Spell Triggers not working

bumbaclo

New Member
Reaction score
3
So I made a tentative spell for an auto-cast target spell (based off cold arrows) that temporarily (10 sec) removes a target hero's agility by 5 each attack, stackable up to 15 times. The resulting triggers are kind of a hybrid of what I was able to gather from searching on forums:

To detect autocast turned on/off:
Trigger:
  • Autocast On
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(coldarrows))
    • Actions
      • Unit Group - Add (Triggering unit) to WeaknessStore


Trigger:
  • Autocast Off
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(uncoldarrows))
    • Actions
      • Unit Group - Remove (Triggering unit) from WeaknessStore


Now, the trigger, using the GDD damage detection system:
Trigger:
  • Weakness Test
    • Events
      • Game - GDD_Damage becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is in WeaknessStore) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of GDD_DamagedUnit) Less than 15
        • Then - Actions
          • Unit - Set the custom value of GDD_DamagedUnit to ((Custom value of GDD_DamagedUnit) + 1)
          • Hero - Modify Agility of GDD_DamagedUnit: Subtract 5
          • Wait 10.00 seconds
          • Hero - Modify Agility of GDD_DamagedUnit: Add 5
          • Unit - Set the custom value of GDD_DamagedUnit to ((Custom value of GDD_DamagedUnit) - 1)
        • Else - Actions

For those who don't know how the GDD system works, whenever the variable GDD_Damage becomes 0, means damage is being detected. Also GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit, while GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.

Ive tried testing different parts of the triggers to find the problem. It seems that for some reason the units are not being added to the unit group...yet the auto-cast detection triggers are firing. For the main trigger, if I remove the condition the unit still doesn't lose any agility. I have a feeling there is more than 1 mess up in my triggers, but I can't seem to understand where. Any help please?
 

GooS

Azrael
Reaction score
154
First of, why use GDD instead of unit is attacked event?

Anyway, did you also test the Custom value condition, making sure that their custom value isn't either higher than 15 at start or something like null so it cannot make that comparison?

//==GooS
 

bumbaclo

New Member
Reaction score
3
yea i would have, except i have (or at least i think) experimentally determined that world editor doesnt consider attacking while in auto-cast either regular attacking or casting a spell, which is why i had to resort to doing this. I haven't touched the custom value of units before this and im assuming the default is 0. If it isn't is there a way to set to 0?
 

Laiev

Hey Listen!!
Reaction score
188
test if the first trigger work and if some unit is in group, this condition is much strang
 

Dave312

Censored for your safe viewing
Reaction score
269
I used these triggers and the ability worked fine.

AutoCast On/Off
Trigger:
  • Turn On AutoCast
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(coldarrows))
    • Actions
      • Game - Display to (All players) the text: Unit Turned On AutoCast
      • Unit Group - Add (Ordered unit) to WeaknessStore

Trigger:
  • Turn Off AutoCast
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(uncoldarrows))
    • Actions
      • Game - Display to (All players) the text: Unit Turned Off AutoCast
      • Unit Group - Remove (Ordered unit) from WeaknessStore


On Map Initialization I set all starting heroes on the map to have a custom value of zero.
Trigger:
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in (Entire map) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in TempUnitGroup and do (Unit - Set the custom value of (Picked unit) to 0)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)


Any heroes revived or trained would also have their custom value set to zero (You could do this as separate triggers but this should work fine).
Trigger:
  • Hero Revived Spawned
    • Events
      • Unit - A unit Finishes reviving
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Reviving Hero) is A Hero) Equal to True
          • ((Trained unit) is A Hero) Equal to True
    • Actions
      • Unit - Set the custom value of (Reviving Hero) to 0
      • Unit - Set the custom value of (Trained unit) to 0


And finally the trigger that reduces the agility of the hero. Note that I also included to check to ensure the hero had enough agility for it to be reduced.
Trigger:
  • Cast Weakness
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is A Hero) Equal to True
      • ((Attacking unit) is in WeaknessStore) Equal to True
      • (Custom value of (Attacked unit)) Less than 15
      • (Agility of (Attacked unit) (Exclude bonuses)) Greater than 5
    • Actions
      • Game - Display to (All players) the text: Hero Weakened
      • Unit - Set the custom value of (Attacked unit) to ((Custom value of (Attacked unit)) + 1)
      • Hero - Modify Agility of (Attacked unit): Subtract 5
      • Wait 10.00 game-time seconds
      • Unit - Set the custom value of (Attacked unit) to ((Custom value of (Attacked unit)) - 1)
      • Hero - Modify Agility of (Attacked unit): Add 5


The Game-Text Message Actions are only there for debugging so I could tell if the triggers were actually running and are not required.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
For those who don't know how the GDD system works, whenever the variable GDD_Damage becomes 0, means damage is being detected.
GDD_Event, not GDD_Damage. :eek: I've made that mistake myself.

Also GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit, while GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
True, but in this particular case you might want to do something different. GDD's event response variables don't work with waits, like you're using. However, you can still use Triggering Unit for the damaged unit, and it will work after a wait.

(I didn't document it because waits are imprecise and generally should be avoided, but in this case, it's reasonable. Also, you might want to consider using a unit auto-indexer such as AIDS and an integer array, instead of custom value.)

Ive tried testing different parts of the triggers to find the problem. It seems that for some reason the units are not being added to the unit group...yet the auto-cast detection triggers are firing.
That'd be because the Weakness Test trigger isn't running (due to aforementioned Damage/Event mixup.) Also, testing for the presence of a buff is preferable to testing whether the unit has autocast enabled, because, for example, the trigger will inappropriately run for spell damage dealt by the unit, and won't run if the player switches off autocasting before the unit's projectile hits.


Trigger:
  • Unit - A unit Is attacked
A Unit Is Attacked is not a good event to use for abilities, because it can be abused by rapidly ordering a unit to stop and therefore firing many attack events - because that event is for when a unit starts to try to attack, not when the attack hits - thus the popularity of damage detection.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top