For tracking the overall relationship (across the game) for each RO I would use a permanent, dedicated variable for each (*create RO1_relationship - or whatever you want to call it).
I think you have this, as you mention that your choices + or - for the RO that is being spoken to. For clarity, I would expect something like this:
You walk over and begin chatting to Steve
#Tell him he is hot
*set Steve_relationship + 1
#Tell him he smells
*set Steve_relationship - 1
Then repeat for each different RO, using their dedicated variable in each case.
So you end up with a number of variables (one for each RO) which contains a value of 0 - X, with the higher number denoting a better relationship. You then want to pick which RO enters into a scene based on those relationships.
This is a straightforward, but not so elegant way to achieve this (I haven’t yet thought of whether there is a more elegant way to do it):
Disclaimer: I have tested this briefly, but can not guarantee it is 100% perfect.
This thread also discusses the issue.
*create Steve_relationship 0
*create Sarah_relationship 0
*create Sam_relationship 0
*create Sean_relationship 0
*create Highest_relationship "Steve"
*create Highest_relationship_stat 0
*set Steve_relationship 5
*set Sarah_relationship 3
*set Sam_relationship 6
*set Sean_relationship 6
*set Highest_relationship_stat Steve_relationship
*if Sarah_relationship > Highest_relationship_stat
*set Highest_relationship "Sarah"
*set Highest_relationship_stat Sarah_relationship
*if Sam_relationship > Highest_relationship_stat
*set Highest_relationship "Sam"
*set Highest_relationship_stat Sam_relationship
*if Sean_relationship > Highest_relationship_stat
*set Highest_relationship "Sean"
*set Highest_relationship_stat Sean_relationship
*if Highest_relationship = "Steve"
*if Highest_relationship = "Sarah"
*if Highest_relationship = "Sam"
*if Highest_relationship = "Sean"
Lines 1-14 will sit inside your startup.txt
Lines 16-39 will sit in whichever file you want to calculate who has the highest relationship score and have something occur off the back of it.
Setting the Highest to “Steve” at the beginning is just a default. Essentially the code assumes it is Steve, then tests Sarah against Steve’s scores; if she is higher, then she replaces Steve as the highest. Then we test Sam against the ‘highest’ who is now Sarah. By line 26 you now have a text string stored in ‘Highest_relationship’ that you can compare against, you then use that to filter which scene plays - obviously each seen is tailored to the RO that goes to assist.
The main problem arising here is for a tie, Sam and Sean are both 6, but the code will select Sam (as Sean is not higher and therefore that if statement won’t fire). There are ways to handle draws (something along these lines):
*if Sean_relationship > = Highest_relationship_stat
Do something to record it is a tie
*if Sean_relationship > Higher_relationship_stat
set Sean as highest
Also, if you are planning to calcute the highest relationship often during your game, it would be worthwhile wrapping lines 16-26 into a subroutine that will go away and calculate the winner, so that you don’t have to repeat that code everywhere.