How to create a character death

Hi, so I’m a budding author and just playing around with ChoiceScript right now, but how would you incorporate a character death (whether it’s the main character or a side character) into the startup. Like how would you write that out? Would it be something like:

*create MC alive
*create MC dead

Not sure, would appreciate any and all help with this

1 Like

I’m not completely sure what you’re going for, but I’d probably do something like:

*comment status refers to whether the character is dead or alive. 1=living, 2=dead
*create mc_status 1

I like using numeric values because they’re easier to do multireplace with imo. And I always comment out what everything means just as good practice.

But you could also do something like

*create mc_status "alive"
3 Likes

You can use a boolean. So:

*create MC_alive true

And flip it to false if MC dies. Then you only need to check one variable :slight_smile:

If you’re odd like me and prefer to work with numbers, traditionally 0 mean false and 1 means true, so I’d do:

*create MC_alive 1

And flip the value to 0 if MC dies. Same idea, different flavor.

4 Likes

Of course, if you’ll have a status for the character being both alive and dead at the same time, or not alive and not dead at the same time, you won’t manage with one boolean (you could manage with one numeric variable, but not everybody finds them as readable).

3 Likes

Which (just to cover all the bases for the OP) you’d do not by *create-ing a new variable, but like this:

*set MC_alive false

at the point in the story where the MC dies.

4 Likes

Yes indeed! :smiley:

1 Like

I’ll note that having a variable equal 0 has caused coding issues for me in the past and cannot be used in multireplace. That’s why I default to 1/2 instead of 0/1.

And I cannot believe I did not think of a boolean variable. Definitely the best option, imo. Easy to flip and useful in multireplace.

4 Likes

Thanks to everyone! I think I get it now, i’m just curious if there is anything you need to put in the choicescript_stats?

Only if you think the player needs to be reminded if they’re dead or alive.

In most games, most of the variables aren’t shown in the stats screen. They’re doing work “under the hood” but don’t need to be displayed in choicescript_stats.

2 Likes

Ok, thank you!

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.