Aller au contenu

Photo

DestroyObject not destroying creatures? (Semi-Resolved)


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

#1
Bandobras Took

Bandobras Took
  • Members
  • 22 messages
Theoretically, this should destroy a creature walking into the trigger (it's attached to the OnEnter).
However, creatures with the appropriate tag walk in, look around, and cheerfully walk right back out.

Why isn't this working?

void main(){ object npctodestroy = GetEnteringObject(); // error-checking DisplayMessageBox(GetFirstPC(),1234567,GetTag(npctodestroy)); if(GetTag(npctodestroy)=="randomnpc") {  DestroyObject(npctodestroy,0.0,FALSE); }}

Modifié par Bandobras Took, 13 mars 2012 - 04:28 .


#2
Bandobras Took

Bandobras Took
  • Members
  • 22 messages
Incidentally, applying a death effect to the entering creature *does* work -- is there some kind of limitation on DestroyObject with regard to creatures?

#3
Bandobras Took

Bandobras Took
  • Members
  • 22 messages
 All right, apparently creatures default to not destroyable; I guess I'll have to script them to be destroyable when they spawn, never mind that you can't actually assign an object to SetIsDestroyable . . . :huh:

#4
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Add:

SetPlotFlag(npctodestroy,FALSE);
SetImmortal(npctodestroy,FALSE);

any time you want to destroy a creature, just to be sure.

#5
kevL

kevL
  • Members
  • 4 070 messages
+

AssignCommand(SetIsDestroyable());

#6
Shaughn78

Shaughn78
  • Members
  • 637 messages
When it comes to destroying creatures I am a big fan of first setting them to script hidden then do my destroy with a delay.