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

Removing leaks in Lua

Status
Not open for further replies.
Do you have another location variable named udg_PointVariable? In that case, just change it back to RemoveLocation(udg_Point). In case that still doesn't work, enclose the call within an xpcall function, which will help you determine if and what errors are occurring when using said function. The xpcall line should look like this: xpcall(RemoveLocation, print, udg_Point)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,579
Creating and removing a global variable:
  • Set Variable TempPoint = (Center of map)
  • Custom script: RemoveLocation(udg_TempPoint)

Creating and removing a local variable:
  • Custom script: local TempPoint = Location(0, 0)
  • Custom script: RemoveLocation(TempPoint)

udg_ is a prefix that tells the code you're talking about a global variable.

Some useful links:
 
Last edited:
Level 11
Joined
Apr 27, 2009
Messages
202
Thank you both for helping out.

I'll be more precise.
I made a Global Variable and then this triggers:

  • Set VariableSet Cinematic1WalkDemon = Cinematic1DemonMoveTo1 <gen>
  • Unit - Order Demon Hunter 0032 <gen> to Move To (Center of Cinematic1WalkDemon)
  • Wait 9.00 seconds
  • Custom script: RemoveLocation(udg_Cinematic1WalkDemon)

Ignores all triggers beneath:
  • Custom script: RemoveLocation(udg_Cinematic1WalkDemon)


Do you have another location variable named udg_PointVariable? In that case, just change it back to RemoveLocation(udg_Point). In case that still doesn't work, enclose the call within an xpcall function, which will help you determine if and what errors are occurring when using said function. The xpcall line should look like this: xpcall(RemoveLocation, print, udg_Point)

When I use
  • Custom script: xpcall(RemoveLocation, print, udg_Cinematic1WalkDemon)
I get:

screenshot_9-png.395679


I think I resolved the Issue by changing the Variable from Region to Point. I'll check back later.
Ye this solved the issue.
 

Attachments

  • Screenshot_9.png
    Screenshot_9.png
    1.1 MB · Views: 84
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,579
Yeah, Regions are not Points (locations). Your trigger should look like this:
  • Set Variable SomePoint = Center of Cinematic1WalkDemon <gen>
  • Unit - Order Demon Hunter 0032 <gen> to Move To SomePoint
  • Wait 9.00 seconds
  • Custom script: RemoveLocation(udg_SomePoint)

Your preplaced Regions can remain active throughout the entire game, you don't have to worry about removing or cleaning them up.
 
Status
Not open for further replies.
Top