I've found several examples of call compile usage here, but none that resulted in the "compile" being an object, most were related to strings. So it's not working for me. I've asked others and the resounding answer has been "I don't know, call gives me headaches!"
Basically I test the side you're on, convert it to a string, then I want to create a trigger at a spawn point based on your side. Or even just move you. I just cannot get the code to work. I keep getting an error saying "Got 0 elements, expected 3".
_sidestring = WEST and I have a marker named "WESTSPAWN" on the map.
Here's my code so far:
_side = side _unit;
_sidestring = format["%1", _side];
_objmarkername = call compile format ["%1SPAWN", _sidestring];
_pos = getmarkerpos _objmarkername;
player setPos _pos; // this doesn't error but it doesn't work either...
_trigger = createTrigger ["foad", _pos]; // this gives the following error.
This is the error the createTrigger gives:
Error position: <createTrigger [_triggername, _pos];
Error 0 elements provided, 3 expected
How can I get _objmarkername to "be" the marker that exists so that I can properly get it's position please? What am I doing wrong in what should be an easy bit of code, right?
Edit: I've also tried it this way, to no avail:
call compile format["_objmarkerName = %1SPAWN", _sidestring];