Convoy script - Printable Version +- Comrades in Arms Discussion Board (http://forum.ciahome.net) +-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3) +--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8) +--- Thread: Convoy script (/showthread.php?tid=4037) |
Convoy script - Siil++ - 08-09-2020 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. Convoy script - Variable - 08-10-2020 Commented liked and subscribed!!! (pinned) Siil, you rock my world. RE: Convoy script - Alwarren - 08-10-2020 Variable Wrote:Commented liked and subscribed!!! (pinned) What, you don't like humping trees? Thanks for the script, Siil! RE: Convoy script - Benchmark - 08-16-2020 Thanks Siil! RE: Convoy script - Alwarren - 05-14-2022 I took Siil's script and added a few modifications to it.
I switched this to waypoints for a number of reasons. One of them is that waypoints are connected with lines and thus make it easier to make sure the convoy route is on the roat. The waypoints are actually deleted in the convoyInit script, they are just for reference. I use this in my functions library to create the functions: Quote:class Convoy |