Gosub file showing in game when play-testing


I play test my game in Firefox after I’ve added a couple of new chapters.

Today, when I play tested, and clicked Next Chapter on the to move on to the next scene file, the game loaded the gosub file.

My text file ends like this:

“All right!” You agree. “You both can be another set of my secret eyes and ears, informing me
about the comings and goings in Nottinghamshire, the Palace, and London before it gets out to
everyone else."

“We will!” She hugs you. “This is wonderful! You have no idea how I’ve been
wanting to stick it to my cousin for so long, and this gives me the chance.”

The Merry Men gives Marian three cheers because she is now the Mistress of the
Band of Thieves.


goto_scene RH8

But instead of going to scene RH8, it goes to the gosub file. I have 36 scene files, and this is happening on the 17th file.

I attempted to remove the extra files inside of the scene folder (except for the variables and the choicescript_stats files), and when I do, the quicktest does not run because it’s looking for the missing files. The random test, however, runs without finding any errors.

Can anyone help?



My first guess is that the *finish command right before the *goto scene is causing ChoiceScript to finish the current file and jump to the next file in the folder. Or rather, the next file in the *scene_list in your startup.txt file.

Does the error persist if you remove or relocate that *finish command?

My second guess, and possibly related to the first, but is your gosub file listed in your *scene_list in your startup.txt? I’m fairly certain you can use *gosub_scene and *goto_scene to call code from a scene file not listed in your startup.txt, but ChoiceScript cannot automatically proceed to that file after a *finish command.

If your gosub file is in your *scene_list, what happens if you remove it from that list?


Hey! Thanks for responding.

The gosub is not the next file in my start_list, so that’s not the problem. When I removed the gosub from the start up list, the game did not jump to RH8. However, when I removed the finish, it did jump to RH8. So I guess I will live with that: not have a chapter break before scene RH8.



Try replacing the finish line with a page_break:

*page_break Next


Ah, okay! Didn’t think to try that. Thanks! :blush: