- Joined
- Feb 6, 2008
- Messages
- 166
I'm working on an Altered Melee map, and I'm adding more playable races in addition to the four already there.
I'm working on a trigger to prevent any one player from getting more than one of the same hero. Of course, there is "Melee Game - Limit Heroes to 1 per Hero-type (for all players)", but it apparently only works on the default heroes, even if you change the gameplay constants.
How effectively and efficiently does this trigger do the trick?
Also, I don't know if this counts as a Trigger Creation or Trigger Fixing thread. Sorry if I put it in the wrong place. In a sense, I want to fix what I have above, but in another sense, I'm also looking to see if anyone knows of a better way to do it than me, in which case, I'd be creating a trigger, since the one above would be scrapped.
Yes, I said in my previous thread that I'm taking a break from THW and map-making, but I decided to at least make this race playable first. The duplicate hero problem is something that keeps this race from being playable. After all, it wouldn't be fair to get three of the same hero now, would it? Especially if it were a hero with AoE damaging spells...
I'm working on a trigger to prevent any one player from getting more than one of the same hero. Of course, there is "Melee Game - Limit Heroes to 1 per Hero-type (for all players)", but it apparently only works on the default heroes, even if you change the gameplay constants.
How effectively and efficiently does this trigger do the trick?
-
Hero Count Fix
-
Events
- Unit - A unit Finishes training a unit
- Conditions
-
Actions
-
For each (Integer ForLoop_Temp_Integer) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Trained unit)) Equal to Overlord
- (Unit-type of (Trained unit)) Equal to Imp
- (Unit-type of (Trained unit)) Equal to Succubus
- (Unit-type of (Trained unit)) Equal to War Contraption
- --- Just keep adding all the custom heroes here. ---
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by PlayerIndex[ForLoop_Temp_Integer]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer ForLoop_Temp_Integer) from 1 to 8, do (Actions)
-
Events
Also, I don't know if this counts as a Trigger Creation or Trigger Fixing thread. Sorry if I put it in the wrong place. In a sense, I want to fix what I have above, but in another sense, I'm also looking to see if anyone knows of a better way to do it than me, in which case, I'd be creating a trigger, since the one above would be scrapped.
Yes, I said in my previous thread that I'm taking a break from THW and map-making, but I decided to at least make this race playable first. The duplicate hero problem is something that keeps this race from being playable. After all, it wouldn't be fair to get three of the same hero now, would it? Especially if it were a hero with AoE damaging spells...