06: Waves System - 14aag/mission_template GitHub Wiki

How to use the Wave system

Place down a trigger. You'll want this trigger to be where your players will be defending or somewhere out the way so you as a Zeus can trigger them. Place down a Logic Module for each wave you want to create. Sync the group leaders of each group of AI you want to be a part of that wave to the logic module. You have to pre-plan the waypoints of each group in order to have them move, otherwise, they will spawn but not act. Now don't worry, the units get removed at mission initialization but in 3DEN you'll end up with something like this:

Now for where stuff needs to go and what it is.

Register wave - Belongs to the logic module.

[this, "uniquewavename"] call efn_wave_fnc_registerWave; Make sure to call the uniquewavename something you can recognize later. For easy reference on the map in 3DEN you can give the logic module a variable name. That way when you hover over the logic on the 3DEN map you see what wave it is.

Create wave configuration - Belongs in XEH_PostInit

["uniquename", ["uniquewavename", "uniquewavename2"], { _alive < _strength }, 60, true] call efn_wave_fnc_createWaveConfiguration;

You'll find this file in the mission template. It's the XEH_PostInit in the root folder, so do -not- change the XEH_PostInit in the efn > waves folder.

If you are going to use multiple wave triggers make sure to name uniquename something you can recognize later. Fill out the ["uniquewavename", "uniquewavename2"] with all the waves you want to be a part of the setup trigger area. You can list waves multiple times if you want so the following example is possible: ["wave1", "wave1", "wave2", "wave3", "wave1"].

Per standard { _alive < _strength } is set up so that when the first AI in the already spawned wave dies the next wave can spawn. You can change that to a total strength-based calculation instead by changing it to { _alive < (_strength * 0.3) } in this example it means that when the last wave is on 30% strength the next one can spawn.

60 states the minimum time between waves spawning, in this case, it's set up as 60 seconds. The last true means the waves loop or if false they end after your last mentioned wave.

Trigger setup

Tick Repeatable to be on.
Tick Server Only to be on.
Put the following in On Activation ["uniquename"] call efn_wave_fnc_start;
Put the following in On Deactivation ["uniquename"] call efn_wave_fnc_stop;

In the below example of the Trigger setup is set up to be triggered by players due to Blufor already being in the area, it is also set up with a timer when the waves are supposed to start. The timer technically does not need to fill in in both Min, Mid, and Max but I don't like leaving things to chance. In this instance Countdown was chosen due to the attack starting whether or not players are in the trigger are when the time runs out. If you have areas the players can drive/fly through you'd want to use timeout instead as that'll require players to be in that area through the time you have set.

In the trigger Transformation section you can change the C as in below the below example to make sure helicopters or fixed wing don't accidentally activate the trigger. This should allow a helicopter team to provide active intel for example. Players do need to be made aware that if they utilize helicopters or drones for ahead scouting that they will come out deceived as the wave will not spawn.

Integrating LAMBS

When using the wave system it is best to use the LAMBS danger code rather than waypoints and modules. Both can fail you in the case of spawning in units, especially when done repeatedly. Therefore it is better to use code in the group Inits. With all of these I don't go over the full length of options nor all LAMBS modules such as Rush, Hunt and Creep. For that information you can go to: https://github.com/nk3nny/LambsDanger/wiki/waypoints

Patrols

Example: [this, this, 250, 4] call lambs_wp_fnc_taskPatrol; The first 2 this mentions are for the group. The second this the location of the patrol, this could also be an array more on that below. The 250 in the example is the patrol range, beware that the number x2 is the range in actual meters. So the example is 250 and thus 500 meters. The 4 is the number of waypoints that you like to see.

Garrisons

Example: [this, this, 5] call lambs_wp_fnc_taskGarrison; I'd recommend using the Garrison code in combination with the Garrison module from ZEI and then paste the above code wholesale. With that combination, the group will garrison the building ZEI has garrisoned them in already. Putting groups outside of the building works as well. In that case change the 5 to be the range (Remember the x2 for the actual range in meters) of where they look for buildings. This is the one I'd keep the most simple to avoid headaches.

Camps

Example: [this, getPos object, 75, [10, 10, 0, false]] call lambs_wp_fnc_taskCamp; The this refers to the group itself. getPos allows you to center the camp around an object (The object Variable name.) or a array. The 75 in the example is the area it will automatically patrol in and search for turrets to mount. The array that follows that is the area it camps in. The 75 and camp area being different is good as it allows you more control of the Camp behavior, even more than the Zeus module and 3DEN module allow for.

Arrays

The area arrays you can use will always look like [X, Y, 0, false] for an ellipse or [X, Y, 0, true] for a rectangle. You can change the X and Y values for whatever area you'd want it to cover. In the Camps example it is a 20x20 meter ellipse as the array is [10, 10, 0, false]. The 2x for actual meters also applies here. I would personally never change the 0 as that is for angle, which in the case of areas never actually matters. For more info: https://community.bistudio.com/wiki/inArea

Notes when using this for unit automatization

When abusing the system for automating the mission rather then using it for general play make sure to toggle off the Repeatable from the trigger. That way the wave can only trigger once.