Actually scratch that let me give a better explaination:
$MyScript::Fruit::Apples::Green = 1;
$MyScript::Fruit::Apples::Red = 0;
$MyScript::Fruit::Oranges = "Delicious";
$MyScript::Fruit::Bananas = "Ew";
$MyScript::Veggies::Lettuce = "Ew";
$MyScript::Veggies::Carrots = "Good for eyes";
$MyScript::Candy = false;
This is an example of parented global variables. It's a form of hierarchy of variables that is purely user-intended and shortens the time that the script will parse the variables. They are still global variables and will function like such. However, there is a 'way' to create a default path for the variables, so instead of there being a $MyScript in front of every variable, it will skip over to the next category after it when the script is executed.
Namespaces:
Namespaces function similar to parenting variables, except they are functions, and are meant to perform a certain task/function instead of hold a value. In order to use namespaces correctly:
Either create a new group that is a child of the virtual object SimGroup, like so (This is only one of many ways to do this):
$myGroup = new SimGroup(myGroup)
{
thCIAAnExampleVariableThatIsAssignedToThisGroupAndIsCustom = "Hi";
}; //REALLY IMPORTANT! CREATING GROUPS REQUIRES A SEMICOLON AT THE END
In this case, to get the value of the method that we included inside the group, you simply do it like this:
$myGroup.thCIAAnExampleVariableThatIsAssignedToThisGroupAndIsCustom;
RETURNS: "Hi";
OR:
myGroup.thCIAAnExampleVariableThatIsAssignedToThisGroupAndIsCustom;
RETURNS: "Hi";
Here's some more stuff on it in case you need help:
http://docs.garagegames.com/tge/official/content/documentation/Reference/Introduction/Namespaces.html