Hey there.
Im trying to set up a custom Zeus that has only access to specific units.
Lets say he is only allowed to spawn and interact with Blufor Rifleman, Ammo Bearer and Squad Leader.
To achieve this, bistudio names the "CuratorObjectRegistered" EventHandler with this example.
myCurator addEventHandler [
"CuratorObjectRegistered",
{
_classes = _this select 1;
_costs = [];
{
_cost = if (_x isKindOf "Man") then {[true,0.1]} else {[false,0]}; // Show only objects of type "Man", hide everything else
_costs = _costs + [_cost];
} forEach _classes; // Go through all classes and assign cost for each of them
_costs
}
];
I found out, that _this select1; gives an array with the classnames of all objects in arma 3.
_this select1 = ["FxWindGrass1","FxWindGrass2","FxWindRock1"...................]
In return the EvenHandler needs an array with an entry for each classname defined by _costs.
_costs = [[true,0.1], [true,0.5,0.6], [false,0,0]......]
My problem:
I need something like an if-then-else funktion with multiple if-then conditions.
My example code aint working ofc but it shows how a working script could look like.
myCurator addEventHandler [
"CuratorObjectRegistered",
{
_classes = _this select 1;
_costs = [];
{
_cost =
if (_x == "B_Soldier_F") then {[true,0.1]},
if (_x == "B_Soldier_A_F") then {[true,0.1]},
if (_x == "B_Soldier_TL_F") then {[true,0.3]}
else {[false,0]}; // Show only objects Rifleman, Ammo Bearer and Squad Leader, hide everything else
_costs = _costs + [_cost];
} forEach _classes; // Go through all classes and assign cost for each of them
_costs
}
];
Any hints, thought or whatever is welcome :D.