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
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?
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
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.
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?
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
*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
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”
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
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.
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
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.