Triggers & ScriptsIn this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone.
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)
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?