From reply #9:
_this in upper code returns an "type array, expect object" error;
had to replace _this with the actual name of the unit
Read the error msg carefully. If often says exactly what's wrong (and often not...lol).
Ofp gets an "array" from you while it expects an "object".
anything between brackets [this eg] is an array, where "this" is an object (or the name of the vehicle. dude).
With _Dude1 = _this select 0, you get the first object out of the array. _dude2 = _this select 1, would get the 2nd and so on, as HateR_Kint said.
Now back to the error msg. It tells you that you sent an array (like in [this] exec "xxx.sqs") but the way the script is written ofp wants an object (this exec "xxx.sqs" or bmp1 exec "xxx.sqs").
Because the first this is between bracketes ([this]) it's an array, and you have to tell ofp the get something out of that array first (_this select 0 eg).
Hope this adds some
__________
I did [] exec "xxx.sqs" in init field of Bradley
and this is xxx.sqs
Code:
#loop
dude say "start"
~60
? alive dude: goto "loop"
exit
This isn't the best way to script, since you don't use a variable for the name of the unit you want to act in this script, but a unit name. (dude). This means you have to write a new script for each unit you want this script to use (now, if you just want 1 car to be the propaganda van...ok
)
To make it more usable use this:
_dude = _this
#loop
_dude say "start"
~60
? alive _dude: goto "loop"
exit
where you call the script with "this exec "xxx.sqs" from the units init field.