Hiding stats picks

Ok, its been a while since I tried to code for this. The ones on the forms seem to only work if there is only a two choices. For my story, I have it where the player can pick 4 different regions to start out. I want to keep this stat hidden and want to carry it over to the other scenes. I have it like the one below for the next scene. I having hard time of getting to work right.

Any help would be much appreciated.

*if region = 1
	*goto northern 
	*elseif region = 2
		*goto Southern
	*elseif region = 3
		*goto Western 
	*elseif region = 4
		*goto Eastern
		*finish

Hi, the indentation seems to be the problem here.

*if region = 1
	*goto northern 
*elseif region = 2
	*goto Southern
*elseif region = 3
	*goto Western 
*elseif region = 4
	*goto Eastern
	*finish

*if and *elseif should have the same indentation, hope it works :slight_smile:

I’ll try to find the article on the wiki.

(Here it is http://choicescriptdev.wikia.com/wiki/If )

Thank you for the quick response. I was wondering how I would do this for the stats screen? The one up top is from the next scene.

It should work the same way, unless you want to do something else?
You want a specific text to be displayed for each option?

You’re quite welcome :slight_smile:

Edit: I’ve found an older topic that might be useful:

Well I tried doing it how you did it and the next scene just shows all the paths at once. For the stats screen I have this. Nothing to different.

*label screen
*stat_chart
	text Name
	percent health
	text leadership
	text strength
	text agility
	text intelligence
	text treasury
	text stealth
	opposed_pair Honor
		Cunning
	opposed_pair favor
		Imperial court: Favor
		Unfavor
	
*line_break

*if region = 1
		text northern
		*finish
*elseif region = 2
		text southern 
		*finish
*elseif region = 3
		text western
		*finish
*elseif region = 4
		text eastern
		*finish

Mmmh.

Can the player have all 4 at once?

Nope, which is why its keeps bugging me. The player only gets to pick only one region he wants to start out at.

Mmmh. Just tested it in startup.txt file

*create region 0


*fake_choice
	#1
		*set region "1"
	#2
		*set region "2"
	#3
		*set region "3"
	#4
		*set region "4"





*if region = 1
		text northern
		*finish
*elseif region = 2
		text southern
		*finish
*elseif region = 3
		text western
		*finish
*elseif region = 4
		text eastern
		*finish

It works, though…

Do you need to have an *else if you have an *if and one or more *elseif?

I can get it to work with it on the startup but I need it to work with the next scene. I tried doing something like this below but it still shows it. When I pick the other options, it will show like that path and the ones below it.

“You take the Eastern road
You take the Western road”

or

“*
You take the southern road
You take the Western road
You take the Eastern road”

Gower what do you mean?

*temp region_location
*if region = 1
		*goto screen
*elseif region = 2
		
		*goto screen
*elseif region = 3
		
		*goto screen
*elseif region = 4
		
		*goto scree

Did you *create (in “startup.txt”) the “region” variable, or is it only *temp?

If you didn’t *create it, the next scene won’t take it into account.

I have it, *create region 0 in startup.

I think it is best practice, when having an “if” followed by a bunch of "elseif"s, to have the last one be “else” rather than “elseif”–not able to format the code to show you at the moment, alas.

I may just be missing the point, though.

Then, when the player chooses one path, you did *set the correct value under each of these choices, right?

Ex:

#choice 1
        *set region 1
etc...

Correct. Under each choice it is: *set region 1, etc.

Could you show me the entire code of the scene? In PM, if you’d prefer.

Here was the solution! :fireworks:
(Just had to add *goto and a label)

*label Northern
You have gone the northern road.
*goto continue

*label Southern
You take the southern road
*goto continue

*label Western
You take the Western road
*goto continue

*label Eastern
You take the Eastern road
*goto continue

*label continue

@Snowpanther Bad kitty. :newspaper2: Don’t encourage the brute force approach. :stuck_out_tongue:

@Wakabam45 There’s a couple mistakes, so let’s take them one at a time. First, in your stats screen, you have text northern on it’s own line. If you want it to appear as a chart, you need:

*stat_chart
    text foo <-- Where foo is the variable you want to show.

However, before that we need to make sure we have the right variable. What I’m assuming you want to show is something like this:

Region: Northern

If that’s the case, you need to *set region "Northern" (and southern, eastern, and western). Then, instead of text northern, you use:

*stat_chart
  text region

No ifs or anything else. That work for you?

(Oh, and @Gower is right. If you start an *elsif chain, you need to finish it with an *else else it’s going to throw and error.)

3 Likes