[XP] Complete Climate and Time System (CCTS)

Started by ForeverZer0, May 12, 2010, 06:08:20 pm

Previous topic - Next topic

CountVlad

Hi ForeverZero,

Thanks for the reply. Sorry to bug you again, but it there a way of putting the hour into a variable (not script based). I want to use it with an event so that an event page will be run if the hour is X or higher. (e.g. if the time is 9:00 or above, then the second event page will be run instead of the first event page).
I'm not very good at scripting, so I have no idea how to use script variables.

ForeverZer0

May 28, 2010, 06:49:36 pm #21 Last Edit: May 28, 2010, 06:54:31 pm by ForeverZero
Quote from: CountVlad on May 27, 2010, 05:59:29 pm
Hi ForeverZero,

Thanks for the reply. Sorry to bug you again, but it there a way of putting the hour into a variable (not script based). I want to use it with an event so that an event page will be run if the hour is X or higher. (e.g. if the time is 9:00 or above, then the second event page will be run instead of the first event page).
I'm not very good at scripting, so I have no idea how to use script variables.


In the refresh_switches method, add this:

$game_variables[YOUR VARIABLE ID] = $game_system.time.hour


Often the $game_map needs refreshed to have events respond immediately to altered variables, switches, etc. You may have to also add this:

$game_map.refresh


or

$game_map.need_refresh = true


Don't worry about bugging me, I'm happy to assist in any way I can. I have just started a new job though, and only get a chance to respond every once and a while, so please be patient, and don't think I'm ignoring everybody.

As for incompatibility with other scripts using the $game_system.time, obviously using multiple time system scripts is going to cause issues, not really a news flash. Simply use whatever system you prefer, but only use one.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.


ForeverZer0

Quote from: CountVlad on May 28, 2010, 07:51:56 pm
Thanks! :D


No prob. I just noticed I wrote 'hour' in the example above, but imagine you got the idea.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

lonely_cubone

June 06, 2010, 10:36:05 am #24 Last Edit: June 06, 2010, 11:45:38 am by lonely_cubone
This looks like an awesome script, but I'm getting an error. Well, 2 different errors, actually. I can get to the main menu fine. If I start a new game, I get:
Spoiler: ShowHide


When I continue from a saved game, I get:
Spoiler: ShowHide


I tried copying the scripts directly into a blank game, but it still doesn't work. Obviously other people have gotten it to work, so what am I doing wrong?

Shining Riku

I used the scripts from the demo ForeverZer0 made.

I could take a look at it for you if you like. I'm using these scripts in my own R U INSANE game, so I managed to get them to work :D


Hellfire Dragon

June 08, 2010, 01:54:18 pm #27 Last Edit: July 03, 2010, 09:06:12 am by Hellfire Dragon
I keep getting this error when I hit new game

Spoiler: ShowHide

Script 'CCTS Sript' line 335: NoMethodError occured

undefined method 'speed_frozen' for #<Time_System:0x3cf2dc8>

ForeverZer0

June 09, 2010, 05:40:12 pm #28 Last Edit: June 09, 2010, 05:43:43 pm by ForeverZero
Quote from: Hellfire Dragon on June 08, 2010, 01:54:18 pm
I keep getting this error when I hit new game

[spoiler][code
Script 'CCTS Sript' line 335: NoMethodError occured

undefined method 'speed_frozen' for #<Time_System:0x3cf2dc8>
[/spoiler]


See the above post. You probably don't have the Debugger installed. I messed up and placed an attr_accessor in the debugger that needs to be in the main script.

Just add this...
attr_reader :speed_frozen


...anywhere with the other ones in the Time_System class.

Sorry about that.  :P

@lonely_cubone
I'll have to check out the second error your getting. I got a busy schedule right now, but be patient and I promise I'll get back to you sometime here...
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

lonely_cubone

Well, I put the debugger in, and now I don't get either error. Thanks anyways! :D

ForeverZer0

Quote from: lonely_cubone on June 13, 2010, 10:34:27 am
Well, I put the debugger in, and now I don't get either error. Thanks anyways! :D


Alrighty then. It may have been linked to the same problem. Anybody else getting that error?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

WhiteRose

F0, I know you're undoubtedly busy with other things, but if you have a minute, you should create version 1.1 of this script with the following fixes:
  • Fix the "undefined method 'speed_frozen' for #<Time_System:0x3cf2dc8>" error. (Unless I'm mistaken, you just have to add that line to the script, correct?)
  • Make it so the Time window reappears after closing the menu.
    Just a suggestion for whenever you're looking for your next thing to script.

    ~Rose <3

ForeverZer0

@rose
I made a 1.1 with those exact fixes actually, I must have forgot to update the link. Oops...  :wacko:
I'll take care of it. No internet at home right now where I got my game, but I'll fix it here next chance I get.
Thanks for the feedback.  :)
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

ForeverZer0

Okay, I finally updated the script.
It will now memorize if the clock was on or not. Now if the clock is on and you go into the menu, when you return to the map it will go back on.

You only need to re-download the second part to get this feature, and not have to redo any config.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

KRoP

I'm not sure, but it looks like part 2 might link to the wrong file. o:

The file linked to is fileutils.rb.  I skimmed through the code and didn't find anything related to the climate system.  Can you please check the file again?  Thanks.

ForeverZer0

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Mimi Chan

Wow o.o
I am always looking for a good time system since I want to create a very realistic town with shops opening and closing at certain times, you can see npc move depending on the time of the day, monsters appear either at day or night, etc.

This is a perfect time system *.*

Some question though, how can I set it up since my game only has days and weeks, no years and months o.oa
1st week = sun to sat
2nd week = sun to sat
3rd week, 4th week
Then cycles again o.o

And the HUD showing it like this

Includes weather/time of day icon ^^

Thanks very much~!
What's a sig?

ForeverZer0

Do you mean a counter of how many total weeks have passed?
That won't be hard to do.
If you just don't like the day, month, and year, just ignore them and let them be whatever they are.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Mimi Chan

I mean I only want it to show Day and Week o.o

I could rename the months into weeks and tell it to only have 7 days but the year will still show T-T

And how to make the hud show the weather icon o.oa
What's a sig?

keyonne

August 17, 2010, 02:14:22 pm #39 Last Edit: August 17, 2010, 02:19:22 pm by keyonne
Hey, I'm absolutely loving your script. I replaced my old time system script that I had as it was buggy and limited. However, I am having a few issues I'd like to ask you questions about.

1) Is there any way I could set this up so that the weather changes according to town rather than map. I.E. - a set of maps grouped together would be one town, and a different set as another. I want each town to have weather separate from each other, but all the maps within one town must also be the same.

2) I'm wondering if there is a way to add a Good_Weather_Switch. I know you have a Bad_Weather_Switch, but I have the characters go inside when it is bad outside. However, without a switch to make the character events disappear from inside the house when its nice out, I've had to create a separate page of if thens that read the weather type and eventually turn a switch on that I have labeled as the good weather switch at the moment. I was just curious as to whether there is a way to bypass this eventing and put it into the script directly. I was guessing, as I have no clue as to how to script at all, and have come up with this myself but am wary of using it for fear of screwing something up.
Quotedef refresh_weather_switches(type)
   $game_variables[CCTS::Weather_Variable] = type
   value = CCTS::Bad_Weather_Types.include?(type)
   $game_switches[CCTS::Bad_Weather_Switch] = value
   $game_variables[CCTS::Weather_Variable] = type
   value = CCTS::Good_Weather_Types.include?(type)
   $game_switches[CCTS::Good_Weather_Switch] = value
 end


3) I used one of the script add-ons as mentioned before by someone else under the refresh_switches area, but I'm noticing that my shops still aren't opening and closing like they should be. I have them set by hour and I haven't been able to get into any of them since I introduced this script. This is what I have under refresh_switches right now - perhaps I've done something wrong:
                           
Quoterefresh_switches
   $game_variables[484] = $game_system.time.hour
   $game_variables[483] = $game_system.time.min
   $game_variables[485] = $game_system.time.day
   $game_variables[486] = $game_system.time.month
   $game_variables[488] = $game_system.time.year
   $game_map.need_refresh = true



EDIT: Sorry, I forgot to mention that when I save the game and come back, the clock box is gone. Idk if this is a bug, or simply something that has been overlooked, but I thought it was worth mentioning.