Okay so this might be really obvious, but I’m new to this. I’m very confused on how to make a percentage go up, i mean it can’t just stay at 50% the entire game.
You've just finished a long day, what do you do again?
*choice
#I'm a realtor
*set Charm %+25
*finish
#I'm a sales advisor
*set Telepathy %+25
*finish
#I'm a personal trainer
*set Strength %+25
*finish
#I'm a... Well lets just say it's not exactly legal...
*set Menace %+25
*finish
This is what I originally tried, but it’s not right, any advice/suggestions?
Thanks
All the percentages are at 50%, after the choice I’d hope that it would go to 75%, although thinking about it know I’d probably want to add less than that like 10% or 5% because 25% seems like a lot. I read through the fairmath instructions, but it just seemed really confusing. And thanks for replying so fast, TBH i wasn’t expecting to here anything for a while.
If you want to increase or decrease a variable by a fixed amount, it’s easy.
If your variable was “eel” and eel is 50, and you want to raise it by 25, then you would just do:
*set eel +25
However, if eel is 50 and you want to increase eel by 25 percent of 50, then it’s a different process.
There are many different math equations that can work here, but I might use this one:
*set eel (eel * 0.25) +eel
So to follow that, eel is 50.
We’re telling the computer to find 25 percent, which is .25
That gives us 12.5
Then we add back the original number 50 to give us 62.5
Please let me know if this works for you because I haven’t actually tried it yet
Edit: I fixed the code, it didn’t work the first time. It should work now.
Okay so it worked for my text variable (money) , but it didn’t for my percentages.This is how the code looks:
*scene_list
startup
animal
variables
gosub
ending
death
*create money 100
You’ve just finished a long day, what do you do again?
*choice #I’m a realtor
*set charm +25
*finish #I’m a sales advisor
*set money +25
*finish #I’m a personal trainer
*set money +25
*finish #I’m a… Well lets just say it’s not exactly legal…
*set money +25
*finish
Also, if you want to show pre-formatted text, you can use the </> button on the toolbar (or press control shift c).
Edit: Ok, I see what happened:
In your stat chart, you should have already set the variables in startup.txt
So, if in your startup, these variables are set to 50, then you could display them like:
Increase/decrease the value of a variable with a diminishing effect (the higher the lesser ++, vice versa)
Use the +%[number] or -%[number] command to modify a variable using fairmath
Maximum value of variable is 99
Minimum value of variable is 1
Normal:
Increase/decrease the value with a fixed amount.
Use +[number] or -[number] instead of using +% or -%
No limitation on max/min value (go beyond 100 and 0)
By the way, you can use </> button at the comment toolbar to show your code. This way, your comment will have indents on it that resembles the actual code.
Also it may help to post what you have in your startup.txt just to make sure the variables are set correctly there.
If they aren’t set correctly in startup, they won’t display on the stats screen.
*title Life of a
*author EELSFOREALS
*scene_list
startup
animal
variables
gosub
ending
death
*create money 100
*create Hunger 50
*create Charm 50
*create Telepathy 50
*create Strength 50
*create Menace 50
*page_break
next screen:
You’ve just finished a long day, what do you do again?
*choice #I’m a realtor
*set Charm +25
*finish #I’m a sales advisor
*set Telepathy +25
*finish #I’m a personal trainer
*set Strength +25
*finish #I’m a… Well lets just say it’s not exactly legal…
*set Menace +25
*finish
*page_break
next screen:
You've just finished a long day, what do you do again?
*choice
#I'm a realtor
*set Charm +25
*finish
#I'm a sales advisor
*set Telepathy +25
*finish
#I'm a personal trainer
*set Strength +25
*finish
#I'm a... Well lets just say it's not exactly legal...
*set Menace +25
*finish
*page_break
If I may, when you initially create variables, you don’t capitalize:
*create strength 50
When you want to see the strength stat in the stat-screen, you can do either this:
percent Strength
Or this:
percent strength
But later when you want to add 15 points to strength, it should look like:
*set strength +15
Another thing I noticed is that the money stat isn’t capitalized but all of the percent stats are when you created them…
Also, you don’t have to put the *page_break command at the bottom of the stat page because the game already lets the player go back to the story from any of the stat pages…
It looks like you’re writing the first scene in the startup file… the game works just fine if this is the case, but it might be harder to tell where the story begins once you add more writing…