| View previous topic :: View next topic |
| Author |
Message |
randomguy9900
Joined: 27 Aug 2008 Posts: 3
Digg It |
Posted: Thu Aug 28, 2008 1:00 pm Post subject: What does var do? |
|
|
| How do you use the var. thing? I've always wondered what it does and how you use it. And also can you make it so if you press something, something stays on? instead of only if you hold it? And one more thing, is there a place with a bunch of tutorials about stuff like that and how to use it? |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Mon Oct 27, 2008 2:12 pm Post subject: var thing? |
|
|
don't know if you had a reply yet
var is a memory location where a user can store a value, which is dynamic and therefore 'variable'
var.foo=false
if wiimote.2=true then
var.foo=true else var.foo=false
debug=var.foo
endif
Q. when is var.foo true?
check out the documentation for tips and definitions; also run some of the bundled scripts, mess with them, break them, fix them....
it's the only way (besides this excellent forum)
Brendan |
|
| Back to top |
|
 |
MoreDread
Joined: 30 Oct 2008 Posts: 17
Digg It |
Posted: Fri Oct 31, 2008 1:07 pm Post subject: |
|
|
if you wanna use it to make a key stay pressed you can do it like this
| Code: |
if wiimote.A
if var.Apressed = false
var.Apressed = true
endif
endif
if var.Apressed = true && wiimote.B
var.Apressed = false
endif
key.up = var.Apressed
debug = "var = " + var.Apressed |
this code will toggle the up key on by pressing the A.Button and off with the B button |
|
| Back to top |
|
 |
|