Help! I've written myself into a corner

Eeek!

Is there a way to go to a specific sub-scene within a new scene?

Problem: In my WIP I give the reader 4 choices at the end of the last completed chapter. Each choice needs its own sub-scene in the next chapter. But without thinking I ended them all with *finish, because I have not written the next chapter yet.

After posting the WIP for game play, I now realize I don’t know how to route these choices into another scene without messing up the current game saves. Everything I can think of will have me rewriting the end of the chapter I’ve already posted.

So is there a way I can rescue this, so people who have already played the WIP, and saved their progress, don’t have to replay from the beginning? I used CJW’s autosave script to enable the game saves.

I hope this makes sense…

*goto_scene can be used to go to a label within a scene.

*goto_scene denouement bad_ending

But I find the description of your problem confusing; it’s not clear to me that this trick will help you sort out your problem.

Thanks!

I don’t think it will solve the problem, unfortunately. I don’t think there is a way to solve it without rewriting the chapter ending, which will invalidate the current saved games, I think.

I’ve pulled the link until I can fix the ending. Sigh.

If you have a variable that is specific to each of your scenes, you could use that to direct the players to the correct part of the new path. For example, if your health stat has to be over 5 for path one, but is less than 5 for all of the other paths, then you can start your new scene with:

*if health >5
*goto path_one_continuation

You can use similar other stats for the other paths.

Here’s the code:

I closed my eyes and hoped that I would be chosen to bathe
*choice
#Agamemnon
*set bathname “Agamemnon”
*goto agbath
#Achilles
*set bathname “Prince Achilles”
*goto genbath
#Odysseus
*set bathname “King Odysseus”
*goto genbath
#Menelaus
*set bathname “King Menelaus”
*goto genbath

*label agbath
All eyes were on me.
*fake_choice
#I lowered my head in acceptance.
#I took a deep breath and lifted my chin.
#I smiled.

I turned and left the room, knowing Agamemnon would follow.
*finish

*label genbath
“My daughter Polyxena will serve you well, King Agamemnon,” Priam said, waving his dark-haired daughter forth.

Agamemnon nodded briefly.

Polyxena gave a slight curtsy and approached the High King. “It would be my honor to serve you, my lord, if you would follow me.”

Priam’s gaze fell on me. Gesturing me forth, he said, “${bathname}, my youngest daughter Cassandra would be pleased to serve you.”
*fake_choice
#I lowered my head in acceptance.
#I took a deep breath and lifted my chin.
#I smiled.

I turned and left the room, hoping ${bathname} would follow.
*finish

That’s perfect. You have 4 different bathname choices. Start the new scene with:

*if bathname = "Agamemnon"
  *goto agamemnon_path
*if bathname = "Prince Achilles"
  *goto prince_achilles_path
*if bathname = "King Odysseus"
  *goto king_odysseus_path
*if bathtime = "King Menelaus"
  *goto king_menelaus_path

Then:

*label agamemnon_path

Path story written here

Repeat for the other paths.

Right now the bathnames are only temp variables, so I’ll have to create them as regular variables. I was hoping to find a way to do this that does not wreck the already saved games, but I don’t think that’s possible. :frowning:

You shouldn’t be afraid of “wrecking it”, it’s a WIP after all. People will understand. You’re most likely going to need new variables inserted into startup sooner or later anyways as you come up with new ideas, and that will most likely wreck it anyhow. Better to not limit yourself.

1 Like

Have you tried asking @CJW if there’s a fix/workaround?

Sadly there isn’t really a ‘generic’ fix-all work around, but as @MutonElite says, if it’s an early-stage WIP, you’re going to change and break things anyway - people will understand us.

If you’re really that concerned about it, my top suggestion would be to switch to the smPlugin framework and save at specific interlude intervals (scenes that don’t have any code but the save code in for example). This will keep saves from being bodged by scene edits (causing line numbers to change), though the addition of extra variables and the like is obviously still going to cause problems.

Okay, I’m trying to fix my previous mistake now. I am trying to go to a label (either “agabath” or “generalbath”) within the scene “baths”. I’ve written it like this:

*goto_scene baths_agabath

and also

*goto_scene baths agabath

and both times I get the following error:

Couldn’t load URL: scenes/baths_agabath.txt
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

Any ideas on what I’ve gotten wrong here?

Thanks so much!

*goto_scene baths_agabath is correct. First make sure that the file is in the correct folder (most likely it is, but worth a check). If that’s fine, do you have any unusual text in baths_agabath itself? That could cause a problem. Failing all that, I’d ask Dan Fabulich as the error isn’t one I’ve come across before.

Edit: after re-reading, you say you want to go to a label within the scene baths. To go to a label, use *goto, not *goto_scene…

It’s a label within a different scene. I used the command Dan used above, but I wasn’t sure of the second underscore…

I’ll check the folders.

What’s the name of the scene file you’re trying to visit? Assuming you’re trying to go to the agabath label inside baths.txt then *goto_scene baths agabath will do the right thing.

You say that it said “Couldn’t load URL: scenes/baths_agabath.txt” in both cases, but that sounds to me like you forgot to save when you tried changing it from goto_scene baths_agabath to *goto_scene baths agabath. It will only try to open baths_agabath when you type that exact word somewhere in your code.

Hmm. Okay, I’ve double, triple checked. Files are all in the same folder. I’ve corrected to *goto_scene baths agabath (or general bath). I still get the following error when i try to playthrough.

NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

FYI…the baths scene works fine by itself on playthrough…it’s just when I try to switch scenes.

Any thoughts?