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 

One stupidly small question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
The Tjalian



Joined: 14 Dec 2006
Posts: 31
Location: England

Digg It
PostPosted: Wed Dec 20, 2006 9:24 pm    Post subject: One stupidly small question

I can't believe I'm asking this, being a programmer and all, but how do you create variables using GlovePIE? It's just I need to make one for this script I'm using but I don't even know how to bloody declare one Sad

Many thanks in advance.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
reik85



Joined: 14 Dec 2006
Posts: 18
Location: OKC, OK

Digg It
PostPosted: Wed Dec 20, 2006 9:48 pm    Post subject:

Just add a good ol' "var." , add the name and what it is equal to. For example: var.xOffset = -7

Very Happy Tis that simple. I do believe it's not case sensitive. There's a whole thread of scripts in the WiiMote and Nunchuk section of the forums.
Back to top
View user's profile Send private message
deceased
Site Admin


Joined: 11 Dec 2006
Posts: 287
Location: Aurora, ON

Digg It
PostPosted: Wed Dec 20, 2006 10:57 pm    Post subject:

Also, you don't need to declare the variables. They are created the first time they're used and set to false (0) by default.

However, if you want to make declarations use this

Code:

if not var.declared then
   var.declared = true
   // initiate all the variables you want here
   var.x = 1
   var.y = 20
endif

_________________
-deceased-

Wiili - a gnu revolution
Back to top
View user's profile Send private message
The Tjalian



Joined: 14 Dec 2006
Posts: 31
Location: England

Digg It
PostPosted: Wed Dec 20, 2006 11:34 pm    Post subject:

Oh, it's not that I specifically want to declare variables, I just thought that was the way things were done Razz

One more Q, when doing an if statement, is it asking is a button is pressed or a button is held?
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
deceased
Site Admin


Joined: 11 Dec 2006
Posts: 287
Location: Aurora, ON

Digg It
PostPosted: Thu Dec 21, 2006 12:05 am    Post subject:

Press, but it's easier to map a button like this

Code:
X = wiimote.A


So, every time you hit A on the Wiimote, it's like X is being pressed on the keyboard.

Or you can write...

Code:

if wiimote.A then
   X = true
   wait 10 ms
   X = false
endif


This should make it like you're pressing A on the Wiimote over and over. (I think, can't test it, but you can Wink.)
_________________
-deceased-

Wiili - a gnu revolution
Back to top
View user's profile Send private message
The Tjalian



Joined: 14 Dec 2006
Posts: 31
Location: England

Digg It
PostPosted: Thu Dec 21, 2006 12:35 am    Post subject:

Oh no, I actually WANT it to act like it's being pressed, not held XD

If it was being held, it'd totally ruin my plans Razz
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
deceased
Site Admin


Joined: 11 Dec 2006
Posts: 287
Location: Aurora, ON

Digg It
PostPosted: Thu Dec 21, 2006 12:39 am    Post subject:

Still, try out the code above and see what works for you.
_________________
-deceased-

Wiili - a gnu revolution
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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