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 

Scripting help!

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
rednano12



Joined: 07 Jul 2008
Posts: 5

Digg It
PostPosted: Mon Jul 07, 2008 9:15 pm    Post subject: Scripting help!

Hi everybody!

I was attempting to do edit the OoT Twilight Princess controls and I added this code:



Code:
if Wiimote.Left pressed then
   var.item = 0
endif

if Wiimote.Right pressed then
   var.item = 1
endif

if Wiimote.Down pressed then
   var.item = 2
endif


For some reason though, when I run the script, the if lines (all 3) are highlighted in red and I get the error "THEN" expected||

Please help!
Back to top
View user's profile Send private message
AlMightyBob



Joined: 24 May 2008
Posts: 11

Digg It
PostPosted: Tue Jul 08, 2008 1:14 pm    Post subject:

I don't think "pressed" by itself is a command.

Try this:
Code:
if Wiimote.Left = 1 then var.item = 0
endif
Back to top
View user's profile Send private message
rednano12



Joined: 07 Jul 2008
Posts: 5

Digg It
PostPosted: Wed Jul 09, 2008 1:10 am    Post subject:

Thank you! Works beautifully.

I am really sorry for being such a noob, but now...

Code:
if Wiimote.Left = 1 then var.item = 0
endif

if Wiimote.Right = 1 then var.item = 1
endif

if Wiimote.Down = 1 then var.item = 2
endif

if var.item = 0 then
   Wiimote.Leds = 1
   Wiimote.B = key.J
endif

if var.item = 1 then
   Wiimote.Leds = 8
   Wiimote.B = key.l
endif

if var.item = 2 then
   Wiimote.Leds = 6
   Wiimote.B = key.k
endif


But the B button isn't working... Sad
Back to top
View user's profile Send private message
wii_128



Joined: 07 Jul 2008
Posts: 61

Digg It
PostPosted: Thu Jul 10, 2008 1:04 am    Post subject:

I'm not sure what's wrong... try using this code, it worked when I wrote my own OoT script:

Code:
if Wiimote.Left = true then
var.item = 0
endif

if Wiimote.Right = true then
var.item = 1
endif

if Wiimote.Down = true then
var.item = 2
endif
if (Wiimote.B = true) and (var.item = 0) then
Key.J = true
endif

if (Wiimote.B = true) and (var.item = 1) then
Key.L = true
endif

if (Wiimote.B = true) and (var.item = 2) then
Key.K = true
endif

if (Wiimote.B = false) then
Key.J = false
Key.L = false
Key.K = false
endif

if var.item = 0 then
   Wiimote.Leds = 1
endif

if var.item = 1 then
   Wiimote.Leds = 8
endif

if var.item = 2 then
   Wiimote.Leds = 6
endif

It's longer than yours, but I'm sure it will work. I can't test it now, though; for some reason GlovePIE won't work on my PC since just 5 minutes ago.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Sarabialberto



Joined: 10 Jul 2008
Posts: 5

Digg It
PostPosted: Thu Jul 10, 2008 1:10 am    Post subject:

Try this Wink.

Code:
if pressed(Wiimote.Left) then
var.item = 0
endif

if pressed(Wiimote.Right) then
var.item = 1
endif

if pressed(Wiimote.Down) then
var.item = 2
endif

if var.item = 0 then
   Wiimote.Leds = 1
   key.J = pressed(Wiimote.B)
endif

if var.item = 1 then
   Wiimote.Leds = 8
   key.l = pressed(Wiimote.B)
endif

if var.item = 2 then
   Wiimote.Leds = 6
   key.k = pressed(Wiimote.B)
endif

debug = "Item Select: "+var.item


Edit: Oh, wii_128 has written a code too..
Use you want, mine works perfectly Wink

P.S.: If you have any questions about the script, tell me ^^.
Back to top
View user's profile Send private message
rednano12



Joined: 07 Jul 2008
Posts: 5

Digg It
PostPosted: Thu Jul 10, 2008 3:38 am    Post subject:

I love you all! Thank you so much!
Back to top
View user's profile Send private message
wii_128



Joined: 07 Jul 2008
Posts: 61

Digg It
PostPosted: Sun Jul 13, 2008 12:21 am    Post subject:

If you need any more help with that Oot script, I could help you. Just say the word!
_________________
Proud member of the .Pie Making Community!

... not like we do much there, anyway. Try to keep us working at http://www.wiili.org/forum/glovepie-script-requests-t3881-s21.html
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 -> GlovePie 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