Global counters?

I’m doing a sci-fi piece with the possibility for multiple clones, and I need to include a death counter to see if someone has run out of lives. Furthermore, I need to include the integer for the death counter as a part of the character’s name, such as “Anne-7” or something like that. Is there a way to do this in Inform 7?

If you include the Play Counter extension, you can access the number of deaths as “the ending count”. (Or if there are other ways for the game to end except in death, “the ending count minus the final ending count”.)

Are these going to be counters of “deaths” in a single play session, or will the game actually end in death? Also, does this just include a player or an NPC?

If you’re doing it within a single play session, it’s pretty easy; do something like this:

[code]A person has a number called death count. A person has a number called maximum death count. The maximum death count of a person is usually 9.

After printing the name of a person (called fellow): say “-[death count of fellow]”.[/code]

Then in whatever code you have for killing a person, you increment the death count, check to see if it exceeds the maximum deaths, and do what you need to do.