• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Dummy not casting spell

Status
Not open for further replies.
I have a script that is supposed to make a dummy cast a spell on a unit everytime it is damaged by a specific enemy (based on chance).
Problem is, for some reason, it won't fire.

This is how the code snippet looks:
JASS:
set dummy = CreateUnitAtLoc(GetOwningPlayer(u2), 'h00N', loc, 0.)
call UnitAddAbility(dummy, 'A009')
call IssueTargetOrder( dummy, "cripple", u2)
call UnitApplyTimedLife(dummy , 'BTLF', 10.00 )
call PauseUnit(u2, true)
call BJDebugMsg("Immobilized")
call RemoveLocation(loc)

i am sure there's nothing wrong with the variables, and i have bugchecked and noticed that the unit IS infact created, so the problem lies in the spell.
The variable "u2" is set to "Triggering Unit", of a trigger with the event "x unit takes damage". It works with the "PauseUnit" call, so it must be right.

I can't screenshot the spell in the object editor, byt i can type some of the important properties:

Code:
Check Dependencies: False
Cast Range: 9999
Cooldown: 0.10
Duration: 9999
Mana Cost: 0
Targets Allowed: Ground, Enemy, Friend, Allied, Mechanical.

The dummy unit has the following abilities:

Code:
Locust
Invurnerability

The dummy has no model file.


And well.. i don't know what other information could be neccesary. The problem just seems really silly to me. :(

EDIT: Debug also shows that the unit BEGINS casting the ability (which means the dummy is created, gains the ability, knows the target, begins casting, but can't). This is really confusing me.
EDIT: Gave the dummy ability to a regular ground unit and ordered it to cast it on the target. Worked like a charm. But somehow, the dummy refuses to do the same! Why?!
It lives for 10 seconds, so it should have well enough time..
 
Last edited:
Status
Not open for further replies.
Top