Trigger breaking? If so, how and why?

Squishinator

New Member
Reaction score
3
Trigger Not Working--- is it leaking?

What is causing this not to work???? It removes the ability, but doesnt give the new one... I am using spellbooks

Trigger:
  • Use Beast1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Subtract 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Subtract 1
      • Unit - Remove (Ability being cast) from Unit_fireBEAST1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Casting unit)
        • Else - Actions
 

Squishinator

New Member
Reaction score
3
It is by default zero... isnt it? or do i need to set it as zero at map initiation???


EDIT: It doesnt work even if i do that....
 

XeNiM666

I lurk for pizza
Reaction score
138
just a guess, change the (Casting unit) to (Triggering Unit) and remove the (DO nothing) function because its useless :)

EDIT:
Try this: Caster is a unit variable
Code:
Unit starts the effect of an ability

Ability being cast == Spark (BEAST)

Set Caster = (Triggering Unit)

then in your trigger, change the (Casting Unit) to Caster
 

Squishinator

New Member
Reaction score
3
"system" not working

I am trying to make some kinda system where if you kill a certain unit you will get an ability in spellbook1 and a different ability in spellbook2. If a unit casts the new ability in spellbook2, they will get another ability in spellbook3 for x second. During those seconds, i want to remove the ability put into spellbook1, and then, after x seconds are over, the unit will gain the ability back. I have about half of what i am trying to accomplish for one player.

Here are my triggers:


Trigger:
  • Give Beast1
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 1) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST1 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Spark (SPELLBOOK) to (Killing unit)
      • Set Boolean_FIREBEAST1READY = True
      • Hero - Modify Strength of (Killing unit): Add 5
      • Hero - Modify Intelligence of (Killing unit): Add 1
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • Unit - Add Growth(SPELLBOOK) to (Killing unit)
          • Set Ability_FIREBEAST1_red = Growth(SPELLBOOK)
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST1_red = Tide (SPELLBOOK)
            • Else - Actions




Trigger:
  • Use Beast1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST1: Subtract 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Subtract 1
      • Wait 25.00 seconds
      • Hero - Modify Strength of Unit_fireBEAST1: Add 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 1
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_BEAST_FIREred = (Integer_FIRE_SUMMONred - 1)





Trigger:
  • FIRE1 SUMMON RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Greater than or equal to 1
        • Then - Actions
          • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
          • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
          • Unit - Add Mars (SPELLBOOK) to (Casting unit)
          • Wait 25.00 seconds
          • Unit - Remove Mars (SPELLBOOK) from (Casting unit)
          • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
          • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
        • Else - Actions






Trigger:
  • FIRE1 REMOVE RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST1_red from (Casting unit)
        • Else - Actions


Right now it is not running this last trigger... Why not?


I do not know how to give the ability back and have it work with all of this, so if you have any ideas please tell me.

Also, if you know what i am trying to do, could you explain to me how to do this with multiple triggers like the first? Thats why I added integer variables, because i knew that would be a simple way to do that... Does anyone know what i am trying to say???
 
Reaction score
91
Waits screw up your trigger because if you cast the spell during a wait, the variable will be redeclared. Besides, use Triggering unit instead of Casting unit since Casting unit is lost after long waits.
 

Squishinator

New Member
Reaction score
3
does that mean the only other way is making extra triggers and running them, because that will be a pain.
 

Squishinator

New Member
Reaction score
3
Setting Integer Variables

Just a quick question:

If in a trigger i set say set Integerx as integerx + 1, and later in the same trigger i place an if integerx is equal to 1, do this. Pretending integerx was 0 when this trigger started, would it work or would i have to set the first part of the funcion in a different trigger?
 

UndeadDragon

Super Moderator
Reaction score
447
It should work fine, as long as integerx's default value was 0, because if it is 1, then when you do integerx = integerx+1 the value will be 2.
 

Squishinator

New Member
Reaction score
3
"System" not working... please help

All of number one is working, but number two is being a pain. The only thing it seems to do correctly is add and subtract the integer variables.

Here is my system of triggers:


--------------------#1--------------------
Trigger:
  • Give Beast1
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 1) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST1 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Spark (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 5
      • Hero - Modify Intelligence of (Killing unit): Add 1
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • Unit - Add Growth(SPELLBOOK) to (Killing unit)
          • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[1] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST1: Subtract 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Subtract 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast1 returns
    • Events
      • Time - Timer_FIREBEAST___RED[1] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 1
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST1 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




--------------------#2--------------------

Trigger:
  • Give Beast2
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 2) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST2 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Cannon (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 8
      • Hero - Modify Intelligence of (Killing unit): Add 2
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_BEAST_EARTHred Equal to 0
              • Integer_BEAST_WATERred Equal to 0
              • Integer_BEAST_WINDred Equal to 0
            • Then - Actions
              • Unit - Add Growth(SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
            • Else - Actions
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[2] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST2: Subtract 8
      • Hero - Modify Intelligence of Unit_fireBEAST2: Subtract 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast2 returns
    • Events
      • Time - Timer_FIREBEAST___RED[2] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 8
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 2
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST2 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




You should see that number two is a copy of number one, the variables are just changed.
 

Squishinator

New Member
Reaction score
3
Trigger not working.... it is a copy of another, only the variables have changed.WHY?

All of number one is working, but number two is being a pain. The only thing it seems to do correctly is add and subtract the integer variables.

Here is my system of triggers:


--------------------#1--------------------
Trigger:
  • Give Beast1
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 1) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST1 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Spark (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 5
      • Hero - Modify Intelligence of (Killing unit): Add 1
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • Unit - Add Growth(SPELLBOOK) to (Killing unit)
          • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[1] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST1: Subtract 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Subtract 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast1 returns
    • Events
      • Time - Timer_FIREBEAST___RED[1] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 1
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST1 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




--------------------#2--------------------

Trigger:
  • Give Beast2
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 2) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST2 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Cannon (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 8
      • Hero - Modify Intelligence of (Killing unit): Add 2
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_BEAST_EARTHred Equal to 0
              • Integer_BEAST_WATERred Equal to 0
              • Integer_BEAST_WINDred Equal to 0
            • Then - Actions
              • Unit - Add Growth(SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
            • Else - Actions
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[2] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST2: Subtract 8
      • Hero - Modify Intelligence of Unit_fireBEAST2: Subtract 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast2 returns
    • Events
      • Time - Timer_FIREBEAST___RED[2] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 8
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 2
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST2 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




You should see that number two is a copy of number one, the variables are just changed.
 

Squishinator

New Member
Reaction score
3
Trigger not working.... it is a copy of another, only the variables have changed.WHY?

All of number one is working, but number two is being a pain. The only thing it seems to do correctly is add and subtract the integer variables.

Here is my system of triggers:


--------------------#1--------------------
Trigger:
  • Give Beast1
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 1) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST1 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Spark (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 5
      • Hero - Modify Intelligence of (Killing unit): Add 1
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • Unit - Add Growth(SPELLBOOK) to (Killing unit)
          • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[1] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST1: Subtract 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Subtract 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast1 returns
    • Events
      • Time - Timer_FIREBEAST___RED[1] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 5
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 1
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST1 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spark (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




--------------------#2--------------------

Trigger:
  • Give Beast2
    • Events
      • Unit - A unit Dies
    • Conditions
      • |cffff7000Fire Beast|n (Level 2) Equal to (Unit-type of (Dying unit))
    • Actions
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Unit_fireBEAST2 = (Killing unit)
      • Special Effect - Create a special effect at (Position of (Killing unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Unit - Add Cannon (SPELLBOOK) to (Killing unit)
      • Hero - Modify Strength of (Killing unit): Add 8
      • Hero - Modify Intelligence of (Killing unit): Add 2
      • -------- EARTH ADEPT --- ability --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Killing unit)) Equal to Earth Adept
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_BEAST_EARTHred Equal to 0
              • Integer_BEAST_WATERred Equal to 0
              • Integer_BEAST_WINDred Equal to 0
            • Then - Actions
              • Unit - Add Growth(SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Growth(SPELLBOOK)
            • Else - Actions
        • Else - Actions
          • -------- WATER ADEPT --- ability --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Equal to Water Adept
            • Then - Actions
              • Unit - Add Tide (SPELLBOOK) to (Killing unit)
              • Set Ability_FIREBEAST_red[1] = Tide (SPELLBOOK)
            • Else - Actions


Trigger:
  • Use Beast2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • Countdown Timer - Start Timer_FIREBEAST___RED[2] as a One-shot timer that will expire in 30.00 seconds
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred - 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred + 1)
      • Hero - Modify Strength of Unit_fireBEAST2: Subtract 8
      • Hero - Modify Intelligence of Unit_fireBEAST2: Subtract 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
        • Else - Actions


Trigger:
  • FIREBeast2 returns
    • Events
      • Time - Timer_FIREBEAST___RED[2] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 8
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 2
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions


Trigger:
  • FIRE1 SUMMON BEAST2 RED
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon (BEAST)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Equal to 0
        • Then - Actions
          • Unit - Remove Ability_FIREBEAST_red[1] from (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 1
        • Then - Actions
          • Unit - Add Mars (SPELLBOOK) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 2
            • Then - Actions
              • Unit - Add Nova (SPELLBOOK) to (Triggering unit)
            • Else - Actions




You should see that number two is a copy of number one, the variables are just changed.
 

Squishinator

New Member
Reaction score
3
Leaking? Are Integer Leaks Possible?

Here is my code:


Trigger:
  • FIREBeast2 returns
    • Events
      • Time - Timer_FIREBEAST___RED[2] expires
    • Conditions
    • Actions
      • Hero - Modify Strength of Unit_fireBEAST1: Add 8
      • Hero - Modify Intelligence of Unit_fireBEAST1: Add 2
      • Set Integer_BEAST_FIREred = (Integer_BEAST_FIREred + 1)
      • Set Integer_FIRE_SUMMONred = (Integer_FIRE_SUMMONred - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_BEAST_FIREred Greater than or equal to 1
        • Then - Actions
          • Unit - Add Ability_FIREBEAST_red[1] to Hero_RED
        • Else - Actions
      • -------- --------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_FIRE_SUMMONred Equal to 0
        • Then - Actions
          • Unit - Remove Mars (SPELLBOOK) from Hero_RED
          • Unit - Remove Nova (SPELLBOOK) from Hero_RED
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_FIRE_SUMMONred Equal to 1
            • Then - Actions
              • Unit - Remove Nova (SPELLBOOK) from Hero_RED
            • Else - Actions
 

Trollvottel

never aging title
Reaction score
262
no, integers dont leak. does it lagg? this may be because you add the ability to your unit and the ability isnt preloaded so wc3 has to load it ingame. a solution would be creating a unit with this ability and removing it at map init.
 

Kikac_NNGK

Well-Known Member
Reaction score
33
if u have lag try to change the Timer. If u have very small timers like: 0.01; 0.1 it lags. I usualy use a 0.3 timer
 

TheSpoon

New Member
Reaction score
10
What is the lagg like?
Does it steadily build? Or does the game just halt?

Are we sure that this is where the lagg is coming from?

Otherwise.. no. I don't see any leaks : s
 

Squishinator

New Member
Reaction score
3
It doesnt lag. It just doesnt work. I have two triggers like this, this one's just a copy of the other the variables have just been changed. The first one works, the second one doesnt. and no matter what it only removes one ability... What could be causing this? Bug i system maybe? SO CONFUSED:banghead::banghead::banghead:
 

TheSpoon

New Member
Reaction score
10
Tell us exactly: what you are trying to do, and what is going wrong.
So far you just gave us a trigger, we don't have much to work with.
 

Lumograph090

New Member
Reaction score
22
It doesnt lag. It just doesnt work. I have two triggers like this, this one's just a copy of the other the variables have just been changed. The first one works, the second one doesnt. and no matter what it only removes one ability... What could be causing this? Bug i system maybe? SO CONFUSED:banghead::banghead::banghead:

Wait, what? Your title and your apparent problem are two totally different issues.

You say the game lags, and you ask if Integers can leak. But then you tell us the Trigger doesn't work.

So what is the actual problem?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top