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

Cleanup!

Status
Not open for further replies.
Level 4
Joined
Dec 30, 2008
Messages
41
I would like to clean this spell up make it less triggers etc, I would like some advice on what 2 do or even better an example :) please and thank you! When it is finished i will make sure i post it on the spells section because it really is cool.

  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ice barrage
    • Actions
      • Set Caster = (Casting unit)
      • Set pointofcasted = (Target point of ability being cast)
      • Unit - Create 1 Dummy for (Owner of Caster) at pointofcasted facing Default building facing degrees
      • Set dummy = (Last created unit)
      • Trigger - Turn on Loopattempt <gen>
      • Sound - Play war3mapImported\The wonderful sound of ice barrage.mp3
      • Wait 1.40 seconds
      • Unit - Order dummy to Orc Tauren Chieftain - War Stomp
      • Wait 2.00 seconds
      • Trigger - Turn off Loopattempt <gen>
      • Unit - Remove dummy from the game
      • Set Count2stp = 0
      • Set degrees = 0.00


  • Loopattempt
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • Count2stp Not equal to 39
    • Actions
      • Unit - Order dummy to Orc Tauren Chieftain - Shockwave (pointofcasted offset by 300.00 towards degrees degrees)
      • Set degrees = (degrees + 10.00)
      • Set Count2stp = (Count2stp + 1)


  • effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FREEZE! (Neutral Hostile 1)
    • Actions
      • Set unitgroup = (Units in (Region centered at pointofcasted with size (1200.00, 1200.00)) matching ((((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Set inta = 0
      • Unit Group - Pick every unit in unitgroup and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
          • Set inta = (inta + 1)
          • Set Specialeffect[inta] = (Last created special effect)
      • Wait 3.00 seconds
      • For each (Integer A) from 1 to inta, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy Specialeffect[(Integer A)]


Im also aware the hive does not like long posts like this and like it to be put in that contained box..but idk how to do it lol sorry =\
 
Level 9
Joined
Oct 11, 2009
Messages
477
Put a 'Custom script' action at the end of the first trigger containing "call RemoveLocation(udg_pointofcasted)". Without the quotation marks.

In the third trigger, check my changes on your trigger. It is now clean:

  • effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FREEZE! (Neutral Hostile 1)
    • Actions
      • Set region = (Region centered at pointofcasted with size (1200.00, 1200.00))
      • Set unitgroup = (Units in (region) matching ((((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Custom script: call RemoveRect(udg_region)
      • Set inta = 0
      • Unit Group - Pick every unit in unitgroup and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
      • Custom script: call DestroyGroup(udg_unitgroup)
      • Set inta = (inta + 1)
      • Set Specialeffect[inta] = (Last created special effect)
      • Wait 3.00 seconds
      • For each (Integer A) from 1 to inta, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy Specialeffect[(Integer A)]
Noticed that there is a new variable? You must create a new region type variable as region(s) leaks when created through triggers. And find a way to link your point variable from the first trigger to the third trigger as it leaks even if you clean it on the first trigger.

@ChoovakPetri83: The loop 'For each (Integer A) from 1 to inta, do (Actions)' cannot be deleted since the loop cleans all created special effects. By the way don't assume for reputation as you are breaking the rules of the hive on reputation award distribution. Anyway here's a reputation for your effort.
 
Last edited:
Level 4
Joined
Dec 30, 2008
Messages
41
To seph, thanks very much that helped alot...i put it together kinda slopply. But the main thing im concered about is the waits. I take it there is no way to put this spell into one or 2 triggers, as well as remove the waits. I cannot use hashtables im aweful with them. lol. The spell is really cool and a great idea i just have a feeling it would be rejected on the site.
 
Level 9
Joined
Oct 11, 2009
Messages
477
Yeah, most non-MUI spells are sometimes rejected when you submit them. Try to learn hashtables, the tutorial(s) are available in the hive. Try to search for them. My Warcraft III on my PC got recently removed so I may not construct a test-map for it without waits but I cheer you up, removing the waits on your cool spell is possible.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
I would like to clean this spell up make it less triggers etc, I would like some advice on what 2 do or even better an example :) please and thank you! When it is finished i will make sure i post it on the spells section because it really is cool.

  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ice barrage
    • Actions
      • Set Caster = (Casting unit)
      • Set pointofcasted = (Target point of ability being cast)
      • Unit - Create 1 Dummy for (Owner of Caster) at pointofcasted facing Default building facing degrees
      • Set dummy = (Last created unit)
      • Trigger - Turn on Loopattempt <gen>
      • Sound - Play war3mapImported\The wonderful sound of ice barrage.mp3
      • Wait 1.40 seconds
      • Unit - Order dummy to Orc Tauren Chieftain - War Stomp
      • Wait 2.00 seconds
      • Trigger - Turn off Loopattempt <gen>
      • Unit - Remove dummy from the game
      • Set Count2stp = 0
      • Set degrees = 0.00
Comments
- Try change the (Casting unit) to (Triggering unit), it performs better, just use that
- Avoid the usage of Waits, it can cause bugs and stuffs, just be straightforward for your spell
- For removing the dummy out of the game, just use this:
  • Unit - Add a 2.00 second Generic expiration timer to dummy
Well, we can always look at the situation, this can be used if your dummy is not part of the spell from Special Effect or something
Because removing a unit, will look cooler than killing the unit
If your dummy is unseenable, just use this trigger, it saves, big time, rather than to use Waits to kill the dummy, it will bug

  • Loopattempt
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • Count2stp Not equal to 39
    • Actions
      • Unit - Order dummy to Orc Tauren Chieftain - Shockwave (pointofcasted offset by 300.00 towards degrees degrees)
      • Set degrees = (degrees + 10.00)
      • Set Count2stp = (Count2stp + 1)
Comments
Well, nothing much to say
Nice use of 0.03 per second trigger, instead of 0.01 (causes lags and freezes)

  • effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FREEZE! (Neutral Hostile 1)
    • Actions
      • Set unitgroup = (Units in (Region centered at pointofcasted with size (1200.00, 1200.00)) matching ((((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Set inta = 0
      • Unit Group - Pick every unit in unitgroup and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
          • Set inta = (inta + 1)
          • Set Specialeffect[inta] = (Last created special effect)
      • Wait 3.00 seconds
      • For each (Integer A) from 1 to inta, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy Specialeffect[(Integer A)]
Comments
- Your Unit Group action, leaks
This:
  • Unit Group - Pick every unit in unitgroup and do (Actions)
You should add this Custom Script action at the most below of the trigger:
  • Custom script: call DestroyGroup(udg_*Variable*)
The *Variable* is the "unitgroup", therefore:
  • Custom script: call DestroyGroup(udg_unitgroup)

Im also aware the hive does not like long posts like this and like it to be put in that contained box..but idk how to do it lol sorry =\

I've commented in your quotes, check `em out ^_^
 
Status
Not open for further replies.
Top