Jump to content

Recommended Posts

Posted

So I have a trigger set to activate a flag after a mission time. That will start a trigger cascade that will start randomly checking to see if a flag is true (a value) to activate a group. I'm struggling making it work though. Can a trigger guru write what that should look like in crayon for me please? Once, repeating, etc is all throwing me.

I think I can think somewhat logically, and then when I try doing trigger logic I realize I am chaos personified. 

Posted

It depends a bit on what different outcomes you want to be possible.

If you mean that it should be truly random as to whether the group is activate, then ONCE / NO EVENT > FLAG IS TRUE + RANDOM > GROUP ACTIVATE will be a useful combination, but this may mean that the activation never happens because that's just the way the random die rolls. It is also tricky to dial in the RANDOM value because doing it this way means it's something that will be evaluated every second, and even at low percentages (say 10%), it is likely to happen within the first minute. Even at 1%, it may still happen too quickly for your taste simply because of how often the check happens (in a quick test or three, it happened within 5 minutes every time), so you need to make the trigger a bit more elaborate to slow it down a bit. So even in this simple case, it becomes a question of how soon is too soon, and how much variation do you want?

If you want it to be certain that the spawn happens, and want to control the time frame within which it can happen, and just make it random exactly when in that window the group is activated, you're going to need to mix in at least a little bit of Lua scripting to set the random time on mission start and store that activation time in a user flag. The rest can then be done in the mission editor trigger editor by creating a time counter using REPETITIVE ACTION > FLAG INCREASE that ticks up every second, and then check that counter against the random spawn time using ONCE > FLAG IS FLAG > GROUP ACTIVATE to get the group going.

…but that's also a bit brittle. With a bit of unlucky timing and/or lag, the check may skip a beat and just run past the “FLAG IS FLAG” moment and then never trigger. This can once again be helped by slowing the counter down a bit to make sure there's more room for the flag check to work properly. Ultimately, to get the most control in terms of minimum and maximum wait times, and being sure that it doesn't bug out, you probably need to resort to a full Lua solution, at least for the randomisation part, although it can still trip a flag that you can use the regular ME trigger logic to catch and activate a group from.

 

So, tl;dr: how certain do you want to be that the random event happens, and how much control do you want over the allowed variation in randomness?

❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧

Posted

As @Tippis already kindly remarked, it's not entirely clear what your are trying to achieve.

especially this passage isn't clear to me 

9 hours ago, Paladin1cd said:

That will start a trigger cascade that will start randomly checking to see if a flag is true

Which triggers are you cascading why, and what do you mean by 'randomly checking'? Will the trigger in the cascade roll the dice if they should test a flag? If so, why? What are you trying to achieve?

In cases like this, I usually try to write the problem down, and carefully describe the preconditions (fancy word for 'things that I assume are set like this, and that I think are relevant), and then proceed to try and see what changes I'm really looking for, and why.

If the end result is (after dumbing down the problem) is that you want to activate a group some randomized seconds after a key situation (e.g. a flag has become true) I think we can quickly resolve this.

So, apologies if my brain is slow today: what are you exactly trying to achieve? 

Posted (edited)

Yes, I want it to maybe not fire. That way it can change the gameplay each time the game is loaded. I'd like for it to check it over a period of time, and then never fire again. The random action does not seem to work, and when googling it I found older posts from three years or so back that said it only worked at 5%. 

 

I want to have a number of groups that may or may not populate based on percent chance over a period of time. I say cascade thinking I was going to have to do it with the random number action and reset it each time it ran, then set a timer to check it again in five minutes or whatever. If the random action worked that would be great, but it doesn't seem to when I've set it up and added a message to see when it fires for testing. 

 

Thanks

Edited by Paladin1cd
Posted
On 11/22/2023 at 9:03 PM, Paladin1cd said:

I want to have a number of groups that may or may not populate based on percent chance over a period of time.

This can be done with triggers, and it would be messy and difficult to maintain. That's probably the reason why most of the mission helper frameworks have strong support for randomization. 

Below is a DML based mission that randomizes the number of groups and their distribution over an area (quad trigger zone). It's just one of many different ways to solve this common challenge.

 

 

random enemy mine.miz

  • Recently Browsing   0 members

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