Deck Posted May 14, 2013 Share Posted May 14, 2013 (edited) Here's a sample mission with scripted troop pickup/dropoff. It uses coalition.addGroup() and missionCommands.addCommandForGroup() for spawning, with built-in waypoint so the dropped troops navigate to the nearest objective area. The biggest problem I encountered while making this was understanding how missionCommands.addCommandForGroup() actually functions in multiplayer, because things that appear to work for the mission host may not be available for other players, depending on the circumstances. Specifically, you cannot simply call addCommandForGroup for each client group at mission start. Rather, you must only call addCommandForGroup when that group is populated by a client, requiring the script to use a periodic timer to check the client slots for non-nil state. There are still a lot of new features to add to this mission, but I thought I should post this before it gets even more complicated, in the hope that others can learn from it. Anyway, here's a syntax highlighted copy of the Lua, and it's also attached, and embedded in the attached miz. http://pastebin.com/6awatkUz Here's a video showing a hot-drop of troops via the radio command: http://www.twitch.tv/dickfly/c/2281684 Followup-comment: The infantry AI in DCS can use some improvement. They seem to path around buildings just fine, unless there are enemies nearby, in which case they will *always* assume a defensive posture, even if the enemies have no line-of-sight due to terrain or structures. The consequence is that troops dropped into a city will fail to kill their enemies, even if the enemy is vastly outnumbered. Troops that have entered "combat mode" will sit in place if their line-of-sight to the target is obstructed, and they seem unable to re-route and engage. Update May 14: Updated the mission to include evacuating/relocating troops. Attached as HueyDrop2.miz.HueyDrop.mizNewHuey.luaHueyDrop2.miz Edited May 15, 2013 by Deck 10 Link to comment Share on other sites More sharing options...
AlaskanGrizzly Posted May 14, 2013 Share Posted May 14, 2013 That was a blast. It felt like DCS: Arma. Thanks! 1 Link to comment Share on other sites More sharing options...
EagleEye Posted May 14, 2013 Share Posted May 14, 2013 Sounds cool. Will have a look at it when at home. Thanks for sharing. Deutsche DCS-Flughandbücher SYSSpecs: i7-4790K @4GHz|GA-Z97X-SLI|16GB RAM|ASUS GTX1070|Win10 64bit|TrackIR5|TM Warthog/Saitek Pro Pedals Link to comment Share on other sites More sharing options...
MagicBra Posted May 14, 2013 Share Posted May 14, 2013 Thanks a lot, this is excellent. The code is very instructive, I was really hopping for someone to make something like that. Can this be reused it in a scripting tutorial (and obviously naming you in the credits) ? 1 VEAF - Virtual European Air Force- www.veaf.org Association européenne de simulation évoluant sur DCS, BMS et ArmA3. Nous rejoindre : http://www.veaf.org/fr/association/formulaire-de-contact Link to comment Share on other sites More sharing options...
Robert1983NL Posted May 14, 2013 Share Posted May 14, 2013 Having seen the video... Awesome work! This is the kind of stuff we need for the Huey! Link to comment Share on other sites More sharing options...
Midnight Posted May 14, 2013 Share Posted May 14, 2013 Very cool script man, is there a way to pick up the troops inserted, what's left of them I mean? Link to comment Share on other sites More sharing options...
galevsky06 Posted May 14, 2013 Share Posted May 14, 2013 Yes excellent Link to comment Share on other sites More sharing options...
ericoh Posted May 14, 2013 Share Posted May 14, 2013 This is so cool, good job! 1 Link to comment Share on other sites More sharing options...
leonpo Posted May 14, 2013 Share Posted May 14, 2013 great mission leon 1 Link to comment Share on other sites More sharing options...
EagleEye Posted May 14, 2013 Share Posted May 14, 2013 Just played it with a squadron mate and it`s fantastic.:thumbsup: Please please expand it! That is a great example of a typical Huey mission. I love it. Don`t look at pics...spoiler! Rep inbound. 1 Deutsche DCS-Flughandbücher SYSSpecs: i7-4790K @4GHz|GA-Z97X-SLI|16GB RAM|ASUS GTX1070|Win10 64bit|TrackIR5|TM Warthog/Saitek Pro Pedals Link to comment Share on other sites More sharing options...
harock Posted May 15, 2013 Share Posted May 15, 2013 Played this mission online. Very excited! It would be awesome if you could command troops eventually! Super cool thanks Glad i know about the defensive troop problem, i had that happen to me 1 Link to comment Share on other sites More sharing options...
Fuby Posted May 15, 2013 Share Posted May 15, 2013 Not only did this mission humble me in my lack of landing in the proper place.. or safely at all sigh.. it made me appreciate the purchase of the Huey twice as much.. excellent work Deck.. thanks for sharing! Great practice for those landings under fire. what a thrill! 1 Games-Survival.com Link to comment Share on other sites More sharing options...
Deck Posted May 15, 2013 Author Share Posted May 15, 2013 (edited) Very cool script man, is there a way to pick up the troops inserted, what's left of them I mean? Yes! Added this to the original post, attached as HueyDrop2.miz. I also enabled Combined Arms, so that pilots can direct the dropped soldiers. For example, if they're being too shy, you can switch their alert status to GREEN and they'll advance. (And get mowed down because they're not combat ready.) The behavior is a little quirky though. According to the 1.2.4 draft script reference, unit:Destroy() isn't remoted, but group:Destroy() is... so I can't easily implement logic where your helicopter will load the 11 nearest troops, regardless of their group association. Instead it must load whole groups, which complicates matters. Instead of trying to implement a search algorithm to attempt to "fill" all 11 passenger slots in the helicopter, I just grab the entire group you've landed nearest, regardless of its size. Consequently you might only be able to load the 3 surviving members of a (previously) 11 member squad. I think this is a good compromise for simplicity, until unit:Destroy() is remotable. On the TODO list: - Add an OnCrash event handler to mark the crashed chopper as empty (and announce the unfortunate innocent deaths to shame the pilot) - Add OnDead event handlers and a cross-reference table to credit the pilots for kills achieved by the ground units they inserted. - Entirely new missions based on this system, such as a team-versus mode. Edited May 15, 2013 by Deck Link to comment Share on other sites More sharing options...
Fuby Posted May 17, 2013 Share Posted May 17, 2013 This is such a fun small Muliplayer mission as well as the learning aspect! Can't wait till you release the next installment!! Games-Survival.com Link to comment Share on other sites More sharing options...
Mike Busutil Posted May 17, 2013 Share Posted May 17, 2013 Are we supposed to replace the original .lua file with this new one? What are we doing with this file? [sIGPIC][/sIGPIC] Checkout my user files here: https://www.digitalcombatsimulator.com/en/files/?CREATED_BY=Mike%20Busutil&set_filter=Y Link to comment Share on other sites More sharing options...
pakfront Posted May 17, 2013 Share Posted May 17, 2013 (edited) Been playing this SP, as it's great landing/takeoff practice. I*'m a little out-gunned in SP since door gunners don't fire yet. So, a nice addition would be arty or gunship prep of an LZ. Either the player could use radio F10 to designate an LZ to prep, or the Mission could select one, give a time-to-target. The last option sounds fun as it would give a time element to the player as well - you want to land as soon as possible after the arty stopped... but not too soon! What are we doing with this file? It's just an example lua script. You don't need it to play the mission. Edited May 17, 2013 by pakfront Link to comment Share on other sites More sharing options...
fangav Posted May 18, 2013 Share Posted May 18, 2013 The AEF love this. A great little hot LZ mission. Rep inbound [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
shelt Posted May 24, 2013 Share Posted May 24, 2013 Thanks for this. Nice work Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift Link to comment Share on other sites More sharing options...
Yurgon Posted May 24, 2013 Share Posted May 24, 2013 Great training mission! :thumbup: I just flew it SP for an hour or so. I hope some more training in this mission will finally help me sort out my VRS problems that had me crash so many times already. :joystick: Link to comment Share on other sites More sharing options...
Fuby Posted May 24, 2013 Share Posted May 24, 2013 (edited) On the TODO list: - Add an OnCrash event handler to mark the crashed chopper as empty (and announce the unfortunate innocent deaths to shame the pilot) - Add OnDead event handlers and a cross-reference table to credit the pilots for kills achieved by the ground units they inserted. - Entirely new missions based on this system, such as a team-versus mode. Hey deck, I noticed you added the HueyDrop2 to the "missions" forum today and was wondering if it is the same lua as in the HueyDrop2 here or has the updates been added? This is such a good template for missions it's all I run on my part time server.. expanded east and west already with new drop points and it seems to be well liked by those that stop in. The biggest confusion is in the once pilot/chopper killed.. on respawn they actually still have the 11 troops with them if not dropped prior.. many guys drop off those troops at pickup instead of picking new ones up at the pickup and miss the message that pops up as to which they are doing.. and find out when they make it to a drop.. I would rather wait till you expand it properly instead of myself butcher it trying to repair that feature.. as for 1) I'm no good with scripts or missions for that matter.. lol .. and for 2) you seem very good with them. Another problem is with the insurgents themselves which I assume happens in all DCS missions.. if they run into a building.. there is no way to get to them.. sigh. which limits an automation of mission reloads if set to change mission when all insurgents are killed.. dunno if anything can help that at this point. Oh another thought on expansion that Im sure you probably already thought of.. internal cargo weight at pickup and dropoff.. I believe grimes mentioned in another posting that you cannot do it with scripting at this time..so I guess triggers in pickup and dropoff zones? look forward to the expansion.. thanks again! Edited May 25, 2013 by Fuby Games-Survival.com Link to comment Share on other sites More sharing options...
YoYo Posted May 25, 2013 Share Posted May 25, 2013 (edited) Nice mission, not finished yet (after 7 trips x 11 our troops I had crash) but looks promosing. Just for me - our soldiers need be more more effective (77 troops against 18 and no finished one point? ; ) Rookie men! I think about the problem - our troops stayed, dont move. Edited May 25, 2013 by YoYo Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro Link to comment Share on other sites More sharing options...
Fuby Posted May 25, 2013 Share Posted May 25, 2013 (edited) I think about the problem - our troops stayed, dont move. Now if you purchased Combined Arms... your troops.. they move.. :thumbup: On the server.. Just 3 good huey pilots.. mission over within 25 minutes.. insurgents all gone.. Edited May 25, 2013 by Fuby Games-Survival.com Link to comment Share on other sites More sharing options...
hreich Posted May 25, 2013 Share Posted May 25, 2013 Now if you purchased Combined Arms... your troops.. they move.. :thumbup: On the server.. Just 3 good huey pilots.. mission over within 25 minutes.. insurgents all gone.. Great mission...i just realized how i suck at landing in confined spaces...kerp them coming..this is reason i purchased huey [sIGPIC][/sIGPIC] Pilot from Croatia Link to comment Share on other sites More sharing options...
159th_Falcon Posted May 28, 2013 Share Posted May 28, 2013 Deck, this is an awesome little mission and a nice script. I have a question though. Am i correct in assuming i can delete EVERYTHING in the mission file except the trigger zone's and the script will still work? How can i make the script work the Russian Huey's? Am i free to move the trigger zone's and change there size? And lastly, how would i go about changing the units that spawn from the helicopter to RUS infantry. (AK47, RPG, IGLA Manpads etc) Please note, i have ZERO coding experience. Did try and look at your script though but i have no clue what all function's do and don't wanna break it. [sIGPIC][/sIGPIC] The keeper of all mathematical knowledge and the oracle of flight modeling.:) Link to comment Share on other sites More sharing options...
Stacker Posted May 29, 2013 Share Posted May 29, 2013 Thanks for sharing - I've learnt a heck of a lot by looking at your script. Didn't realise you could do half of these things. i7-4790K@4.7GHz : EVGA 1070 SC : 16GB Corsair Vengence Pro : 2xEVO 840 SSD : EVGA 850W PSU : CORSAIR H100i Cooler : ASUS Z97-AR MB : CORSAIR OBSIDIAN 750D FULL TOWER Link to comment Share on other sites More sharing options...
Recommended Posts