HimariMegami

Warper
Member
Joined
Apr 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Not that great with rpgm yet but im trying to implement a passage of time idea, without a script. by just using variables.

I plan to have a 60 minute, 24 hour, 30 day, 12 month, a year system.
Using variables i allready got the gist of how to do it.
Wondering if its efficient and there is a easier way to do this.

First i made 5 variables, 1 each for minutes, hours ,days, months, and years (named as such.)
Then when I wish time to progress or advance I input it in with the event or action.
ie a cutscene which takes around 10 minutes in game, I simply put :
control variables: [0006:minutes]+=10, (within the event page for this cutscene)
Then after this putting a:
Conditional branch: Variable [0006:minutes]>=60 (greater or equal to 60)
Control variables: [0007:hours] +=1 (add one hour)
Control variables: [0006:minutes] -= 60 (minus 60 minutes)

This lets minutes flow up the hours and resets the minutes, and its simple to do this with hours into days
Conditional branch: Variable [0007:hours]>=24 (greater or equal to 24)
Control variables: [0008:days] +=1 (add one day)
Control variables: [0007:hours] -= 24 (minus 24 hours)
And so on for days months and years.

To see this time change ingame, there is a simple event where if you have a clock in your protagonists house, or a clock anywhere.
Have a priority same as character, action trigger event on the clock and input:
Conditional branch: variable[0006:minutes] < 10 (under 10 minutes)
Text:-, -, Normal, Bottom (or middle or top or what ever)
: : It's \v[007]:0\v[006] (first one is hour variable second is minutes, odd 0 is important)

: Else
Text :-, -, Normal, Bottom
: : It's \v[007]:\v[006]
The conditional branch is because when it reads out variables it dictates them exactly, so if it was:
5 hours and 5 minutes. it would incorrectly say 5:5 which is not standard time reading.
With the conditional branch adding the 0 before the minute readout when it is lower than 10 minutes.
making it read 5 hours and 5 minutes as 5:05
If you want to to read 05:05 (which looks weird to me), you will need to add a second layer of conditional branch,
using hours lower than 10 ect.
Obviously those who know how to utilize variables for event triggers or completion, or what ever they can be used for. You see how this could be used.

Hoping for some feedback or questions if anyone doesn't understand.
Is this next best thing since sliced bread, or is it a really twisted or buggy way to have a time passage feature in a game... :p
thanks

I have a small game file of my work, its 2 mb on mega
https://mega.nz/#F!1UdxxYYJ!czXYnQvBN0OlOLCntDp8tA
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,002
First Language
English
Primarily Uses
RMVXA
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using.

[move]RPG Maker VX Ace[/move]
I can't comment on the overall structure of what you're trying to do, but please note that when indicating the ID of a switch or variable, you do not include the leading zeros. So e.g. instead of [0006] it would be [6]
 

HimariMegami

Warper
Member
Joined
Apr 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using.

[move]RPG Maker VX Ace[/move]
I can't comment on the overall structure of what you're trying to do, but please note that when indicating the ID of a switch or variable, you do not include the leading zeros. So e.g. instead of [0006] it would be [6]

Ok thanks, sorry for posting in the wrong section. I just assumed its a gameplay mechanic I'm trying to figure out so i posted here.

I posted it as 0006 because thats how it looks in the event page.
I'm just guessing an advanced user would understand my garbage explanation and would know what I'm trying to do, and tell me how its done for real.

General ramblings now. (no longer reply)
I can do most of what i want to implement in my game with this technique im using, just not a time delayed effect.
for example, self cast one month spell effect, and once the month is over the spell effect ends.
I have an idea but not certain yet.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
525
Reaction score
1,528
First Language
Indonesia
Primarily Uses
RMMV
It's hurtful to watch how you handle the variables, especially when you use substraction...
This is where modulo is useful for
upload_2019-8-21_23-31-36.png

If it was me, I will separate the use of time to operate, and time for show. Depend on its importance, I will use minutes and days for operating. It mean I can only control this 2 variable.
Code:
# This will be called whenever time progress

# List of variable to be used :
# Variable [0001:minutes]
# Variable [0002:days]
# Variable [0003:minute]
# Variable [0004:hour]
# Variable [0005:date]
# Variable [0006:month]
# Variable [0007:year]

Conditional branch: Variable [0001:minutes]>=1440
  Control variables: [0002:days] += 1
end
Control variables: [0001:minutes] %= 1440

# If I want to show it, I just need to use another variable to use and convert it.

# Initiate to operant
Control variables: [0003..0004] = Variable: [0001:minutes]
Control variables: [0005..0007] = Variable: [0002:days]

# Get the value of minute for show
Control variables: [0003:minute] %= 60

# Get the value of hour for show
Control variables: [0004:hour] /= 60
Control variables: [0004:hour] %= 24

# Get the value of date for show
Control variables: [0005:date] %= 30

# Get the value of month for show
Control variables: [0006:month] /= 30
Control variables: [0006:month] %= 12

# Get the value of year for show
Control variables: [0007:year] /= 360

I do it like this because it will be easier with just 2 variable to control.
 
Last edited:

HimariMegami

Warper
Member
Joined
Apr 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Conditional branch: Variable [0001:minutes]>=1440
Control variables: [0001:minutes] %= 1440
Control variables: [0002:days] += 1
end
Wouldnt there be an issue when it gets to 1410 minutes aka 23:30 pm and you pass 60 minutes its value would be 1470 putting it to 24:30 pm.
But the issue is when you do a percentage 1440 of 1470 would not set it back to 30 would it (00:30 am)?
or am i misunderstanding the mod function?
I used minus because that's how I felt I had to overcome that issue.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
525
Reaction score
1,528
First Language
Indonesia
Primarily Uses
RMMV
Yeah, that's how mod works. It's like "repeat substracting until it can't be substracted anymore, avoid reach negative value" and leave the remainder.

Putting it inside the conditional branch are not necessary though. You can just put it outside. The conditional branch are mean for the days +1.
(edited post above)
 
Last edited:

HimariMegami

Warper
Member
Joined
Apr 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I need it to keep the remaining value so time is not lost.
if its 23:45 and thirty minutes is added to the value, it will subtract to 00:00 instead of 00:15?
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
525
Reaction score
1,528
First Language
Indonesia
Primarily Uses
RMMV
23:45 (mean minutes = 1425)

Add 30 minutes (1425 + 30 = 1455)

Condition check (1455 >= 1440) passed

Days += 1

1455 mod 1440 = 15

# Get the value of minute for show
15 mod 60 = 15

# Get the value of hour for show
15 / 60 = 0
0 mod 24 = 0

minute = 15
hour = 0
Output = 0:15

No time lost.
 

Latest Threads

Latest Posts

Latest Profile Posts

2021 has been the runner-up for the worst year of my life. 2015 may take that title, but '21 is pushing it. Excuses really don't justify how much of a jerk I've been this year to a lot of people.

I'm sorry. I don't intend to be a jerk forever, but I'd rather back up my intent with actions, not words.
"Another hundred habaneros... a teaspoon of tumeric... and a heaping helping of nitroglycerin!" The kitten in a chef's hat laughed maniacally as the pot he was stirring promptly exploded.
Woot got a promotion and a pay rise ᕙ( • ‿ • )ᕗ now I'm set.
does anyone feel like explaining to me the difference between simulation and emulation? you have my full permission to be as pedantic as you want.

Forum statistics

Threads
116,010
Messages
1,094,898
Members
151,323
Latest member
yuyucomi
Top