Hi! I’m super new to any kind of coding and taking my first crack at creating a game. I’ve been trying to figure out how to do something, and if this has already been answered here somewhere I have yet to find it, so I could use some help!
Within my story there is a character who would be going by a fake name at the beginning, and the player would later learn their actual name.
I would really like for the relationship percentage bar on the stats page to have the fake name at the beginning of the game, then later change when their actual name is revealed. I don’t know the best way to set that up, though. Especially because I don’t want to make it more difficult to adjust the stat itself by accident.
So I’m wondering if it is possible/relatively simple to
- Literally just have the name change?
- Have 2 different percentage bars for the 2 names, but only one visible at a time?
- Add text after the name at some point and have it say something like “(aka Actual Name”)?
Again, I am basically a baby when it comes to code. I have no idea what I’m doing, and I don’t want to make it harder than it has to be. Any guidance would be greatly appreciated!
Hey, I’m not amazing at code, but I know a simple enough method of achieving #2!
Basically do this at the start:
*create Andy 10 (any number will do, you do the %+10 etc. to this before the reveal)
*create Realname 10 (number doesn't matter, you do the %+10 etc. to this after they reveal their realname)
*create charactername1 "Andy"
And when they first reveal their real name, do:
*set charactername1 "RealName"
*set Realname Andy (This is to set the Realname variable to the same number as the original)
It should affect this stat chart as you want it to, just make sure the indent style is the same as you’ve been doing:
*if charactername1 = "Andy"
*stat_chart
percent Andy
*else
*stat_chart
percent Realname
Hopefully I didn’t do anything wrong, I’ve forgotten a lot of how choicescript works atm. If there’s a way to make this more streamlined, I don’t remember if it’s possible lol
EDIT: I rlly did forget how to code, I corrected it now so names display in the percent bar as “Name: 10%” if you prefer the variable name not showing 
You can use your character’s name in the story like this (or just write it as their name lol):
My name is ${charactername1}.
2 Likes
What @Kezthier suggests will work, but I would probably have a separate variable you can set to true when the player knows the character’s real name, and then use a multireplace to check which name shows before the percentage bar.
*stat_chart
percent character_relationship @{name_known TrueName|FakeName}
This would also let you show any additional text after the true name, if you wanted.
You would need to remember to set the variable to true in the game itself, though!
6 Likes
Thanks for answering this!
I attempted to do what you said, but when I go to the stats page I’m getting an error popping up saying "Non-existent variable ‘@{name_known’ ", but on my startup page I have
*create name_known false
Also I’m using CSIDE and it has the little thing to view variables, and name_known is showing up there. So I’m not sure what I’m doing wrong or why its saying that?