Wierd behavior with simple trigger

Level 5
Joined
Jun 24, 2024
Messages
59
Good day fellow Warcraft enjoyers,

i'm currently creating a Rougle-Like / Perma-Progression TD with Randomized Hero Towers and Fusion mechanics.

I created a Randomizer Tower with an Reroll ability, which always gives for possible spells to choose from.
These spells should then summon the selected hero if triggered.

I tried two simple approaches to test:
  • BuyOrcL1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Orc Tower 1
    • Actions
      • Unit - Replace (Triggering unit) with a Legendary Drek'Thar using The new unit's default life and mana
or
  • BuyOrcL2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Orc Tower 2
      • (Unit-type of (Triggering unit)) Equal to Random Tower
    • Actions
      • Unit - Create 1 Legendary Drek'Thar for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Remove (Triggering unit) from the game
The Tower gets constructed by the Builder and then rolls the first 4 spells.
Here i used Orc Tower 1 and 2 for testing purposes, when the Random Tower rolls either of these spells, it does not always work when i click it (1in20* it summons the unit).
The Spell Base of the Orc1 and Orc2 spells is the "Charge player Gold and Lumber" Spell, so i don't have to use triggers that check and remove currencies.

Any idea why this happens?

Edit - Note: The Random tower starts with 4 placeholder abilities, those will be set in 4 variables. Those 4 variables then get replaced by the reroll triggers 4 chosen spells, so they registered instead. This is so they can then be replaced again with 4 new ones, when they get rerolled again. I don't know if this impacts anything, just wanting to add it.

SMOrc
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You're using the Charge Gold and Lumber ability, but have you given the two abilities their own Base Order Id? They will conflict with one another if they use the same order. I think once you address that issue the triggers should both work.

Also, maybe this condition interferes:
  • (Unit-type of (Triggering unit)) Equal to Random Tower
 
Level 5
Joined
Jun 24, 2024
Messages
59
There is only so many Base Order IDs to go with, i would have a lot of spells for tower transformation and i also want to add custom spells later.
Does the Base Order ID really matter? Setting both to "none" yields the same result of "sometimes it works, other times not". I added casting time, cooldown and the "Flare" effect, thinking maybe the ability cast itself is to short to get picked up as "starts the effect". Didn't change much.
 
Level 5
Joined
Jun 24, 2024
Messages
59
Okay i added the Base Order ID: Absorb to both towers instead of "neutralspell" which is standard. Now every tested summon so far works for both variants.
I think thats the solution, but i have to test it again when all tower summon spells are set and every single one (75 total so far) is set to ID Avbsorb. Will let you know :)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Okay i added the Base Order ID: Absorb to both towers instead of "neutralspell" which is standard. Now every tested summon so far works for both variants.
I think thats the solution, but i have to test it again when all tower summon spells are set and every single one (75 total so far) is set to ID Avbsorb. Will let you know :)
Give each of those abilities a unique Base Order Id following this simple rule: Ensure that the Order Id isn't being used by another Ability that the unit has.

If you give a unit 2 or more copies of the same type of Ability - EVEN if they're named differently and have different rawcodes, you will experience issues. The result is usually that the Unit fails to cast the correct ability but I imagine it can cause all sorts of weird issues. Warcraft 3 is just not designed to handle this due to the nature of the Order system.

Luckily, Charge Gold and Lumber is one of the rare abilities that allows you to assign your own Order Id and get around this issue. Channel is another ability that can do this, along with Spellbook. That's why Channel is so useful for creating custom spells, it doesn't suffer from any order conflicts when used correctly.
 
Last edited:
Level 5
Joined
Jun 24, 2024
Messages
59
Does the ID influence anything else then the order? Does it influence other Abilities or Tower?
If no, than i can just give all my summon "Charge Gold and Lumber " the ids going down the table, only my sell and 4 reroll abilities need to be considered of, right?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Does the ID influence anything else then the order? Does it influence other Abilities or Tower?
If no, than i can just give all my summon "Charge Gold and Lumber " the ids going down the table, only my sell and 4 reroll abilities need to be considered of, right?
If a unit has 2 or more abilities with the same Order ID you will run into issues. Make everything unique.
 
Top