WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pefect Dark Script (needs sensitivity adjustment)

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
TheDro



Joined: 10 Feb 2008
Posts: 39
Location: Canada

Digg It
PostPosted: Thu Apr 17, 2008 7:44 pm    Post subject: Pefect Dark Script (needs sensitivity adjustment)

Here's a script I've been working on and the biggest problem I have is with the sensitivity. In the game I use control style 1.2 which means the "analog stick" controls the aiming and the "c-buttons" control strafing and moving forward and backward. As you can see below, I used a square root to up the sensitivity in the middle and make it less sensitive as the values are further from zero. The x axis sensitivity seems good but the y axis sensitivity is still difficult to get used to. I was also thinking of using the pitch for the y axis instead of the IR but I haven't tried it yet. If anyone has any ideas on how to adjust the sensitivity, please let me know. btw, I didn't use any fancy comments and stuff yet so it's purely functional so far.
Code:
// TheDro's Perfect Dark Script
wiimote1.Led1 = wiimote1.PluggedIn
PPJoy1.Digital0 = wiimote1.A
PPJoy1.Digital1 = wiimote1.B
PPJoy1.Digital2 = wiimote1.Minus
PPJoy1.Digital3 = wiimote1.Home
PPJoy1.Digital4 = wiimote1.Plus
PPJoy1.Digital5 = wiimote1.One
PPJoy1.Digital6 = wiimote1.Two
PPJoy1.Digital7 = wiimote1.Nunchuk.CButton
PPJoy1.Digital8 = wiimote1.Nunchuk.ZButton
PPJoy1.Digital16 = wiimote1.Left
PPJoy1.Digital17 = wiimote1.Down
PPJoy1.Digital18 = wiimote1.Up
PPJoy1.Digital19 = wiimote1.Right

if (wiimote1.B = 1) and (wiimote1.dot1vis=1 or wiimote1.dot2vis=1) {
   PPJoy1.Analog0 = maprange((wiimote1.dot1x+wiimote1.dot2x), 0, 2046, 1,-1)
   PPJoy1.Analog1 = maprange((wiimote1.dot1y+wiimote1.dot2y), 0, 1534, -1,1)
   elseif (wiimote1.B = 0) and (wiimote1.dot1vis=1 or wiimote1.dot2vis=1)
   PPJoy1.Analog0 = var.irx
   PPJoy1.Analog1 = var.iry
   elseif wiimote1.dot1vis=0 and wiimote1.dot2vis=0
   PPJoy1.Analog0 = 0
   PPJoy1.Analog1 = 0
   }
if (wiimote1.dot1x+wiimote1.dot2x) >= 1024
   var.irx = -(((wiimote1.dot1x+wiimote1.dot2x-1024)/1024)^(1/2))
   elseif (wiimote1.dot1x+wiimote1.dot2x) < 1024
   var.irx = (((-wiimote1.dot1x-wiimote1.dot2x+1024)/1024)^(1/2))
   }
if (wiimote1.dot1y+wiimote1.dot2y) >= 768
   var.iry = 0.6*((wiimote1.dot1y+wiimote1.dot2y-768)/768)^(1/2)
   elseif (wiimote1.dot1y+wiimote1.dot2y) < 768
   var.iry = -0.6*(((-wiimote1.dot1y-wiimote1.dot2y+768)/768)^(1/2))
   }

PPJoy1.Digital10 = (wiimote1.Nunchuk.JoyX < -0.35)
PPJoy1.Digital11 = (wiimote1.Nunchuk.JoyY > 0.35)
PPJoy1.Digital12 = (wiimote1.Nunchuk.JoyY < -0.35)
PPJoy1.Digital13 = (wiimote1.Nunchuk.JoyX > 0.35)

Back to top
View user's profile Send private message
CarlKenner
Site Admin


Joined: 29 Nov 2006
Posts: 614

Digg It
PostPosted: Sat Apr 19, 2008 1:58 am    Post subject:

If you are using GlovePIE 0.30, I recommend using PointerX, PointerY, and PointerVisible instead of the dot1x etc.

It took me a while to see the square root. Then I remembered x^(1/2) is the same as sqrt(x). Smile
Back to top
View user's profile Send private message Send e-mail
TheDro



Joined: 10 Feb 2008
Posts: 39
Location: Canada

Digg It
PostPosted: Mon Apr 21, 2008 11:02 pm    Post subject:

I was actually having some problems with version 0.30 (I forget what exactly it was but I think it had to do with using the IR and the nunchuk at the same time) so I've been using 0.29 instead which is just as good for my use.

Great program btw. Very Happy It's really appreciated.

Back to the main topic, has anybody figured out how to improve the sensitivity for perfect dark (or maybe goldeneye since they are similar)?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group