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

Leak Fix

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Creating a spell. Special effect leaks and I don't know how to fix it. If I put destroy special effect after creating it, it won't work. Fast help needed. The one who can help me, will have a reputation point.

Here is the trigger:

  • Glacial Orb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glacial Orb
    • Actions
      • Set TempLoc = ((Position of (Casting unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees)
      • Set TempLoc2 = ((Target point of ability being cast) offset by 1000.00 towards (Facing of (Casting unit)) degrees)
      • Unit - Create 1 Glacial Orb Dummy 1 for (Owner of (Casting unit)) at TempLoc facing Default building facing degrees
      • Set Glacial_Orb_Unit = (Last created unit)
      • Unit - Order (Last created unit) to Move To TempLoc2
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • For each (Integer Glacial_Orb_Integer_1) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set TempLoc3 = (Position of Glacial_Orb_Unit)
          • Set TempGroup2 = (Units owned by Neutral Hostile)
          • Set TempGroup = (Units within 250.00 of TempLoc3 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Shiva'sWrath.mdx
          • Custom script: call DestroyGroup(udg_TempGroup2)
          • Custom script: call DestroyGroup(udg_TempGroup)
          • Custom script: call RemoveLocation(udg_TempLoc3)
          • Wait 1.00 seconds
 
Level 13
Joined
Jul 3, 2008
Messages
1,098
Creating a spell. Special effect leaks and I don't know how to fix it. If I put destroy special effect after creating it, it won't work. Fast help needed. The one who can help me, will have a reputation point.

Here is the trigger:

  • Glacial Orb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Glacial Orb
    • Actions
      • Set TempLoc = ((Position of (Casting unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees)
      • Set TempLoc2 = ((Target point of ability being cast) offset by 1000.00 towards (Facing of (Casting unit)) degrees)
      • Unit - Create 1 Glacial Orb Dummy 1 for (Owner of (Casting unit)) at TempLoc facing Default building facing degrees
      • Set Glacial_Orb_Unit = (Last created unit)
      • Unit - Order (Last created unit) to Move To TempLoc2
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • For each (Integer Glacial_Orb_Integer_1) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set TempLoc3 = (Position of Glacial_Orb_Unit)
          • Set TempGroup2 = (Units owned by Neutral Hostile)
          • Set TempGroup = (Units within 250.00 of TempLoc3 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Shiva'sWrath.mdxadd to this
  • [COLOR="Red"]set variable specialeffect=last created special effect[/COLOR]
    • Custom script: call DestroyGroup(udg_TempGroup2)
    • Custom script: call DestroyGroup(udg_TempGroup)
    • Custom script: call RemoveLocation(udg_TempLoc3)
    • Wait 1.00 seconds[COLOR="Red"]<---remove this[/COLOR]
    • [COLOR="Red"]trigger-turn on trigger 2[/COLOR]

trigger 2
event:
elapsed time equal to 1 sec
action:
destroy specialeffect

turn off this trigger

trigger 2 is defaultly turned off

there are some difference in main trigger so chec it
 
Level 17
Joined
Aug 20, 2007
Messages
1,122
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of hero[1] using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
          • Set specialeffectrenamable[(Integer A)] = (Last created special effect)
          • Wait 1.00 seconds
          • Special Effect - Destroy specialeffectrenamable[(Integer A)]
Try this....

I made a special effect, and after that, I set a variable 1,2,3,4,5 into that last created special effect 1,2,3,4,5 and wait for one second, and all of those leaks will be gone in 1,2,3,4,5.

Need help? Wow, you've posted and repped alot, yet you don't know that much of triggering, I think...

BTW, if your aiming unit's origin, instead of point cause you think it will lag, MAYBE its because its a

  • Special Effect - Create a special effect attached to the origin of hero[1] using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
instead of

  • Special Effect - Create a special effect at (Position of hero[1]) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
with leaks removed, may be the reason why it is immediately removed after you use the remove special effect trigger...
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Bah, I tried to do what you tried to tell me, but I failed. It's just easier if someone(or perhaps you?) could take this map that I attach to the post and just fix the problem.

Vicboy said:
Need help? Wow, you've posted and repped alot, yet you don't know that much of triggering, I think...
It does not matter how much I have posted or how much my rep is. They don't mean how good I'm with making maps. And if you want to know, I'm bad with "advanced triggers".
 

Attachments

  • new spells.w3x
    45 KB · Views: 74
Level 17
Joined
Aug 20, 2007
Messages
1,122
I hope it's now fixed and no more leaks! :p

Gawd, you worry too much about leaks...

Anyway, once the VARIABLE is set with a value, your computer will have to hold on to that info until you either replace the value with a new one or remove it... (Take note: Its even worst without a variable, because the computer will hold on to it for a loooooong time)
 
Level 17
Joined
Aug 20, 2007
Messages
1,122
Just so you know, I did that sentence above to train myself in grammar because I am gonna do my english essay soon enough (No, my native language ain't english)

AND WARNING

Mixing WAITS and VARIABLES is really a bad combination.

If you do this spell twice like if you have another hero with this, the spell might get screwed up when casted twice...

Maybe a 0.01 wait, or no wait at all...

Try removing the wait and see if it still works...
 
Level 17
Joined
Aug 20, 2007
Messages
1,122
Really? Well, spells I made are for a campaign have some waits. Am I doing wrong? Why they should not have waits? X_x

You can't do these spells many at the same time.

So your working this on a single player campaign? Not a multiplayer?

If its just single player, just make the cooldown long enough that the waits are finished and the trigger is finished...

If its multiplayer, then maybe, yes, they might use the spells at the same time, accidentally or intentionally which will, I'm guessing, cancel out the first caster and just continue with the second caster...
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Vicboy said:
So your working this on a single player campaign? Not a multiplayer?
Yeah, this is a 11 chapter long campaign with over 500 items and over 200 cinematics, etc, etc. Been working almost year now.

Vicboy said:
If its just single player, just make the cooldown long enough that the waits are finished and the trigger is finished...
Yeah! That's what I'm talking about.


Vicboy said:
If its multiplayer, then maybe, yes, they might use the spells at the same time, accidentally or intentionally which will, I'm guessing, cancel out the first caster and just continue with the second caster...
No problem at all! This is not a campaign like I mentioned before.
 
Status
Not open for further replies.
Top