Bug with Goto_Scene causing Finish to work incorrectly


#1

I am using goto_scene to skip a chapter if a PC makes certain decisions. However, when they do skip the scene, it goes to the next scene which ends with a *finish command. If you skipped the previous chapter, the game ends on the finish command with the play again choice appearing. If you arrived there through normal finishes (i.e. you didn’t skip the previous scene) it works perfectly and progresses on to the next scene.

I have worked around it in my book but my question is this, does the finish command keep track of what actual scene should come next? or is it like, counting what scene should be next based on an unrelated counter? Because if it is doing that latter, it means that using goto_scene and finish in the same book is impossible and doesn’t work. Anyone have some insight here?


#2

I might not be answering your question, but I’ll try anyway.

*finish
command ends the current scene and hops to the next scene based on your *scene_list in startup.txt

*goto_scene scene_name
command ends the current scene and jumps to scene_name

so with careful positioning and planning, it is possible to use both.


#3

Is the name of the scene in all lowercase letters? Capital letters tend to cause issues when used in combination with certain commands.


#4

Hi, yeah I understand the function of both commands. It was not working however so I thought that goto_scene might interfere with finish.

The scene it is going to has capital letters. Should I make them all lowercase?


#5

You might want to try that first, and see how it goes from there.

Rule of thumb in coding: try to use lower case whenever possible.
Edit: Especially when dealing with variables.


#6

(Especially in labels and scene names)


#7

Okie dokie. I was not aware of the capital letter thing. I will make some changes and ideally it won’t cause any more problems. I had already put in a workaround but it is not very elegant :stuck_out_tongue:


#8

E.g.

*scene_list
  chapter1
  chapter2
  skipablechapter
  chapter3
  chapter4

(Remember ever scene except for choicescript_stats should go in this list, without exception.)

If we *finish chapter1, we move to chapter2. If we then if we *goto_scene chapter3 the next time we finish, we should be in chapter4.


#9

Right. That is what SHOULD happen, but I am finding that in some instances where I have used goto_scene to skip a chapter, then when that chapter has a finish command it ends the game. If you choose a path that only uses finish commands, it finishes properly.

I put a workaround where the path that skips a chapter still finishes to the skipped chapter with a check at the top for a variable to see if you are supposed to skip it. But it does make things really annoying.


#10

I would need something reproduceable to be certain as to what’s going on. *Finish can end the game, if it’s used in the last chapter, is that’s what happening?


#11

No, it is finishing several txt files before the end.

*scene_list
	startup
	roomate
	themeeting
	morningact
	firstclass
	darker
	second_class
	clubs_fair
	third_class
	elective
	weekly_choices
	charts

Is what I am using in startup. This has all of my chapters including the skippable ones. Sorry for the many edits. It has been a bit since I fixed this.


#12

The issue occurs after you skip clubs fair from second_class. When you do your third class, it finishes the game.
If you proceed without using the *goto_scene prompt, it progresses normally.


#13

Hmmm, maybe some criteria was supposed to be met at clubs_fair was not met when you skipped it? Resulting is some *if statement causing third_class to end?

Oh, btw, correct me if I’m wrong, but I don’t think you need startup in the *scene_list

@Deracial
Whoops, my bad. startup is to be in the *scene_list


#14

That makes sense. Can we double check on having startup in the scenelist? because as far as I can remember, when I downloaded the Chocie Script engine, it came with a tester that had startup in the scene list.


#15

As to the other thing, there isn’t any criteria that sends it to an end state. Just a finish command. Like I said, it only happens after a goto_scene call previous. :frowning:


#16

Does this only happen at third_class, or have you experienced it with other scene files, too?


#17

It has happened at other places to, but those stopped after som rearranging. This has been the most consistent one. Like I said, I made a workaround, but the unexpected (play again} menu has come up before.


#18

Hmmm… maybe you could try providing the raw code for that scene? We might be able to poke around it.
This is starting to sound weirder and weirder…


#19

You would need a lot of scenes…About 1000 lines of code. Not sure how much time you have :smiley:


#20

Oooooh… I have the time… at least 6 hours. Blame the school break…
It’s fine if you don’t want to, though.

Lets see… 1000lines… i think a file should be better XD