Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
Polraudio

[XP/Solved]Making Thigs Happen After Certiant Game Time

Question

I know you can do this by using the if command but i dont know how to make it but it should look something like this.

if game_time =="10:00:00"

Im trying to make it where you can access certian commands after certian time.

EDIT: Playtime is what i mean

 

I know Leon might know how this could be done.

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Do you think making a variable that equals "Play Time" would work? It would be in Operand, Other, Play Time.

Share this post


Link to post
Share on other sites
  • 0

After a certain play time?

 

From Window_PlayTime:

	@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60

So, if you want to set it to a variable, you could do:

Script...

x = $game_variables[1]
g = Graphics.frame_count
h = Graphics.frame_rate
ts = g/h
x = ts/60/60

That will set the hour equal to the number of hours the player has, well, played. That code snippet you can call with an event, and it sets it equal to game variable 1

Share this post


Link to post
Share on other sites
  • 0

This sounds interesting, you could make like easter eggs if you finished the game really fast.

Share this post


Link to post
Share on other sites
  • 0
After a certain play time?

 

From Window_PlayTime:

	@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60

So, if you want to set it to a variable, you could do:

Script...

x = $game_variables[1]
g = Graphics.frame_count
h = Graphics.frame_rate
ts = g/h
x = ts/60/60

That will set the hour equal to the number of hours the player has, well, played. That code snippet you can call with an event, and it sets it equal to game variable 1

It don't work. I tried making an event that would change it to variable 1 to 7 then i used another event with that script in it and it didn't change the variable to 0.

 

How would i set the min and sec?

 

This sounds interesting, you could make like easter eggs if you finished the game really fast.

Thats the plan or something like that. Its mainly going to be used for my Rewards System.

Share this post


Link to post
Share on other sites
  • 0

Sorry for the double-post:

g = Graphics.frame_count
h = Graphics.frame_rate
ts = g/h
x = ts/60/60
$game_variables[1] = x

That gives hour. For minute, x = ts/60 % 60

For second: ts % 60

Share this post


Link to post
Share on other sites
  • 0
Sorry for the double-post:

g = Graphics.frame_count
h = Graphics.frame_rate
ts = g/h
x = ts/60/60
$game_variables[1] = x

That gives hour. For minute, x = ts/60 % 60

For second: ts % 60

Now it works. Thank you very much Leon. Off to the Special Thanks with you.

Share this post


Link to post
Share on other sites
  • 0
Now it works. Thank you very much Leon. Off to the Special Thanks with you.

 

 

Ha ha! That sounded funny. Good job Leon!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...