Bit of a problem getting relationship rank to work in script

Post » Thu Jul 07, 2016 8:55 pm

So, I'm creating a mod where if the person you're speaking to doesn't have a high enough relationship rank towards you then what you're trying to do won't work. However, no matter how I write my script I seem to be unable to get the right reaction at the right relationship rank.



If the character has a relationship rank of 3 or more towards the player then the positive message box should be displayed. However, when I test it even at rank 3 (and I use the getrelationshiprank console command to check) I get the negative message.



I've tried rewriting my script in several different ways, suggestions?



For reference, here are the two latest versions of the script:



---------------------------------Version 1-----------------------------------------------



if Game.GetPlayer().GetRelationshipRank(akSpeaker) > 2

if Game.GetPlayer().GetLevel() < SecondProgenyLevel.GetValue()

if TurnAmount.GetValue() < 1

Debug.MessageBox("They attentively listen as you explain the details of immortal life to them. Though initially hesitant, eventually they decide spending an eternity with you wouldn't be so bad. You nod before you bite into their flesh...")

else

Debug.MessageBox("They attentively listen as you explain the details of immortal life to them. Though initially hesitant, eventually they decide spending an eternity with you wouldn't be so bad. You nod and bite them, however when you're finish you notice the curse hasn't taken hold and conclude you are not yet powerful enough to turn more progeny.")

endif

elseif Game.GetPlayer().GetLevel() < ThirdProgenyLevel.GetValue()

if TurnAmount.GetValue() < 2

else

Debug.Notification("You cannot have any more progeny.")

endif

elseif Game.GetPlayer().GetLevel() < FourthProgenyLevel.GetValue()

if TurnAmount.GetValue() < 3

else

Debug.Notification("You cannot have any more progeny.")

endif

else

if TurnAmount.GetValue() < 4

else

Debug.Notification("You cannot have any more progeny.")

endif

endif

else

Debug.MessageBox("As you explain the details of immortal life to them their face changes and they shudder at the thought. Refusing to spend eternity with someone like you.")

endif

-----------------------------------Version 2---------------------------------------------


RelationshipRank.SetValue(akSpeaker.GetRelationshipRank(Game.GetPlayer()))

if RelationshipRank.GetValue() > 2

if Game.GetPlayer().GetLevel() < SecondProgenyLevel.GetValue()

if TurnAmount.GetValue() < 1

Debug.MessageBox("They attentively listen as you explain the details of immortal life to them. Though initially hesitant, eventually they decide spending an eternity with you wouldn't be so bad. You nod before you bite into their flesh...")

else

Debug.MessageBox("They attentively listen as you explain the details of immortal life to them. Though initially hesitant, eventually they decide spending an eternity with you wouldn't be so bad. You nod and bite them, however when you're finish you notice the curse hasn't taken hold and conclude you are not yet powerful enough to turn more progeny.")

endif

elseif Game.GetPlayer().GetLevel() < ThirdProgenyLevel.GetValue()

if TurnAmount.GetValue() < 2

else

Debug.Notification("You cannot have any more progeny.")

endif

elseif Game.GetPlayer().GetLevel() < FourthProgenyLevel.GetValue()

if TurnAmount.GetValue() < 3

else

Debug.Notification("You cannot have any more progeny.")

endif

else

if TurnAmount.GetValue() < 4

else

Debug.Notification("You cannot have any more progeny.")

endif

endif

else

Debug.MessageBox("As you explain the details of immortal life to them their face changes and they shudder at the thought. Refusing to spend eternity with someone like you.")

endif


---------------------------------------------------------------------------------------------

User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Return to V - Skyrim