Goto / goto_scene


#1

I’m trying to code for a scene in chapter that changes depending on who you choose and how cooperative you were in the prologue, but I’m still having trouble with it.

I’ve tried using relationship, but I keep getting a bad label error. It looks a bit like this.

*if (ally name>=50)
*goto guest
*else (ally name<50)
*goto prisoner

and I have in fact, labeled it properly.

*label guest

*label prisoner

I’ve already tried reading all of the usual guides, but I still have a lot of trouble with this. I’m sure that there is a better way to code this though.


#2

A few bits to check / fix:

  1. Both of those *goto lines are properly indented?
  2. *else should never have a condition of its own (else essentially means "if none of the above conditions apply, then do this)
  3. ally name should probably be ally_name? variables should be a single word only, no spaces

#3

It’s not actually called “ally name” as I have 4 characters who can be a possible ally and merely decided not to add in their name here, but I have taken your suggestions into account.

I am still getting “bad label guest” though.

How strange.


#4

… and *label guest is definitely in the same scene file as *goto guest? (if not, it should be *goto_scene scene_name guest).


#5

I’m getting a new error…

“Couldn’t load scene file:scene/scenes_name.txt
The file is probably missing.”

I need to look over this again.


#6

Sorry, my bad - scene_name should be your scene name. For instance, if *label guest is in the scene file called chapter02 then you would use:

*goto_scene chapter02 guest


#7

It works!

Now that’s one less coding headache.

Thanks for the help.