I'm trying to create an age mechanic for my game

My current project needs a mechanic where the player can choose their age, for instance a number between 20-60.

I’m not sure how this could be implemented in game, what would be best is something like a slider or tab where you choose your specific age.

Not only do I need this but I also need to make it so your age affects certain stats from the start.

I realize I could make each individual year a choice of its own, and I could even think of some clever little ways to make going this route less clunky but I’m hoping to find a better alternative.

I realize this is an advanced mechanic and I’ve never seen it implemented in any of the Choice Of Games, so I find myself on my own in this so ANY ideas or help would be much appreciated.

You let people type in their age using input number.

You can then check to make sure the number isn’t outside your range using if statements.

You can also set up age-ranges, instead of doing each age individually, so

if (age >20) and (age < 30)

etc

3 Likes

Thank you so much, I’m new at this so I don’t know all the commands.

1 Like

I can give more specific information on how to but I always find searching for the precise ways myself helps me learn how to code. The wiki’s a great source for information, as is looking at the code of other games.

I’m trying to think, off the top of my head, if any games allow for you to choose your age. Creatures such as we does and uses age ranges. I’m not sure if it has any impact though.

*fake_choice

  #A young…
    *set age "young"

  #A thirty-something…
    *set age "thirty"

  #A middle-aged…
    *set age "middle"

  #An older…
    *set age "older"

  #A near-retirement…
    *set age "older"

The way I was suggesting is just

How old are you? (You may choose between 20 and 60)

*input_number age 20 60

And then doing, if needed

*if age <30
    *set wisdom -10
    *set health +10
    You're young and full of life, with much to learn.
*if age >50 
    You're old and not as healthy as you were, but you sure know a lot. 
    *set wisdom +10
    *set health -10 

However, doing this means that people can’t play that super-athletic older person if they want. It can be limiting. So I’d be more in favour of not actually limiting stats, and just acknowledging that a 60 year old whose a kickboxing champion is unusual, or something.

3 Likes

I’d say just do the same thing when a player wants to name the MC instead of picking from the random list of names. maybe this way you’ll have more control?

Sabres of Infinity lets you pick your age (14, 18, 25, or 30) at the start with different stat adjustments if you’re other than 18.

It’s workable, but the older age range isn’t yet old enough for penalties (right away) - those appear later in the series.

1 Like

I’m not saying this would work for you, but I’d love to write a game where you pick a series of backgrounds and life-paths at the beginning and those set your starting skills, contacts etc., but the more of them you take, the older you are at the start (which would lower some other stats). They would chain on from each other (so, if you took Private, you could later take Sergeant, or if you took Pickpocket, you could later take Burglar).

This way, a 62 year old character could be a kickboxing champ if they’ve spent all their path choices on fighting paths, but they’ll also have some cumulative drawbacks.

4 Likes