Devastator_cm 434 Posted November 13, 2016 Hi Guys, My first project which is for AI Convoys and vehicle patrols. Initial idea is based on Norrin's convoy script for which I got permission to modify from Norrin. I rewrite the scripts and now it has several new features and working. Convoy & Vehicle Patrol Features AI convoy and patrol which follows roads and keeps the distance between vehicles Defending the convoy in case they notice enemies or being attacked by enemies Intel share related to enemy positions between convoy vehicles. Attack position selection based on convoy vehicle and enemy type. For example a tank will move closer to enemy armored units to attack instead of moving closer to infantry units. Distance to enemy and amount of enemy in a specific area can influence the decision for attack position. Restarting the convoy route after danger is eliminated Units whose vehicle is destroyed, will try to find seat in other vehicles in convoy. In case there isn't any available they will walk to final marker on foot Dead gunners and drivers will be replaced by AI units who sit at cargo of any vehicle, when enemy threat is eliminated. In case a vehicle's driver is killed during gun fight, another AI in same vehicle will try to move to gunner position After an ambush, the groups who sits inside same vehicle will be merged to prevent single unit groups. Only exception is for the vehicles who has guns. For such vehicles there will be two groups; (1) group for the units in cargo, (2) group for the vehicle units (gunner(s), driver, commander) Leader in merged group will be moved to the unit which has highest rank Possiblity to have multiple convoys in same mission Possibility to have patrol behaviour Possibility to extend the logic by adjusting ConvoyEnd.sqf file. In this file you can add your own custom code or script call. The file is called when convoy reaches final marker Script can be called from triggers or init.sqf Keep in mind this script is for AI. So if you put a player in one of the vehicle it might cause issues (or work without issue :) ). Future Plans I am open to any suggestions. Known Issue(s) I just encountered this in during my last test with a BTR-60P (Project Opfor Mod) that it simply didn't start moving. Reason was the unit in commander seat. After I remove him problem solved. At the moment I don't know why it caused such an issue. I had no issue with RHS BTR with Russian units inside though. In case you encounter such problem you can do a workaround. Do not put any unit in commander seat in mission design and lock the commander seat of the vehicle by adding following into INIT field of the problematic vehicle this lockturret [[0,0],true]; Thanks to @Duke101 it appears that acex headless client is causing issues. So following variable need to be set by each convoy vehicle before starting the convoy from server this setVariable ["acex_headless_blacklist", true, true]; Credits Norrin, thanks to you once more for the initial scripts and the idea! Download Dropbox (version 2.5) Armaholic (version 2.5) Sample Mission Dropbox Usage Details are in readMe.txt inside the zip. Examples about how to add custom code or introduce a patrol behaviour are inside ConvoyEnd.sqf. Sample mission can be found above. Version History v.2.5 Fixed: Logic Objects on map can cause aircraft to stuck in combat mode over an area as such objects might be categorized as enemy. Removed: Restart Delay parameter is removed. Added: Attack location evaluation based on enemy and convoy vehicle. For example, tank class vehicles will try to come closer to enemy tanks instead of enemy infantry. Added: During restart phase if another attack happens to convoy, units will start defence again. Tweaked: Restart phase is optimized. It will require less time to start convoy again. Tweaked: Enemy aircrafts will not be considered as enemy and will not stop the convoy. Tweaked: Some code optimizations. v.2.2 Fixed: Workaround applied due to bug in BIS_fnc_EnemyTargets function which does not consider static weapons as enemy v.2.1 Fixed: Paths which are circular were causing the convoy to stuck. v.2.0 Added: New parameters are added and they are moved into script call Added: ConvoyEnd.sqf file added to provide possibility to user to add his/her own code or script calls. This specific file is called when convoy reaches final marker Added: Multiple convoys are possible Added: Patrolling is possible (thanks to ConvoyEnd.sqf) by repeating the convoy call inside this file Added: Units are looking for another vehicle to get in, incase their vehicle is destroyed or not able to move Added: Dead gunner is replaced by other units in vehicle during firefight when there is a possibility (if they are under fire or enemy is danger close this will not happen) Added: Merging of groups (after ambush) and assigning the unit with highest rank as leader added. v.1.0 Initial version Enjoy! 10 Share this post Link to post Share on other sites
DmitryJDM 1 Posted November 14, 2016 good work comrade! i have error http://i.imgur.com/Ks0mhIH.png run in initServer.sqf: [["m_convoy_1", "m_convoy_2", "m_convoy_3", "m_convoy_4"],["DMSK_ConvWeapons1", "DMSK_ConvWeapons2", "DMSK_ConvWeapons3"]] execVM "scripts\convoy\convoyInit.sqf"; Share this post Link to post Share on other sites
Guest Posted November 14, 2016 Release frontpaged on the Armaholic homepage. Devas Convoy v1.0 Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 14, 2016 Thanks @foxhound.@Dimas1k I dropped you PM. Share this post Link to post Share on other sites
Undeceived 392 Posted November 14, 2016 Wow, good to hear you're picking up norrins work. great job and thanks for it! I have two questions: 1. Is it possible to have 2 or more convoys in a mission m, without having to rewrite resp. rename all variables in all scripts (which I did, which was quite an amount of work, but it was worth it. :) )? 2. Does the convoy drive a bit faster than in norrin's script (which was pretty slow)? Thanks again! Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 14, 2016 Answers are1- No but I can adjust it in next release2- Yes they are faster. There is even a parameter where you can adjust the speedlimit if you want. Default is 35 kmh at the moment. Share this post Link to post Share on other sites
Undeceived 392 Posted November 15, 2016 Perfect, thanks a lot! Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 15, 2016 good work comrade! i have error http://i.imgur.com/Ks0mhIH.png run in initServer.sqf: [["m_convoy_1", "m_convoy_2", "m_convoy_3", "m_convoy_4"],["DMSK_ConvWeapons1", "DMSK_ConvWeapons2", "DMSK_ConvWeapons3"]] execVM "scripts\convoy\convoyInit.sqf"; Information for all, here the problem was the script call. Vehicle names should not be between "". Only markers should be between "" The issue which I mentioned in open points (BTR-60 with commander) might happen with other vehicles. It is not related to the convoy script. You can check if your vehicle setup is ok or not by just running a domove command from editor v2 domove getmarkerpos "pos_2" If vehicle moves then all fine in your setup, if not then your vehicle has issue with the commander and that unit need to be removed otherwise it will block all convoy. Be sure there is no unit in vehicle who might sit at commander seat after an ambush for such vehicles, which means for problematic vehicles keep gunner(s) and driver. Like said this issue is happening without convoy script for some specific vehicles. I wrote a message already to OPFOR mod as I used their ISIS BTR-60 and domove command (also the waypoints) did not work to move the vehicle when commander was inside Share this post Link to post Share on other sites
autigergrad 2034 Posted November 21, 2016 Awesome! I love Norrins Convoy script. Easily one of the coolest missions/tasks for ARMA with ambushing a convoy. Glad to see you are adding to it! Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 21, 2016 I just finished testing the new version and releasing it now to community. Keep in mind I was testing it alone so there might be issues which I didn't see by myself. Just inform me if you encounter something and I will look at it. Biggest changes in this version are Possibility to have multiple convoys in single mission Having possibility to create patrolling behaviour Giving user a clean place where he/she can add own script calls (or code pieces) when convoy reaches final marker. So you will not need to implement trigger logic in final point to let convoy do something else for example v.2. New parameters are added and they are moved into script call ConvoyEnd.sqf file added to provide possibility to user to add his/her own code or script calls. This specific file is called when convoy reaches final marker Multiple convoys are possible Patrolling is possible (thanks to ConvoyEnd.sqf) by repeating the convoy call inside this file Units are looking for another vehicle in case their vehicle is destroyer or not able to move Dead gunner is replaced by other units in vehicle during firefight when there is a possibility (if they are under fire or enemy is danger close this will not happen) Merging of groups (after ambush) and assigning the unit with highest rank as leader added. 3 Share this post Link to post Share on other sites
Guest Posted November 21, 2016 Release frontpaged on the Armaholic homepage. Devas Convoy v2 Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 21, 2016 Thanks FoxhoundJust a small note to you The script call as well as the parameters passed Are adjusted in this version. I described in read me file. Could you please also adjust it in armaholic please? Share this post Link to post Share on other sites
Guest Posted November 22, 2016 Done, I have updated the Armaholic downloadpage with the instructions from the included readme. Thanks for letting me know :) Devas Convoy v2 Share this post Link to post Share on other sites
Undeceived 392 Posted November 22, 2016 Good progress here, thank you, Devastator! Share this post Link to post Share on other sites
autigergrad 2034 Posted November 22, 2016 I looked in the readme and didn't see this so I'll ask... If I want multiple convoys...what is the naming convention I need for each? c1,c2,c3 d1,d2,d3? Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 22, 2016 there is no naming convention. I use myself more clean names for arrays especially by vehicle array, i.e. [btr_1, tank_1, truck_1, truck_2] of course same vehicle should not be written in two convoy calls otherwise background process will try to move the vehicle to two markers at the same time :) On the other hand same marker can be used for two different convoys, very simple example would be if you want two convoys start from same place or end at same place. Share this post Link to post Share on other sites
randy andy tw1 12 Posted November 23, 2016 _handle = [["cm1","cm2","cm3","cm4","cm5","cm6","cm7","cm8"],[v1,v2,v3,v4,v5,v6], 35, 500, 120, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; with CM being the convoy markers and v1-6 being the vehicles, i get the following rpt error 11:26:27 Error in expression <00, 120, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; }; 11:26:27 Error position: <DEVAS_ConvoyMove; }; 11:26:27 Error Undefined variable in expression: devas_convoymove followed the read me which stated Code: if (isServer) then { _handle = [["pos_1","pos_2","pos_3","pos_4"],[v_1,v_2,v_3], 35, 500, 120, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; }; have i missed something? Share this post Link to post Share on other sites
randy andy tw1 12 Posted November 23, 2016 ....doh.. called the _handle too soon convoy\convoyInit.sqf Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 23, 2016 :)I am at work so cannot check the zip. Did I not write in help to use the init file first? If not then my bad :( Share this post Link to post Share on other sites
4-325Ranger 62 Posted November 23, 2016 Devastator, Thanks for this! I finally got a chance to test this last night. I ran 3 iterations in SP with ACE and RHS on. I ran a blufor convoy with AI ambushes along a route on Takistan Mountains. I ran a mix of vehicles all three times. Two of the runs went out without a hitch, was really impressed watching the whole thing unfold in Zeus. 2nd of the 3 runs - The lead vehicle got hit, wounded driver got out, did not run to trail vehicles; 2nd vehicle killed the offender, but never took the lead, just kind herky-jerky'd in place for a while and then all vehicles froze. I don't know if it was due to the convoy being in the middle of turning at a marker and getting ambushed at the same time causing a confilct? I'll try to recreate later today. Even with this minor issue, this particular script really opens up several mission scenarios for mission making, I've been waiting for something like this to come along for a while in Arma 3 - great work!! Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 23, 2016 hmm that is weird. I tested also in that way where I destroyed first vehicle. So after ambush finishe soldiers didn't get in to vehicles?Keep in mind there are wait events after ambush which can cause 5-6 minutes until they pack up their stuff and decide to drive further Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 24, 2016 Version 2.1 released. Small bug fix which is related to stucked convoy in circular convoy paths. @4-325RangerI beleive it will also solve the problem which you faced Still I would suggest not to plan a convoy ambush in areas where convoy is very close to the marker. I tested it and had no issue at the moment but I have a feeling that there might be a special case which I miss during test @foxhound can you adjust the Armaholic subject like in forum? It is not just convoy anymore as it can provide patrol functionality since v.2. :) Devas Convoy & Vehicle Patrol 2 Share this post Link to post Share on other sites
.kju 3245 Posted November 24, 2016 Looks like very good progress! Do you mind adding one or few demo missions that demonstrate well the difference to the standard behavior please? Also do you make use of any of the scripting commands available for the new convoy behavior? Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 24, 2016 Thanks .kju :)Actually a very good idea to put some videos :)Can you suggest me a program to edit videos maybe? I didn't do such thing before. Which particular commands do you mean regarding the behaviour btw? Share this post Link to post Share on other sites
Guest Posted November 24, 2016 New version frontpaged on the Armaholic homepage. Devas Convoy & Vehicle Patrol v2.1 @foxhound can you adjust the Armaholic subject like in forum? Devas Convoy & Vehicle Patrol Done ;) Share this post Link to post Share on other sites