• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Triggers not executing

Status
Not open for further replies.
Level 4
Joined
Aug 5, 2016
Messages
39
Iv'e been creating an ability with triggers but it seems like my triggers doesn't execute can you guys help me find and fix this problem? :(

Here are the triggers:

  • Circle Of Death Config
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Circle Of Destruction
    • Actions
      • -------- Dont Change this unless there are bugs! --------
      • -------- Start of Config --------
      • -------- -------- --------
      • Set CFD_Ability = Circle Of Destruction
      • -------- -------- --------
      • Set CFD_Debuff = Collapsing Death
      • -------- -------- --------
      • Set CFD_Dummy = Circle Of Destruction Dummy
      • -------- -------- --------
      • Set Damage_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))))
      • -------- -------- --------
      • Set CFD_Lvl = (Level of Circle Of Destruction for (Triggering unit))
      • -------- -------- --------
      • -------- Stats Each Level --------
      • -------- -------- --------
      • Set CFD_Damage[1] = 100.00
      • Set CFD_Damage[2] = 150.00
      • Set CFD_Damage[3] = 200.00
      • -------- -------- --------
      • Set CFD_DamageOvertime[1] = 20.00
      • Set CFD_DamageOvertime[2] = 40.00
      • Set CFD_DamageOvertime[3] = 60.00
      • -------- -------- --------
      • Set CFD_Radius[1] = 200.00
      • Set CFD_Radius[2] = 250.00
      • Set CFD_Radius[3] = 300.00
      • -------- -------- --------
      • Set CFD_DebuffDuration[1] = 5.00
      • Set CFD_DebuffDuration[2] = 10.00
      • Set CFD_DebuffDuration[3] = 15.00
      • -------- -------- --------
      • -------- Special Effects & Animations --------
      • -------- -------- --------
      • Set CFD_Height = 50.00
      • -------- -------- --------
      • Set CFD_ALPHA = 200
      • Set CFD_GREEN = 250
      • Set CFD_RED = 178
      • Set CFD_Blue = 160
      • -------- -------- --------
      • Set CFD_FX = Abilities\Spells\Undead\RegenerationAura\ObsidianRegenAura.mdl
      • Set CFD_DebuffFx = Abilities\Weapons\WitchDoctorMissile\WitchDoctorMissile.mdl
      • Set CFD_DebuffAttachment = overhead
      • -------- -------- --------
      • -------- End of Config --------
      • Trigger - Run Circle Of Death Execution <gen> (ignoring conditions)
  • Circle Of Death Execution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Circle Of Destruction
    • Actions
      • -------- ------ --------
      • -------- Animation For the Dummy Unit --------
      • -------- ------ --------
      • -------- ------ --------
      • -------- Spell Var --------
      • -------- ------ --------
      • Set CFD_Caster = (Casting unit)
      • Set CFD_Point = (Target point of ability being cast)
      • Set CFD_Target = (Picked unit)
      • -------- ------ --------
      • -------- Filtering The Damage Group --------
      • -------- ------ --------
      • Unit Group - Pick every unit in Damage_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Circle Of Destruction for CFD_Caster) Greater than or equal to 1
              • (CFD_Target belongs to an enemy of Player 1 (Red)) Equal to True
            • Then - Actions
              • -------- ------ --------
              • Unit - Create 1 for Neutral Passive at CFD_Point facing Default building facing degrees
              • -------- ------ --------
              • Unit - Cause CFD_Dummy to damage circular area after 0.00 seconds of radius CFD_Radius[CFD_Lvl] at CFD_Point, dealing CFD_Damage[CFD_Lvl] damage of attack type Spells and damage type Normal
              • Unit - Add a 10.00 second Generic expiration timer to CFD_Dummy
              • -------- ------ --------
              • -------- Animation For the Dummy Unit --------
              • -------- ------ --------
              • Animation - Play CFD_Dummy's CFD_FX animation
              • Animation - Change CFD_Dummy's vertex coloring to (100.00%, 60.00%, 20.00%) with 100.00% transparency
              • Animation - Change CFD_Dummy flying height to CFD_Height at 0.00
              • -------- ------ --------
              • -------- Special Effects --------
              • -------- ------ --------
              • Special Effect - Create a special effect at CFD_Point using CFD_FX
              • -------- ------ --------
              • -------- Destroy the last effect created to prevent leaks --------
              • -------- ------ --------
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • -------- ------ --------
      • -------- Destroying the Unit Group --------
      • -------- Removing Leaks --------
      • -------- ------ --------
      • Custom script: call RemoveLocation(udg_CFD_Point)
      • Custom script: call DestroyGroup(udg_Damage_Group)
      • Trigger - Run Collapsing Death Debuff <gen> (ignoring conditions)
  • Collapsing Death Debuff
    • Events
    • Conditions
    • Actions
      • -------- ------ --------
      • -------- Debuff Var --------
      • -------- ------ --------
      • Set Damage_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))))
      • Set CFD_Target = (Picked unit)
      • -------- ------ --------
      • -------- ------ --------
      • -------- ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CFD_Target has buff Collapsing Death ) Equal to True
          • (CFD_Target is Summoned) Equal to False
          • (CFD_Target is Mechanical) Equal to False
          • (CFD_Target is Magic Immune) Equal to False
          • (CFD_Target is Summoned) Equal to False
        • Then - Actions
          • -------- ------ --------
          • -------- Filtering the units that will get the debuff --------
          • -------- ------ --------
          • Unit Group - Pick every unit in Damage_Group and do (Actions)
            • Loop - Actions
              • Unit - Grant shared vision of CFD_Target to Player 1 (Red)
              • -------- ------ --------
              • -------- Damage and Damage Overtime --------
              • -------- ------ --------
              • Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in CFD_DebuffDuration[CFD_Lvl] seconds
              • Unit - Cause CFD_Caster to damage CFD_Target, dealing CFD_DamageOvertime[CFD_Lvl] damage of attack type Spells and damage type Normal
              • -------- ------ --------
              • -------- Making the Special Effects --------
              • -------- ------ --------
              • Special Effect - Create a special effect attached to the CFD_DebuffAttachment of CFD_Target using CFD_DebuffFx
              • -------- ------ --------
              • -------- Destroy the special effect --------
              • -------- ------ --------
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_Damage_Group)
 

Attachments

  • Circle Of Destruction (Buggy).w3x
    40.1 KB · Views: 23
Level 39
Joined
Feb 27, 2007
Messages
5,024
Your flow here is a little wonky. It doesn't make sense to run your config setup each time the spell is cast; since the way you have it set up now manually executes the cast trigger at the end of the config trigger, the cast trigger having its own events actually means it executes twice on spell cast. Instead you should run the config trigger once on map init and then the data is set for all subsequent casts; you cast trigger will keep its event and only fire one time. You will then have to move the Damage_Group and CFD_Lvl setting parts inside the actual cast trigger and remove the trigger execution at the end (and also get the level by referring to the CFD_Ability variable). You should have something like this:

  • Circle Of Death Config
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • -------- Dont Change this unless there are bugs! --------
      • -------- Start of Config --------
      • -------- -------- --------
      • Set CFD_Ability = Circle Of Destruction
      • -------- -------- --------
      • Set CFD_Debuff = Collapsing Death
      • -------- -------- --------
      • Set CFD_Dummy = Circle Of Destruction Dummy
      • -------- -------- --------
      • -------- Stats Each Level --------
      • -------- -------- --------
      • Set CFD_Damage[1] = 100.00
      • Set CFD_Damage[2] = 150.00
      • Set CFD_Damage[3] = 200.00
      • -------- -------- --------
      • Set CFD_DamageOvertime[1] = 20.00
      • Set CFD_DamageOvertime[2] = 40.00
      • Set CFD_DamageOvertime[3] = 60.00
      • -------- -------- --------
      • Set CFD_Radius[1] = 200.00
      • Set CFD_Radius[2] = 250.00
      • Set CFD_Radius[3] = 300.00
      • -------- -------- --------
      • Set CFD_DebuffDuration[1] = 5.00
      • Set CFD_DebuffDuration[2] = 10.00
      • Set CFD_DebuffDuration[3] = 15.00
      • -------- -------- --------
      • -------- Special Effects & Animations --------
      • -------- -------- --------
      • Set CFD_Height = 50.00
      • -------- -------- --------
      • Set CFD_ALPHA = 200
      • Set CFD_GREEN = 250
      • Set CFD_RED = 178
      • Set CFD_Blue = 160
      • -------- -------- --------
      • Set CFD_FX = Abilities\Spells\Undead\RegenerationAura\ObsidianRegenAura.mdl
      • Set CFD_DebuffFx = Abilities\Weapons\WitchDoctorMissile\WitchDoctorMissile.mdl
      • Set CFD_DebuffAttachment = overhead
      • -------- -------- --------
      • -------- End of Config --------
Now onto the actual spell actions.
  • I'm not sure why you're doing the Damage_Group setup in the way that you are (picking a random player enemy of Player 1 and fucking with their units, but then not picking the same units later for the debuff...?) but I'll ignore that for now and assume you have a good reason for it being that way.
  • Player 1 (Red) seems hardcoded in in a few places where you probably want to use Owner of (CFD_Caster) but I left it as is because I don't fully understand what the ability is supposed to do.
  • Use Triggering Unit wherever possible, it's always wait-safe and some of the more specific event responses like Casting Unit are just wrappers anyway.
  • "Picked unit" doesn't mean anything except when it's inside of a Pick every unit in X and do (actions)... loop, so here it is meaningless. I'm not sure what it's supposed to be (since the spell seems to be point targeted fropm the CFD_Point setting line) but I'm gonna guess you wanted Target Unit of Ability Being Cast. However, a spell cannot ever have a "target point" and a "target unit" simultaneously so one of those two is always going to be null. More detail here would make it easier to suggest what you should do.
  • You didn't really use your CFD_Ability variable where it was applicable so I've added that in.
  • Both of your conditions in the If block are pointless. The caster just cast the ability so of course it's at least level 1, and the way you set up Damage_Group all of the units in it are already enemies of Player 1. Not sure what you're trying to filter out here.
  • Maybe your trigger got messed up when you posted it here because I'm confused about the CFD_Dummy variable. It appears to be a unit-type variable in the config trigger but in the cast trigger its being used as a direct unit variable! Your Unit - Create... line is missing a unit-type! Assuming it's a unit-type and it just wasn't assigned properly.
  • There's a dummy created for every unit, and every dummy created damages the AoE; this makes the damage dealt dependent on how many units there are in the area and is probably not what you intended. Also damaging the area will deal damage to all units, allied and enemy. Instead you want to use the "unit damage target" action. You also probably want to create the dummy for the owner of the caster (or player 1?) instead of neutral passive, else kill gold/credit will go to NP, not the caster (or make the caster damage the targets, as I chose to do). Furthermore since all the dummies are created at the same point (and are going to be overlapping), you can actually just create 1 dummy unit and then use it to damage all of the appropriate targets. Move the dummy creation outside the loop
  • You didn't use your config RGBA values when setting up the dummy unit. I'm guessing those values are out of 256 not 100...?
  • The way I've modified this doesn't use the CFD radius so I'm not sure what you're going for with this. My best guess is to filter out and only damage units that are within the Radius of the cast point, but again I'm not sure. You didn't have a check for this distance anywhere else.

  • Circle Of Death Execution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Circle Of Destruction
    • Actions
      • -------- ------ --------
      • -------- Animation For the Dummy Unit --------
      • -------- ------ --------
      • -------- ------ --------
      • -------- Spell Var --------
      • -------- ------ --------
      • Set CFD_Caster = (Triggering unit)
      • Set CFD_Point = (Target point of ability being cast)
      • Set CFD_Target = (Target unit of ability being cast)
      • Set Damage_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))))
      • Set CFD_Lvl = (Level of CFD_Ability CFD_Caster)
      • -------- ------ --------
      • Unit - Create 1 CFD_Dummy for (Owner of CFD_Caster) at CFD_Point facing Default building facing degrees
      • Set CFD_DummyUnitVar = (Last created unit) //I introduced a new variable here
      • -------- ------ --------
      • Unit - Add a 10.00 second Generic expiration timer to CFD_DummyUnitVar
      • -------- ------ --------
      • -------- Animation For the Dummy Unit --------
      • -------- ------ --------
      • Animation - Play CFD_DummyUnitVar's CFD_FX animation
      • Animation - Change CFD_DummyUnitVar's vertex coloring to (Real(CFD_Red)/256.00, Real(CFD_Green)/256.00, Real(CFD_Blue)/256.00) with Real(256 - CFD_Alpha)/256.00 transparency
      • Animation - Change CFD_DummyUnitVar flying height to CFD_Height at 0.00
      • -------- ------ --------
      • -------- Special Effects --------
      • -------- ------ --------
      • Special Effect - Create a special effect at CFD_Point using CFD_FX
      • -------- ------ --------
      • -------- Destroy the last effect created to prevent leaks --------
      • -------- ------ --------
      • Special Effect - Destroy (Last created special effect)
      • -------- ------ --------
      • -------- Filtering The Damage Group --------
      • -------- ------ --------
      • Unit Group - Pick every unit in Damage_Group and do (Actions)
        • Loop - Actions
          • ~~ RADIUS NOT USED HERE, I THINK YOU WANTED TO FILTER BY RADIUS ~~
          • Unit - Cause CFD_Caster to damage (Picked unit) dealing CFD_Damage[CFD_Lvl] damage of attack type Spells and damage type Normal
      • -------- ------ --------
      • -------- Destroying the Unit Group --------
      • -------- Removing Leaks --------
      • -------- ------ --------
      • Custom script: call RemoveLocation(udg_CFD_Point)
      • Custom script: call DestroyGroup(udg_Damage_Group)
      • Trigger - Run Collapsing Death Debuff <gen> (ignoring conditions)
And finally onto the Collapsing Death debuff. Where this debuff comes from is unclear to me but will just ignore that for now. Notes:
  • Again picked unit doesn't mean anything here. Everything I said above applies here. However since CFD_Target was just set in the trigger that executed this one there no reason to re-set it; you can just remove it.
  • You could have left Damage_Group instead of destroying it in the cast trigger, since none of the units from it got removed and you seemed to 'create' it again in the same way.
  • You duplicated your "is summoned" check in the if block conditions; delete one of them.
  • You permanently grant shared vision of the targeted units in Damage_Group, which is every single unit that randomly chosen player owns. Is that what you intended?
  • There's no expiring timer here and the trigger doesn't run off of a timer event. That line does nothing.
  • Move the group destroy outside of the whole if block, since the group is created before the if-block.

  • Collapsing Death Debuff
    • Events
    • Conditions
    • Actions
      • -------- ------ --------
      • -------- Debuff Var --------
      • -------- ------ --------
      • Set Damage_Group = (Units owned by (Random player from (All enemies of Player 1 (Red))))
      • -------- ------ --------
      • -------- ------ --------
      • -------- ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CFD_Target has buff Collapsing Death ) Equal to True
          • (CFD_Target is Summoned) Equal to False
          • (CFD_Target is Mechanical) Equal to False
          • (CFD_Target is Magic Immune) Equal to False
        • Then - Actions
          • -------- ------ --------
          • -------- Filtering the units that will get the debuff --------
          • -------- ------ --------
          • Unit Group - Pick every unit in Damage_Group and do (Actions)
            • Loop - Actions
              • Unit - Grant shared vision of CFD_Target to Player 1 (Red)
              • -------- ------ --------
              • -------- Damage and Damage Overtime --------
              • -------- ------ --------
              • NOT DOING ANYTHING: Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in CFD_DebuffDuration[CFD_Lvl] seconds
              • Unit - Cause CFD_Caster to damage CFD_Target, dealing CFD_DamageOvertime[CFD_Lvl] damage of attack type Spells and damage type Normal
              • -------- ------ --------
              • -------- Making the Special Effects --------
              • -------- ------ --------
              • Special Effect - Create a special effect attached to the CFD_DebuffAttachment of CFD_Target using CFD_DebuffFx
              • -------- ------ --------
              • -------- Destroy the special effect --------
              • -------- ------ --------
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Damage_Group)
This does not fully fix your trigger but it's a start. If you can give an actual description of what you want it to do it'll be much easier to help you finish fixing this.
 
Status
Not open for further replies.
Top