Bridget |
01-30-2009 09:21 AM |
This won't work, because I need the function to remove the specific entity that has been triggered, while ignoring the other scripts that are exactly the same. Instead, the code you offered freaks out because it realizes, oh shit there is more than one a_special_script on the map. Then, it just removes the first one it can find (not the specific one you touch) and touching further a_special_scripts does nothing. I don't think there's a way to achieve what I'm looking for. In order to do it the way I want, I'd have to make like x+ (number depends on how many I need in my map) scripts each with their own :touch() function that finds them specifically and removes them. That's a really beginner-desperation way of doing things, so I guess I'm out of luck. RemoveEntity(self) should remove the specific entity that the touch() function was called on in real time, not in code (Oh, remove this specific script? Not any or every script that happens to be of this kind. Sure.), even if there are a dozen entities of the same type, name, and whatever. If it doesn't make sense to use RemoveEntity(x), a new lua function should be added that allows this.
|