HTML Random message on phone Twine Sugarcube

Drmmrt

Newbie
Jul 14, 2017
81
247
Hello everyone!

I'm having a little trouble with a feature on my game.
The idea is that players get messages on their phones by the characters they have unlocked.
The messages come in 3 or 4 variations, depending on how far they have progressed said characters.

What I have done so far:
In a couple of passages, a variable is set to a random number (between 0 and 5) and if that number is 1 another variable is set to true.
When that happens, another passage checks which characters are unlocked and how far they have progressed with them, and if which messages should be included, and then it picks one message to forward.
Finally, in the sidebar, a link is shown that says 'new message!' and the player can click that to read the message.

The problem is:
This works okay-ish at first, but the farther the player progresses the more messages he/she receives to a point that is get's really annoying.

Does anyone have an idea about how I could make this a little more realistic and playable?
I'm an amateur when it comes to coding and twine (though I came a lot further than I first thought I would :ROFLMAO:) so if there is an option, I would like to keep it as simple as possible.

Thanks in advance, I'm looking forward to any, and all ideas!
 

Rafster

Bear chaser
Game Developer
Mar 23, 2019
2,012
3,932
What if, you choose only one message at day from a random character you have unlocked? (could be after one particular hour of the day) That's how I plan to implement this feature on the game I'm making. Of course, I'm at a very early stage of development so I cannot give you a more technical reply. It will be weeks until I get to this part.
 
  • Like
Reactions: Drmmrt

Drmmrt

Newbie
Jul 14, 2017
81
247
What if, you choose only one message at day from a random character you have unlocked? (could be after one particular hour of the day) That's how I plan to implement this feature on the game I'm making. Of course, I'm at a very early stage of development so I cannot give you a more technical reply. It will be weeks until I get to this part.
Thanks! Sounds like a good starting point!
 
  • Like
Reactions: Rafster
Apr 24, 2020
192
257
If the messages are meant to repeat, then you might also want to keep a record of which messages you have shown. That way you can prioritize messages the player haven't seen or the ones that the player hasn't seen in a long while.

Hades has a very good system for offering dialogue pieces, here's a video that goes over the basics:
 

Drmmrt

Newbie
Jul 14, 2017
81
247
If the messages are meant to repeat, then you might also want to keep a record of which messages you have shown. That way you can prioritize messages the player haven't seen or the ones that the player hasn't seen in a long while.

Hades has a very good system for offering dialogue pieces, here's a video that goes over the basics:
Thanks a lot for the video! That's fascinating stuf! :D(y)