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

[Trigger] Need Help 4 Removing Some Leaks

Status
Not open for further replies.
Level 4
Joined
Jun 16, 2010
Messages
48
I Will Glad If Some One Can Spend His/Her Time 4 Me !
Look Guys I Have 2 leaks part , But when i remove them as usual it make a bug to my spell.

Look I Have A Posision Leak And A Group Leaks But I Cant Delete Them Normally.
  • AbilCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to HolySaliiiib
    • Actions
      • Set salib_pos = (Target point of ability being cast)
      • Set Unit_DoroVar = (Units within 700.00 of salib_pos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
      • Unit - Create 1 SalibDummy for (Owner of (Triggering unit)) at salib_pos facing Default building facing degrees
      • Animation - Change (Last created unit)'s size to (150.00%, 150.00%, 150.00%) of its original size
      • Unit - Add a 3.50 second Generic expiration timer to (Last created unit)
      • Special Effect - Create a special effect at salib_pos using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in Unit_DoroVar and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at salib_pos facing Default building facing degrees
          • Unit - Add Death Grip to (Last created unit)
          • Unit - Set level of Death Grip for (Last created unit) to 1
          • Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
          • Unit - Add a 3.50 second Generic expiration timer to (Last created unit)
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Grip
    • Actions
      • Set Position = (Position of (Triggering unit))
      • Set Position2 = (Position of (Target unit of ability being cast))
      • Set Angle = ((Angle from Position to Position2) + 180.00)
      • Set Distance = 10.00
      • Set RemainingTime = ((Distance between Position and Position2) - 100.00)
      • Set Caster = (Triggering unit)
      • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target) of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Distance as (Key distance) of (Key (Target unit of ability being cast)) in Hashtable
      • Hashtable - Save RemainingTime as (Key time) of (Key (Target unit of ability being cast)) in Hashtable
      • Hashtable - Save Angle as (Key angle) of (Key (Target unit of ability being cast)) in Hashtable
      • Hashtable - Save Handle OfCaster as (Key caster) of (Key (Target unit of ability being cast)) in Hashtable
      • Unit Group - Add (Target unit of ability being cast) to UnitGroup
      • Unit - Turn collision for (Target unit of ability being cast) Off
      • Custom script: call RemoveLocation(udg_Position)
      • Custom script: call RemoveLocation(udg_Position2)
      • Trigger - Turn on Loop <gen>
  • Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in UnitGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • Set Distance = (Load (Key distance) of (Key (Picked unit)) from Hashtable)
              • Set Angle = (Load (Key angle) of (Key (Picked unit)) from Hashtable)
              • Set RemainingTime = (Load (Key time) of (Key (Picked unit)) from Hashtable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RemainingTime Greater than 0.00
                • Then - Actions
                  • Set Position = (Position of (Picked unit))
                  • Set Position2 = (Position offset by (Load (Key distance) of (Key (Picked unit)) from Hashtable) towards (Load (Key angle) of (Key (Picked unit)) from Hashtable) degrees)
                  • Unit - Move (Picked unit) instantly to Position2
                  • Hashtable - Save (RemainingTime - 10.00) as (Key time) of (Key (Picked unit)) in Hashtable
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\HealingSpray\HealBottleMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_Position)
                  • Custom script: call RemoveLocation(udg_Position2)
                • Else - Actions
                  • Unit - Turn collision for (Picked unit) On
                  • Unit - Pause (Load (Key caster) of (Key (Picked unit)) in Hashtable)
                  • Unit - Unpause (Load (Key caster) of (Key (Picked unit)) in Hashtable)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
                  • Unit Group - Remove (Picked unit) from UnitGroup
        • Else - Actions
          • Trigger - Turn off (This trigger)

I Should Add if you see any thing that make my spell to not be Mui pls help me fix it
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
for Unit_doroVar you can try doing
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 700.00 of salib_pos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
This will create its own unit group and after its done with it it automatically destroys it.

or you can add
  • Custom script: call DestroyGroup(udg_Unit_DoroVar)
and you should add
  • Custom script: call RemoveLocation(udg_salib_pos)
at the end of the holy saliiiib trigger as you do not use this location anywhere else

Hope it helps a little bit
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
well seeing code and saying what causes bugs when removing leaks is harder then having the map and testing it and I read it but misunderstand
Also saying it make a bug is not really enough, it's good to know at least whan happens when you remove leaks
 
Level 11
Joined
Aug 6, 2009
Messages
697
There are a couple things wrong that don't make this MUI as far as I can see it.

  • Unit - Pause (Load (Key caster) of (Key (Picked unit)) in Hashtable)
    • Unit - Unpause (Load (Key caster) of (Key (Picked unit)) in Hashtable)
First, there is no point in this if you are just going to Unpause right after.

  • Trigger - Turn on Loop <gen>
Second, in your second trigger you're using the Hashtable system so you need to turn the Loop so it should always be on. Also in your third trigger, remove the "trigger off" function.


Thirdly, remove this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Number of units in UnitGroup) Greater than 0
and put
  • Unit Group - Pick every unit in UnitGroup and do (Actions)
this on top.

Fourth, I learned that you don't need variables for saving hashtables, you can just save them as numbers like
  • Hashtable - Save Handle OfUnit as 0 of ID in SpellHash
  • Unit - Pause (Load 0 of ID in SpellHash)
Also,
  • Hashtable - Save (RemainingTime - 10.00) as (Key time) of (Key (Picked unit)) in Hashtable
if this spell is supposed to last 4 seconds, make the remaining time - 1.
 
Level 4
Joined
Jun 16, 2010
Messages
48
Thanks Dear At Last Some One Helps , For The First Part I Should Say I Copy it From Another Spell That was Mui and aproved.for the second part on turned it on at last line .
and can you explain me why i should remove turn off trigger ? and for the unit group yes your right they are both same . thank you dear thanks , but can you tell me how can i remove dose leaks in the first trigger . they will bug if i remove them as normal.
 
Level 11
Joined
Aug 6, 2009
Messages
697
can you tell me how can i remove dose leaks in the first trigger
I'm not that great with leaks but I am pretty sure you got most of them, you don't need to bj_wantdestroygroup or whatever it was because the group will be removed thus making the spell broken.

and can you explain me why i should remove turn off trigger ?

If you turn off the trigger it will no longer work after the first use and make it non-MUI.
 
Status
Not open for further replies.
Top