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

Arrays as object properties

$
0
0
I am using the most current version of Sugarcube and Twine 2 and I have an object set up that has an array as one of its properties, and now I need to pull out a specific element in that array and I'm having problems.

Code below.
<<for $ca=0;$ca<4;$ca++>>\
	<<switch $chararray[$ca]>>\
		<<case "chief">>\
			<<if $chief.where[$chief.plot] == $actloc>>\
				Continue the Chief's plot at this location by talking to the $chief.who[$chief.plot].\
			<</if>>\

When I use this particular notation $chief.where[$chief.plot], I get back the full array of $chief.where, plus the current value of $chief.plot, not the specific element within the $chief.where that is located at the $chief.plot place, which is what I want.

Any suggestions?

Viewing all articles
Browse latest Browse all 1844

Trending Articles