War for the Overworld

War for the Overworld

Discover and conquer new realms!
Looking for new realms to subjugate? Peruse the cavernous depths of the Workshop to find the next map upon which to sate your bloodlust or create your own and share via the in-game editor!
Learn More
Random numbers in Mighty Script
I have been using random numbers in the scripts function to trigger certain outcomes in the level that I'm creating.

I create a number with an initial value of 0, then in the script I trigger a random number event which gives the number a value between a series of integer values, say 1, 2 and 3. When actually running the game certain numbers never come out, so 1 and 2 would come out, but never 3. Conversely I have another number event where 3, 4, 5 or 6 should be chosen, in this event 4, 5 and 6 appear, but never 3.

I find this quite bizarre. Has anyone else experienced this? Does anyone have any advice? I can provide more details on the exact events used it needed.
< >
Showing 1-3 of 3 comments
Korvek 117 16 Apr, 2020 @ 6:47pm 
Yes. I had this too and ended up just accepting it as a bug. I have ticketed it already.
roysten712 17 18 Apr, 2020 @ 1:59am 
I'm glad it's recognised and ticketed, hopefully in the next patch we'll get a fix. Tried any good work around? It has been suggested to me that I expand my list of numbers so it then includes one more than the actual range I want.
Korvek 117 18 Apr, 2020 @ 6:24am 
Well, for me it was always the highest number rather than number 3. E.G. If I had a script pick between 1 and 2, it would always pick 1. If between 1, 2, and 3, it would pick between 1 and 2. My workaround was to add one number extra (so if I only wanted three numbers, I would make four). As has already been suggested, I would add just one extra as well. If you are having problem with number 3 only then just add one extra number and rescript it to substitute it. E.G. If you want 5 numbers, make 6 with possibilities 1, 2, 4, 5, and 6.
< >
Showing 1-3 of 3 comments
Per page: 1530 50