And I’m back again!

Initally, I was writing relationship stats as percentages, the usual. I wasn’t fond of the idea to begin with, but it was the easiest to set up. However, I’m wanting to do something different now. I’m terrible at explaining, but, the idea is show the relationship status as purely text based. Example:

``````John: Good friends.
or
John: Rivals.
``````

However, I’m not sure how to put this in code, much less how to calculate it? I assume the calculating works like it would for percentages, ex.

``````You hugged John.
*set rela_John +2
*goto blahblah
``````

How would I set up; 2 points means friends status, or 10 points means good friends? Does that make sense at all?
I’d like to do something similar for MC stats as well, for their strength or knowledge, removing the percentages and making it a status that can improve throughout.

3 Likes

You could set it up with if/elseif/else statements.

Crude example:

``````   *if (johnr <= 3)
*set john_text "Rivals."
*goto XXXXXX
*elseif (johnr <= 7)
*set john_text "Freindly."
*goto XXXXXX
*elseif (johnr <= 13)
*set john_text "Great Freiends."
*goto XXXXXX
*else
*set john_text "BFFs."
*goto XXXXXX
``````

johnr is what I put as the john relationship variable.

1 Like

So…how do I put that in startup?? Like, do I need to `*create` anything? Or…?

using the above example you would just have to *creat john_text “” i think

I assume you want a score-based system, although this isn’t all that different than percentage in the sense that percent ranges from 1-100 while score gives you the freedom to set up the range.

You’d want to do:

``````*create john_lvl 1
``````

Then, whenever you want to modify this number, simply +1/-1 or set it to any level you like.

In the stats_screen, do this:

``````*if john_lvl = 1
John: Enemy
*elseif john_lvl = 2
John: Normal
*elseif john_lvl = 3
John: Ally
etc.    /// whatever kind of relationship you want, put it this way
``````

Alternatively, you can go a bit further by adding value-range if your game is a bit on the simulator side, so:

``````*if (john_lvl < 1)                            ///Score 1 less is not yet met
Haven't met
*elseif (john_lvl >= 1) and (john_lvl < 6)    ///score 1-5 is hostile relationship
Enemy
*elseif (john_lvl >= 6) and (john_lvl < 13)   ///score 6-13 is neutral
Normal
etc.
``````
1 Like

I think I understand…
How would I write that in stats, so it says: `John: Ally`, or something?
I also know it isn’t too terribly different, but it is easier for me and something I just like… aesthetically? I guess??? The stats are difficult, even with having a Fairmath calculator. I hate percentages so much.

Just write it `John: Ally`. No need to go fancy with `*stat_chart`.

Oooh, glad to see someone else going with text on this. I really like that compared to just numbers.

Here’s the code from my first story, Nuclear Powered Toaster, where the relationships were involved. Hopefully this displays right.

``````[b]Relationships[/b]

*if (ashow > 0)
Alexi thinks
*if (arlship < 6)
the only thing stopping him from shooting you in the back is that he doesn't want to waste the bullet.
*check_achievements
*if (choice_achieved_like = false)
*achieve nopop
*if ((arlship > 5) and (arlship < 9))
you should think more and talk a whole lot less.
*if ((arlship > 8) and (arlship < 13))
he doesn't quite know what to think of you yet.
*if ((arlship > 12) and (arlship < 15))
there might just be some profit in keeping you around.
*if ((arlship > 14) and (arlship < 20))
he hasn't liked a government employee this much inâ€¦well, forever.
*if (arlship > 19)
finding you was worth the minor concussion.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve like

*if (fshow > 0)
Fiorella thinks
*if (frlship < 6)
she's already preparing her testimony against you for a future trial.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((frlship > 5) and (frlship < 9))
it'd be great if you were as competent as you seem to think you are.
*if ((frlship > 8) and (frlship < 12))
she hasn't quite decided which side you're on, but she'll give you a chance.
*if ((frlship > 11) and (frlship < 15))
that she likes the cut of your jib.
*if ((frlship > 14) and (frlship < 20))
you may be scruffy-looking, but you're certainly not a nerf-herder.
*if (frlship > 19)
she doesn't want to do a mission without you, ever again.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if (hshow > 0)
\$!{bname} thinks
*if (hrlship < 6)
he should start looking for a good place to bury your body.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((hrlship > 5) and (hrlship < 9))
all things considered, he was probably better off before he met you.
*if ((hrlship > 8) and (hrlship < 12))
he might as well stick with you for the time being.
*if ((hrlship > 11) and (hrlship < 15))
you really know how to handle yourself.
*if ((hrlship > 14) and (hrlship < 18))
where you lead, he will follow.
*if (hrlship > 17)
the only thing stopping him from voting you president of the world is that you're not running.  And that it's not a real thing.  And being prohibited from voting due to a couple of tiny little felony convictions.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if (eandlshow > 0)
Latasha thinks
*if (lrlship < 6)
she wouldn't spit on you if you were on fire.  Presumably because she's the one who put you to the torch in the first place.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((lrlship > 5) and (lrlship < 9))
you are definitely more than a little glitched up.
*if ((lrlship > 8) and (lrlship < 12))
that she is hopeful you'll be able to help.
*if ((lrlship > 11) and (lrlship < 15))
you have some great ideas.
*if ((lrlship > 14) and (lrlship < 18))
that you're her spirit animal.
*if (lrlship > 17)
you've helped to give her life meaning.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if (eandlshow > 0)
Elgin thinks
*if (erlship < 6)
it's about time for you to exit, stage left.  Permanently.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((erlship > 5) and (erlship < 9))
that your company is growing tiresome.
*if ((erlship > 8) and (erlship < 12))
you may not be the hero Mallard Valley wants, but you are the one it needs.
*if ((erlship > 11) and (erlship < 15))
if nothing else, you're keeping things lively.
*if ((erlship > 14) and (erlship < 18))
the sight of you warms his not-actually-old bones.
*if (erlship > 17)
you're his inspiration.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if ((nshow > 0) and (alexi = 1))
Neb thinks
*if (nrlship < 6)
he can't let you do that, Dave.
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((nrlship > 5) and (nrlship < 9))
you're just another depressing meatbag.
*if ((nrlship > 8) and (nrlship < 12))
his opinion of you needs more data
*if ((nrlship > 11) and (nrlship < 15))
that you're not bad for a human.
*if ((nrlship > 14) and (nrlship < 18))
you are a valuable source of input.
*if (nrlship > 17)
he's secretly hoping Alexi will sell him to you.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if ((nshow > 0) and (alexi = 2))
Neb thinks
*if (nrlship < 6)
*check_achievements
*if (choice_achieved_nopop = false)
*achieve nopop
*if ((nrlship > 5) and (nrlship < 9))
you humans are all alike.
*if ((nrlship > 8) and (nrlship < 12))
you're his favorite owner.  Also his least favorite, since he's never been owned by anyone else.
*if ((nrlship > 11) and (nrlship < 15))
*if ((nrlship > 14) and (nrlship < 18))
that he wants you inside him.  And not just because it gives him clearance to engage his weapon systems.
*if (nrlship > 17)
you're his 42.
*check_achievements
*if (choice_achieved_like = false)
*achieve like

*if (tshow > 0)
Train thinks
*if (goodguy < 0)
*check_achievements
*if (goodguy < 1)
you could be a better guy!
*if ((goodguy > 0) and (goodguy < 4))
you're a good guy!
*if ((goodguy > 3) and (goodguy < 6))
you're a very good guy!
*if ((goodguy > 5) and (goodguy < 8))
you're an extremely good guy!
*if (goodguy > 7)
you could be the fabled Best Goodest Guy Ever!  The legend is real!
*check_achievements
*if (choice_achieved_bestguy = false)
*achieve bestguy
``````

FYI, every relationship stat started at 10. Certain actions or dialogue options would raise or lower it a point (or two, if it was a big deal). Overall I was pretty happy with how it came out, although clearly I didn’t give enough options for ticking off the happy-go-lucky Train, given that I think the only person on Steam to get the Bad Guy achievement is me.

4 Likes

Oh…really? That seems deceptively simple. And it would change accordingly, like depending on the total relationship points?

If your conditional checks (no puns here) are correct, of course, it will change accordingly.

1 Like

I might be slightly biased because I hate numbers. Period. Math is my enemy, numbers are the bane of my existence, and I love that title so much. Oml. I’ve never seen so may *if statements in one sitting, I’m amazed. Thank you for offering the code! Seeing things laid out like that often times makes much more sense than explaining in text form.

1 Like

No idea how to edit my reply to reply to you as well, but, to clarify, I don’t need to have it as a variable? Such as `John: \${relationship}`?

No. Of course, you can go that way, but I think the process would go even more roundabout like trying to deposit your money on the bank.

1 Like