Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Trigger on Hostilities Commence

 
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 Legion >> Trigger on Hostilities Commence Page: [1]
Login
Message << Older Topic   Newer Topic >>
Trigger on Hostilities Commence - 12/6/2019 10:46:57 PM   
patpatpowercat

 

Posts: 5
Joined: 11/19/2019
Status: offline
I am trying to figure out how to activate a list of missions once two sides commence hostilities. I understand how to activate the missions using lua ScenEdit_SetMission {isactive=true}, but I am trying to figure how to best trigger this action. Originally I was going to do it with a unit destroyed, but I don't want a 3rd side to commence hostilities between the two sides prematurely. So I was looking into firing a once a second trigger and using ScenEdit_GetSidePosture, have if it returns hostile than activate the missions. However, my lua knowledge isn't that great and I'm not sure how to take the return of the GetSidePosture and turn it into a variable for us in an if/then argument, or if this would be the optimal way of doing so.

Any suggestions?
Post #: 1
RE: Trigger on Hostilities Commence - 12/6/2019 11:11:28 PM   
apache85

 

Posts: 1631
Joined: 12/18/2014
From: Melbourne, Australia
Status: offline
If it's important that the only variable that is counted is the side postures (i.e. you don't want to use a surrogate like a unit destroyed or a weapon fired) then I'd use a regular time trigger of whatever suits, 1s would be fine because this will be light performance wise until triggered, and have an if statement at the start of the script that checks if the sides are hostile and then activates the missions if that condition is true.

quote:


local sidePosture = ScenEdit_GetSidePosture('Side A','Side B')

if sidePosture == 'H' then

--your code here

end


_____________________________


(in reply to patpatpowercat)
Post #: 2
RE: Trigger on Hostilities Commence - 12/6/2019 11:35:25 PM   
patpatpowercat

 

Posts: 5
Joined: 11/19/2019
Status: offline
Thanks so much! I just had H instead of 'H' and it wasn't working.

(in reply to apache85)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Trigger on Hostilities Commence 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.105