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 

WiiWars, Using your wiimote as a Lightsaber in a game
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
JoCliMe



Joined: 15 Dec 2006
Posts: 16
Location: El Centro, CA

Digg It
PostPosted: Mon Dec 25, 2006 12:26 am    Post subject: WiiWars, Using your wiimote as a Lightsaber in a game

I did a script that allows me to play Star Wars Jedi Knight: Jedi Academy with my wiimote. The main fun comes from swinging the wiimote down in order to swing the lightsaber. The first half of the video is using only the wiimote, and the second part is using the nunchuk as well. The video is available at www.youtube.com/watch?v=fpHcgkXp_4w (brackets removed by deceased)
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Mon Dec 25, 2006 12:32 am    Post subject:

do u have the script?
can u plz post it here
Back to top
View user's profile Send private message
JoCliMe



Joined: 15 Dec 2006
Posts: 16
Location: El Centro, CA

Digg It
PostPosted: Mon Dec 25, 2006 12:44 am    Post subject:

Edit: Force previous and next need to be mapped to the k/l buttons, and now the up and down control the look up and down, while the left/right control the force push/pull. Also I put a little more comments for instructions in the code.
Code:
//               **Coded by JoCliMe**
//       **WiiWars: SW JediKnight: Jedi Academy**

//Calibration:
//Change these values until the debug line says all zeros when the wiimote is at rest.
var.trimx = 9
var.trimy = -31
var.trimz = 11
var.xOffset = 8
var.yOffset = -37
var.zOffset = 12

var.xRot = Wiimote.RawForceX + var.xOffset
var.yRot = Wiimote.RawForceY + var.yOffset
var.zRot = Wiimote.RawForceZ + var.zOffset

// Debug
debug = "X=" + var.xRot + "   Y=" + var.yRot + "   Z=" + var.zRot

//Flick downward = Left mouse click (Saber)
if var.yRot> 30 then
mouse.leftbutton=true
wiimote.rumble=1
else
mouse.leftbutton=false
wiimote.rumble=false
end if

//Movement
if Wiimote.Nunchuk.JoyX > 0.2 {
   D = True
   wait 5 ms
   D = False
   }
if Wiimote.Nunchuk.JoyX < -0.2 {
   A = True
   wait 5 ms
   A = False
   }
if Wiimote.Nunchuk.JoyY > 0.2 {
   S = True
   wait 5 ms
   S = False
   }
if Wiimote.Nunchuk.JoyY < -0.2 {
   W = True
   wait 5 ms
   W = False
   }


//Interaction
mouse.rightbutton = wiimote.B    //Throw Saber
K = wiimote.minus                //Cycle Force Previous
L = wiimote.plus                 //Cycle Force Forward
F = wiimote.Home                 //Use Force
enter = wiimote.A                //Use
mouse.middlebutton = wiimote.Two //Cycle Saber Strengths
one = wiimote.one                //Power Up/Down saber
C = Wiimote.Nunchuk.CButton      //Crouch (hold)
Space = Wiimote.Nunchuk.ZButton  //Jump
f1 = wiimote.left                //Force Push
f2 = wiimote.right               //Force Pull


//Menu  (esc)
if Wiimote.Two && wiimote.Plus
esc = true
else
esc = false
end if

//Accel Movement
var.x = Wiimote.RawForceX + var.trimx //trim to 0
var.y = Wiimote.RawForceY + var.trimy // trim to 0
var.z = Wiimote.RawForceZ + var.trimz //trim to 0

//precision
var.sense0 = 500
var.thresh0x = 5
var.thresh0y = 2

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

var.sense2 = 100
var.thresh2x = 15
var.thresh2y = 8

var.sense3 = 50
var.thresh3x = 20
var.thresh3y = 12

//Turning Left/Right
if var.x > var.thresh0x
mouse.x = mouse.x - 20/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 20/var.sense0
endif

//Look Up/Down
pgup = wiimote.Up
pgdn = wiimote.Down









Last edited by JoCliMe on Wed Dec 27, 2006 1:39 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
CarlKenner
Site Admin


Joined: 29 Nov 2006
Posts: 614

Digg It
PostPosted: Mon Dec 25, 2006 1:13 pm    Post subject:

Argh! More RawForces! Smile

You don't have to use all this manually calibrated script stuff. The RawForce values are only there for backwards compatability.

Use gx, gy, and gz, which are mapped to the range 0 = no force, 1= gravity, 2.5 = 2 and a half times the force of gravity, etc.

In this script you could replace the offending lines with this:

var.xRot = Wiimote.gx * 30
var.yRot = Wiimote.gy * 30 - 30
var.zRot = Wiimote.gz * 30

And remove the var.trimx, var.xOffset stuff.

But great script none the less.
Back to top
View user's profile Send private message Send e-mail
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Mon Dec 25, 2006 3:11 pm    Post subject:

do u think this will work in jedi outcast?
cuz i already beat jedi academy
Back to top
View user's profile Send private message
jedidove



Joined: 23 Dec 2006
Posts: 10

Digg It
PostPosted: Mon Dec 25, 2006 5:35 pm    Post subject:

There use to be a game for xbox called ObiWan where, you guessed it, you played as ObiWan. Anyway, the game used the right analog stick to control the swinging of the lightsaber. Whichever way you moved the analog stick the lightsaber would follow.

I don't know if there's a PC version with similar controls but it would be a cool use of the wiimote if you could map the swinging to the control for the lightsaber in that game.

Another game (little older, though it has a sequel i think) is Ape Escape, originally on playstation. You used the right analog stick to control a net which you caught monkeys with (fun game actually). It was a pretty big deal when it came out since it was one of the first games to take full advantage of the analog sticks.

The response on both of these games was good and I personally think they would be very fun to control with the wiimote. Smile
Back to top
View user's profile Send private message
JoCliMe



Joined: 15 Dec 2006
Posts: 16
Location: El Centro, CA

Digg It
PostPosted: Mon Dec 25, 2006 6:21 pm    Post subject:

kunalkunal2 wrote:
do u think this will work in jedi outcast?
cuz i already beat jedi academy

See, since Jedi Academy was mainly a lightsaber game, while Jedi Outcast was more of a shooter (imo) it might not work as well. The controls that I have now do not look up and down, only left and right. But I think I remember the controls being the same, if not just remap them and it should work.
And I've already beat Jedi Academy a few times as well, but it's still more fun using the wiimote!
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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