Search the Community
Showing results for tags 'search stored data'.
Found 1 result
-
high command scripting, reverse lookup in allMissionObjects
stuguy posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Long time no talk. I am currently working with the high command module with some old scripts I dusted off. I was able to get some easy scripts to create the HC and add all the units on a particular side to the player: if (count (allMissionObjects "HighCommand") == 0) then { _Group = createGroup (sideLogic); _Group_HC_C = _Group createUnit ["HighCommand", [0, 0, 0], [], 0, "NONE"]; _Group_HC_S = _Group createUnit ["HighCommandSubordinate", [0, 0, 0], [], 0, "NONE"]; player synchronizeObjectsAdd [_Group_HC_C]; _Group_HC_C synchronizeObjectsAdd [_Group_HC_S]; { if (side _x == resistance) then { leader _x synchronizeObjectsAdd [_Group_HC_S]; }; }forEach allGroups; } else .... The else condition is what I am having problems with: else { _Groups_HC = hcAllGroups player; _Group_HC_C = synchronizedObjects player select (side player == sideLogic); _Group_HC_S = synchronizedObjects _Group_HC_C select 0; // or 1? Neither works { if (side _x == resistance && !(_x in _Groups_HC)) then { leader _x synchronizeObjectsAdd [_Group_HC_S]; }; }forEach allGroups; }; I've tried all sorts of ways of tracking down the objects in the allMissionObjects: _Groups = allMissionObjects "HighCommand"; _Group = allMissionObjects "HighCommand" select (side player == sideLogic); //This looks like a subordinate _Group = synchronizedObjects player select 0; //it's definitely a group in this case //and _Group_HC_C = synchronizedObjects player select 0; //primary group _Group_HC_S = synchronizedObjects _Group_HC_C select 0; //p1 //and _Group_HC_C = synchronizedObjects player select 0; //primary group _Group_HC_S = synchronizedObjects _Group_HC_C select 1; //looks like the sub I'm stumped on how to pull the same data I injected so I can add more groups. The goal is getting a basic example working and sort out a simple admin script to add basic high command group management, nothing more. Anyone have any ideas? edit: wait, I think the else isn't adding leaders. checking... Ok, i updated the else to reflect what I needed it to do, but I am still unable to properly lookup and find the variables I created.- 4 replies
-
- high command
- allmissionobjects
- (and 2 more)