• 🏆 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!

Feedback

Status
Not open for further replies.
Level 7
Joined
Apr 12, 2011
Messages
124
Some spells i made. Far from done but it's the general idea. Would like some feedback on what to improve/fix.
Also, im new at this so please be precise in your pointing out leaks/improvements. Just saying in comment it sucks isn't helping anyone.

Im a Noob so don't be too annoyed if i write something dumb

Thunderstorm:

  • Thunderstorm Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunderstorm
    • Actions
      • Set LightningCount = 0
      • Set WS_Caster = (Triggering unit)
      • Set WS_Owner = (Owner of WS_Caster)
      • Set ThunderLvl = (Level of Thunderstorm for WS_Caster)
      • Set WS_Point[1] = (Position of WS_Caster)
      • Set WS_Real = 0.00
      • -------- --------
      • -------- Testing Flying caster :D --------
      • -------- --------
      • Animation - Play WS_Caster's stand channel animation
      • Unit - Pause WS_Caster
      • Unit - Add Storm Crow Form to WS_Caster
      • Animation - Change WS_Caster flying height to 200.00 at 1750.00
      • Animation - Queue WS_Caster's stand channel animation
      • Animation - Queue WS_Caster's stand channel animation
      • Animation - Change WS_Caster flying height to 300.00 at 1400.00
      • -------- --------
      • Unit - Create 1 Lightning Dummy (Visual Monsoon) for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- --------
      • Unit - Create 1 Lightning Dummy (Visual Thunderclap) for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- --------
      • For each (Integer WS_Integer) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set WS_Point[3] = (WS_Point[1] offset by 500.00 towards WS_Real degrees)
          • Lightning - Create a Chain Lightning - Primary lightning effect from source WS_Point[1] to target WS_Point[3]
          • Set LightningCount = (LightningCount + 1)
          • Set WS_Lightning[LightningCount] = (Last created lightning effect)
          • Set WS_Point[2] = (WS_Point[1] offset by 300.00 towards WS_Real degrees)
          • -------- --------
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Add Thunderstorm Dummy to (Last created unit)
          • Unit - Set level of Thunderstorm Dummy for (Last created unit) to ThunderLvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[2]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[3] facing Default building facing degrees
          • Unit - Add Thunderstorm Dummy to (Last created unit)
          • Unit - Set level of Thunderstorm Dummy for (Last created unit) to ThunderLvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[1]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
          • Set WS_Real = (WS_Real + (360.00 / 15.00))
          • Custom script: call RemoveLocation(udg_WS_Point[2])
          • Custom script: call RemoveLocation(udg_WS_Point[3])
      • Set WS_Unitgroup = (Units within 550.00 of WS_Point[1] matching (((Matching unit) belongs to an enemy of WS_Owner) Equal to True))
      • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Add Electrified to (Last created unit)
          • Unit - Set level of Electrified for (Last created unit) to ThunderLvl
          • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- --------
      • -------- Cleanup Flyer --------
      • -------- Later --------
      • -------- --------
      • -------- --------
      • Countdown Timer - Start Lightning as a One-shot timer that will expire in 0.20 seconds
      • Countdown Timer - Start Flying as a One-shot timer that will expire in 0.70 seconds
      • Custom script: call RemoveLocation(udg_WS_Point[1])
      • Custom script: call DestroyGroup(udg_WS_Unitgroup)
      • -------- --------


  • Cleanup Flyer
    • Events
      • Time - Flying expires
    • Conditions
    • Actions
      • -------- --------
      • -------- This is how i want it to LOOK --------
      • -------- But not the way the triggers should be --------
      • -------- IDK how to fix em --------
      • -------- And for some dumb reason the effect on Thundershock (Dummy) won't show --------
      • -------- Made the effects with Special Effect triggers instead- Leakfree- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (WS_Caster is alive) Equal to True
        • Then - Actions
          • Animation - Change WS_Caster flying height to 0.00 at 2000.00
          • Unit - Remove Storm Crow Form from WS_Caster
          • Unit - Unpause WS_Caster
          • Animation - Play WS_Caster's attack animation
          • Animation - Play WS_Caster's stand animation
          • -------- --------
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at (Position of WS_Caster) facing Default building facing degrees
          • Unit - Add Thundershock (Dummy) to (Last created unit)
          • Unit - Set level of Thundershock (Dummy) for (Last created unit) to (Level of Thunderstorm for WS_Caster)
          • Animation - Change (Last created unit) flying height to 0.00 at 50000.00
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
          • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
        • Else - Actions


  • Destroy Lightning
    • Events
      • Time - Lightning expires
    • Conditions
    • Actions
      • -------- --------
      • -------- There should always be a minimum of a 1 second cooldown. --------
      • -------- Therefor i don't see that it will leak, but if the cooldown is less than 1 sec it will --------
      • -------- --------
      • -------- There is a 0.70 second marginal for error --------
      • -------- --------
      • -------- Meaning the spell can be cast by multiple casters if they cast with a 0.70 seconds in between --------
      • -------- --------
      • Lightning - Destroy WS_Lightning[LightningCount]
      • Custom script: call DestroyLightning(udg_WS_Lightning[1])
      • Custom script: call DestroyLightning(udg_WS_Lightning[2])
      • Custom script: call DestroyLightning(udg_WS_Lightning[3])
      • Custom script: call DestroyLightning(udg_WS_Lightning[4])
      • Custom script: call DestroyLightning(udg_WS_Lightning[5])
      • Custom script: call DestroyLightning(udg_WS_Lightning[6])
      • Custom script: call DestroyLightning(udg_WS_Lightning[7])
      • Custom script: call DestroyLightning(udg_WS_Lightning[8])
      • Custom script: call DestroyLightning(udg_WS_Lightning[9])
      • Custom script: call DestroyLightning(udg_WS_Lightning[10])
      • Custom script: call DestroyLightning(udg_WS_Lightning[11])
      • Custom script: call DestroyLightning(udg_WS_Lightning[12])
      • Custom script: call DestroyLightning(udg_WS_Lightning[13])
      • Custom script: call DestroyLightning(udg_WS_Lightning[14])
      • Custom script: call DestroyLightning(udg_WS_Lightning[15])


  • Damage Ticks
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunderstorm for WS_Caster) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Normal)
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Thunderstorm for WS_Caster) Equal to 2
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 15.00 damage of attack type Spells and damage type Normal)
              • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Thunderstorm for WS_Caster) Equal to 3
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal)
                  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock ) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
                • Else - Actions



Ring of Frost:

  • Ring of Frost Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ring of Frost (Version 2)
    • Actions
      • Set WS_Caster = (Triggering unit)
      • Set WS_Owner = (Owner of WS_Caster)
      • Set RoFLvl = (Level of Ring of Frost (Version 2) for WS_Caster)
      • Set WS_Point[1] = (Target point of ability being cast)
      • Set WS_Real = 0.00
      • For each (Integer WS_Integer) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set WS_Point[2] = (WS_Point[1] offset by 300.00 towards WS_Real degrees)
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Add Ring of Frost Dummy to (Last created unit)
          • Unit - Set level of Ring of Frost Dummy for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[2]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Set WS_Real = (WS_Real + (360.00 / 15.00))
          • Custom script: call RemoveLocation(udg_WS_Point[2])
      • Set WS_Unitgroup = (Units within 450.00 of WS_Point[1] matching (((Matching unit) belongs to an enemy of WS_Owner) Equal to True))
      • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
        • Loop - Actions
          • -------- --------
          • Unit - Remove Frozen (Pause) buff from (Picked unit)
          • Unit - Remove Frostbite buff from (Picked unit)
          • -------- --------
          • Unit - Cause WS_Caster to damage (Picked unit), dealing 3.00 damage of attack type Spells and damage type Normal
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Add Freeze (Dummy) to (Last created unit)
          • Unit - Set level of Freeze (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
          • Unit - Create 1 Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Add Frostbite (Dummy) to (Last created unit)
          • Unit - Set level of Frostbite (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call DestroyGroup(udg_WS_Unitgroup)
      • Custom script: call RemoveLocation(udg_WS_Point[1])


  • Damage Ticks 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ring of Frost for WS_Caster) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Frostbite ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Ring of Frost for WS_Caster) Equal to 2
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Frostbite ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 30.00 damage of attack type Spells and damage type Normal)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Ring of Frost for WS_Caster) Equal to 3
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Frostbite ) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 40.00 damage of attack type Spells and damage type Normal)
                • Else - Actions


-: Uploaded Screenshots :-
Any leaks/improvements?
Constructive Critisism is apprechiated.


Updated:
- Firestorm is now Ring of Frost - freezes enemies within the target area and leaves them with a debuff that slows movement and deals damage over time
- Fixed leaks (mercy, i suck at finding leaks)
- Nuke removed
Updated:
- Ring of Frost now breaks upon damage and have it's duration increased by 2 seconds for each lvl, Balancing it out.
Updated
- Ring of Frost no longer make the game crash if reapplied on an already frozen target :)
- Uploaded crash-free version
 

Attachments

  • [Mana] Spellpack 1.1.w3x
    32 KB · Views: 39
  • [Mana] Spellpack 1.2.w3x
    42.1 KB · Views: 71
  • [Mana] Spellpack 1.3.w3x
    42.3 KB · Views: 57
  • [Mana] Spellpack 1.4Error.w3x
    42.7 KB · Views: 56
  • Manasurge Spellpack img3.jpg
    Manasurge Spellpack img3.jpg
    747.6 KB · Views: 84
  • Manasurge Spellpack img2.jpg
    Manasurge Spellpack img2.jpg
    763.9 KB · Views: 79
  • [Mana] Spellpack 1.5.w3x
    44.6 KB · Views: 54
  • [Mana] Spellpack 1.6.w3x
    44.6 KB · Views: 95
  • Manasurge Spellpack img4.jpg
    Manasurge Spellpack img4.jpg
    605 KB · Views: 99
  • Manasurge Spellpack img5.jpg
    Manasurge Spellpack img5.jpg
    626.5 KB · Views: 84
  • Manasurge Spellpack img6.jpg
    Manasurge Spellpack img6.jpg
    707.7 KB · Views: 75
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Use "Triggering Unit" instead of "Casting Unit".
Don't use arrays if you don't need them (referring to the arrayed location variables, 2 separate variables are more efficient).
After EVERY special effect, use the action "Special effect - Destroy (last created special effect)" (or something), otherwise it leaks.


The first spell is... weird, really. You cast a spell called "Nuke" and then you've got... I think "Burn" which decides the damage (and/or range/AoE) and "Firestorm" for the... purge duration?
Well, that's 3 spells (Nuke, Burn, Firestorm) the caster needs to succesfully cast this spell. Not that this is bad, it's just not common.

You posted the trigger "Spell Effect" twice.
That trigger also has quite some leaks.
  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
  • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
  • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
  • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
  • Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
That's 9 leaks (5 SE leaks, 4 location leaks).

The trigger after that ("Damage Ticks") leaks unit groups (pick every unit in (...)).
It's also more efficient to put the next ITE ( = If Then Else) in the else-section of the previous one
Like this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Thunderstorm for WS_Caster) Equal to 1
    • Then - Actions
      • ...
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunderstorm for WS_Caster) Equal to 2
        • Then - Actions
          • ...
        • Else - Actions
          • ... (etc)
This is because if the level of the ability is 1, the level can't be 2 or higher.
If you put them underneath eachother (like you did), the trigger will STILL check whether the level is 2 or higher, even though it can't possibly be true.


"Damage Ticks 2" has the same problem as "Damage Ticks" (unit group leaks and ITE combining).
These two triggers should also be turned off when there are no units with that buff (otherwise it will keep running every second while it's not needed, might stress the game if too many periodic triggers are running).


That's all I could find.
Good luck!
 
Level 7
Joined
Apr 12, 2011
Messages
124
@ Ap0calypse

ty for the constructive critisism, will look into the triggers as soon as i can.

and for the

Special Effect - Create a special effect at (Position of WS_Caster) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl

Thought it wouldn't matter since it plays its own deathanimation aswell. But i said earlier im completely new so i didn't understand what "leaked" with that.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Note that "playing the death animation" doesn't mean that it actually gets removed.
Even though you can't see it anymore, the special effect is still there (sort of like when units die, they leave a corpse - the corpse of most special effects is invisible, so you can't see them, yet they're there).

The difference with units is that they get removed after death (I believe standard is 88 seconds after death), special effects don't have such an "auto-remove" feature.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
I should mention that the ORDER for the dummy for casting custom spells is like this...coz if that caster is an AI, then it wont cast properly...

  • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
  • Unit - Add Burn to (Last created unit)
  • Unit - Set level of Burn for (Last created unit) to (Level of Firestorm for WS_Caster)
  • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
always put "(Level of Firestorm for WS_Caster)" into a variable...

this leaks as well...you should put the WS_Point[1] in the loop...

  • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
for others I did not look coz seems to me they are the same...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I should mention that the ORDER for the dummy for casting custom spells is like this...coz if that caster is an AI, then it wont cast properly...

  • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
  • Unit - Add Burn to (Last created unit)
  • Unit - Set level of Burn for (Last created unit) to (Level of Firestorm for WS_Caster)
  • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
always put "(Level of Firestorm for WS_Caster)" into a variable...

this leaks as well...you should put the WS_Point[1] in the loop...

  • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
for others I did not look coz seems to me they are the same...
I don't mean to bash you, but:
  • You don't HAVE to set the level of the ability in a variable (t does improve the trigger if you use it a lot though. So in this loop it would be correct, but certainly not 'always').
  • It doesn't leak, in fact: I recommend NOT to set the location inside the loop (it's far more efficient if you set the location outside the loop and then use it, as he did).
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
You don't HAVE to set the level of the ability in a variable (t does improve the trigger if you use it a lot though. So in this loop it would be correct, but certainly not 'always').

its a practice, since in the future he 'may' use indexing or hashtables, saves level first, then load it in another trigger loop...

It doesn't leak, in fact: I recommend NOT to set the location inside the loop (it's far more efficient if you set the location outside the loop and then use it, as he did).

I based my suggestion on this...

http://www.thehelper.net/forums/showthread.php/27219-Triggers-Memory-Leaks-and-Custom-Scripts

suggested by: emjlr3

and one tutorial in the Hive, I forgot where it is...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
What he (emjlr3) said there:
  • Actions
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Set Temp_Point = (Center of (Playable map area))
        • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Undead\UnholyAura\UnholyAura.mdl
        • Special Effect - destroy (Last created special effect)
        • Custom script: call RemoveLocation (udg_Temp_Point)
Isn't good.
It works (means he removes all leaks), but it isn't as efficient as it could be.


This would be better:
  • Actions
    • Set Temp_Point = (Center of (Playable map area))
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Undead\UnholyAura\UnholyAura.mdl
        • Special Effect - destroy (Last created special effect)
    • Custom script: call RemoveLocation (udg_Temp_Point)
The reason is simple: in the first trigger, he sets and removes the same location 10 times.
In the second trigger, you only set and remove it once, which saves some useless actions.
You can keep using the same location variable without creating any leaks, so yeah... leave them as they are: outside the loop (only set/remove them inside the loop if the location changes).
 
Level 7
Joined
Apr 12, 2011
Messages
124
Thanks for all feedback, really want to make this efficient as my first spell.

Working on fixing leaks, got an idea for the special effects by making a unit with the effect i want as model file and then creating him and giving him a timed life.

^^)b
 
Level 7
Joined
Apr 12, 2011
Messages
124
Latest build of my Ring of Frost spell:

  • Spell Effect 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ring of Frost (Version 2)
    • Actions
      • Set WS_Caster = (Triggering unit)
      • Set RoFLvl = (Level of Ring of Frost (Version 2) for WS_Caster)
      • Set WS_Point[1] = (Target point of ability being cast)
      • Set WS_Real = 0.00
      • For each (Integer WS_Integer) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set WS_Point[2] = (WS_Point[1] offset by 300.00 towards WS_Real degrees)
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Ring of Frost Dummy to (Last created unit)
          • Unit - Set level of Ring of Frost Dummy for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[2]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Set WS_Real = (WS_Real + (360.00 / 15.00))
          • Custom script: call RemoveLocation(udg_WS_Point[2])
      • Set WS_Unitgroup = (Units within 400.00 of WS_Point[1] matching (((Matching unit) belongs to an enemy of (Owner of WS_Caster)) Equal to True))
      • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
        • Loop - Actions
          • Unit - Cause WS_Caster to damage (Picked unit), dealing 3.00 damage of attack type Spells and damage type Normal
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Freeze (Dummy) to (Last created unit)
          • Unit - Set level of Freeze (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Frostbite (Dummy) to (Last created unit)
          • Unit - Set level of Frostbite (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call DestroyGroup(udg_WS_Unitgroup)
      • Custom script: call RemoveLocation(udg_WS_Point[1])


  • Dispel upon Damage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Damage taken) Greater than 0.00
          • ((Attacked unit) has buff Frozen (Pause)) Equal to True
    • Actions
      • Unit - Remove Frozen (Pause) buff from (Attacked unit)


It Crashes and i can't seem to find the reason, Stun is Storm Bolt remade for dummy, cast is Flame strike, Debuff is Cripple remade.
Anyone know what might cause this to crash?

It only seem to crash when it hits a target affected by the freeze (pause) debuff, it's spammable unless it affects a target which makes no sense to me. Need help badly :'(
 
On your damage trigger, (Damage taken) Greater than 0.00 would malfunction since the event is Unit - A unit is attacked, this event is fired while the unit is just starting to attack, so Damage Taken would always be 0 (or might even cause a crash)...

Rather than using a point array, just use two different variables... its faster...
 
Level 7
Joined
Apr 12, 2011
Messages
124
@ Adiktuz

Thanks for the info on the damage taken condition, but it's not that that makes it crash, i disabled that trigger and it would still crash.

This is giving me a headache i really can't seem to figure it out.

I got a feeling it's in my usage of my RoFLvl integer since it didn't crash before i had them. :p
  • Set RoFLvl = (Level of Ring of Frost (Version 2) for WS_Caster)
  • Unit - Set level of Ring of Frost Dummy for (Last created unit) to RoFLvl
 
Last edited:
Yeah, I'm pretty much sure its not the one, just pointed it out...

Some more:
-You don't need to set WS_real to 0.00 at the top...
-Set the owner of triggering unit to a player variable, and use that...

anyway, I don't see anything that could cause a crash... You could try disabling some actions until you make it work...
 
Level 7
Joined
Apr 12, 2011
Messages
124
Found the solution to the problem

  • Spell Effect 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ring of Frost (Version 2)
    • Actions
      • Set WS_Caster = (Triggering unit)
      • Set RoFLvl = (Level of Ring of Frost (Version 2) for WS_Caster)
      • Set WS_Point[1] = (Target point of ability being cast)
      • Set WS_Real = 0.00
      • For each (Integer WS_Integer) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set WS_Point[2] = (WS_Point[1] offset by 300.00 towards WS_Real degrees)
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Ring of Frost Dummy to (Last created unit)
          • Unit - Set level of Ring of Frost Dummy for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[2]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Set WS_Real = (WS_Real + (360.00 / 15.00))
          • Custom script: call RemoveLocation(udg_WS_Point[2])
      • Set WS_Unitgroup = (Units within 400.00 of WS_Point[1] matching (((Matching unit) belongs to an enemy of (Owner of WS_Caster)) Equal to True))
      • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
        • Loop - Actions
          • Unit - Remove Frozen (Pause) buff from (Picked unit)
          • Unit - Remove Frostbite buff from (Picked unit)
          • Unit - Cause WS_Caster to damage (Picked unit), dealing 3.00 damage of attack type Spells and damage type Normal
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Freeze (Dummy) to (Last created unit)
          • Unit - Set level of Freeze (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- --------
          • Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
          • Unit - Add Frostbite (Dummy) to (Last created unit)
          • Unit - Set level of Frostbite (Dummy) for (Last created unit) to RoFLvl
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call DestroyGroup(udg_WS_Unitgroup)
      • Custom script: call RemoveLocation(udg_WS_Point[1])


added this, its my conclusion that the buffs attempting to stack(?) is indeed bugged with in the game engine.
  • Unit - Remove Frozen (Pause) buff from (Picked unit)
  • Unit - Remove Frostbite buff from (Picked unit)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I can't see it either.

I guess it is time for you to learn how to debug your triggers ^^ (an extremely useful thing to know).

Insert a small wait before everything that might crash (e.g.: before the loop, before it sets the unit group, before it picks the unit greoup, before it creates the first/second dummy etc).
Then put a game message before that wait, like "Creating first dummy", or "Picking units in group".

From the moment it crashes, you have a general image of where it goes wrong.
And then you can continue (e.g.: if it crashes when "Creating first dummy", then you can add waits and messages before it adds the spell, before it sets the level, etc).
Now you can accurately pin-point the problem.


Note: Using waits to debug is (usually) only when it crashes the game. When debugging because it doesn't do what you want, just putting game messages with all values (e.g.: "Damage: [damage variable]") is the best thing to do.

Seriously, debugging correctly can save everyone a lot of time.


Edit: I see you found the solution already :D
Oh well, I believe this will still be useful next time anything goes wrong.
 
Level 7
Joined
Apr 12, 2011
Messages
124
Yeah, I'm pretty much sure its not the one, just pointed it out...

Some more:
-You don't need to set WS_real to 0.00 at the top...
-Set the owner of triggering unit to a player variable, and use that...

anyway, I don't see anything that could cause a crash... You could try disabling some actions until you make it work...

Fixed :) i noticed that reals is automatically set to 0.00 but i forgot to change it after i learned
 
Level 7
Joined
Apr 12, 2011
Messages
124
I can't see it either.

I guess it is time for you to learn how to debug your triggers ^^ (an extremely useful thing to know).

Insert a small wait before everything that might crash (e.g.: before the loop, before it sets the unit group, before it picks the unit greoup, before it creates the first/second dummy etc).
Then put a game message before that wait, like "Creating first dummy", or "Picking units in group".

From the moment it crashes, you have a general image of where it goes wrong.
And then you can continue (e.g.: if it crashes when "Creating first dummy", then you can add waits and messages before it adds the spell, before it sets the level, etc).
Now you can accurately pin-point the problem.


Note: Using waits to debug is (usually) only when it crashes the game. When debugging because it doesn't do what you want, just putting game messages with all values (e.g.: "Damage: [damage variable]") is the best thing to do.

Seriously, debugging correctly can save everyone a lot of time.


Edit: I see you found the solution already :D
Oh well, I believe this will still be useful next time anything goes wrong.

That does sound extremely useful, tyvm :D never again shall i be bothered by unsolveable mysteries +rep
 
Status
Not open for further replies.
Top