Create two variables as percentages of a single stat?

I’ve combed through the wiki, but haven’t been able to find an answer to this:

Is there a way to create a variable that is broken down into percentages, those percentages being two other variables?

Specifically, I’ve created a stat “persuasion” but want to break it down into an opposed pair (intimidate/charm) to add flavor to the text. Is there a way to do this or will I have to track it all separately?

It sounds like you want to be able to have three stats, all of them testable and *set-able, but two of them acting as opposed pairs, when then are used to calculate the third stat.

By opposed pairs, do you mean the sum of them will always be 100? (assuming you are using fairmath)? Or do you have some other, fancier ratio in mind?

My off-the-cuff sense is that you could simply make it so that whenever you gain intimidate, subtract from charm and vice versa (or whatever mathematical relationship you want them to have). A simple subroutine would make that pretty straightforward.

And then you could simply *set persuasion (intimidate + charm) after any such change. (assuming you want persuasion to be the sum of the pair)

You’ll have to make sure they never go below zero, though.

1 Like

Won’t this solve your problem?

*create persuasion 100

   percent persuasion

That’s why I wanted to do it in the reverse, really.

Persuasion will be a skill the MC can choose at the beginning, then build on it (so it’d be a 0-100 scale, but yes, using fairmath). So they’ll have “persuasion” before they ever get any intimidating or charming points. Instead of being a sum of intimidating + charming, it would instead be that persuasion is broken down into intimidating + charming.

I get what you’re saying. Maybe I can just have two separate stats on the stat chart: one for persuasion and one for persuasion “method” (with intimidate/charm on a percentage scale). I’ll try it like that.

Thanks to both of you!

I believe in that case the two names on left and right would not be directly testable—as well as the main stat—, which I think may be the desire here.

1 Like

Yeah, exactly.

The intimidate/charm is really just for flavor–pass a persuasion check and, unless we specifically offer the choice between intimidate or charm, you get text reflecting whichever is higher.

Oof… I’m not sure I understand the relationship between persuation, intimidate and charm :sweat_smile:

I’ll see if I can explain…

In a lot of games where persuasion is used, you have to basically choose whether you intimidate people or charm them. It’s always bugged me. The two are just different methods of getting people to do what you want, yeah? And if you’re good at it, then you should be able to do both, depending on the situation.

So instead of being forced to always go with intimidate so you can pass a persuasion check, you can do whatever rows your boat and your persuasion skill goes up. The reason I want to keep track of which is used more is for when we have a “minor” persuasion that there’s no option for, in which case the persuasion check can be passed and the resulting dialogue/text will be affected by whether the MC has a higher intimidate vs charming. Ex…

“I want that cupcake.”


persuasion check passed, charming

“Please?” you ask with puppy dog eyes, smiling when the doofus hands over his cupcake.

persuasion check passed, intimidate

“Either give me that cupcake or you’re gonna be breathing out of a straw the rest of your life,” you threaten, smirking when the doofus hands you the cupcake.

If I’m understanding correctly:

  • You want it so that Persuasion can be any value.
  • Persuasion is broken down into two, Charm and Intimidate.
  • Increasing Charm or Intimidate does not increase Persuasion.
  • If Persuasion increases, the Charm and Intimidate increase with it.

So, if Persuasion increases from 10 to 20, and Charm and Intimidate were both 5 (50%), then Charm and Intimidate become 10 (which remains 50%)

*create persuasion_percent 10
*create charm_intimidate_opposed 50

   percent persuasion_percent Persuasion
   percent (charm_intimidate_opposed * persuasion_percent * 0.01) Charm
   percent ((100 - charm_intimidate_opposed) * persuasion_percent * 0.01) Intimidate

Code above has it so that Charm and Intimidate move around, but should always add up to Persuasion no matter how much they move.


That wasn’t exactly what I was asking for, but I think it actually works better than what I had in mind and yields the same result.

Thank you!!

1 Like

Well, it looks like you got it figured out, but I’ll chime in if I may.

Tô me, it looks like persuasion is a skill and intimidation (buly?) and charming are personality traits. If so, it’s not that difficult. In fact a lot of games do just that. Traits mostly yields flavour text and skills are used in success-failure checks.

You could keep two variables, one for the skill and the other to be used as an opossed pair.

You can actually use opposed_pair, unless you want each trait in its own line.

1 Like

A quick question; maybe helps you to guide how you want this to go.

  1. How player builds their persuasion skill? Through character creation’s point distribution?
  2. How player define their charm/intimidation trait? Random roll or presented through choice?

Character creation will provide the base for the persuasion skill. It will be increased through choices (and training/practice), and the choices will be charm or intimidate, so when charm or intimidate increase, so does persuasion.

Charm and intimidate will be tracked as a percentage of the persuasion skill. So, say you start out with a 25 in persuasion and your first choice that checks your skill is to talk a vendor down in price on an item. If you choose to bully or charm him, then you would get +1 intimidate or +1 charm, and +1 persuasion (so 26 persuasion, 1 intimidation or charm): if you choose the intimidating option, then your intimidation (at that point) would be 100% (effectively, 26, but only temporarily) and your charm would be 0%. As soon as you hit another choice that affects the stats that way (sometimes it will just be a persuasion check and you won’t get an increase on persuasion), and you choose the charming option, then your intimidate/charm would be 50%/50% (effectively 13/13, if there was no persuasion increase).

Hell, now that I’m explaining it in a more detailed way, I think I’m making it too complicated. it might be easier just to track persuasion and the charm/intimidate separately and have the percentages go up and down as choices are made, without even considering the persuasion points, especially when the charm/intimidate is only there for flavor.

With the way how you track it down so 50/50 of 26 is 13/13, the only thing I fear is that you have PERSUASION on 26 but the game would somehow check it as 13, effectively worsening your persuasion if you don’t focus on one of guardian/renegade choice.

Yeah, I get what you’re saying. The funny part is that was the reason I wanted to do it this way, so the player wouldn’t have to focus on one or the other.

In some games, if you don’t focus solely on paragon or renegade, you can’t pass a persuasion check. I want persuade to include them both (if you’re good at persuading people, you can switch between the two with ease, instead of focusing on only one–that always drove me crazy in Mass Effect games). But I wanted to keep track of which is the most used, so when I put a minor persuasion check in (without adding a choice for dialogue), I can change the dialogue to match what is most used (or, if one isn’t significantly stronger than the other, make the text more vague about what was said/done for them to pass it).

I still think you’re perfectly describing the skill-trait dynamic.

  • If someone chooses intimidate, then persuasion skill increases and intimidation trait increases.
*set persuasion %+5
*set intimidate %+5
  • If someone chooses charm, then persuasion skill increases and charming trait increases (or intimidation decreases if used as opposed pair).
*set persuasion %+5
*set intimidate %-5
  • Success-failure checks are done with the skill. Flavour text is displayed according to the trait.
1 Like

@cup_half_empty Thank you! I will go ahead and set it up that way instead of trying to make things difficult. This is the first time I’ve tried coding with CoG, so there’s a learning curve. Seems fairly straightforward, most of the time, though. :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.