schurem Posted September 5, 2019 Share Posted September 5, 2019 Hi all, I built a couple of small scenario's that spawn random OPFOR. I used a trigger system to do this. * One trigger, on mission start, that puts a random value between 1 and 100 in flag 1. * One trigger for fighter group A that activates it on condition of flag 1 being more than 1 AND less than 25. * One trigger for fighter group B that activates it on condition of flag 1 being more than 25 AND less than 50 * One trigger for fighter group C that activates it on condition of flag 1 being more than 50 AND less than 75 * One trigger for fighter group D that activates it on condition of flag 1 being more than 75 AND less than 100 Now on tuesday, on the 'stable' version, this would give me one of four possible groups. Today this no longer works, no fighters get activated. For some reason the only way I can get this to work is a 50/50 chance with one group having the single condition MORE than 50 and the other LESS than 50. Having both (more and less) conditions leaves the groups unactivated! Le bug? I suspect something broke when it comes to evaluating trigger conditions. Also, if anyone knows of a more elegant solution to activating one out of a number of groups, I'd be happy to learn :smartass:trainAA4.miz I5 9600KF, 32GB, 3080ti, G2, PointCTRL Link to comment Share on other sites More sharing options...
Grimes Posted September 5, 2019 Share Posted September 5, 2019 It looks to be caused by using the "Mission Start" event with a once condition possibly. Just change it to "no event" and it should work. Fine. As for a more elegant solution. Once> Flag 1 is False && Random 5% > Flag 1 ON && Activate Group A Once> Flag 1 is False && Random 5% > Flag 1 ON && Activate Group B Once> Flag 1 is False && Random 5% > Flag 1 ON && Activate Group C Once> Flag 1 is False && Random 5% > Flag 1 ON && Activate Group D Basically as long as flag 1 is false the random condition gets evaluated until it becomes true. There might be a small delay in when it will spawn, but it will always choose something. The nice part is you can keep adding new groups with the same condition to spawn each one without having to fiddle with setting a range of flags. The other nice part is you can set flag 1 back to false whenever you want and it will randomly spawn from one of the remaining triggers. Could slightly modify it by changing the trigger to the following and adding a trigger to set Flag 2 to a random value of however many groups you want to spawn. Its basically a multiple choice. Once> Flag 1 is less than Flag 2 && Random 5% > Flag 1 Increase by 1 && Activate Group A Here is a wiki article if interested in other methods: https://wiki.hoggitworld.com/view/DCS_editor_Randomization 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 Link to comment Share on other sites More sharing options...
schurem Posted September 5, 2019 Author Share Posted September 5, 2019 Nice! thanks Grimes! I5 9600KF, 32GB, 3080ti, G2, PointCTRL Link to comment Share on other sites More sharing options...
Recommended Posts