• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Unit peon classification

Status
Not open for further replies.
Level 4
Joined
Sep 6, 2012
Messages
88
Hi everyone,

I'm currently having an unsolvable problem that I'd like to receive help from you.

  • Being Attacked In Stealth
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Is attacked
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of (Triggering unit)) Equal to (Order(<Empty String>))
          • Stealth_Check[0] Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Hint message: abc
          • Unit - Add classification of A peon-type unit to (Triggering unit)
        • Else - Actions
          • Quest - Display to (All players) the Hint message: zzzzzz
          • Unit - Remove classification of A peon-type unit from (Triggering unit)
I'm trying to set a hero's classification flexibly depending on whether he's being attacked or not. If he's not, then I add a Peon classification to him so he wouldn't start aggroing and if he's being attacked, I remove the classification so instead of running away he will start fighting back. The Stealth_Check variable here is only for checking whether my hero is inside a region or not () since I only want this trigger to run within this region.

The problem is that everything seems to run well, I get the Quest Display to print out text to ensure that my conditions are correct. However, it seems that once my hero Peon classification is removed, he will never regain it again even if the fight's long over. I don't know what caused this, especially when I get the abc and zzzzz hints printed out correctly. Please help me figure out the problem, thank you very much !
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Here are the events that you can experiment with:
  • Acquires Target
    • Events
      • Unit - No unit Acquires a target
      • Unit - No unit Notices a target in range
    • Conditions
    • Actions
This event is under Unit - Specific unit event, which means that you'll need another trigger to attach it to this trigger.
When the hero enters the game, do this:
  • Trigger - Add to Acquires Target <gen> the event (Unit - hero Acquires a target)
The rest should be easy, good luck!
 
Level 4
Joined
Sep 6, 2012
Messages
88
Your solution looks a bit complicated to me and I guess by trying to go all the way with it, my map is going to be a lot laggy. Therefore I decided to drop this matter at the moment since there's not a really effective solution to it. Thank you very much for helping me ! :)
 
Status
Not open for further replies.
Top