YouGroove Posted February 24, 2014 Share Posted February 24, 2014 I corrected some project problem of someone else. I tried to free some object in it's script using Release but it crashed. Must Release() be called by some manager or parent entity, or can it be called by the entity scripts owner in it's script ? function Script:stopbullet() self.bullActive = false self.entity:Hide() --Makes crash --self.entity:Release() end Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted March 1, 2014 Share Posted March 1, 2014 If you give me the project or a small demo I can debug it in Visual Studio. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
YouGroove Posted March 9, 2014 Author Share Posted March 9, 2014 Here is a simple map file. Steps to test : - create new project - download and dezip file test1.zip somewhere , than put test1.map in map directory - download and put turret.zip on your "Models" folder - dezip turret.zip (you should have Models/turret containing models,scripts) - run the level It will fire bullets and will crash at some point. If you remove the call to Release() in script Models/turret/bullet.lua , it won't crash after lot of bullets. Crash version function Script:stopbullet() self.bullActive = false self.entity:Hide() self.entity:Release() end ok version function Script:stopbullet() self.bullActive = false self.entity:Hide() end test1.zip Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted March 16, 2014 Share Posted March 16, 2014 First, if you are using physics commands you do not need to modulate things by GetAppSpeed(). The physics simulator runs at a constant 60 hz and will take care of this for you. In fact, that is the reason your bullets are wobbling around strangely. I found the cause of this and was able to fix it. It's not really crashing, just creating an infinite loop. This will first be available on the beta branch in Steam. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts