Twine Version: 2.6.2
Sugarcube Version: 2.36.1
I’m trying to make a player object which will be accessed and modified both during character creation and along the game, this is my current code:
<<set $player = {
name: "",
money: 0,
debuffs: [],
buffs: [],
spells: [],
books: [],
journal: [],
inventory: [],
/* Stats */
determination: 0,
intelligence: 0,
dextery: 0,
social_skills: 0,
strenght: 0,
/* Skills */
/* Dextery */
bow: 0,
throwing: 0,
two_handed: 0,
polearm: 0,
crossbow: 0,
gunpowder: 0,
stealth: 0,
painting: 0,
/* Social Skills */
negotiation: 0,
non_verbal: 0,
leadership: 0,
acting: 0,
music: 0,
/* Determination */
faith: 0,
mental_strenght: 0,
mental_resistance: 0,
/* Strenght */
athletism: 0,
unarmed: 0,
constitution: 0,
/* Intelligence */
animals : 0,
humanities: 0,
medicine: 0,
engineering: 0,
perception: 0,
/* Others */
hp: 0,
max_hp: 0,
}>>
When I tried to print the values, such as $player.hp
I get the following error:
Error: <<print>>: bad evaluation: State.variables.player is undefined
What am I doing wrong and how to fix it?