• 🏆 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!

[Trigger] cooldown or dummy casting not working

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
cooldown or dummy casting not working (FIXED)

well i was told to post this and here i go.

im trying to make a skill that shoots 1 arrow and at a targeted unit, and a AOE happens at that unit. i looked at a few skills that i could just edit but i couldnt find one with the effect i wanted so i made my own with a dummy unit. now im having 1 of 2 problems: A) the skill works properly but the cooldown on the hero = 0 and mp cost = 0. or B) cooldown/mp work, aoe effect from dummy unit doesnt work.

ive disabled my spawning units thinking that might be the issue but no luck again.

my trigger is this:
Burst shot (unit) is the hero skill i gave the hero casting it
Burst Shot (dummy) the unit skill i gave the dummy based off of fan of knifes
both have 10 levels and both have a 10 second cooldown. the hero's skill has no damage, but yes on mp cost. the dummy unit one has no mp cost but has damage.

  • Burst Shot
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Burst Shot (Unit)
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit - Set level of Burst Shot (Dummy) for (Last created unit) to (Level of Burst Shot (Unit) for (Triggering unit))
      • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
hopefully im just missing something simple

i know it leaks and im only useing GUI as of now and i know that JASS is better, bla bla bla.

thx for the help.


THIS HAS BEEN FIXED, EQUAL HELPED ME, THANK YOU TO HIM!

problem was the unit beings casting an ability should have ben begins casting an effect and he also guided me into setting a unit variable for the dummy unit. all works you may close/delete or whatever to this thread.

 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
It leaks indeed, and you don't need JASS to remove those leaks.

You just need to add this custom script

  • Custom Script: call RemoveLocation( udg_location )
  • Change the udg_location to your point variable, for example if your point is called Location1 , then it will be udg_Location1
The point that leaks is the "create unit at point of triggering unit".

And a tip - please everyone that see's this - DON'T base triggers on "a unit starts casting" because a player can start casting the ability, and then stop before the unit started.
Terefor he will get the effects of the ability and the unit would be able to move or do whatever he wants.
 
Level 5
Joined
Nov 14, 2007
Messages
161
ok well now i've decided to clean up a few leaks now that it works and from what i understand this should work fine. problem is i cant save because it gives me an error on the custom script saying "expected a name." i've seen the function exist at one point in time so im wondering what i need to change to enable the custom scripts?

  • Burst Shot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burst Shot (Hero)
    • Actions
      • Set Point_BS = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point_BS facing Default building facing degrees
      • Set Dummy_BS = (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to Dummy_BS
      • Unit - Set level of Burst Shot (Dummy) for Dummy_BS to (Level of Burst Shot (Hero) for (Triggering unit))
      • Unit - Order Dummy_BS to Night Elf Warden - Fan Of Knives
      • Custom script: call RemoveLocation(udg_Point_BS)

and does this look good to you and leaky free.

thx for the help.
 
Last edited:
Level 5
Joined
Nov 14, 2007
Messages
161
Custom scripts (as I mentioned (or didn't?)) are one-line of JASS and terefor are Case Sensitive, so change your code to udg_Point_BS instead of udg_point_BS.
yeah i figured that one out earlier today but thx =P

And I suggest you read atleast a part of the "Things That Leak" sticky thread.
ive read most of it some time ago and even ran it through a leek checker and from what i can tell, its leak free. it seems to be MUI (more then 1 player can do this spell at once) which is what im needing as this spell will be on 3 different characters and has a possibility of being used at the same time.
 
Status
Not open for further replies.
Top