Is there a gotoref equivalent for goto_scene? That is, something that would allow me to use goto_scene with a variable. I think it would be a nice little debug tool. I’d like to be able to skip ahead to whatever scene I’m working on without having to replay the whole game each time, especially since I already have a kind of “new game +” function that allows me to keep previous stats. So at the end of each scene I’d like to add something like:
*if debug=true
*choice
# Continue
*finish
# Skip to a different scene
*input_text skip
*[tweaked goto_scene command] skip
*finish
I think what your looking for is simply the update to goto_scene command which allows you to go to any scene and then any label inside of that scene. SImply put in the scene you want to go to…
*goto_scene chapter2 war
The game will automatically skip to the scene called chapter2 and look for a *label war and things will roll out from there. I highly recommend not using *gotoref.
Well, the way I want to do it, I’d only need this tiny block of code at the end of each scene. Right now I have 48 scenes so if I do a simple choice, it would look like:
*choice
# Skip to chapter 1
*goto_scene 1
(etc. all the way up to chapter 48)
# Continue
*finish
Which means 99 lines of code! Even if I decided to paste that at the bottom of each scene, if I were to add or rename chapters, I’d have to change the code again on every page! That wouldn’t be helpful at all.
Thanks! That’s what I thought, but it’s not working for me. My code right now is:
*if debug=true
*choice
# Skip to a different scene
*input_text skip
Are you sure you want to skip to scene ${skip}?
*goto_scene {skip}
# Continue
*finish
*finish
I added the “are you sure” bit just to verify that I could use the curly braces and get the right value for skip. The value I entered was a3 (my file is called a3.txt). Here is what I get:
I’m rather new to coding and I might be way off here, but…should that be *goto_scene {skip} instead of just {skip}, without the sign? In looking at the error message, it seems like perhaps the program thinks you’re trying to go to a scene that’s called {skip}, rather than a scene called a3. And I’m guessing in this instance, ${skip} = a3, aye?
Again, throwing random and probably worthless theories out here, but were you trying to run a compiled version? I know that when compiling, all of the scenes must be listed in the scene list, even if they’re never accessed with *finish, or else the game won’t compile properly.
I can’t reproduce the problem you’re having. In Firefox, with the current latest version of ChoiceScript up on github, I replaced startup.txt with this:
*create leadership 50
*create strength 50
*temp skip
*choice
# Continue
*finish
# Skip to a different scene
*input_text skip
*goto_scene {skip}
*finish
I was then able to type animal or variables into the box, and it just worked.