Resetting all variables

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Resetting all variables

Postby Imari » Fri Mar 06, 2009 4:02 pm

A while back, GM was going to make a variable to reset all variables at the start of a game. Does anyone happen to know if he did this or not? I don't see that option under the VBS language reference?
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Lyberodoggy » Sun Mar 08, 2009 12:19 am

Code: Select all
'initialize Global Integers
For i = 1 To WindowObject.Variables.Count
WindowObject.Variables.Item(i).Value=0
Next
'initialize Global Variants
For i = 1 To WindowObject.VariablesVariant.Count
WindowObject.VariablesVariant.Item(i).Value=""
Next



This should do...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Imari » Mon Mar 09, 2009 2:50 am

Thanks, Lyberodoggy! It works perfectly.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby sugawara » Thu Mar 26, 2009 6:30 am

Does this go in the global procedures? or is this for a hotspot?

and the variable in this script is... " i " ?

thanks!
sugawara
Active Member
 
Posts: 90
Joined: Sat Oct 28, 2006 4:25 am

Postby Lyberodoggy » Thu Mar 26, 2009 2:24 pm

A hotspot could do.

Yes the variable is i, but you shouldn't declare it, it's a local variable that will be deleted as soon as the script execution stops
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby sugawara » Thu Mar 26, 2009 10:37 pm

hmm im a bit confused, shouldnt declare it? what do you mean?
now that i know i is the variable i can create an integer variable and then plug the variable name in when i put the script in the hotspot?
sugawara
Active Member
 
Posts: 90
Joined: Sat Oct 28, 2006 4:25 am

Postby mercedes » Thu Mar 26, 2009 10:55 pm

Hi Sugawara..:D

The variable 'i' is a local variable declared in the statement,.....therefore no need to make an integer variable...The statement alone is all you need..


Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests