First time coding EVER, need help


#1

well i am very confused with this but i am determined to finish atleast one game.
things i cant figure out:
how to add a new scene and where it gets placed
how to make an option add stats
how to give a name choice
how to have different options send to different scenes
everything else

screenshots would be very helpful


#2

Have you looked at the tutorial on the main site yet?


#3

yes i have but i dont like the examples or the way they explain things. I still cant figure out how to have a different option go to a different chapter

I want each finish to go to a different scene, but i cant figure out how

here is my mygame

nav = new SceneNavigator([
----“startup”
----,“militarybrothers”
----,“militaryfriend”
----,“militaryrival”
----,“militaryalone”
----,“variables”
----,“gosub”
----,“ending”
----,“death”

]);


#4

Ah. You’re doing the nav right. But to move between chapters, you should add this command:
*finish

If you still have problems with it, or if there are choices leading to different chapters, add this:
*goto_scene

So it would look like this:
*finish
*goto_scene militarybrothers

To make an option add to stats, you can use either use the + or equal signs. For example, you have a Fun stat. If you want to set Fun to 3, you can either use the equal:
*set fun = 3

Or addition:
*set fun +3

To give a name choice, make sure you first have a name stat. Let’s call the stat “name”.
*input_text name


#5

the *goto_scene militaryfriend command did not work

edit: nvm got it to work :slight_smile:


#6

now how would i get that name to repeat throughout the story


#7

Assuming the stat is called “name”, use:
${name}


#8

how do i make the stat “name”


#9

In your mygame.js file, you will see the lines “stats = {” and “debugStats = {”

Under those two, add “name:” and a default value. If you wish to leave the default value as a blank, you can add this behind: " "

That’s a pair of quotation marks with a space in between. I’m not sure if it has any effect, but make sure the arrangement of the values under stats and debugStats are the same just in case.


#10

so will it look like this?

“name:” " "


#11

i have the default name as Egnar and this is what i have

,name: “Egnar”

the ${name} command works fine but if i were to choose to make my own name i get a script error

edit: problem solved through trial and error


#12

You should expect to do a lot of trial and error at this stage. I know I did.


#13

yeah just one thing,

*finish
*goto_scene militaryfriend

keeps giving me an error, i could go *goto_scene only but it wont count as a new chapter


#14

Is your txt file name also called “militaryfriend”? Check for spelling errors?


#15

its spelled correctly


#16

Try removing the *finish command. That is telling it “this is the end of this scene, move on to the next one in the list” (militaryrival, by the looks?) so your *goto_scene line would not even be reached.