Jump to content

Recommended Posts

  • ED Translators
Posted

So I tried to play with RANDOM condition for triggers..

 

I've setup simple mission with convoy and 3 ambush points along the way with probability of 1% (initially it was 10%).

 

Ambush point is a group with late activation, Trigger for activation is set to once and condition is RANDOM 1%, ACTION is specific group activation with debug message:

 

P9YHdl-Z4GY.jpg

 

So after mission start all three groups are spawned like it was probability of 100%.... It is only matter of time.

 

 

Looks like RANDOM condition checking itself in real time continously if you don't add other condition, until trigger action is done...

 

Should it work like that?

Convoy_test.miz

AKA LazzySeal

Posted

I'm being lazy, but I tend to use flags for this. Something like, ONCE>...>SET RANDOM FLAG (between 1 and 10)

then

Once condition flag = <3 activate group

once condition flag = >3, condition flag <7, activate group

 

etc

 

Doesnt help your problem but I know this way works.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

  • ED Translators
Posted
I'm being lazy, but I tend to use flags for this. Something like, ONCE>...>SET RANDOM FLAG (between 1 and 10)

then

Once condition flag = <3 activate group

once condition flag = >3, condition flag <7, activate group

 

etc

 

Doesnt help your problem but I know this way works.

 

I can add something like time less 2 seconds and make it check RANDOM condition only for 2 seconds for instance, but at this point I'm curious if its a bug or a feature...

AKA LazzySeal

  • ED Translators
Posted
Ohhhhhhhhhhhhh

 

I've got it.

 

ONCE does execute repeatedly until the condition is true. That's by design.

 

Looks like it :smartass:

AKA LazzySeal

Posted

There are a couple of different ways to get the result you want.

 

1. Directly on each groups panel when you select them. Select a group and just below the group name is something labeled "Condition". You can set that number value to anything from 0 and 100, and it will do the check once while the mission is loading to spawn them. Keep in mind this condition is for whether or not the group even exists.

 

2. Change the "Once" to "Mission Start" and it will evaluate the condition just one time exactly when you unpause the mission. The big difference between this and the above method is that wit this method you can still spawn the group in later if you wanted to.

 

3. Add an extra condition to be checked. A good example is Time Less than X. This way it can evaluate multiple times but it will eventually stop. So if the time is 5 seconds then there are 5 "roll of the dice" with a 1% chance of it occurring.

 

There are several other trigger setups you can do to get desired results by using random. Here is a wiki article I wrote on it.

  • Thanks 1

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

Posted (edited)

Eh grimes- back in the day I recall there was an issue with random not being so... um... random. As a result someone pointed me to a script that was really slick. I can go find it again but do you know if the random function got fixed?

 

 

Never mind I found it anyway- loved this script. I literally loved it.

 

https://forums.eagle.ru/showpost.php?p=1991162&postcount=451

 

This way you can run the random for a given flag. Set parameters for how many potential scenarios you have (let's say 3) so your parameters are min 1 max 3. Do a trigger for flag x = 1 this happens. 2= that happens 3 = dat happens.

Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

  • Recently Browsing   0 members

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