Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Question about LUA

 
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 >> Question about LUA Page: [1]
Login
Message << Older Topic   Newer Topic >>
Question about LUA - 12/7/2014 6:23:05 PM   
snowburn


Posts: 188
Joined: 9/24/2013
From: Bovril, Argentina
Status: offline
Hello!!

i want to add some reserve aircraft to a mission when 5 sam sites where destroyed.
can we do something like this with the new LUA editor?



Event scenario_start:
trigger: T1
action: init_variables


Event: SAM Site destroyed
trigger: sam_site_hit
action: sam_site_count
add_fighters




Action init_variables:
ScenEdit_SetKeyValue('sam_site_destroyed', 0 )


Action: sam_site_count:
ScenEdit_SetKeyValue('sam_site_destroyed', ScenEdit_GetKeyValue('sam_site_destroyed') +1 )


Action add_fighters:
if(ScenEdit_GetKeyValue('sam_site_destroyed') == 5) {
ScenEdit_AssignUnitToMission('ac1', 'CAP')
ScenEdit_AssignUnitToMission('ac2', 'CAP')
ScenEdit_AssignUnitToMission('ac3', 'CAP')
ScenEdit_AssignUnitToMission('ac4', 'CAP')
ScenEdit_AssignUnitToMission('ac5', 'CAP')
}






< Message edited by snowburn -- 12/7/2014 7:25:31 PM >
Post #: 1
RE: Question about LUA - 12/7/2014 6:25:16 PM   
ckfinite

 

Posts: 377
Joined: 7/20/2013
Status: offline
Yep, that should work.

(in reply to snowburn)
Post #: 2
RE: Question about LUA - 12/7/2014 6:26:42 PM   
snowburn


Posts: 188
Joined: 9/24/2013
From: Bovril, Argentina
Status: offline
thanks :)
i hope we can have a release canditate soon

(in reply to ckfinite)
Post #: 3
RE: Question about LUA - 12/10/2014 9:35:32 PM   
mx1

 

Posts: 76
Joined: 1/16/2014
Status: offline
Is the ScenEdit_SetKeyValue part of API? I don't see it documented on github site.


(in reply to snowburn)
Post #: 4
RE: Question about LUA - 12/10/2014 9:49:35 PM   
snowburn


Posts: 188
Joined: 9/24/2013
From: Bovril, Argentina
Status: offline

quote:

ORIGINAL: mx1

Is the ScenEdit_SetKeyValue part of API? I don't see it documented on github site.




http://wiki.baloogancampaign.com/index.php/ScenEdit_SetKeyValue

(in reply to mx1)
Post #: 5
RE: Question about LUA - 12/10/2014 11:43:11 PM   
ckfinite

 

Posts: 377
Joined: 7/20/2013
Status: offline
I knew I forgot something, sorry about that. Yes, SetKeyValue and GetKeyValue are both valid functions.

(in reply to mx1)
Post #: 6
RE: Question about LUA - 12/10/2014 11:49:07 PM   
ckfinite

 

Posts: 377
Joined: 7/20/2013
Status: offline
They are now documented, again sorry about that.

(in reply to mx1)
Post #: 7
RE: Question about LUA - 1/22/2015 9:40:41 PM   
mx1

 

Posts: 76
Joined: 1/16/2014
Status: offline
I've also found that ScenEdit_GetReferencePoint() works as expected but is not documented. It is pretty useful function to check whether unit is within certain area defined by RPs.

(in reply to ckfinite)
Post #: 8
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Question about LUA 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

1.125