Jump to content

Help with Players limb condition please


Agnot2006

Recommended Posts

Can anyone please tell me what the code is to get Players limb condition?

Not player.GetHealth, but damage to chest, head arms and legs.

I tried the script below but it doesn’t seem to work V1VarContainerQuest.PlayerWoundedSevereConversation its always 1.

If player.GetAV LeftAttackCondition == 100 && player.GetAV RightAttackCondition == 100 && player.GetAV LeftMobilityCondition == 100 && GetAV RightMobilityCondition == 100 && player.GetHealthPercentage == 100
Set V1VarContainerQuest.PlayerWoundedSevereConversation to 0
endif
	
	If player.GetAV LeftAttackCondition < 100
		Set V1VarContainerQuest.PlayerWoundedSevereConversation to 1
			StartConversation PlayerREF V1WoundedPlayerSevere
	endif
	If player.GetAV RightAttackCondition < 100
		Set V1VarContainerQuest.PlayerWoundedSevereConversation to 1
			StartConversation PlayerREF V1WoundedPlayerSevere
	endif
	If player.GetAV LeftMobilityCondition < 100
		Set V1VarContainerQuest.PlayerWoundedSevereConversation to 1
			StartConversation PlayerREF V1WoundedPlayerSevere
	endif
	If player.GetAV RightMobilityCondition < 100
		Set V1VarContainerQuest.PlayerWoundedSevereConversation to 1
			StartConversation PlayerREF V1WoundedPlayerSevere
	endif
	If player.GetHealthPercentage < 100
		Set V1VarContainerQuest.PlayerWoundedSevereConversation to 1
			StartConversation PlayerREF V1WoundedPlayerSevere
	endif

Link to comment
Share on other sites

Unless I'm mistaken, you can't nest functions like that. The if test condition that resets the variable will never test true.

 

If you flipped the order around, such that it tests for every set condition, and only resets it once the others had failed, the logic would be a lot simpler. eg:

if player.GetAV LeftAttackCondition < 100 
set *** to 1 
start... 
elseif player.GetAV RightAttackCondition < 100 
set ... 
start... 
elseif player.GetAV LeftMobilityCondition < 100 
set ... 
start... 
elseif player.GetAV RightMobilityCondition < 100 
set ... 
start... 
elseif player.GetHealthPercentage < 100 
set *** to 1 
start... 
else 
set *** to 0 
endif

This method should also result in a smaller script compilation and run time, since you're only calling getav for an attribute once per frame, instead of twice every frame in your method. It will still try and start the conversation every frame the script is run though, what are you attaching the script to?

 

What's the purpose of the the variable though if you're going to be starting the conversation from the script? Unless it's used somewhere else, sure, but if it's only used in this script, it's useless.

Edited by Skevitj
Link to comment
Share on other sites

I’m afraid it still doesn’t work somehow its always less than 100 whether the player if injured or not.

Can You help with that?

This is the new version as hopefully as you suggested

What Have I done wrong?

       if player.GetAV LeftAttackCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV RightAttackCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV LeftMobilityCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV RightMobilityCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetHealthPercentage < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
else  
	Set aajeallesGirlsRepairSB.PlayerHurt to 0
	Set aajeallesGirlsRepairSB.PlayerHurtSaid to 0
endif

Link to comment
Share on other sites

I found the problem: player.GetHealthPercentage 1 is full health. So < 100 would always be true.

I have also tried player.GetAV braincondition < 100 for damage to head but it’s not associated with the players head because after getting a lot of damage indicated in Pipboy is still said 100

All I need now is something to indicate damage to head and torso can you help with that?

 

The test script now is:

Set aajeallesGirlsRepairSB.PlayerHurtLeftA to player.GetAV LeftAttackCondition
	Set aajeallesGirlsRepairSB.PlayerHurtRightA to player.GetAV RightAttackCondition
	Set aajeallesGirlsRepairSB.PlayerHurtLeftM to player.GetAV LeftMobilityCondition
	Set aajeallesGirlsRepairSB.PlayerHurtRightM to player.GetAV RightMobilityCondition
	Set aajeallesGirlsRepairSB.PlayerHurtHealthP to player.GetHealthPercentage
	Set aajeallesGirlsRepairSB.PlayerHurtHead to player.GetAV braincondition
if player.GetAV LeftAttackCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV RightAttackCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV LeftMobilityCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV RightMobilityCondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetAV braincondition < 100  
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
elseif player.GetHealthPercentage < 1
	Set aajeallesGirlsRepairSB.PlayerHurt to 1
else  
Set aajeallesGirlsRepairSB.PlayerHurt to 0
Set aajeallesGirlsRepairSB.PlayerHurtSaid to 0
endif

Link to comment
Share on other sites

  • Recently Browsing   0 members

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