Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

DTM2801

Member
  • Content Count

    118
  • Joined

  • Last visited

  • Medals

Everything posted by DTM2801

  1. Convoy creator & convoy control Version: 1.6 Description: This script wil create a convoy (configurable) and will keep monitoring all convoy vehicles for the correct distance by adjusting speed. If the distance between convoy vehicles gets too far the forward vehicle will slowdown and eventually wait until the follower gets back in acceptable distance. Usage: To make it more versatile there are 4 ways to make use of these scripts to suit your needs. 1. Convoy with default vehicles and cycle waypoint, spawns vehicles using the convoysize and default side vehicles with controlscript. null= [this,WEST,["convoywp1","convoywp2","convoywp3"],true,5,7,[],[],true,false]execvm "convoy.sqf"; 2. Convoy with classname vehicles, spawns all vehicles in the defined array with controlscript. null= [this,WEST,["convoywp1","convoywp2","convoywp3"],false,0,7,["HMMWV_M2","MTVR","HMMWV_M2"],[],true,false]execvm "convoy.sqf"; 3. Convoy with preplaced vehicles on the map, adds vehicles to an array and assigns waypoints and controlscript. null= [this,WEST,["convoywp1","convoywp2","convoywp3"],false,0,7,[],[veh1, veh2, veh3],true,false]execvm "convoy.sqf"; 4. Convoy with preplaced vehicles and waypoints on the map, using only the controlscript. veh1: first vehicle nothing veh2: null = [veh2,veh1,false] execVM "convoy_control.sqf"; veh3: null = [veh3,veh2,false] execVM "convoy_control.sqf"; veh4: null = [veh4,veh3,false] execVM "convoy_control.sqf"; (to enable/disable debug change option 3 to true/false) - Define a route for the convoy by placing and naming markers on the map. - Place a Game Logic on the map at the location and direction where you want the convoy to be spawned. - Put the initstring in the initialisation field of the Game Logic and maybe change to your needs. NOTE: ** Functions module must be placed on the map ** The included sample mission has all 4 different convoy options placed, including cargo (soldiers). Explanation of initstring: null= [1: objectname,2:side,3:["nameofmarker1","nameofmarker2","nameofmarker3"],4:cycle,5:convoysize,6:delay,7:["classname1","classname2",classname3"],8:[nameofvehicle1,nameofvehicle2,nameofvehicle3],9:wpmarkers,10:debug]execvm "convoy.sqf"; 1: _position : objectname where convoy is spawned (default: this) 2: _side : side of convoy vehicles (WEST, EAST, RESISTANCE, CIVILIAN) 3: _wparray : array of markernames used to create waypoints (have to be between "") 4: _cycle: turn on/off cycle waypoint, will be added by script (true/false) 5: _convoysize : number of default spawned vehicles * (default: 5) 6: _delay : time between vehicle spawns, needed to prevent pile ups (default: 7) 7: _vehiclearray : array of vehicle classnames by choice, will be spawned it the order left to right (default: []) 8: _customarray : array of vehiclenames preplaced in the map (default: []) 9: _wpmarkers : turn on/off display of waypoint markers on map (true/false) 10: _debug : turn on/off debug messages (true/false) * default side vehicle WEST = "MTVR" EAST = "Kamaz" RESISTANCE = "V3S_Gue" CIVILIAN = "UralCivil2" How to use the control script (convoy_control.sqf): - To tweak the convoy behaviour change the distance (example: _backdist > 80) or forcespeed (example: forceSpeed 0). If you any suggestions/comments to make this script work better please share your ideas. Changes: v1.1 - Added convoy tracking markers. - Some code cleanup. - Test mission cleared of external addons. v1.2 - Added description. v1.3 - Added vehicle names. - Added eventhandlers. - Added option to enable/disable waypoint map markers (found in convoy.sqf) - Dropped vehmarkers.sqf (still looking for a way to integrate in main script). - Updated convoy_control while parameter. v1.4: - Added side selection to init. (thanks zonker3210) - Added default vehicle for 3 sides. - Added init string checks. - Moved waypoint markers option to init. - Moved debug option to init. v1.5: - Introduced cases into the script for more flexibity. - Added multiple ways to use the script. (see usage notes) - Added createcenter to ensure vehicle spawns. - Added CIVILIAN to side choices. - some code cleanup. v1.6: - Added random units in cargo of spawned vehicles (thanks TRexian) - Added optional cycle waypoint ** remember to update the existing convoy initstrings ** - Improved control script (less distance, more speed) Todo: - Optional vehicle markers. Credits & special thanks: - TRexian for providing random cargo piece :cool: - Everyone who reads this. Mirrors: (including sample mission) Armaholic.com - http://www.armaholic.com/page.php?id=8286 ArmedAssault.info - http://www.armedassault.info/index.php?game=1&cat=addons&id=1137 AssaultMissionStudio.de - http://www.assaultmissionstudio.de/downloads.php?page_id=255 Filefront.com - http://www.filefront.com/14941751/convoy_v1.6.Chernarus.rar ** check for latest version number **
  2. I've found a way to create/save/share and use your own object compositions using slightly adjusted BIS scripts objectgrabber and objectmapper. Download and open the package at the bottom and place @SAP_render (thank you Sgt.Ace) in your arma2 dir, place objectmapper and objectgrabber in your missionsfolder. How to create a custom composition: Open the editor (2d) using the map "Render Island" Load the mission "objectgrabber". Place your objects on the map. If you want a custom object init you have to use this format in the initialisation field of the object otherwise it wont be grabbed: this setvariable ["VehicleInit","<YOUR INITSTRING>;"] Place the player unit in the middle of your composition and put this in its init: null = [getpos this,200] execvm "objectGrabber.sqf"; // (200 is the radius, adjust when needed). Preview the mission, the objects are now written in arma2.rpt. Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file composition_template.sqf at the marked area located in the missionfolder "objectmapper\compositions\". Remove , at the last line of the copied text. Example arma2.rpt ["MASH",[0,0,0],0,1,0], ["Land_GuardShed",[35.9503,29.7019,0],0,1,0], ["ACamp",[-41.3973,-33.6524,0],0,1,0], After editing ["MASH",[0,0,0],0,1,0], ["Land_GuardShed",[35.9503,29.7019,0],0,1,0], ["ACamp",[-41.3973,-33.6524,0],0,1,0] 9. Save the file in the missions compositions folder. How to place your created composition on the map: (in this example I use my sample map, but it works the same when using your own missionmap). Open the mission Render Island -> objectmapper. Place a gamelogic on the map and put this in the init: null= ["test_comp", getdir this, getpos this] execVM "Createcomposition.sqf"; (replace "test_comp" with your own compositioname without .sqf) Preview the mission and your composition is placed (you can place multiple and different compositions at once). I've also included the original BIS compositions. Custom compositions v0.3 Custom compositions v0.3 (RTE compatible) thanks Binesi Manhattan composition
  3. Can you use BIS_fnc_spawnGroup creating units of the faction from unit that calls it? This is the script I'm using: _cargoNum = _spawned emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = getpos _position; _locGr = _pos findEmptyPosition [10, 100]; _dir = getdir _spawned; if (_locGr select 0 > 0)then { _cargo = [_locGr,(side _spawned), _cargoNum,[],[],[],[],[_fillSlots,.5], _dir] call BIS_fnc_spawnGroup; {_x moveInCargo _spawned;} forEach units _cargo; if (_joingroup) then {{[_x] joinSilent (group _spawned)} forEach units _cargo;}; }; }; It choses the side of the unit, but how would I define lets say side WEST, faction BIS_US? I'm aware of the "CfgGroups" as described here, but how to incorporate that with the functionality of this script (spawning random side/faction soldiers based on the cargo space of the vehicle). Tips on how to achieve this would be much appreciated.
  4. Wow, you are going all out :cool:, gonna take your script for a spin. If this works, it shouldnt be a big leap using it to spawn units of the same vehicles side,faction taking available vehicle cargo space in account. (Having that said, didnt we talk about more simple? hehe) TEST Result: Looking good, like you said spawning WEST side US soldiers returns empty array. EAST and RESISTANCE work fine. If the _minUnits could be converted to _maxUnits based on cargo space its working exactly as wanted. Gonna dive in to it tomorrow after work:). Awesome job Demonized!
  5. Thanks I'll give that a go, still there must be a more simple way to do this. Without the faction in the equation the spawngroup function is pretty straight forward.
  6. Convoy Manager Version: 1.0 Author: DTM2801 Description: This addon wil create a fully configurable convoy and will monitor all convoy vehicles to maintain formation using fsm script. Standard settings can be changed in the userconfig file (more details below), but can also be changed in the initfield of the module through 'setvariable' commands. When a vehicle is unable to move (or driver is dead) an attempt will be done to reinventory available vehicles to restore the convoy formation. If the distance between convoy vehicles gets too far the forward vehicle will slowdown and eventually stop until the follower gets back in formation. This addon is MP compatible, running serverside only. Addon is signed and key is included. Usage: IMPORTANT: *** CM_config_DTM2801.hpp has to be placed in this location on your harddrive: <ARMA2 DIR>\userconfig\DTM2801 *** Convoy options: 1. Convoy with default vehicles, spawns vehicles using the convoysize and default side vehicles with controlscript. - Place the module [Convoy Manager - DTM2801] on the map where you want the convoy to start (incl. direction), settings will be read from the userconfig file. 2. Convoy with classname vehicles, spawns all vehicles in the defined array with controlscript. - Place the module [Convoy Manager - DTM2801] on the map where you want the convoy to start (incl. direction). - Module init: this setvariable ["CM_vehiclearray",["classname","classname"]]; or change the default values in userconfig file. This will change the default settings! 3. Convoy with preplaced vehicles on the map, adds waypoints and controlscript. - Place the module [Convoy Manager - DTM2801] on the map where you want the convoy to start (incl. direction). - Module init: this setvariable ["CM_customarray",[vehiclename,vehiclename]]; or change the default values in userconfig file. This will change the default settings! 4. Convoy with preplaced vehicles and waypoints, using only the control script. - Place the vehicles on the map and name them. - Vehicle inits: 1st vehicle - nothing next vehicles - nul= [this,true/false debug] execFSM "\CM_DTM2801\fsms\CM_control_DTM2801.fsm"; Details on the userconfig default values can be found in the file as comments. Editor module init variables: CM_location - Starting location of the spawned convoy (default: this) CM_side - Side of spawned vehicles (WEST,EAST,RESISTANCE,CIVILIAN) CM_wparray - Names of the waypoint markers (with "") CM_wpcycle - Waypoint cycle (true/false) CM_convoysize - Number of spawned convoy vehicles (default: 5) CM_delay - Time between spawns (default :7) CM_vehiclearray - Vehicle classnames to replace defaults (with "") CM_customarray - Vehicle names on the map (without "") CM_wpmarkers - Waypoint dots on the map (true/false) CM_debug - Debug messages (true/false) CM_west - Default West vehicle CM_east - Default East vehicle CM_resistance - Default Resistance vehicle CM_civilian - Default Civilian vehicle CM_vehname - Name of spawned vehicles, number will be added behind name (with "") Usage: this setvariable ["nameofvariable",[setting]]; for multiple entries like vehicles, waypoint marker names. this setvariable ["nameofvariable",setting]; for single entries like side, wpcycle, debug You can enter multiple variable strings in one placed module, so you have different kinds of convoys on the same map with its own settings (side,vehicles,waypoints, etc). Todo & upcoming features: - code improvements, depending on feedback. Please report any encountered errors/bugs. Required addons: - Community Base Addons Mirrors: Armaholic - http://www.armaholic.com/page.php?id=8389 Filefront - http://www.filefront.com/15003119/CM_DTM2801_v.1.0.rar
  7. You download, extract the archive and put manhattan.sqf in your missionfolder\compositions folder. The init would be: null= ["manhattan", getdir this, getpos this] execVM "Createcomposition.sqf"; This should work.
  8. Have you tried to change the side to "INS" in the initstring btw?
  9. You got a point there.. I'll have a look at the code tomorrow.
  10. Can anyone help me out with probably something I missed. First a little background info: I'm currently working on a modulair fsm driven convoy addon, what I'm trying to achieve is to select the vehicle (in the same group) in front of the current unit to start calculating distance and needed actions. This is called via a fsm script, but should be almost the same for a normal sqf aswell. Finding nearest objects with nearestObjects [(_unit select 0), [], 100]; goes fine, but will also find every other object within the radius. Question: How can I configure the findnearestobject (or other command which I dont know about) to filter and only find/allow vehicles that are in the current vehicles group or custom vehicle array (which is also available). Thanks in advance.
  11. DTM2801

    GLT Dynamic AI

    Interesting features, will try this when I get home.. thanks for sharing
  12. You can adjust the distance and speed in convoy_control.sqf, in the last version (1.6) the distance is too short and results in the stop and go behaviour and the distance (_dist) should be increased. You can tweak this yourself, but here is an better working version: This could be the result of a waypoint behaviour setting, if its not "SAFE" the vehicles wont stick to the road. If this is not the case please give some more info about what settings are used.
  13. DTM2801

    Convoy Manager

    Thanks for the tip, was looking for a cleaner way to achieve this.
  14. DTM2801

    Convoy Manager

    Addon version 1.0 released, all details can be read in mainpost and included readme.
  15. DTM2801

    Convoy Manager

    Its an addon but executed server-side, so clients dont need the addon. Its not tested by me on any mp map, but it should be fine. If you want a scripted version its here http://forums.bistudio.com/showthread.php?t=90208
  16. Thank you for the responses @Myke found what I was looking for in the overview (misc -> nearestPosition), thanks for posting the list.
  17. Its about time ;) If you want to change the waypoint type you could use the control-script only option. This will stay this way for these scripts (unless you code it yourself ofc) until I finish the replacement modulair scripts that will allow waypoints to be configured seperately.
  18. Thank you for pointing that out, was getting sick of reloading the game :) This is an example how I use the combination of hpp and object variableset: _vehiclearray = if (isnil {_location getvariable "cm_vehiclearray"}) then {CM_DTM2801_vehiclearray} else {_location getvariable cm_vehiclearray"}; _location setvariable ["cm_vehiclearray",_vehiclearray]; Indeed, that's what makes this interesting for me too.. scavaging for knowledge and trying to fit it all together by trial and lots of error :p
  19. I found this in ambientcombat.fsm, might be useful //Create database of groups from CfgGroups to base spawned groups on. private ["_db"]; _db = []; private ["_cfgGroups", "_cfgWest", "_cfgEast", "_cfgGuerilla"]; _cfgGroups = configFile >> "CfgGroups"; _cfgWest = _cfgGroups >> "West"; _cfgEast = _cfgGroups >> "East"; _cfgGuerilla = _cfgGroups >> "Guerrila"; //Extract all groups for all factions. { private ["_cfgFaction", "_grpsFaction"]; _cfgFaction = _x; _grpsFaction = []; //Find all groups defined for various subtypes. { private ["_cfgType", "_groups"]; _cfgType = _cfgFaction >> _x; _groups = []; for "_i" from 0 to ((count _cfgType) - 1) do { private ["_class"]; _class = _cfgType select _i; //Only take actual classes. if (isClass (_class)) then { _groups = _groups + [_class]; }; }; _grpsFaction = _grpsFaction + [_groups]; } forEach ["Infantry", "Motorized", "Mechanized", "Armored", "Air"]; _db = _db + [_grpsFaction]; } forEach [_cfgWest >> "USMC", _cfgWest >> "CDF", _cfgEast >> "RU", _cfgEast >> "INS", _cfgGuerilla >> "GUE"]; //Store database in the ACM. _acm setVariable ["dbGroups", _db];
  20. Yes, this was my thought at first too.. until I found out the use of standard default (although user-adaptable) hpp values combined with the variable setting which are set through the init of the module on the map like the BIS modules, this can make each placed convoy module work with its own settings, hence hold the config for a shared mission. I'll check out your post :)
  21. The control script changes arent working that well, for a quick fix I recommend reverting back convoy_control.sqf to v1.5. Just copy/paste this in the existing version (or save as new file and name it convoy_control.sqf): As the setup strings in its current form are getting out of hand, I decided to switch to a module based solution (thanks for the headsup TRexian). This does mean there will be no more updates of this script as it is now, but there will be a modularized version 2.0 release which will upgrade this project. This will make it alot easier to use and way more flexible/configurable to suit everyones needs.
  22. Script update to v1.6: - Added random units in cargo of spawned vehicles (thanks TRexian) - Added optional cycle waypoint ** remember to update the existing convoy initstrings ** - Improved control script (less distance, more speed)
  23. It could make the convoy placement alot easier :p, in the upcoming version there are 10 config fields to be filled through the initstring (which will be released tonight). I'll have a good look at your ambientciv work, might be a convoy 2.0 revamp. Thanks for the tip :cool:.
  24. You can put the initstring in the On Act. field of a trigger. The GL will only function as a locationholder then, so leave the initfield empty. -Place a GL on the map where you want the convoy to start and give the GL a name, lets say for this example GLNAME. example with standard initstring: null= [[b]GLNAME[/b],WEST,["convoywp1","convoywp2","convoywp3"],5,7,[],[],true,false]execvm "convoy.sqf"; Hope this helps :)
  25. At the moment you can place your own vehicles on the map with their waypoints (using any type you wish) and make use only of the control script.(see usage nr4). Although the idea of making waypoints more configurable is something I might pickup somewhere in the next releases :). Haven't seen this happen before, which convoy type are you using? (initstring would be nice)
×