• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] dummy refuse to cast carrionswarm

Status
Not open for further replies.
Maybe someone experience this very strange problem. Im sure there are people cause I remember here on Hive I read about that.

The example spell is Blink-Wave:
hero cast blink, I create dummy, dummy is ordered to carrion swarm target point. Simple.

But dummy in some circumstances is not casting carrionswarm (even when debug message returns 'true' on this):
JASS:
call IssuePointOrder(d, "carrionswarm", Tx, Ty)

I found out the problem is somehow connected with preloading spells section. Have no idea why?? I preload all spells on all picked heroes at 55sec of the game. Just by adding ability to dummy (udg_PreloadingUnit), then after 5sec I remove preloading dummy from the game.
JASS:
call UnitAddAbility( udg_PreloadingUnit, udg_Skill1[GetUnitPointValue(udg_Hero[a])] )
call UnitAddAbility( udg_PreloadingUnit, udg_Skill2[GetUnitPointValue(udg_Hero[a])] )
call UnitAddAbility( udg_PreloadingUnit, udg_Skill3[GetUnitPointValue(udg_Hero[a])] )
call UnitAddAbility( udg_PreloadingUnit, udg_Skill4[GetUnitPointValue(udg_Hero[a])] )
(Of course all integers udg_Skill1[x] etc are ok)

And now strange part: if preloading part (above) in this 55sec trigger is disbled (commented) then dummy cast carrionswarm and all works.

Even more strange: if I cast spell Blink-Wave when picked hero before preloading is executed then spell works all game..
If I didnt cast Blink-Wave, and preloading is done, after that, spell is bugged cause dummy refuse cast carrionswarm...


Why it is happend? You got any ideas?
 
Last edited by a moderator:
Level 12
Joined
Mar 13, 2012
Messages
1,121
That is quite strange.
First make a copy of your map and try to delete as many triggers that are not related to the issue as possible while testing repeatedly. If this still does not provide results, upload this stripped map and I will have a look at it.
 
Im preloading heroes abilities only (4 per hero) Here is whole trigger with preloading section:

JASS:
function Trig_GameTime60sec_Func015001002 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'n008' )  //circle
endfunction

function Trig_Prepare50sec_Func007A takes nothing returns nothing
    call RemoveUnit( GetEnumUnit() )
endfunction
//===========================================================================
//===========================================================================
function Trig_Prepare50sec_Actions takes nothing returns nothing
local integer a=1
    call StopMusicBJ( true )
    call PlaySoundBJ( gg_snd_TheHornOfCenarius )
    set bj_wantDestroyGroup = true     // remove units from TempRegion
    call ForGroupBJ( GetUnitsInRectAll(gg_rct_TempRegion), function Trig_Prepare50sec_Func007A )
    
    //--------------------------------
    call TriggerSleepAction(5.00)
    //--------------------------------55sec
    
    call DisableTrigger( gg_trg_PlayerRandom )
    call TriggerExecute( gg_trg_AllRandomActions )
    // --------preload spells:-----------
    
    loop
        exitwhen a > 10
        if udg_Hero[a] != null then
            call UnitAddAbility( udg_PreloadingUnit, udg_Skill1[GetUnitPointValue(udg_Hero[a])] )
            call UnitAddAbility( udg_PreloadingUnit, udg_Skill2[GetUnitPointValue(udg_Hero[a])] )
            call UnitAddAbility( udg_PreloadingUnit, udg_Skill3[GetUnitPointValue(udg_Hero[a])] )
            call UnitAddAbility( udg_PreloadingUnit, udg_Skill4[GetUnitPointValue(udg_Hero[a])] )      
            call DisplayTextToForce(GetPlayersAll(), "preloaded spells  from hero nr: " + I2S(a))
            call DisplayTextToForce(GetPlayersAll(), "ability1: " + GetAbilityName(udg_Skill1[GetUnitPointValue(udg_Hero[a])]))
            call DisplayTextToForce(GetPlayersAll(), "ability2: " + GetAbilityName(udg_Skill2[GetUnitPointValue(udg_Hero[a])]))
            call DisplayTextToForce(GetPlayersAll(), "ability3: " + GetAbilityName(udg_Skill3[GetUnitPointValue(udg_Hero[a])]))
            call DisplayTextToForce(GetPlayersAll(), "ability4: " + GetAbilityName(udg_Skill4[GetUnitPointValue(udg_Hero[a])]))
            
        endif
        set a = a + 1
    endloop
    
    // ------end preloading  ----------------
    
    //--------------------------------
    call TriggerSleepAction(5.00)
    //--------------------------------60sec
    
    call PlaySoundBJ( gg_snd_PrepareForBattle64k )
    // ---------  turn off Repick triggers ---------
    call DisplayTextToForce( bj_FORCE_ALL_PLAYERS, "-repick is now |cffff0000disabled|r" )
    call DisableTrigger( gg_trg_HeroRepick )
    call RemoveUnit( udg_PreloadingUnit )  // --remove  preloading unit form the game
    // -----------  remove circles :
    set bj_wantDestroyGroup = true
    call ForGroupBJ( GetUnitsInRectMatching(gg_rct_TavernArea, Condition(function Trig_GameTime60sec_Func015001002)), function Trig_Prepare50sec_Func007A )

    //--------------------------------
    call TriggerSleepAction(10.00)
    //--------------------------------70sec
    
    call TriggerExecute( gg_trg_Settings1 ) //restore heroes setting, DuplicateHero needs that
    call DisplayTextToForce(GetPlayersAll(), "trigger Prepare50sec finished" )
endfunction
//===========================================================================
function InitTrig_Prepare50sec takes nothing returns nothing
    set gg_trg_Prepare50sec = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Prepare50sec, 50.00 )
    call TriggerAddAction( gg_trg_Prepare50sec, function Trig_Prepare50sec_Actions )
endfunction


again: if section from:
// --------preload spells:-----------
to:
// ------end preloading ----------------
is disabled (commented)
then spell works fine

I have other spell, where dummy is issued to cast carrionswarm , and this 2nd spell behaves the same way!

You know Bribe, I also noticed even your knockback2D is not working properly (the reason is not probably in your system). While playing test on line: after bug with cast carrionswarm is present, I found 2 passive units: infinite stuned Paladin and one Inferno (from your K2DPathAbil). Looks like part of map is falling apart after this carrioswrm-bug.. but about 80% of spells works.

Also pls read again green text in 1st post
 
Does "trigger Prepare50sec finished" show when you don't comment the preloading block out?
Also, do you have lots of array variables with initialized instances?

I suspect your global variable initialization to hit operation limit, so it does not properly initialize several critical variables.

Also, show your spell trigger.
 
Its not operation limit, Zwiebelchen. Message is show always.
Im still testing today this shit and suspect it is related with order strings.

Problematic hero: Stripe, hero skills:
1st skill: IonCannonBeam, based on channel [ANcl], order string: carrionswarm
2nd skill: FarSight, based on Orc Far Sight [AOfs], order string: farsight
3rd skill: BlinkWave, based on Blink [AEbl], order string: blink
4rd skill: LaserStrike, based on based on channel [ANcl], order string: healingward

Bugged skill is skill3 (BlinkWave). This spell uses dummy with ability BlinkWaveDummy, based on Neutral Hostile Crushing Wave [ACcv], order string: carrionswarm

During test I found that if I comment:
JASS:
call UnitAddAbility( udg_PreloadingUnit, udg_Skill1[GetUnitPointValue(udg_Hero[a])] )
so 1st hero skill: IonCannonBeam is NOT preloaded, then all works..
so, I think somehow hero 1st skill interfere with dummy's ability

completely dont understand why

spell trigger is simple:

JASS:
function BlinkWave takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local real Tx = GetLocationX(GetSpellTargetLoc())
local real Ty = GetLocationY(GetSpellTargetLoc())
local integer lvl = GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())
local real r = I2R(lvl)
local real dmg = ( 8.00 * r * r ) + 48.00
local unit d = CreateUnit(GetTriggerPlayer(), 'n010', x, y, 0.00)
    call UnitApplyTimedLife(d, 'BTLF', 3.00)

    // add ability Wave -----------
    call UnitAddAbility(d, 'A079')
    call SetUnitAbilityLevel(d, 'A079', lvl)
    call IssuePointOrder(d, "carrionswarm", Tx, Ty)
    //  
set d=null
endfunction


this is called when ability is cast (EVENT_PLAYER_UNIT_SPELL_EFFECT)
 
after many hours Im able to reproduce this bug, but I still completely dont understand why it happends and Im not sure how to avoid that. Please look at test map I made.
If you choose muntain king, problematic spell won't work from the begining regardless you preload spells or not. However when you choose Paladin it works like this:
1.use blinkWave on hero /works/
2.preload spells /type: preload/
3.use blinkWave on hero /works/

now restart map and:
1.preload spells /type: preload/
2.use blinkWave on hero /not working!/

someone pls help me to understand what is going on
 

Attachments

  • carriontest.w3x
    39.3 KB · Views: 50
Level 12
Joined
Mar 13, 2012
Messages
1,121
You have encountered a rarely seen bug in wc3.

Wc3 caches every order ID (in integer form) with a certain target type (e.g. instant, unit/point target). When an ability with a yet uncached order ID is first added to a unit the abilitys target type is cached. This cache counts for all units and all players.

Manually casting an ability does not use the cached target type but the IssueXXXOrder natives (and probably other things) do.
So such a native might try to cast blink (which is point target) as instant target, which will of course fail (though the native might return true).

Now you have to know that Carrion Swarm is actually target type "point or unit target". If the channel based ability with order id "carrionswarm" is cached only as "point target", casting a normal carrion swarm ability via triggers will no longer work.

For the testmap this means to just change the channel based ability with order id carrionswarm to target type "point or unit target" and you're good. For your real map also check whether other abilities use the same order ids with different target types.
 
Status
Not open for further replies.
Top