Jump to content

How to have a group appear in one of a number of random places?


Recommended Posts

Posted (edited)

Hi all,

 

I'm wanting to setup a mission where the player is searching for an enemy artillery unit over a wide area, and I want it to be randomised so they're not always in the same place.

 

Is there a way to set this up using triggers? I haven't really delved into the scripting engine yet because I'm not really clued up on lua, but I'm used to using triggers to setup fairly complex scenarios. I was thinking of maybe creating multiple groups in different locations, and then some sort of trigger to make sure only one of them appears, but I can't see a simple way to do that.

 

Failing that, is this something that's possible with one of the big scripting expansions like MIST or MOOSE? If needs be I'm willing to look into those and see how to set them up.

 

Cheers,

 

BritTorrent

 

Sent from my ONEPLUS A3003 using Tapatalk

Edited by BritTorrent
Posted

There are a handful of ways to do this. If you want to brute force it, place an identical group in as many locations as desired. Check the "late activation" box for each group.

 

Use the SET FLAG RANDOM VALUE action with no conditions to set a flag to a value between 1 and X where X is the number of groups you have placed.

 

Use a second set of triggers to spawn the group based on that flag's value.

 

1 ONCE (Spawn, NO EVENT)

==

FLAG EQUALS (1, 1)

==

GROUP ACTIVATE (random 1)

 

Repeat that for as many groups as you have. When the mission starts, a value will be assigned to that flag. That random value will determine which of your groups will spawn.

  • Recently Browsing   0 members

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