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

[SugarCube 2] Arrays within arrays?

$
0
0
Hello,

I'm trying to figure out how to build a relationship matrix within Twine 2/Sugarcube 2. I feel I am missing something very basic here.

I have $people[$i] where my people are described. For starters they have attributes of $people[$i].id, $people[$i].business, $people[$i].age, $people[$i].gender, $people[$i].favoriteSportTeam, and so on. What I want to be able to do is add something like $relationship[$k].id (which would be a people[$i].id, $relationship[$k].relationship (mother, brother, friend, etc.) and $relationship[$k].relationshiptype (probably a numeric scale of -10 (hatred and loathing) to 10 (love and trust)).

Can you have multidimensional arrays in Twine/Sugarcube? If so, how exactly are they referenced? I've been struggling trying to word my searches to find an answer. My best guess is $people[$i].$relationship[$k].id (or other attribute), but that doesn't seem to be working.

Thanks!

Viewing all articles
Browse latest Browse all 1844

Trending Articles