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

Having trouble with making text clickable to change a variable but not move to another passage.

$
0
0
I am trying to output variables from an array of objects into a chart and make each of the first variables in a row clickable to change another variable, but not move to another passage. here is the code below of what I have so far, and it gives me an error each time. This is in sugarcube also.

<<nobr>>
<<set $currentCity="5">>
/*formats a table to output $randomCity array*/
<table border="1" width="100%" height="0%">
<tr>
<th>#</th>
<th>$cityList[0].name</th>
<th>$cityList[0].population</th>
<th>$cityList[0].taxRate</th>
<th>$cityList[0].crime</th>
</tr>
<<for $x=1;$x<11;$x++>>

<tr>
<td>$x</td>
<td>
<<click $cityList[$x].name >><<set $currentCity =$cityList[$x].name>><</click>>
</td>
<td>$cityList[$x].population</td>
<td>$cityList[$x].taxRate</td>
<td>$cityList[$x].crime</td>
</tr>

<</for>>
</table>
$currentCity
<</nobr>>


Viewing all articles
Browse latest Browse all 1844

Trending Articles