I got a problem that keeps nagging me. I had created one very small test scenario with one blue player and one opposing red AI. This AI is within the range of the trigger SECTION_C (Red, Activation Once).
For my little test scenario I had also created two setradiomsg's : "SAVE" and "TEST"
Save uses LIST to save the array of objects within SECTION_C into zSectorCUnits.
Test just globalchat the variable zSectorCUnits.
I begin my little test scenario by doing a radio "SAVE". The globalchat informs me "[East Alpha Black:1] 1"
Then I kill East Alpha Black:1 and uses the radio "TEST" to verify zSectorCUnits. Since I did not uses "SAVE" after I killed him I expect the globalchat to reply "[East Alpha Black:1] 1" but instead it replies with "[]" 0 ??
How can zSectorCUnits be changed without doing a LIST?
Init.sqs
zSectorCUnits = []
1 SETRADIOMSG "SAVE"
2 SETRADIOMSG "TEST"
EXIT
Save.sqs
HINT "Saving Sector C"
zSectorCUnits = LIST SECTOR_C;
PLAYER GLOBALCHAT FORMAT["%1 %2", zSectorCUnits, COUNT zSectorCUnits];
EXIT
Test.sqs
PLAYER GLOBALCHAT FORMAT["%1 %2", zSectorCUnits, COUNT zSectorCUnits];
EXIT
My goal is to use LIST to save a list of objects within SECTOR_C. When all blue forces are out of the range of SECTOR_C another trigger "clearsector" are activated. Killed.sqs just does a DeleteVehicle.
ClearSector.sqs
? COUNT zSectorCUnits == 0 : GOTO "SectorEmpty"
HINT "Cleanup"
"IF (NOT ALIVE _x) THEN {[_x] exec ""killed.sqs""}" FOREACH zSectorCUnits
#SectorEmpty
EXIT
I have seen many scripts that perform something likewise but all of them uses ~# to determine some kind of delay before deleting the objects. However I want to use triggers to determine when the objects should be deleted.
Best regards
Malm