Mistermann Posted May 18, 2024 Posted May 18, 2024 I can't, for the life of me figure out where I've gone wrong here. I've spent the last 2 hours debugging this and still can't figure it out. Is there possibly a defect in the current release regarding how the core evaluates a trigger with "FLAG IS LESS THAN FLAG" statement? Are my variables using special characters that the interpreter doesn't like? Do mods possibly impact trigger logic? Here's the trigger - pretty simple. I have a fixed % variable that compared against a random # variable that's evaluated in this statement. If the random number is less than the % number a random group spawns and I add 1 to a group counter so I can keep track of the number of groups on the map. It appears as though this statement evaluates as TRUE regardless of the variables. I have an in game message that I trigger via the F10 radio to show the values of the variables. In this particular example above there should only be 3 groups spawned (5, 6, and 9) but the system spawns all 12. The posted trigger above is just for the Rando1 spawn. There are 11 more, one for each random group. I removed the OR clause in the triggers thinking that might be causing the issue and received the same results. Hopefully I am just doing something silly and someone can square me away. Tagging a few folks to see if they can assist given your help in the past. @cfrag, @Rudel_chw, @Grimes System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 35 Into The Jungle (MP Mission) F18: Scorpion's Sting Apache Campaign - Griffins Kiowa Campaign - Assassins
rob10 Posted May 18, 2024 Posted May 18, 2024 Nothing obvious to me in that (not positive on # or % in names is OK). I assume you've quadruple checked all your names? One misplaced capitalized vs lower case or the number 1 ("1") or zero ("0") vs letter L ("l") or letter O ("O") can ruin your day and be hard to spot.
Mistermann Posted May 18, 2024 Author Posted May 18, 2024 (edited) 24 minutes ago, rob10 said: Nothing obvious to me in that (not positive on # or % in names is OK). I assume you've quadruple checked all your names? One misplaced capitalized vs lower case or the number 1 ("1") or zero ("0") vs letter L ("l") or letter O ("O") can ruin your day and be hard to spot. Yeah I have checked those - and rechecked. And will check them AGAIN because there's SOMETHING off here and it feels like its me. Yet there was that nasty "Group in Zone" trigger defect that hung around for months recently so I am just a wee bit cautious that I may have stumbled on another one. FWIW, I've used # and % in variable names for quite some time and have seen them work. Again, something recent may have broken that so IDK. I may have to go back and rename the variables and see. Thanks @rob10 Edited May 18, 2024 by Mistermann System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 35 Into The Jungle (MP Mission) F18: Scorpion's Sting Apache Campaign - Griffins Kiowa Campaign - Assassins
Solution Rudel_chw Posted May 18, 2024 Solution Posted May 18, 2024 (edited) 53 minutes ago, Mistermann said: If the random number is less than the % number a random group spawns and I add 1 to a group counter so I can keep track of the number of groups on the map. It appears as though this statement evaluates as TRUE regardless of the variables. Not exactly, what is not obvious from the triggers listing, is that DCS checks this list once per second, so even if a trigger is type ONCE it may still be checked hundred or thousands of times depending on how long the mission lasts ... if on any of those hundred evaluations, the random # variable is less than your set percentage, then the expression will be true, the action will be executed, and ONLY THEN the trigger will be removed from the trigger listing that is evaluated by DCS every second. In other words, all those triggers will eventually evaluate to TRUE. Edited May 18, 2024 by Rudel_chw For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Mistermann Posted May 18, 2024 Author Posted May 18, 2024 2 minutes ago, Rudel_chw said: Not exactly, what is not obvious from the triggers listing, is that DCS checks this list once per second, so even if a trigger is type ONCE it may still be checked hundred or thousands of times depending on how long the mission lasts ... if on any of those hundred evaluations, the random # variable is less than your set percentage, then the expression will be true, the action will be executed, and ONLY the trigger will be removed from the trigger listing that is evaluated by DCS every second. In other words, all those triggers will eventually evaluate to TRUE. Hummmmm ... that's something I hadn't really considered. I'll see if I can force the check AFTER I am certain the random numbers have been calculated. Thanks for the clue, @Rudel_chw System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 35 Into The Jungle (MP Mission) F18: Scorpion's Sting Apache Campaign - Griffins Kiowa Campaign - Assassins
Rudel_chw Posted May 18, 2024 Posted May 18, 2024 (edited) 6 minutes ago, Mistermann said: Hummmmm ... that's something I hadn't really considered. I'll see if I can force the check AFTER I am certain the random numbers have been calculated. Thanks for the clue, @Rudel_chw You could at the start of the combat part of the mission, assign a random amount of seconds to each Group to be spawned, lets say the combat should last 20 minutes, then assign to each spawn a number between 1 and 1200. Then have a seconds counter Flag within the combat part, and compare that seconds counter, with the random start time that you assigned to each spawn. PS: Also the DML scripts by @cfrag have the functionality that you need, in a much simpler way to use. Edited May 18, 2024 by Rudel_chw For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
AdrianL Posted May 18, 2024 Posted May 18, 2024 1 hour ago, Mistermann said: If the random number is less than the % number On a side note: I am pretty sure the "FLAG IS LESS THAN FLAG" returns true is the 2nd variable is less than the first. Based on what you wrote, the flags should be swapped.
Mistermann Posted May 18, 2024 Author Posted May 18, 2024 14 minutes ago, Rudel_chw said: Not exactly, what is not obvious from the triggers listing, is that DCS checks this list once per second, so even if a trigger is type ONCE it may still be checked hundred or thousands of times depending on how long the mission lasts ... if on any of those hundred evaluations, the random # variable is less than your set percentage, then the expression will be true, the action will be executed, and ONLY THEN the trigger will be removed from the trigger listing that is evaluated by DCS every second. In other words, all those triggers will eventually evaluate to TRUE. @Rudel_chw - once again, you come through with a solution!! Thank you, sir! Here's what I did. When calculating the random number that is placed into the "CCP_Rando1_#" variable (and all others), I turned on a new flag called "Randos_Calculated". I only allow the evaluation of the FLAG IS LESS THAN FLAG once the random numbers are determined. As you can see below, the logic works perfectly. I should only have 2 groups spawned and that's exactly what occurred. For some reason I thought the DCS triggers had a sequence to them based on where they were in the list of triggers. A ONCE trigger at the top of the list would be evaluated before a ONCE trigger at the bottom. Today, I learned that isn't the case thanks to Rudel. Hopefully this helps future mission editors. Thanks to all who replied. 1 System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 35 Into The Jungle (MP Mission) F18: Scorpion's Sting Apache Campaign - Griffins Kiowa Campaign - Assassins
Rudel_chw Posted May 18, 2024 Posted May 18, 2024 17 minutes ago, Mistermann said: For some reason I thought the DCS triggers had a sequence to them based on where they were in the list of triggers. A ONCE trigger at the top of the list would be evaluated before a ONCE trigger at the bottom. Well, actually it has a sequence .. the DCS engine checks the trigger list from top to bottom, but the trick is that it does so once per second, so a particular trigger at the bottom may have its action part executed before a trigger at the top, depending on when their conditions became true. If they are both true on the same DCS check iteration, then the trigger at the top will be evaluated before than the one at the bottom. 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
TEMPEST.114 Posted May 18, 2024 Posted May 18, 2024 5 hours ago, AdrianL said: On a side note: I am pretty sure the "FLAG IS LESS THAN FLAG" returns true is the 2nd variable is less than the first. Based on what you wrote, the flags should be swapped. This is why checking with the manual addresses so many of the issues posted. It's just a shame that the manual won't get pinned to the forum's front page.
Recommended Posts