• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Maths - Random Number doesn't work!

Status
Not open for further replies.
Level 5
Joined
Sep 14, 2004
Messages
66
At least not in my map, I've made the following trigger: (It's the triggers for random hero selection)

Events
Player - Player 3 (Teal) types a chat message containing -random as An exact match

Conditions
(Player 3 (Teal) Food used) Equal to 0

Actions
Set RandomHeroP3 = (Random integer number between 1 and 10)

Then after that, I've run a "if allconditions are true then, else actions" 1 number for each hero.
But when I test this, the trigger always sets the variable to 5 and I get the same hero over and over again, I've tested it like 5 times.

Really vexing :x
 
Level 4
Joined
Feb 13, 2004
Messages
32
Do you know what a random number seed is? Random numbers on a computer are predictable if you use the same seed.

If you use the Test Map option instead of actually starting your map from within War3, the map editor will force the same seed to be used everytime.

You can either uncheck the option"Fixed Random Seed" or you can test your map from within War3 instead of using Test Map.
 
Level 5
Joined
Jun 9, 2004
Messages
181
redscull said:
If you use the Test Map option instead of actually starting your map from within War3, the map editor will force the same seed to be used everytime.

You can either uncheck the option"Fixed Random Seed" or you can test your map from within War3 instead of using Test Map.

Yeah that's it. Go to file->preferences and there uncheck that FixedRandom. It caused me problems too unitl i finally found it. (for example in my InstaGib map it always used the same model for the enemy, and the same start location for both of us, tho it was random.)
 
Status
Not open for further replies.
Top