• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] This trigger no more works after blocked by spell shield

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,146
This trigger was overriding Spell Shield, so i have added these lines by myself.

  • Wait 0.10 seconds
  • ((Target unit of ability being cast) has buff Stunned (Pause)) Equal to True
For the make it run, i have decided to detect it is stunned by spell. It worked. But after it blocked by amulet of spell shield, no more works again.

  • Psychic Blast On
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Psychic Blast //
    • Actions
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in PB_Group) Equal to 0
          • ((Target unit of ability being cast) has buff Stunned (Pause)) Equal to True
        • Then - Actions
          • Trigger - Turn on Psychic Blast Loop <gen>
        • Else - Actions
      • Set PB_Times = (PB_Times + 1)
      • Set PB_HERO[PB_Times] = (Triggering unit)
      • Set PB_Targ[PB_Times] = (Target unit of ability being cast)
      • -------- ------------------------------------------------------------------------------------ --------
      • Set PB_Point[1] = (Position of PB_Targ[PB_Times])
      • Set PB_HeroP[1] = (Position of PB_HERO[PB_Times])
      • Set PB_Angel[PB_Times] = (Angle from PB_HeroP[1] to PB_Point[1])
      • -------- ------------------------------------------------------------------------ --------
      • Set PB_Counter[PB_Times] = 0
      • Set PB_Speed[PB_Times] = 20.00
      • Set PB_Distance[PB_Times] = 400.00
      • Set PB_Formula[PB_Times] = (PB_Distance[PB_Times] / PB_Speed[PB_Times])
      • -------- -------------------------------------------------------------------------------- --------
      • Set PB_Max_Distance[PB_Times] = PB_Distance[PB_Times]
      • Set PB_Height[PB_Times] = ((Square root(PB_Distance[PB_Times])) / (PB_Distance[PB_Times] / 15.00))
      • Set PB_Height_Formula[PB_Times] = (PB_Distance[PB_Times] x PB_Height[PB_Times])
      • -------- --------------------------------------------------------------------- --------
      • Unit - Add Storm Crow Form to PB_Targ[PB_Times]
      • Unit - Remove Storm Crow Form from PB_Targ[PB_Times]
      • Unit Group - Add PB_Targ[PB_Times] to PB_Group
      • -------- ----------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_PB_Point[1])
      • Custom script: call RemoveLocation(udg_PB_HeroP[1])
  • Psychic Blast Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer PB) from 1 to PB_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PB_Targ[PB] is in PB_Group) Equal to True
            • Then - Actions
              • Set PB_Distance[PB] = (PB_Distance[PB] - PB_Speed[PB])
              • Set PB_Speed[PB] = (PB_Distance[PB] / PB_Formula[PB])
              • Set PB_Speed[PB] = (PB_Speed[PB] + 0.50)
              • -------- ---------------------------------------------------------------- --------
              • Set PB_Point[1] = (Position of PB_Targ[PB])
              • Set PB_Point[2] = (PB_Point[1] offset by PB_Speed[PB] towards PB_Angel[PB] degrees)
              • Unit - Move PB_Targ[PB] instantly to PB_Point[2]
              • -------- -------------------------------------------------------- --------
              • Set PB_Fly[PB] = (PB_Fly[PB] + (180.00 / (PB_Max_Distance[PB] / PB_Speed[PB])))
              • Set PB_Fly_Now[PB] = ((Sin(PB_Fly[PB])) x PB_Height_Formula[PB])
              • Animation - Change PB_Targ[PB] flying height to PB_Fly_Now[PB] at 1000000000.00
              • -------- ---------------------------------------------------- --------
              • Set PB_Counter[PB] = (PB_Counter[PB] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PB_Counter[PB] Equal to 8
                • Then - Actions
                  • Set PB_Counter[PB] = 0
                  • Special Effect - Create a special effect attached to the origin of PB_Targ[PB] using Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
                  • Special Effect - Create a special effect attached to the origin of PB_Targ[PB] using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PB_Counter[PB] Equal to 5
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the origin of PB_Targ[PB] using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • -------- ------------------------------------------------------------------------------ --------
              • Custom script: call RemoveLocation(udg_PB_Point[1])
              • Custom script: call RemoveLocation(udg_PB_Point[2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PB_Distance[PB] Less than or equal to 0.00
                • Then - Actions
                  • Unit Group - Remove PB_Targ[PB] from PB_Group
                  • Animation - Change PB_Targ[PB] flying height to (Default flying height of PB_Targ[PB]) at 1000000000.00
                  • Unit - Cause PB_HERO[PB] to damage PB_Targ[PB], dealing (60.00 x (Real((Level of Psychic Blast // for PB_HERO[(Player number of (Owner of (Triggering unit)))])))) damage of attack type Spells and damage type Magic
                  • Set PB_Targ[PB] = No unit
                  • Set PB_HERO[PB] = No unit
                  • -------- --------------------------------------------------------------- --------
                  • Set PB_Angel[PB] = 0.00
                  • Set PB_Counter[PB] = 0
                  • Set PB_Speed[PB] = 0.00
                  • Set PB_Distance[PB] = 0.00
                  • Set PB_Formula[PB] = 0.00
                  • Set PB_Max_Distance[PB] = 0.00
                  • Set PB_Height[PB] = 0.00
                  • Set PB_Height_Formula[PB] = 0.00
                  • Set PB_Fly[PB] = 0.00
                  • Set PB_Fly_Now[PB] = 0.00
                  • -------- ------------------------------------------------ --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in PB_Group) Equal to 0
                    • Then - Actions
                      • Set PB_Times = 0
                      • Trigger - Turn off Psychic Blast Loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
This is not my trigger and it is confusing to me, i haven't found it yet.
 
Level 20
Joined
Feb 27, 2019
Messages
593
When is the unit added to the group in the first trigger removed from that group?

Wouldnt that have an effect on the condition that is responsible to turn on the loop trigger?

You could instead add an if then else condition at the start of the first trigger, put your condition there and the original trigger inside the then actions.
 
Level 17
Joined
Jun 2, 2009
Messages
1,146
When is the unit added to the group in the first trigger removed from that group?

Wouldnt that have an effect on the condition that is responsible to turn on the loop trigger?

You could instead add an if then else condition at the start of the first trigger, put your condition there and the original trigger inside the then actions.
Uhm, it is the entire trigger. I don't understand you and the trigger because it is not my trigger.
By the way if i will remove these (original state) it works without any issues
  • zzz.gif
    Wait 0.10 seconds
  • if.gif
    ((Target unit of ability being cast) has buff Stunned (Pause)) Equal to True
But overrides Spell Block items. And it is important issue to us.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583

You can't use a Wait like that MOST of the time. Event Responses all have their own behavior and a lot of them won't work after a Wait.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,146

You can't use a Wait like that MOST of the time. Event Responses all have their own behavior and a lot of them won't work after a Wait.
Deleted wait and nothing changed.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Of course something changed:
  • Set PB_Targ[PB_Times] = (Target unit of ability being cast)
This variable never gets Set if you have the Wait. Without that variable the spell doesn't have a target, no target means nothing happens.

This Action is what turns on the Loop trigger which periodically moves the units. If this trigger isn't on, nothing will happen:
  • Trigger - Turn on Psychic Blast Loop <gen>
So the issue is that 1) The Wait was breaking things. 2) You're not turning on Psychic Blast Loop. The solution would be something like this:
  • Actions
    • If (Target unit of ability being cast) has Spell Shield Equal to True then Skip remaining actions
How you want to go about detecting that it has Spell Shield is the difficult part. You'd probably need a Timer system / Unit Group to manage tracking whether or not a unit has Spell Block ready. If this is too much then you'll either need to get rid of Spell Block or your triggered Spells or just make the triggered spells "Pierce Spell Block".
 
Level 17
Joined
Jun 2, 2009
Messages
1,146
Before reply let me explain something. My map has more than 100+ trigger spells and none of them requires system that detects spell shield.
Because when spell shield blocked spell, triggers are not running. But this spells is the only exclusion.

When unit gets targeted by this spell, it is stunning for 1 second and there is a buff appears on it callled "stunned (pause)"

Is there a no way to check targeted unit has "stunned (pause)" buff?
If no, just don't run the trigger?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
There is no instant Stun, so the unit won't be stunned when that Event fires. Also, you can't confirm whether or not the Stun came from that ability anyway so it's not really a solution.

And I don't really understand how none of your triggered spells would require a system to detect spell shield. Either all of the triggered spells work with Spell Shield or all of them don't work. Unless there's some interaction I'm unaware of.

What about this ability makes it unique? If you can figure that out, you shouldn't have to mess with the triggers. You can probably just adjust the ability to do what you want.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,146
There is no instant Stun, so the unit won't be stunned when that Event fires. Also, you can't confirm whether or not the Stun came from that ability anyway so it's not really a solution.

And I don't really understand how none of your triggered spells would require a system to detect spell shield. Either all of the triggered spells work with Spell Shield or all of them don't work. Unless there's some interaction I'm unaware of.

What about this ability makes it unique? If you can figure that out, you shouldn't have to mess with the triggers. You can probably just adjust the ability to do what you want.
Nothing. It is just a Storm Bolt with missile speed 99999 and it has unique buff. This is why i was put 0.10 wait for the let enemy get stunned, then get the debuff then let the trigger check.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Maybe it's because the Spell Shield fires when the Missile of the Storm Bolt hits the target. If so, try using an ability other than Storm Bolt for Psychic Blast, like something that would immediately break the Spell Shield. Then for the Stun you can order a Dummy unit to cast Storm Bolt on the target inside of the Psychic Blast On trigger.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,146
But problem is after it's blocked.
You can cast this spell to the enemy many times as you want.
No problem.
When the targed buys Spell Shield item, it blocks and trigger not works. No problem.
But once it's blocked, trigger no more works again.

This is confusing.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I just tested Spell Shield with both Storm Bolt (missile) and Entangling Roots (instant) and the triggers always run.
  • ex 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
  • ex 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
So unless on your version it's different, the Event "A unit Starts the effect of an ability" will happen even if Spell Shield blocks the ability. This means that your triggered spells will ALWAYS run regardless of Spell Shield, so this problem isn't exclusive to Psychic Blast.

This is how I thought it worked, I know maps like DotA had to design around Spell Block using special systems.
 
Level 17
Joined
Jun 2, 2009
Messages
1,146
I just tested Spell Shield with both Storm Bolt (missile) and Entangling Roots (instant) and the triggers always run.
  • ex 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
  • ex 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
So unless on your version it's different, the Event "A unit Starts the effect of an ability" will happen even if Spell Shield blocks the ability. This means that your triggered spells will ALWAYS run regardless of Spell Shield, so this problem isn't exclusive to Psychic Blast.

This is how I thought it worked, I know maps like DotA had to design around Spell Block using special systems.
Ok ok but this is why i am trying to add the unit buff and let the check trigger has this buff.
Another words, is it not possible to prevent this?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Using a Unit Indexer you can track the state of Spell Block:
  • Set Spell Block
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • -------- This is just an example. Units with the Spell Shield ability whether that be an Item ability or Unit ability need to have this variable initially set to TRUE --------
      • -------- This variable is then set to FALSE when their Spell Shield is broken! Then it's set to TRUE again once it's ready --------
      • Unit Group - Pick every unit in UnitsWithSpellShield and do (Actions)
        • Loop - Actions
          • Set SpellShield_Ready[(Custom value of (Picked unit))] = True
This trigger toggles the state of SpellShield_Ready and uses this method to make it MUI. It assumes that Spell Shield has a 6.00 second cooldown:
  • Spell Shield
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • SpellShield_Ready[(Custom value of (Target unit of ability being cast))] Equal to True
    • Actions
      • Custom script: local unit udg_SpellShield_Target = GetSpellTargetUnit()
      • Set SpellShield_Ready[(Custom value of SpellBlock_Target)] = False
      • Wait 6.00 game-time seconds
      • Set SpellShield_Ready[(Custom value of SpellBlock_Target)] = True
      • Custom script: set udg_SpellShield_Target = null
Here's a custom spell example. It won't run the Actions if the target's SpellShield_Ready is Equal to True:
  • Entangling Roots Custom Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
      • SpellShield_Ready[(Custom value of (Target unit of ability being cast))] Equal to False
    • Actions
      • Unit - Kill (Target unit of ability being cast)
So you could add this SpellShield_Ready condition to your Custom Spells to prevent them from running.

In order for this to work properly your Spell Shield trigger needs to run last, meaning you should position it as the last trigger in your Trigger Editor. This is because all of the custom spell triggers use the "A unit Starts the effect of an ability" Event and Spell Shield needs to happen after them otherwise SpellShield_Ready won't be Set in time.

Keep in mind if the unit can drop their Spell Shield item / Buy a new one / etc... then problems can arise and bugs will happen. You could get around this by preventing units from acquiring multiple Spell Shield items and preventing them from dropping the item while it's on cooldown. If it's a Unit ability then this should work fine assuming that's the only source of Spell Shield they can have. Also, the duration of the Wait could be a problem if you wanted multiple Spell Shields with different durations.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,146
I'm glad it works but doesn't the Wait mess it up? That Event Response should be lost. Again, maybe on your version it's different but I really doubt it...
Our objective was check the unit has the specific buff.
If yes, go and run. If no, don't.
I was used wait for the giving a time to make sure my spell hits the enemy.
Wait condition saves me from lot of trouble.

Here is the quick example

  • Orcish Spirit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
          • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +15)
          • Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
          • Hero - Create Kelen's Dagger of Escape and give it to (Triggering unit)
        • Else - Actions
This is just one of my item triggers. When we pick item from the ground or somewhere else and made the trigger about that, game thinks like this "hmm he has the required item, now i have to work this trigger" yes it is doing it's job. But if i will not use wait here, it acts like i haven't recently grabbed it from elsewhere. This 0.10 seconds wait giving us the time for get the item on our inventory, then trigger starts to work.

If i will create trigger about "a unit acquires item" and if another trigger tries to combine this item with another item, second one works and combines item and first trigger will never work. When i put 0.10 seconds wait for the second trigger, that gives a time for the first trigger work

  • Orcish Spirit Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: (Name of (Item being manipulated))
Here is the example. This trigger detects Crown of Kings +5 and runs actions.

Events
Unit - A unit Acquires an item
Conditions
Or - Any (Conditions) are true
Conditions
(Item-type of (Item being manipulated)) Equal to Claws of Attack +15
(Item-type of (Item being manipulated)) Equal to Crown of Kings +5
Actions
Wait 0.10 seconds When i remove this wait from here, the above code does not works.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Claws of Attack +15) Equal to True
((Triggering unit) has an item of type Crown of Kings +5) Equal to True
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +15)
Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
Hero - Create Kelen's Dagger of Escape and give it to (Triggering unit)
Else - Actions

By the way i am sorry English is not my native language and probably i have explained it bit of complicated.
 
Level 20
Joined
Feb 27, 2019
Messages
593
It may very well be that the trigger works for you but on the off chance that you reset cooldown, have multiple units using the spell simultaneously or cooldown being less than the time the spell has to execute it will not work properly. In essence the trigger is no longer properly MUI. To fix it correctly create an entirely new "If (All Conditions are True) then do (Then Actions) else do (Else Actions)" and place the original trigger actions for Psychic Blast On inside the Then Actions.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Your condition) Equal to True
    • Then - Actions
      • -------- put the Original Psychic Blast On Actions here --------
    • Else - Actions
Also you should make the storm bolt instant by changing the missile speed to 0.

I'm glad it works but doesn't the Wait mess it up? That Event Response should be lost. Again, maybe on your version it's different but I really doubt it...
From some testing using "Target unit of ability being cast" it seems to be valid as long as Art - Animation - Cast Backswing BUT if you give the caster a new order before the wait has expired the spell will activate but "Target unit of ability being cast" will be invalid.

You should try this with your ability JFAMAP. Itd be very anoying for the player if the spell doesnt work properly.
 
Last edited:
Status
Not open for further replies.
Top