Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Maverik010

Spawned units go to location

Recommended Posts

Hello my friends,

I am new here, I looked for solution to my problem but i didn't find it.

My problem is that i spawned infantry group and i have no idea how to order this group to attack position.

I made a repeatedly trigger, detected by Independent and activated by

resistance countside thislist < 18

and in "On Activation" field i put

[getPos aPos, Resistance, ["TK_GUE_Soldier_2_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_AT_EP1", 
"TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_TL_EP1", "TK_GUE_Soldier_AR_EP1"],
[], [], [], [], [], 210] call BIS_fnc_spawnGroup;

What should i put in activation field to order this newly created group to attack a position.

Is there any option to call this function from description.ext and randomize spawn location and limit this trigger by mission time?

Share this post


Link to post
Share on other sites

randomize position (assuming you have 3 marker named "pos1","pos2","pos3):

SpawnPosition = ["pos1","pos2","pos3"] call BIS_fnc_selectRandom;

spawn it like that :

InfGroup = [getMarkerPos SpawnPosition , Resistance, ["TK_GUE_Soldier_2_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_AT_EP1",

"TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_TL_EP1", "TK_GUE_Soldier_AR_EP1"],

[], [], [], [], [], 210] call BIS_fnc_spawnGroup;

and Order attack like that
[infGroup, PositionToAttack] call BIS_fnc_taskAttack;

to limit a trigger by mission time insert in Condition Field (exemple where trigger will be activated after 10 min mission started):

time > 600
Edited by Ios

Share this post


Link to post
Share on other sites

Thank you very much, i had to adjust this code a bit but works perfectly now.

SpawnPosition = [aPos,bPos,cPos] call BIS_fnc_selectRandom;
InfGroup = [getPos SpawnPosition, Resistance, ["TK_GUE_Soldier_2_EP1", 
"TK_GUE_Soldier_EP1", "TK_GUE_Soldier_AT_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", 
"TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_TL_EP1", "TK_GUE_Soldier_AR_EP1"],  [], [], [], [], [], 210] call BIS_fnc_spawnGroup; 
[infGroup, getPos Target] call BIS_fnc_taskAttack;

Share this post


Link to post
Share on other sites

Thank you very much, it worked but i adjust code a bit.

SpawnPosition = [aPos,bPos,cPos] call BIS_fnc_selectRandom; 
InfGroup = [getPos SpawnPosition, Resistance, ["TK_GUE_Soldier_2_EP1", "TK_GUE_Soldier_EP1", 
"TK_GUE_Soldier_AT_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_EP1", 
"TK_GUE_Soldier_EP1", "TK_GUE_Soldier_TL_EP1", "TK_GUE_Soldier_AR_EP1"],  [], [], [], [], [], 210] call BIS_fnc_spawnGroup; 
[infGroup, getPos Target] call BIS_fnc_taskAttack;

Share this post


Link to post
Share on other sites
Sign in to follow this  

×