A *goto_scene problem


#1

What I’m trying to do for 2 days is fixing an error with *goto_scene. After I saw it won’t work at all, I came to the forums for an answer.

What I am trying to do is:


*choice
	#Travel.
		*goto Travel

*label Travel
*page_break Travel
*goto_scene Next

I tried doing this as well:


*choice
	#Travel.
                *goto_scene Next

But it did the same.
The scene Next starts the following:


*set in_town1 true
*set in_town2 false
*set in_town3 false
...
Welcome!
(what was following up was a label and then a choice)

I tried a *goto after Welcome which would go to the label following, but it still did the same.

Now, the problem:
When I choose the choice “Travel” in the first scene, it takes me to the 2nd scene, where I see the message “Welcome” and a next button (Note: I Should see the choice that was coming up). I click the next button and then a blank page containing only a “Next Chapter” button appears. When I click that button, I end up in the next scene in the navigator, which is the scene “ending”. What I’m asking is, how can I make it so that if I go to another scene, the scene continues, not just shows the first part of it and then moves on? (Note: I never used the *finish command, so it couldn’t just go to the next scene). I can’t as well use the *finish command in the first “Travel” choice, because in the future you can travel to several other scenes, that aren’t next in the sceneNav.


#2

Change the label Travel to travel

Or change Next to next

Labels and scene names should be lowercase


#3

@Nocturnal_Stillness, all my labels have uppercases and they work fine (in a file of 19000 lines of code, no errors so far with labels). And about scene names, I’ll try that. But I doubt it’s the problem, since it actually goes to the scene, but it just reads the first line out of 3000 others. I’ll edit this once I try that.

EDIT: Still the same,even with lowercase labels/file names (both at once) :expressionless:

EDIT2: If no-one will figure it out, I’ll upload the code itself with the choice, and the “test” game for everyone to see the problem…


#4

If it actually loaded the second scene then the problem is in there, not in the *goto_scene bit of the first scene (though I share @Nocturnal_Stillness’s likely amazement that your use of uppercase letters doesn’t cause at least a bad label error . . . a change in the latest CS update, perhaps?).

We would need to see the scripting for what comes after “Welcome!”.


#5

Here is what is after the “Welcome!”:


Welcome!
*choice
	#Go to the outskirts.
		*goto Outskirts
*label Outskirts
*set time_minutes + 2
*gosub Date
*gosub Health
What do you want to do next?
*choice
     "choices of where to go"

The first *choice doesn’t show up, only the “Welcome” does. Also, I tried this way:


Welcome!
*goto Outskirts
*label Outskirts
*choice
...

And no success. And I tried this way also:


Welcome!
*label Outskirts
*choice

The “Outskirts” label is needed as it’s used further in the scene, so I can’t remove it.

Note: The *gosub Health/Date labels exist and are working, and so do all the other variables.


#6

Hmm. What I’m struggling with understanding is why it is even going to a third scene (never mind so early in scene 2) when you say you have no *finish command. Without a *finish (or at least another *goto_scene) it should just error sooner or later, before exiting the second scene. It should certainly not exit that scene of its own accord.

That aside, I can see why you’re confused–there’s no logical reason (if we ignore the capital letter in “Outskirts”) why that choice in scene 2 should not be displayed, or at least result in some sort of traceable error message.


#7

I would not call a scene Next. Try a different scene name, even TheNext.

Next is a default label for page_break, so I wonder if it is bugging on the name.


#8

@JimD, the name isn’t literally “Next”, it’s a placeholder to not reveal the game itself (I basically changed some of the words here on the forums than from the game itself).

@Vendetta, I’m confused with why it won’t read the whole scene instead of just reading the first line and moving on in the sceneNav. This technique worked for 2 travels (from Intro to Customization and then to Laves scene files used in my game, Red Moon) but it won’t work here. No idea why though.

Some time later I’ll upload the game on dropbox (the game meaning this part that’s not working, for everyone to experience it).


#9

Very, very strange. I’d love to take a look at this.
You haven’t made any modifications to the CS have you? Like custom commands or that global scene mod?


#10

@CJW, the only modification was to the ui.js (adding more buttons) and to the index.html (again, for adding more buttons). But I don’t think that’d affect it.

Also, for everyone that wants to encounter what I did, the link is here:
https://dl.dropbox.com/u/95587456/web/index.html
This is the link to my game (Red Moon), and for encountering the error you need to get past the Customization, and then in Laves you go to the Outskirts and travel to Yalta.

EDIT: Note that there’s no *ending or any command as such; the *ending that occurs when travelling is in the scene coming up next after the “Yalta” scene you should be taken to (named “Ending”). There’s no *goto_scene other than the one in the scene you choose to “Travel to Yalta”. And there’s no *finish anywhere in the game.

EDIT2: On Mozilla, the text that’s in the “Ending” scene showed up. On Google Chrome, apparently, it doesn’t. Also, keep in mind the fact that the sceneNav is as following: “Laves”, “Yalta”, “Death”, “Ending”. The “Death” scene is skipped, and so is the Yalta scene (except the first line of it), going straight to the “Ending” scene.


#11

Did anyone find any solution to this? I won’t be able to play my game without fixing this. I looked upon it more but still, no matter what, it does the same.


#12

Hm… the scene “Yalta” does not appear to be declared in mygame.js. Try that. You may also want to clean up mygame.js a little bit, as I’m not sure how much Java Script minds the jumps between spaces and tabs.


#13

@Reaperoa, on the dropbox, I didn’t upload the mygame.js, but on my PC, the sceneNavigator has “Yalta”. And about the mygame.js, it is clean (i.e it only has the scenes I use in the sceneNav, and only the variables I use; over 200). I’ll upload mygame.js as well in a second.

EDIT: Done.

EDIT2: I forgot to mention the same thing happens, even with mygame.js updated. :expressionless:


#14

Hm, at this point I’m guessing, but under the Date subroutine, between each *elseif, there is an unindented line. Could that be breaking it? I know that unindented lines completely stopped CS in earlier versions, but I don’t know what it does now.


#15

@Reaperoa, I’ll try that in a moment.

EDIT: Not a single change. Still the same. The alternative to this *goto_scene would be putting every single village in 1 file. But there would be a major drawback, as the first village has 19.000 lines of code (0.5 MB) and imagine 31 villages like those. It would take a while to start the game every single session of playing.


#16

Yea, I get that, just checking for what could cause the error. It’s strange, 'cause everything seems to run fine. It’s not as though the game is crashing because the size of the village, but instead it’s doing something at that *goto.


#17

I did something else which made me not understand the error even more. I copied the beginning of the file “Yalta” in another file in another game, I made the gosubs and variables needed for them in mygame.js, I made another “Laves” file containing only the *goto_scene choice, and I also changed the names of them to something else (scene1 and scene2). Well, that works. And I have no idea why my game doesn’t, as that just proves it should.


#18

Check your code there is a missing # that should go before the choices of where you want to go


#19

Okay, so looking at the time it displays, it appears that it’s hitting this line *set time_minutes + 2 fine. So there may be something wrong with the subroutines. Try removing the call to the subroutines under the YaltaOutskirts label to see if that makes it work.


#20

@Nocturnal_Stillness, I looked through the whole file and no missing “#” at choices. Also, while looking for "#"s I found another error in the code, which is again fixed, and didn’t change a thing, sadly.

@Reaperoa, I’ll try it, but it’s most likely not. I tried making a separate game in which I tested this *goto_scene along with the subroutines, and they worked just fine. I’ll edit this once i test it this way.

EDIT: WORKING! I think I’ll rage. Why aren’t subroutines working?! I removed them and everything is working fine. I need them for the date/time system to work, and I can’t really see why they wouldn’t work. But that was the problem cause. Thanks, @Reaperoa !