Jump to content

Triggering random groups


StrayWolf

Recommended Posts

Here's what I would like to accomplish.

 

A player controlled flight enters a trigger zone activating an enemy flight group for close range (10nm) ACM.

Simple enough for one enemy group.

Create trigger

Specify that when Player Group enters said trigger area, activate enemy flight.

 

Now, what I would like to do is to RANDOMIZE those enemy flights in order to provide variety of enemy aircraft. Say one group of Vipers, another of MiG21s and another of...whatever.

 

I know how to create a randomization at the mission start but not when a specific group enters a trigger.

 

Any help would be appreciated! :thumbup:

Windows 10 Pro | i5-8600K | MSI Tomahawk Z370 | 48GB DDR4-3000 A-DATA (LED) | EVGA Superclocked 2 GTX 1080 8GB DDR5 | 256GB M.2 NVe A-DATA | 512GB M.2 NVe A-DATA | HP Omen 32" 2560x1440 | Thrustmaster Warthog, CH Pedals Oculus Rift S VR
Link to comment
Share on other sites

Hi StrayWolf,

 

How many times would you like this to be repeatable? Is this something you're planning to use as a one-and-done affair with a single random encounter, or do you want to be able to keep returning to the same point?

 

If the former, it will be a relatively simple affair involving using the UNIT INSIDE ZONE or PART OF COALITION IN ZONE condition to randomize a flag's value, then spawning a predetermined group at a predetermined location based on the random value of that flag.

 

If the latter, you'll need to use MiST or MOOSE and write basic .lua, as groups can only be spawned once through the vanilla Mission Editor functions. Either option is very possible though!


Edited by feefifofum
Link to comment
Share on other sites

Hey feefifofum! Thanks for the quick reply!

 

OK, here's what I have right now with triggers...I have ZERO clue on how to script right now...

 

So, 1 Once / Conditions - Unit inside Zone (hornet, acm tigger) / Actions Flag Set Random Value (1,0,2)

Then,

1 Once / Conditions - Time Since Flag (1,3) Flag Equals(1,0) / Actions - Group Activate (AggressorF5)

 

Then I clone that for the other possible enemy flight groups. I know its doable but I think I am missing something simple. I just want to get it working with triggers.

And to answer your question, yes - it would happen once. In order to get another ACM event we would have to restart the mission, but I was planning on having several of this triggers spread out throughout a "training area" - each waypoint would take the flight to a new engagement.

 

Another question - I cannot use Group then for Clients, correct?

Windows 10 Pro | i5-8600K | MSI Tomahawk Z370 | 48GB DDR4-3000 A-DATA (LED) | EVGA Superclocked 2 GTX 1080 8GB DDR5 | 256GB M.2 NVe A-DATA | 512GB M.2 NVe A-DATA | HP Omen 32" 2560x1440 | Thrustmaster Warthog, CH Pedals Oculus Rift S VR
Link to comment
Share on other sites

A flag set to 0 is considered false by the triggers. So the time since flag condition won't work with it since it only applies to the time after it is set to true or a value of 1+.

 

 

A easier solution might be to use:

 

Once>Flag X is True and Random(5)> Set Flag X False and Activate Group A

Once>Flag X is True and Random(5)> Set Flag X False and Activate Group B

 

Set the flag to true when you want something to spawn and it will "pick" one trigger due to the delay from the random condition.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Thanks Grimes for the additional tip.

 

This is how I have it actually working -

1 Once ACM / Condition - Unit,ACM area / Actions - Flag On (1)

1 Once FlagValue / Condition - nothing / Actions - Flag Set Random Value (1,0,2)

1 Once ACM F5 / Condition - Time Since Flag (1,1) / Action Activate (Aggressors F5)

Flag Equals (1,0)

*** CLONE LAST LINE TWO MORE TIMES BUT ALTERING FOR DIFFERENT GROUPS ***

 

And...it works. Of course, it only works once but that was the intended objective. It would be cool to be able to cycle it - meaning, once the first activated group is destroyed the player units can generate another encounter.

Windows 10 Pro | i5-8600K | MSI Tomahawk Z370 | 48GB DDR4-3000 A-DATA (LED) | EVGA Superclocked 2 GTX 1080 8GB DDR5 | 256GB M.2 NVe A-DATA | 512GB M.2 NVe A-DATA | HP Omen 32" 2560x1440 | Thrustmaster Warthog, CH Pedals Oculus Rift S VR
Link to comment
Share on other sites

Another similar discussion I had with another member-

https://forums.eagle.ru/showthread.php?t=215187

 

I'll hack together some details tomorrow if that doesnt make it clear enough...as long as you only want each encounter to happen once you can accomplish this natively in the ME. In your case you'd simply replace the radio item condition check with a unit inside zone check.

Link to comment
Share on other sites

Are you interested in using scripting rather than the ME? Because its a lot easier to do. Just checkout my A2A Engagements mission in my sig. Super simple. Not exactly what you want to do but its hinged on a menu selection instead but the concepts used there would work for what you want I think.

Link to comment
Share on other sites

Thanks Delta99 - will check them out!

Windows 10 Pro | i5-8600K | MSI Tomahawk Z370 | 48GB DDR4-3000 A-DATA (LED) | EVGA Superclocked 2 GTX 1080 8GB DDR5 | 256GB M.2 NVe A-DATA | 512GB M.2 NVe A-DATA | HP Omen 32" 2560x1440 | Thrustmaster Warthog, CH Pedals Oculus Rift S VR
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...