Aller au contenu

Photo

using a script to make a creature inactive?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Prince of Thieves

Prince of Thieves
  • Members
  • 32 messages
 I have a creature (NPC) that I want removed (which I think is best done by switching the creatures active flag to false) after I run a script.

Does anyone know the command to change the "Active" flag to false?

Thanks.

#2
Magic

Magic
  • Members
  • 187 messages
SetObjectActive(oCreature,FALSE);

oCreature being your creature object.



Do you know the filter in the script editor to search for specific functions/constants etc.? That's really helpful.



There's also UT_ExitDestroy() and the plot flag GEN_EXIT_DESTROY which might be handy, depending on what you want to have exactly. They move the creature first, the plot flag can be called from a conversation as well.

#3
Prince of Thieves

Prince of Thieves
  • Members
  • 32 messages
Thank you Magic.

#4
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
Aren't you supposed to use Safe_Destroy instead? I vaguely remember reading some warning in the toolkit about a Destroy command.

#5
Magic

Magic
  • Members
  • 187 messages
Safe_Destroy_Object() should be used instead of DestroyObject() to make sure no critical object gets deleted by accident. If you're taking care of this yourself, both is okay since Safe_Destroy_Object() calls DestroyObject() anyway. SetObjectActive() is even "safer" though because the object stays reusable.