Garcia 0 Posted May 11, 2005 Well, the question is simple...does a eventhandler (killed eventhandler thingy ) get, deleted/removed when the unit it is attached to gets deleted? I've got a MP mission with eventhandlers to AI to detect when they die, and then execute a script to delete them...but I also use CoC AI On Demand, which deletes the AI, and then adds them again when the player gets close...and each time a unit is created again, he gets a new eventhandler. Now, I'll just ask another question too...if the eventhandler doesn't get removed, and therefor uses some CPU, then it would be better to just run a script for the AI, checking if he is dead or not, then delete them after a delay...but, how can I exit the script in case the AI gets deleted by AI OD? Share this post Link to post Share on other sites
hardrock 1 Posted May 11, 2005 As eventhandlers are attached to units and the units in your case get deleted, I'm sure the EH is gone too. When you create a new unit, how should OFP know what EHs "this unit" (only you know which unit you intend to recreate, but not OFP) had in its last life? Share this post Link to post Share on other sites
Garcia 0 Posted May 11, 2005 Well, the only thing that matters is if the EH is removed or not. Cause if they ain't, and stick around for some strange reason, they would create a lot of extra load on the computer after a while since every new unit created gets a new EH. And after a while it would be a lot of EHs... Share this post Link to post Share on other sites
hardrock 1 Posted May 11, 2005 I guess units are stored in classes in OFP's engine. Things like eventhandlers or behaviour etc. are probably class definitions, when a unit is deleted I assume that the whole class is removed from the memory, that way everything included in this class (= related to the unit) is deleted too. But that's only a guess. Share this post Link to post Share on other sites
bn880 5 Posted May 11, 2005 Well, the event handlers are indeed deleted, as they fit inside the class of the unit. So no worries, and AIOD simply deletes the units, so you're fine. Share this post Link to post Share on other sites