HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Tides of blood limit Hero Select

09-05-2006, 05:23 PM#1
Jman11
In tides of blood the hero select system limits your amount of heroes picked to 1 please can someone give me an exact trigger on how to limit the amount of heroes.

Thanks
09-05-2006, 05:25 PM#2
Rising_Dusk
Have a global integer array with indicies associated with each player's player number.
In GUI, you would use converted player numbers, therefore the integers would be 1-12 inclusive.

When a player selects a hero, set their integer to 1.
Then only permit a player to select a hero if their integer is 0.
You could use booleans too, but I like integers more.

It's really quite simple, give it a try and I'm sure you'll get it.
We can help you out along the way if you still have trouble.
09-05-2006, 05:26 PM#3
Anitarf
Please be more specific. What kind of hero selection system are you using, do you want to limit it to one of a type or one per player or what?
09-05-2006, 05:33 PM#4
Jman11
one per player, and i think rising dusk got it right anyhow thanks alot. And for the integer thing didnt you mean: Then only permit a player to select a hero if their integer is 1.

Anitarf: I wanted the ToB Limit hero trigger
09-05-2006, 05:41 PM#5
moyack
In player trigger section there's one option to limit the number of units that can be trained by a player. Is something like that:

Trigger:
Player - Limit training of <Your hero> to 1
I don't know if this can help you. I hope so.
09-05-2006, 05:43 PM#6
Rising_Dusk
Well, no.
Also, trained heroes don't factor heroes given by trigs.

Initially a player's integer is 0.
Then when they select a hero set it to 1.
Then permit a player to select a hero ONLY when their integer is 0.
(Therefore that means they haven't picked yet)
09-05-2006, 08:07 PM#7
Captain Griffen
A boolean array would be much more appropriate.
09-05-2006, 10:53 PM#8
martix
Yeah, I imagine bools take less space than int's :)
09-05-2006, 11:02 PM#9
PipeDream
Nope, same exact space. Integers makes it extensible, booleans mean one less comparison. whatever floats your boat.
09-05-2006, 11:05 PM#10
The__Prophet
Except Boolean would be easier. Somthing like this.

set Hero_Picked[player number of owner of trigger unit] = true

then make a condition where it only runs if hero_picked[player number] = false
09-05-2006, 11:15 PM#11
martix
Quote:
Originally Posted by PipeDream
Nope, same exact space. Integers makes it extensible, booleans mean one less comparison. whatever floats your boat.
Oh... why?
Bools can take only one single bit, if you use integers won't it take as much as 4294967296, which is 2 on what power? 2 bytes i think...
09-06-2006, 12:09 AM#12
Rising_Dusk
I like integers because maybe later on you want that same integer to be 2 etc. for a special case or something.
It allows more versatility.

And yeah, whatever floats your boat.
Doesn't really matter.
09-06-2006, 04:48 AM#13
blu_da_noob
Quote:
Originally Posted by martix
Oh... why?
Bools can take only one single bit, if you use integers won't it take as much as 4294967296, which is 2 on what power? 2 bytes i think...

WC3 allocates the same space for each perhaps? And Vex found that booleans can have values other than 0 and 1.
09-06-2006, 02:51 PM#14
Jman11
can someone tell me how to make the integer one work please? Im not sure how to do it (as a trigger)

Thanks
09-06-2006, 04:53 PM#15
Jman11
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit

Conditions
((Triggering unit) is A Hero) Equal to True
(Unit-type of (Triggering unit)) Equal to Pandaren Brewmaster
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LimitHero[1] Equal to 0
LimitHero[2] Equal to 0
LimitHero[3] Equal to 0
LimitHero[4] Equal to 0
LimitHero[5] Equal to 0
LimitHero[6] Equal to 0
Then - Actions
Unit - Change ownership of Pandaren Brewmaster 0024 <gen> to Player 1 (Red) and Change color
Unit - Move (Triggering unit) instantly to (Center of Team 1 <gen>)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 1 (Red)
Then - Actions
Set LimitHero[1] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 2 (Blue)
Then - Actions
Set LimitHero[2] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 3 (Teal)
Then - Actions
Set LimitHero[3] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 4 (Purple)
Then - Actions
Set LimitHero[4] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 5 (Yellow)
Then - Actions
Set LimitHero[5] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 6 (Orange)
Then - Actions
Set LimitHero[6] = 1
Else - Actions
Camera - Pan camera for (Picked player) to (Center of Team 1 <gen>) over 0.00 seconds
Wait 30.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of Pandaren Brewmaster 0024 <gen>) Equal to Neutral Passive
Then - Actions
Unit - Remove Pandaren Brewmaster 0024 <gen> from the game
Else - Actions
Trigger - Turn off (This trigger)


I think i got it But im just making sure, if there is a shorter way please let me know
(please ignore some of the triggers like the wait trigger thanks)