Random function bugged?

Baterasis

New Member
Reaction score
4
FIXED

Even with the Fixed Random Seed box unchecked, the game always generates a fixed number. Changing from Test Map to manually starting the game changes nothing, not even online play changes anything.

At startup, a cinematic will play, randomly displaying one of the playable Heroes with a short description. While I've got the cinematic to work, one Hero will show up every time I start the map - and it's always the first one in the array.

Example:

Trigger:
  • Initialize Cinematic
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Position of Garage 0012 <gen>) over 0.00 seconds
      • Set RandomInteger = (Random integer number between 1 and 10)
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Disable user control for (All players)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 1.00 seconds
      • Set ranCin[1] = Paladin
      • Set ranCin[2] = Deceiver
      • Set ranCin[3] = Imperial Guard
      • Set ranCin[4] = Crypt Lord
      • Set ranCin[5] = Star Caller
      • Set ranCin[6] = Pagan Priestess
      • Set ranCin[7] = Captain
      • Set ranCin[8] = Royal Buccaneer
      • Set ranCin[9] = Mechanist
      • Set ranCin[10] = Deathbringer
      • Set ranString[1] = |cffffcc00Baz Darkhammer|r the Paladin.|n|nStrength based, melee Hero.
      • Set ranString[2] = |cffffcc00Akash|r the Deceiver.|n|nIntelligence based, ranged Hero.
      • Set ranString[3] = |cffffcc00Virgil|r the Imperial Guard.|n|nStrength based, ranged Hero.
      • Set ranString[4] = |cffffcc00Akkad|r the Crypt Lord.|n|nIntelligence based, ranged Hero.
      • Set ranString[5] = |cffffcc00Agony|r the Star Caller.|n|nIntelligence based, melee Hero.
      • Set ranString[6] = |cffffcc00Dyan|r the Pagan Priestess.|n|nAgility based, ranged Hero.
      • Set ranString[7] = |cffffcc00Storgh|r the Captain.|n|nStrength based, melee Hero.
      • Set ranString[8] = |cffffcc00Cheltenham|r the Royal Buccaneer.|n|nStrength based, melee Hero.
      • Set ranString[9] = |cffffcc00Ning'Kenonk|r the Mechanist.|n|nAgility based, melee Hero.
      • Set ranString[10] = |cffffcc00Lando|r the Deathbringer.|n|nAgility based, melee Hero.
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Apply Cinematic <gen> for (Picked player) over 3.00 seconds
      • Wait 1.00 game-time seconds
      • Cinematic - Send transmission to (All players) from a Neutral Passive ranCin[RandomInteger] named |cffffcc00Todays Co... at (Center of (Playable map area)): Play Credits <gen> and display ranString[RandomInteger]. Modify duration: Add 1.50 seconds and Don't wait
      • Wait 8.00 game-time seconds
      • Sound - Stop (Last played sound) After fading
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Apply Standard <gen> for (Picked player) over 0.00 seconds
      • Trigger - Run Exit Cinematic <gen> (ignoring conditions)


Adding every Hero to a group and then using the Random Unit from Group does exactly the same - it picks the unit that was first assigned to that group - always.

Any solutions?
 

Baterasis

New Member
Reaction score
4
I also have a random function that is executed every time a unit dies, that is working as intended. And I know that the trigger I posted has worked properly before. Guess I have to check earlier versions to find a solution.
 

Inflicted

Currently inactive
Reaction score
63
What I generally do, is put a Wait Random Amount of Time between 0 and 1 seconds, and that generally adds to the randomness.
The random normally depends on time and events, and things of that type, try to keep it as differently evented as possible.
 

Baterasis

New Member
Reaction score
4
What I generally do, is put a Wait Random Amount of Time between 0 and 1 seconds, and that generally adds to the randomness.
The random normally depends on time and events, and things of that type, try to keep it as differently evented as possible.

It seems that checking the Fixed Random Seed box, saving and exiting World Editor, then opening the map, unchecking the box and saving the map made the random function work as intended again. If I ever get problems with random numbers again, I will make sure I try that idea of yours.
 

Inflicted

Currently inactive
Reaction score
63
That random fixed seed thing only occurs in Test'ing with the editor.
What I was describing was that if you like have an event that randomly does something on a set time. The random isnt always as random as you would hope so. So i re-randomize the random, effectively :p
It may seem unnessesary but it does help sometimes haha.

Glad its solved, always test in like a Multiplayer game to test things like that. Things sometimes operate slightly different through test.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top