I was experimenting with my choicescript game commands and with the help of various forums that I read, I managed to make one. If anyone can suggest an improvement for my code, I will appreciate it, but my goal in writing this is topic is to help other people who are also having a hard time hiding the relationship or stat chart until it is needed. (I’m still new in coding so forgive me if I use the wrong terms or unable to use the proper jargons.)
The first thing that I did was to create a character relationship in the startup txt, which I then set to 0 so that relationships will not appear in the startup screen.
Note: RelChar1 can be changed into whatever label you like.
*create RelChar1 100
*create RelChar2 100
*create RelChar3 100
*create RelChar4 100
*create RelChar5 100
*create RelChar6 100
*create RelChar7 100
*create RelChar8 100
*create RelChar9 100
*set RelChar1 0
*set RelChar2 0
*set RelChar3 0
*set RelChar4 0
*set RelChar5 0
*set RelChar6 0
*set RelChar7 0
*set RelChar8 0
*set RelChar9 0
Then I went into the choicescript_stats and created an if-else statement.
*if RelChar1 = 0
*goto no_data
*else
*stat_chart
percent RelChar1 Char1
*if RelChar2 = 0
*goto no_data
*else
*stat_chart
percent RelChar2 Char2
*if RelChar3 = 0
*goto no_data
*else
*stat_chart
percent RelChar3 Char3
*if RelChar4 = 0
*goto no_data
*else
*stat_chart
percent RelChar4 Char4
*if RelChar5 = 0
*goto no_data
*else
*stat_chart
percent RelChar5 Char5
*if RelChar6 = 0
*goto no_data
*else
*stat_chart
percent RelChar6 Char6
*if RelChar7 = 0
*goto no_data
*else
*stat_chart
percent RelChar7 Char7
*if RelChar8 = 0
*goto no_data
*else
*stat_chart
percent RelChar8 Char8
*if RelChar9 = 0
*goto no_data
*else
*stat_chart
percent RelChar9 Char9
*label no_data
Characters that you have met will appear in this screen.
Now the way this code works is if the stated relationship of your character is 0, it will automatically go to the no_data label. If the relationship is more than 0, the relationship chart would automatically appear on the show stat screen. Now you can increase the relationship for your character at any point in your game. An example of this would be the following:
“Hello, Char1!” You greeted the woman sitting on top of the desk.
*set RelChar1 30
Once a value for RelChar1 is more than 0, their relationship chart would now appear on the show stats screen. As previously stated, until you set a value more that 0 for a character, their chart would not appear on the show stat screen.
However, I admit that there is one tragic flaw with this code that I made. If you decreased the character’s relationship unknowingly to 0, the relationship chart would once again disappear from the show stat screen. In some instances, this can be helpful especially in situations where you want to kill off your characters.
I hope that this topic helps everyone in some way.