I require assistance... How do I put scenes in scene navigator and stats in stats in mygame.js?


#1

I have just started creating my first Choicescript game. I currently have a startup scene, a Chapter 1 scene (no code yet), and a stats screen. I tried to execute a random test but it took an unbearable amount of time. Here is the code:
The sands of the wastes sweep across the horizon, as an owl would sweep over a rat with talons at the ready. The heat of the sun beats down upon you. Though rest but a second and the guard will fracture your finger as incentive.
startup-Notepad
*line_break

(More description)

*line_break

(Text for story)

*page_break The worker next to you notices… (Et cetera)

*line_break

Is this person a Man or Woman?

*label sc1

*choice

_#Man

__*set sc1_hisherc “His”

__*set sc1_genderc “Man”

__*set sc1_heshec “He”

__*set sc1_himherc “Him”

__(same except lowercase letters)

__Okay, so the person looking at your hammer is a ${sc1_genderl}. Got it.

__*goto sc1_2

_#Woman

(Same variables except female)

*label sc1_2

Do you know this ${sc1_genderl}'s name?

*choice

_#Yes

__This ${sc1_genderl}'s name is…

___*input_text sc1_name

____Okay, so {sc1_hisherl} name is {sc1_name}. Well ${sc1_heshel} certainly seems concerned.

____*goto agemchar

_#No

__{sc1_heshec} is nameless. At least to you. {sc1_heshec} certainly seems concerned about your cracked tool.

___*goto agemchar

*label agemchar

How old are you currently?

*choice

_#15

__*goto mchargender

_#18

__*goto mchargender

_#30

__*goto mchargender

_#47

__*goto mchargender

_#70

__*goto mchargender

_#I don’t remember…

__agemchar = rand 15 65

_#None of these are my age.

__*goto input_age

*label input_age

_input_number agemchar

__So you are ${agemchar} years old?

___*choice

____#Yes

_____*goto mchargender

____#No

_____*goto agemchar

*label mchargender

Are you Male or Female?

*choice

_#I’m Male.

__*set sexmchar “Male”

___So you are a guy. Understood.

____*goto mcharname1

_#I’m Female.

__*set sexmchar “Female”

___So you are a woman. Understood.

____*goto mcharname1

*label mcharname1

What is your first name?

_*if (sexmchar = “Male”)

__*choice

___#John

____*goto mcharname2

___#Viktor

____*goto mcharname2

___#Xavier

____*goto mcharname2

___#None of these are mine.

____*goto input_first

(Et cetera female versions. I do apologize for the lack of detail but I lack an Internet connection currently and I am using my iPhone to Input this message.)

Okay, so your name is ${mcharname1}?

*choice

_#Yes

__*goto mcharname2

_#No

__*goto mcharname2

*label mcharname2

_Okay what is your last name, ${mcharname1}?

*choice

(Last name variables etc.)

__Okay, so your full name is {mcharname1}_{mcharname2}?

___*choice

____#Yes

_____*goto_scene Chapter1

____#No

_____*goto mcharname1

*page_break

Stats_screen-Notepad

*label stat_chart

_Name: {mcharname1}_{mcharname2}

_*line_break

_Gender: ${sexmchar}

_*line_break

_Age: ${agemchar}

_*line_break

_opposed_pair Ruthless

__Compassionate

_opposed_pair Aggressive

__Tolerant

_opposed_pair Deceitful

__Trustworthy

_opposed_pair Dictatorial

__Enlightened

_*line_break

_percent ${sc1}

_percent ${sc2}

_percent ${sc3}

_percent ${sc4}

_percent ${sc5}

_percent ${sc6}

Mygame - Notepad

nav = new SceneNavigator([“startup”, “Chapter1”]);stats = {Name: “???”, Gender: “???”, Age: “???”, Ruthless: “50%”, Aggressive: “50%”, Deceitful: “50%”, Dictatorial: “50%”};

I will appreciate any help anyone can offer. Many thanks XD


#2

Well for a start you don’t need to add:

*line break

On the paragraph, simply enter and that will break the paragraph.

I don’t think

*line break

is necessary after

*page_break

Also refer to IDE https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/IDE/main.html Can help you see whatever error you might accidentally done or as a reference.

and well use a Notepad++ than Notepad :stuck_out_tongue:


#3

to post code here use
< pre> Do not put space in before the pre.
< /pre> Again no space.


#4

I might be confused in what you’re asking for, but anyway, I don’t think you need to mess with mygame.js anymore. For the scenes, just put them under the title. Stats go in choicescript_stats file (which needs to have that name)

So, pretty much, the very top of startup should look like.


*title Blah

*scene_list
      scene1
      scene2

and for choicescript_stats


*stat_chart
     text ${mcharname1}_${mcharname2}
     text ${sexmchar}

*line_break isn’t necessarily needed in choicescript_stats between stats. If you want it to be separate than other information then just add another *stat_chart

Also, notepad++ is preferable, as well as free and has plugins, and I find quicktest to be a bit nicer than random test :slight_smile:


#5

Thank you all for the reply. :smiley:

Aera- Ah ok. I just assumed that pressing enter did nothing haha. Now I get it.
Lordirish- I’m not sure I understand… Is that for highlighting the code?
Babisko-Okay, got it XD. I’ll let you guys know if it works, one moment please.


#6

@SolemnSirSalvo the < pre > < /pre > that Lordirish mentioned is for what I did in my post, the *scene_list and *stat_chart thing, so that it formats in an easier way to convey to coders and all. :slight_smile:


#7

Much appreciated. Alright I got rid of the [enter]s on every part of the code except the text shown in the story. I deleted the stats I inputted into the mygame.js as well as only leave startup in the SceneNavigator. Unfortunately I tried to try it out on windows script host and there’s an error saying on line 1 character 1 the SceneNavigator is undefined. Error code: 800A1391?


#8

You may want to replace the file with a new one, just in case when you deleted the stats and didn’t end up accidently messing up something else.


#9

Which file?


#10

Wait, never mind! I’ve had a breakthrough! I was trying to play the game itself with the wrong file. Haha I thought you actually USED mygame.js AS the player :D. I think I have it set from here, I thank all of you! XD