jazzraill 3 Posted July 9, 2016 Hello everyone. I am trying to spawn units and some objects with trigger, then delete them when player leaves the trigger area (eg. 200x200) and re-spawn when entering again. what i am trying to do is to create a military bases around the map with camps/ tents and units patrolling but it costs a lot of fps. i would like to place units and objects in editor but they should spawn when player is in their activation trigger. then they should despawn if player leaves the area. sorry for bad english Share this post Link to post Share on other sites
sarogahtyp 1104 Posted July 9, 2016 Type: none Activation: any condition: this && {(isPlayer _x) and (alive _x)}count thisList > 0 On act: yourglobalarray = []; _nul = yourglobalarray pushBack ("O_G_Soldier_F" createVehicle position thisTrigger); _nul = yourglobalarray pushBack ("O_G_Soldier_F" createVehicle position thisTrigger); On deact: _nul = { if(!isNull _x) then {deleteVehicle _x;}; true } count yourglobalarray; yourglobalarray=nil; this spawns 2 opfor if player enters area of trigger and deletes them if player leaves area. U just also need to ensure that the empty groups will be deleted with deleteGroup. But there is a good example at the wiki which describes how to delete all empty groups. This is neccessary becaue of the 144 groups limit. 1 Share this post Link to post Share on other sites