% means local variable
$ Means Global
Yes sir, do you know the difference between local and global variables though?
Your biggest tool will be the console. You can find everything out with the console, I mean EVERYTHING.
To find out what happens when you do something, for example, if you want to find out what happens when you click on a vehicle you would do:
Open Console
trace(1);
Close the console
click the vehicle
Open Console
trace(0);
You will then have a list of all functions that were called in the time trace was on.
You will see a list on function names with a bunch of numbers in parentheses. This is a good time to realize that that's what almost everything in Torque is; a number. When you define something like %player = %client.player %player is just storing a number. But we use variables because these numbers aren't always the same.
So, how do you find out what these numbers you got from trace are? you use dump();
Say a number was 7260 and you wanted to find out what that number was; you would use 7260.dump(); This would then echo all of the object's dynamic fields and functions. If that doesn't help you figure out what it is do something like echo(7260.getClassName());
Echo will also help you work things out; you can do anything you do in scripts in the console. so if you want to find out whether or not your string manipulation or something is working correctly, you could just copy it from your script, slap it in the console and use some echos to work things out. You can the modify it until it does work.
Also, you can start typing in the name of a function and press TAB and it will scroll through a list of functions that you begin with what you have type; this can help you find a function.
tl;dr The console is your best friend, use trace(1); trace(0); %foo.dump(); and echo("Hello, World!");