• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Wierd behavior with simple trigger

Status
Not open for further replies.
Level 6
Joined
Jun 24, 2024
Messages
67
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:
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
 
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.
 
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 :)
 
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:
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?
 
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.
 
Status
Not open for further replies.
Back
Top