Hi there! So I’m trying to code a hub where players can spend their day off doing various activities, and each activity moves time forward until the day ends. If they’re spending time with an NPC, I want to use a *gosub_scene command to direct them to the separate NPC files, and then a *return at the end of that NPC file to go back…
*label dayoffchoices
*choice
#I'll spend some time with a companion.
Which Shepherd will you spend time with?
*choice
*hide_reuse *if (bladedayoff = false) #Blade.
*set dayoff +1
*goto_scene blade
*hide_reuse *if (tallysdayoff = false) #Tallys.
*set dayoff +1
*goto_scene tallys
*hide_reuse *if (troubledayoff = false) #Trouble.
*set dayoff +1
*goto_scene trouble
*hide_reuse *if (sherydayoff = false) #Shery.
*set dayoff +1
*goto_scene shery
*hide_reuse #I'll do some strength and weapons training.
*set dayoff +1
*goto strength
*hide_reuse #I'll study magic and spell-casting.
*goto magic
*set dayoff +1
*hide_reuse #I'll take a moment to pray.
*set dayoff +1
*goto pray
#I'll go shopping.
*goto shop
*hide_reuse #I'll run a few errands to earn some extra gold.
*set dayoff +1
*goto parttime
*hide_reuse #I'll rest until the end of the day.
*set dayoff +5
*goto rest
As you can see, right now I have it as *goto_scene, not *gosub_scene. The reason why I need *gosub is because going to a different scene (and then being redirected back to this scene and this label) “resets” the *hide_reuse command, so if you trained in strength or something, then hung out with an NPC, when you came back to this hub, you’d have the ability to train again (which you shouldn’t).
I’m hoping *gosub_scene will negate that, but my problem is the *return at the end of the NPC file takes them back to that nested choice, not to the top of the label (dayoffchoices). I could just not use *return and use *goto_scene dayoff dayoffchoices, but I’ve read that not having a *return for a gosub is game-breaking…
What if you just had the blade, tallys, etc. bits within the same scene? Just stick those parts later in the file. Then you won’t have to worry about the resetting of *hide_reuse at all. It may make your file longer, but that’s ok.
It would make things a lot simpler, but also a huge pain for my own organizational purposes! Each interaction is 3000-5000 words long, there will be probably 10+ interactions per each NPC, and there are 11 NPCs altogether haha… It’s way easier to keep track of everything when they’re in separate files, so I’m hoping I can still do that!
If not, I’ll have to do as you said when everything’s all written out…
okay, where do you want the story to go when the player ‘return’ from the gosub?
The choice body?
A later label?
if the former do like this I think
choice
#I'll spend some time with a companion.
Which Shepherd will you spend time with?
*choice
*hide_reuse *if (bladedayoff = false) #Blade.
*set dayoff +1
*gosub_scene blade
(flavortext telling the player time has passed yadda yadda)
*goto dayoffchoices
It works to get the scene to flow how it should (going back to the choices hub after *returning from an NPC scene) but it doesn’t stop other choices from resetting the *hide_reuse! I think the only way to make that work is to make a bunch of true/false toggles for those or do as @Gower said and just put it all in the same scene!
So if you choose to hang out with an NPC and use *gosub to go to their separate scenes, like this:
choice
#I'll spend some time with a companion.
Which Shepherd will you spend time with?
*choice
*hide_reuse *if (bladedayoff = false) #Blade.
*set dayoff +1
*gosub_scene blade
(flavortext telling the player time has passed yadda yadda)
*goto dayoffchoices
any other choice under *label dayoffchoices that might have been *hide_reused (any activity that’s not hanging out with an NPC) will have been reset:
*hide_reuse #I'll do some strength and weapons training.
*set dayoff +1
*goto strength
*hide_reuse #I'll study magic and spell-casting.
*goto magic
*set dayoff +1
*hide_reuse #I'll take a moment to pray.
*set dayoff +1
*goto pray
In other words, if you hang out with an NPC, do strength training (which should be hide_reused after you do it), then hang out with another NPC, when you return to *label dayoffchoices, strength training pops up again as if you hadn’t already done it!
Mnnn… what happens if you don’t nestle the choice, but make that its own label like…
*label a
*choice
*if (meetcounter !=4) #thing
*goto b
*hide_reuse #thing 2
*goto c
*label b
*choice
*hide_reuse #a
*set meetcounter +1
Gosub stuff
*goto a
*if (meetcounter = 4) there is no one else.
*goto a
Just tried it–same thing! I think whenever you leave the scene, the *hide_reuse will reset no matter what! (Unless you do everything as a true/false toggle)