As the first live trial of my convoy script was a success, I'll post it here incase others want to make convoy missions and live out years of frustration of waiting with your mines while trucks hump trees 10 miles away.
There are two script files
- convoy.sqf which handles the movement and
- ambushaction.sqf which handles what individual vehicles do when under fire.
tl;dr what is needed to get a convoy running -
You need your convoy vehicles, not grouped with each other and placed on the road in the desired order. The vehicle names must be conveh_1, conveh_2, conveh_3 etc.. They don't need to be placed in the numerical order of the names.
On the convoy path, place logics conwp_1, conwp_2, conwp_3 etc... These must be in numerical order.
The easiest way to do this is place a logic conwp and then when you copy and paste it on repeat, the index numbers are automatically generated.
Consider the logics as waypoints the vehicles will drive to reasonably directly. This means you can skip directly over some spooky narrow road S shape in the middle of nowhere.
Vehicles and logics placed, then just do null = [] execVM "convoy.sqf" at your time of choice.
When the convoy comes under fire either one of these conditions has happened:
-One of the vehicles can't move
-Has received a large amount of damage
-The driver is dead
Then convoy.sqf ends and the actual convoy stops with ambushaction.sqf executed on every vehicle. Also a variable "ambushed" is set to =1. Can be used to trigger QRF and stuff.
By doing "this setvariable ["ambush_type",-type-];" in the vehicle editor init field, you can choose what behaviour ambushaction will command:
type "tank" - seek and destroy
type "apc" - dismount infantry, then seek and destroy
type "truck" - dismount everyone (so no "Why yes, the lead tank just got taken out by an ATGM and mines are going off all around. Best to stay calmly at the wheel.)
default if the variable is not set = seek and destroy
Haven't commented or polished the script - maybe I'll do it I reach some final version I'm completely happy with. Or maybe some other professional programmers can pick up the idea do it in a correctly presented manner.
There are two script files
- convoy.sqf which handles the movement and
- ambushaction.sqf which handles what individual vehicles do when under fire.
tl;dr what is needed to get a convoy running -
You need your convoy vehicles, not grouped with each other and placed on the road in the desired order. The vehicle names must be conveh_1, conveh_2, conveh_3 etc.. They don't need to be placed in the numerical order of the names.
On the convoy path, place logics conwp_1, conwp_2, conwp_3 etc... These must be in numerical order.
The easiest way to do this is place a logic conwp and then when you copy and paste it on repeat, the index numbers are automatically generated.
Consider the logics as waypoints the vehicles will drive to reasonably directly. This means you can skip directly over some spooky narrow road S shape in the middle of nowhere.
Vehicles and logics placed, then just do null = [] execVM "convoy.sqf" at your time of choice.
When the convoy comes under fire either one of these conditions has happened:
-One of the vehicles can't move
-Has received a large amount of damage
-The driver is dead
Then convoy.sqf ends and the actual convoy stops with ambushaction.sqf executed on every vehicle. Also a variable "ambushed" is set to =1. Can be used to trigger QRF and stuff.
By doing "this setvariable ["ambush_type",-type-];" in the vehicle editor init field, you can choose what behaviour ambushaction will command:
type "tank" - seek and destroy
type "apc" - dismount infantry, then seek and destroy
type "truck" - dismount everyone (so no "Why yes, the lead tank just got taken out by an ATGM and mines are going off all around. Best to stay calmly at the wheel.)
default if the variable is not set = seek and destroy
Haven't commented or polished the script - maybe I'll do it I reach some final version I'm completely happy with. Or maybe some other professional programmers can pick up the idea do it in a correctly presented manner.