Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Mon 26/06/2006 16:13:52

Title: How to make a general variable?
Post by: on Mon 26/06/2006 16:13:52
Question: I'm trying to make my own adventure game, however, i would like to make a string that keeps counting in all rooms and to which i can add or subtract points from (eg. with ++). where should i put this string and how can i acces it inside every room.

thanks,
Mounty
Title: Re: How to make a general variable?
Post by: Ashen on Mon 26/06/2006 16:17:40
BFAQ: Working with variables, the basics (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Working_with_variables:_the_basics)

What you actually want is an int - strings are for words, not numbers. Also, if you're using version 2.7 or earlier, note that strings can't be made global, use the Get/SetGlobalString commands instead. (In v27.1 there's the Game.GlobalStrings (http://www.adventuregamestudio.co.uk/manual/Game.GlobalStrings.htm) property, but Strings can also be imported/exported.)