NPC is Dead, but looks otherwise.

Post » Fri Aug 05, 2016 10:58 pm

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.

User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Sat Aug 06, 2016 11:46 am

Maybe you should post the script. Did you script it to DoOnce rather than to constantly be setting his health to zero?
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Sat Aug 06, 2016 2:26 am

he is essential
User avatar
Skrapp Stephens
 
Posts: 3350
Joined: Mon Aug 06, 2007 5:04 am

Post » Sat Aug 06, 2016 9:42 am

@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
User avatar
Darren Chandler
 
Posts: 3361
Joined: Mon Jun 25, 2007 9:03 am

Post » Sat Aug 06, 2016 2:05 am

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
User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Sat Aug 06, 2016 6:35 am

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
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm


Return to III - Morrowind