• 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.

[Trigger] Spell Trigger Doesn't Work Properly

Status
Not open for further replies.
Level 2
Joined
May 3, 2008
Messages
18
Ok, so here's the deal...
Paladin has Holy Light, Divine Shield and Blessing of Kings.
What should happen is next:
* Paladin uses Holy Light (which is an AoE heal) over Divine Shield.
-What should happen is the shield bursting (loosing the buff) and doing AoE damage without healing the Paladin. (This part works).
* Paladin uses Divine Shield, then Blessing of Kings and finally using Holy Light over Divine Shield.
-What should happen now is once again the shield bursting, doing damage, but also healing the Paladin.
(The heal part of this works, but the damage one doesn't).

Variables:
* Boolean_BoKIsUp (boolean)[used for checking has Paladin used Blessing of Kings],
* IntTime_BoK (integer)[used for checking have 7 seconds gone by without using the spells effect]
Triggers I'm using to make this happen:
  • Blessing of Kings
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blessing of Kings [Paladin]
    • Actions
      • Set Boolean_BoKIsUp = True
      • Set IntTime_BoK = 0
      • Trigger - Turn on BoK Countdown <gen>
BoK Countdown is initially off.

  • BoK Countdown
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set IntTime_BoK = (IntTime_BoK + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntTime_BoK Greater than or equal to 7
        • Then - Actions
          • Set Boolean_BoKIsUp = False
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing

  • Holy Light
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light [Paladin]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) has buff Divine Shield) Equal to True
          • Boolean_BoKIsUp Equal to True
        • Then - Actions
          • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
          • -------- --------
          • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Holy Light [Heal Effect] to (Last created unit)
          • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
          • -------- --------
          • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Holy Light [Damage Effect] to (Last created unit)
          • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
          • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
          • -------- --------
          • Set Boolean_BoKIsUp = False
          • Trigger - Turn off BoK Countdown <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) has buff Divine Shield) Equal to True
            • Then - Actions
              • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
              • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Damage Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
              • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
            • Else - Actions
              • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Heal Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
              • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
  • Holy Light
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light [Paladin]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) has buff Divine Shield) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_BoKIsUp Equal to True
            • Then - Actions
              • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
              • -------- --------
              • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Heal Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
              • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
              • -------- --------
              • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Damage Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
              • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
              • -------- --------
              • Set Boolean_BoKIsUp = False
              • Trigger - Turn off BoK Countdown <gen>
            • Else - Actions
              • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
              • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Damage Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
              • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
        • Else - Actions
          • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Holy Light [Heal Effect] to (Last created unit)
          • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Casting unit))
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
This is a trigger I type right into the Reply without using World Editor so I cant guarantee that it will fix ur trigger. (But I think it can :D).
Also, ur trigger has so many Location leaks. Try to solve them.
 
Level 9
Joined
Dec 12, 2007
Messages
489
the trigger's logic looks fine though unoptimized.

try use debug message at some point as your trigger flow to see which part doesn't work and which if-block activated on cast.

try store each unit (casting unit, target unit of ability being cast, last created unit) and point (target point of ability being cast) reference to variables and see if it works now,

or

try substitute casting unit with triggering unit

the problem might comes from invalid reference because of GUI ways of handling reference.

and keep in mind that your spell is not MUI or even MPI, so it might behave different when being cast by units more than one in short time.
 
Level 2
Joined
May 3, 2008
Messages
18
Reply

@ hayaku1412
You removed the prerequisite for first part of the spell, he's supposed to have both the Divine Shield on and the boolean variable set to true >.>
(for the doubble effect to take place[I want to trigger heal AND damage effects ONLY if both are true]).
As for the location leaks, I cant say i care about them much now, mostly because it will be a small map. -- But i will solve them eventually.

@ Dark Axl
The spell wasnt intended to be casted by more than one unit (I probably should have mentioned that).
Also there is no wait in my triggers only thing that would happen if more than one Paladin casted BoK
would be that Paladins would have constant BoK boolean = true, meaning opsky spells :) .
I'll try using variables if nothing else works.

Thank you both for looking into my problem.

EDIT:
It's been fixed.
If you're wondering what was the problem, it was
spawning 2 units instead of one.
  • Holy Light
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light [Paladin]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) has buff Divine Shield) Equal to True
          • Boolean_BoKIsUp Equal to True
        • Then - Actions
          • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
          • -------- --------
          • Unit - Create 1 dummy for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Holy Light [Damage Effect] to (Last created unit)
          • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Triggering unit))
          • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
          • -------- --------
          • Unit - Add Holy Light [Heal Effect] to (Last created unit)
          • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Triggering unit))
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
          • -------- --------
          • Set Boolean_BoKIsUp = False
          • Trigger - Turn off BoK Countdown <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) has buff Divine Shield) Equal to True
            • Then - Actions
              • Unit - Remove Divine Shield buff from (Target unit of ability being cast)
              • Unit - Create 1 dummy for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Damage Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Damage Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Triggering unit))
              • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
            • Else - Actions
              • Unit - Create 1 dummy for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Holy Light [Heal Effect] to (Last created unit)
              • Unit - Set level of Holy Light [Heal Effect] for (Last created unit) to (Level of Holy Light [Paladin] for (Triggering unit))
              • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility
If anyone could PM me with how to mark thread as problem solved id greatly appreciate it.
 
Last edited:
Status
Not open for further replies.
Top