I need help because of an error in my game

I’m trying to make a CoG game. I have this one problem when I’m in “Scene 1” then I use the *finish command at the end, but an error message pops up saying "Error Loading Scene ‘Scene’ - it may not exist. I have no clue how to fix this, so if anyone can help me, please do.

You’re in Scene 1 or trying to go to Scene 1? For some reason ChoiceScript can’t handle it if you’ve got spaces in the names of the scenes (the stuff you put in the scene_list that refers to the separate .txt files), so try changing it to Scene_1 instead and see if that works.

I just had (possibly) the same issue.

I went to each .txt file in my scenes folder and removed the spaces in their titles (I’d previously named them things like ‘0 - Prelude’).

Then I went in to my startup.txt file and changed each of the chapter titles there to remove the spaces. So in this case both became simply Prelude.

Cecilia_Rosewood’s solution worked for me, so hope it works for you. Good luck shawniepie. And thanks for visiting my WIP thread for ‘The Aegis Saga - Blood’.

Thanks for the help guys. unfortunately I’m on my phone right now so I can’t try it.

Just as an FYI, in my experience, it is also case sensitive, so double check that the names are consistent with spaces, spelling, and capitalization. Hope that helps and good luck!

This is because spaces are reserved for if you were to want to go to a specific label within a scene.

For example I have a text file just for things that don’t apply to specific chapters but are used in multiple chapters (I have a death message, and checkpoint/save system in a file called extras). I have the death message first because it is shorter and I don’t want to have to scroll through my whole save system just to get to the shorter part. But if I end a chapter I don’t want my death scene to appear then go to the save system. For this I use

*goto_scene extras save_system

This would bring me right to my *label save_system

2 Likes

Thank you guys for all of your help! I’ve been able to work on my game, and I feel like I could script anything (Even though I cant.)

That function wasn’t implemented yet when I first learned ChoiceScript, so yeah… Back then it didn’t have any reason not to work :sweat_smile:

1 Like

That’s a really cool tip I wasn’t aware of Kelvin.

I wonder if there’s a way to use the same system to jump back and forth within text - effectively a reread function (something requested by one of my proofers more used to flicking back and forth in a paperback). I know this goes against the spirit of the choices made by choicescripts developers, but could be interesting

It’s possible to code, it would just take a lot of effort (essentially it would near double all your code size).

Don’t 'spose you know of any examples around the forum?

Think I’d like to experiment with it one day - maybe in a really simple format (so Kelvin’s post made me think of doing it each chapter. But perhaps that would be better served by a last choice each chapter where one option - ‘reread chapter’ option was linked to a label at the start of that chapter).

Potentially what would be better is a way to use the stats screen somehow for a reread. So maybe the last body of explanatory text jumped into the stats page, then got overwritten by the next large body of explanatory text. Could be a boon to people who don’t like massive stats pages so much. .

@nightcap I haven’t tested these ways but this is basically how I did my save game in my game. Please point out any possible improvements

Variation 1

This way you create a second variable for every variable you have for example a variable named strength you would create a new one called save_strength. You would have to do this for every variable/stat.
At the beginning of every chapter you would have:

*gosub(_scene scene1) save_stats
*label beginning

And at the end you would have:

Would you like to reread this section?
*fake_choice
 #Yes 
  *gosub(_scene scene1) set_stats
  *goto beginning
 #No

*finish

In the first scene after the “finish” you would add:

*label save_stats
*set save_strength strength
...
*return
*label set_stats
*set strength save_strength
...
*return

You would not have the part in the parenthesis for the first chapter/scene.


Variation 2

If you wanted your proofers to be able to go back multiple chapters you would have to make even more save_strength’s. I would suggest save_strength_ch1 save_strength_ch2 … And put those in their respective chapters after each “yes” option instead of the gosub. There would be no use in having gosub’s anymore. Then you would move the label from where it is now to right before the previous question. You will also have to rename the label and add _scene after the goto.
At the beginning of every chapter you would have:

*label beginning (only in first scene)
*set save_strength_ch2 strength
...

And at the end you would have: (this example would be at the end of chapter 2)

*label ch2_reset
Would you like to reread this section?
*fake_choice
 #Yes 
  *set strength save_strength_ch2
  ...
  *goto(_scene scene1 ch1_reset)
 #No

*finish
1 Like

If that was at all confusing I understand I wrote it on my phone just ask if you are confused.

@Kelvin
That’s certainly quite useful, but if I may ask, this does look to be quite a tedious process, is there any reason you aren’t using CJW’s Smplugin.js for this? It would certainly save you a whole lot of headaching, especially if your main reason for having this is for beta-testers.

2 Likes

@Malebranche
Well… *scratches head

But yeah I saw the post a while ago but I guess I thought it was explaining how one could make a save, like in their game, so I ignored it. Anyway I’m going to see if I can try and figure that into my game as soon as I get home. Thanks!

2 Likes

Hey @Kelvin apologies for the late reply - somehow I didn’t see the response notification, not functioning so well on reduced sleep - my bad.

This is ALL awesome.

I’m not familiar with subroutines yet, so I’m going to play around with the two versions. But I think I follow the code - :grin:

(advice aside I’m somewhat amazed you wrote that on your phone)

And thanks too to @Malebranche. I’m definitely going to check out the plugin too.

2 Likes

@nightcap
I would definitely check out the plugin. If you can figure it out it is better than what I have above, and takes less work to maintain.

1 Like

You see - I know why that’s a good idea - but I think I’m a bit in love with trying out code at the mo.

even if I’ll never use it again!

2 Likes