- Sep 11, 2021
- 49
- 18
Before opening this thread, I spent hours trying to solve the problem on my own, but I'm exhausted.
I am designing an HTML based game and I have a rank progression bar. When the bar reaches enough $rankpoint value, it resets and it works fine until here.
The problem is that I can't set the $rankpoint variable. When I made the bar, I set the $rankpoint variable via JavaScirpt (let rankpoint = 0) and now I can't increase or decrease this variable with the <<set>> macro, in short, I can't interfere with the variable. What I don't understand is that $rankpoint is defined as 0 in StoryInit.
Example:
When I write <<set $rankpoint to $rankpoint +10>> at the beginning of the "patrol" passage, $rankpoint does not change, but when I change $rankpoint to other variables like $energy and $health, it works fine.
I have no javascript knowledge. Do I need to increase $rankpoint via javascript, if so, how can I do this?
NOTE: I use Twine/Sugarcube
I am designing an HTML based game and I have a rank progression bar. When the bar reaches enough $rankpoint value, it resets and it works fine until here.
The problem is that I can't set the $rankpoint variable. When I made the bar, I set the $rankpoint variable via JavaScirpt (let rankpoint = 0) and now I can't increase or decrease this variable with the <<set>> macro, in short, I can't interfere with the variable. What I don't understand is that $rankpoint is defined as 0 in StoryInit.
Example:
When I write <<set $rankpoint to $rankpoint +10>> at the beginning of the "patrol" passage, $rankpoint does not change, but when I change $rankpoint to other variables like $energy and $health, it works fine.
I have no javascript knowledge. Do I need to increase $rankpoint via javascript, if so, how can I do this?
NOTE: I use Twine/Sugarcube