I am trying to add a calender system, but I am having trouble with it displaying the right day name.
I have a few variables:
Total Day - Integer (Just a total amount of day collected in the game)
Day Name[6] - Text (This is filled with Mon/Tue/Wed etc... from 0~6)
Day Name Changer - Integer (This is used to specify which Day Name to use in the array)
How would I get it so that the Day Name changes according to the Total Day that passed? (Meaning if there had been a total of 1 day, than it's Tue, or if its 8 days, the current name should be Mon).
I know part of the trigger should be doing, when the day passed, the Day Name Changer + 1, or set to 0 if it's already 6.
I couldn't figure this one out because the Day Name Changer seems to be doing more than +1 for each Total Day, making the names wrong.
Currently this is the trigger that work when I don't try to make the Total Day working with it.
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Day Name Changer >= 6
Then
Variable - Set Day Name Changer = 0
Else
Variable - Modify Day Name Changer: + 1
For each A from 0 to Total Day.
+1 to Day Name Changer.
If that's the trigger you used, this explains it. Say that its day 5. The trigger will cycle through the action list for the "For then" 5 times, so the TotalDay value will go up +5 instead of +1.
Quote from ChromiumBoy:
Quote from DarkForce9999: Go
For each A from 0 to Total Day. +1 to Day Name Changer.
If that's the trigger you used, this explains it. Say that its day 5. The trigger will cycle through the action list for the "For then" 5 times, so the TotalDay value will go up +5 instead of +1.
----
So what should I be doing if I want my calendar to synchronize with the total day? 0 being Monday and incrementing afterward? I'm planning to bank the total day as well so it's always synced.
Although i have a hunch I need a variable that stores the total days and then subtract it each time the days increment.
While StoredTotal >= 0
Storedtotal - 1
day name changer if then else routine here.
I am trying to add a calender system, but I am having trouble with it displaying the right day name.
I have a few variables:
Total Day - Integer (Just a total amount of day collected in the game)
Day Name[6] - Text (This is filled with Mon/Tue/Wed etc... from 0~6)
Day Name Changer - Integer (This is used to specify which Day Name to use in the array)
How would I get it so that the Day Name changes according to the Total Day that passed? (Meaning if there had been a total of 1 day, than it's Tue, or if its 8 days, the current name should be Mon).
I know part of the trigger should be doing, when the day passed, the Day Name Changer + 1, or set to 0 if it's already 6.
I couldn't figure this one out because the Day Name Changer seems to be doing more than +1 for each Total Day, making the names wrong.
Currently this is the trigger that work when I don't try to make the Total Day working with it.
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Day Name Changer >= 6
Then
Variable - Set Day Name Changer = 0
Else
Variable - Modify Day Name Changer: + 1
Are you sure that the action isn't being fired multiple times by mistake?
Quote from ChromiumBoy:
Are you sure that the action isn't being fired multiple times by mistake?
----
I am not very sure myself. I was using For and then tried a While, but I probably screwed up how it was going to be used or something.
For each A from 0 to Total Day.
+1 to Day Name Changer.
Although I don't think that's how it worked. So I am stumped.
If that's the trigger you used, this explains it. Say that its day 5. The trigger will cycle through the action list for the "For then" 5 times, so the TotalDay value will go up +5 instead of +1.
Quote from ChromiumBoy:
Quote from DarkForce9999: Go
For each A from 0 to Total Day. +1 to Day Name Changer.
If that's the trigger you used, this explains it. Say that its day 5. The trigger will cycle through the action list for the "For then" 5 times, so the TotalDay value will go up +5 instead of +1.
----
So what should I be doing if I want my calendar to synchronize with the total day? 0 being Monday and incrementing afterward? I'm planning to bank the total day as well so it's always synced.
Although i have a hunch I need a variable that stores the total days and then subtract it each time the days increment.
While StoredTotal >= 0
Storedtotal - 1
day name changer if then else routine here.
Is that it?
At the start of a new day:
Modify TotalDayNumber +1
If DayNameNumber = 7, then set DayNameNumber = 1, else modify DayNameNumber +1
If DayNameNumber = 1, then DayName = "Monday", etc. Using a switch case action should work here too.
and leave all the counting.
Quote from Pfaeff:
day name changer = (total day modulo 7)
your text = day name [day name changer]
and leave all the counting.
----
Thanks for the help guys.
0 should be obsolete in the array right?
edit: nope not at all.