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 

The Ultimate STAR WARS JEDI 2 KNIGHT SCRIPT!!

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



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Sun Feb 04, 2007 12:05 am    Post subject: The Ultimate STAR WARS JEDI 2 KNIGHT SCRIPT!!

Well, after seeing the Kotor 2 video, I decided to make something simalar to that only doing something like that in JEDI KNIGHT 2
So here is my ultimate jedi knight 2 script with actual force power!!!
Feel like a jedi
and may the Force be with you.
-Kunal


Code:
//               **BY KunalKunal2*
//   ** STAR WARS LIGHTSABER AND FORCE POWER SCRIPT *
//         ** Use With A Jedi Knight Game**
//About this script
//What Makes this Script so special is that you use actual movements
//actual Force Power, and actual LightSaber Feeling
//Just like a real JEDI

//Controls:
//To Activate LightSaber Hold B to see left and right
//To choke the the grip roll nunchuk to the left
//To use lighting swing wiimote down
//to pull, swing up.
//To Throw LightSaber hold A and throw lightsaber just as in the game
//Rest of the Controls listed in the rest of the Script
//WARNING: Do not get to excited other wise force power do not work
//Credit: Thx to the Mienaikage's WiinSaber v1.1 for actual feeling
//And thx to the orginal Coder JoCiMe for looking left, right.





//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
var.nunchuk.yrot = wiimote.nunchuk.rawforcey + var.yoffset

// 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
 //Throw Saber
mouse.rightbutton and wiimote.Rumble =wiimote.A and  (wiimote.RawForceX >= 15)

//Pull towards you
f2 and wiimote.rumble = Wiimote.nunchuk.smoothPitch > 40 degrees
//Lighting
f7 and wiimote.rumble= Wiimote.nunchuk.smoothPitch < -40 degrees

f = wiimote.Home                 //use Selected Force
ctrl = wiimote.A                 //open doors
pgup = wiimote.Up                //Look Up
pgdn = wiimote.down              //look down
left = wiimote.left              //look left
right = wiimote.right            //look right
space = wiimote.nunchuk.zbutton  //Jump
c = wiimote.nunchuk.cbutton     //Crouch
p = wiimote.One                 //First Person View/3rd Person
esc = wiimote.Two               //esc
x = wiimote.Plus                //Cycle Forse
z = wiimote.minus               //Cycle Force


//Choke
f6 =  Wiimote.nunchuk.smoothroll < -40 degrees



//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




if var.x > var.thresh0x and wiimote.b
mouse.x = mouse.x - 20/var.sense0
endif
if var.x < -var.thresh0x and wiimote.b
mouse.x = mouse.x + 20/var.sense0
endif

//Mienaikage's WiinSaber v1.1
//Based on the Mac WiiSaber

var.xOffset = 0
var.yOffset = -10
var.zOffset = -10

var.xRot = Wiimote.RawAccX + var.xOffset
var.yRot = Wiimote.RawAccY + var.yOffset
var.zRot = Wiimote.rawforceZ + var.zOffset


Wiimote.leds = 0

if var.rmbl then
   wiimote.Rumble = 1
   wait 1 ms
   wiimote.Rumble = 0
   wait var.time ms
endif

if var.rmbl = false then
debug = "May The Force Be With You"
endif

if var.rmbl = true then
endif

if (wiimote.b) + (var.on = 0) then
playsound("lightsaber sounds\on0.wav")
var.time = 25
var.rmbl = true
wait(1.35s)
var.on = 1
var.soundon = 1
endif

if var.soundon = 1
playsound("lightsaber sounds\idle0.wav")
var.time = 100
wait(452ms)
endif

if wiimote.a + (var.on = 1) then
playsound("lightsaber sounds\off0.wav")
var.on = 0
var.soundon = 0
var.time = 200
wait(0.5s)
var.rmbl= false
endif

if (var.yrot < -30) + (var.on = 1) + (wiimote.b = 0) + (wiimote.down = 0) then
var.swingy = 1
playsound("lightsaber sounds\swing0.wav")
wait(0.5s)
var.swingy = 0
endif

if (var.xrot > 15) + (var.on = 1) + (wiimote.b = 0) + (wiimote.down = 0) then
var.swingx = 1
playsound("lightsaber sounds\swing1.wav")
wait(0.64s)
var.swingx = 0
endif

if (var.zrot > 20) + (var.on = 1) + (wiimote.b = 0) + (wiimote.down = 0) then
var.swingz = 1
playsound("lightsaber sounds\swing7.wav")
wait(0.53s)
var.swingz = 0
endif

if (var.yrot > 32) + (var.on = 1) + (wiimote.b = 0) + (wiimote.down = 0) then
var.swingminusy = 1
playsound("lightsaber sounds\swing2.wav")
wait(0.85s)
var.swingminusy = 0
endif

if (var.xrot < -15) + (var.on = 1) + (wiimote.b = 0) + (wiimote.down = 0) then
var.swingminusx = 1
playsound("lightsaber sounds\swing5.wav")
wait(0.64s)
var.swingminusx = 0
endif



if (var.yrot > 32) + (var.on = 1) + (wiimote.b = 1) then
playsound("lightsaber sounds\strike0.wav")
var.strikey = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.38s)
var.strikey = 0
endif

if (var.xrot > 15) + (var.on = 1) + (wiimote.b = 1) then
playsound("lightsaber sounds\strike1.wav")
var.strikex = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.23s)
var.strikex = 0
endif

if (var.zrot > 20) + (var.on = 1) + (wiimote.b = 1) then
playsound("lightsaber sounds\strike2.wav")
var.strikez = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.27s)
var.strikez = 0
endif

if (var.yrot < -30) + (var.on = 1) + (wiimote.b = 1) then
playsound("lightsaber sounds\strike0.wav")
var.strikeminusy = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.38s)
var.strikeminusy = 0
endif

if (var.xrot < -15) + (var.on = 1) + (wiimote.b = 1) then
playsound("lightsaber sounds\strike1.wav")
var.strikeminusx = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.23s)
var.strikeminusx = 0
endif



if (var.yrot < -30) + (var.on = 1) + (wiimote.down = 1) then
playsound("lightsaber sounds\hit0.wav")
var.hity = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(1.25s)
var.hity = 0
endif

if (var.xrot > 15) + (var.on = 1) + (wiimote.down = 1) then
playsound("lightsaber sounds\hit3.wav")
var.hitx = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.45s)
var.hitx = 0
endif

if (var.zrot > 20) + (var.on = 1) + (wiimote.down = 1) then
playsound("lightsaber sounds\hit1.wav")
var.hitz = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.8s)
var.hitz = 0
endif

if (var.yrot > 32) + (var.on = 1) + (wiimote.down = 1) then
playsound("lightsaber sounds\hit2.wav")
var.hitminusy = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(1.25s)
var.hitminusy = 0
endif

if (var.xrot < -15) + (var.on = 1) + (wiimote.down = 1) then
playsound("lightsaber sounds\hit4.wav")
var.hitminusx = 1
var.time = 0
Wiimote.Leds = 15
wait(0.3s)
var.time = 50
wait(0.45s)
var.hitminusx = 0
endif



if (var.swingy or var.swingx or var.swingz or var.strikey or var.strikex or var.strikez or var.hity or var.hitx or var.hitz or var.swingminusy or var.swingminusx or var.strikeminusy or var.strikeminusx or var.hitminusy or var.hitminusx) = 1 then
var.soundon = 0
else if var.on = 1
var.soundon = 1
endif

_________________
Check out my collection of my wii script's
freewebs.com/kunalkunal2
Back to top
View user's profile Send private message
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Sun Feb 04, 2007 12:06 am    Post subject:

Also can someone make a YouTube Vid showing the game play on this
Thanks
-Kunal
_________________
Check out my collection of my wii script's
freewebs.com/kunalkunal2


Last edited by kunalkunal2 on Mon Apr 16, 2007 12:47 am; edited 1 time in total
Back to top
View user's profile Send private message
JoCliMe



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

Digg It
PostPosted: Tue Feb 06, 2007 1:41 am    Post subject:

Looks cool, man. I thought about trying something like this after seeing that video, but couldn't find the time. Good job.
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: Tue Feb 06, 2007 9:46 pm    Post subject:

JoCliMe wrote:
Looks cool, man. I thought about trying something like this after seeing that video, but couldn't find the time. Good job.

What Video?
And thanks for the comments man
Any more comments will be appericiate:D
_________________
Check out my collection of my wii script's
freewebs.com/kunalkunal2
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