Date Function in ChoiceScript

Does anyone know if a ChoiceScript function exists to generate the current date, i.e. today - so the story begins (in the narrative) on the same real-world day the player begins to read?

Not officially, though you can use *script to call some JavaScript (but that’s not really a topic we tend to deep dive into on this forum).

1 Like

I had a similar question a while back but figured: Why?
While it can make for an interest gimmick, it can more easily make a story seem weird after a bit.
Because the world out there changes.
The game will not (unless you constantly update it to fit)

1 Like

Thanks! I’ll try the js angle then.

Personalization methods seem to make these games pretty engaging.

I think ‘right now’ (today) in a narrative could be kind of interesting for a life or world-changing event iike winning a lottery, a nuclear holocaust or the beginning of a post-apocalyptic event that begins when the game begins.

I’m trying to look beyond just name and gender for elements to personalize the game.

Do you have any favorite personalization choices/inputs that you would like to share?

No, really don’t go for JS. just… maybe drop that gimmick entirely (espcially since js can majory screw with the game. so it’s easily the choice between a working game or the gimmick. I know this sounds harsh, but from what i’ve seen this can easily be true)
A work around could be to let the player enter a date at the start and have a counter-variable running when the day changes ingame.

Enter a month (numbers)
input_text month

and when the day changes ingame

*gosub newday

and there

*set day +1
*if ((day = 28) and (month = 2))
   *set day "1"
   *set month "3"


heck, you could have a fieldday with things that way, by having the story adjust to the year entered, like

*if (year > 2000)
   take out your cellphone
*if (year < 1980)
   head to the next phone booth

to call Andrew