| 09-26-2007, 05:38 PM | #1 |
So I encountered this very weird bug, figured maybe someone here has seen it before or knows something about it... I have a necromancer with a raise dead issue. There are 2 custom abilities in my map. Both of them based off channel, both with an orderid of "channel". They are identical, they only differ in name and icon. One is "Autocast On", one is "Autocast Off". Using either replaces itself with the opposite (simple toggle). The necromancer has its base abilities, and Autocast On. The ability doesn't do anything, its not a script issue. If I try to cast raise dead immediately, it works. 2 Skeletons are summoned, a corpse is used. The problem comes when I toggle autocast. If I hit AutocastOn, its replaced with AutocastOff. The raise dead still works fine. If I hit autocastOff, its replaced with AutocastOn, and any subsequent Raise Dead fails automatically with the message "There are no usable corpses nearby". There are definately usable corpses nearby. The second I hit AutocastOn to turn it off, the raise dead starts working again, using up corpses etc. If I use the autocast-raise dead feature (right clicking on raise dead), it will not do anything until the AutocastOn Ability is removed from the unit. As soon as I toggle the AutocastOn to AutocastOff, it starts raising corpses. I'm at a complete loss as to why this is occuring. Any ideas as to what is failing here could help. EDIT: Found some new information already: JASS:function ACST_EventSpellUnitToggleAutocast takes nothing returns nothing local unit uCaster = GetTriggerUnit() local integer iAbilityId = GetSpellAbilityId() if ( iAbilityId == ACST_AutocastOnAbilityId ) then call UnitRemoveAbility(uCaster, ACST_AutocastOnAbilityId) call UnitAddAbility(uCaster, ACST_AutocastOffAbilityId) elseif ( iAbilityId == ACST_AutocastOffAbilityId ) then call UnitRemoveAbility(uCaster, ACST_AutocastOffAbilityId) call UnitAddAbility(uCaster, ACST_AutocastOnAbilityId) endif set uCaster = null endfunction |
| 09-26-2007, 05:41 PM | #2 |
have you looked at the action strings (i think there called) maby there flipped? |
| 09-26-2007, 11:18 PM | #3 | |
Quote:
I you sure you want EVENT_PLAYER_UNIT_SPELL_CAST, it does not sound logical to me? Why is it exactly that you don't want to use EVENT_PLAYER_UNIT_SPELL_EFFECT ? |
| 09-26-2007, 11:28 PM | #4 |
Not that it is of any importance but, EVENT_PLAYER_UNIT_SPELL_CAST occurs when you start casting, and EVENT_PLAYER_UNIT_SPELL_EFFECT occurs after your cast point, making it take time to occur. |
| 09-26-2007, 11:39 PM | #5 | |
Nope it does not, you just have to remove that 0.98 from your channel Quote:
ZOMG ERROR, ERROR, ERROR, GAMECRASH. SORRY YOU GOT DISCONNECTED - FOREVER EDIT: And now that I calmed down in a bit more detail: NEVER EVER EVER .. (come down) EVER use same orderid for 2 spells on the same hero - EVER It does not matter if they are swapped (you are using some boolean flag I presume? - bad idea) Make 2 triggers, one for ON and one for OFF. |
