Is there condition...

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2007
Messages
253
Is there any condition to detect if player is allowed/disallowed to train unit? I've been trying to find it but i could or maybe there is any other way to make other condition but with same effect?
Disabling heroes using this:
  • Player - Make Hero Unavailable for training/construction by Player 1 (Red)
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
I don't think there is...

But your problem won't really need it if you're only doing this by triggers.
Make a boolean variable and set it to true/false whenever you use that action. (You could make it an array as well since this only needs to be MPI)
Ex:
  • Player - Make Hero Unavailable for training/construction by Player 1 (Red)
  • Set CanTrainHero = False
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • CanTrainHero Equal to False
    • Then - Actions
      • -------- Do things here --------
    • Else - Actions
Of course, this solution doesn't really work well if you don't do everything by triggers/have a lot of units you want to check.
 
Level 8
Joined
Jun 26, 2010
Messages
530
Actually, most things that are not detecable by events can be detected by using variables in the moment they're created. Some time ago i was kind of surprised when i noticed a lot of people just don't tought about that lol

Also, i know watermelon_1234 knew it and just forgot to say or tought you already know it, but correct would be using an array :p
 
Status
Not open for further replies.
Top