thehankinator Posted September 19, 2016 Share Posted September 19, 2016 Is this a typo? If not, Delete() appears not to be called when the script is removed from the object, under what conditions does an object have a script removed but not deleted? http://www.leadwerks.com/werkspace/page/api-reference/_/script-reference/ Script:Delete() This function is called when the entity it is attached to is deleted from memory. Use this to release any resources you allocated in the Script:Start() function. http://www.leadwerks.com/werkspace/page/tutorials/_/lua-scripting-r12 Script:Detach() This function will be called when the script is removed from the object, or if the object is deleted. Quote Link to comment Share on other sites More sharing options...
reepblue Posted September 19, 2016 Share Posted September 19, 2016 Script::Delete() is from the LE3.0 days and has been 'replaced' with Script::Release(). Everything in LE should be released and the engine will take care of the rest. I never used Detach personally so I can't tell you what it'd be good for. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
thehankinator Posted September 19, 2016 Author Share Posted September 19, 2016 Script::Delete() is from the LE3.0 days and has been 'replaced' with Script::Release(). Everything in LE should be released and the engine will take care of the rest. I never used Detach personally so I can't tell you what it'd be good for. So neither the tutorial or the reference pages are correct? Do you know where Script:Release() is documented? I don't see it on either page. Quote Link to comment Share on other sites More sharing options...
Roland Posted September 19, 2016 Share Posted September 19, 2016 http://www.leadwerks.com/werkspace/page/documentation/_/object/objectrelease-r21 http://www.leadwerks.com/werkspace/page/documentation/_/object/reference-counting-r613 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
thehankinator Posted September 19, 2016 Author Share Posted September 19, 2016 http://www.leadwerks.com/werkspace/page/documentation/_/object/objectrelease-r21 http://www.leadwerks.com/werkspace/page/documentation/_/object/reference-counting-r613 That's for Object:Release(), the documentation I am looking for defines the the behavior of Script:Release() if it exists in a script that is attached to an entity. Similar to Script:Start(), Script:UpdateWorld(), etc. The links in OP have Script:Detach() or Script:Delete() but nothing about Script:Release() which Reep says superseded Script:Detach() and/or Script:Delete() but the tutorial and reference do not match (one has Script:Detach() the other Script:Delete()) and neither have Script:Release() defined. Quote Link to comment Share on other sites More sharing options...
Roland Posted September 19, 2016 Share Posted September 19, 2016 Ahh.. yes. Not the same thing. Sorry Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.