- Joined
- Jan 11, 2009
- Messages
- 3,414
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:
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:
The dummy unit has the following abilities:
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..
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: