ED Translators Foka1 Posted January 13, 2017 ED Translators Posted January 13, 2017 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: 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
Pikey Posted January 13, 2017 Posted January 13, 2017 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 Foka1 Posted January 13, 2017 Author ED Translators Posted January 13, 2017 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
Pikey Posted January 13, 2017 Posted January 13, 2017 OK, i tried CONTINUOUS > random 10 > message to all It came up about the right amount of time for 10% of the time. Perhaps its soemthing else? ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Pikey Posted January 13, 2017 Posted January 13, 2017 Ohhhhhhhhhhhhh I've got it. ONCE does execute repeatedly until the condition is true. That's by design. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
ED Translators Foka1 Posted January 13, 2017 Author ED Translators Posted January 13, 2017 Ohhhhhhhhhhhhh I've got it. ONCE does execute repeatedly until the condition is true. That's by design. Looks like it :smartass: AKA LazzySeal
Grimes Posted January 14, 2017 Posted January 14, 2017 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. 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted January 14, 2017 Posted January 14, 2017 (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 January 14, 2017 by ENO "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Recommended Posts