- Joined
- Dec 30, 2007
- Messages
- 1,554
Hey!
I've tried to make a random hero system,
but I have a problem....
When I buy the random unit, it always "picks"
the same hero. So it's not really random at all...
I used this tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hero-selection-systems-38699/
I've tried to make a random hero system,
but I have a problem....
When I buy the random unit, it always "picks"
the same hero. So it's not really random at all...
I used this tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hero-selection-systems-38699/
-
Random Hero
-
Events
-
Unit - A unit Sells a unit
-
-
Conditions
-
(Unit-type of (Sold unit)) Equal to Random Hero
-
-
Actions
-
Set Temp_Pt = ((Owner of (Sold unit)) start location)
-
Unit - Remove (Sold unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Hero_choosen_by_player[(Player number of (Owner of (Sold unit)))] Equal to False
-
-
Then - Actions
-
Set Hero_choosen_by_player[(Player number of (Owner of (Sold unit)))] = True
-
Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and 36)] for (Owner of (Sold unit)) at Temp_Pt facing Default building facing degrees
-
Unit - Move (Sold unit) instantly to Temp_Pt
-
Camera - Pan camera for (Owner of (Sold unit)) to (Position of (Sold unit)) over 1.00 seconds
-
Hero - Create Scroll of Town Portal and give it to (Last Created Unit)
-
Selection - Clear selection for (Owner of (Sold unit))
-
Selection - Add (Last created unit) to selection for (Owner of (Last created unit))
-
-
Else - Actions
-
Game - Display to (All players) the text: You already have a ...
-
-
-
Custom script: call RemoveLocation (udg_Temp_Pt)
-
-