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

Adding sentences to Arrays

$
0
0
Hello there.

I've using the following code to contain and display information about npc's during my game:
<<set $npcs to {
		barkeeper:{name: "Unknown",
					interaction: 0,
					aff: "",
					related:"",
					remarks:"",
					visible:false,
					},
		waitress:{name: "Unknown",
				interaction: 0,
				aff: "",
				related:"",
				remarks:"",
				visible: false,}
}>>

And it's been working great.
Now, I've been setting new variables like so:
<<set $npcs["barkeeper"].name to "Ric">>
Which works fine when it's a just a name, for example.
But in the case, let's say of
$npcs["barkeeper"].remarks
I would like to add multiple sentences. My intention, was that during the game, when you discovered a new detail about the character I would add it to this variable so that it could be displayed later. Something like "he likes beer", "he does not like blonds", and so on and on. Now this may be a totally dumb question, but I don't know how to add new sentences to the array, only set it as something completely new.

I feel like it's just a matter of syntax that I'm not familiar with, but I would love any assist. Thanks!
(and I've been using Twine 2 and Sugarcube 2.18)

Viewing all articles
Browse latest Browse all 1844

Trending Articles