• 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.

Too many custom abilitys sharing the same Order trigger.

Status
Not open for further replies.
Level 2
Joined
Aug 15, 2005
Messages
7
I looked through and searched and couldn't find a thread with this question.

I am trying to create a spell system where Neutral characters are given abilities based on actions within the map.

(For instance, the player comes upon a water temple and destroys the Naga God. There are now two priest characters who can cast "Vengence of Athera" and ressurect that god when they need to do damage to their enemies.)

I have run into the problem where I cannot order those neutral units to use that ability when under certain conditions.

There are many other spells I needed custom made as well, and most are based off of the "inner fire" spell. I have it set that when a hero is attacked, they use the "inner fire", as that is their imbued stong spell at the enemy. Sadly, after adding more and more custom spells, my trigger no longer works. I'm curious as to whether there is some sort of limitation on the number of custom spells one can make from a single ability? I have made extra sure that every hero only gains one "Inner Fire" ability and I know that multiple custom units off of the same base works, so I'm not sure what my problem is.

Is there anyone who has run into this problem? Would you like to see trigger code? Just ask, and I will do my best to provide you with what you need.

Thanks in advance.
 
Level 2
Joined
Aug 15, 2005
Messages
7
It's a lot of code, what part do you want to see?

I mean, I'm pretty sure I'm on the right track with the code, it's the theory that I'm asking about.

Well, let's give this a shot I suppose.

Code:
call IssueTargetOrderBJ( udg_BattleOrder[GetForLoopIndexA()], "innerfire", gg_unit_nshe_0097 )

That is my priest using his "buff" spell on a nearby warrior...

This is the Spell code:

Code:
function Trig_YaneshsKiss_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
        return false
    endif
    return true
endfunction

function Trig_YaneshsKiss_Copy_Func001A takes nothing returns nothing
    call AddSpecialEffectTargetUnitBJ( "overhead", GetEnumUnit(), "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageMissile.mdl" )
    call UnitResetCooldown( GetEnumUnit() )
    call SetUnitLifePercentBJ( GetEnumUnit(), 100 )
    call SetUnitManaPercentBJ( GetEnumUnit(), 100 )
    call PolledWait( 0.50 )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

function Trig_YaneshsKiss_Copy_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRectAll(gg_rct_Army), function Trig_YaneshsKiss_Copy_Func001A )
endfunction

//===========================================================================
function InitTrig_YaneshsKiss_Copy takes nothing returns nothing
    set gg_trg_YaneshsKiss_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_YaneshsKiss_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_YaneshsKiss_Copy, Condition( function Trig_YaneshsKiss_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_YaneshsKiss_Copy, function Trig_YaneshsKiss_Copy_Actions )
endfunction

Simple spell. Resets cooldown and completely refreshes units in the vicinity.

Finally, Here is the main problem.
If this displays, (else you might have to click on it...) This is an ingame pic, where just after I killed a god, I polled the priests to use their new abilities, and I set to capture them. This is the result of that capture.

wc3scrnshot081505131340010tx.jpg


The code for the Poll:

Code:
function Trig_GiftToPriests_Func002A takes nothing returns nothing
    call IssueTargetOrderBJ( GetEnumUnit(), "innerfire", gg_unit_nshe_0097 )
    call DisplayTextToForce( GetPlayersAll(), ( ( "Priest " + GetHeroProperName(GetEnumUnit()) ) + ( " - " + GetAbilityName(udg_Ability) ) ) )
endfunction

function Trig_GiftToPriests_Actions takes nothing returns nothing
    set udg_AbilityInt = 1
    call ForGroupBJ( udg_BattleGroup, function Trig_GiftToPriests_Func002A )
endfunction

//===========================================================================
function InitTrig_GiftToPriests takes nothing returns nothing
    set gg_trg_GiftToPriests = CreateTrigger(  )
    call TriggerAddAction( gg_trg_GiftToPriests, function Trig_GiftToPriests_Actions )
endfunction

This is currently just a testing code, it is used mainly by me to analyze and solve this problem...

And the Capture:

Code:
function Trig_StoreSpell_Conditions takes nothing returns boolean
    if ( not ( udg_AbilityInt == 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_StoreSpell_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), GetAbilityName(GetSpellAbilityId()) )
    set udg_Ability = GetSpellAbilityId()
endfunction

//===========================================================================
function InitTrig_StoreSpell takes nothing returns nothing
    set gg_trg_StoreSpell = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_StoreSpell, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_StoreSpell, Condition( function Trig_StoreSpell_Conditions ) )
    call TriggerAddAction( gg_trg_StoreSpell, function Trig_StoreSpell_Actions )
endfunction

Once again, a purely utility function.
This trigger makes sure we want to capture, by asking about AbilityInt which is my global for testing is true, then gets the ability being used, and stores it in another global.

This I believe is the only way to determine a trigger given spell on a unit. Correct me if I'm wrong.

And it spits out the SS up above.

Thanks for any help, and if you need more code, please specify what you would like to see.
 
Level 13
Joined
Dec 29, 2004
Messages
597
Code:
Code:
function Trig_GiftToPriests_Func002A takes nothing returns nothing
    call IssueTargetOrderBJ( GetEnumUnit(), "innerfire", gg_unit_nshe_0097 )
    call DisplayTextToForce( GetPlayersAll(), ( ( "Priest " + GetHeroProperName(GetEnumUnit()) ) + ( " - " + GetAbilityName(udg_Ability) ) ) )
endfunction

function Trig_GiftToPriests_Actions takes nothing returns nothing
    set udg_AbilityInt = 1
    call ForGroupBJ( udg_BattleGroup, function Trig_GiftToPriests_Func002A )
endfunction

//===========================================================================
function InitTrig_GiftToPriests takes nothing returns nothing
    set gg_trg_GiftToPriests = CreateTrigger(  )
    call TriggerAddAction( gg_trg_GiftToPriests, function Trig_GiftToPriests_Actions )
endfunction

This is code to order those priest right? But, why there are no events to trigger it? And, if you want cast inner fire to the god after it get killed, of course that's impossible, since the god already killed, so there are no target right now.

And what this code suppose to mean?
Code:
call IssueTargetOrderBJ( udg_BattleOrder[GetForLoopIndexA()], "innerfire", gg_unit_nshe_0097 )

I don't see any trigger set udg_BattleOrder array, please post a whole trigger for this call function.
 
Level 2
Joined
Aug 15, 2005
Messages
7
Thanks for the effort, but I have long since solved this problem by reworking my spell system.

There is a problem there and it's hard to solve. If I find myself caring enough, I might try and solve it in a bit... but for now... I'll just tell anyone that if they find themselves with this problem to rework your spell system using modified blizzard spells and a large if/than/else array of custom function calls with your spells in them.

Neither way is really the best to solve this issue, but there at least is a way to get around it.
 
Status
Not open for further replies.
Top