Stats menu not changing

In my WiP the stats menu is supposed to change when a particular variable is true but it doesn’t do that in my case.

These are parts of the code:

THE STORY

*set pov_armour true
You start to feel a water-like liquid wrap around your body, hugging you from head to toe becoming armour. It's so subtle that the woman doesn't notice until the last minute and she yells at her men to start shooting before running for cover.
*line_break
They shoot at you from all angles not giving you enough breathing space to react. 
*line_break

THE STARTUP FILE

*create pov_armour false

*comment ARMOUR
*create power false
*create armour_durability 100
*create bioelectricity 50

THE CHOICESCRIPT_STATS FILE

*if (pov_armour = false)
	*goto stats
*if (pov_armour = true)
	*goto pov_armour 


*label stats
[i][b]PROFILE[/b][/i]
*line_break
Name - $!{name} ${surname}
*line_break
Age - ${age}
*line_break
Gender - $!{gender}

*if (power = true) 
	*stat_chart 
		percent bioelectricity Bio-Electricity Levels


[i][b]ATTRIBUTES[/b][/i]
*stat_chart
		percent intelligence Intelligence
		percent psyche Will
		percent cunning Cunning
		percent stealth Stealth
		percent combat Combat

*comment CONSTITUTION
*if power != false 
	[i][b]CONSTITUTION[/b][/i]
	*stat_chart
		opposed_pair mind
			Mind
			H.I.V.E

*comment PERSONALITY
[b][i]PERSONALITY[/i][/b]
*stat_chart 
	percent aggressive Aggressive
	percent calm Calm
	percent impulsive Impulsive
	percent cautious Cautious
	percent vengeful Vengeful
	percent altruistic Altruistic
	percent arrogant Arrogant
	percent humble Humble
	percent charismatic Charismatic
	percent awkward Awkward

*comment PUBLICITY
*if (hero_career = true)
	[b]PUBLIC OPINION[/b]
	*stat_chart
		percent popularity Public Opinion

*label pov_armour
*if power = true
	[i][b]ARMOUR[/b][/i]
	*stat_chart 
		percent armour_durability Durability
		percent bioelectricity Bio-Electricity Levels
	*line_break
[i][b]ATTRIBUTES[/b][/i]
*stat_chart
		percent intelligence Intelligence
		percent psyche Will
*if power != false 
	[i][b]CONSTITUTION[/b][/i]
	*stat_chart
		opposed_pair mind
			Mind
			H.I.V.E
*line_break
[b][i]PERSONALITY[/i][/b]
*stat_chart 
	percent aggressive Aggressive
	percent calm Calm
	percent impulsive Impulsive
	percent cautious Cautious
	percent vengeful Vengeful
	percent altruistic Altruistic
	percent arrogant Arrogant
	percent humble Humble
	percent charismatic Charismatic
	percent awkward Awkward
*line_break 
*if power != false		
	*line_break
	[i][b]ABILITIES[/b][/i]
	*stat_chart
		percent endurance Endurance 
		percent re_gen Regeneration
		percent techno Techopathy/Technokinesis
		percent force_field Force field
		percent xray_infrared X-ray/Infrared Vision
		percent strength Strength
		percent speed Speed
		percent illusion Illusion
		percent cyborg Cyborgial Transformations
		percent flight Flight

Don’t know a lot so this might be wrong, but do you need to create a variable for Armour being true in the startup file as well as having the false option?

1 Like
*if InTuneWithSpirit
	*stat_chart
		percent Healing
		percent Vigor
		percent Maelstrom
		percent Necromancy
		percent Fury
		percent Hellstorm

Here’s what I did in my game. You can just hide the entire stat screen until the variable is true. Then make it so if pov_armour is true, hide the first stat screen

No, you shouldn’t have to. One variable should suffice

1 Like

Try changing your if (variable=true) to just if (variable). True/false conditionals have different formatting for true/false checks. Also maybe innstead of doing if variable=true or *if variable=false, do if (variable)
and then *else. Because you shouldn’t need to do if checks in both cases, because if that variable isn’t true, its false.

1 Like

I should probably just send the entire code.

Startup file

*title Project H.I.V.E
*author  Jonah Greye and HGoltara
*scene_list
	prologue
	chapter_1
	chapter_2
	

*comment PROFILE
*create name ""
*create surname "Summers"
*create age 1
*create hair_colour ""
*create hair_style ""
*create skin_colour ""


*comment GENDER
*create gender "male"
*create he "he"
*create him "him"
*create his "his"
*create boy "boy"
*create son "son"
*create hes "he's"


*comment RELATIONSHIPS
*create show_rela false 
*create victor 50
*create meet_victor false 
*create blair 0
*create meet_blair false
*create iris 0 
*create meet_iris false
*create joel 0 
*create meet_joel false 
*create hive 10
*create meet_hive false
*create gregor 0
*create meet_gregor false 
*create bonny 0 
*create meet_bonny false


*comment ARMOUR
*create power false
*create armour_durability 100
*create bioelectricity 50


*comment ABILITIES
*create techno 50
*create force_field 50
*create xray_infrared 50
*create strength 50
*create shape_shift 50
*create speed 50  
*create illusion 50  
*create cyborg 50 
*create flight 50  
*create re_gen 50
*create endurance 50 


*comment FOUND ABILITIES 
*create found_endurance false
*create found_regen false 
*create found_techno false 
*create found_forcefield false 
*create found_xrayinfrared false 
*create found_strength false 
*create found_speed false 
*create found_illusion false 
*create found_cyborg false 
*create found_flight false


*comment ATTRIBUTES
*create intelligence 30
*create psyche 30
*create cunning 30
*create stealth 30
*create combat 30


*comment CONSTITUTION
*create mind 50


*comment PERSONALITY
*create aggressive 10
*create calm 10 
*create cautious 10 
*create impulsive 10 
*create vengeful 10 
*create altruistic 10 
*create humble 10 
*create arrogant 10
*create charismatic 10 
*create awkward 10

*comment HERO PERSONA
*create traditionalist 0
*create brooder 0
*create charmer 0
*create jokester  0 

*comment SCHOOL
*create grades 0 
*create school false 

*comment MISC
*create bio ""
*create hero_career false
*create popularity 0
*create shield_ false
*create shield 0
*create pov_armour false
*finish

Choicescript_stats

*if (pov_armour = true)
	*goto pov_armour 
*else 
	*goto stats

*label stats
[i][b]PROFILE[/b][/i]
*line_break
Name - $!{name} ${surname}
*line_break
Age - ${age}
*line_break
Gender - $!{gender}

*if (power = true) 
	*stat_chart 
		percent bioelectricity Bio-Electricity Levels


[i][b]ATTRIBUTES[/b][/i]
*stat_chart
		percent intelligence Intelligence
		percent psyche Will
		percent cunning Cunning
		percent stealth Stealth
		percent combat Combat

*comment CONSTITUTION
*if power != false 
	[i][b]CONSTITUTION[/b][/i]
	*stat_chart
		opposed_pair mind
			Mind
			H.I.V.E

*comment PERSONALITY
[b][i]PERSONALITY[/i][/b]
*stat_chart 
	percent aggressive Aggressive
	percent calm Calm
	percent impulsive Impulsive
	percent cautious Cautious
	percent vengeful Vengeful
	percent altruistic Altruistic
	percent arrogant Arrogant
	percent humble Humble
	percent charismatic Charismatic
	percent awkward Awkward

*comment PUBLICITY
*if (hero_career = true)
	[b]PUBLIC OPINION[/b]
	*stat_chart
		percent popularity Public Opinion
		
*comment SUPERPOWERS
*if power != false		
	*line_break
	[i][b]ABILITIES[/b][/i]
	*if (found_endurance = true)
		*stat_chart
			percent endurance Endurance 
	*if (found_regen = true)
		*stat_chart
			percent re_gen Regeneration
	*if (found_techno = true)
		*stat_chart
			percent techno Techopathy/Technokinesis
	*if (found_forcefield = true)
		*stat_chart
			percent force_field Force field
	*if (found_xrayinfrared = true)
		*stat_chart
			percent xray_infrared X-ray/Infrared Vision
	*if (found_strength = true)
		*stat_chart
			percent strength Strength
	*if (found_speed = true)
		*stat_chart
			percent speed Speed
	*if (found_illusion = true)
		*stat_chart
			percent illusion Illusion
	*if (found_cyborg = true)
		*stat_chart
			percent cyborg Cyborgial Transformations
	*if (found_flight = true)
		*stat_chart
			percent flight Flight
*if (shield_ != false)
	Shield Count - ${shield}
				
*choice
	*if (power !=	false) #Detailed Bio
		*goto bio1
	*if (power != false) #Abilities
		*goto power_explain
	#Subjects and People of Interest
		*goto SOI1 
	#Emotional Attachments
		*if meet_blair != false
			*stat_chart
				percent blair Blair
		*if meet_iris != false
			*stat_chart
				percent iris Iris
		*if meet_joel != false 
			*stat_chart
				percent joel Joel
		*if meet_victor != false 
			*stat_chart
				percent victor Victor
		*if (meet_hive = true)
			*stat_chart
				percent hive H.I.V.E
		*if meet_gregor != false 
			*stat_chart
				percent gregor Gregor
		*if (meet_bonny = true)
			*stat_chart
				percent bonny Bonny
		*choice
			#Return to Stats
				*goto stats
	*if (hero_career = true) #Hero Persona
		*stat_chart
			percent traditionalist Traditionalist
			percent brooder Brooder
			percent charmer Charmer
			percent jokester Jokester
		*choice 
			#Return to Stats
				*goto stats
*goto end_stats

*label power_explain

*if power != false 
	*fake_choice 
		#[b]Regeneration:[/b]
			lllmghh
			*choice 
				#Back to Abilities
					*goto powerexplain
				#	Back to Stats Screen
					*goto stats

		#	Back to Main Stats Screen
			*goto stats 

*choice 
	#Go back to Main Stats page
		*goto stats
*finish



*label SOI1
*fake_choice 
	*if (meet_blair = true)
		#Blair Anderson
	*if (meet_bonny = true)
		#Bonny Simmons
	*if (meet_iris = true)
		#Iris Brooks
	*if (meet_hive = true)
		#H.I.V.E 
	*if (meet_joel = true)
		#Joel Brooks
	*if (meet_gregor = true)
		#Gregor 
	*if (meet_victor = true)
		#Victor Fonseca
			*choice 
				#Back to Subjects of Interest
					*goto SOI1
				#Back to Main stats Screen
					*goto stats
	#Back to Main stats Screen
			*goto stats

*label bio1
[b]NAME:[/b]${name} Summers
*line_break
[b]AGE:[/b]${age}
*line_break
[b]SEX:[/b]${gender}
*fake_choice
	#Back to Main stats Screen
			*goto stats



*label pov_armour
*if power = true
	[i][b]ARMOUR[/b][/i]
	*stat_chart 
		percent armour_durability Durability
		percent bioelectricity Bio-Electricity Levels
	*line_break
[i][b]ATTRIBUTES[/b][/i]
*stat_chart
		percent intelligence Intelligence
		percent psyche Will
*if power != false 
	[i][b]CONSTITUTION[/b][/i]
	*stat_chart
		opposed_pair mind
			Mind
			H.I.V.E
*line_break
[b][i]PERSONALITY[/i][/b]
*stat_chart 
	percent aggressive Aggressive
	percent calm Calm
	percent impulsive Impulsive
	percent cautious Cautious
	percent vengeful Vengeful
	percent altruistic Altruistic
	percent arrogant Arrogant
	percent humble Humble
	percent charismatic Charismatic
	percent awkward Awkward
*line_break 
*if power != false		
	*line_break
	[i][b]ABILITIES[/b][/i]
	*stat_chart
		percent endurance Endurance 
		percent re_gen Regeneration
		percent techno Techopathy/Technokinesis
		percent force_field Force field
		percent xray_infrared X-ray/Infrared Vision
		percent strength Strength
		percent speed Speed
		percent illusion Illusion
		percent cyborg Cyborgial Transformations
		percent flight Flight
*if (shield_ != false)
	Shield Count - ${shield}

*choice
	#Detailed Bio 
		*goto bio2
	#Abilities
		*goto powerexplain
		*choice 
			#Back to Main Screen
			*goto pov_armour
	#Subjects and People of Interest
		*goto SOI2

			*choice 
				#Go back 
					*goto pov_armour
*goto end_stats
		
		
*label powerexplain
*if power != false 
	*fake_choice 
		#[b]Regeneration:[/b]
			lllmghh
			*choice 
				#Back to Abilities
					*goto powerexplain
				#	Back to Power Screen
					*goto pov_armour
	
	#	Back to Power Screen
		*goto pov_armour
	





*label SOI2
*fake_choice 
	#A 
		The first Letter of the alphabet
		*choice 
			#Back to Subjects of Interest
				*goto SOI2
			#Back to Power Screen
				*goto pov_armour
	#Back to Power Screen
		*goto pov_armour

*label bio2
[b]NAME:[/b]${name} Summers
*line_break
[b]AGE:[/b]${age}
*line_break
[b]SEX:[/b]${gender}


*label end_stats

So, your problem is on thepov_armour, isn’t it?
I don’t see anything wrong with your code setup. Where exactly do you want the stats change to happen? Does it change on that particular point?

Know what guys. I thought of a better idea and I won’t use this procedure anymmore. Thanks for your help

I thought of something.
Is there a way to make a set of stats get an increase when a variable is called or when a variable is true

Havent tried it myself, but if you use a go_sub where you then create an *if statement with that variable (adding the stat boosters) then anytime you switch the variable on or off, just add the go_sub

1 Like

Whenever you have the variable true just set all the stats to increase or decrease too…

12

1 Like

Can you code something for me so I can use that as a reference.

Example: when pov_armour is true, 5 stats will get a %+5 increase

1 Like

That will look like this, I think.

*set pov_armour true
*gosub stat_changes

You start to feel a water-like liquid wrap around your body, hugging you from head to toe becoming armour. It's so subtle that the woman doesn't notice until the last minute and she yells at her men to start shooting before running for cover.
*line_break
They shoot at you from all angles not giving you enough breathing space to react. 
*line_break

Then, somewhere within the same file,

*label stat_changes
*if (pov_armour = true)
	*set stat1 %+5
	*set stat2 %+5
	*set stat3 %+5
	*set stat4 %+5
	*set stat5 %+5
*if (pov_armour = false)
	*set stat1 %-5
	*set stat2 %-5
	*set stat3 %-5
	*set stat4 %-5
	*set stat5 %-5
*return

Or, if the occurrence of *set pov_armour true/false is present in multiple files, you could use *gosub_scene instead.

*set pov_armour true
*gosub_scene background_stuff

You start to feel a water-like liquid wrap around your body, hugging you from head to toe becoming armour. It's so subtle that the woman doesn't notice until the last minute and she yells at her men to start shooting before running for cover.
*line_break
They shoot at you from all angles not giving you enough breathing space to react. 
*line_break

Then, within the file named “background_stuff.txt”

*if (pov_armour = true)
	*set stat1 %+5
	*set stat2 %+5
	*set stat3 %+5
	*set stat4 %+5
	*set stat5 %+5
*if (pov_armour = false)
	*set stat1 %-5
	*set stat2 %-5
	*set stat3 %-5
	*set stat4 %-5
	*set stat5 %-5
*return

That way, whenever you change the status of pov_armour, you only have to write the *gosub or *gosub_scene command

3 Likes

This should work. The *gosub scene is much more difficult imo, just add the regular *gosub into each of your scenes where it is applicable. Then use *gosub whenever the variable changes

1 Like

The gosubs worked but I had another issue. The starting value of each stat is 10 but when I added %+6 to each of the stats it gave a final value of 19 which is not supposed to be so because it should give me 15

The thing about this is I want the stats to go back to their original positions when the player’s armour comes off.

Look at it like this. I have a certain level of power, when I get a boost my power level increases by a certain amount which changes overtime but when the boost wears off my power level returns to it’s previous power level.

You dig?

1 Like

Then create a choice,

*fake_choice
#take off armour
*set stat1 %10
*set stat2 %10
*set sta3 %10
#keep armour on
*set stat1 %50
*set stat2 %50
*set sta3 %50

There needs to be a space in between %+ and 5. See if that works. Otherwise, instead of using fairmath, simply say *set stat1 + 10 or whatever other number

As mentioned by @Jackpot1776, it will be much simpler for the stats to go back to their original position by not using fairmath.

But, if you insist on using the fairmath and/or the effect the player’s armour has on the stats aren’t always fixed, you can try the following

*gosub stats_save
*set pov_armour true
*gosub stats_boost

You start to feel a water-like liquid wrap around your body, hugging you from head to toe becoming armour. It's so subtle that the woman doesn't notice until the last minute and she yells at her men to start shooting before running for cover.
*line_break
They shoot at you from all angles not giving you enough breathing space to react. 
*line_break

*page_break

*set pov_armour false
*gosub stats_restore

And in the same file

*label stats_save
*set save1 stat1
*set save2 stat2
*set save3 stat3
*set save4 stat4
*set save5 stat5
*return

*label stats_boost
*set stat1 %+5
*set stat2 %+5
*set stat3 %+5
*set stat4 %+5
*set stat5 %+5
*return

*label stats_restore
*set stat1 save1
*set stat2 save2
*set stat3 save3
*set stat4 save4
*set stat5 save5
*return

By ‘saving’ the stats before boosting them, you can use the *gosub stats_restore to return the stats to their position prior wearing the armour.

This however, could create a problem of it’s own, as it will ignore all the changes in stats—the one unrelated to the boost—when the player is wearing their armour.

It should be 15. Don’t know why it gives you 19.

2 Likes

I would advise you use gosub
One for increase the other for decrease
To increase or reduce the armour variables by given values respectively

So any time you want to use the armour
Gosub scene…
The stats
It increases
When you take it off
It reduces

1 Like