Jump to content
twakkie

[Release] Configurable Motorised Infantry Reinforcement Script

Recommended Posts

Hi All

 

I want to share a script which I have been working on in the last couple of months. I started development of the script with the intent of not only providing my unit with an easy and semi configurable reinforcement script but also to improve my own scripting skills. The reinforcement will be spawned at a predefined marker location, loaded up in a vehicle of choice, follow waypoint markers to an offload point and then attack a marked area.

 

 

HOW TO USE

The bare minimum needed for the script to work is: 

  • 3 waypoint (spawn,drop and attack waypoints)
  • a trigger (or any other method) to call the script
  • the name transport vehicle.

 

~In Editor:
Place minimum three markers on the map. The first being the spawnpoint (movement array element 0) of the transported infantry and vehicle, in this example it will be "marker_vehSpawn_01". The second will be the drop off point of the infantry, in this instance "marker_vehUnload_01" and lastly the attack point for the infantry and vehicle (vehicle will only assault attack markers if specified in the "motoInfReinforce_Init.sqf" otherwise it will remain at the unload waypoint), called "marker_attack".

 

~In initServer.sqf:
In the intServer.sqf place this code: [] execVM "motoInfReinforce_Init.sqf";

 

~How to Call (Basic):
Place a trigger on the map, set it to whatever conditions required ex "Bluforce Present" and in the init:

Description:    ["vehicleClassName",[moveMentMarkers],[offloadMarkers],[attackMarkers]]
Example:        null = ["O_APC_Tracked_02_cannon_F",["marker_vehSpawn_01"],["marker_vehUnload_01"],["marker_attack"]] spawn TB_fnc_motoInfReinforce_Main;
The vehicle cargo space will dictate the number of units transported.

 

~Configurable:
There is no need to edit the main program body and you can edit the "motoInfReinforce_Init.sqf" settings to customise the vehicles and units that are spawned.

Please read the readme to see all settings that can be adjusted. This includes, vehicle type, nr of movement, unload and attack markers, the unit type size and class as well as nr of squads.

 

~Advance Calling:

Syntax 1

Description:    ["vehicleClassName",[moveMentMarkers],[offloadMarkers],[attackMarkers],[customSquadArray],side]
Return:            Created vehicle (OBJECT)
Example:        veh = ["vehClassName",["markerSpawn","markerWaypoint_01"],["markerOffload_1"],["markerAttack_1"],[NrOfSquads,"Unit1_className","Unit2_className"],Side] call TB_fnc_motoInfReinforce_Main;
 

The script allows further customization by adjusting six variables the following variables (* is optional variables):
(1st) vehicleClassName (STRING)                           :    CfgVehicles class name of the transport vehicle. Ensure the vehicle spawned is large enough to accommodate the infantry group.
(2de) moveMentMarkers (ARRAY of STRING)         :    Array of spawn marker and movement markers for vehicle transporting the infantry. The first marker will be used as the spawn marker.
(3de) offloadMarkers (ARRAY of STRING)               :    Array of possible offload markers for the infantry.If more than one offload marker is provided, a random offload point will be selected from the array.
(4th) attackMarkers (ARRAY of STRING)                 :    Array of possible assault markers where all combat units will move too and perform an Search and Destroy movement order.
                                                                                      If more than one marker is provided in the array, attack points will be assaulted sequentially. 
(5th*) customSquadArray (ARRAY of NR&STRING) :    Array of class names of units and the number of squads that must be transported:

                                                                                      [NrOfSquads,"Unit1_classNames","Unit2_classNames"]
                                                                                      NrOfSquads         -   Total number of squads to be spawned. (integer > 0)
                                                                                      Unit_classNames -   List of Unit classNames that will be spawned in a single squad.
(6th*)    side (side)                                                    :    Optional Variable. Side of the reinforcement ( West || East || Independent ).
                                          
* Is Optional. (If this variable is not provided, default function will be used)

 

Syntax 2
Description:    ["vehicleClassName",[moveMentMarkers],[offloadMarkers],[attackMarkers],numberOfUnits,side]
Return:            Created vehicle (OBJECT)
Example:        veh = ["vehClassName",["markerSpawn","markerWaypoint_01","markerWaypoint_01", etc],["markerOffload_1","markerOffload_2", etc],["markerAttack_1","markerAttack_2",etc],numberOfUnits,Side] call TB_fnc_motoInfReinforce_Main;
 

The script allows further customization by adjusting six variables the following variables (* is optional variables):
(1st) vehicleClassName (STRING)                      :    Same as syntax 1
(2de) moveMentMarkers (ARRAY of STRING)    :    Same as syntax 1
(3de) offloadMarkers (ARRAY of STRING)          :    Same as syntax 1
(4th) attackMarkers (ARRAY of STRING)            :    Same as syntax 1
(5th*) numberOfUnits (Integer)                            :    Optional variable. Integer wich dictates how many units are spawned and added to the vehicle cargo.
                                                                                 numberOfUnits < 0 -   Spawn default group and move into the vehicle.
                                                                                 numberOfUnits = 0 -   Default setting. All of the vehicle cargo is filled with default units.
                                                                                 numberOfUnits > 0 -   Use default unit and spawn total number of units equal to the number provided.
(6th*)    side (side)                                               :    Same as syntax 1

 

* Is Optional. (If this variable is not provided, default function will be used)

 

 

CREATING A CONVOY:
Description:    [[vehicles], speedVar]
Example:        [[veh_1,veh_2,etc],80] spawn TB_fnc_createConvoy;

The script allows further customization by adjusting six variables the following variables (* is optional variables):
(1st)     vehicles (ARRAY of OBJECTS)    :    Array of vehicles that will form a group.
(2de*)     speedVar (INTEGER)                :    Variable adjust the maximum speed the lead vehicle can travel at. 
                                                                      speedVar <= 0 will be default behaviour (no speed limit).
* is Optional

 

 

DOWNLOAD

Motorised Infantry VR Mission Example

 

Any suggestions and comments are welcome.

 

 

CHANGELOG

Quote

v2.1 (19/12/2016)
    -   Initial Release
    
v2.2 (10/01/2017)
    -    Added function to form a convoy with different vehicles. 
    -    fn_motoInfReinforce_Main now returns the vehicle name that was created.
 

 

  • Like 1

Share this post


Link to post
Share on other sites

Nice work there bro...

any way to have more than one vehicle? I would like to set up an "insurgent" QRF with an armed tecnical and a transport offroad or truck following behind....

Thanks man!

Share this post


Link to post
Share on other sites
22 minutes ago, zagor64bz said:

Nice work there bro...

any way to have more than one vehicle? I would like to set up an "insurgent" QRF with an armed tecnical and a transport offroad or truck following behind....

Thanks man!

 

Shouldnt be impossible. I will see what I can do. It might be easier to just write another script that calls the vehicles and add them in a single group. Will look at it this weekend.

  • Like 1

Share this post


Link to post
Share on other sites

I have written a lot of code on dynamic convoys, motinf attacks, mechinf attacks, transp. helo attack etc.. It is one of my favorite subjects :-)

My dynamic scripts are elaborate and not so user friendly, so it's very nice that someone releases a script that can be easily used and practiced with.

 

> more than one vehicle

Because vehicles have problems driving in convoys and attacking in group formations, I choose to fire scripts for individual vehicles with markers that are close together. So it appears they drive in convoy and attack together but they are not grouped together. In Arma3, vehicles groups easily become a big mess.. If its just trucks on the road you might get away with it ;-)

 

A simple thing that maintains attack cohesion and avoids vehicles clashing and driving over their own infantry is to limit their speed. Limit overall speed, or just in the attack phase. Just the command _veh limitSpeed _x will do this.

 

 

When I get home I will take a look at your script, I'm interested!

 

 

  • Like 1

Share this post


Link to post
Share on other sites
30 minutes ago, joostsidy said:

I have written a lot of code on dynamic convoys, motinf attacks, mechinf attacks, transp. helo attack etc.. It is one of my favorite subjects :-)

My dynamic scripts are elaborate and not so user friendly, so it's very nice that someone releases a script that can be easily used and practiced with.

 

> more than one vehicle

Because vehicles have problems driving in convoys and attacking in group formations, I choose to fire scripts for individual vehicles with markers that are close together. So it appears they drive in convoy and attack together but they are not grouped together. In Arma3, vehicles groups easily become a big mess.. If its just trucks on the road you might get away with it ;-)

 

A simple thing that maintains attack cohesion and avoids vehicles clashing and driving over their own infantry is to limit their speed. Limit overall speed, or just in the attack phase. Just the command _veh limitSpeed _x will do this.

 

 

When I get home I will take a look at your script, I'm interested!

 

 

 

Yes I know all too well about convoys crashing into one another or poor patrolling ai next too the road.

But to be fair too BIS, they have DRAMATICALLY improved convoys when vehicles are grouped together.

 

That is definitely a solution, to create a convoy that isnt grouped together but limit the speed they travel at.

 

Would love your input. Thanks

Share this post


Link to post
Share on other sites

I took a look at your scripts, looks very nice! Much better code and commenting discipline than my stuff :-)

 

 

Have you thought about passing existing units to your script instead of spawning them?

         - If you use pre-created units (placed in the editor) you can customize them in detail (for instance with the Virtual Arsenal) and pass them to the script

         - With pre-created units you can re-run the script several times: I'm currently building a mission in which a platoon attacks, then retreats with a convoy to a fall-back position. They defend this position, after which they board the convoy again to fall back for a second time. It's a lot of fun playing as one of the platoon soldiers.

 

A suggestion to add to your system: One thing I did to increase realism is to do an 'infantry scatter'. Normally, squads that are finished with their waypoints just stand around in their perfect wedge formation. I make them scatter in a randomized circle pattern* with some units taking a knee. It looks really nice I must say and adds to the atmosphere.

 

* A random degree with distance multiplied by unit number in squad to make sure they never end up too close to another soldier.

 

 

 

Share this post


Link to post
Share on other sites
On 1/8/2017 at 0:29 AM, joostsidy said:

I took a look at your scripts, looks very nice! Much better code and commenting discipline than my stuff :-)

 

 

Have you thought about passing existing units to your script instead of spawning them?

         - If you use pre-created units (placed in the editor) you can customize them in detail (for instance with the Virtual Arsenal) and pass them to the script

         - With pre-created units you can re-run the script several times: I'm currently building a mission in which a platoon attacks, then retreats with a convoy to a fall-back position. They defend this position, after which they board the convoy again to fall back for a second time. It's a lot of fun playing as one of the platoon soldiers.

 

A suggestion to add to your system: One thing I did to increase realism is to do an 'infantry scatter'. Normally, squads that are finished with their waypoints just stand around in their perfect wedge formation. I make them scatter in a randomized circle pattern* with some units taking a knee. It looks really nice I must say and adds to the atmosphere.

 

* A random degree with distance multiplied by unit number in squad to make sure they never end up too close to another soldier.

 

 

 

 

Hi Joostsidy

 

Thank you very much. I am really bad at programming so if I dont comment my own stuff I forget what I did :)

 

I can definitely look at passing customised units to the vehicles. Shouldnt be too difficult (I said in every scripting endeavour of mine only to take a whole week to sort out 2 lines of script :P ). I am just finishing the convoy function of the script, then I will take a crack at it. It is a very cool idea.

 

Regarding the 'infantry scatter'. I really dont see any purpose for it. It might look cool, but the amount of low level coding needed to move units from the same group to different positions in different directions in different stances I really dont feel would be beneficial. Of course if you have the code and want to add it, then I am more than willing too.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
On 1/5/2017 at 2:04 PM, zagor64bz said:

Nice work there bro...

any way to have more than one vehicle? I would like to set up an "insurgent" QRF with an armed tecnical and a transport offroad or truck following behind....

Thanks man!

 

On 1/5/2017 at 3:12 PM, joostsidy said:

I have written a lot of code on dynamic convoys, motinf attacks, mechinf attacks, transp. helo attack etc.. It is one of my favorite subjects :-)

My dynamic scripts are elaborate and not so user friendly, so it's very nice that someone releases a script that can be easily used and practiced with.

*snip*

 

Okay so I have written a function which allows the user to add all the vehicles in a convoy.

Here is an example:

Quote

veh_1 = ["O_APC_Tracked_02_cannon_F",["marker_vehSpawn_01"],["marker_vehUnload_01"],["marker_attack"]] call TB_fnc_motoInfReinforce_Main; 
veh_2 = ["O_APC_Tracked_02_cannon_F",["marker_vehSpawn_02"],["marker_vehUnload_01"],["marker_attack"]] call TB_fnc_motoInfReinforce_Main; 

[[veh_1,veh_2,etc],80] spawn TB_fnc_createConvoy; 

/*
where [[vehicles], speedVar] spawn TB_fnc_createConvoy; 
(1st) 	vehicles (ARRAY of OBJECTS)	:	Array of vehicles that will form a group.
(2de*) 	speedVar (INTEGER)		:	Variable adjust the maximum speed the lead vehicle can travel at. 
									speedVar <= 0 will be default behaviour (no speed limit).
*/

NB you need to use call to execute the script. 

veh_1 is the lead vehicle and all other vehicles in the array *should* chronologically be added in the convoy. Also all other vehicles get the assigned markers of the lead vehicle.

 

I have tested it and should work fine but please play around with it and let me know of any shortcoming.

NB. I do suggested using different spawn markers for the time being for each vehicle you spawn. It seems to spawn them one on another otherwise. Will try and fix it in coming weeks.

 

  • Like 1

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

×