| 02-27-2009, 04:51 AM | #1 |
Can anyone clue me in on how to order a unit to stop autocasting? I've tried everything I can think of, but it just won't stop. Here's what I've tried: JASS:
call IssueImmediateOrder(u, "faeriefire")
call IssueImmediateOrder(u, "faeriefireoff")
call IssueImmediateOrder(u, "faeriefireon")
call IssueImmediateOrder(u, "stop")
[edit] Found a method that worked; but I'd prefer not resorting to it:
globals
private timer Undotimer = CreateTimer()
private unit Undounit
private integer Undoability
private integer Undolvl
endglobals
private function Undo2 takes nothing returns nothing
call UnitAddAbility(Undounit, Undoability)
call SetUnitAbilityLevel(Undounit, Undoability, Undolvl)
endfunction
private function Undo takes nothing returns nothing
local RFLAG R = CALLBACK_STRUCT
local unit u = CALLBACK_RESPONDER
local integer I = GetUnitAbilityLevel(u, R.aid)
call UnitRemoveAbility(u, R.aid)
set Undounit = u
set Undoability = R.aid
set Undolvl = I
call TimerStart(Undotimer, 0, false, function Undo2)
endfunction
45 minutes of searching for functions or orders I can send; no luck =x. It's kind of aggrivating; nothing I do seems to work T_T. Any ideas? |
| 02-27-2009, 05:19 AM | #2 |
This should work: JASS:call UnitRemoveAbility(u, 'A000') call UnitAddAbility(u, 'A000') call MakeAbilityPermanent(u, 'A000', true) |
| 02-27-2009, 05:26 AM | #3 | |
Quote:
It doesn't =x. |
| 02-27-2009, 05:27 AM | #4 |
By "autocasting" do you mean automatically acquiring a target and casting it? Or do you mean activating autocast? |
| 02-27-2009, 05:30 AM | #5 | |
Quote:
Acitvating it; i want a way to be able to enable/disable autocast via triggers. |
| 02-27-2009, 05:45 AM | #6 |
That's dumb. Removing the ability should turn off the autocast. Try removing it, ordering the unit to stop, then adding it and making it permanent. |
| 02-27-2009, 06:00 AM | #7 | |
Quote:
It is very dumb =x. JASS:
private function Undo takes nothing returns nothing
local RFLAG R = CALLBACK_STRUCT
local unit u = CALLBACK_RESPONDER
local integer I = GetUnitAbilityLevel(u, R.aid)
call UnitRemoveAbility(u, R.aid)
call PauseUnit(u, true)
call IssueImmediateOrder(u, "stop")
call PauseUnit(u, false)
call UnitAddAbility(u, R.aid)
endfunction
Doesn't work with or without the pauses. Bleh; blizzard is weird. |
| 02-27-2009, 07:08 AM | #8 | |
Quote:
I tried that; it doesn't work. |
| 02-27-2009, 09:41 AM | #9 |
Post map. There is no problems with autocast. Removing and ordering stop it. |
| 02-27-2009, 10:45 AM | #10 |
Yea, I would think IssueImmedaiteOrder(<unit>, "faeriefireoff") would deactivate the auto-cast. You're sure these methods don't work? In fact, it does. At least, issuing the immediate "healon" or "healoff" orders both toggle the auto-cast automatically. Its kind of neat. |
| 02-27-2009, 08:15 PM | #11 |
JASS:
private function Undo takes nothing returns nothing
local RFLAG R = CALLBACK_STRUCT
local unit u = CALLBACK_RESPONDER
call BJDebugMsg("mhmm")
call SetUnitVertexColor(u, 255, 0, 0, 255)
call IssueImmediateOrder(u, "faeriefireoff")
endfunction
The correct unit is receiving the order; it fires correctly when toggled. The unit has an ability based on FaerieFire. \/ MAP: Ability is called Awesomewin; The trigger is called Awesome under General Examples. |
| 02-27-2009, 09:54 PM | #12 | |
Quote:
Indeed it does. There is no problem with issuing autocast orders, so you must be having a different issue in your map. |
| 02-27-2009, 11:52 PM | #13 |
Durrrrrrrr fixed your map thing |
