• 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] What's wronge with this trigger?

Status
Not open for further replies.
Level 7
Joined
Jan 18, 2007
Messages
180
  • shower
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shower
    • Actions
      • Set cpoint = (Target point of ability being cast)
      • Set cgroup = (Units in (Region centered at (Target point of ability being cast) with size (350.00, 350.00)) matching ((Unit-type of (Picked unit)) Equal to Growing Crops))
      • Unit Group - Pick every unit in cgroup and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a Grown Crops using The old unit's relative life and mana
      • Custom script: call RemoveRect(udg_cregion)
      • Custom script: call DestroyGroup(udg_cgroup)
It's supposed to turn Growing Crops into a different unit, Grown Crops. The problem is when I cast the ability (It's an item ability if it matters), nothing happens.
 
Level 5
Joined
Sep 10, 2006
Messages
185
  • Set cgroup = (Units in (Region centered at (Target point of ability being cast) with size (350.00, 350.00)) matching ((Unit-type of (Picked unit)) Equal to Growing Crops))
Shouldn't it be unit-type of matching unit? Not picked?

so:
  • Set cgroup = (Units in (Region centered at (Target point of ability being cast) with size (350.00, 350.00)) matching ((Unit-type of (Matching)) Equal to Growing Crops))
This is just from looking at it.


This works... :
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Player 1 (Red))) and do (Unit - Order (Picked unit) to Move To (Center of (Playable map area)))
so yeah I think that's it.
 
Level 5
Joined
Sep 10, 2006
Messages
185
I believe BagOfChips is right.

Anyways.
Swap this: "Unit - A unit Begins casting an ability"
With this: "Unit - A unit starts the effect of an ability"

Edit: I answered a few seconds late. :p

I've always wondered the subtle difference between the two, because they both seem to always work. Are there some cases where "begin casting" will glitch?
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Begins casting an ability and starts the effect of ability are very different events.

Starts the effect of an ability fires when the mana is used and the cooldown begins.

The Unit Begins Casting event is when the unit begins the casting point time - in other words, before mana is expended and before the cooldown begins. The event is much more fickle, particularly when used with abilities that do not have casting times - and for some abilities it doesn't even fire.
 
Status
Not open for further replies.
Top