Gosub placement (I guess...?)

Hello everyone! Hope all of you are having a nice day.

So the problem I have is not some pesky code errors trying grate on my nerves (Ha! take that “bad token” error!), but rather the placement of a code (code block? Code section? Idk🤷‍♂️).

So first, lemme divide this into two parts trying to incompetently describe my problem😅

My purpose

So what I’m trying to achieve here is something like in WotW, where you would get a central hub-like scene to choose different actions to pass your day. I kind of fell in love with that (kudos to @MahatmaDagon for that👏), and wanted it to implement it in my own twisty, messy way in my detective story, for finding and examining clues and if you have enough clues (more than 50% of a case’s total discoverable clues), you would be able to guess who the criminal was (wow, boring right?).

The problem

The problem I’m facing here is that where should I exactly place my code. I mean, Ik I have to use the *gosub command here, but in which file I should put this hub? Should it be in startup.txt or should I create a routines file or should I put it in every chapter/case file?

I know I probably didn’t made any sense above, but nevertheless, thank you!


I feel this could very quickly become a thread full of long essays and opinions. There’s no “right way” to do this. The beauty of code is that it’s flexible, and entirely up to you how to implement.

My first thought is to have it be its own scene: hub.txt, which you go-to after every chapterN.txt. That way you don’t even have to mess around with gosubs. But there are plenty of alternatives, and each will have their own pros and cons. Experiment a little? See what works for you.


So kind of like an extra file where I would go back-and-forth using *gosub and *goto_scene?

Nah, it isn’t that interesting of a topic😂

Just putting a *goto_scene to it at the end of every chapter. You’d obviously need a way to keep track of which chapter you’re on though, so you know which one is next, after the hub.

1 Like


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.