Lua Question (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


Dannyp19 -> Lua Question (5/26/2016 9:26:49 PM)

I'm starting to really delve into the editor and make some scenarios(small personal ones ATM)

Lua reminds me of a custom programming logic script I used to do a long time ago working on building management controls.

Anyway I was wondering is there a way to write a script for when an aircraft gets shot down an ejected pilot shows up in the general area where it was downed.

Baloogan has a downed pilot script but the link was bad.

My plan is to have it occur randomly and a CSR team gets in the area and picks them up.

Any advice would be appreciated.

Thanks

OOPS...somebody just posted in the general and I wasnt looking. I got it.....I think.




ckfinite -> RE: Lua Question (5/26/2016 9:39:11 PM)

Sure. You just add a "Unit Destroyed" trigger, and then have something like the following inside it:

local unit = ScenEdit_UnitX()
ScenEdit_AddUnit({ ... pilot information ..., latitude = unit.latitude, longitude = unit.longitude})


When the unit gets shot down, it'll call that trigger and add the pilot in. Remember to replace the "... pilot information ..." with something meaningful.

CSAR scripts are considerably more annoying to write. Let me know when you get to that.




Dannyp19 -> RE: Lua Question (5/26/2016 11:10:03 PM)

Thanks





Dannyp19 -> RE: Lua Question (5/31/2016 9:14:57 PM)

Hi Ckfinite

That worked good. Now what I would like to do is draw 4 RPs around the downed pilot to set up a CSAR mission.

What my plan is
1. Helo gets shot down (this will have probability check)
2. Insert downed pilot
3. Draw RP's around pilot (4 minimum )
4. Activate CSAR mission

This is all done on player side. Once CSAR mission is triggered active then player can choose what A/C's to assign.
Any help would be great





Gunner98 -> RE: Lua Question (5/31/2016 9:21:43 PM)

A player aid to this would be to insert a radio beacon in the area that the AC gets shot down. Helps the player focus on where things are. You need to delete it when the CSAR is complete though. I tried a bunch of these in NF 4. It was clumsy and with ships - pre lua days but taking a look there might help.

B




wqc12345 -> RE: Lua Question (5/31/2016 11:33:08 PM)

There is an excellent lua script here that does exactly what you want... its about three posts down, called Task Force Normandy, just do a search on my posts and look for the attachment for the script.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
2.328125