OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Blanco on 22 Jul 2007, 01:38:09
-
I have a few scripts, several groups are running the same scripts. I want to create a unique bolean to terminate all scripts for each group.
I'm thinking about combining a boleanname + the groupname.
Let's say my boleanname is ENDSCRIPTS and my group is defined as grp1, so the dynamic bolean should be ENDSCRIPTSgrp1. When you set this true only the scripts for grp1 should terminate.
How can this be done? Is there a way to return the physical groupname?
-
to do it u have to use da format command as mandoble explains here (http://www.ofpec.com/forum/index.php?topic=29817.msg203648#msg203648)...
now 2 get da grpname.... i dont really know... strange dat i never thought bout it b4
LCD OUT
-
try this:
_unit = _this select 0
call compile (format["_ENDSCRIPT%1", group _unit] = true)
? (call compile (format["_ENDSCRIPT%1", group _unit])): hint "it is true"
-
Thx Mandoble
I've tested your code and I got a error missing ;
_grp is returned as WEST 1-1-A
So in the example the bolean should be _ENDSCRIPT WEST 1-1-A
Is that an error because spaces are not allowed in boleans/vars?
Is there a reason for the underscore?
Can I return the unit's name I gave in the editor? (in the name field)
*looking for a command that does this*
-
Yep, you can get the editor name with vehicleVarName comman.
-
Thx, works great
But it seems there something wrong with the call compile stuff because I still got an error.
It's:
...at ["_ENDSCRIPT%1", Vehiclename _unit] |#| - true)' Error Missing )
got :
_unit = _this select 0
;hint format ["%1",Vehiclevarname _unit]
call compile (format["ENDSCRIPT%1", VehicleVarname _unit] = true)
? (call compile (format["ENDSCRIPT%1",VehicleVarname _unit])): hint "it is true"
edit: Hmmm, wait a sec... :confused:
You don't need = true to check a condition, right?
edit2: Indeed, works fine now. Thx a lot.
-
right