Rnd#

Please share all your mods and scenarios here for the community to play

Moderator: Saint Ruth

Post Reply
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Rnd#

Post by kevinkins »

Trying to get a Soviet tank corps to move in different directions based on the Rnd# test. Please take a look at the attached file attachment] based on the sandbox scenario posted a few weeks ago. It was modified for testing this specifically and I have trying various setting with no success. Thanks.

Kevin
Rnd Test.zip
(24.83 KiB) Downloaded 8 times
Here is the basic solution I believe ...
Rnd Test Solution.zip
(24.8 KiB) Downloaded 11 times
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
Saint Ruth
Posts: 1385
Joined: Wed Dec 16, 2009 1:39 pm

Re: Rnd#

Post by Saint Ruth »

That will work.
BUT you should not have the RND number in your script 2.
The RND number of 6 in script 1 means there's a 60% change of script 1 running.
The RND number of 4 in script 2 is not doing anything as there's no alternative script.
Cheers,
Brian
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Rnd#

Post by kevinkins »

Thanks

One thing is trying to keep the first randomly selected script running disregarding the other one for the rest of the scenario. I can see a situation where the scripts alternate running for the length of the game (depending on the Max Run number). This would send Response formations on an unintended avenue of advance. In other words, once a script with 60% chance runs on turn one, the other with 40% would never have a chance to be selected again i.e. skipped for the rest of the game. The same would be true if the lower 40% script is selected on turn one. The solution might be in the Max Run number being set to a bare minimum.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
Saint Ruth
Posts: 1385
Joined: Wed Dec 16, 2009 1:39 pm

Re: Rnd#

Post by Saint Ruth »

Hi,
Yes, you should have maxRun = 1 if you don't want it rerun.
And REF_SCRIPTS will never be run unless referenced from another script.

If you want script 2 to run, just remove the REF_SCRIPT and let it have its own trigger.
Then it will run if the RND succeeds on script1 or if have it run on (say) turn 4 or something.
If you have maxRun = 1 then it will only run once.

cheers,
Brian
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Rnd#

Post by kevinkins »

However, script one will be tested at a 10% probability until it runs. This means while script two runs at 90%, script one will eventually run once script two completes. So, the org reaches 12, I0 using script two then heads to 1,1 at a 10% probability per turn per script one's instructions. I want to turn script one off if it fails the random test on turn one. In other words, script one has just one chance to effect movement. Script one just hangs around waiting to fire. In fact, once script two finishes it appears the random # test is ignored and off the org goes to 1,1 immediately using script one. Playing with triggers to avoid this behavior.

Kevin
More on Rnd.zip
(25.19 KiB) Downloaded 10 times
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
Saint Ruth
Posts: 1385
Joined: Wed Dec 16, 2009 1:39 pm

Re: Rnd#

Post by Saint Ruth »

Hi, if you put script 1 to run on turn 1, then it will only run on turn 1 and never try to run again.
Will that solve your problem?
Cheers,
Brian
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Rnd#

Post by kevinkins »

Not really since I want either script to have a chance to run on turn 1 then both scripts turn off for the rest of the game. The game then moves units to the winning script’s response hexes as determined on turn 1 with no interference. As of now, if the losing script on turn 1 wins the random die roll say on turn 3, that will mess up the way the formation moves i.e., heading in one direction on turn 1 then heading in another direction on turn 3 as directed by the script that lost on turn 1 since that script remains active. The Rnd # feature forces it to be bypassed (not turned off) and the script defined by the Alt ID runs. If the Max Run is set to 1 for both scripts, then the last winning script prevails. If you set the random # to 5 and the Max Run numbers large, the response organization will end up very confused.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
Saint Ruth
Posts: 1385
Joined: Wed Dec 16, 2009 1:39 pm

Re: Rnd#

Post by Saint Ruth »

You mean it keeps check the RND every turn... oh, I'll have to check that out.
Thanks,
Brian
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Rnd#

Post by kevinkins »

Yes, it keeps checking until the script's Max Run # is reached even when that is set to 1.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
Saint Ruth
Posts: 1385
Joined: Wed Dec 16, 2009 1:39 pm

Re: Rnd#

Post by Saint Ruth »

Yep, a bug. The max run isn't reduced when the script (or the alt script) fails the RND check.
Fixed now and will be released in the next patch.
Thanks!
Brian
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: Rnd#

Post by kevinkins »

Thanks.
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “WEGO World War II: Stalingrad: Mods and Scenarios”