• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

When i use this spell my game is freeze sometimes.

Level 3
Joined
Sep 23, 2023
Messages
9
How should I fix this spell? When I use this spell, it sometimes works normally, but sometimes it makes the game freeze.

I tried creating a new trigger to turn off the looping trigger, but it still freezes.

this skill add another skill (Spiked Carapace) to unit when have "Sanctified Reflection" buff. Take skill (Spiked Carapace) off after buff is gone.

Game is freeze sometimes. When I used another skill has looping check too. including single target skill.




Sanctified Reflection
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Sanctified Reflection
  • Actions
    • Set VariableSet SR_Caster = (Triggering unit)
    • Set VariableSet SR_Ability_Level = (Level of Sanctified Reflection for SR_Caster)
    • -------- --------------------------- --------
    • Set VariableSet SR_AOE = 300.00
    • Set VariableSet SR_Location = (Target point of ability being cast)
    • Set VariableSet SR_Group = (Units within SR_AOE of SR_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of SR_Caster).) Equal to True))).)
    • -------- --------------------------- --------
    • Unit Group - Pick every unit in SR_Group and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to SR_Group_Buff
        • Unit - Add Sanctified Reflection (Dummy) to (Picked unit)
        • Unit - Set level of Sanctified Reflection (Dummy) for (Picked unit) to SR_Ability_Level
    • -------- --------------------------- --------
    • Special Effect - Create a special effect at SR_Location using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
    • Special Effect - Set Scale of (Last created special effect) to 1.50
    • Special Effect - Destroy (Last created special effect)
    • -------- --------------------------- --------
    • Custom script: call RemoveLocation(udg_SR_Location)
    • Custom script: call DestroyGroup(udg_SR_Group)
  • Wait 1.00 seconds
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Guardians Retribution loop <gen> is on) Equal to False
    • Then - Actions
      • Trigger - Turn on Incarcerate loop <gen>
    • Else - Actions
Sanctified Reflection loop
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in SR_Group_Buff and do (Actions)
      • Loop - Actions
        • Set VariableSet SR_Target = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (SR_Target has buff Sanctified Reflection ) Equal to True
          • Then - Actions
            • Do nothing
          • Else - Actions
            • Unit - Remove Sanctified Reflection (Dummy) from SR_Target
            • Unit Group - Remove SR_Target from SR_Group_Buff.
    • Wait 1.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (SR_Group_Buff is empty) Equal to True
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Your Loop trigger has an unnecessary Wait, change it to this:
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in SR_Group_Buff and do (Actions)
      • Loop - Actions
        • Set VariableSet SR_Target = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (SR_Target has buff Sanctified Reflection ) Equal to False
          • Then - Actions
            • Unit - Remove Sanctified Reflection (Dummy) from SR_Target
            • Unit Group - Remove SR_Target from SR_Group_Buff.
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (SR_Group_Buff is empty) Equal to True
              • Then - Actions
                • Trigger - Turn off (This trigger)
              • Else - Actions
          • Else - Actions
Also, note how I ordered it in a way that makes more sense.

This Action doesn't do anything special:
  • Do nothing
It's just a comment.
 
Level 3
Joined
Sep 23, 2023
Messages
9
Your Loop trigger has an unnecessary Wait, change it to this:
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in SR_Group_Buff and do (Actions)
      • Loop - Actions
        • Set VariableSet SR_Target = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (SR_Target has buff Sanctified Reflection ) Equal to False
          • Then - Actions
            • Unit - Remove Sanctified Reflection (Dummy) from SR_Target
            • Unit Group - Remove SR_Target from SR_Group_Buff.
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (SR_Group_Buff is empty) Equal to True
              • Then - Actions
                • Trigger - Turn off (This trigger)
              • Else - Actions
          • Else - Actions
Also, note how I ordered it in a way that makes more sense.

This Action doesn't do anything special:
  • Do nothing
It's just a comment.
it still crash :cry:
 
Level 20
Joined
Feb 27, 2019
Messages
592
Flame Strike but I change target only friends unit and make every damage to 0

My another single skill with looping is freezes too
Base is shadow strike.
That is great information. The reason for your freezes are explained here: [Crash] - List of WarCraft III Crashes by Adiktuz and Dr Super Goods. Go to the page, CTRL + F and search for interval. The sneaky part is that casting such a spell after ~10 minutes of gameplay causes the freeze, not before that.

With Flame Strike is there any reason for 0 damage to allies? If it shouldnt damage any targets the damage and stats can be left to their default values and targets allowed set to none.

What is the Shadow Strike spell used for?

EDIT:
There is a spell in Neutral Hostile -> Heroes -> Channel that is often used for dummy abilities because it has a lot of customizable data fields such as setting a custom order id.
Data - Art Duration: 0
Data - Base Order ID: channel or anything
Data - Disable Other Abilities: false
Data - Follow Through Time: 0
Data - Option:
Visible = If shown on the hero ui
Targeting Image = If it has the aoe targeting image
Physical Spell = Can be cast on spell immune
Universal Spell = Can be cast on anything
Unique Cast = No idea
Data - Target Type = AoE, Point, Target or Instant
I dont use the instant one since it stops the unit. There are different instant abilities f.e. fan of knives that automatically allows the warden to continue running after the spell is cast which is not the case for channel. Berserk is another example that doesnt take any time to cast or interrupts the unit in any way.
 
Last edited:
Level 3
Joined
Sep 23, 2023
Messages
9
I have changed my base skill from (Flame Strike) to another skill and created a dummy cast skill (Base: Frost Armor) upon picked unit.

Everything is working normally. Thank you, everyone, for notifying me about the base skill. I have also changed my single-target skill from (Base: Shadow Strike) to (Base: Cripple), and it works great too!

  • Sanctified Reflection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sanctified Reflection
    • Actions
      • Set VariableSet SR_Caster = (Triggering unit)
      • Set VariableSet SR_Ability_Level = (Level of Sanctified Reflection for SR_Caster)
      • -------- --------------------------- --------
      • Set VariableSet SR_AOE = 300.00
      • Set VariableSet SR_Location = (Target point of ability being cast)
      • Set VariableSet SR_Group = (Units within SR_AOE of SR_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of SR_Caster).) Equal to True))).)
      • -------- --------------------------- --------
      • Unit Group - Pick every unit in SR_Group and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to SR_Group_Buff
          • Unit - Create 1 Dummy for (Owner of SR_Caster) at SR_Location facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Sanctified Reflection Buff (Dummy) to (Last created unit)
          • Unit - Set level of Sanctified Reflection Buff (Dummy) for (Last created unit) to 1
          • Unit - Order (Last created unit) to Undead Lich - Frost Armor (Picked unit)
          • Game - Display to (All players) the text: Add to Group
          • Game - Display to (All players) the text: Add buff to unit!
          • Unit - Add Sanctified Reflection Target (Dummy) to (Picked unit)
          • Unit - Set level of Sanctified Reflection Target (Dummy) for (Picked unit) to SR_Ability_Level
      • -------- --------------------------- --------
      • Special Effect - Create a special effect at SR_Location using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Special Effect - Set Scale of (Last created special effect) to 1.50
      • Special Effect - Destroy (Last created special effect)
      • -------- --------------------------- --------
      • Custom script: call RemoveLocation(udg_SR_Location)
      • Custom script: call DestroyGroup(udg_SR_Group)
      • Wait 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Sanctified Reflection loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Sanctified Reflection loop <gen>
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
  • Sanctified Reflection
I'm glad you got it working, I was under the impression that the Waits were stacking up or something. Either way, the Waits are not necessary and you can improve the efficiency with some simple changes.

Here's how you can improve the cast trigger:
  • Sanctified Reflection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sanctified Reflection
    • Actions
      • Set VariableSet SR_Caster = (Triggering unit)
      • Set VariableSet SR_Ability_Level = (Level of Sanctified Reflection for SR_Caster)
      • -------- --------------------------- --------
      • Set VariableSet SR_AOE = 300.00
      • Set VariableSet SR_Location = (Target point of ability being cast)
      • Set VariableSet SR_Group = (Units within SR_AOE of SR_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of SR_Caster).) Equal to True))).)
      • Unit - Create 1 Dummy for (Owner of SR_Caster) at SR_Location facing Default building facing degrees
      • Set VariableSet SR_Dummy = (Last created unit)
      • Unit - Add a 0.20 second Generic expiration timer to SR_Dummy
      • Unit - Add Sanctified Reflection Buff (Dummy) to SR_Dummy
      • Unit - Set level of Sanctified Reflection Buff (Dummy) for SR_Dummy to 1
      • -------- --------------------------- --------
      • Unit Group - Pick every unit in SR_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet SR_Target = (Picked unit)
          • Unit Group - Add SR_Target to SR_Group_Buff
          • Unit - Order SR_Dummy to Undead Lich - Frost Armor SR_Target
          • Unit - Add Sanctified Reflection Target (Dummy) to SR_Target
          • Unit - Set level of Sanctified Reflection Target (Dummy) for SR_Target to SR_Ability_Level
          • Game - Display to (All players) the text: Add to Group
          • Game - Display to (All players) the text: Add buff to unit!
      • -------- --------------------------- --------
      • Special Effect - Create a special effect at SR_Location using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Special Effect - Set Scale of (Last created special effect) to 1.50
      • Special Effect - Destroy (Last created special effect)
      • -------- --------------------------- --------
      • Custom script: call RemoveLocation(udg_SR_Location)
      • Custom script: call DestroyGroup(udg_SR_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Sanctified Reflection loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Sanctified Reflection loop <gen>
        • Else - Actions
1) I've adjusted the trigger to use a single Dummy unit, only one is ever necessary for most cases.
2) I've introduced some variables that will improve efficiency and prevent bugs, SR_Dummy and SR_Target.
3) I've removed the Wait action just like I did in my previous trigger since it literally did nothing. There is no need to delay things like this.

In order for this design to work you need to make sure that your Dummy unit is setup correctly. Here's how to create a proper Dummy unit (contrary to the very outdated info of the past):

1) Copy and paste the Locust unit.
2) Set it's Movement Type = None, Speed Base: 0, Model = None, Shadow = None, Attacks Enabled = None. You can also give it mana but I generally just ensure that my Dummy abilities are setup properly to not cost mana.

With these settings the Dummy unit can cast spells immediately without needing to turn to face it's target. This means that it can cast ANY number of abilities within the same game frame, assuming that they don't have any Cast Time/Channeling time.

Also, you're setting the Dummy ability to level 1, which it already is. Perhaps you wanted this to be set to SR_Ability_Level?
  • Unit - Set level of Sanctified Reflection Buff (Dummy) for SR_Dummy to 1
 
Level 3
Joined
Sep 23, 2023
Messages
9
I'm glad you got it working, I was under the impression that the Waits were stacking up or something. Either way, the Waits are not necessary and you can improve the efficiency with some simple changes.

Here's how you can improve the cast trigger:
  • Sanctified Reflection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sanctified Reflection
    • Actions
      • Set VariableSet SR_Caster = (Triggering unit)
      • Set VariableSet SR_Ability_Level = (Level of Sanctified Reflection for SR_Caster)
      • -------- --------------------------- --------
      • Set VariableSet SR_AOE = 300.00
      • Set VariableSet SR_Location = (Target point of ability being cast)
      • Set VariableSet SR_Group = (Units within SR_AOE of SR_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of SR_Caster).) Equal to True))).)
      • Unit - Create 1 Dummy for (Owner of SR_Caster) at SR_Location facing Default building facing degrees
      • Set VariableSet SR_Dummy = (Last created unit)
      • Unit - Add a 0.20 second Generic expiration timer to SR_Dummy
      • Unit - Add Sanctified Reflection Buff (Dummy) to SR_Dummy
      • Unit - Set level of Sanctified Reflection Buff (Dummy) for SR_Dummy to 1
      • -------- --------------------------- --------
      • Unit Group - Pick every unit in SR_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet SR_Target = (Picked unit)
          • Unit Group - Add SR_Target to SR_Group_Buff
          • Unit - Order SR_Dummy to Undead Lich - Frost Armor SR_Target
          • Unit - Add Sanctified Reflection Target (Dummy) to SR_Target
          • Unit - Set level of Sanctified Reflection Target (Dummy) for SR_Target to SR_Ability_Level
          • Game - Display to (All players) the text: Add to Group
          • Game - Display to (All players) the text: Add buff to unit!
      • -------- --------------------------- --------
      • Special Effect - Create a special effect at SR_Location using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Special Effect - Set Scale of (Last created special effect) to 1.50
      • Special Effect - Destroy (Last created special effect)
      • -------- --------------------------- --------
      • Custom script: call RemoveLocation(udg_SR_Location)
      • Custom script: call DestroyGroup(udg_SR_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Sanctified Reflection loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Sanctified Reflection loop <gen>
        • Else - Actions
1) I've adjusted the trigger to use a single Dummy unit, only one is ever necessary for most cases.
2) I've introduced some variables that will improve efficiency and prevent bugs, SR_Dummy and SR_Target.
3) I've removed the Wait action just like I did in my previous trigger since it literally did nothing. There is no need to delay things like this.

In order for this design to work you need to make sure that your Dummy unit is setup correctly. Here's how to create a proper Dummy unit (contrary to the very outdated info of the past):

1) Copy and paste the Locust unit.
2) Set it's Movement Type = None, Speed Base: 0, Model = None, Shadow = None, Attacks Enabled = None. You can also give it mana but I generally just ensure that my Dummy abilities are setup properly to not cost mana.

With these settings the Dummy unit can cast spells immediately without needing to turn to face it's target. This means that it can cast ANY number of abilities within the same game frame, assuming that they don't have any Cast Time/Channeling time.

Also, you're setting the Dummy ability to level 1, which it already is. Perhaps you wanted this to be set to SR_Ability_Level?
  • Unit - Set level of Sanctified Reflection Buff (Dummy) for SR_Dummy to 1
Thank you! I will use this trigger to improve another skill as well!.

How can I do if some skill is projectile not instant cast. before projectile running to unit. trigger is finished and turn them off.

  • Unit - Set level of Sanctified Reflection Buff (Dummy) for SR_Dummy to 1
i take it off already. that my mistake trigger hahahaha.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
How can I do if some skill is projectile not instant cast. before projectile running to unit. trigger is finished and turn them off.
For skills which use Missiles (projectile running to unit) I recommend learning how to use this system:

It may seem intimidating at first but it's actually quite easy to use. To help you get started, I attached a demo map with a simple design for a Missile which seeks out it's target similar to Storm Bolt or Death Coil.
 

Attachments

  • Missile Example 1.w3m
    79.3 KB · Views: 5
Level 3
Joined
Sep 23, 2023
Messages
9
For skills which use Missiles (projectile running to unit) I recommend learning how to use this system:

It may seem intimidating at first but it's actually quite easy to use. To help you get started, I attached a demo map with a simple design for a Missile which seeks out it's target similar to Storm Bolt or Death Coil.
Thank you!
 
Top