Jump to content

Recommended Posts

Hi all, as the title suggests, I'd like to have a convoy spawn at a start point and travel to an endpoint. I would like the convoy to spawn only when blufor are within the trigger area and when blufor exit the trigger area the convoy will despawn. 

If anyone has any idea how to implement this it would be much appreciated. 

 

 

Share this post


Link to post
Share on other sites

Welcome on forum. You can find many threads about convoys, using the search tool.

Anyway, I suggest you to prepare the convoy in editor.

- Don't spawn it, it's tricky and that can fail. On the other hand, you can customize all vehicles and all units in editor;

- disable simulation and visibility (show model) in editor for mission start

- group your vehicles in the right order of your convoy :  group vehicle 1 to leader, vehicle 2 to leader... (don't let the automatic grouping decide for who is who)

- name the group (example : group1)

- set the formation of the group to column;

- SET the behavior of the group to SAFE (the driver must be SAFE to drive as far as possible on roads)

- SET the drivers init with if (isServer) then {this disableAI _x} forEach ["FSM","AUTOCOMBAT","TARGET","AUTOTARGET"] };

  that way, the driver will stay safe even in combat area (but not all the other units)

- this setConvoySeparation 30; in init field of each vehicle

- this limitSpeed 40;   also in init field of each vehicle

 

For your trigger (server only), on act field:

{_x enableSimulationGlobal TRUE; _x hideObjectGlobal FALSE} forEach units group1;

 

Convoys are tricky to set because there are plenty of native Arma behavior for driving and fighting, and multiple problems with obstacle detection and reaction. Don't multiply waypoints (it's useless, even if a distant destination takes more time to be computed), avoid bridges (on many maps), avoid too narrow paths for big assets like HEMTT or tanks....

Have fun!

 

  • Like 1

Share this post


Link to post
Share on other sites

Pah. You are a lightweight, @pierremgi 🙂

 

If you are spawning it in script, check your intended route isn't borked using calculatePath. find a roadpiece at the convoy spawn point, spawn a vehicle there, get the next roadpiece, spawn another vehicle, set the direction according to the direction of the road.

Put a driver in each, add them all to the same group (In Ifrits and Marids, you'll need to add the gunners to the driver group too). Put them in safe behaviour mode, separation and limitspeed as you said, safe behaviour, disable their autocombat (leave the rest on) , allowcrewin immobile true and setunloadincombat false false, forcefollowroad true. Give them a single waypoint, job done. Sometimes at the start they'll get a bit confused but they'll get going eventually (perhaps a minute or two). The order of the convoy doesn't matter. It just doesnt. 🙂 If you are adding cargo crw, make them a different group.

 

There's a few other tricks going on, but those are not in use in this video. I check if they are alive and have a waypoint but not moved 10m for 30 seconds, then i give them a setvelocityspace nudge if there is nothing in front. This usually gets them going alhough it looks ugly so I stop doing that when players are nearby. If the convoy gets split up, lower the limit speed of the front vehicle.

 

9 out of 10 of my convoys reach their destination. It's best to use no more than 6 vehicles, but I have had 15 vehicle convoys working.

  • Like 1

Share this post


Link to post
Share on other sites
On 1/11/2021 at 4:04 AM, pierremgi said:

Welcome on forum. You can find many threads about convoys, using the search tool.

Anyway, I suggest you to prepare the convoy in editor.

- Don't spawn it, it's tricky and that can fail. On the other hand, you can customize all vehicles and all units in editor;

- disable simulation and visibility (show model) in editor for mission start

- group your vehicles in the right order of your convoy :  group vehicle 1 to leader, vehicle 2 to leader... (don't let the automatic grouping decide for who is who)

- name the group (example : group1)

- set the formation of the group to column;

- SET the behavior of the group to SAFE (the driver must be SAFE to drive as far as possible on roads)

- SET the drivers init with if (isServer) then {this disableAI _x} forEach ["FSM","AUTOCOMBAT","TARGET","AUTOTARGET"] };

  that way, the driver will stay safe even in combat area (but not all the other units)

- this setConvoySeparation 30; in init field of each vehicle

- this limitSpeed 40;   also in init field of each vehicle

 

For your trigger (server only), on act field:

{_x enableSimulationGlobal TRUE; _x hideObjectGlobal FALSE} forEach units group1;

 

Convoys are tricky to set because there are plenty of native Arma behavior for driving and fighting, and multiple problems with obstacle detection and reaction. Don't multiply waypoints (it's useless, even if a distant destination takes more time to be computed), avoid bridges (on many maps), avoid too narrow paths for big assets like HEMTT or tanks....

Have fun!

 

had a little issue with the script - i selected the group and hid it, but in reality only the vehicles (with troops inside) were hidden. so when i used {_x enableSimulationGlobal TRUE; _x hideObjectGlobal FALSE} forEach units group1 it didn't work. however, changing _x to (vehicle _x) fixed it. the final script that worked for me looks like this:
{(vehicle _x) enableSimulationGlobal TRUE; (vehicle _x) hideObjectGlobal FALSE} forEach units group1;

  • 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

×