• 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] Pick units

Status
Not open for further replies.
Level 9
Joined
Nov 19, 2011
Messages
516
Hi there,

What is wrong with this line:

Pick every unit in (Region centered at(Target of Ablility being cast) with size (510, 510))

1. There is at last 1 unit in casted area for sure
2. Nothing is picked at all

Map attached.

Thanks for any suggest.
 

Attachments

  • (12)IceCrown KAZA v1.41.w3x
    3 MB · Views: 47
Level 28
Joined
Sep 26, 2009
Messages
2,520
First of, if you don't save the target point in variable and then you don't use the point variable in the line you posted, you will leak that location.

Second - why don't you use "Unit in range" option instead of "Unit in region" when picking units? Makes more sense and it doesn't have to use any dynamically created regions.
 
Level 9
Joined
Nov 19, 2011
Messages
516
  • Wait 0.10 game-time seconds
You can't use a wait action in a loop like that.

Oh.

so how to add delay?

  • Unit Group - Pick every unit it Ranage (510) from (Target of Ability being cast))
    • Actions
      • Unit - Create 1 (Caster) for (Owner of (Casting Unit) at (Position of (Casting Unit)
      • Unit - Add (Death Coil) to (Last Created Unit)
      • Unit - Order (Last Created Unit) to (Undead - Death Coil) targeting (Picked Unit)
      • Wait - Delay
 
Level 7
Joined
Mar 6, 2006
Messages
282
Well, it will get a lot more complicated. You need to use timers and dynamic indexing.

What effect are you trying to achieve? The way I see it now is:

- unit casts aoe spell
- effected enemies are death coiled 1 by 1, randomly

What's wrong with having them all death coiled at the same time? Not saying you have to do this, just trying to find the easiest way.
 
Level 7
Joined
Mar 6, 2006
Messages
282
If you're up for it, you can do it. Here's a tutorial on indexing:

http://www.hiveworkshop.com/forums/...-gui-user-should-know-233242/#Section 2 Ch 12

So you basically have 2 triggers. The first trigger is run when the unit cast's the spell "starts the effect of an ability". That's where you set all the variables for the spell, like damage, time, etc.

The 2nd trigger is the timer. It runs periodically and is turned on the by first trigger. This trig does all the actions for the spell, by reading all the variables set in the first trigger.

The tutorial shows you how to set up the indexing so that the spell is multi-unit instance, or MUI. That's why you can't use a 'wait' action in your original spell, because the variables won't be saved after the wait has ended, which is why it needs to be done with 2 triggers, and indexing.
 
Level 9
Joined
Nov 19, 2011
Messages
516
  • Unit Group - Pick every unit it Ranage (510) from (Target of Ability being cast))
    • Actions
      • Unit - Create 1 (Caster) for (Owner of (Casting Unit) at (Position of (Casting Unit)
      • Unit - Add (Death Coil) to (Last Created Unit)
      • Unit - Order (Last Created Unit) to (Undead - Death Coil) targeting (Picked Unit)
      • Wait - Delay

Now it looks like this:
  • Set tmp_casting = Casting Unit
  • Unit Group - Pick every unit it Ranage (510) from (Target of Ability being cast))
    • Actions
      • Unit - Create 1 (Caster) for (Owner of (Casting Unit) at (Position of (tmp_casting)
      • Set tmp_caster = Last Created Unit
      • Unit - Add (Death Coil) to (tmp_caster)
      • Unit - Order (tmp_caster) to (Undead - Death Coil) targeting (Picked Unit)
 
Status
Not open for further replies.
Top