Jump to content

Scripting Ghost People problem


Crystalking52

Recommended Posts

Greetings, I'm working on a mod for NV and I've run into a snag with the Ghost People in Dead Money. See, I'm trying to disable the visual effects of their dismemberment but no matter what changes I make to the script governing this, they just keep on getting their limbs destroyed. I've even gone as far as to disable combat gore completely in the game settings. What am I doing wrong?
Link to comment
Share on other sites

What am I doing wrong?

 

You're not telling us specifically what changes you tried in the scripting, so it's difficult to provide an answer without knowing if you've already tried it.

 

Going through script NVDLC01GhostSCRIPT and removing the dismember parameter from all of the KillActor lines would seem to be a reasonable course of action.

Link to comment
Share on other sites

 

 

You're not telling us specifically what changes you tried in the scripting, so it's difficult to provide an answer without knowing if you've already tried it.

 

Going through script NVDLC01GhostSCRIPT and removing the dismember parameter from all of the KillActor lines would seem to be a reasonable course of action.

 

Woops, sorry about that.

 

I commented out the killactor player # lines and that did nothing. I tried changing them to just killactor player and then tried changing them into kill, but those did nothing too. I did have to start up a new game to test these changes, correct?

Link to comment
Share on other sites

I commented out the killactor player # lines and that did nothing. I tried changing them to just killactor player and then tried changing them into kill, but those did nothing too. I did have to start up a new game to test these changes, correct?

 

I can't say for certain. Half of the dismemberment calls are in the OnHit block, the other half in the GameMode block. The ones in the GameMode block are wrapped in a conditional "if" block that only get used during the Dead Money story.

 

For this test I modified the "if" block to be (1 == 1) so it was always true.

1. In a save where I had just stepped out of Doc Mitchell's house after creating my character, I went behind the house and spawned a ghost person.

2. I hacked at him with a machete and observed the dismemberment process.

3. In the GECK I removed all the dismemberment parameters so the lines were only "KillActor Player," and saved these changes in a test plugin.

4. With this test plugin loaded, I redid steps 1 & 2. I observed that the ghost person did not get dismembered when they died. I tried it with both a machete and a 10mm pistol and got the same result.

 

So, on the surface the process seems to do what it sounds like you want it do. I cannot say what is happening in your situation.

 

I commented out the killactor player # lines and that did nothing.

 

This is very odd, if you commented those lines out the ghost people should not die at all. The fact that instead it did nothing suggests maybe the plugin wasn't loaded, or it is somehow being override by another mod that also changes that script?

Edited by viennacalling
Link to comment
Share on other sites

 

 

I can't say for certain. Half of the dismemberment calls are in the OnHit block, the other half in the GameMode block. The ones in the GameMode block are wrapped in a conditional "if" block that only get used during the Dead Money story.

 

For this test I modified the "if" block to be (1 == 1) so it was always true.

1. In a save where I had just stepped out of Doc Mitchell's house after creating my character, I went behind the house and spawned a ghost person.

2. I hacked at him with a machete and observed the dismemberment process.

3. In the GECK I removed all the dismemberment parameters so the lines were only "KillActor Player," and saved these changes in a test plugin.

4. With this test plugin loaded, I redid steps 1 & 2. I observed that the ghost person did not get dismembered when they died. I tried it with both a machete and a 10mm pistol and got the same result.

 

So, on the surface the process seems to do what it sounds like you want it do. I cannot say what is happening in your situation.

 

Bizarre. Can you tell me the command you used to spawn a ghost people? It'd save me a fair amount of travelling since my testing process involved creating a new save file each time I made changes to my script, going through the bits of Doc Mitchell, and then 'coc'ing to the bunker and going through the Sierra Madre intro and then finding a Ghost Person there. At one time, I was 'coc'ing directly into the Sierra Madre, but for some reason that caused all of the Ghost People to never die (always falling down and standing back up.)

 

Perhaps I forgot to save my changes or something stupidly small like that. Oh and I'm not using any other mods that touch that script and I know it's enabled.

 

EDIT: Well, I tried deleting and remaking the ESP, but no go (I used the GRA Bozar.) Which area did you change the if block to 1 == 1 to? Oh and will this lalso prevent their corpses from being dismembered?

Scn    NVDLC01GhostSCRIPT

; - Jorge & Rob 

Short	bFlagOn
Short 	bChallenge
Short	bWorship
Short bBarked
Int		nDeadState ; 0 = Alive, 1 = Dead, 2 = Semi-Dead
Float	fRandom
Float 	fRandomBark

ref ActivatingActor

Begin OnLoad

if (player.HasPerk NVDLC01GhostHunter)
	; do nothing so ghosts can be killed without dismemberment
elseif (nDeadState != 1)
	SetActorRefEssential 1;																; We set the Essential flag because setting it in the NPC's entity (Actor Window) will have permanent effect.
endif

End

Begin OnDeath

PlaySound3D NPCGhostRealDeath;
SetActorRefEssential 0;
Set nDeadState to 1;

End
; <<<<----------------

; >>>>----------------
Begin OnHit NVDLC01FightingStarlet

SetActorRefEssential 0;
CIOS LaserDisintegrationFXSpell;
KillActor NVDLC01FightingStarlet 1
Set nDeadState to 1;

End
; <<<<----------------

; >>>>----------------
Begin OnHit	

; JSH 11.29.10 - Added check to make sure Ghost Person doesn't reset aggression each time he's hit.
if (GetAV Aggression < 1)
	SetAV Aggression 1																; 11.12.10 JF - Whenever a ghost person is hit, they get pissed.
	SetAV Assistance 2																; This is used when a ghost person is currently worshipping a hologram.
endif

If (nDeadState == 2)
	If (Player.GetWeaponAnimType < 4)											; If Player is using a Melee, or Unarmed weapon.
		Set nDeadState to 1;															; Set the Ghost dude to "Dead 4 Realz" state.
		If (IsLimbGone 0 10 != 1)														; If the Ghost dude has limbs intact.
			Set fRandom to GetRandomPercent;									; We call a random number, and then dismember a limb according to the result.
			If (fRandom < 10)															; The purpose of this is to make it easier for players using Melee/Unarmed to dismember downed Ghost People.
				KillActor Player;
			Elseif (fRandom < 25)
				KillActor Player;
			Elseif (fRandom < 40)
				KillActor Player;
			Elseif (fRandom < 55)
				KillActor Player;
			Elseif (fRandom < 70)
				KillActor Player;
			Elseif (fRandom < 85)
				KillActor Player;
			Else
				KillActor Player;
			Endif
		Endif
	Endif	
Endif

If (nDeadState == 1)
	SetActorRefEssential 0;
endif

If (GetDead == 0) && (nDeadState != 1) && (player.HasPerk NVDLC01GhostHunter)			; Added nDeadState check and Ghost Hunter perk to ensure the OnLoad block doesn't reset the ghost person to alive when they're supposed to be dead.
	SetActorRefEssential 0;
endif
End
; <<<<----------------

; 11.12.10 JF - Added to allow Dog's script to change a var in this script

begin onActivate

set ActivatingActor to GetActionREF

; When Dog starts devouring a ghost person, we use this block to set nDeadState so the chewed up ghost person doesn't come back to life
if ActivatingActor.GetIsReference NVDLC01DogREF
	set nDeadState to 1
else
	Activate
endif

end


; >>>>----------------
Begin GameMode

if (GetDisabled == 0) ;Adding this check in here to make sure that when Ghost People are disabled the extra scripts below checking AV's don't fire since those AV's are cleared out on disabling, causing them to be killed and kill cams to occasionally fire. (CES 12/8/10)

If (nDeadState == 1)
	If (bChallenge == 1)
		Return;
	Else
		If (GetIsID NVDLC01CrGhostTrapper) || (GetIsID NVDLC01CrGhostTrapperET) || (GetIsID NVDLC01CrGhostTrapperETDG) || (GetIsID NVDLC01CrGhostTrapperETSpecial) || (GetIsID NVDLC01CrGhostTrapperLob) || (GetIsID NVDLC01CrGhostTrapperVilla)
			IncrementScriptedChallenge NVDLC01ChallengeGhostEaterTrapper;
		ElseIf (GetIsID NVDLC01CrGhostSeeker) || (GetIsID NVDLC01CrGhostSeekerET) || (GetIsID NVDLC01CrGhostSeekerETDG) || (GetIsID NVDLC01CrGhostSeekerLob) || (GetIsID NVDLC01CrGhostSeekerWT) || (GetIsID NVDLC01CrGhostSeekerWTNorth) || (GetIsID NVDLC01CrGhostSeekerWTSouth)
			IncrementScriptedChallenge NVDLC01ChallengeGhostEaterSeeker;
		ElseIf (GetIsID NVDLC01CrGhostHarvester) || (GetIsID NVDLC01CrGhostHarvesterET) || (GetIsID NVDLC01CrGhostHarvesterETDogEat) || (GetIsID NVDLC01CrGhostHarvesterLob) || (GetIsID NVDLC01CrGhostHarvesterVilla) || (GetIsID NVDLC01CrGhostHarvesterVilla02) || (GetIsID NVDLC01CrGhostHarvesterWT) || (GetIsID NVDLC01CrGhostHarvesterWTGala01) || (GetIsID NVDLC01CrGhostHarvesterWTSouth)
			IncrementScriptedChallenge NVDLC01ChallengeGhostEaterHarvester;
		Endif
		SetActorRefEssential 0;
		Set bChallenge to 1;
		Return;
	Endif
Else
	If (GetStageDone NVDLC01MQ01 5 && NVDLC01SlideBoxRef.bEndingDone == 0)
		If (bFlagOn == 0)
			SetActorRefEssential 1;																; We set the Essential flag because setting it in the NPC's entity (Actor Window) will have permanent effect.
			Set bFlagOn to 1;																		; The new function that toggles Essential flag on/off is meant to be used only in scripts - it cannot fully alter an NPC flagged as Essential in its Actor Window checkbox.
			Return;
		Else
			If (nDeadState != 1)
				If (IsActorRefEssential) && (Player.HasPerk NVDLC01GhostHunter)	; Safety fall-through to set the ghost not essential if the player has the Ghost Hunter perk and the ghost isn't currently essential
					SetActorRefEssential 0;
					Return;
				Elseif (IsInCriticalStage GooStart) || (IsInCriticalStage GooEnd) || (IsInCriticalStage DisintegrateStart) || (IsInCriticalStage DisintegrateEnd)	; If the ghost is getting critically zapped by an energy weapon
					SetActorRefEssential 0;														; We strip the Ghost dude of its essential flag.
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV PerceptionCondition <= 0)										; And then we check the condition of its limbs. If any of these is below 0, then we explode it, and kill the fella outright.
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV RightAttackCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV LeftAttackCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV RightMobilityCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV LeftMobilityCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV EnduranceCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (IsLimbGone 0 12 == 1)													; If any of the Ghosts limbs are missing
					SetActorRefEssential 0;														; We strip the Ghost dude of its essential flag.
					Set nDeadState to 1;															; Set it dead
					KillActor Player;																; Kill it, rewarding the player xp
					Return;
				Elseif (IsAnimPlaying == 0 && nDeadState != 2)							; If the Ghost dude is knocked down, this means that we've taken it into Semi-Dead state (equivalent of GetDead == 1, and then resurrecting the actor after a few seconds).
		
					Set fRandomBark to GetRandomPercent;
					If (fRandomBark <= 33)
						;Companion Barks for telling the player to kill the Ghost Person - CES 10/29/10
						if ( NVDLC01Followers.bDeanHired == 1 )
							NVDLC01DeanREF.SayTo player NVDLC01DeanDialogueGhostDeadBark
						elseif ( NVDLC01Followers.bChristineHired == 1 )
							NVDLC01ChristineREF.SayTo player NVDLC01ChristineDialogueGhostDeadBark
						Endif
					Endif
		
					PlaySound3D NPCGhostDeath;											; after which they will get up, as if they still were Essential. However, during this time, they can be killed normally (but not looted, until dead).
					SetActorValue PerceptionCondition 10;									; Set limb condition to low, so high level ghosts are easier to kill while unconscious
					SetActorValue RightAttackCondition 10;							
					SetActorValue RightMobilityCondition 10;
					SetActorValue LeftAttackCondition 10;
					SetActorValue LeftMobilityCondition 10;
					SetActorRefEssential 0;	
					Set nDeadState to 2;															; Set the var of state to 2 = Semi-Dead.
					Return;
		
				Elseif (IsAnimPlaying == 1 && GetKnockedState == 0 && nDeadState != 0)
					If (Player.HasPerk NVDLC01GhostHunter)								; Player has the Ghost Hunter Perk, so we don't set them essential upon getting back up
						PlaySound3D NPCGhostEmergeVox;									; Play get up sound
						Set nDeadState to 0;														; The Ghost Dude is now back to normal.
					Else
						PlaySound3D NPCGhostEmergeVox;							
						SetActorRefEssential 1;													; If player doesn't have Ghost Hunter, set the Essential flag back to "On."
						Set nDeadState to 0;	
					Endif
					Return;
				Elseif (nDeadState == 0)
					If (IsActorRefEssential != 1)
						If (Player.HasPerk NVDLC01GhostHunter != 1)
							SetActorRefEssential 1;												; Since the checks above all force a Return; call when they run, we can safely here re-apply the Essential flag
						Endif																			; otherwise, loading a savegame will reset it to 0 (this flag does not get stored in the savegame data for each ref).
					Endif
				Endif
			Endif
		Endif
	Endif
Endif

Endif
End
; <<<<----------------
; <<<<---------------- Finish Code;

Edited by Crystalking52
Link to comment
Share on other sites

Bizarre. Can you tell me the command you used to spawn a ghost people?

 

PlaceAtMe. For the random low-level ghost person I selected:

 

player.placeatme xx0117FF 1

 

where xx was the load order for Dead Money.

 

 

At one time, I was 'coc'ing directly into the Sierra Madre, but for some reason that caused all of the Ghost People to never die (always falling down and standing back up.)

 

This is because of the previously mentioned if statement. If you do not meet the conditions in the if statement (i.e. if you are not still playing through Dead Money) and if you do not have the perk NVDLC01GhostHunter the ghost person will still be set as essential.

 

Which area did you change the if block to 1 == 1 to?

 

These are changes I made for testing:

 

The relevant part of the OnHit block

If (nDeadState == 2)
	If (Player.GetWeaponAnimType < 4)											; If Player is using a Melee, or Unarmed weapon.
		Set nDeadState to 1;															; Set the Ghost dude to "Dead 4 Realz" state.
		If (IsLimbGone 0 10 != 1)														; If the Ghost dude has limbs intact.
			Set fRandom to GetRandomPercent;									; We call a random number, and then dismember a limb according to the result.
			If (fRandom < 10)															; The purpose of this is to make it easier for players using Melee/Unarmed to dismember downed Ghost People.
				KillActor Player;
			Elseif (fRandom < 25)
				KillActor Player;
			Elseif (fRandom < 40)
				KillActor Player;
			Elseif (fRandom < 55)
				KillActor Player;
			Elseif (fRandom < 70)
				KillActor Player;
			Elseif (fRandom < 85)
				KillActor Player;
			Else
				KillActor Player;
			Endif
		Endif
	Endif	
Endif

 

The relevant part of the GameMode block

	If (1 == 1)
		If (bFlagOn == 0)
			SetActorRefEssential 1;																; We set the Essential flag because setting it in the NPC's entity (Actor Window) will have permanent effect.
			Set bFlagOn to 1;																		; The new function that toggles Essential flag on/off is meant to be used only in scripts - it cannot fully alter an NPC flagged as Essential in its Actor Window checkbox.
			Return;
		Else
			If (nDeadState != 1)
				If (IsActorRefEssential) && (Player.HasPerk NVDLC01GhostHunter)	; Safety fall-through to set the ghost not essential if the player has the Ghost Hunter perk and the ghost isn't currently essential
					SetActorRefEssential 0;
					Return;
				Elseif (IsInCriticalStage GooStart) || (IsInCriticalStage GooEnd) || (IsInCriticalStage DisintegrateStart) || (IsInCriticalStage DisintegrateEnd)	; If the ghost is getting critically zapped by an energy weapon
					SetActorRefEssential 0;														; We strip the Ghost dude of its essential flag.
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV PerceptionCondition <= 0)										; And then we check the condition of its limbs. If any of these is below 0, then we explode it, and kill the fella outright.
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV RightAttackCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV LeftAttackCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV RightMobilityCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV LeftMobilityCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (GetAV EnduranceCondition <= 0)
					SetActorRefEssential 0;
					Set nDeadState to 1;
					KillActor Player;
					Return;
				Elseif (IsLimbGone 0 12 == 1)													; If any of the Ghosts limbs are missing
					SetActorRefEssential 0;														; We strip the Ghost dude of its essential flag.
					Set nDeadState to 1;															; Set it dead
					KillActor Player;																; Kill it, rewarding the player xp
					Return;

Link to comment
Share on other sites

Alright sir, I basically had all that minus the disabling Dead money's intro quest part and I figured out why it was gibbing (or at least a guess.) As I mentioned in my last post, I used the Bozar as a test weapon and it was hitting the Ghost People more than once. Dealing the death blow doesn't gib them (such as with a single shot weapon like a 10mm pistol) but hitting their corpse afterwards does gib them. If that can also be disabled, my mod will be complete. I'm gonna look into seeing why their corpses gib even with all the game settings related to gibbing disabled.

 

Also, thanks for putting up with all of my bumbling.

Link to comment
Share on other sites

Have you tried editing NVDLC01GhostBodyPartData to make their limbs un-severable and not explodable?

 

No sir because I did not know it existed until this moment, so you have saved me! I'm gonna edit this and see if it solves all my problems.

 

EDIT: It worked! Thanks to both of you sirs! You'll be in the credits of my mod once I release it (gotta take some comparison pictures first.)

Edited by Crystalking52
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...