Agnot2006 Posted October 21, 2011 Share Posted October 21, 2011 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 More sharing options...
Skevitj Posted October 21, 2011 Share Posted October 21, 2011 (edited) 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 endifThis 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 October 21, 2011 by Skevitj Link to comment Share on other sites More sharing options...
Agnot2006 Posted October 21, 2011 Author Share Posted October 21, 2011 Thank YouI will give that a tryIts a script attached to a companion. Link to comment Share on other sites More sharing options...
Agnot2006 Posted October 22, 2011 Author Share Posted October 22, 2011 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 suggestedWhat 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 More sharing options...
Skevitj Posted October 23, 2011 Share Posted October 23, 2011 Did you check the return values from the statement, of are you saying they're <100 due to the trigger variable never being reset? Try setting it up to read out the values from the tests. Link to comment Share on other sites More sharing options...
Agnot2006 Posted October 23, 2011 Author Share Posted October 23, 2011 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 100All 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 More sharing options...
Skevitj Posted October 23, 2011 Share Posted October 23, 2011 PerceptionCondition is head condition, EnduranceCondition is torso. BrainCondition is for bugs and robots, corresponding to the body part where you frenzy them. Stats List for reference. Link to comment Share on other sites More sharing options...
Agnot2006 Posted October 23, 2011 Author Share Posted October 23, 2011 Fantastic I want to Thank You for all your help Link to comment Share on other sites More sharing options...
Recommended Posts