OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Triggerhappy on 18 Sep 2005, 19:10:33
-
I'm trying to make variables using call, format, and a counter... unfortunately, ofp spits out an unknown operator at me...
here's the code:
(call format ["TRG_fakepilot%1",_counter]) = this
and this is done in the init line of createunit:
"SoldierWB" createUnit [[0,0,0], group _pilot, {(call format ["TRG_fakepilot%1",_counter]) = this}, 1, "corporal"]
and here is the error message:
(call format ["TRG_fakepilot%1",_counter]) |#|= this:error unknown operator
what am i not doing? or doing wrong?
-
Jusr passing so this is quick thought:
Try:
"SoldierWB" createUnit [[0,0,0], group _pilot, {(call format ["TRG_fakepilot%1 = this",counter]) }, 1, "corporal"]
Note also that I have made counter a global variable
-
well i need it as a local varible because i use it later on, and the global counter could have been changed if the event happens in close succession. I assume that wouldn't make a difference....