Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

SugarCube 2 How to use arrays?

$
0
0
I have this:
StoryInit
<<set $LOW_SKILL = 1>>
<<set $MID_SKILL = 2>>
<<set $HIGH_SKILL = 3>>
<<set $SALARY[$LOW_SKILL] = 100>>
<<set $SALARY[$MID_SKILL] = 200>>
<<set $SALARY[$HIGH_SKILL] = 300>>
Somewhere in passages:
<<set $skill = $LOW_SKILL>> (or $MID_SKILL or $HIGH_SKILL)
<<set $money += $SALARY[$skill]>>
I have error: <<set>> bad evaluation. Cannot set property "1" of undefined.
In documentation note like $obj[$index] is something about members. But I need only numeric arrays for my constants.
What need I do?

Viewing all articles
Browse latest Browse all 1844

Trending Articles