I've an idea for a story in a Soulslike setting. Ignoring the very obvious stuff that a written story cannot do compared to video game, the main feature I'd like to make use of is the dying/respawning gimmick. I'm not sure if Variables can support it though, or how well they'd be able to do it.
Using the
first boss of DS3 as an example of what I'd do if the mechanic can be used, the player might die a number of times in the first phase (humanoid) because of poor choices (not enough restoration items, misjudging attack patterns, not enough environmental awareness, etc) with future fights minimizing/eliminating certain options until after a certain amount of deaths, they get past all the issues and manage to get to the boss's second phase (inky snake monster thing).
After triggering this second phase, the player could again try to brute force their way past multiple deaths to EVENTUALLY get the options that guarantee a win, or get lucky and manage to get the right choices to win with fewer deaths. Another option, would be that this encounter would open up new options to the player, like more conversation topics for an NPC who might have an idea that either expands the amount of actions a player can take (giving the player fire bombs because they think the creature might be weak to fire) or eliminating guaranteed failure options.
Another thing I want to do, but am unsure if I can/should, would be track how often the player dies and have that influence things down the road. How, I don't know yet, but feels like if used right it could be a promising variable.
Unfortunately, all the stuff regarding the site's game mode is mostly gibberish to me. I can't immediately determine whether or not its possible to do something like that the way I want or not, and I'd rather not start off with a less-than-basic idea of how to make the mechanics work the way I want only to find out after a significant amount of work later that I can't follow through on the ideas.
Actually, everything you've just asked about is super easy! I'm gonna explain every aspect of it to be safe, so if you already know something, sorry that it might come off as condescending. It's also going to end up sounding pretty complicated, so be sure to take it step-by-step and go slow through it! Refer back to it as you need, and you'll get the hang of it after writing a few chapters, promise.
Firstly, just have a variable named "
Deaths" that goes up by one each time a player dies. You can do this by having a "death" chapter option in the boss fight page -- the "death" chapter would require your
HP variable to be <1, and every other chapter (run in and attack, drink a potion, etc.) requires your
HP variable to be >0. The "death" chapter would increase
Deaths by 1, and link back to your last Bonfire equivalent. To make a Link chapter, while editing the chapter contents click "Create Link Chapter" on the right side, and select what chapter you want it to connect to. A link chapter can't have any text, so create a new chapter for this, or it'll delete whatever you've got written. In addition to increasing the player's
Deaths, you should also use this to change whatever other variables you want to change, such as refilling their
HP (and the Boss').
In the main Boss Fight chapter, each option should link back to the "hub" of sorts, where all options are available. For example:
Fight the Boss
>Attack its Legs
>>(Link back to Boss)
>Drink Healing Potion
>>(Link back to Boss)
>Activate Second Phase [REQUIRES BOSS HP < X%]
>>New "hub" chapter for fighting the boss, with new battle options
>Death
>>(Link back to Bonfire)
There would be other ways to do this involving the options
themselves being links, and changing a hidden variable to create entirely new text on the Fight the Boss page, but that's complicated and you don't need to even think about it if it's your first time using variables, this way works just as well anyway.
Each of the options can have variable requirements to choose them -- for example, to drink a potion you need your
HP < 100% and your
Potions > 0, or to choose certain options you need your
Deaths over a certain threshold, like you were asking about. You can use more specific variables for this too, such as
LearnedFireWeakness == True. You can also have variables that internally count how often you use each option -- for example, "Attack its Legs" could have
BossLegAttack + 1 each time you view it, and internally change text based on that variable so that it's not just the same thing over and over -- maybe even making changes as big as the Boss learning and countering if you do the same thing too many times, or just as simple a change as flavour text that basically explains the same thing. I'll cover how to change text based on variables in a bit!
Be sure to reset any variables like
BossLegAttack to 0 when the player dies, so that they don't go in continuing from last time. If you like, you can make these variables more general (such as
AttackBossType1), so that you don't need to make new ones for each boss and can just reuse the old ones -- which'll work, since you'll never be fighting two bosses at once, and they should all be set to 0 when the fight starts anyway. Also, you probably want to set variables like that to Hidden so that the player can't see them, which can be done by clicking the box with two rectangles until it's a circle with a line through it when setting or changing the variable. The two rectangles mean keep the variable's current visibility, the eye means make it visible, and the circle with a line through it means make it hidden.
You could also base which versions of the same-looking chapter the player sees based on their in-game stats. For example, having two chapters called "Attack its Legs", which I'll call
A and
B. Chapter
A would require
Strength > 50, and would be invisible otherwise. Chapter
B would require
Strength < 51, and would be invisible otherwise. This means that the player only ever sees one version of the Chapter. Chapter
A would be a success, leading to reduced Boss HP, whereas Chapter
B would be a failure, in which you take damage. If you wanted, you could even make the system more complicated like the following, but that would just be for optional immersion:
Attack the Legs (A)
Requires Strength > 50
Requires
BossLegAttack == 0
Sets
BossLegAttack to 1
Reduces
Boss HP (success)
Attack the Legs (B)
Requires Strength < 51
Requires
BossLegAttack == 0
Sets
BossLegAttack to 1
Reduces
Player HP (failure)
Attack the Legs (C)
Requires Strength > 60
Requires
BossLegAttack == 1
Sets
BossLegAttack to 2
Reduces
Boss HP (success)
Attack the Legs (D)
Requires Strength > 61
Requires
BossLegAttack == 1
Sets
BossLegAttack to 2
Reduces
Player HP (failure)
A system like the above would mean that the Player needs a higher
Strength to do the same move successfully for a second time. Do keep in mind that it's good game design to have a way for players to win no matter what, even if it's just one obscure path of choices, and that barring
every success behind a stat can be frustrating for no reason. People are here to have fun and read stories, not to get stuck on a pointlessly hard boss and have to reclick through a bunch of chapters for a second try. If something's going to be punishing to lose, make it feel rewarding to win. Be cautious not to follow video games' design too closely in all areas, because we're making something completely different here, and you wouldn't want a clock powered by car batteries.
Now, onto the last bit to do with what you were asking about -- making
Deaths change things down the line! That means getting into how variables can change chapter text. This is going to look really complicated, but take your time, because it's actually fairly simple once you get the hang of things. I'm gonna try to set things out in the most clear way possible. I'll do the example of a conversation that has special text if you've never died, different special text if you've died five or more times, special text if you've died twenty or more times, and default text for if you've died 1-4 times. Keep in mind that if you want something like "special text if you've died to
BOSS ONE x amount of times", or any other variable in the game, it'll work the exact same way but you'd have to set up the variable beforehand -- e.g. making Boss One's death chapter increase
Deaths by 1, as well as increasing
BossOneDeaths by 1. Remember that you can also use all of these variables as requirements to view specific chapters, too.
Right, onto the complicated-looking changing text! I'm going to write it out in phases, and explain it all in a paragraph beneath each phase. Please do refer back to the complicated-looking bit as you read the paragraph beneath, it'll make it easier to get. And trust me, everything's a lot easier after you do it yourself a few times, that's all it takes to really get it!
{if Deaths = 0}"Ah! You look like somebody who can handle themself."
{elseif Deaths > 19}"I'm not sure you should go any further. The things in here will eat you alive."
{elseif Deaths > 4}"Hello! Be careful, it's not safe around here."
{else}"Well met, friend."
{endif}
Squiggly brackets are the ones you've got to use. It should be pretty clear what's happening here, for the most part -- make sure to end each contingency with an "{endif}" to close the check. Only one {endif} is required in the above example, because only one {if...} was used -- {elseif}s continue on from the original. Also, notice that {if Deaths > 19} comes
before {if Deaths > 4}, because if it went the other way, somebody with 28
Deaths would only ever see the {if Deaths > 4} text, since they meet that requirement and wouldn't go on to the else-case.
Now, here's the same thing, but also with changes based on if you have a certain amount of money:
{if Deaths = 0}"Ah! You look like somebody who can handle themself.
{if Money > 15} I don't suppose I could interest you in some armour and weapons, then?
{endif}"
{elseif Deaths > 19}"I'm not sure you should go any further. The things in here will eat you alive.
{if Money > 15} Especially in that rinky armour you've got on -- you could really use what I'm selling.
{else} Come back when you've got some money for new gear.
{endif}"
{elseif Deaths > 4}"Hello! Be careful, it's not safe around here.
{if Money > 15} You should consider investing in some new equipment.
{endif}"
{else}"Well met, friend.
{if Money > 15} Can I interest you in any weapons or armour?"
{endif}
It looks complicated! I know! But trust me, it's not that bad. Here's a few examples of variable states and outputs, try to follow them through in the above example to get a better understanding of what's going on:
Deaths = 0 and
Money = 0
"Ah! You look like somebody who can handle themself."
Deaths = 0 and
Money = 40
"Ah! You look like somebody who can handle themself. I don't suppose I could interest you in some armour and weapons, then?"
Deaths = 26 and
Money = 4
"I'm not sure you should go any further. The things in here will eat you alive. Come back when you've got some money for new gear."
Deaths = 26 and
Money = 32
"I'm not sure you should go any further. The things in here will eat you alive. Especially in that rinky armour you've got on -- you could really use what I'm selling."
Notice that the new variable checks also require an {endif}, and this {endif} can be contained within a different check if you like, and once ended the first check's {elseif}s and {else}s can still pick up from it. Try see if you can follow the text through to find what would be printed if
Deaths = 18 and
Money = 12. Play around with it and try writing your own strings and then following through until you've got a grasp on it. You can also use totally different variables for an {elseif} in the same string of logic -- for example, here's a string of text where you get special text if you have some specific
Armour levels, and different special text if you don't have that
Armour level but
do have a certain
Reputation level:
"
{if Armour == 5}That plate sure is fine craftsmanship.
{elseif Armour == 4}That mail looks sturdy enough.
{elseif Reputation > 20}You're doing great work out there.
{else}Good day.
{endif}" The man says with a nod.
Hopefully that answers all of your questions, and gives you a guide to follow until it becomes natural to you! Let me know if you've got any questions, and have a good time writing!