Scene jumping (Can it be done?)


#1

There’s a side-project I’d like to start working on (well, a second project)…

I’d like to set it up where you progress through a bunch of days (50 total), and you can visit three different locations each day. I’d like to set it up where, at some of the locations you visit, what happens there advances with the number of times you’ve visited (like RO encounters). What I’d like to know is, can I set it up where I can temporarily jump to a scene specifically set up for a certain location, then jump back to the scene I had been at in the progression of days? If I can’t, I can just set it up where the location information is included in each day, but that would significantly increase the size of the game, and I would rather compress 50x the same thing into 1. But to do so, I’d need to be able to jump to a scene not necessarily in sequence in the CS scene list at the beginning of the startup, and then back. Can this be done?


#2

Yeah, it can be done using *goto_scene (scene name).


#3

Yep, that should be easy enough to do.

You’ll need to have permanent variables to keep track of the number of times you’ve visited each scene. Otherwise just use the *goto_scene command to navigate between scenes instead of relying on *finish. And remember to use it on both scenes.


#4

Okay. I wasn’t sure if it could be done, because in the CS tutorial it says the scenes need to be in order so CS recognizes what should be where. I can figure out (with a bit of time) how to add variables to keep track of time progression and location progression, and even how to jump back to the scene you arrived from, but I wasn’t sure if CS would allow you to move around in scenes out of sequence. It’s a major help to know that you can. Thank you.


#5

They only need to be in order for the *finish command. (Not sure if the auto-testers use that list too.)

If you don’t use the finish command then you can jump around using *goto_scene to your heart’s content. There’s even a command that you can jump to specific parts of a scene now.


#6

:slight_smile: Thank you. I know about the *goto (labelname) … but I didn’t know about *goto_scene

It will really help me to be able to *goto_scene rather than *finish! TY FairyGodfeather.


#7

Slightly relevant.


#8

Wow! Now I understand what you actually meant. That’s amazing and handy!


#9

I tend to work better from examples. I was trying to think if any of the existing games used a similar system. I’d suspected Neighbourhood Necromancer did, have just checked the code to confirm and it does. It lets you jump around to different locations, and uses *goto_scene to do so.

It looks like it’s in the free trial too, so I’d suggest checking out its code just to see it in action. (Although I definitely suggest buying the game anyway if you haven’t because it’s fun to play.)

Have a look at
https://www.choiceofgames.com/neighbourhood-necromancer/scenes/startup.txt just to see what’s done with the scene list.

Then https://www.choiceofgames.com/neighbourhood-necromancer/scenes/stageone.txt (do a find for ‘what will you do’ and scroll down to that point so you can see the scene select text.)

And then http://www.choiceofgames.com/neighbourhood-necromancer/scenes/graveyard.txt is one of the examples of how a location that you can visit multiple times is implemented. Note how it sets it so the text changes each time you visit.


#10

If you have a lot of non-sequential scenes, just use *finish at the end of your last scene; otherwise use *goto_scene and then *page_break. Or *gosub_scene, which sounds like it would work better for this.