Jump to content

Sample: huey troop pickup/dropoff via radio command


Deck

Recommended Posts

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.miz

NewHuey.lua

HueyDrop2.miz


Edited by Deck
  • Like 10
Link to comment
Share on other sites

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) ?

  • Like 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

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!

  • Like 1
Link to comment
Share on other sites

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 by Deck
Link to comment
Share on other sites

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 by pakfront
Link to comment
Share on other sites

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

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

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 by Fuby
Link to comment
Share on other sites

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!

 

uh1h45.jpg

 

I think about the problem - our troops stayed, dont move.


Edited by YoYo

Webmaster of http://www.yoyosims.pl

Yoyosimsbanner.gif

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

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 by Fuby
Link to comment
Share on other sites

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...