• 🏆 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!

[Trigger] Randoming trigger.

Status
Not open for further replies.
Level 1
Joined
Jun 20, 2012
Messages
4
When the trigger creates a random unit its not so random.. its the same unit for everyone, each time its a different hero.. but everyone gets the same hero.. help?

  • All Random
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Trigger - Turn off Default mode <gen>
      • Trigger - Turn off Turn off all random <gen>
      • Trigger - Turn off Allowed Selection <gen>
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Quest - Display to (All players) the Hint message: ((Name of (Triggering player)) + has selected random mode.)
              • Set Random_Hero = (Random integer number between 1 and Random_Count)
              • Unit - Create 1 Heroes_array[RandomData[Player_Count]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
              • Set RandomData[Random_Hero] = Random_Count
              • Set Player_Count = (Random_Count - 1)
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
              • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
                • Loop - Actions
                  • Camera - Pan camera for (Picked player) to (Center of Team1Circle <gen>) over 0.00 seconds
              • Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
                • Loop - Actions
                  • Camera - Pan camera for (Picked player) to (Center of Team2Circle <gen>) over 0.00 seconds
              • Trigger - Turn on Random level 2 <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • Do nothing
 
Level 5
Joined
Jun 16, 2004
Messages
108
Perhaps you could explain what you were thinking when you designed the random system this way and the purpose behind each of those variables?

Set Random_Hero = (Random integer number between 1 and Random_Count)
Unit - Create 1 Heroes_array[RandomData[Player_Count]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
Set RandomData[Random_Hero] = Random_Count
Set Player_Count = (Random_Count - 1)

I can tell you one thing I have noticed though. Player count is set to random_count - 1, but I do not see random_count being modified anywhere. So it could be that Heroes_array[RandomData[Player_Count]] is using the same player_count for every player except for the first one. Which might be the main reason why several players would be getting the same hero.

On another note, are you trying to avoid players getting the same type of hero when it randoms?
 
Level 4
Joined
Oct 20, 2011
Messages
129
The Warcraft 3 randomizer is really stupid. It results the same each time you start the map it.
Example:
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • Game - Display to (All players) the text: (String((Random integer number between 1 and 10)))
It always displays 7 6 1 9 3 10 8... with me...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The system never is stupid because the stupid would be the human because simply, we created them to act like that.

1. Open World Editor
2. File
3. Preferences...
4. Test Map Tab
5. Untick the "Use Fixed Random Seed"

You're good to go.

If you want to ask "why the hell do they want to get a same value whereas the system itself if called random?"

Well, for some experimenters who wants to repeat the test, they will do it in a controlled variable, where you can easily catch a data or whatsoever.

It is really useful for experimenting with random values with a controlled situation.
 
Status
Not open for further replies.
Top