• 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.

Priority?

Status
Not open for further replies.
Level 7
Joined
Jun 23, 2009
Messages
297
Hi all, I have a castle and two towers that defend it. What i want is that the creeps first attack the towers and THEN the castle, so, i don't want to use triggers, because if i order to attack the towers it wont attack other heros that are in the game, so it wont work.
How to do that?
 
Level 3
Joined
Feb 23, 2010
Messages
73
Well without triggers the only thing I can think of is giving the towers a taunt ability, and triggering it to go off every couple seconds or so...

This situation could be absolved with triggers though.

this is a pretty dumbed down version, but something like this could work too:

Where Tower1_isDead and Tower2_isDead are boolean variables, and my_Unit_Group is a Unit Group Variable:
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • If (all conditions are true, then do actions)
      • Conditions
        • (Dying Unit) Equal to (Tower1)
      • Then
        • Set (Tower1_isDead) = True
      • Else
        • Do Nothing
    • If (all conditions are true, then do actions)
      • Conditions
        • (Dying Unit) Equal to (Tower2)
      • Then
        • Set (Tower2_isDead) = True
      • Else
        • Do Nothing
  • Events
    • Unit - A unit is attacked
  • Conditions
    • Unit-Type of attacked unit Equal to Castle
  • Actions
    • If (all conditions are true, then do actions)
      • Conditions
        • (Tower1_isDead Equal to False) or (Tower2_isDead Equal to False)
      • Then
        • Set my_Unit_Group = Units owned by (Enemy)
        • Unit Group - Remove Castle from my_Unit_Group
        • Unit - Order (attacking unit) to attack (Random unit from (my_Unit_Group))
      • Else
        • Do Nothing
This will make your units attack other units before attacking the castle
 
Level 3
Joined
Feb 23, 2010
Messages
73
acually im not sure on this at all, but doesn't the stats - priority field affect targeting? isn't that what it's for? if im wrong please correct me I rarely encouter this circumstance.
also the unit's level? And I believe AI script will lower attack priority for peon type units too.
 
Status
Not open for further replies.
Top