Show Day count question

Hi all,
I have a really stupid question:
I have a variable (DayNumber) that ticks up 1 each 30 frames to represent one day passing. I want to show the number of days passed, and I have three events in a line, each representing a digit (I have 10 event images representing the digits) so that I can show up to 999 days. I'm not sure how to have the event images change to show the correct day count.
Thanks!
Assuming you are using events to use the images as event graphics to show each digit (meaning you have 3 events because your max is 999 days, so 3 digits)

Spoiler
You could split the number into three variables (1 variable for each event), and have each event use 10 pages. The left most page of each event will be for 0, next will be for 1 and so on until the right most page is for 9. Then each page will use the condition: Variable is equal to or greater than X, X being the page number. For Page 0, you can opt not to use the condition.

If you meant to use show pictures, you can still separate the number into its 3 digits, then use Conditional Branches to determine which image to show per digit.
I am using event graphics for each digit.
Thanks for the idea. I need to keep the variable as one whole number, because I use the day number in certain equations. I suppose I could have a separate whole day number variable in addition to the three, but I would prefer a simpler solution 🙁
Yeah, thats exactly what I was suggesting, separate the value into 3 for the graphic event purposes only. You will keep the main one as a whole because it will be more troublesome to use 3 for the main count...

Its actually simple, once you have one event setup, you just copy-paste it for the other two and just adjust the variable used in the conditions.

TBH, if you're using events graphics to show each digit, this is probably the least troublesome and sure fire way. Unless you want to calculate things inside the events and so on which is more troublesome.

Or unless you would rather use a plugin to show the graphics instead of events...
I suppose I could have a separate whole day number variable in addition to the three, but I would prefer a simpler solution
that IS the simplest solution.

if you want the three events to show the correct numbers without creating three variables for holding them, you would have to calculate each of the three numbers everytime and then use thirty different remote move command to change the graphics of all three events depending on the time.
that will add lag for the calculations and create a long events where you need to be carefull that every change command is in the correct conditional branch based on those calculations.

Anyone who ever tried to do it that way would realise very soon that using three variables and let the engine handle the conditions is much easier than trying to manually make conditional branches just to spare three extra variables.
Thanks for the answers. I was playing around with options this morning, and what I ended up doing was creating 3 common events with 10 conditionals each to tell the digit events whether to increment the count up one. Works great, though not any simpler than using Engr. Adiktuzmiko's suggestion.
Engr. Adiktuzmiko, could you explain how to split up a 3-digit variable into one variable for each digit?
I have another number I'm going to represent, and I wanted to try out your suggestion; but I'm a little unclear on the splitting-up the variable part.
One way is to use the modulo operator. It's a mathematical operator the same way that addition, multiplication, etc. are mathematical operators and is almost always denoted by the '%' symbol. You might wonder why this can help you.

For example, say your number is 219.
219 divided by 10 is 21 with 9 left over. The modulo operator gives you that 9 left over.

219 % 10 --> 9
219 / 10 and round down: 219 is now 21
21 % 10 --> 1
21 / 10 and round down: 21 is now 2
2 % 10 --> 2

Notice anything about the result of each modulo operation? That's right, it's your 3 digit number split into each digit. The best part about this solution is no script calls are necessary, you don't need to know anything about Javascript, it's pure eventing. Here is an example:

upload_2019-4-30_22-42-35.png



Another way is to use Javascript to convert the number into a string, then split the string into each character, then convert each character into a number.
Code:
const numArray = (219).toString().split('').map(Number);
console.log(numArray); // [2, 1, 9]
$gameVariables.setValue(11, numArray[0]);
$gameVariables.setValue(10, numArray[1]);
$gameVariables.setValue(9, numArray[2]);
Thanks a ton, Aloe Gunner!

Original thread: https://forums.rpgmakerweb.com/threads/show-day-count-question.108523/