Jump to content
Sign in to follow this  
Whyte_Out

Enemy Waves?

Recommended Posts

How would I create, or make waves of enemies. I would like to do like 4 or 5 waves of enemies. The scenario would be...you and your team our held up on a mountain defending a position...How would I create this? I would like it to be as soon as you kill one wave, another wave comes. I would llike them to be spawned if possible, that way they would be undetectable until you have to defend, then they would be spawned.

Share this post


Link to post
Share on other sites

Place triggers with the desired radius in your aoo - one for each wave. Assuming these waves are single groups, synch them up with the triggers and set them to NOT PRESENT. That should do the trick - all without scripting. And if you place them at distance or behind some topology/structure, they will be undetected anyway.

If you wanna spawn your waves one after the other then write a little script for it. Either place down markers on the map for the start positions of your waves or calculate them at random (fixed distance/radius, random angle for example). And then think about when exactly you wanna send the next wave. After a fixed/estimated amount of time? Once all wave/group members are dead? (not recommended; they could be fleeing) Once all wave/group members are "fleeing", that is out of the aao?... There are lots of ways to do this. As you like.

If you dont know how to write such a script. Start to learn it; theres plenty of information out there. And if you have a specific problem or question, just ask again.

Have fun.

Share this post


Link to post
Share on other sites

Or there are some cool tools like Ups, theres an AI respawn using UPs or even better search for Upsmon that do all that for you + a whole lot more without the need to script.

Share this post


Link to post
Share on other sites

I would use triggers to do it, I'm guessing you're defending a pre-determined position or area?

For this you need to name your group leaders and place markers. I'm stealing this from a mission I've made, but you should get the jist of it.

condition:

({alive _x} count units r3) < 6 

on act:

{_x doMove (getMarkerPos "wp3")} foreach units group r6

Where R3 is another unit moving towards marker "WP3", when less 6 men are left alive in their group, that will trigger the next wave, in this case group R6 will begin to move to marker "WP3". If someone has a better idea for actually moving the units to the marker help would be appreciated, using doMove was the only way I could get the entire group to comply.

As mentioned UPSMON is always a great option, I'm actually not sure how the reinforcement system works, I think it still needs to be activated via trigger, in which case you should use the condition I used above. If you want them to come to you, I recommend attacking a marker to the player.

Edited by The Hebrew Hammer

Share this post


Link to post
Share on other sites

Some time ago I prepared myself something called "Automatic War". Idea is simple. Two scripts, one per side, forming a randomly selected groups of soldiers of a certain "value" activated respectively by two repeatable triggers, while each of the groups receives a waypoint in the center (plus some randomization) of the trigger of the opposing party. This gives you possibility to easily play some meeting engagement. If to remove a waypoint one of the groups, and for that will appoint defensive positions in buildings, with static weapons, sets auto patrols, etc. We have, in turn, attack-defense mission.

Triggers conditions looks like this:

((east countSide allUnits) < 20) and (EST < 4);

and

((west countSide allUnits) < 20) and (WST < 4);

(with

EST = 0;WST = 0;

inside init field any unit)

and its activation fields:

[] exec "EAS.sqs"; EST = EST + 1

[] exec "WAS.sqs";WST = WST + 1

Triggers also has 30-40 sec. countdown. Without that they could generate all waves at once with such conditions (because groups of a given wave are spawned with some short interval, so condidtion may be considered true few times before number of units rises above the threshold (20)).

As you can see there are set four waves per side.

Do not show scripts, because they are messy SQS, which would not explain anything, I afraid.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Hey guys thanks a lot for your replies. I will test them all out now and determine which one fits the situation best. I will respond soon letting you know how it went. Thanks again for your help guys.

-Whyte

Share this post


Link to post
Share on other sites

not sure if this is of any use to you...

Attacking an FOB (object) script i made a while back, bit rough but i never finished it.

used the below code to spawn several opfors random distance from the FOB, seems to work. They all seem to run towards the FOB, whilst still attacking. Created a trigger that creates an explosion at one of the opfors if entered (suicide bomber).

waveattack.sqf


_d = [80,90,100] call BIS_fnc_selectRandom;
_r = random 360;
_WaveSpawnLocation = [((getpos FOB) select 0) + sin _r *_d, ((getpos FOB) select 1) + cos _r *_d, 0]; 
wavegroup1 = [_WaveSpawnLocation, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
		{
		_x doMove position FOB;
                       _x setBehaviour "COMBAT";
		} foreach units wavegroup1;

trigger created

_trg	= createTrigger["EmptyDetector",getPos FOB];
_trg setTriggerArea[17,17,0,false];
_trg setTriggerActivation["EAST", "PRESENT", true];
_trg setTriggerStatements["this", "[] spawn suicideexplosion", ""]; 
//_trg setTriggerStatements["this", "hint 'working trigger'", ""]; 
	[] spawn Suiciderunner;

Suiciderunner code - same as for the wave spawn, but added the following...

{
removeallweapons _x;
_x doMove position FOB;
_x setBehaviour "SAFE";
} foreach units suicideman;

suicideexplosion

suicideexplosion = {		

 [nil,nil,rHint, "BREACH of perimeter!!!"] call RE;
 sleep 2;
_bombtype = ["Sh_105_HE", "Sh_85_AP"] call BIS_fnc_selectRandom;    // "BO_GBU12_LGB"
{
_shell = _bombtype createVehicle position _x;  
} foreach units suicideman;
		};		

if this is of any use to anyone (apologise for the lame scritping) can post the whole code - not that much longer.

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  

×