Curious problem


#1

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:

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

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

nav = new SceneNavigator([

"startup"
,"maledayone"
,"femaledayone"
,"maledaytwo"

]);

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?


#2

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


#3

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

that has to work


#4

@Nocturnal
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

@Marajade
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?


#5

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"


#6

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…


#7

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


#8

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


#9

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


#10

@xmaslightguy

*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


#11

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.


#12

Well that works too


#13

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?


#14

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]

#15

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?


#16

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

  percent best_friend Best Friend

edit:

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

*if (male)

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


#17

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