I love this template, but i'm new to coding and I can't figure out how to make the character stats actually impacted by the player choices.
Viewing post in Twine/Sugarcube 2 Template comments
I had the same problem before! I'm not the creator and i am sorry for answering so late but here's what I found:
For stats: Make sure to put the stat you want (I will use "introverted" and "extroverted" for this example) in the Storyinit passage first, so for example:
<<set $introvert to 50>> <<set $extrovert to 50>>
- Then, if you have your stats page ready, you put in the stat bar:
<div class="stat-bar-group">
<div class="stat-bar-container">
<div class="stat-bar-overlay-left">Introvert $introvert%</div>
<div class="stat-bar-overlay-right">Extrovert $extrovert%</div>
<div class="stat-bar" id="stat"></div>
</div></div>
- Now, when the character gains points for the stat you can add something like this in the passage your writing your story in:
<<set $introvert to 55>><<set $extrovert to 45>>
For character customization: I'm still a bit confused on this one but this is what worked for me. On a profile passage, you make a variable command.
<<if $profile is true>>
Really cool character description
<</if>>
(If you want to leave a message when the player hasn't chosen, lets say a hair color, you can do something like this):
Your hair color is... <<if $haircolor is true>> $haircolor <<else>> uh... you don't know yet <</if>>
- Now, you can let the player chose an option for their character's looks by:
a) Your hair color is... *<<link "Brown">><<set $haircolor to "brown">>
This is for more of a list
b) Your hair color is... <<textbox "$haircolor" "">>
This allows the reader to write the hair color themselves
c) Your hair color is... <<include "Cycling">>
For this option you have to make a passage to enter in a code like this:
<<silently>>
<<if not $choices>>
<<set $choicesCount to -1>>
<<set $choices to ["brown", "auburn", "black", "white", "ash grey"]>>
<</if>>
<<set $choicesCount to $choicesCount + 1>>
<<if $choicesCount >= $choices.length>>
<<set $choicesCount to 0>>
<</if>>
<<set $haircolor to $choices[$choicesCount]>>
<</silently>>
\<<linkreplace $choices[$choicesCount]>><<include "Cycling">><</linkreplace>>
Hope this helps!! :D