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 

WiinSaber (current version: v1.1)
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
Mienaikage



Joined: 13 Dec 2006
Posts: 54
Location: London, UK

Digg It
PostPosted: 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 Razz

EDIT2: Done Very Happy 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
View user's profile Send private message Visit poster's website
Mienaikage



Joined: 13 Dec 2006
Posts: 54
Location: London, UK

Digg It
PostPosted: 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 Smile

Controls:

B to start
Hold B or down on the D-pad to change sound effects
Press A to stop
Back to top
View user's profile Send private message Visit poster's website
tuxido
Site Admin


Joined: 05 Nov 2006
Posts: 150

Digg It
PostPosted: 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
View user's profile Send private message
Mienaikage



Joined: 13 Dec 2006
Posts: 54
Location: London, UK

Digg It
PostPosted: 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
View user's profile Send private message Visit poster's website
Mienaikage



Joined: 13 Dec 2006
Posts: 54
Location: London, UK

Digg It
PostPosted: 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
View user's profile Send private message Visit poster's website
US of Anarchy



Joined: 13 Dec 2006
Posts: 41

Digg It
PostPosted: Thu Dec 14, 2006 2:55 am    Post subject:

Darn! You beat me to it! See mine here:
http://www.wiili.org/forum/graphpie-wii-mote-scripts-t360-s15.html#3102

Good job for a first effort, but I think I've got you beat.
Back to top
View user's profile Send private message Send e-mail
Mienaikage



Joined: 13 Dec 2006
Posts: 54
Location: London, UK

Digg It
PostPosted: Thu Dec 14, 2006 3:23 am    Post subject:

Yours is good, but I think I like mine better Razz
Back to top
View user's profile Send private message Visit poster's website
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, 4  Next
Page 1 of 4

 
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