Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to trigger a mission with a condition of quantity ?

 
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 >> The War Room >> How to trigger a mission with a condition of quantity ? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to trigger a mission with a condition of quantity ? - 6/10/2016 7:22:37 PM   
FoxZz

 

Posts: 92
Joined: 4/28/2015
Status: offline
Hello,

I'm trying to create a mission where I want the AI side to scramble an interception air patrol in order to ID incoming bogeys.
However, I would like the number of planes scrambled to be set accordingly with the number of bogeys detected.

So that if many bogeys are detected, the AI scramble more planes than if a single bogey is detected.

I was thinking to create two separate interception mission, one with 2 planes ready to be scrambled, and another one with 4 planes.

The first mission would trigger if the number of bogey is between [1,4] and [8,infinite]
The second mission would trigger of the number of planes is between ]4,infinite]

So that if 1,2,3,4 bogeys are detected, mission 1 fire
between 5 and 8, mission 2 fires
from 8 and above, mission 2 and mission 1 fire

This would allow the AI to have depending on the number of bgeys 2,4, or 6 planes in the air.

Is there an LUA function for this ?

Thanks.


< Message edited by FoxZz -- 6/11/2016 4:08:11 PM >
Post #: 1
RE: How to trigger a mission with a condition of quanti... - 6/13/2016 1:13:11 PM   
FoxZz

 

Posts: 92
Joined: 4/28/2015
Status: offline
bump

(in reply to FoxZz)
Post #: 2
RE: How to trigger a mission with a condition of quanti... - 6/13/2016 3:58:37 PM   
Yokes

 

Posts: 298
Joined: 3/14/2007
Status: offline
I know of an ugly way to do it.

Let's say you have X enemy aircraft that could trigger this.

First, you need to create X "keyvalue" entries, one for each aircraft, initialized to false. These will be used to keep the event only triggering once per aircraft. You will also need a "keyvalue" initialized to false to act as a timer.

Next, you create X "unit enters area" triggers, one for each aircraft. For each of these triggers, the action would check that unit's "keyvalue", and if false it would add one to a counter "keyvalue". Also, you would need to check to see if the timer value is false. If so, then this is the first aircraft to enter the zone, so you would need to start the timer. I recommend moving a unit (I like to use city markers) into an area defined by waypoints, with a "unit remains in area" trigger. This can all be hidden from the player in a non-player side.

Finally, when the timer goes off, you look at the counter "keyvalue" to see how many aircraft have entered the area. You can then figure out how many aircraft to assign to the intercept mission from that.

This is "ugly" since it would only work once without resetting all the counters and variables. That can also be done, but it would take a lot of actions.

Yokes

(in reply to FoxZz)
Post #: 3
RE: How to trigger a mission with a condition of quanti... - 6/13/2016 5:17:17 PM   
FoxZz

 

Posts: 92
Joined: 4/28/2015
Status: offline
I'll try it and see if it's viable in the mission.
Thank you very much :)

(in reply to Yokes)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> The War Room >> How to trigger a mission with a condition of quantity ? 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.086