Hi for you, that is reading me. I'm in doubt about my random choice trigger and I'd like some help. For now. it is like this:
My doubt is: How can I erase a hero from his variable, when another player picks a hero at the tavern?
If I let the trigger as this, I can have a duplicated hero inside the game (Heroes are unique, so this is a leak). I didn't figure out yet, so here I am.
Why am I trying to do this?
All tests that I've runned along my project, at least one player tried to randomize his hero selection. So, I think it's something to insert in the project.
-
Random Player 1
-
Events
-
Player - Player 1 (Red) types a chat message containing -random as An exact match
-
-
Conditions
-
Actions
-
Set VariableSet Temp_Char_Randomed = (Random integer number between 1 and 21)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Random_Characters[Temp_Char_Randomed] Not equal to No unit-type
-
-
Then - Actions
-
Unit - Create 1 Random_Characters[Temp_Char_Randomed] for (Triggering player) at Hero_Spawn_Point facing Default building facing degrees
-
Camera - Pan camera for (Triggering player) to (Position of (Last created unit)) over 0.00 seconds
-
Game - Display to (All players) the text: (Player_Colors[(Player number of (Triggering player))] + ( has randomed the + Characters[Temp_Char_Randomed]))
-
Unit - Kill (Random unit from (Units in Players Souls <gen> owned by (Triggering player)))
-
Set VariableSet Random_Characters[Temp_Char_Randomed] = No unit-type
-
Set VariableSet Temp_Char_Randomed = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Trigger - Run (This trigger) (checking conditions)
-
-
-
-
My doubt is: How can I erase a hero from his variable, when another player picks a hero at the tavern?
If I let the trigger as this, I can have a duplicated hero inside the game (Heroes are unique, so this is a leak). I didn't figure out yet, so here I am.
Why am I trying to do this?
All tests that I've runned along my project, at least one player tried to randomize his hero selection. So, I think it's something to insert in the project.