Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Lua Question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Question Page: [1]
Login
Message << Older Topic   Newer Topic >>
Lua Question - 5/26/2016 9:26:49 PM   
Dannyp19

 

Posts: 186
Joined: 10/20/2013
Status: offline
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.

< Message edited by Dannyp19 -- 5/26/2016 9:31:17 PM >
Post #: 1
RE: Lua Question - 5/26/2016 9:39:11 PM   
ckfinite

 

Posts: 377
Joined: 7/20/2013
Status: offline
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.

(in reply to Dannyp19)
Post #: 2
RE: Lua Question - 5/26/2016 11:10:03 PM   
Dannyp19

 

Posts: 186
Joined: 10/20/2013
Status: offline
Thanks


(in reply to ckfinite)
Post #: 3
RE: Lua Question - 5/31/2016 9:14:57 PM   
Dannyp19

 

Posts: 186
Joined: 10/20/2013
Status: offline
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


(in reply to Dannyp19)
Post #: 4
RE: Lua Question - 5/31/2016 9:21:43 PM   
Gunner98

 

Posts: 5508
Joined: 4/29/2005
From: The Great White North!
Status: offline
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

(in reply to Dannyp19)
Post #: 5
RE: Lua Question - 5/31/2016 11:33:08 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
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.

(in reply to Gunner98)
Post #: 6
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.764