Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: Oomek on March 22, 2017, 09:50:43 AM
-
I'm struggling to find a way to destroy an object or a variable.
when I make for example
local myText = fe.add_text()
How can I get rid of it from the screen apart from writing
myText.msg = ""
?
-
I don't think you can remove a variable from memory, but you can destroy a variable by changing its type. I'm not sure if attract more would destroy the object on screen if you changed the variable type. You would have to test it. Assign your text object ass null during a transition and see what happens.
-
Assigning a variable to null does work as I cannot access it anymore, but the object does not disappear from the screen. I was trying to wipe it from the fe.obj table, but using .find() throws an error
-
you can't destroy attractmode objects from a script after they are created. best thing to do is to set their visible attribute to false and just stop using them (or reuse them for something else)
cheers
-
you can't destroy attractmode objects from a script after they are created. best thing to do is to set their visible attribute to false and just stop using them (or reuse them for something else)
cheers
I did as you suggested, thanks.