| View previous topic :: View next topic |
| Author |
Message |
Mienaikage
Joined: 13 Dec 2006 Posts: 54 Location: London, UK
Digg It |
Posted: Wed Dec 13, 2006 1:00 pm Post subject: WiinSaber (current version: v1.1) |
|
|
I'm trying to do one myself, I have all the sound effects, but I've never used GlovePIE to script before so it would take me quite a while.
| Code: | //Mienaikage's WiinSaber v1.1
//Based on the Mac WiiSaber
//Get all the files you need at http://rapidshare.com/files/7731954/WiinSaber_v1.1.rar.html
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 = "Press B to turn on your WiinSaber"
endif
if var.rmbl = true then
debug = "Swing. Hold B or Down to change sound effects. Press A to stop."
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 |
That's what I've written just now, I'm having a bit of trouble writing a script to switch it off though...
EDIT: So far so good, now to get some swings in
EDIT2: Done Get everything here:
http://rapidshare.com/files/7731954/WiinSaber_v1.1.rar.html
Last edited by Mienaikage on Sat Dec 16, 2006 3:03 pm; edited 15 times in total |
|
| Back to top |
|
 |
Mienaikage
Joined: 13 Dec 2006 Posts: 54 Location: London, UK
Digg It |
Posted: Wed Dec 13, 2006 10:46 pm Post subject: |
|
|
I didn't feel like waiting for someone to make a script, so I wrote one myself. Enjoy everyone
Controls:
B to start
Hold B or down on the D-pad to change sound effects
Press A to stop |
|
| Back to top |
|
 |
tuxido Site Admin

Joined: 05 Nov 2006 Posts: 150
Digg It |
Posted: Wed Dec 13, 2006 11:05 pm Post subject: |
|
|
| Can you please make a youtube video and post it on the Wiki? <youtube>123abc</youtube> |
|
| Back to top |
|
 |
Mienaikage
Joined: 13 Dec 2006 Posts: 54 Location: London, UK
Digg It |
Posted: Wed Dec 13, 2006 11:15 pm Post subject: |
|
|
| tuxido wrote: | | Can you please make a youtube video and post it on the Wiki? <youtube>123abc</youtube> |
Sorry I'm not actually at home at the moment, I'll make a video as soon as I'm back.
P.S. I tweaked the script a bit, make sure you update the file you get in the RAR |
|
| Back to top |
|
 |
Mienaikage
Joined: 13 Dec 2006 Posts: 54 Location: London, UK
Digg It |
Posted: Thu Dec 14, 2006 1:49 am Post subject: |
|
|
Upgraded to v0.5
Added some extra rumble features to the striking swings
EDIT: Upgraded to v0.5.1, edited the rumble slightly |
|
| Back to top |
|
 |
US of Anarchy

Joined: 13 Dec 2006 Posts: 41
Digg It |
|
| Back to top |
|
 |
Mienaikage
Joined: 13 Dec 2006 Posts: 54 Location: London, UK
Digg It |
Posted: Thu Dec 14, 2006 3:23 am Post subject: |
|
|
Yours is good, but I think I like mine better  |
|
| Back to top |
|
 |
|