NPC Perma Unconscious

Post » Sat May 28, 2011 6:05 am

Heyas

So I have an NPC (A CM Partner that I created) and it's set to essential
when it goes unconscious it stays that way and keeps spamming the message "so and so is unconscious" and If I set it to not essential while it's like this it dies. It's as if something keeps on damaging it and draining it's health.

Anyways I tried to find out why this happens, I found that it also happens to Mazoga the Orc
So I tried to compare them and see what they had in common, both had scripts attached to them and both of those scripts had OnDeath blocks. I'm not sure if that means anything but I know that if I set any other NPC to Essential they get up just fine with no issue.

My guess is that a mod I'm using is doing this, but if I knew what the heck was going on id be able to find the mod and debug it better
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Fri May 27, 2011 6:06 pm

Interestingly, calling GetUnconscious on the NPC returns 0. I was sorta able to fix it by SetUnconsious 1 then SetUnconsious 0. But of course if the NPC gets killed again it will be perma unconscious again. Gotta be someone that has encountered something like this
User avatar
Manuela Ribeiro Pereira
 
Posts: 3423
Joined: Fri Nov 17, 2006 10:24 pm

Post » Sat May 28, 2011 7:37 am

Further Investigation: No mod that I am using is causing this as far as I can see, this has to be something wrong with the NPC themselves. I started killing the stock CM Partners that come with that mod and none of them have this problem, It spams the message twice and they get up.

So my question again to the more experienced: Could their be something wrong with them that would cause this? Mazoga is not normally essential, but I have set it as such in my game and up until now she was the only npc that did this. And now, this CM partner that I created which is a copy of one of the stock ones (which don't have this problem) with a few edits. I'm pulling my hair out trying to figure this out
User avatar
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm

Post » Fri May 27, 2011 8:05 pm

If you hit him with a healing spell, (heal 10 points on touch/target), does he get back up? or stay unconscious?
User avatar
Eire Charlotta
 
Posts: 3394
Joined: Thu Nov 09, 2006 6:00 pm

Post » Sat May 28, 2011 12:40 am

Just tested, hit it a few times with a target healing spell and it stays unconscious

So it seems to be not a matter of the npc not having enough health, something is forcing it into that state. A token or a script, but again I really went out of my way to test that other mods I'm using are not causing it and it still happened regardless of that.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Sat May 28, 2011 4:11 am

And this is the only companion that seems to have the issue? Is he scripted? or do you do the companion stuff via dialog? Can you check and see what his health is with the console, to make sure that something isn't settting it back to zero?
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Fri May 27, 2011 9:46 pm

ya, it's the only one, If I set Mazoga as essential and kill her, she does the same as this companion is too. Both are scripted, but neither of those scripts have anything in them that would do this. The companion has dialog options to control it, it's a standard CM partner but that seems to have no effect on any of this.

I would also like to say that it has a custom ability that restores 2 health and 2 fatigue constantly, so that complicates it more :D
Before I do anything to it, it has health of 682/632 (fortify health 50) and when it's unconscious is has 1/632
User avatar
Isabel Ruiz
 
Posts: 3447
Joined: Sat Nov 04, 2006 4:39 am

Post » Fri May 27, 2011 9:34 pm

Does the health regenerate over time when it is unconscious? maybe post the scripts? Since it occurs with others as well..... I am just not sure....

I am not real familiar with companions, as I don't really use them...
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Fri May 27, 2011 6:44 pm

The health does regenerate when it's unconscious, I waited an hour and it was at full again. Here are both scripts to compare, the only real thing in common is that both have ondeath blocks. The other stock CM partners that come with the mod use the same script and neither of them have this problem,

Mazoga Script
scriptname MS91Scriptshort MazogaChat	;tracks Mazoga-Weebam-Na conversationshort MogensChat	;tracks Mazoga-Mogens conversationshort Donetalkbegin gamemode;enable Mogens Wind-Shifter faction and map marker at Fisherman's Rock; NPCs and map marker parented by Mogens Wind-Shifter; MOVED TO MS91 FishermansRockFollow topic;if ( GetStage MS91 >= 50 );	if MogensWindShifterRef.GetDisabled == 1;		MogensWindShifterRef.Enable;	endif;endif;when all four of the Mogens Wind-Shifter faction are dead, advance quest stageif ( donetalk == 1 ) && ( WeebamNaRef.GetCurrentAIProcedure != 4 ) && ( player.getincell LeyawiinCastleCountyHall == 1 )	SetStage MS91 35	Set donetalk to 2endifif ( GetStage MS91 >= 80 )	returnendifif MogensWindShifterRef.getdead == 1	if JBaashaRef.getdead == 1		if AyishaRef.getdead == 1			if MensaSelasRef.getdead == 1				if GetStageDone MS91 60 == 1	; Mazoga starts combat					SetStage MS91 80	; Mazoga gets revenge and is happy					MazogatheOrcREF.EVP				else					SetStage MS91 55	; player spoils revenge and Mazoga is pissed					MazogatheOrcREF.EVP				endif			endif		endif	endifendifend


CM Partners Script
ScriptName PartnerScriptshort partnershort npctypeshort partyshort inpartyshort standbyshort stayshort packageshort followshort followingshort controlfloat controltimershort commandshort interiorshort dooncefloat timershort timepastfloat partytimershort fspeedshort fathleticsfloat pfacingshort incombatshort deadshort isdeadshort alertshort lootref reftargetshort dispositionshort crimeshort npccrimeshort bountyshort forcecombatshort pccombatfloat combattimershort sparringshort adversaryfloat xposfloat yposfloat zposshort warpshort localwarpshort teleportshort lockoutshort loadshort mapshort pczshort npczshort runningshort sittingshort torchshort sneakingshort chameleonshort invisibleshort waterbreathingshort waterwalkingshort hoodshort shieldshort countshort hoodsetref hoodrefshort npcspeedshort npcathleticsshort npchealthshort npcmagickashort npcfatigueshort npcacrobaticsshort npcresponsibilityshort npcaggressionshort npcdispshort dispdiff    ; Defined as ( npcdisp - disposition )short setupdoonceshort npclevelshort pclevelshort levelupshort pchealthshort inventoryshort regulatorshort repairref refnpcref refboxshort joinshort menushort mjoinshort mmenuBegin OnDeath  set isdead to 1  if inparty == 1    Message, "Your partner is dead."  endif  EndBegin MenuMode 1023  set map to 1EndBegin OnLoadif inparty == 1 && map == 1  set load to 1endifif teleport == 2  set teleport to 0  RemoveScriptPackage  AddScriptPackage "cmStandby"   SetFactionRank NPCStand, 1    SetFactionRank NPCParty, 0 endifset partner to ( GetFactionRank Partners )set npctype to ( GetFactionRank NPCType )set inparty to ( GetFactionRank NPCParty )set standby to ( GetFactionRank NPCStand )set stay to ( GetFactionRank NPCStay )set follow to GetCurrentAiPackage == 1set npclevel to GetLevelset pclevel to Player.GetLevelset npcdisp to GetDisposition Playerset npcmagicka to ( GetBaseActorValue Magicka )set npcfatigue to ( GetBaseActorValue Fatigue )set npcspeed to ( GetBaseActorValue Speed )set npcathletics to ( GetBaseActorValue Athletics )set npcacrobatics to ( GetBaseActorValue Acrobatics ) set npcresponsibility to ( GetBaseActorValue Responsibility )set npcaggression to ( GetBaseActorValue Aggression )  set pchealth to ( Player.GetBaseActorValue Health )set refnpc to GetSelfset dead to GetDeadif npctype == 1  set npchealth to ( 0.85 * pchealth )  SetActorValue Health, npchealthelseif npctype == 2  set npchealth to ( 0.80 * pchealth )  SetActorValue Health, npchealthelseif npctype == 3  set npchealth to ( 0.75 * pchealth )    SetActorValue Health, npchealth endifif inparty == 1 && dead != 1  set control to 1endifif cmPartnersQuest.nRead == 1  set cmPartnersQuest.nRead to 0endifEndBegin OnActivate ; Sets Quest variables when Dialogue is activated.  This allows every Partner NPC to use the Quest dialogue as their own.Set cmPartnersQuest.nType to npctypeset cmPartnersQuest.nInParty to inpartyset cmPartnersQuest.npcRef to GetSelfif IsActionRef Player == 1 && Player.IsSneaking == 1 && partner >= 1 && disposition >= 50 && dead != 1  ; Activates the Quick Menu if the Player is sneaking, or works normal if the Player is not..  if partner == 1 && join == 0     MessageBox "Partner:" "Join me" "Stats" "Nevermind"    set join to 1  elseif partner == 2 && inparty == 1 && menu == 0     MessageBox "Partner:" "Follow Me" "Stats" "Share" "Guard" "Standby" "Stay" "Nevermind"    set menu to 1  elseif partner == 2 && inparty == 0 && menu == 0       MessageBox "Partner:" "Follow Me" "Stats" "Nevermind"    set menu to 1  endifelseif IsActionRef Player == 1 && Player.IsSneaking == 1 && partner >= 1 && disposition < 50 && dead != 1  MessageBox "I'm sorry. I don't know you well enough."elseif IsActionRef Player == 1 && Player.IsSneaking == 0   Activateelse  ActivateendifEndBegin GameMode   ; Normal game scripting run in non-menu mode.; INITIAL SETUP - Sets all starting values for variables and adds topics and spells..if setupdoonce == 0  set partner to ( GetFactionRank Partners )  set npctype to ( GetFactionRank NPCType )  set inparty to ( GetFactionRank NPCParty )  set standby to ( GetFactionRank NPCStand )  set stay to ( GetFactionRank NPCStay )    set npclevel to GetLevel  set pclevel to Player.GetLevel  set pchealth to ( Player.GetBaseActorValue Health )  set npcdisp to GetDisposition Player   set npcmagicka to ( GetBaseActorValue Magicka )  set npcfatigue to ( GetBaseActorValue Fatigue )  set npcspeed to ( GetBaseActorValue Speed )  set npcathletics to ( GetBaseActorValue Athletics )  set npcacrobatics to ( GetBaseActorValue Acrobatics )  set npcresponsibility to ( GetBaseActorValue Responsibility )  set npcaggression to ( GetBaseActorValue Aggression )  if npctype < 1    ;  If NPCType is not set for NPC, then will set to 1, Combat.    SetFactionRank NPCType, 1  endif  AddTopic cmStats    AddTopic cmJoinMe    if npctype == 3    AddSpell "cmHealPlayer"    AddSpell "cmRestoreHealth"  else    AddSpell "cmRestoreHealth10"      endif    set setupdoonce to -1endifif dead == 1 && isdead == 1 ; Terminates script after 10 minutes if NPC is dead.  set timer to ( timer + GetSecondsPassed )  If timer > 600    set timepast to -1    set isdead to -1;    MoveTo cmDeadMark1    SetQuestObject refnpc 0    SetFactionRank Partners, 0    SetFactionRank NPCParty, 0    SetFactionRank NPCStand, 0    SetFactionRank NPCStay, 0      RemoveScriptPackage   endif  elseif dead == 1 && isdead == -1  Returnendif; MENU MODE - Quick Menuif join == 1 && partner == 1  Set mjoin to GetButtonPressed  if mjoin == 0                     ; Join    set mjoin to -1    set join to 0    ModFactionRank Partners, 1    SetFactionRank NPCParty, 1    RemoveScriptPackage    AddScriptPackage "cmFollowPlayer"    Return  elseif mjoin == 1                ; Stats    set mjoin to -1    set join to 0    AddItem cmQkStatToken 1    Return  elseif mjoin == 2                ; Nevermind    set mjoin to -1          set join to 0     Return       endifelseif menu == 1 && partner == 2 && inparty == 1  set mmenu to GetButtonPressed  if mmenu == 0                     ; Follow    set mmenu to -1    set menu to 0    RemoveScriptPackage    AddScriptPackage "cmFollowPlayer"    SetFactionRank NPCParty, 1    SetFactionRank NPCStay, 0    SetFactionRank NPCStand, 0        Return  elseif mmenu == 1                 ; Stats     set mmenu to -1      set menu to 0    AddItem cmQkStatToken 1    Return  elseif mmenu == 2                 ; Share     set mmenu to -1      set menu to 0    set inventory to 1    Return   elseif mmenu == 3                 ; Guard      RemoveScriptPackage    AddScriptPackage "cmStandGuard"    SetFactionRank NPCParty, 0        set mmenu to -1        set menu to 0     Return  elseif mmenu == 4                 ; Standby     set mmenu to -1      set menu to 0        RemoveScriptPackage    AddScriptPackage "cmStandby"    SetFactionRank NPCParty, 0     SetFactionRank NPCStand, 1    Return  elseif mmenu == 5                 ; Stay     set mmenu to -1      set menu to 0       RemoveScriptPackage    AddScriptPackage "cmWander"    SetFactionRank NPCParty, 0     SetFactionRank NPCStay, 1    Return  elseif mmenu == 6                 ; Nevermind    set mmenu to -1          set menu to 0     Return     endifelseif menu == 1 && partner == 2 && inparty == 0  set mmenu to GetButtonPressed  if mmenu == 0                     ; Follow    set mmenu to -1    set menu to 0    RemoveScriptPackage    AddScriptPackage "cmFollowPlayer"    SetFactionRank NPCParty, 1    SetFactionRank NPCStay, 0    SetFactionRank NPCStand, 0    Return  elseif mmenu == 1                 ; Stats     set mmenu to -1      set menu to 0    AddItem cmQkStatToken 1    Return  elseif mmenu == 2                 ; Nevermind    set mmenu to -1          set menu to 0     Return    endif  endif; TELEPORT MODEif load >= 1 && inparty == 1 ; Modified fix from Cecelia for double face bug.  if load == 3    Enable    set load to 0    RemoveScriptPackage    AddScriptPackage cmFollowPlayer  elseif load == 2    Disable    set load to 3  elseif load == 1    set map to 0    set load to 2  endif    endifif teleport == 1 && command == 0 && cmPartnersQuest.nLockNPC == 0   ;  Teleport script for Mark and Return  set teleport to 2  RemoveScriptPackage  SetFactionRank NPCParty, 0  PlaySound AMBThunder     if pfacing < 90  ; northeasterly    MoveTo cmPartnersMark1, -50, -50, 10  elseif pfacing < 180 ; southeasterly    MoveTo cmPartnersMark1, -50, 50, 10  elseif pfacing < 270 ; southwesterly    MoveTo cmPartnersMark1, 50, 50, 10  else ; northwesterly    MoveTo cmPartnersMark1, 50, -50, 10  endif  set teleport to 0  RemoveScriptPackage  AddScriptPackage "cmStandby"   SetFactionRank NPCStand, 1    SetFactionRank NPCParty, 0   elseif teleport == 1 && command == 0 && cmPartnersQuest.nLockNPC == 1  set teleport to 0  Message, "Mark and Return doesn't work here."endifif warp == 1 && cmPartnersQuest.nLockout == 0      ; Warp script for Summon and Recall  set warp to 0  if pfacing < 90  ; northeasterly    MoveTo Player, -50, -50, 10  elseif pfacing < 180 ; southeasterly    MoveTo Player, -50, 50, 10  elseif pfacing < 270 ; southwesterly    MoveTo Player, 50, 50, 10  else ; northwesterly    MoveTo Player, 50, -50, 10  endifelseif warp == 1 && command == 0 && cmPartnersQuest.nLockout == 1  set warp to 0  Message, "Warp doesn't work here."  endifif localwarp == 1       ; Local warp script for the Partners Ring and Movement Warp  set localwarp to 0  if pfacing < 90  ; northeasterly    MoveTo Player, -50, -50, 10  elseif pfacing < 180 ; southeasterly    MoveTo Player, -50, 50, 10  elseif pfacing < 270 ; southwesterly    MoveTo Player, 50, 50, 10  else ; northwesterly    MoveTo Player, 50, -50, 10  endifendifset package to GetCurrentAiPackage        ; Updates main variables.set follow to GetCurrentAiPackage == 1set partner to ( GetFactionRank Partners )set inparty to ( GetFactionRank NPCParty )set standby to ( GetFactionRank NPCStand )set stay to ( GetFactionRank NPCStay )set interior to IsInInteriorset disposition to GetDisposition Playerset dispdiff to ( npcdisp - disposition )set incombat to IsInCombatset pccombat to Player.IsInCombatset adversary to ( GetInFaction Adversaries )set bounty to GetCrimeGoldset dead to GetDeadif crime == 1 && dispdiff > 0 ; Resets disposition if Player commits a crime.  ModDisposition Player, dispdiff  set disposition to GetDisposition Player    set crime to 0endifif npccrime == 1 || bounty > 0  SetCrimeGold 0  set npccrime to 0  set bounty to 0endifif control == 1 && inparty == 1 && incombat == 0 && dead != 1   set controltimer to ( controltimer + GetSecondsPassed )  if controltimer > 2    set control to 0    set controltimer to 0    RemoveScriptPackage    AddScriptPackage "cmFollowPlayer"  endifendif; FOLLOW MODE - Sets all the follow variables to define how the NPC follows the Player.if follow == 1 && following == 0  set fspeed to ( Player.GetActorValue Speed * 1.5 )  set fathletics to ( Player.GetActorValue Athletics * 1.5 )  SetActorValue Speed, fspeed  SetActorValue Athletics, fathletics  SetIgnoreFriendlyHits 10   set following to 1  elseif follow != 1 && following == 1  SetActorValue Speed, npcspeed  SetActorValue Athletics, npcathletics  SetIgnoreFriendlyHits 5  set following to 0endifif follow == 1 && incombat == 0  set pcz to Player.GetPos z  set npcz to GetPos z  set pfacing to Player.GetAngle z  elseif follow != 1 && incombat == 0     set npcz to GetPos zendifif follow == 1  ;  Scripting in this block commands the NPC to follow the Player in many different ways.    if incombat == 0     if IsSwimming == 0 && (GetDistance Player > 1024) || (pcz > (npcz + 400)) || (pcz < (npcz - 400))    ; Warp script: get the angle player is facing, and move to player, but behind.      set localwarp to 1    elseif IsSwimming == 1 && (GetDistance Player > 1600) || (pcz > (npcz + 800)) || (pcz < (npcz - 800))    ; Warp script: get the angle player is facing, and move to player, but behind.      set localwarp to 1     endif  endif  if alert == 0 && Player.IsWeaponOut == 1    SetAlert 1    set alert to 1  elseif alert == 1 && Player.IsWeaponOut == 0    SetAlert 0    set alert to 0  endif  if sneaking == 0 && Player.IsSneaking == 1 && incombat == 0    SetForceSneak 1    set sneaking to 1    SetActorValue Responsibility, 0    SetActorValue Aggression, 5  elseif sneaking == 1 && Player.IsSneaking == 0 || incombat == 1    SetForceSneak 0    set sneaking to 0    SetActorValue Responsibility, npcresponsibility    SetActorValue Aggression, npcaggression  endif  if chameleon == 0 && Player.HasMagicEffect CHML == 1    AddSpell "cmChameleonA"    set chameleon to 1  elseif chameleon == 1 && Player.HasMagicEffect CHML == 0    RemoveSpell "cmChameleonA"     set chameleon to 0  endif  if invisible == 0 && Player.HasMagicEffect INVI == 1    AddSpell "cmInvisibilityA"    set invisible to 1  elseif invisible == 1 && Player.HasMagicEffect INVI == 0    RemoveSpell "cmInvisibilityA"     set invisible to 0  endif  if running == 0 && Player.IsRunning == 1    SetForceRun 1    set running to 1  elseif running == 1 && Player.IsRunning == 0    SetForceRun 0    set running to 0  endif   if waterwalking == 0 && Player.HasMagicEffect WAWA == 1    AddSpell "cmWaterWalkingA"    set waterwalking to 1  elseif waterwalking == 1 && Player.HasMagicEffect WAWA == 0    RemoveSpell "cmWaterWalkingA"    set waterwalking to 0  endif  if npctype == 3 && sparring == 0 && cmPartnersQuest.nHeal == 1 ; Cast Party Heal spell.    AddSpell "cmHealParty"    Cast cmHealParty Player    RemoveSpell "cmHealParty"    set cmPartnersQuest.nHeal to 0  endif    if sitting == 0 && Player.GetSitting == 3    AddScriptPackage "cmSitScript"    set sitting to 1  endif   endifif sitting == 1 && Player.GetSitting == 0   ; Forces NPC to rejoin Player after sitting package is complete.  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  set sitting to 0endif; COMBAT MODE       ; Controls combat between Partner NPCs, the Player, and other NPCs.if forcecombat == 2 && inparty == 1 && pccombat == 0 && cmPartnersQuest.nSpar == 0  set forcecombat to 0  SetFactionRank Adversaries -1  ModActorValue Aggression -30  set cmPartnersQuest.nForce to 0  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  elseif forcecombat == 1 && follow == 1 && pccombat == 1 && GetDistance Player <= 2000 && npcaggression >= 5 && cmPartnersQuest.nSpar == 0  set forcecombat to 2    SetFactionRank Adversaries 1  ModActorValue Aggression 30  set reftarget to GetCombatTarget    StartCombat reftargetelseif forcecombat == 0 && follow == 1 && cmPartnersQuest.nForce == 1 && cmPartnersQuest.nSpar == 0  set forcecombat to 1elseif forcecombat == 0 && follow == 1 && IsInCombat == 1 && npcaggression >= 5 && cmPartnersQuest.nSpar == 0 && cmPartnersQuest.nForce == 0  set reftarget to GetCombatTarget   SetIgnoreFriendlyHits 30;  set loot to 1          ; If activated will cause Partners to automatically loot the area after combat.  if reftarget == Player    Yield    set loot to 0    Return  elseif reftarget.GetInFaction Partners > -1    Yield    ModDisposition reftarget 100    set loot to 0    Return  elseif reftarget.GetInFaction Minions > -1 || reftarget.GetInFaction Beasts > -1    Yield    ModDisposition reftarget 100    set loot to 0    Return  endifendifif loot == 1 && incombat == 0   ; Automatically starts looting after combat.  if reftarget.GetDead == 1      set loot to 0    Message, "Looting"    RemoveScriptPackage    AddScriptPackage "cmLootWeapon"    SetPackDuration 8        endifendifif sparring == 1 && forcecombat == 0 && inparty == 1 && cmPartnersQuest.nSpar == 0  set sparring to 0  set cmPartnersQuest.nHeal to 1    SetFactionRank Adversaries -1     ModActorValue Aggression -100  StopCombat  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"endifif sparring == 0 && forcecombat == 0 && inparty == 1 && cmPartnersQuest.nSpar == 1  set sparring to 1  SetFactionRank Adversaries 0    ModActorValue Aggression 100  StartCombat Playerendif; INVENTORY MODE  - Inventory scripting which is a modified Toaster script, but uses MoveTo rather than the PlaceAtMe command.  .if inventory == 1 && follow == 1  if regulator == 3    AddItem cmTorch02 1    EquipItem cmTorch02    RemoveItem cmTorch02 1    set regulator to 0    toggleActorsAI    RemoveScriptPackage "cmInventory"    AddScriptPackage "cmFollowPlayer"        set inventory to 0  endif  if regulator == 2 && MenuMode == 0    set regulator to 3    cmInvNPC.RemoveAllItems refnpc  endif  if regulator == 1    toggleActorsAI      RemoveAllItems cmInvNPC    cmInvNPC.Activate Player    set regulator to 2  endif  if regulator == 0    cmInvNPC.MoveTo Player 0 0 -50    set refbox to cmInvNPC        refbox.setOwnership    set regulator to 1  endifendif; PARTY COMMANDS - Reads Quest variable nParty and executes party commands for NPC.if command == 1 && cmPartnersQuest.nParty >= 1   set partytimer to ( partytimer + GetSecondsPassed )  If partytimer > 3    set cmPartnersQuest.nParty to 0    set command to 0    set partytimer to 0  endifelseif command == 1 && cmPartnersQuest.nParty == 0   set command to 0  set partytimer to 0endifif partner == 2 && command == 0 && cmPartnersQuest.nParty==1 && inparty == 1 ; Party Follow  set command to 1  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCStay, 0  SetFactionRank NPCStand, 0  SetFactionRank NPCParty, 1  elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==2 && inparty == 1  ; Party Guard  set command to 1  RemoveScriptPackage  AddScriptPackage "cmStandGuard"  SetFactionRank NPCParty, 0elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==3 && inparty == 1   ; Party Stay  set command to 1  RemoveScriptPackage  AddScriptPackage "cmWander"  SetFactionRank NPCStay, 1  SetFactionRank NPCParty, 0elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==4 && inparty == 1   ; Party Eat  RemoveScriptPackage  AddScriptPackage "cmEatCommand"  set command to 1 elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==5 && inparty == 1    ; Party Drink  RemoveScriptPackage  AddScriptPackage "cmDrunkCommand"  set command to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==6 && inparty == 1   ; Party Sleep  RemoveScriptPackage  AddScriptPackage "cmSleepCommand"  set command to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==7 && inparty == 1 && npctype >= 2   ; Party Harvest  RemoveScriptPackage  AddScriptPackage "cmHarvestCommand"  set command to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==8 && inparty == 1   ; Party Melee  RemoveScriptPackage  AddScriptPackage "cmMeleeCommand"   set command to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==9 && inparty == 1   ; Party Magic  RemoveScriptPackage  AddScriptPackage "cmCastAnyCommand"  set command to 1 elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==10 && inparty == 1   ; Party Attack NPC  RemoveScriptPackage  AddScriptPackage "cmAttackNPCCommand"   set command to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==11 && inparty == 1   ; Party Attack Creature  RemoveScriptPackage  AddScriptPackage "cmAttackMonsterCommand"  set command to 1 elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==12 && stay == 1 && dead != 1  ; Party Recall  set command to 1  set warp to 1   RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCStay, 0  SetFactionRank NPCParty, 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==13 && inparty == 1 && dead != 1   ; Partners Ring  set command to 1  set localwarp to 1  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCParty, 1  elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==14 && standby == 1 && dead != 1  ; Party Summon  set command to 1   set warp to 1  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCStand, 0  SetFactionRank NPCParty, 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==15 && inparty == 1  ; Party Loot  set command to 1  RemoveScriptPackage  AddScriptPackage "cmLootArmor"  SetPackDuration 15elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==17 && inparty == 1 && dead != 1   ; Party Return  set command to 1  set teleport to 1elseif partner == 2 && command == 0 && cmPartnersQuest.nParty==18 && inparty == 1    ; Party Standby  set command to 1  RemoveScriptPackage  AddScriptPackage "cmStandby"   SetFactionRank NPCStand, 1  SetFactionRank NPCParty, 0endif; ITEMS - Items used by the party.if torch == 0 && IsActorUsingATorch == 0 && cmPartnersQuest.nTorch == 1 && IsSneaking == 0  AddItem cmTorch02 1  EquipItem cmTorch02  set torch to 1elseif torch == 1 && cmPartnersQuest.nTorch == 0   RemoveItem cmTorch02 1  set torch to 0elseif torch == 1 && IsSneaking == 1  RemoveItem cmTorch02 1  set torch to 0  endifif hoodset == 0 && cmPartnersQuest.nHood >= 1 ; HOODS - Adds hood to Stealth characters and a lighter hood of the same color to Magic characters  outside at night or during the day when it's raining.  Hoods are removed during the day when it's not raining or when you go inside.  set hoodset to 1  if npctype == 2 && cmPartnersQuest.nHood == 1 ; Black Hood    set hoodref to BlackHood  elseif npctype == 3 && cmPartnersQuest.nHood == 1 ; Blue Hood    set hoodref to ArchMageHood  elseif npctype == 2 && cmPartnersQuest.nHood == 2 ; Green Hood    set hoodref to LowerRobe04hood  elseif npctype == 3 && cmPartnersQuest.nHood == 2 ; Aqua Silk Hood    set hoodref to UpperRobe03hood      elseif npctype == 2 && cmPartnersQuest.nHood == 3 ; Dark Gray Hood    set hoodref to LowerRobe02hood  elseif npctype == 3 && cmPartnersQuest.nHood == 3 ; Gray Hood    set hoodref to LowerRobe05hood      elseif npctype == 2 && cmPartnersQuest.nHood == 4 ; Red Hood    set hoodref to MythicDawnRobeHood  elseif npctype == 3 && cmPartnersQuest.nHood == 4 ; Red Silk Hood    set hoodref to UpperRobe02hood      endifelseif hoodset == 1 && cmPartnersQuest.nHood == 0   set hoodset to 0endif  if hoodset == 1 && hood == 1 && interior == 1  set count to GetItemCount hoodref  if count > 0    UnEquipItem hoodref    RemoveItem hoodref 1    set hood to 0  endifelseif hoodset == 1 && hood == 1 && interior == 0 && Gamehour > 8 && GameHour < 19 && IsRaining == 0  set count to GetItemCount hoodref  if count > 0    UnEquipItem hoodref    RemoveItem hoodref 1            set hood to 0         endifelseif hoodset == 1 && hood == 0 && interior == 0 && ( GameHour > 19 || GameHour < 8 || IsRaining > 0.5 )  AddItem hoodref 1  EquipItem hoodref      set hood to 1 elseif hoodset == 0 && hood == 1  UnEquipItem hoodref  RemoveItem hoodref 1  set hood to 0endifif cmPartnersQuest.nShield == 1 && shield == 0  ; SHIELD & CUIRASS - Adds or removes a Kvatch Shield.& Cuirass  if GetItemCount TownguardKvShield == 0    AddItem TownguardKvShield 1    EquipItem TownguardKvShield  endif  if GetItemCount TownguardCuirassKv == 0    AddItem TownguardCuirassKv 1    EquipItem TownguardCuirassKv  endif    set shield to 1elseif cmPartnersQuest.nShield == 2 && shield == 1  if GetItemCount TownguardKvShield >= 1    UnequipItem TownguardKvShield    RemoveItem TownguardKvShield 1  endif  if GetItemCount TownguardCuirassKv >= 1    UnequipItem TownguardCuirassKv      RemoveItem TownguardCuirassKv 1  endif  set shield to 0  AddItem cmTorch02 1  EquipItem cmTorch02  RemoveItem cmTorch02 1  endif; LEVELUPif cmPartnersQuest.nLevel == 0 && levelup == 1    set levelup to 0elseif cmPartnersQuest.nLevel == 0 && levelup == 0 && ( GetBaseActorValue Health < npchealth )  SetActorValue Health, npchealthelseif cmPartnersQuest.nLevel == 1 && levelup == 0  set npclevel to GetLevel  set pclevel to Player.GetLevel  set pchealth to ( Player.GetBaseActorValue Health )  set npcmagicka to ( GetBaseActorValue Magicka )  set npcfatigue to ( GetBaseActorValue Fatigue )  set npcspeed to ( GetBaseActorValue Speed )  set npcathletics to ( GetBaseActorValue Athletics )  set npcacrobatics to ( GetBaseActorValue Acrobatics )  set levelup to 1  if npctype == 1    set npchealth to ( 0.85 * pchealth )    SetActorValue Health, npchealth  elseif npctype == 2    set npchealth to ( 0.80 * pchealth )    SetActorValue Health, npchealth  elseif npctype == 3    set npchealth to ( 0.75 * pchealth )      SetActorValue Health, npchealth   endif endifEnd; AI PACKAGE CONTROLSBegin OnPackageStart "cmInventory"  if partner == 2 && IsInCombat != 1    set inventory to 1  endifEnd Begin OnPackageStart "cmFollowPlayer"  SetFactionRank NPCParty, 1  SetFactionRank NPCStand, 0  SetFactionRank NPCStay, 0EndBegin OnPackageStart "cmStandGuard"  SetFactionRank NPCParty, 0 EndBegin OnPackageStart "cmStandby"  SetFactionRank NPCStand, 1  SetFactionRank NPCParty, 0 EndBegin OnPackageStart "cmWander"  SetFactionRank NPCStay, 1  SetFactionRank NPCParty, 0 End Begin OnPackageStart "cmPickLockContainer"  SetPackDuration 20EndBegin OnPackageDone "cmPickLockContainer" ; Commands NPC to rejoin Player after commands are executed.  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCParty, 1   EndBegin OnPackageDone "cmHarvestCommand"  set warp to 1  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCParty, 1  EndBegin OnPackageStart "cmEatCommand"  SetPackDuration 40  EndBegin OnPackageStart "cmDrinkCommand"  SetPackDuration 40  EndBegin OnPackageStart "cmDrunkCommand"  SetPackDuration 40EndBegin OnPackageDone "cmLootArmor"   ; Daisy-chaining Loot AI Packages so that Partner NPC's will loot various items automatically after combat or on command, and then return to the Player when done.  RemoveScriptPackage  AddScriptPackage "cmLootWeapon"  SetPackDuration 10EndBegin OnPackageDone "cmLootWeapon"     RemoveScriptPackage  AddScriptPackage "cmLootAmmo"  SetPackDuration 5EndBegin OnPackageDone "cmLootAmmo"  RemoveScriptPackage  AddScriptPackage "cmLootIngred"  SetPackDuration 5EndBegin OnPackageDone "cmLootIngred"   RemoveScriptPackage  AddScriptPackage "cmLootGold"  SetPackDuration 5EndBegin OnPackageDone "cmLootGold"  set warp to 1  RemoveScriptPackage  AddScriptPackage "cmFollowPlayer"  SetFactionRank NPCParty, 1    EndBegin OnAlarm 0, Player   set crime to 1EndBegin OnAlarm 1, Player   set crime to 1EndBegin OnAlarm 2, Player    set crime to 1EndBegin OnAlarm 3, Player    set crime to 1EndBegin OnAlarm 4, Player   set crime to 1EndBegin OnAlarm 0  set npccrime to 1EndBegin OnAlarm 1  set npccrime to 1EndBegin OnAlarm 2    set npccrime to 1EndBegin OnAlarm 3   set npccrime to 1EndBegin OnAlarm 4   set npccrime to 1End

User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Sat May 28, 2011 5:25 am

try commenting out the ondeath loop on the essential NPC, and see if that makes any difference. given that one should 'die'.... that might be complicating issues some.
User avatar
Samantha Jane Adams
 
Posts: 3433
Joined: Mon Dec 04, 2006 4:00 pm

Post » Sat May 28, 2011 4:05 am

I originally removed the whole script from the NPC, but even just commenting it out didn't do anything :o This is a real noodle scratcher
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am


Return to IV - Oblivion