I need help! Problems with coding for the stat screen

Not sure why you need a stat chart for gender? On your stat screen why not have a straight variable like:

Gender: ${gender}

Where gender is set to make/female/non binary etc
Or if you want a paragraph type:

You are ${name}, a ${age} year old ${boygirl} from ${city}.

When setting up your character you can offer a choice like:

You are a...
*choice
   #Boy
      *set boygirl "boy"
   #Girl
      *set boygirl "girl"
Etc

What ever variable you have just make a create command near the top of the start up file for each one.
IE *create boygirl “”
This will leave a blank value that you can set with a choice selection later

@Jopari use the < / > button

1 Like

I still got the problem and just did exactly as you wrote. It says “choicescript_stats line 4: Invalid expression, couldn’t extract another token: :”.

I updated the version. Maybe it is wrong of the new version.

Would help if you posted the whole of the code. Hard to know what’s in line 4 otherwise.

Okay…

The royal ??? (I still haven't decided.)

*stat_chart
         text Gender: ${gender}

*stat_chart
  text gender

^^ That is the correct way to use a *stat_chart. The colon is wrong, and presumably so is the ${reference}, which is for writings stats in line.

1 Like

While you wrote, I wrote about the species and then I tested to play, but it said “startup line 52: Expected option starting with #”.


*choice
  #Blahblah
    *choice
      (52) BLAHBLAHBLAH
      #Yes, I am.
      *set species "Blahblah"
      *set knowledge 10
      *set strategy 10
      *goto test
      #No, I am not.
      *return

Do I miss anything?

Are you intentionally trying to nest a choice in another choice? If not, that might be your problem.

Edit- here’s an example of nesting choices, courtesy of @fantom(because I’m terrible at coding).

Edit 2: just replace *fake_choice with *choice.

What would you like to eat?

*label food
*fake_choice
	#Hamburger
		What would you like on it?
		*fake_choice
			#Just the patties
				*goto yummy
			#Slap some cheese on that!
				*goto yummy
			#Put everything you have on it!
				*goto yummy
	#Hot dog
		How would you like them cooked?
		*fake_choice
			#Grilled
				*goto yummy
			#Just microwave them
				*goto yummy
			#Slice 'em up and fry them!
				*goto yummy
	#Salad
		What? Ew, no! Choose something else!
		*goto food
		
*label yummy

A fine choice.

It appears you’ve not figured yet how codes in CS are handled.

BTW, the way you use *choice command is like this

*choice
  #Option1
    Stuff that happens if you choose option 1
  #Option2
    Stuff that happens if you choose option 2

The problem is solved.

I just looked on wiki for the code which can’t go on, but I couldn’t find the code.

EDIT: Yes, I was reading about the code before. I forgot where I was finding.

code that can’t go on? Can’t you explain more about it?

Or do you mean this *bug command?

No, it is hard to explain, but I want *choice to not go on because I am not finished.

I believe you’re looking for this

I found *disable_reuse command, but it doesn’t work for me!

*fake_choice
  #Blahblah
    *fake_choice
      BLAHBLAHBLAH
      #Yes, I am.
       *set species "Blahblah"
       *set knowledge 10
       *goto test
      #No, I am not.
       *goto species
  *disable_reuse #species

I remember having a problem with *disable_reuse to where it only worked if it was the first choice.

Also, it looks like your *disable_reuse choice isn’t tabbed properly, which is why it may not be appearing.

Nononono… you’re doing it wrong[quote=“Thunder-Man, post:36, topic:23514”]

*fake_choice
  #Blahblah
    *fake_choice (every line below this shouldn't be indented by +1 level)
      BLAHBLAHBLAH (put this blahblah one level up, swap the position with the *fake_choice)
      #Yes, I am.
       *set species "Blahblah"
       *set knowledge 10
       *goto test
      #No, I am not.
       *goto species (this should bring you to the "species" label)
  *disable_reuse #species (but this is an option of a choice. Not a label)

[/quote]

My guess as to what you mean with ‘not go on’ is something like this:


*label foo
*choice
  #first
    first
    *goto foo
  #second
    second
    *goto foo

No, I just mean the grey choice bottom, so I will work later.

Okay, then either *disable_reuse or *selectable_if


*choice
    *selectable_if (foo = 1) #Not selectable
        Not selectable if the equation isn't true
    *disable_reuse #Can only select once
        You can only use this option once.

Noteworthy though, that if no options are selectable if you will hit an error. (So, if you’re trying to close the game, just use *ending instead.

I did as you wrote, so the two codes hide in the web browser. It is too strange. Why?

Edit: I just solved the problem, and I tested both, so it worked.

I quicktested the game. But I got the problem.

TITLE TOO LONG (35 out of 30 characters): The galactic destiny of the Monarch

Will I ignore the “too long” title?

Edit: I changed the title: The Galactic Monarchy

Can any @moderators open the post The galactic destiny of the Monarch?