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

Did create items at position leak?

Status
Not open for further replies.
Level 1
Joined
Aug 20, 2014
Messages
1
Hi, Im new at this I read a tutorial for memory leaks, but I m not complety sure about the action: Item - Create (name of item) at Position of Trigger unit), did this action leak???


And about the action Wait, I read a lot that is not good to use this action, my question about this is how bad is use this action did it reduce the game speed(lag) like memory leaks? and is it always bad to use it in any tipe of trigger??
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
I recommend reading this tutorial, which will help a lot with understanding leaks and WC3 memory management.

See this thread: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-memory-leaks-5889/

Item - Create (name of item) at Position of Trigger unit)

In the worst case this will leak two handles if for some reason the item you created doesn't ever get cleaned up.

item --> Item - Create
location --> Position of Trigger Unit

Minimally it leaks a location, which should be cached then removed afterwards.

It leaks an item because you've lost the handle to it, though this can be recovered by events like item sell, kill, destroy, use, etc.

It will always leak a location because there is no way to recover that location handle, there's simply no event or hook into it. So you'll need to use a custom script to destroy the location.

Set unitLoc = Position of Trigger Unit
Item - Create (name of item) at unitLoc
call Custom Script: RemoveLocation(unitLoc)

the action Wait, I read a lot that is not good to use this action, my question about this is how bad is use this action did it reduce the game speed(lag) like memory leaks? and is it always bad to use it in any tipe of trigger??

TriggerSleepAction or GUI Wait can be problematic for a number of reasons. Some functions break after a Wait, and Waits do not work unless used in functions called by triggers.

See this thread: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/

If you're just doing GUI I wouldn't worry about it. If something weird happens, then post it on the forums and we'll help you.
 
Status
Not open for further replies.
Top