| View previous topic :: View next topic |
| Author |
Message |
rednano12
Joined: 07 Jul 2008 Posts: 5
Digg It |
Posted: 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 |
|
 |
AlMightyBob
Joined: 24 May 2008 Posts: 11
Digg It |
Posted: 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 |
|
 |
rednano12
Joined: 07 Jul 2008 Posts: 5
Digg It |
Posted: 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...  |
|
| Back to top |
|
 |
wii_128

Joined: 07 Jul 2008 Posts: 61
Digg It |
Posted: 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 |
|
 |
Sarabialberto
Joined: 10 Jul 2008 Posts: 5
Digg It |
Posted: Thu Jul 10, 2008 1:10 am Post subject: |
|
|
Try this .
| 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
P.S.: If you have any questions about the script, tell me ^^. |
|
| Back to top |
|
 |
rednano12
Joined: 07 Jul 2008 Posts: 5
Digg It |
Posted: Thu Jul 10, 2008 3:38 am Post subject: |
|
|
| I love you all! Thank you so much! |
|
| Back to top |
|
 |
wii_128

Joined: 07 Jul 2008 Posts: 61
Digg It |
Posted: 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 |
|
 |
|