- May 23, 2023
- 19
- 85
Hi,
I'm doing a little game on Twine chapbook, the problem is that chapbook only allows to modify a variable in the var-section at the top of the passage. Wich means I can't modify a variable in its own passage (imagine you start with money ==1 but on the same page you end up money ==2, that is not possible, i need to increment it on next passage).
So here comes my issue:
I have a cycling choice, let's say "blue" or "red" then we go to next passage and depending on the choice the text differs. But I would want also to differ a variable (red+=1 if red was chosen etc) wich is not possible in the var-section, i can set red += 1 but not based on the choice i made so even if blue was chosen red would also get +=1 and so the choice would have no impact.
So is there a way to use JS to do that ? Or any other way ?
I know I could just split the passage in two but it's less fun and it's annoying to do 2 passages for the same text with only a few words that changes.
Thanks
I'm doing a little game on Twine chapbook, the problem is that chapbook only allows to modify a variable in the var-section at the top of the passage. Wich means I can't modify a variable in its own passage (imagine you start with money ==1 but on the same page you end up money ==2, that is not possible, i need to increment it on next passage).
So here comes my issue:
I have a cycling choice, let's say "blue" or "red" then we go to next passage and depending on the choice the text differs. But I would want also to differ a variable (red+=1 if red was chosen etc) wich is not possible in the var-section, i can set red += 1 but not based on the choice i made so even if blue was chosen red would also get +=1 and so the choice would have no impact.
So is there a way to use JS to do that ? Or any other way ?
I know I could just split the passage in two but it's less fun and it's annoying to do 2 passages for the same text with only a few words that changes.
Thanks