|
|
This condition leaks, though.I found this conditions somewhere and added it.It works well.
(Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
If you do want to use your condition, then you need to put it inside an ITE, so you can remove the group leak.Only 1 hero:
Conditions
HasHero[Player number of (triggering player)] Equal to False
Actions
Set HasHero[Player number of (triggering player)] = True
Yeah, sure.Now i have a last problem.The other players can chose or random hero which i randomed.I didn't understand how to fix with those ways so can someone do and upload to copy my map ?
I don't think so.I think still the other player can pick or random hero which i randomed.
Random Komutu
Events
Player - Player 1 (Red) types a chat message containing -rastgele as An exact match
Player - Player 2 (Blue) types a chat message containing -rastgele as An exact match
Player - Player 3 (Teal) types a chat message containing -rastgele as An exact match
Player - Player 4 (Purple) types a chat message containing -rastgele as An exact match
Player - Player 5 (Yellow) types a chat message containing -rastgele as An exact match
Player - Player 6 (Orange) types a chat message containing -rastgele as An exact match
Player - Player 7 (Green) types a chat message containing -rastgele as An exact match
Player - Player 8 (Pink) types a chat message containing -rastgele as An exact match
Player - Player 9 (Gray) types a chat message containing -rastgele as An exact match
Player - Player 10 (Light Blue) types a chat message containing -rastgele as An exact match
Conditions
(Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
Actions
Set integerrandom = (Random integer number between 1 and HeroSayisi)
Unit - Create 1 rastgelehero[integerrandom] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Player - Add -1 to (Triggering player) Current lumber
Camera - Pan camera for (Triggering player) to (Position of (Last created unit)) over 0.00 seconds
Selection - Select (Last created unit) for (Triggering player)
Set rastgelehero[integerrandom] = rastgelehero[HeroSayisi]
Set HeroSayisi = (HeroSayisi - 1)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Make rastgelehero[integerrandom] Unavailable for training/construction by (Picked player)
I don't think so.
Here's an example:
integerrandom = 10
Thus you randomed "Zergling" ( = rastgelehero[10]).
--> rastgelehero[integerrandom] = rastgelehero[HeroSayisi]
--> rastgelehero[10] = rastgelehero[14]
This means that rastgelehero[10] is now "Rennder".
The new random hero will be a number between 1 and 13 (the new value for HeroSayisi).
"Zergling" can never be randomed again.
Oh, I see.I mean the other players mustn't chose my randomed hero. *-*
Something like this should work.
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Make rastgelehero[integerrandom] Unavailable for training/construction by (Picked player)