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 

FPS script !! great for F.E.A.R. CoD2, etc etc...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Remote and Nunchuck
View previous topic :: View next topic  
Author Message
rmanqueros



Joined: 02 Feb 2007
Posts: 9

Digg It
PostPosted: Fri Feb 02, 2007 9:00 pm    Post subject: FPS script !! great for F.E.A.R. CoD2, etc etc...

this is my script, all done by my except the 'old style' mouse movement but that's only if you dont use IR leds. its very easy to configure, just set the presicion values to your preference and you're done.
for fear use the directinput one.
Code:

// all done by me, except the "old style input".

wiimote.Led1=true;

var.ConDirectInput=false; // true=with directInput, False=without directInput
var.ConIR=true;  // true = with IR leds, false = without them
var.presicion=5; // presicion when using IR only
var.presicionDI=80; // presicion when using IR + DirectInput

w = Wiimote.Nunchuk.JoyY < -0.5
a = Wiimote.Nunchuk.JoyX < -0.5
s = Wiimote.Nunchuk.JoyY > 0.5
d = Wiimote.Nunchuk.JoyX > 0.5

mouse.WheelUp=wiimote.One;
mouse.WheelDown=wiimote.Two;
mouse.LeftButton=wiimote.B;
mouse.RightButton=wiimote.A;
keyboard.F=wiimote.one;

keyboard.Space=(wiimote.Nunchuk.ZButton)and(wiimote.nunchuk.rawforcey>100);
keyboard.G=(wiimote.Down)and(wiimote.nunchuk.rawforceY<-1.6);
keyboard.4=(wiimote.Right)and(wiimote.nunchuk.rawforceY<-1.6);
keyboard.r=wiimote.Home;
LeftControl=wiimote.Nunchuk.CButton;
leftShift=wiimote.Plus;

if(var.ConIR)then
    var.movX=20;

    var.movMinX=2;
    var.movMinY=2;

    var.movMinXDi=1;
    var.movMinYDi=1;

    var.posX=round((screen.Width*(1-(wiimote.dot2x/1024)))-var.movX);
    var.posY=round(screen.Height*(wiimote.dot2y/768))-20;

    if(var.ConDirectInput)then
        var.MouseDxPosX=mouse.DirectInputX;
        var.MouseDxPosY=mouse.DirectInputY;

        var.incX=(var.posX-var.MouseDxPosX)/var.presicionDi;
        var.incY=(var.posY-var.MouseDxPosY)/var.presicionDi;

        if((var.incX>var.movMinXDI)or(var.incX<-var.movMinXDI)) then
            Mouse.DirectInputX=mouse.DirectInputX+var.incX;
        endif
        if((var.incY>var.movMinYDI)or(var.incY<-var.movMinYDI)) then
            Mouse.DirectInputY=mouse.DirectInputY+var.incY;
        endif
        debug="Mouse input with DirectInput and IR";
    else

        var.incX=(var.posX-mouse.CursorPosX)/var.presicion;
        var.incY=(var.posY-mouse.CursorPosY)/var.presicion;

        if((var.incX>var.movMinX)or(var.incX<-var.movMinX)) then
            mouse.CursorPosX=mouse.CursorPosX+var.incX;
        endif
        if((var.incY>var.movMinY)or(var.incY<-var.movMinY)) then
            mouse.CursorPosY=mouse.CursorPosY+var.incY;
        endif
        debug="Normal Mouse input with IR";
    endif
else
    var.x = Wiimote.RawForceX +12
    var.y = Wiimote.RawForceY -37
    var.z = Wiimote.RawForceZ +11

    var.sense0 = 700
    var.thresh0x = 3.5;
    var.thresh0y = 2;

    var.sense = 300
    var.threshx = 10
    var.threshy = 8

    var.sense2 = 200
    var.thresh2x = 15
    var.thresh2y = 15

    var.sense3 = 60
    var.thresh3x = 20
    var.thresh3y = 20

    if var.x > var.thresh0x
    mouse.x = mouse.x - 1/var.sense0
    endif
    if var.x < -var.thresh0x
    mouse.x = mouse.x + 1/var.sense0
    endif

    if var.z > var.thresh0y
    mouse.y = mouse.y - 1/var.sense0
    endif
    if var.z < -var.thresh0y
    mouse.y = mouse.y + 1/(6*var.sense0)
    endif

    if var.x > var.threshx
    mouse.x = mouse.x - 1/var.sense
    endif
    if var.x < -var.threshx
    mouse.x = mouse.x + 1/var.sense
    endif

    if var.z > var.threshy
    mouse.y = mouse.y - 1/var.sense
    endif
    if var.z < -var.threshy
    mouse.y = mouse.y + 1/(var.sense)
    endif

    if var.x > var.thresh2x
    mouse.x = mouse.x - 1/var.sense2
    endif
    if var.x < -var.thresh2x
    mouse.x = mouse.x + 1/var.sense2
    endif

    if var.z > var.thresh2y
    mouse.y = mouse.y - 1/var.sense2
    endif
    if var.z < -var.thresh2y
    mouse.y = mouse.y + 1/var.sense2
    endif

    if var.x > var.thresh3x
    mouse.x = mouse.x - 1/var.sense3
    endif
    if var.x < -var.thresh3x
    mouse.x = mouse.x + 1/var.sense3
    endif

    if var.z > var.thresh3y
    mouse.y = mouse.y - 1/var.sense3
    endif
    if var.z < -var.thresh3y
    mouse.y = mouse.y + 1/var.sense3
    endif
    debug="old style mouse input without IR";
endif


questions or anything send me an email.
Back to top
View user's profile Send private message Send e-mail
Vaughan14



Joined: 28 Jan 2007
Posts: 32
Location: Australia

Digg It
PostPosted: Wed Feb 28, 2007 8:02 am    Post subject:

WOW! I just tested out your IR Script and its almost flawless, you should really post a topic about your IR Script!
_________________
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Bubba Gump



Joined: 13 Feb 2007
Posts: 23

Digg It
PostPosted: Wed Feb 28, 2007 1:02 pm    Post subject:

If that script that you have posted isn't IR, you really should post one with IR. I have been looking forever for a good IR script. Please post it.
_________________
Wiidelin away..
Back to top
View user's profile Send private message
rmanqueros



Joined: 02 Feb 2007
Posts: 9

Digg It
PostPosted: Wed Feb 28, 2007 4:56 pm    Post subject:

this scripts works for almost all metods, you just have to change the following to suite your needs:
var.ConIR=true; // if you are using an IR bar
var.ConIR=false; // if you are not using an IR bar

var.ConDirectInput=true; // if using an IR bar select this for some games to work
var.ConDirectInput=false; // else use this one
Back to top
View user's profile Send private message Send e-mail
Vaughan14



Joined: 28 Jan 2007
Posts: 32
Location: Australia

Digg It
PostPosted: Thu Mar 01, 2007 5:32 am    Post subject:

Yes I worked that out and once i changed it to direct input it wasn't the same...

Oh well maybe you could work on it. Also how should i go about changing the script because my screen resolution is 1280x800. Because i have had a shot at it myself, this is what the script was:

Code:


    var.posX=round((screen.Width*(1-(wiimote.dot2x/1024)))-var.movX);
    var.posY=round(screen.Height*(wiimote.dot2y/768))-20;



and i changed it to:

Code:


    var.posX=round((screen.Width*(1-(wiimote.dot2x/1280)))-var.movX);
    var.posY=round(screen.Height*(wiimote.dot2y/800))-20;



but it ended up making the screen area that the mouse moves on smaller, if you catch my drift?
_________________
Back to top
View user's profile Send private message Send e-mail MSN Messenger
rmanqueros



Joined: 02 Feb 2007
Posts: 9

Digg It
PostPosted: Thu Mar 01, 2007 6:14 am    Post subject:

change this:
Code:

var.posY=round(screen.Height*(wiimote.dot2y/768))-20;

to this:
Code:

var.posY=round(screen.Height*(wiimote.dot2y/640))-20;


in fact with normal resolution's it's supposed to work correctly without changing that, but you seem to use a widescreen, btw, this modification will work for any widescreen res ( i hope .. Razz ).
the directinput option is to make it work with fear, the rest of the games seem to work correctly without it.[/code]
Back to top
View user's profile Send private message Send e-mail
Vaughan14



Joined: 28 Jan 2007
Posts: 32
Location: Australia

Digg It
PostPosted: Thu Mar 01, 2007 7:42 am    Post subject:

Thanks, i used the script in Fear and Halo and both needed direct input =(..

I will try that screen resolution soon and post back.
_________________
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Remote and Nunchuck All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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