• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ability trigger help

Status
Not open for further replies.
Level 3
Joined
May 26, 2014
Messages
41
Hey, so i have an ability called "Witch Hunt" and it damages units that cast a spell. I've decided to change the ability a bit and add an AoE silence after the ability is finished casting. I've tried to create a trigger for this, but i'm pretty bad at making them.
Any help would be greatly appreciated.
 
Last edited:
Level 3
Joined
May 26, 2014
Messages
41
CasLoc is where? You do not set it. Plus you do not create a group, why destroy one? Position of Triggering Unit leaks.

I've created this trigger based of another one, didnt delete that part. Just shows how noobish I am at this. Thanks. Is that the only problem tho?

is the ability a PBAoE? if it isn't then it should be "target point of ability being cast" instead of unit position of triggering unit.

It is PBAoE.
 
Level 12
Joined
Nov 3, 2013
Messages
989
and well for next time you might want to use
  • copied text from world editor[\trigger] to post the trigger instead of an image
 
Level 3
Joined
May 26, 2014
Messages
41
  • Witch Hunt Silence
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Witch Hunt
    • Actions
      • Set WitchHuntDummy = (Last created unit group)
      • Unit - Create 1 Shards of Ice Dummy for (Owner of (Casting unit)) at CasLoc facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Witch Hunt Silence to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Dark Ranger - Silence (Position of (Triggering unit))
      • Custom script: call DestroyGroup(udg_WitchHuntDummy)
 
Level 3
Joined
May 26, 2014
Messages
41
  • Witch Hunt Silence
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Witch Hunt
    • Actions
      • Unit - Create 1 Shards of Ice Dummy for (Owner of (Casting unit)) at CasLoc facing Default building facing degrees
      • Set WitchHunterDummy2 = (Last created unit)
      • Set CasLoc = (Target point of ability being cast)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Witch Hunt Silence to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Dark Ranger - Silence (Position of (Triggering unit))
      • Custom script: call DestroyGroup(udg_WitchHuntDummy2)
      • Custom script: call RemoveLocation(udg_CasLoc)
Like this?
 
Level 12
Joined
Nov 3, 2013
Messages
989
yeah, and remove the DestroyGroup custom script too

btw, you probably want to use "a unit starts the effect of an ability" unless it's a channel ability (which i doubt since it's a PBAoE).

also, use the variables now instead of "last created unit" and "unit postition of trigger unit" (otherwise there's no point in creating them and the location would still leak)

  • Unit - Order WitchHunterDummy2 to Neutral Dark Ranger - Silence CasLoc
also you forgot to use triggering player
  • Unit - Create 1 Shards of Ice Dummy for triggering player at CasLoc facing Default building facing degrees
 
Level 3
Joined
May 26, 2014
Messages
41
yeah, and remove the DestroyGroup custom script too

btw, you probably want to use "a unit starts the effect of an ability" unless it's a channel ability (which i doubt since it's a PBAoE).

Witch Hunt ability is a channel ability and i want silence to be used after the unit stops casting that channel ability.

Also, move the CasLoc before you create unit and use it as reference point to prevent leaks.

How do i do that?

This is how my trigger looks like right now :
  • Witch Hunt Silence
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Witch Hunt
    • Actions
      • Unit - Create 1 Shards of Ice Dummy for (Triggering player) at CasLoc facing Default building facing degrees
      • Set WitchHunterDummy2 = (Last created unit)
      • Set CasLoc = (Target point of ability being cast)
      • Unit - Add a 1.00 second Generic expiration timer to WitchHunterDummy2
      • Unit - Add Witch Hunt Silence to WitchHunterDummy2
      • Unit - Order WitchHunterDummy2 to Neutral Dark Ranger - Silence (Position of (Triggering unit))
      • Custom script: set <unit> = null
      • Custom script: call RemoveLocation(udg_CasLoc)
 
Level 12
Joined
Nov 3, 2013
Messages
989
since the variable isn't set before you use it, it will not be used it will be used but it will not have been set to something else than x=0, y=0 (center of map).

Set CasLoc = (Target point of ability being cast)
Unit - Create 1 Shards of Ice Dummy for (Triggering player) at CasLoc facing Default building facing degrees
 
Level 3
Joined
May 26, 2014
Messages
41
since the variable isn't set before you use it, it will not be used it will be used but it will not have been set to something else than x=0, y=0 (center of map).

Set CasLoc = (Target point of ability being cast)
Unit - Create 1 Shards of Ice Dummy for (Triggering player) at CasLoc facing Default building facing degrees

Done, now jass gives me an error when i save the map.
  • Witch Hunt Silence
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Witch Hunt
    • Actions
      • Set CasLoc = (Target point of ability being cast)
      • Unit - Create 1 Shards of Ice Dummy for (Triggering player) at CasLoc facing Default building facing degrees
      • Set WitchHunterDummy2 = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to WitchHunterDummy2
      • Unit - Add Witch Hunt Silence to WitchHunterDummy2
      • Unit - Order WitchHunterDummy2 to Neutral Dark Ranger - Silence CasLoc)
      • Custom script: set udg_WitchHuntDummy2 = null
      • Custom script: call RemoveLocation(udg_CasLoc)
 
Level 3
Joined
May 26, 2014
Messages
41
GIves me an error "undeclared variable udg_WitchHuntDummy2" Edited: nvm i'm dumb, spelled it wrong. Gonna test the trigger now
  • Witch Hunt Silence
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Witch Hunt
    • Actions
      • Set CasLoc = (Target point of ability being cast)
      • Unit - Create 1 Shards of Ice Dummy for (Triggering player) at CasLoc facing Default building facing degrees
      • Set WitchHunterDummy2 = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to WitchHunterDummy2
      • Unit - Add Witch Hunt Silence to WitchHunterDummy2
      • Unit - Order WitchHuntDummy2 to Neutral Dark Ranger - Silence CasLoc
      • Custom script: udg_WitchHunterDummy2 = null
      • Custom script: call RemoveLocation(udg_CasLoc)
 
Level 3
Joined
May 26, 2014
Messages
41
Oh crap, "udg_WitchHunterDummy2"; the same name as your variable. Sorry.

Nah it was my bad, spelled variable "Hunter" and not "Hunt" for some reason :D
Silence after the ability still doesn't work for some reason. Maybe it has something to do with the end of channeling or silence ability.
 
Level 3
Joined
May 26, 2014
Messages
41
a. Can the dummy cast? (spell research requirements, mana cost, etc.)
b. Is the dummy casting fast enough for 1s? (cast backswing/point, ability casting time)
c. Make sure dummy has 0 movement speed, and Flying movement type.

This Dummy is already used in other triggers and they're working fine(Those triggers werent made by me), so i think dummy isn't the problem. However the ability is the "Item Silence ability", it could do smth with this. Ima check what you wrote tho.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Maybe that item silence ability doesn't have the same order id string as banshee ranger silence, try changing the ability.

also actually, isn't it supposed to be finishes channeling an ability? (not casting)
 
Level 3
Joined
May 26, 2014
Messages
41
Maybe that item silence ability doesn't have the same order id string as banshee ranger silence, try changing the ability.

also actually, isn't it supposed to be finishes channeling an ability? (not casting)

There's no "finishes channeling an ability", only casting. I've tried different abilities, didnt work.
 
Level 12
Joined
Nov 3, 2013
Messages
989
ehm, I just thought of something, why is it "target point of ability being cast" when it's a PBAoE btw? it should be "unit position of triggering unit" xd
 
Level 3
Joined
May 26, 2014
Messages
41
ehm, I just thought of something, why is it "target point of ability being cast" when it's a PBAoE btw? it should be "unit position of triggering unit" xd

Changed that. It finally works! Thanks a lot guys! I've already gave you both +rep, not sure if i can do that again!
 
Level 12
Joined
Nov 3, 2013
Messages
989
Player Based Area of Effect, it's not a very accurate term to use in an RTS style game (like wc3) though since the player doesn't necessarily control only one character but yeah...
 
Level 12
Joined
Nov 3, 2013
Messages
989
Here it is called instant or No Target abilities. :3

No Target doesn't specify what it does though. PBAoE means that it's an Area of Effect centered around the player character, like warstomp for instance, while No Target might as well be berserk or something.

For choosing between target point or position of unit we only need what type of targeting. But knowing that the ability were an area of effect (due to the silence ability) I specified it to PBAoE.
 
Status
Not open for further replies.
Top