sleepingnamja seems to have found a fix that fixes the problem, and I've applied it to the script (v1.5.2) on the pastebin
Advanced Game Time
RGSS3 Scripts (RMVX Ace)Okay, I picked the new version straight from pastebin. It still doesn't work properly for me.
At first everything's alright when I paste the script into the project. There is no tinting delay anywhere.
But as soon as I set USE_VICTOR to true I get a "wrong number of arguments (1 for 2)" error when I start the game and it crashes instantly.
It's around line 536 ( $game_map.screen.shade.change_opacity(0) if no_tint )
When I change it to " $game_map.screen.shade.change_opacity(0,0) if no_tint " I can start the game, but then the tinting delay is back. 🙁
Any ideas how to solve this? I'd like to stick with victor's script as I have already implemented a lot of lamps and torches and stuff.
At first everything's alright when I paste the script into the project. There is no tinting delay anywhere.
But as soon as I set USE_VICTOR to true I get a "wrong number of arguments (1 for 2)" error when I start the game and it crashes instantly.
It's around line 536 ( $game_map.screen.shade.change_opacity(0) if no_tint )
When I change it to " $game_map.screen.shade.change_opacity(0,0) if no_tint " I can start the game, but then the tinting delay is back. 🙁
Any ideas how to solve this? I'd like to stick with victor's script as I have already implemented a lot of lamps and torches and stuff.
The only changes were with the Khas script. I don't think Victor's script was compatible to begin with even thought it's in there.
Edit:
Try this (I changed "change_color" to "set_color," the opacity might be wrong though.)
Edit:
Try this (I changed "change_color" to "set_color," the opacity might be wrong though.)
Code:
def use_victor return if $game_map.nil? self.visible = false $game_map.screen.shade.set_color(0,0,0) if no_tint $game_map.screen.shade.change_opacity(0) if no_tint return if no_tint $game_map.screen.shade.show if !$game_map.screen.shade.visible min = $game_time.min return if min == @old_time @old_time = min rgba = get_new_tint(min) return if rgba == @old_tint @old_tint = rgba $game_map.screen.shade.set_color(rgba[0],rgba[1],rgba[2]) $game_map.screen.shade.change_opacity(rgba[3],0) end
Awesome! That's a very neat script.
I'm just wondering. Is it possible to do Once-a-day events?
Either the feature isn't in this script or I'm not reading the instructions properly.
I'm just wondering. Is it possible to do Once-a-day events?
Either the feature isn't in this script or I'm not reading the instructions properly.
@>Conditional Branch: Script: GameTime.hour? = n
@>Some event that you want
Branch End
n=the time
@>Some event that you want
Branch End
n=the time
just asking ... I can easely settle a restaurant system with this?
like if the time it is a certain hour it serve breakfast
when this is the night it serve super and alchool
just some few exemple
I am curious of the use of your game time
with this i can also create custom made clock who follow the hour of your system?
like if the time it is a certain hour it serve breakfast
when this is the night it serve super and alchool
just some few exemple
I am curious of the use of your game time
with this i can also create custom made clock who follow the hour of your system?
@>Conditional Branch: Script: GameTime.hour? >= 6 or GameTime.hour? < 11
@>Breakfast food
@>Conditional Branch: Script: GameTime.hour? >= 11 or GameTime.hour? < 22
@>Non Breakfast food
@>Conditional Branch: Script: GameTime.hour? >= 22 or GameTime.hour? < 3
@>Bar Opens
I've never done it, but you can use a custom clock.
@>Breakfast food
@>Conditional Branch: Script: GameTime.hour? >= 11 or GameTime.hour? < 22
@>Non Breakfast food
@>Conditional Branch: Script: GameTime.hour? >= 22 or GameTime.hour? < 3
@>Bar Opens
I've never done it, but you can use a custom clock.
haha thanks : D
Ok, I tried that. Sadly, it didn't work. 🙁
BUT: I found a workaround that doesn't require any scripting. 😀
When I experimented with different possible solutions (changing the speed of time, saving and loading time, pausing and resuming time etc.) I noticed, that
the tinting delay is just as long as it takes for an ingame minute to pass (not using seconds, so I don't know if they affect the delay, too).
I then kept the screen faded out for 61 frames (which is/was my game's duration of a minute + 1 frame). That solved my
problem but prolonged the "blackness of the screen". Thus, I had to change the duration of a minute to 30 frames (and the duration of the wait command to 31 frames).
The screen still is dark for a little while after every map transfer, but at least the tinting delay is gone.
I might try and fool around with saving and loading time and changing the speed of time to reduce the waiting time before the screen is faded in again. If I find something I'll edit it into
this post.
The change_opacity should be (0,0), and it worked for me.
@sleepingnamja, thanks!
The wrong number of arguments error is gone with (0,0) but the tinting wasn't solved by your code snippet. Maybe there's some conflict with another
script I have.
Anyway, with my workaround it works as intended.
how can I disable the tinting on certain "indoor" maps?
Go to map properties (right click a map), and where it says "Note," write /Notint/
Got this script up and running. Working well so far. I have a question about firing periodic events off based on these clocks.
I would like to have an event fire once a day at say 23:59 that forces the player to eat (item rations -1) and various events that fire at the start of a new month, like pay, global events that change and so on. It seems like it should be possible to do this...I just don't know the process to go about handling it. Thanks for any help.
I would like to have an event fire once a day at say 23:59 that forces the player to eat (item rations -1) and various events that fire at the start of a new month, like pay, global events that change and so on. It seems like it should be possible to do this...I just don't know the process to go about handling it. Thanks for any help.
Go into your database, and click on "Common Events," and create a common event with parallel process as the trigger and have the condition switch to the switch that you want.
In the contents, have something like:
Conditional Branch: Script: GameTime.hour? = 24@>The Event that you want.@>Erase EventElse@>Branch EndYou could change parallel process to Autorun if you want the player to stop what they're doing and stand still while the event is happening.
This Common Event that I have here is an event that happens every time the hour is 24 or 11 pm.
Another thing to note is that this stuff is in the beginning of the script:
#Usage: Script calls:# GameTime.sec? #current second# GameTime.min? #current minute# GameTime.hour? #current hour# GameTime.hour_nom? #current hour (12-hour)# GameTime.day? #current day of month# GameTime.day_week? #current day of the week# GameTime.day_year? #current day of the year# GameTime.month? #current month# GameTime.year? #current yearSo if you want a monthly or a weekly event, replace "GameTime.hour?" with "GameTime.day_week?" or "GameTime.month?"
In the contents, have something like:
Conditional Branch: Script: GameTime.hour? = 24@>The Event that you want.@>Erase EventElse@>Branch EndYou could change parallel process to Autorun if you want the player to stop what they're doing and stand still while the event is happening.
This Common Event that I have here is an event that happens every time the hour is 24 or 11 pm.
Another thing to note is that this stuff is in the beginning of the script:
#Usage: Script calls:# GameTime.sec? #current second# GameTime.min? #current minute# GameTime.hour? #current hour# GameTime.hour_nom? #current hour (12-hour)# GameTime.day? #current day of month# GameTime.day_week? #current day of the week# GameTime.day_year? #current day of the year# GameTime.month? #current month# GameTime.year? #current yearSo if you want a monthly or a weekly event, replace "GameTime.hour?" with "GameTime.day_week?" or "GameTime.month?"
Sorry if this sounds dumb, but won't that just fire off the event constantly while it's true? The hour is 24 for 1/24th of the day...I don't want infinite food getting eaten, because the event is constantly running 1/24th of the day.
Hi Vlue,
I've added a small snippet that displays the current game time (instead of the total play time) on the save screen. Let me know what you think.
It's posted on GitHub here.
It's scoped to be quite limited (only the current hour + minute) because that's all I need for my current game 🙂
I've added a small snippet that displays the current game time (instead of the total play time) on the save screen. Let me know what you think.
It's posted on GitHub here.
It's scoped to be quite limited (only the current hour + minute) because that's all I need for my current game 🙂
Nice idea! Would make sense to show current time on the save file~
Original thread: https://forums.rpgmakerweb.com/threads/advanced-game-time.3851/