Going more basic.. and I know it is way too long.. But god if I would have discovered this info early on..... so many hours of my life.. *sniff* gone
.
One of the things that took me a while to wrap my head around and once figured out helped me the most was understanding all the This select 0, this select 1, stuff. All these are are variables in an array that you get to define. For example:
_name = _this select 0
_position = _this select 1
_azimut =_this select 2
The array translates to this [name,position,azimut]. You can define whatever you want as the name, position and azimut. Do not be confused by the names I am using. These are not defined by the word they are defined by the script inwhich the above is entered. These are only examples. These can be defined as anything. For example, lets say I want my tank named 'Tank1' to be moved to the position of a marker I placed on the map named Marker1 and I want the tanks direction(azimut) to be 35. I would enter this into the array like this [tank1,"marker1",35]. Always put "" around marker names. Took me forever to figure that one out.
Now to actually make all that work I need the actual script to define these things. It would look something like this:
_name = _this select 0
_position = _this select 1
_azimut = _this select 3
_name setpos (getmarkerpos "_position");
_name setdir _azimut;
exit
Now what this does is allow you to enter any names or numbers you want into your array when executing this script. For example, Lets say I want this to be activated by a trigger. In the Activation field of the trigger I would enter
[tank1,"marker1",35] exec "Nameofscript.sqs"
Now the beaughty of this is that you can activate this same script multiple times for multiple objects by simplying entering in the corrisponding informaiion into the array when executing. You can make tank2 go to maker2 and get set facing an azimut of 125 by entering
[tank2,"marker2",125] exec "nameofscript.sqs" in a new trigger or script or whatever you want to activate it.. Even the same trigger infact... Awsome I know.. Saves hours of tedious mind nummbing scripting. Yay