Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Event condition 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 Legion >> Event condition question Page: [1]
Login
Message << Older Topic   Newer Topic >>
Event condition question - 1/26/2019 3:59:03 PM   
orca

 

Posts: 500
Joined: 11/6/2013
Status: offline
I want to activate strike when a unit is detected AND the unit is in a certain area.

Can I use a unit detected trigger and then make a condition using lua with unit enters area (or unit remains in area)?

Or use a unit enters area trigger and then lua unit is detected condition?

Or is there a way to create a trigger that requires 2 things to fire- unit enters area AND unit is detected?

Thanks

Post #: 1
RE: Event condition question - 1/26/2019 4:50:53 PM   
SeaQueen


Posts: 1439
Joined: 4/14/2007
From: Washington D.C.
Status: offline
I would use the unit enters area as the trigger, just because it's easier/faster to use the built in code for determining if an object is in a polygon than to write your own in LUA.

Detection is fairly easy to work with in LUA using the ScenEdit_GetContact() and ScenEdit_GetContacts() functions. GetContacts() returns a list of contacts to loop over. Next, return the properties of each of the returned contacts using the GetContact() function. You can then determine if the thing you're interested in is on a side's contact list by referencing the contact's properties. The only thing to be careful about is that you must be conscious that the contact guid and the unit's guid are different. To reconcile the two, refer to the actualunitid of the contact after using the ScenEdit_GetContact() function.

(in reply to orca)
Post #: 2
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Event condition 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.246