Using options in stat screens

Meaning the player won’t see their powers?

Randomtest 05-Jul-20 12_18_51 PM


MY RANDOM TEST GAVE ME AN ERROR

That’s because CS uses explicit control flow by default. That means you must always explicitly tell the CS Engine where to go next.

You can’t fall out of an if statement, you have to use *goto to tell it where to go next, even if it’s the very next line.

This is to prevent authors from forgetting to add gotos where they must be, but this also forces authors to add gotos where they are not needed.

If you have some experience with programming or if you feel comfortable with implicit control, just go to startup.txt and add this line:

*create implicit_control_flow true

1 Like

Why not? Add something like this in your choicescript_stats file:

Depending on your power focus, you can use Super Speed, Strength or Mind Manipulation.

Your current power focus is ${power}.

Any chance I can send my code to someone if not all of you. Cause I’m having a hard time explaining m problems

OK, send your code.

You can post it here. Don’t forget to use preformatted text.

I’d still say you don’t need the choices in the text if there’s only one ability linked to a power.

So, for example, instead of (simplified text)

text
*choice
   #use the power you have
      *if power_checks_out
         good stuff
         *goto yay
      *else
         bad stuff
         *goto nay

You could go with this

text
*if power_x
   *goto x
*elseif power_y
   *goto y
else
   *goto z
*label x
*if (x_power > 60)
   *set stats
@{(x_power > 60) success text| fail text}
*goto thing

I think.

2 Likes

choicescript_stats.txt

*label stats
[b]Character Details[/b]
*line_break
Name - $!{name}
*line_break
Class - $!!{class}
*line_break
Active Superpower - $!{power}
*line_break
*line_break

*choice
	#Power Gauntlet
		*label gauntlet
		[i][b]POWER GAUNTLET[/b][/i]
		*fake_choice
			#Mind Manipulation
				*stat_chart 
					percent mind Mind Manipulation
				*goto return
			#Super Speed
				*stat_chart
					percent speed Super Speed
				*goto return
			#Super Physical
				*stat_chart
					percent physical Super Physical
				*goto return
			#Back to the stats page
				*goto stats
		*label return 
		*choice
			#Return
				*goto gauntlet
			#Back to stats page
				*goto stats

scene.txt

*label name
What is your superhero name
*fake_choice
	#Neuro
		*set name "Neuro"
	#Zoom
		*set name "Zoom"
	#Scala
		*set name "Scala"
	#Neither of those fit me
		Ok then. What's your awesome superhero name?
		*input_text name

*temp max_points 100
*temp points 0
*label beginning
How good are you at Mind manipulation?
*input_number points 0 max_points
*set mind +points
*set max_points -points
*set points 0 

How fast are you?
*input_number points 0 max_points
*set speed +points
*set max_points -points
*set points 0 

How physically fit are you?
*input_number points 0 max_points
*set physical +points
*set max_points -points
*set points 0 
*page_break 

Are you satisfied with your stats?
*choice
	#I changed my mind. Let's redo the allocation
		*set max_points 100
		*set points 0
		*set physical 0
		*set speed 0
		*set mind 0 
		*goto beginning
	#I'm ready to fight
		*goto story

*label story
You are currently fighting against the lowlife villain known as Liquid metal who has the- (as you may have guessed) ability to liquify metal and kinetically move it like water.
*page_break FIGHT!!!!
He liquifies the nearest metal to him and transforms it into liquid bullets and starts shooting at you.

*label action
*choice 
	#I'll need to select an ability to use in battle
		*gosub_scene power_gauntlet
	
*label lets_go
*if (power = "Mind Manipulation")
	*choice
		#Break his constitution
			*if (mind >= 60 )
				You break his constitution and render him less than willing to fight.
*elseif (mind < 60 )
	Your attempt at breaking his constitution is thwarted my mental barriers which you cannot break.
	
*if (power = "Super Speed")
	*choice
		#Dodge his bullets
			*if (speed >= 60)
				You are able to dodge fast enough and counter with a bulet of your own, a speed punch.
*elseif (speed < 60)
	You are able to dodge his bullets but a surprise bullet catches you in the kneecap making you spill over onto the ground

*if (power = "Super Physical")
	*choice
		#Endure the barrage of bullets coming at you
			*if (physical >= 60)
			You feel funny all over as the bullets bounce off you and fall to the ground. As soon as you approach Liquid metal you borrow him a couple of punches.
*elseif (physical < 60)
	You overestimate your durability and get shot countless times to your death.
	*page_break [i][b]REPEAT[/b][/i]
	*goto name

power_gauntlet.txt

*label select_power
Active Superpower - $!{power}
*choice
	*selectable_if (power != "Mind manipulation") #Use Mind Manipulation
		*set power "Mind manipulation"
		*goto select_power 
	*selectable_if (power != "Super Speed") #Use Super Speed
		*set power "Super Speed"
		*goto select_power
	*selectable_if (power != "Super Physical") #Use Super Physical
		*set power "Super Physical"
		*goto select_power
	#Return to game
		*return

startup.txt

*title Test Project
*author JONAH GREYE
*scene_list
	scene 
*create mind 0
*create speed 0
*create physical 0
*create name "unknown"
*create class "unknown"
*create power "not yet assigned"

*finish

Your startup.txt and power_gauntlet seem fine.
I’ve fixed indentation in your scene, as well as that *gosub_scene command. Also replaced *if with *selectable_if command, so a potential player can see their possible actions before selecting a power. This passed quicktest just fine, but Randomtest was moving with a pace of a sleepy snail. Probably because the program kept failing the fight and repeating. It works faster after I removed that repeat option.
New version of your scene:

*label name
What is your superhero name
*fake_choice
	#Neuro
		*set name "Neuro"
	#Zoom
		*set name "Zoom"
	#Scala
		*set name "Scala"
	#Neither of those fit me
		Ok then. What's your awesome superhero name?
		*input_text name

*temp max_points 100
*temp points 0
*label beginning
How good are you at Mind manipulation? 
You have ${max_points} points left.
*input_number points 0 max_points
*set mind +points
*set max_points -points
*set points 0

How fast are you? You have ${max_points} points left.
*input_number points 0 max_points
*set speed +points
*set max_points -points
*set points 0 

How physically fit are you? You have ${max_points} points left.
*input_number points 0 max_points
*set physical +points
*set max_points -points
*set points 0 
*page_break 

Are you satisfied with your stats?
*choice
	#I changed my mind. Let's redo the allocation
		*set max_points 100
		*set points 0
		*set physical 0
		*set speed 0
		*set mind 0 
		*goto beginning
	#I'm ready to fight
		*goto story

*label story
You are currently fighting against the lowlife villain known as Liquid metal who has the- (as you may have guessed) ability to liquify metal and kinetically move it like water.
*page_break FIGHT!!!!
He liquifies the nearest metal to him and transforms it into liquid bullets and starts shooting at you.

*label action
*choice 
	#I'll need to select an ability to use in battle.
		*gosub_scene power_gauntlet select_power
		*goto action
	*selectable_if (power = "Mind manipulation") #Break his constitution.
		*if (mind >= 60 )
			You break his constitution and render him less than willing to fight.
			*goto next_move
		*else
			Your attempt at breaking his constitution is thwarted my mental barriers which you cannot break.
			*goto fail
	*selectable_if (power = "Super Speed") #Dodge his bullets.
		*if (speed >= 60)
			You are able to dodge fast enough and counter with a bullet of your own, a speed punch.
			*goto next_move
		*else
			You are able to dodge his bullets but a surprise bullet catches you in the kneecap making you spill over onto the ground
			*goto fail
	*selectable_if (power = "Super Physical") #Endure the barrage of bullets coming at you.
		*if (physical >= 60)
			You feel funny all over as the bullets bounce off you and fall to the ground. As soon as you approach Liquid metal you borrow him a couple of punches.
			*goto next_move
		*else
			You overestimate your durability and get shot countless times to your death.
			*goto fail

*label fail

You have failed.
*goto all
*label next_move

Your previous action was successful. What is your next move?
*label all

This is all for now!
*finish

Your choicescript_stats file was technically fine, but if you need more compact version:

*label stats
[b]Character Details[/b]
*line_break
Name - $!{name}
*line_break
Class - $!!{class}
*line_break
Active Superpower - $!{power}

[i][b]POWER GAUNTLET[/b][/i]
*stat_chart 
	percent mind Mind Manipulation
	percent speed Super Speed
	percent physical Super Physical

Try to test this.

2 Likes

It’s Perfect .Thanks.
I’m planning on creating a thread to see how people would react to the mechanics.
Can I post this on dashingdon considering it’s just a test?

1 Like

Well, Dashingdon is for works in progress, so technically you can?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.