Speed Posted August 31, 2011 Posted August 31, 2011 Similar to the mission editor hot tips post Madtommy started back in DCS: Black Shark, I thought it would be a good idea to share some ideas or tips we had thought of or found that might be uncommon knowledge. 1) Getting attacking ground units to retreat In real life, attacking enemies retreat when they take heavy losses, but without using the trick I am about to describe, our only options are to make them stop or keep attacking to the last man. Since none of the units in the game are manned by Bushido warriors on a Banzai charge, neither option is realistic. As Grimes first pointed out, when ground units are tasked to drive over a bridge, and ahead of them, that bridge is destroyed, they switch automatically to their last waypoint. This proves that some sort of waypoint-switching appears in the code for ground units. Unfortunately, it is inaccessible to Lua, or so all my experiments seem to indicate. That said, we can use the behavior to our advantage to make attacking units retreat. Here's how: 1) Give the ground units a set of attack waypoints. Give the last waypoint in the attacking waypoints a hold position command of some sort. Also make sure not to have any of the waypoints cross a bridge. Personally, what I do is to blow up all bridges (simulating combat engineers sabotaging them to slow an enemy advange), and then have the attacking units drive around the blown bridges. Just make sure none of them are trying to cross the bridges! 2) Add a further waypoints past the attacking waypoints, and make it go to a distant part of the map, bypassing all bridges if at all possible. Make sure that the ground units will actually plot a path to this distant area of the map. You will need to use off-road waypoints alot. Now make these waypoints cross a bridge on this distant portion of the map. 3) Create a zone at this distant bridge, and a trigger to blow this bridge up (explosion in zone) 4) Create one last waypoint, a "retreat" waypoint, that is where you want the enemies to retreat to. 5) Now, all you have to do is trigger the explosion of that distant bridge, and the enemies will halt their attack, turn around, and start retreating! 2) Replicating static structure groups: The best way I can think of to replicate an arrangement of static buildings is to place units directly over them (and I mean exactly on top of them, at max zoom level). Name a solder placed directly over a helipad something like "helipad hdg 340", so that the unit tells you the structure type, and heading that the structure is supposed to be set to. Place another nearby soldier on top of another building, name him something like "hanger hdg 70". And so on. Now that you have units placed directly on top of all the structures, and have them named to tell you what type of building and at what heading, take that group of units and either drag or copy them to somewhere else. If you copy them, I believe the names will change to like, "helipad hdg 340#1" since there is already a "helipad hdg 340" unit in the mission. 3) Make artillery shoot at a unit I haven't tested this yet in 1109, but it should work. For each artillery group, change the entries in the artyunits table to match names of the artillery units in the group, and change the entries in the targetunits table to make the names of the target unit(s) you want the artillery to try to hit. You could call this script, for example, to try to make mortars land on top of people who are poking along on an airbase :devil: if true then --Enter the artillery units local artyunits = { 'arty1_1', 'arty1_2', 'arty1_3', 'arty1_4' } --Enter the target units local targetunits = { 'target1_1', 'target1_2', 'target1_3', 'target1_4' } --Set the radius around the unit you're firing at local radius = 100 --Modify nothing below this line------ ---------------------------------------------------------------------------------------------- for i = 1, #artyunits do if Unit.getByName(artyunits[i]) ~= nil then local arty_ind = i for j = 1, #targetunits do if Unit.getByName(targetunits[j]) ~= nil then local firemission = { id = 'FireAtPoint', params = { y = Unit.getByName(targetunits[j]):getPosition().p.z, x = Unit.getByName(targetunits[j]):getPosition().p.x, zoneRadius = radius } } Unit.getByName(artyunits[arty_ind]):getController():setTask(firemission) break end end break end end end I'll give it a test tonight. I'm thinking of integrating some simple artillery commands into slmod before I integrate the full autoarty function set. 4) Make units disperse to the "four winds": If you set up really huge templates where units are all spread out over many kilometers, you can make units disperse very widely by using a "deploy to template" trigger action. Anyway, that's all I can think of for now. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Grimes Posted August 31, 2011 Posted August 31, 2011 4) Make units disperse to the "four winds": If you set up really huge templates where units are all spread out over many kilometers, you can make units disperse very widely by using a "deploy to template" trigger action. To expand on this point... -Deploy to template is based off of the orientation and position of the first unit in the group. -Any waypoint based movement breaks the template and the AI will form whichever formation the waypoint is set to. -About a minute timeout exists for the AI to deploy to a template. They will simply stop once that timelimit is reached. Calling the same action again or using different stop to template will make em for the corresponding template. -If lead vehicle is destroyed, the next vehicle becomes the "lead" and everything is based on it. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts