Hello all,
New arrival here. I've only been tooling around with Twine for a week, so feel free to respond with a link if there's documentation on this that my searching today didn't uncover. (I admit I'm bad at searching, especially for my glasses. if only I could see to look for them...)
I have an object array of 'people' and a for loop that iterates across the array to populate a table.
It "works" and the table is filled out, but when I click on the resultant click macros, they all call the index from the end of the loop, not the pass they were on when they were produced inside the for loop.
So... I keep getting this error:
How do I get Twine/Sugarcube2/Javascript to evaluate $i into a number during the creation of the click button rather than when it's clicked? <<print>> seems to work for everything BUT the stuff inside my click-replace macro pair.
New arrival here. I've only been tooling around with Twine for a week, so feel free to respond with a link if there's documentation on this that my searching today didn't uncover. (I admit I'm bad at searching, especially for my glasses. if only I could see to look for them...)
I have an object array of 'people' and a for loop that iterates across the array to populate a table.
It "works" and the table is filled out, but when I click on the resultant click macros, they all call the index from the end of the loop, not the pass they were on when they were produced inside the for loop.
So... I keep getting this error:
from:Error: <<Hehas>>: error within widget contents (Error: <<if>>: bad conditional expression in <<if>> clause: Cannot read property 'type' of undefined)
What seems to be happening is that when I click on the 'Look' button, my widget <<Hehas>> is being passed $people[2] and since I'm just doing testing so far, my character list is only $people[0] and $people[1].<<print "<td><<click \"Look\">><<replace \"#displayArea\">> <<Hehas $people[$i]>> ... <</replace>><</click>></td>">>
How do I get Twine/Sugarcube2/Javascript to evaluate $i into a number during the creation of the click button rather than when it's clicked? <<print>> seems to work for everything BUT the stuff inside my click-replace macro pair.