Check How Much Time Has Passed

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
1,879
Reaction score
3,349
First Language
English
Primarily Uses
RMVXA
I'm making a timing based action battle system, and I know how to do most of it, but I just need to know if there's a way to check how much time has passed with a variable or a script call. (I would just use Galv's timed button attacks, but I'm using events for my battle system. I cannot figure this out for the life of me, even though I feel like it's right in front of me (which it probably is because sometimes I'm an extreme noob -_-) 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You just set a variable to the game time at the start of the battle, and when you want to check it, put the game time into another variable and calculate the difference.  I think that will give you seconds, so if you need to convert to minutes just /60.
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
Well, ruby has Time.now for the time, now. Check the Ruby document for 1.9.3, it's very nice documentation. 
 
Last edited by a moderator:

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
1,879
Reaction score
3,349
First Language
English
Primarily Uses
RMVXA
@Shaz So I'm assuming with that said, multiplying by 60 would split it into frames?


EDIT: This is not working. 

Screenshot (49).pngScreenshot (50).pngScreenshot (51).png

The button inputs aren't working at all, no matter how many times I press. 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You do not set the time and check the time in the same event.


You 'set' the time at the start of the battle.  On another event page, you get the current time into a different variable then take the first variable away from it.  This will tell you how many seconds have elapsed.  If you want to know how many frames, yes, you would multiply by 60.
 

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
1,879
Reaction score
3,349
First Language
English
Primarily Uses
RMVXA
Thanks, Shaz. I basically have the system figured out now, but how would I reset the time at the end of each turn? 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You just need another page that gets executed once per turn that sets the original variable again.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top