I can’t easily detect when a Creature Spawner device is destroyed. I’ve been trying to think of a workaround. Any suggestions?
give it a tag and check if it still exists every now and again maybe?
you can manually destroy it maybe do some janky stuff to like have a collision that detects damage and kill it that way?
Thanks. Unfortunately, tags were the first thing I tried since the spawners are already tagged, but so far with what testing I’ve done, it seems that destroying the object in-game doesn’t remove the tagged device. Hopefully I’m missing something.
This page for the creature_spawner_device class says for GetTransform:
Returns the transform of the
creative_object
with units in cm. You must checkcreative_object.IsValid
before calling this if there is a possibility the object has been disposed or destroyed by gameplay. Otherwise a runtime error will result.
but I haven’t been able to get that to work and others seem to be asking the same question. Hopefully I’m missing something here too, and if anyone has experience with this, let me know.
I’m betting janky will be the way.
It doesn’t look like damage_result, damageable, etc, are accessible for creative devices (although the digests imply that it might implemented in the future).