I've been looking through the manual but I really can't get my head around the various variables there are and what they do.
Could somebody please give me a quick lesson on the different types?
Specifically, I'm wondering about:
Variables
Global Variables
Graphical Variables
Arrays
Of these, which can be declared/accessed through both the Global Script and the Room Script?
What are the differences between Global Variables and Graphical Variables?
I know theres no maximum number of variables or arrays, and theres a maximum of 500 GlobalInts. Does GlobalInts refer to Global Variables? Is there a maximum number of Graphical Variables?
And what do Strings do?
Is there any other information I need to know?
I know I'm asking quite a few questions, but I think the manual skips over quite a few things. It caters for Beginner Beginners, then jumps up to Advanced. I'm kinda stuck in the middle lol.
Thanks for the help.
Quote
Of these, which can be declared/accessed through both the Global Script and the Room Script?
All of them apart from 'Variables', depending on how the Graphical Variable is set up. But the question is actually a little misleading, I think there's a vocabulary issue.
'Variable' is just used to describe any Data type (http://www.adventuregamestudio.co.uk/manual/Datatypes.htm), usually created by the game author, but there are built in ones (the GlobalInts,
Character.x/y/z/Name etc, ...).
'Global Variables' are just variables that have been exported/imported to make them accessable to all Global & Room Scripts. Forum search import and export, check the manual (http://www.adventuregamestudio.co.uk/manual/importkeyword.htm), or the BFAQ (http://americangirlscouts.org/agswiki/Scripting%2C_Code_%26_Interaction#Working_with_variables:_the_basics) for more details. 'Global' in this sense just means that you can set a variables value in one script (the Global Script, for example, or in a hotspot interaction in Room 2), and check it in another (a different Room script - that hotspot in Room 2 unlocks a door in Room 3). (The opposite - a variable that's only good in the room its declared in - is called 'Local'.)
'Graphical Variables' are ones created (and mostly checked and changed) in the Interaction Editor - you can make them Global or Room-specific depending on what you want to use them for. '
Arrays' are just groups of variables sharing a common name (
MyInt[1], MyInt[27], etc) and can be local or Global (again, using
import/export).
Quote
Does GlobalInts refer to Global Variables?
The GlobalInts are a hard-coded array of 500
ints accessed by
Get/SetGlobalInt. They
are global variables, in the sense that they can be set in one room and accessed in another, but 'Global Variables' in general is a wider term than just the GlobalInts (a global variable could be an
int, a
String, a
bool, a
float ... GlobalInts are only
ints.
There's a few other threads dealing with the pros and cons of the various types, try a search.
Quote
Is there a maximum number of Graphical Variables?
Read the Manual (http://www.adventuregamestudio.co.uk/manual/System%20limits.htm). There's a limit of 100
Global Graphical variables, not sure about Room-based ones. Hopefully, though, you'll have left the Interaction Editor behind long before you reach that point.
Quote
And what do Strings do?
Contain strings of characters, e.g. for display on GUIs or in
Character.Say commands. As opposed to
ints which can only contain numerical values, and have to be reformatted for display.
Character.Name is a
String, because it contains a 'word',
Character.x is an
int because it only needs to be a number.
As well as trying some forum searchs (try
GetGraphicalVariable,
import, etc), I'd suggest going back and re-reading the manual - this really IS 'beginner beginner' stuff, it's just the unfamiliar wording makes it seem harder than it is.