Curious problem

I’m making a game and would like for the first main division between stories be if you are a girl or boy. I have the ending of the first scene set up like this:

*if gender = male
*goto_scene “maledayone”
*goto_scene “femaledayone”

I then put in the mygame.js document for scenes;

nav = new SceneNavigator([



I’m not encountering any problems until I finish with maledayone and it automatically goes to femaledayone even though I put *goto_scene “maledaytwo” at the end of maledayone. Any suggestions for how to stop femaledayone from popping up if the gender variable is set to male?

The *finish command sends you to the next scene in mygame so that code sends you to next scene before it hits the *if

you try this
*if gender = male
----*goto_scene maledayone
----*goto_scene femaledayone

that has to work

If I place the *finish after the *goto_scene I get the next scene thrown in on the same page as the ending of the first scene. I believe *finish puts the button to go to next chapter

Unfortunately no, as I tested both with gender = male and female and both times it follows mygame.js and goes maledayone, femaledayone, maledaytwo.

Is the scene navigator in mygame.js neccessary? Or can I manipulate it to allow the *goto_scene to decide what scene is next?

I did that stuff without doing scene navigating and I did put

*goto_scene [insert scene name here]

I did mine without the ""s and mine worked just fine

here just how I would do it(My way is a bit different)

*if (gender = "male")
  *goto_scene maledayone
*if (gender = "female")
  *goto_scene femaledayone"

hm, I did this but without the scene navigator and got a script error, so I put in the first scene and it was the only playable one. I tried putting all the scenes back and put your code in place of mine on the first scene and it didn’t work. Wow, it will be a serious pain if I have to code is game with a linear scene progression…

Im trying to think I think script error means its not really the scenes themselves but an error within somewhere else… there might be an error in the stats maybe its not even the scene thing, possibly a , or : are missing or maybe one of the scenes are misspelled from what you put it as so when you put *goto_scene [whatever] it cant find it and it flips out

well the only thing I changed was taking away scene navigator and then adding it back, which makes sense since I’m sure the scene nav is used in the HTML or other js documents as a reference for which text documents need to be picked up

Hmmm, well I hope you also removed the *finish because the finish will give you an error and if your gonna do scenes like *goto_scene you dont really need anything in the navigator except the first scene so the game knows where to start


*finish adds the next chapter button but it then sends you to the next scene mentioned in mygame.js

for example finish at the end of maledayone would send you to femaledayone.

if you want you could always do this

*page_break Next Scene
*goto maledaytwo

What I actually have figured out is I can just make a dayone scene and put an *if gender = male at the top, followed by an *if gender = female halfway down, simply splitting the scene so you only see half depending on your gender.

Well that works too

new problem. Since my dayone scene starts with *if gender = male the game won’t continue unless you are a boy. I have indented the rest of the code two spaces so only the *if gender = male and the later *if gender = female have no spaces before them. Why won’t it jump over the first *if since I selected being a girl?

idk… thats odd… and you sure do run into alot of problems XD I would try this…

*if (gender = "female")
  *goto femalestart
*if (gender = "male")
  [whatever you have here

*label femalestart
*if (gender = "female")
  [female part whatever you put here]

this worked! Thank you so much!!!

But I found another question :stuck_out_tongue:
I have a variable called best_friend and when I display it in the stats page I want it to say Best Friend instead of Best_Friend with the underscore. Any suggestions?

Name the variable best_friend but then in choicescript stats put it like this

  percent best_friend Best Friend


Also you can have a male and female variable and then you just need to put

*if (male)

as opposed to *if (gender = “male”)

Oh that makes so much sense now! Thank you all for the help, and I think I’m finally done (for now) with the questions. Although, I’ve looked at the index html code and probably have a thousand questions on that one :stuck_out_tongue:
but that’s for another time. HEY MODS, THIS TOPIC IS SOLVED