Jump to content
Sign in to follow this  
SIXTWO

Spawning enemys with waypoint

Recommended Posts

im sorta new to the editor but i no the basics of it.

Im currently making a mission where a convoy is under attack and two delta teams are dropped in by littlebirds to assist and help defend the convoy.

and i want more enemys to spawn once my team have reached the convoy, there for making another counter attack.

so the question really is how can i trigger enemys to spawn by a waypoint?

Share this post


Link to post
Share on other sites

Try this

spawnenemygroup.sqf

_pos = getmarkerPos "enemygroup1";
_skill = [0.1, 0.5];
_side = EAST;
_units = ["TK_Soldier_SL_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1", "TK_Soldier_EP1", "TK_Soldier_AT_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1"];

EnemyGroup1 = [_pos, _side, _units, [], [], _skill] call BIS_fnc_spawnGroup;

sleep 3;

{
   _x setskill ["aimingAccuracy",0.15];
   _x setskill ["courage",0.85]; 
} foreach units EnemyGroup1;

_ewp1 = EnemyGroup1 addWaypoint [getMarkerpos "enemywp", 10];
_ewp1 = setWaypointType "SAD";
_ewp1 = setWaypointSpeed "NORMAL";
_ewp1 = setWaypointFormation "STAG COLUMN";

where "enemygroup1" is the location of the spawn, and "enemywp" is where the waypoint is set. Just execVM the .sqf once the waypoint is reached.

Also, you can change the classnames in _units, those are just there.

Share this post


Link to post
Share on other sites

thanks but where do i put this long code or script, im actually not up to doing all that kind of stuff with the editor, but i was thinking about learning eventually.

Share this post


Link to post
Share on other sites

Grimes this is very helpful, how would I add a vehicle, then add a Driver and a Gunner? It would be a ship, and then go to a multiple waypoints.

Thanks

Share this post


Link to post
Share on other sites

SixTwo, save the code in notepad, name it spawnenemygroup.sqf

Important: under 'save as type" switch to 'all files' . That way it won't end up being spawnenemygroup.sqf.txt.

Save it somewhere so you can use it for future missions.

Save a copy into your mission folder for the mission your working on, mine go in

C:\Users\owner\Documents\ArmA 2 Other Profiles\YouProfileName\MPMissions\yourmissionname

a related link

http://forums.bistudio.com/showthread.php?t=107074

Edited by Jack_Ryan_
update

Share this post


Link to post
Share on other sites

thanks, i learnt how to add scripts to the editor.

But not long ago i tyed to putting a IED script in the editor.

But it always comes up with IED.sqf cannot by found. i don't no why this happens but its really bugging me. i have the IED.sqf file in mydocuments/arma2/missions. And im calling the sricpt by [bike1, "Medium"] exec "IED.sqs"

Im on Arrowhead btw, but i don't think that should make a difference.

Share this post


Link to post
Share on other sites

You have a .sqf script but you are calling a .sqs

[bike1, "Medium"] execVM "IED.sqf"
Edited by zigzag

Share this post


Link to post
Share on other sites

oh, well then dodgy read me instructions and dodgy script all together. :/ is there any good IED scripts. because this one i got says its SQS.... funny.

Share this post


Link to post
Share on other sites

If the script name is IED.sqs

you call it with

[bike1, "Medium"] exec "IED.sqs"

and if your script name is IED.sqf

you call it with

[bike1, "Medium"] execVM "IED.sqf"

Share this post


Link to post
Share on other sites

oh, but still i typed in [bike1, "Medium"] exec "IED.sqs" and it says it cannot find.

I can't put it in mydocuments/otheprofiles/missions... or somthing like that because i never go that file wen i installed the game, :/ but is there any solution to the darn editor not finding the IED.sqs.

Share this post


Link to post
Share on other sites

The file MUST be in the mission folder. The mission folder while editing will be:

C:\Users\WindowUsername\Documents\ArmA 2 Other Profiles\PlayerName\missions\SalvageExample.Desert_E

Where "SalvageExample" would be the name of the mission and Desert_E is the map it's on.

Put the IED.sqs in that folder. It should than work in the editor.

When you choose Save then Export to Single Player missions (or Multiplayer missions) it will take all the mission files, including your SQS, and move them into a PBO file in your main install directory\mission (or MPMissions) folder and you can use it in game under Scenarios or host it as multiplayer.

Share this post


Link to post
Share on other sites

omg thanks alot. this editor isn't that hard to use once u get the hang of it. ive created some good little scenarios that i might upload in a few weeks. Havent got much time on my hand to finish the missions off with tasks and Mission complete/fail triggers.

Share this post


Link to post
Share on other sites

kylania and I posted the path where editor created missions are stored. Your .sqf will go in there.

Share this post


Link to post
Share on other sites
;1742697']Try this

spawnenemygroup.sqf

_pos = getmarkerPos "enemygroup1";
_skill = [0.1, 0.5];
_side = EAST;
_units = ["TK_Soldier_SL_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1", "TK_Soldier_EP1", "TK_Soldier_AT_EP1", "TK_Soldier_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_AR_EP1"];

EnemyGroup1 = [_pos, _side, _units, [], [], _skill] call BIS_fnc_spawnGroup;

sleep 3;

{
   _x setskill ["aimingAccuracy",0.15];
   _x setskill ["courage",0.85]; 
} foreach units EnemyGroup1;

_ewp1 = EnemyGroup1 addWaypoint [getMarkerpos "enemywp", 10];
_ewp1 = setWaypointType "SAD";
_ewp1 = setWaypointSpeed "NORMAL";
_ewp1 = setWaypointFormation "STAG COLUMN";

where "enemygroup1" is the location of the spawn' date=' and "enemywp" is where the waypoint is set. Just execVM the .sqf once the waypoint is reached.

Also, you can change the classnames in _units, those are just there.[/quote']

I tried this exact script and the enemy spawn but dont move. I tried all sorts of things including changing the waypointtype to "MOVE" but they would not go. Any ideas.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×