• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Memory Leak Problem

Status
Not open for further replies.
Level 6
Joined
Aug 19, 2007
Messages
109
Greetings all! I am currently working on an ability in which an archer forms ghost-forms of itself while casting shockwave on a pivot point. It works completely, however the Temp_Point i create has certain issues:

When i use Custom Script: call RemoveLocation (udg_Temp_Point)
Custom Script: call RemoveLocation (udg_Temp_Point2)
and Custom Script: call RemoveLocation (udg_Temp_Point3)
just before the first 'wait game-time seconds' in one loop of the integer A
Then, the trigger does not function as it should.

On the NEXT and consecutive loops (There are 5 in total), the Temp_Point2 becomes the default 'centre of entire map'. (But Temp_Point stays on the casting unit variable).

I don't understand though...does the custom script remove the variable altogether? because the temp_Point2 only works when i DONT have the custom script. :(

Does that mean i MUST have a memory leak (15 times) every time i cast that spell?
Here is the Map: Please help!
 

Attachments

  • Strafing Arrows.w3x
    27.2 KB · Views: 48
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Spell121 Copy
    • Events
    • Conditions
    • Actions
      • Set Temp_Point = Strafing_Run_Pivot_Point[1]
      • Unit - Create 1 Target(Strafing Run) for Player 1 (Red) at Temp_Point facing Default building facing degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of Strafing_Run_Casting_Unit[1])
          • Set Temp_Point2 = Strafing_Run_Pivot_Point[1]
          • Set Temp_Point3 = (Temp_Point offset by 400.00 towards (Angle from Temp_Point to Temp_Point2) degrees)
          • Unit - Create 1 Ghostly Archer for (Owner of Strafing_Run_Casting_Unit[1]) at Temp_Point facing Temp_Point2
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
          • Unit - Add Strafing Run (Damage) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave Temp_Point3
          • Set Temp_Archer_Unit[1] = (Last created unit)
          • Wait 0.50 game-time seconds
          • Unit - Pause Temp_Archer_Unit[1]
          • Wait 1.50 game-time seconds
          • Unit - Unpause Temp_Archer_Unit[1]
          • Unit - Remove Temp_Archer_Unit[1] from the game
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Custom script: call RemoveLocation(udg_Temp_Point2)
          • Custom script: call RemoveLocation(udg_Temp_Point3)
Except make those point variables arrays, and use Temp_Point[Player number].
 
Level 6
Joined
Aug 19, 2007
Messages
109
Maker: Nope it still doesnt work, I tried it. (I will put in arrays in the actual map...ty for pointing that out).
  • Actions
    • Set Temp_Point = Strafing_Run_Pivot_Point[1]
    • Unit - Create 1 Target(Strafing Run) for Player 1 (Red) at Temp_Point facing Default building facing degrees
    • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Temp_Point)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Set Temp_Point = (Position of Strafing_Run_Casting_Unit[1])
        • Set Temp_Point2 = Strafing_Run_Pivot_Point[1]
        • Set Temp_Point3 = (Temp_Point offset by 400.00 towards (Angle from Temp_Point to Temp_Point2) degrees)
        • Unit - Create 1 Ghostly Archer for (Owner of Strafing_Run_Casting_Unit[1]) at Temp_Point facing Temp_Point2
        • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
        • Unit - Add Strafing Run (Damage) to (Last created unit)
        • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave Temp_Point3
        • Set Temp_Archer_Unit[1] = (Last created unit)
        • Wait 0.50 game-time seconds
        • Unit - Pause Temp_Archer_Unit[1]
        • Wait 1.50 game-time seconds
        • Unit - Unpause Temp_Archer_Unit[1]
        • Unit - Remove Temp_Archer_Unit[1] from the game
        • Custom script: call RemoveLocation (udg_Temp_Point)
        • Custom script: call RemoveLocation (udg_Temp_Point2)
        • Custom script: call RemoveLocation (udg_Temp_Point3)
This... right? Yea i tried this...Didnt work :( the Temp_Point2 still becomes Centre of Entire map (The Default) for some reason.

Perhaps theres another way of doing the entire ability for it to work without memory leaks? which you could help me with eh please?

Thanks for trying though.
 
Level 6
Joined
Aug 19, 2007
Messages
109
Nope...thats the only trigger using it, download the map and add the custom scrips...and you will see it doesnt work. I dont understand it :(

Hmm...here are the differences between the one without the custom scripts and the ones WITH the custom scripts:
-Temp_Point2 is changed to default (Centre of entire map)
-Therefore Temp_Point3 is as well...as it depends on Temp_Point2
-However Temp_Point stays as the position of the casting unit...and therefore so does "Strafing_Run_Casting_Unit[1]"-equal to the casting unit.
-Also: "Strafing_Run_Pivot_Point[1]" changes...to default point after being Removed by custom script.

Perhaps the custom script actually removes the variable itself? and the Position of "Strafing_Run_Casting_Unit[1]" is still O.K. because it uses a unit as the point...whereas the other variable just sets a point depending on the global variable...of the casting point...

If that is the case...then I must create a dummy unit at the pivot point (Which cannot be seen) and use THAT as my pivot point...but thats stupid then...the trigger gets so complicated.

If anybody can think of another way to create the same effect i would like to hear it plz. :( A very annoying spell this is. Good guess though.

Edit:Ok here is the map after using a Dummy Unit as a the Pivot Point (Place holder) kinda thing...The ability works...with the custom scripts, but I was wondering:
A: Is there a better way to do this ability?
B: How come the point variable gets removed after you call the custom script...so that the point moves to centre of playable map area.
C: Are there now any memory leaks in this NEW Version? (Point ones)
 

Attachments

  • Strafing Arrows.w3x
    27.7 KB · Views: 44
Last edited:
Status
Not open for further replies.
Top