Alright here is a good one. Hardest thing I have tried to tackle so far.
I am trying to build a set of scripts that allows a truck to be given the ability to create another unit near it. I need the truck to be able to repspawn and I need the vehical it creates to respawn. Both exist on the map at start of the mission. All the create option does is move the unit near the truck from another location. This is the script in question. What I need to do is have these local variables passed with the execution of the "Artillary.sqs" script. "Artaction.sqs" is executed as follows.
[Truck,Art] exec "Artaction.sqs"
_truck = _this select 0
_art = _this select 1
artaction=_truck addaction ["Build Arillary","Artillary.sqs";
_truck is the vehical that the action is being added to and _art is the actual artillary piece. These 2 variables need to be passed in much the same way the "artaction.sqs" script was executed
Now I have done some reading and I read that it can be done but maybe I mss understood or the info I read is wrong. Or it doesn't work for local variables just global which ofcourse won't work but according to this site
http://community.bistudio.com/wiki/addActionif I understand it correctly I should be able to simply do this:
artaction=_truck addaction ["Build Arillary","Artillary.sqs",(_truck,_art)];
Natuarally it doesn't work. So any ideas?