Trigger / Beings Casting

Anything.

New Member
Reaction score
69
I'm trying to make a casting system so that when a unit begins casting, it creates an effect, and when it dies / stops / finishes casting, it removes the effect. The effect currently only appears after the unit finishes casting and removes itself in about 1 seconds.

Code:
Fire Spell
    Events
        Unit - A unit Begins casting an ability
    Conditions
        ((Casting unit) is A Hero) Equal to True
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Feral Spirit (Test)
    Actions
        Special Effect - Create a special effect attached to the (hand + left) of (Casting unit) using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
        Set SpellLeft[(Player number of (Owner of (Casting unit)))] = (Last created special effect)
        Special Effect - Create a special effect attached to the (hand + right) of (Casting unit) using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
        Set SpellRight[(Player number of (Owner of (Casting unit)))] = (Last created special effect)
        Animation - Play (Casting unit)'s (spell + loop) animation

Code:
Finish Cast
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        ((Casting unit) is A Hero) Equal to True
    Actions
        Animation - Reset (Dying unit)'s animation
        Special Effect - Destroy SpellLeft[(Player number of (Owner of (Casting unit)))]
        Special Effect - Destroy SpellRight[(Player number of (Owner of (Casting unit)))]
 
G

Goauld

Guest
You should use starts the effect of an ability and stops casting an ability as your events. Stops casting includes all possibilities of stopping but finishes casting is only when the unit fully finishes the spell and its spell animation has ended.

Animation - Reset (Dying unit)'s animation
There's no dying unit, what should this refer to? Casting unit? Triggering unit is better than casting unit or dying unit in any trigger that has "some unit does something" as an event.

Channeling a normal spell isn't considered starts casting btw, if you wanted the art to show up during that time it's pretty hard to do.
 

Anything.

New Member
Reaction score
69
Goauld said:
You should use starts the effect of an ability and stops casting an ability as your events. Stops casting includes all possibilities of stopping but finishes casting is only when the unit fully finishes the spell and its spell animation has ended.


There's no dying unit, what should this refer to? Casting unit? Triggering unit is better than casting unit or dying unit in any trigger that has "some unit does something" as an event.

Channeling a normal spell isn't considered starts casting btw, if you wanted the art to show up during that time it's pretty hard to do.
Er, I swore I changed that code while editing. It's correct in my trigger editor though. That last code is a bit messed up, but it doesn't matter because I fixed it.

If casting time doesn't relate to when a unit starts and finishes casting, then what does? When does the unit start casting and when does it finish casting? I'm not trying to make the spell channel, but rather i want it to play channel animation.

When does a unit stop casting?
 
G

Goauld

Guest
You could try "starts channeling an ability" if your spell has a casting time longer than 0.00 seconds. And then remove the effects with "stops casting an ability". It fires when the casting is finished or cancelled. "Finishes casting an ability" actually comes after the unit has casted the spell and it can auto-attack, so although you always get the spell cast but if you order the unit something right when the spell fires it doesn't count as "finishes casting an ability".
 
T

tomcerveja

Guest
a unit "stops casting" (event) when you issue another order for it during the casting time, die, or finishes casting (complete the casting)

if you're trying to make an effect lasts as long as the unit stands still, or until a time limit (as i imagine youre trying to) you gotta use begins casting and stop casting, just like the other guy said. of course that the spell u're using as base must be useless, and have no non-trigger effects, because non-trigger spells only have their effect cast after the casting time is finished... =P
 

Anything.

New Member
Reaction score
69
tomcerveja said:
a unit "stops casting" (event) when you issue another order for it during the casting time, die, or finishes casting (complete the casting)

if you're trying to make an effect lasts as long as the unit stands still, or until a time limit (as i imagine youre trying to) you gotta use begins casting and stop casting, just like the other guy said. of course that the spell u're using as base must be useless, and have no non-trigger effects, because non-trigger spells only have their effect cast after the casting time is finished... =P
Uhm, I'm thinking that my "Finishes Casting" is actually happening before my "Starts Casting". Funny. I think this because my effect goes on the unit now, but doesn't go away. And then, when I recast the spell a couple more times, the effect doesn't stack on top of the previous, like all effects do.

Wouldn't "Begins channeling" only be used for spells like Starfall and Tranquility?

Er, I'm using Feral Spirit with an 8 second casting time for testing purposes.

Shouldn't stop casting be when a unit stops casting through finishing, ending, interruption, death, and etc.?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top