Page 1 of 1

NPC is Dead, but looks otherwise.

PostPosted: Fri Aug 05, 2016 10:58 pm
by Terry

I scripted the death of an NPC using "npc"->sethealth 0, but it seems to not work? The script is executed after a certain journal entry. It kills the NPC, and he's dead because he's also lootable, but he for some reason does not perform the corpse animation (He looks like he's alive, he's just standing there) and he is also repeatedly making grunting noises (Argh! Ah! etc etc) as if he were being hit.



The NPC is located in an interior. Could this be the cause? The NPC is Kaushad for refrence.


NPC is Dead, but looks otherwise.

PostPosted: Sat Aug 06, 2016 11:46 am
by Jimmie Allen
Maybe you should post the script. Did you script it to DoOnce rather than to constantly be setting his health to zero?

NPC is Dead, but looks otherwise.

PostPosted: Sat Aug 06, 2016 2:26 am
by Skrapp Stephens
he is essential

NPC is Dead, but looks otherwise.

PostPosted: Sat Aug 06, 2016 9:42 am
by Darren Chandler

@Abot, I unclicked the essential box for Kaushad.



Begin KaushadScript

; KaushadScript will activate on Journal Index 15

if ( GetDisabled != 1 )
if ( GetJournalIndex "aa1_zainab" >= 16 )
Disable
endif
endif

if ( GetDisabled == 1 )
if ( GetJournalIndex aa1_zainab >= 15 )
Enable
endif
endif

; KaushadScript will give journal entry 16 when player is near

if ( GetDisabled != 1 )
if ( GetDistance Player <= 256 )
if ( GetJournalIndex "aa1_zainab" == 15 )
Journal "aa1_zainab" 16
"Kaushad"->sethealth 0
endif
endif
endif


End

NPC is Dead, but looks otherwise.

PostPosted: Sat Aug 06, 2016 2:05 am
by Laura
Uhm, I think you are disabling/enabling him each frame because >=15 and >= 16 are both true

; KaushadScript will activate on Journal Index 15

if ( GetDisabled != 1 )
if ( GetJournalIndex "aa1_zainab" >= 16 )
Disable
messageBox "now you don't"
endif
endif

if ( GetDisabled == 1 )
if ( GetJournalIndex aa1_zainab >= 15 )
Enable
messageBox "now you see me..."
endif
endif

; KaushadScript will give journal entry 16 when player is near

if ( GetDisabled != 1 )
if ( GetDistance Player <= 256 )
if ( GetJournalIndex "aa1_zainab" == 15 )
Journal "aa1_zainab" 16
"Kaushad"->sethealth 0
endif
endif
endif


End

NPC is Dead, but looks otherwise.

PostPosted: Sat Aug 06, 2016 6:35 am
by naomi

Are you sure you understand what the http://www.uesp.net/wiki/Tes3Mod:EnableDisable functions do? They don't actually disable/enable scripts, they only show/hide the actual objects (scripts still run even while objects are disabled).



It's hard to tell from your posts, but I think the only part you need is this:



begin KaushadScript

if ( GetJournalIndex aa1_zainab == 15 )
if ( GetDistance player <= 256 )
Journal aa1_zainab 16
SetHealth 0
endif
endif

end