Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: ForeverZer0 on May 12, 2010, 06:08:20 pm

Title: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 12, 2010, 06:08:20 pm
Complete Climate and Time System (CCTS)
Authors: ForeverZer0
Version: 1.2.2
Type: Dynamic Environment System
Key Term: Custom Environment System



Introduction

  This script will give you TOTAL control of weather and time in your game. It will allow you to set up different climates that use different weather patterns, tints, sounds, and effects. It is also a complete Time System that gives you full control of, and keeps track of, time, with every possible configuration at your disposal. Note this script comes with a preset config that will be suitable for most's needs, but it can be configured to the most extreme level if so desired, which will require more work. It is not necessary to do this, but the ability is there.


Features




Screenshots
Game
(https://drive.google.com/open?id=0Bz0mz6k80xj3NTk5NGQ5NGItMDQ0Mi00Mjg0LWJjYmUtZjU3MzBkNTYyYTYy)  (https://drive.google.com/open?id=0Bz0mz6k80xj3M2I0NzFmZDgtYjFkMi00ODE0LWJkMmQtOGM0NTMzZDk5YWFh)

Configuration
(https://drive.google.com/open?id=0Bz0mz6k80xj3NDM2MTQ1NmUtZWUxNy00OTJlLTg0ZDctOTNlYjM3NTgyMWVk)   (https://drive.google.com/open?id=0Bz0mz6k80xj3NDVhNTAzZjMtYTZiZi00YTkzLTlkMTEtMjhiM2I5ZmJjOGFi)



Demo

Here's the demo (https://drive.google.com/open?id=0Bz0mz6k80xj3NjIyNjQxYzMtMzcyMy00MWZkLWIwNWMtODMwM2EwZTE1Nzdm).



Script

Here's the script (https://drive.google.com/open?id=1kzT6cPGrcuGChwd1Q62DkMtBT5JpHKTTdYbeM-mSNcY).
KK20 addressed a bug in the time advancement calls. That can be found here (http://pastebin.com/zhBNCCxn).



Instructions

Place script below default scripts, and above "Main".

I have created an application to create the scripts as well. It will output the scripts, as well as allow you to use a Window's interface to make the configuration file. It will be much easier for to configure for those who are unsure of how to properly set up the script.
It can be downloaded here:

CCTS Configuration App (https://drive.google.com/open?id=0Bz0mz6k80xj3YTEyM2EwMDQtOGQ4MS00MmU0LWE4ZjYtODFhOTZkZDE5ZmJl) (1.33 MB)

The configuration application requires that you have Microsoft's .NET Framework 2.0 (22.96 MB) installed to work. Most users with modern PCs will likely have this on their systems already. If you need to download the framework, I would suggest that you download Microsoft's .NET Framework 4.0 (49.27 MB). It is a larger download, but offers the same features as 2.0 and much more.

See script for the big evil instructions if you choose not to use the configuration program.



Compatibility

High probability of issues with scripts that try to change the screen tinting and weather. This system will likely totally override any script that even thinks about it.



Credits and Thanks





Author's Notes

Please report any bugs/issues/suggestions. I will be happy to fix them.
Enjoy!
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: G_G on May 12, 2010, 06:35:26 pm
Post is a bit messed up. Not sure if you noticed. Try using pastebin.com paste your scripts there. Then link them here. Which is probably whats causing the problem.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 12, 2010, 06:46:37 pm
Quote from: game_guy on May 12, 2010, 06:35:26 pm
Post is a bit messed up. Not sure if you noticed. Try using pastebin.com paste your scripts there. Then link them here. Which is probably whats causing the problem.


No, I didn't notice. Thank you.
I seem to always mess these things up  :wacko:

All better now.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 12, 2010, 07:13:54 pm
There we go, ATES just went down the drain. xD
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 12, 2010, 08:11:06 pm
Quote from: Blizzard on May 12, 2010, 07:13:54 pm
There we go, ATES just went down the drain. xD


Was ATES ever finished?
I used some it for inspiration for the use of switches and what not.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: WhiteRose on May 12, 2010, 09:26:14 pm
Fantastic as usual, however, if you open and close the menu, the clock disappears.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 12, 2010, 09:43:41 pm
Quote from: WhiteRose on May 12, 2010, 09:26:14 pm
Fantastic as usual, however, if you open and close the menu, the clock disappears.


Yeah, I was being lazy. I'll fix that and update here soon.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Wizered67 on May 12, 2010, 10:56:25 pm
if this had a plug-in for rmxos to make it global like ATES does, I would so use this!
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 12, 2010, 11:41:12 pm
Quote from: Wizered67 on May 12, 2010, 10:56:25 pm
if this had a plug-in for rmxos to make it global like ATES does, I would so use this!


To be honest, I haven't messed with RMX-OS yet, I might include that once I experiment around with it a little.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 13, 2010, 02:40:16 am
Quote from: ForeverZero on May 12, 2010, 08:11:06 pm
Was ATES ever finished?


Not really, lol!
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Alton Wyte on May 13, 2010, 05:23:57 pm
What coding would I use to show the time and date in the playtime window instead of the playtime? I had it working with ATES but this is so much better so I had to switch.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 14, 2010, 05:55:56 pm
Quote from: Alton Wyte on May 13, 2010, 05:23:57 pm
What coding would I use to show the time and date in the playtime window instead of the playtime? I had it working with ATES but this is so much better so I had to switch.


I'll include that in the next update. I didn't think of that.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 14, 2010, 06:14:46 pm
You should totally make a RMX-OS plugin for this so people don't have to put up with ATES anymore (since it was never really finished).
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 19, 2010, 05:58:52 pm
Quote from: Blizzard on May 14, 2010, 06:14:46 pm
You should totally make a RMX-OS plugin for this so people don't have to put up with ATES anymore (since it was never really finished).


Not really familiar with RMX-OS. If somebody could create one for me, I'd be happy to include it, with credits, of course.

On a side note, I found one minor issue. The debugger has an attr_reader that has to be with the system, not just the debugger. I havn't changed the download yet, but all you have to do is add this:

attr_reader :speed_frozen


...with all the other attrs of the Time_System class. It works fine if you use the debugger, but if you erase that, the system will freeze. Sorry! :P

Also, if you would like the 'playtime window' on the menu to display the time, and not playtime, place this anywhere below Window_PlayTime.

Spoiler: ShowHide
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#  It doesn't do this no more.
#  It will now display the current time of CCST
#==============================================================================

class Window_PlayTime < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0, 160, 96)
   self.contents = Bitmap.new(width - 32, height - 32)
   @minute = $game_system.time.minute
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   self.contents.font.color = system_color
   self.contents.draw_text(4, 0, 120, 32, 'Time')
   hour = $game_system.time.hour
   @minute = $game_system.time.minute
   text = sprintf('%02d:%02d', hour, @minute)
   self.contents.font.color = normal_color
   self.contents.draw_text(4, 32, 120, 32, text, 2)
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   # To make time pass on the menu, erase the ## from the following line.
   ##$game_system.time.update  # <---
   if @minute != $game_system.time.minute
     refresh
   end
 end
end
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Agckuu Coceg on May 21, 2010, 11:13:20 am
Not a new version ATES? No way! I'm fan of ATES!!!  :haha:

About script: FZ released a new toy for makers. And again + + +
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Shining Riku on May 21, 2010, 04:53:38 pm
How do I make it so a certain climate rains 100% of the time?

I set everything up fine but I don't have any weather. at all.

Checked the true/false things and everything. There's no reason for it not to work : /

EDIT: My new climate doesn't work at all. The tinting is ignored, weather is ignored, only thing that works is the time passage speed.

RE-EDIT: Fixed the tinting

EDIT: I'm sorry.....Finally understand how EVERYTHING works and why so I got it figured out now.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on May 23, 2010, 05:00:12 pm
I love this script! It's way better than my Event based one.
Is there a way to set a variable to store the date (just the day number) in? It's just that I need to process a common event once a day and I can't think of anything else that would work. It was simple with my event system, but now I have no idea how to do it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Shining Riku on May 23, 2010, 05:27:10 pm
Unfortunately I looked at the script and I didn't see a way to set up something like that.  :P

Maybe you could PM ForeverZer0 about the script?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 26, 2010, 05:51:13 pm
Quote from: CountVlad on May 23, 2010, 05:00:12 pm
I love this script! It's way better than my Event based one.
Is there a way to set a variable to store the date (just the day number) in? It's just that I need to process a common event once a day and I can't think of anything else that would work. It was simple with my event system, but now I have no idea how to do it.


If mean just the date, like 1-31, use...
$your_variable = $game_system.time.day
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Agckuu Coceg on May 27, 2010, 12:16:23 pm
Incidentally, this method $game_system.time. is the biggest problem. A similar method .time is used in many scripts that call to them incompatible with your script. Take a note about this.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: 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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 28, 2010, 06:49:36 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on May 28, 2010, 07:51:56 pm
Thanks! :D
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 28, 2010, 08:24:46 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: lonely_cubone on June 06, 2010, 10:36:05 am
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
(http://i978.photobucket.com/albums/ae270/lonely_cube/error.png)


When I continue from a saved game, I get:
Spoiler: ShowHide
(http://i978.photobucket.com/albums/ae270/lonely_cube/error2.png)


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?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Shining Riku on June 06, 2010, 11:48:00 am
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
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: lonely_cubone on June 06, 2010, 12:07:18 pm
Thanks Riku, I'll send them to you. :haha:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Hellfire Dragon on June 08, 2010, 01:54:18 pm
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>
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on June 09, 2010, 05:40:12 pm
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...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: 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
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on June 16, 2010, 07:23:11 pm
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?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: WhiteRose on June 29, 2010, 04:38:09 pm
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:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on June 30, 2010, 05:15:57 pm
@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.  :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 14, 2010, 05:50:42 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KRoP on July 15, 2010, 10:52:03 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 15, 2010, 11:07:04 pm
Sorry 'bout that!  :???:
It's fixed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on July 26, 2010, 05:16:34 pm
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
(http://i30.tinypic.com/qy7mnp.png)
Includes weather/time of day icon ^^

Thanks very much~!
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 27, 2010, 04:40:17 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on July 27, 2010, 05:47:34 pm
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
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: keyonne on August 17, 2010, 02:14:22 pm
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.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on August 17, 2010, 04:36:12 pm
@keyonne
Thanks for the feedback. Let me see if I can maybe answer some of your questions.

1. Just make a weather system and include the IDs of all the maps that the town uses.

2. Adding a "Good Weather Switch would be very simple. I can do it if you like, but it would essentially be the same as checking if the Bad Weather Switch is false.

3. Not sure what the deal is with the last one. Try just changing...
$game_map.need_refresh = true

...to just...
$game_map.refresh

...and see if that helps anything.
I may just make an add-on real quick for shop opening/closing etc. That should eliminate a lot of problems.

As for the window not reappearing, it was likely just an over-sight by me. Thanks for letting me know. I plan on updating this script and Zer0 Add-Ons as soon as I finish this CBS I'm working on.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: keyonne on August 19, 2010, 12:02:10 pm
By weather system, do you mean the climate? because I already Have all the town<s maps under the indoor and outdoor climates accordingly.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on August 19, 2010, 12:14:42 pm
Quote from: keyonne on August 19, 2010, 12:02:10 pm
By weather system, do you mean the climate? because I already Have all the town<s maps under the indoor and outdoor climates accordingly.

Yeah, I mean create a climate that is custom for each town that you want to use a unique climate for, and add the map IDs to that new climate. Then you will have each town have it's own custom climate.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: keyonne on August 25, 2010, 05:21:12 pm
It would be helpful to have something to add in that would indeed check for the bad weather switch. I'm completely unknowledgable in scripting, so I haven't the slightest clue on how to do that. Do you know of anywhere that has a tutitorial for scripting basics?

And I'm still having the issue with my climates. Though the town's maps are all within the same climate, one map is having rain and it is sunshine in another. I don't quite understand what it going on...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on August 26, 2010, 11:29:53 am
I'll make an update here real soon.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 08, 2010, 11:58:12 am
This script works really good...well until I add in the SDK at least, I've tried 1.5 and 2.3, and both stop the auto tinting completely. Basically I'm trying to get this script, Dynamic Light and Shadows by someone called Trebor777, and the SDK required to make it work to all play nicely together. The effect I'm trying to create is lights that come on at night, and turn off at dawn. If anyone needs more info, let me know.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 08, 2010, 12:06:36 pm
SDK sucks. That is why nobody uses it. If it is not this script that SDK has incompatibility issues with, it will be another.
I would suggest to either not use the script that requires it, or request for someone to de-SDK it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 08, 2010, 02:37:22 pm
Thanks for the super fast reply. I had a feeling the SDK would keep things from working, so I removed it and will continue to look for a light script to use with my game, since the light script I found is very heavily reliant on the SDK, and removing the dependencies would probably render the script blank  :haha: Thanks again for your help.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 10, 2010, 04:58:38 pm
OK I'm sorry to bother you with this possibly noob question, (and I hope this isn't a double post) but I've been trying for a couple weeks to figure this out. I want to use the day and night switches to operate outside lights, using the Light Effects script version 3 by Near Fantastica. Now if I leave a map and come back, or open and close the menu, the lights are on when the night switch is on, but they don't work automatically, I've tried using the $game_map.refresh in the CCTS script, in the event, in common events, and even set a variable, but when I use a script command to refresh the map, the game freezes completely. I've ran out of ideas, so any help would be greatly appreciated.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 13, 2010, 12:08:21 pm
CCTS is likely not going to be compatible with another script that automatically effects the screen tone, especially an SDK one. I'm sorry, but the best advice I can tell you is to pick one of the two scripts not to use in your game.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 13, 2010, 02:30:19 pm
Just to clarify, I erased the SDK and the Dynamic light script out of my game, and selected a new light script, that does not use the SDK at all, it basically uses a picture and changes it's size, blending and opacity to simulate a handful of lighting effects. It works great with your script, but i couldn't get it to refresh in real time, like if you were outside and it's 9pm, the lights come on automatically. I will probably have to either start a topic on it here or find the author of the light effects script and ask if there is a script command to refresh the light effect events when a switch is turned on, because the ones I have used lock up the game. Thank you for your response though, and I look forward to any new updates on this excellent script  :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 20, 2010, 11:56:08 am
OK, well I managed to get the light effects script to work automatically, by changing the day and night switches to variables (maybe it's just me, but variables seem to update instantly) and adding $scene = Scene_Map.new AND $game_map.refresh in the refresh switches section, it seems to only work if both commands are present. Now i just need to figure out how to get it to not refresh in a battle, because it kicks you out of the battle when the screen refreshes, and it refreshes every game hour. This is my first time messing with the scripting engine in any RPG maker, but so far so good.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 20, 2010, 12:05:53 pm
$scene = Scene_Map.new should not be in the method.
That is just going to cause all sorts of unforeseen problems, and lots of big obvious ones.
That is also why you get kicked out of battle.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on September 23, 2010, 01:19:48 pm
Hello again, I just wanted to stop by and give some thanks for the advice on the scripting, I'm no good at it right now, but maybe with some practice I'll get better. I didn't realize that the scene_map.new caused so much trouble, I was just excited to see the events update  :haha: I've ran out of ideas to make it work automatically, but at least i learned a few things, and even managed to merge the Thomas Edison VX script into the Light Effects XP script with little to no problems. Anyway, thanks again for the help, hopefully I haven't bugged you too much, and I look forward to any new releases of this script.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 23, 2010, 04:43:45 pm
Quote from: rlm1000 on September 23, 2010, 01:19:48 pm
Hello again, I just wanted to stop by and give some thanks for the advice on the scripting, I'm no good at it right now, but maybe with some practice I'll get better. I didn't realize that the scene_map.new caused so much trouble, I was just excited to see the events update  :haha: I've ran out of ideas to make it work automatically, but at least i learned a few things, and even managed to merge the Thomas Edison VX script into the Light Effects XP script with little to no problems. Anyway, thanks again for the help, hopefully I haven't bugged you too much, and I look forward to any new releases of this script.


You're not bugging me, thats the point of the thread.  ;)
I will be updating this script very soon. I'm re-writing the weather module, and once that is done I plan on updating this one as well.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 26, 2010, 10:50:00 am
ATES has the Dswitches and Nswitches :/  and its easier to use. I couldn't get this thing to work :/ I really think someone should consider finishing it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 08, 2010, 12:51:20 pm
I get an error with this line

    unless $game_system.time.speed_frozen

It's a no method error.
My configuration: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Complete Climate and Time System (CCTS) by ForeverZer0
# Version: 1.0
# Date: 5.12.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
# Introduction:
#
#   This script will give you TOTAL control of weather and time in your game. It
#   will allow you to set up different climates that use different weather
#   patterns, tints, sounds, and effects. It is also a complete Time System that
#   gives you full control of, and keeps track of, time, with every possible
#   configuration at your disposal. Note this script comes with a preset config
#   that will be suitable for most's needs, but it can be configured to the most
#   extreme level if so desired, which will require more work. It is not
#   neccessary to do this, but the ability is there.
#
# Features:
#
#   - Automatic weather control with defined types, frequency, probabilities,
#     tints, and sounds for any and every map in your game.
#   - Weather tint and BGS will fade in/out smoothly with the weather for a very
#     realistic feel
#   - Configurable screen tints for every climate, month, and hour that will
#     smoothly transition over the course of each hour, not transition to day
#     or night in matter of seconds.
#   - Completely configurable calendar system that can use custom names for days
#     and months, custom month lengths, etc.
#   - Can easily use configurable switches and variables for event conditions
#     based off the hour of the day, the season of the year, or the current
#     weather.
#   - Comes with a clock that can be toggled on/off by the player, with custom
#     location, opacity, and font name/size options.
#   - Complete control to freeze the time, screen tone, weather, or time speed,
#     seperately or together, with simple script calls.
#   - Comes with error checking and a debugger for easily testing your own
#     customization, and to help understand the system.
#   - Short, simple script calls for easy manipulation
#   - Compatible with Zero Advanced Weather and MAWS (v.1.2 or higher)
#
# Instructions:
#   
#   All the configuration is within this part of the script. The other part is
#   the actual working of the script and should not be altered without knowing
#   what you are doing.
#
#   All instructions for configuration are explained below in each section.
#
#   ------------------------------------------------------------------------
#
#   Script Calls:
#
# ► time.freeze(true/false)
#     - Will freeze/unfreeze time, tone, and weather.
#
# ► time.tone_freeze(true/false)
#     - Will freeze/unfreeze the screen tone from updating automatically. Use
#       before you would like to set a custom screen tone, otherwise the system
#       will override it.
#
# ► time.weather_freeze(true/false)
#     - Will freeze/unfreeze the weather from updating. Freeze if you would like
#       to manually set the weather and do not want the system to override it.
#
# ► time.speed_freeze(true/false)
#     - Will keep the time speed set at a specific rate, and not change per each
#       map as the system usually does.
#
# ► time.change_speed(SPEED)
#     - Will set the time speed to SPEED. Use time.speed_freeze if you would
#       would like to keep it there indefinitely
#
# ► time.set(m, h, d, m, y)
#     - Sets the time to time defined in (minute, hour, day, month, year)
#       This will also allow you to 'go back' in time.
#
# ► time.advance_minute(NUMBER)
#     - Advances minute by NUMBER
#
# ► time.advance_hour(NUMBER)
#     - Advances hour by NUMBER
#
# ► time.advance_day(NUMBER)
#     - Advances day by NUMBER
#
# ► time.advance_month(NUMBER)
#     - Advances month by NUMBER
#
# ► time.advance_year(NUMBER)
#     - Advances year by NUMBER
#
# ► time.memorize(INDEX)
#     - Memorizes the current time to an array at INDEX. The INDEX can be any
#       integer you like, it is used to reference later if the time is restored.
#       This will allow for you to memorize as many 'times' as you need. Using
#       an existing INDEX will over-write the old one.
#
# ► time.restore(INDEX)
#     - Sets the time to memorized time at INDEX. Does nothing if INDEX does not
#       exist. Obviously, you must have a memorized time before using.
#
# ► time.clock(true/false)
#     - Enables/Disables player from toggling clock. Will dispose the clock
#       if disabled when clock is showing.
#
# ► time.simple_clock(true/false)
#     - By default, the clock displays the time, day, and date. If this is true,
#       the clock will only display the time, nothing else.
#
# ► time.clock_face(x, y, opacity, fontname, fontsize)
#     - Changes the clock settings to defined values. The opacity, fontname, and
#       fontsize can be omitted if you are only changing the X and Y. Will also
#       make sure the font is found in the system before changing.
#
# ► time.show_clock
#     - Forcibly toggles the clock ON. Used for showing the clock when it is
#       unknown if the player will have it ON or OFF at that time. The clock must
#       be enabled for this method to work. (Only during Scene_Map)
#
# ► time.change_climate(MAP_ID, CLIMATE_ID)
#     - Will permanently change map with MAP_ID from its current climate to the
#       the one defined by CLIMATE_ID. Will not have an immediate effect on the
#       current map, but will be applied next time the player returns.
#
# ► CCTS.time_system_debugger
#     - Calls a screen that will show all pertinent information to the Time
#       System that you may need when debugging your setup
#
# ► CCTS.missing_climates
#     - Checks your climate configuration to make sure all maps are accounted
#       for and that it is all correct.
#
#  For scripters:
#   If you would like to create any script that is based on time in any way, you
#   can use the method: "$game_system.time.current_time" in another script. It
#   will return this array: [minute, hour, day, month, year].
#   From there you can use/manipulate the data without having to create a bunch
#   of local variables set to the different time values. This can also be used
#   to store in a variable, etc. to be referenced later.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                         BEGIN CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

module CCTS
 
  # The names for your days. Use as many as you want.
  Days =  ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
           'Saturday', 'Sunday']
           
  # The name for your months. Use as many as you want.         
  Months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
            'August', 'September', 'October', 'November', 'December']
           
  # How many days in a month? (Per each index above)
  Month_Length = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
           
  # Set up as follows: [Minute, Hour, Day, Month, Year]
  Start_Date = [0, 17, 4, 7, 1776]
 
  # Button used to toggle clock ON/OFF (if enabled). This is the game button,
  # not just the key on your keyboard.
  Clock_Button = Input::Z
 
  # Default settings for the clock.
  # Set up using this pattern. [X, Y, OPACITY, FONTNAME, FONTSIZE]
  # All can be changed in-game with a script call at any time.
  Clock_Face =  [0, 60, 160, 'Calibri', 15]
 
  # The minimun/maximum number of seconds before the system re-calculates what
  # weather pattern will be used. The number will be randomly selected from
  # within the defined range.
  Weather_Wait = [20, 25]#[120, 180]
 
  # This variable will be always be equal to the weather type. Lets you create
  # event conditions based off the weather. (must be raining to do this, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Weather_Type_Variable"
  Weather_Variable = 1
 
  # This switch will only be ON during "bad" weather effects (below). Used for
  # event conditions. (Villagers go inside if it is raining, storming, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Adverse_Weather_Switch"
  Bad_Weather_Switch = 1
 
  # Include all "bad" weather types in this array. The above switch will only
  # be on when one of them is occurring
  # Same as from Zer0 Advanced Weather, if using.
  Bad_Weather_Types = [1, 2, 4, 5, 9, 16]
 
  # This variable will be set by the "season" of the year. This can also be used
  # as a condition in events.
  Season_Variable = 11
  # 0 = Summer
  # 1 = Autumn
  # 2 = Winter
  # 3 = Spring
  # Define the months for each season.
  Season_Months = [ [6, 7, 8],    # Summer
                    [9, 10, 11],  # Autumn
                    [12, 1, 2],   # Winter
                    [3, 4, 5] ]   # Spring
             
  # These switches will be used as conditions for events, etc. They will only
  # be ON during the hours defined below.
  Day_Switch_ID = 2
  Night_Switch_ID = 3
 
  # Define the hours that are considered "Day" and "Night". The respective
  # switch above will be ON/OFF depending on the hour of the day.
  Day_Start_Hour = 6        # (6:00 a.m. - 9:00 p.m.) = Day
  Night_Start_Hour = 21     # (9:00 p.m. - 6:00 a.m.) = Night
 
 
  #-----------------------------------------------------------------------------
  # Weather Tints
  #   Set the tint influence for each weather type. These are NOT the values
  #   the screen tint will be, rather they are the amount applied to whatever
  #   the current screen tint already is. They will transition in/out at the
  #   same rate of the weather transition.
  #-----------------------------------------------------------------------------
  def self.weather_tint(type)
    case type
  # when WEATHER_TYPE then return [RED, GREEN, BLUE, GRAY]
    when 1, 4
      return [-20, -20, -15, 10]
    when 2, 5, 9
      return [-30, -30, -20, 15]
    when 3, 16
      return [-15, -15, -15, 20]   
    end
    return [0, 0, 0, 0]
  end
  #-----------------------------------------------------------------------------
  # Hourly Tints
  #   Define the target tints for each hour of the day for each climate.
  #   The month, hour, and climate_id are all passed as arguments so you can
  #   create as in-depth of a configuration as you like. Just create branches
  #   within branches using the climate, month, and hour as conditions to define
  #   the desired screen tone. There will be no tint (0, 0, 0, 0) for anything
  #   left undefined. (see presets below for examples)
  #
  #   Setup: [RED, GREEN, BLUE, GRAY]
  #-----------------------------------------------------------------------------
  def self.time_tint(climate_id, hour, month)
    case climate_id
    #-------------------------------------------------------------------
    when 0   
      # Climate 0 (Normal Outdoors)
      case month
      when 1, 2, 12 # Winter Months (Less daylight hours, overall more gray)
        case hour
        when 17 then return [-20, -20, -20, 10]
        when 18 then return [-30, -30, -30, 20]
        when 0..6, 19..23
          return [-100, -100, -20, 15]
        when 7 then return [-15, -15, -25, 10]
        when 8..18
          return [-10, -10, -10, 10]
        end
      when 6, 7, 8 # Summer Months (More hours of daylight, brighter)
        case hour
        when 18 then return [-25, -25, -10, 5]
        when 19 then return [-50, -50, -15, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 15]
        when 6 then return [10, 10, -10, 0]
        when 7..17
          return [5, 5, -5, 0]
        end
      when 3, 4, 5 # Spring Months (Average)
        case hour
        when 18 then return [0, 0, -15, 5]
        when 19 then return [-15, -15, -30, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 10]
        when 6 then return [-5, -5, -20, 0]
        end
      when 9, 10, 11 # Autumn Months (More 'Orange-Yellow' tinting in evening)
        case hour
        when 18 then return [5, 5, -20, 0]
        when 19 then return [-5, -5, -25, 10]
        when 20..23, 0..5
          return [-100, -100, -20, 10]
        when 6 then return [10, 5, -10, 10]
        end
      end
    #-------------------------------------------------------------------
    when 2
      # Climate 2 (Snow)
      # No month branches. Same tints used year-round
      case hour
      when 17 then return [-20, -20, -20, 10]
      when 18 then return [-30, -30, -30, 20]
      when 0..6, 19..23
        return [-100, -100, -20, 20]
      when 7 then return [-15, -15, -25, 10]
      when 8..18
        return [-10, -10, -10, 10]
      end
    #-------------------------------------------------------------------
    when 3
    # Climate 3 (Desert)
    # No month branches. Same tints used year-round
      case hour
      when 18 then return [-25, -25, -10, 5]
      when 19 then return [-50, -50, -15, 10]
      when 20..23, 0..5
        return [-100, -100, -20, 15]
      when 6 then return [10, 10, -10, 0]
      when 7..17
        return [5, 5, -5, 0]
      end
    #-------------------------------------------------------------------
    when 4
    # Climate 4 (Underground/Cave)
    # Same tint, year-round for every hour
      return [-20, -20, -20, 0]
    #-------------------------------------------------------------------
    end
    # Default return value for undefined time/climate (Don't edit)
    return [0, 0, 0, 0]
  end
  #-----------------------------------------------------------------------------
  # Weather Probability
  #   Define the weather probabilities for each climate. The climate ID and the
  #   month are passed as arguments for branching. This will allow you to make
  #   it snow in the winter, storm in the summer, etc.
  #
  #   Set up like this:
  #
  #   case climate_id
  #   when CLIMATE_ID
  #     case month
  #     when MONTH then return [[TYPE, PROB], [TYPE, PROB], [TYPE, PROB], etc]
  #
  #   If you are using Zer0 Advanced Weather or MAWS (v.1.2 or >) where the
  #   "variation" is used, just add the variation value into the respective
  #   array, like this:
  #                     [TYPE, PROBABILITY, VARIATION]
  #
  #   You need not define a probability for 0, or no weather. It is the default
  #   value used for undefined weather and when the weather probability is not
  #   high enough when the system calculates it.
  #
  #   The actual weather will be chosen randomly from all types that have a   
  #   probability above the randomly chosen 'chance' at each weather update.
  #-----------------------------------------------------------------------------
  def self.weather_prob(climate_id, month)
    case climate_id
    when 0, 1 # Normal Outdoor
      case month
      # Winter
      when 1, 2, 12
        return [[3, 17], [16, 12]]
      # Spring
      when 3, 4, 5
        return [[1, 30], [2, 25], [9, 25]] 
      # Summer 
      when 6, 7, 8
        return [[1, 60], [9, 60]]#[[1, 60], [2, 7], [9, 11]]
      # Autumn
      when 9, 10, 11
        return [[1, 15], [9, 10], [6, 25, rand(3)],  # random "variation"
                [7, 25, rand(3)], [8, 25, rand(3)]]
      end
    when 2 # Snow/Arctic (year-round, no month branching)     
      return [[3, 80], [16, 50]]
    when 3 # Desert (year-round, no month branching)
      return [[1, 5]]
    end
  end
  #-----------------------------------------------------------------------------
  # Weather BGS
  #   Define the BGS used for each weather type. They BGS will fade in/out at
  #   the same rate of the weather's transition. Volume will be 50% for maps
  #   that do not have weather, but still have weather sound.
  #-----------------------------------------------------------------------------
  def self.weather_BGS(type)
    case type
  # when WEATHER_TYPE then return ['FILENAME', VOLUME, PITCH]
    when 1 then return ['005-Rain01', 80, 100]    # Rain
    when 2 then return ['006-Rain02', 80, 100]    # Heavy Rain
    when 3 then return ['001-Wind01', 80, 100]    # Snow
    when 4 then return ['005-Rain01', 60, 75]     # Hail
    when 5, 9
      return ['007-Rain03', 80, 100]              # Thunder/Realistic Storm
    when 7 then return ['003-Wind03', 80, 100]    # Blowing Leaves
    when 8, 16
      return ['004-Wind04', 80, 100]              # Swirling Leaves/Blowing Snow
    when 22 then return ['015-Quake01', 100, 125] # Falling Rocks
    end
  end
end

  #-----------------------------------------------------------------------------

class Climate
 
  attr_accessor :maps

  def initialize
    @climate = []
  #-----------------------------------------------------------------------------
  # Initialize New Climates
  #   Simply follow the same pattern for each new climate you create.
  #-----------------------------------------------------------------------------
    @climate[0] = Game_Climate.new(0)
    @climate[1] = Game_Climate.new(1)
    @climate[2] = Game_Climate.new(2)
    @climate[3] = Game_Climate.new(3)
    @climate[4] = Game_Climate.new(4)
    @climate[5] = Game_Climate.new(5)
  #-----------------------------------------------------------------------------
  # Climate Names
  #   Create names for the different climates.
  #-----------------------------------------------------------------------------
    @climate[0].name = 'Outdoors'
    @climate[1].name = 'Indoors'
    @climate[2].name = 'Snow'
    @climate[3].name = 'Desert'
    @climate[4].name = 'Underground'
    @climate[5].name = 'DUMMY CLIMATE'
  #-----------------------------------------------------------------------------
  # Weather for this Climate?
  #   If false, no weather will be shown for climate, although weather sound and
  #   tinting can still be used if desired.
  #-----------------------------------------------------------------------------
    @climate[0].weather = true
    @climate[1].weather = false
    @climate[2].weather = true
    @climate[3].weather = true
    @climate[4].weather = false
    @climate[5].weather = false
  #-----------------------------------------------------------------------------
  # Weather Tinting?
  #   If true, different weather patterns will influence the screen tint
  #-----------------------------------------------------------------------------
    @climate[0].weather_tinting = true
    @climate[1].weather_tinting = false
    @climate[2].weather_tinting = true
    @climate[3].weather_tinting = true
    @climate[4].weather_tinting = false
    @climate[5].weather_tinting = false
  #----------------------------------------------------------------------------- 
  # Weather Sound?
  #   If true, weather BGS will be played automatically for that climate
  #-----------------------------------------------------------------------------
    @climate[0].weather_sound = true
    @climate[1].weather_sound = true
    @climate[2].weather_sound = true
    @climate[3].weather_sound = true
    @climate[4].weather_sound = false
    @climate[5].weather_sound = false
  #----------------------------------------------------------------------------- 
  # Time Speed
  #   This will be the default time speed used for the climate. It can be
  #   overridden with script calls in-game if needed. "1" is real-time, and
  #   any other number is multiples of real-time, so "5" is 5 times as fast as
  #   the real world. (unless you live in a videogame)
  #-----------------------------------------------------------------------------
    @climate[0].time_speed = 100#5
    @climate[1].time_speed = 8
    @climate[2].time_speed = 5
    @climate[3].time_speed = 4
    @climate[4].time_speed = 2
    @climate[5].time_speed = 5
  #-----------------------------------------------------------------------------
  # Maps for each climate
  # Include IDs of maps that use each respective climate.
  # Use script call 'CCTS.missing_climates' to check.
  #-----------------------------------------------------------------------------
    @climate[0].maps = []
    @climate[1].maps = []
    @climate[2].maps = []
    @climate[3].maps = []
    @climate[4].maps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21, 22, 23, 24]
    @climate[5].maps = []
  #-----------------------------------------------------------------------------
  end
#-------------------------------------------------------------------------------
  def map_climate(map_id)
    @climate.each {|climate| return climate if climate.maps.include?(map_id)}
    return @climate[5] # <--
    # This is the 'dummy climate' to prevent crashes if no climate is defined.
  end
end

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                     END CONFIGURATION (finally!)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 08, 2010, 04:52:17 pm
What version are you using?
I thought i had fixed that bug, though I could be mistaken.

If you add this line to the Time class, it should fix it:
attr_reader :speed_frozen


Just place it with the other attr_readers at the top of the script.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 08, 2010, 05:32:12 pm
Thanks. I probably missed that version, owing to censorship and such.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 12, 2010, 12:15:15 pm
* Updates to 1.2 *

Added a bundle of new stuff, improved some coding. Here's the highlights:


A few of the options and configurations have changed. Please be sure to reconfigure accordingly.

If anyone finds any bugs, be sure to let me know and they will be fixed in the next update.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on October 12, 2010, 03:16:51 pm
I get a syntax error on line 877, not sure why though. Your script update looks nice and streamlined though.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 13, 2010, 12:06:57 pm
Oops!
I fixed it. I forgot a something small I threw it in just before uploading the script, and never tested it for just such a thing. Thanks for pointing out, much appreciated.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sacred Nym on October 13, 2010, 01:13:50 pm
I got an error "Uninitialized constant MINUTE_VARIABLE" error when trying to restore a memorized time. Line 833
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on October 13, 2010, 02:35:18 pm
Quote from: ForeverZer0 on October 13, 2010, 12:06:57 pm
Oops!
I fixed it. I forgot a something small I threw it in just before uploading the script, and never tested it for just such a thing. Thanks for pointing out, much appreciated.


No problem, glad I could help :)

EDIT: Just so you know, it appears you are using the same default switch number for the good weather switch and the day switch.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 14, 2010, 04:00:47 pm
For the MINUTE_VARIABLE error, just add CCTS:: before it.
$game_variables[CCTS::MINUTE_VARIABLE] = @minute if CCTS::MINUTE_VARIABLE != nil

Same goes for the rest.

Though Zero, I don't think variables are properly set up. I tried doing a conditional branch using the time variables but it's not working o.oa
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 14, 2010, 04:27:47 pm
I'll fix these bugs tonight.
I added them last second, and obviously didn't test them.
Sorry everyone, they shall all be fixed soon.  :shy:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 14, 2010, 05:19:06 pm
It's okay *.*
At least I know it's a problem with the script. Because I was burning my head for hours wondering why variable doesn't work >.<

Also what is the script syntax to check for time o.oa
Like for a bakery, if time is 10pm - 7am then return Shop close
And its open only on Mon-Friday

o.oa
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 15, 2010, 12:05:35 pm
Quote from: Mimi Chan on October 14, 2010, 05:19:06 pm
It's okay *.*
At least I know it's a problem with the script. Because I was burning my head for hours wondering why variable doesn't work >.<

Also what is the script syntax to check for time o.oa
Like for a bakery, if time is 10pm - 7am then return Shop close
And its open only on Mon-Friday

o.oa


$game_system.time.hour.between?(10, 19)


That will return a true/false if the hour is between the two numbers.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on October 15, 2010, 12:45:43 pm
Careful, between? is inclusive. It should be (10, 18) if it closes at 7pm. Though, the times is 7am to 10pm so it should be (7, 21).
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 15, 2010, 01:31:14 pm
So by inclusive you mean uhh...only the numbers between two numbers are counted? (4, 10) will only count 5 to 9 o.oa

So I am guessing I will just change the hour into the other variables *.*
$game_system.time.day.between? (1-5) for mon-friday o.oa

I will make a very life like town *.*

Though the variables need fixing since it's not working at the moment ^^;
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on October 15, 2010, 01:37:57 pm
Quote from: Mimi Chan on October 15, 2010, 01:31:14 pm
So by inclusive you mean uhh...only the numbers between two numbers are counted? (4, 10) will only count 5 to 9 o.oa


That's exclusive. Inclusive would mean that the numbers 4 and 10 are included in the range (as the words suggest, inclusive-including, etc.).
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 15, 2010, 01:44:28 pm
Ah okie thanks *.*
$game_system.time.hour.between? I guess I can use this to bypass relying on variables *.*
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 15, 2010, 02:55:54 pm
So what would be exclusive?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on October 15, 2010, 03:33:03 pm
In the example of (4, 10), exclusive would mean from 5 to 9.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 15, 2010, 03:37:39 pm
No, I meant what syntax would you use?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on October 15, 2010, 03:41:24 pm
There is no syntax for exclusive. If you really want exclusive from 4 to 10, just use "between?(5, 9)".
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 15, 2010, 03:46:30 pm
Ah, ok. *Tries to see any possible benefits of having an exclusive method*
*fails*

You have taughtme, Blizzard-sensei.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 15, 2010, 10:19:11 pm
While $game_system.time.hour.between? is for ranges, how to check for exact hour o.oa
Like if it's 6am then...etc.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on October 16, 2010, 04:55:02 am
$game_system.time.hour == 6

-_-
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: [Luke] on October 16, 2010, 06:24:38 pm
Niche, if you really need an exclusive method, like... ummm... when you really need non-integer values (floats, doubles - just real numbers) you can simply use this:
($floating_point_variable > minimum && $floating_point_variable < maximum)
while "between?(number_that_your_variable_should_be_greater_than, number_that_your_variable_should_be_lesser_than)" method is just an equivalent for
($some_numeric_value >= n_t_y_v_s_b_g_t && $some_numeric_value <= n_t_y_v_s_b_l_t)
In general, between? just spares some copypastes and keyboard hits. Which is purely awesome, because that's what are all the high-level programming languages about.

I'll let you know as soon as I write the Global Time and Weather CCTS Plugin for RMX-OS. I had quit working on it since another part of tests after the release of the first version turned it out to be an ultimate disaster - I have to understand much more about CCTS.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 16, 2010, 07:16:13 pm
@Luke: It was a hypothetical question, I can see no real benefit to having an exclusive method. But thanks anyway.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 17, 2010, 09:43:00 pm
I dunno why the time and weather only affects my first map o.O
I dunno where is the place I can put whether my map can be weather affected or not (outdoor and indoor)

Anyone care to point it to me o.oa

And how to change it so that the clock toggles on/off when press 'T' on the keyboard instead of the game button 'Z'?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 18, 2010, 03:21:40 am
1 & 2: Bottom of the configuration, though I suspect you have an actual bug.
3: Just did :P
4: Change the button for z to t? If you have babs, it has a script call for checking if a keyboard button is pressed and I'm pretty sure this has a script call for enabling the clock. Put the two together in a common event and watch things explode.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 18, 2010, 01:51:44 pm
Oh found it ^^
Thanks *.*
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on October 18, 2010, 02:40:32 pm
This script rocks! 
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 18, 2010, 04:28:07 pm
I still got a fix I need to make. I already did it, just haven't uploaded yet. I'm at work right now, but I'll post either tonight or tomorrow.
@magus, glad you like.  ;)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 18, 2010, 05:46:44 pm
Yeah I really like this system *.*
I already chained it with other scripts to use it to it's full powa.

All left is making the light script here, make the lamp post turn on when it's night.

Can't wait for the fix ^^
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 19, 2010, 12:12:00 pm
* Updates to 1.2.2 *

Okay, fixed the little bugs in the demo and script. Everything should be okay finally.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 19, 2010, 08:47:32 pm
Yesh *.*

I tested it, dunno if its only me but the weather tint seems to only affect the current map you are on and doesn't transfer the the next map o.O
Works fine with hourly tint though.

And oh yeah, how to check for certain weather o.oa
I know its uhh $game_screen.weather == 7 will return true if weather is 7
Though I dunno the syntax for it to check for power ranges, and variations o.O

I mean how to check it if the weather is Blowing Leaves with power between 10-50 and variation number 2 o.O
I can probably do a branching conditional branch that checks for each 3 but I dunno their syntax ^^;
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 20, 2010, 12:27:52 pm
Tints will only "transfer" if going to a map with the same climate. Not sure if that is the problem or not, let me know either way.
As for the power range, neither this script or the default one has a way of reading the power. I believe if you create an attr_reader for @weather_max_target or whatever it is in Game_Screen, you can then read it. The attr might already be there, can't remember, just try it and find out.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 20, 2010, 01:26:34 pm
Yup, it's weather_max_target.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 20, 2010, 06:39:48 pm
How about to check the variation? I mean how to tell if it's raining normal or raining blood o.O

I think the good/weather switch is broken o.O
If its bad weather then switch 1 will be always on right?
While for good weather switch 2 will be on.

When I tested it, when the weather turns bad, it does turn on switch 1 BUT after a minute updates, it switch it off even though it's still raining o.O
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 20, 2010, 08:22:45 pm
I'll check out the switch issue.
For the variation,
$game_screen.weather_variation
will return the actual value, and
$game_screen.weather_variation == TYPE
will return a true/false if the defined type is being used. You can place an exclamation point before the second piece of code to see if the weather variation is NOT that type.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 21, 2010, 01:38:27 pm
Zero, is there a script call to stop a certain weather effect?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 21, 2010, 03:24:20 pm
I think I found the problem *.*
Good weather switch is using the same switch as the Day switch which are both 2 o.O

So switch 2 is always on regardless of bad weather O.O

I kinda don't get how the variation call works o.o
Lets pretend I am checking for blood rain
$game_screen.weather_variation 1 (for rain)
$game_screen.weather_variation == 2 (for blood)

o.oa

EDIT: Switches gets messed up every time a minute updates o.O
And events that has a switch as a condition only starts working when the minute updates.

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 21, 2010, 04:31:36 pm
@niche
Do you mean to keep the weather from updating automatically? If so, just use the script call time.weather_frozen(true), you can then change the weather to whatever you want without it being overridden. As for changing the weather patterns for a climate in-game, I haven't thought of that, but I'm sure I can include in the next update.

@mimi
The default config for switches and what not in the demo were intended to be changed to your liking, and I admittingly did not go through and ensure none repeated.

The variation alone cannot be changed with any effect. You basically just call the weather again with a different variation.

The little lines of code from my previous post were just how to read the variation and get the value, or a true/false while checking for a specific one. If you let me know what exactly you need and how you are using it, I can be little more helpful. Not sure if I answered your question or not.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 21, 2010, 04:56:20 pm
...Woops, I was thinking of MAWS. Well, this is embarassing...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Mimi Chan on October 21, 2010, 06:36:56 pm
I just want an NPC that says what weather it is when you talk to him so he can differentiate from weather type and the variation.

So he can tell if its raining normally or if its raining blood.

I want a hidden npc that only pops up when its raining blood o.o
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on October 22, 2010, 03:34:30 am
Player: Hello.
Npc: Oh hello.
Player: What are you doing outside in this weather?
Npc: I'm feeding.
Player: WTF?!
Npc: *bares fangs* LUNCHTIME!!!!

(Awesome optional boss fight :D)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 22, 2010, 12:05:33 pm
Quote from: The Niche on October 21, 2010, 04:56:20 pm
...Woops, I was thinking of MAWS. Well, this is embarassing...


No problem, MAWS is simply my Weather script with some added color schemes. I'm about to realease the Weather module re-write with my WeatherCreator script that will be better than both.  :D
It lets those who know absolutely nothing about scripting create advanced weather effects and variations with ease.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: LiTTleDRAgo on October 27, 2010, 04:54:59 am
Bug on the Demo

Spoiler: ShowHide
(http://img196.imageshack.us/img196/1183/assszxzxscc.jpg)


and

Spoiler: ShowHide
(http://img819.imageshack.us/img819/1183/assszxzxscc.jpg)

at this line
    if @day > CCTS::MONTH_LENGTH[@month - 1]
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 27, 2010, 12:04:48 pm
Thanks, I shall check it out. It seems that there is always one bug left to fix with this script...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: RoseSkye on October 30, 2010, 07:49:26 pm
The toggle buttons are a bit annoying.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on November 01, 2010, 11:04:15 am
That can be easily disabled if you don't like it, though it will remove the ability for the player to be able to turn the clock on/off, unless you add it to a menu, etc. Scan the script, towards the bottom you will find Scene_Map, delete the section in the update method that checks for the Input.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Ryex on November 19, 2010, 08:33:47 pm
your rate generation for the tone is flawed in that if one or more of the rates is positive the rate is either not signed properly the reall difference isn't calculated or both

for example the previous rate is [0, 0, 0, 0]
and the new rate is [20, 20, 10, 10]

old.abs - new.abs yields [-20, -20, -10, -10] when the real difference is [20, 20, 10, 10]

or the previous rate is [-10, -10, -10, 10]
and the new rate is [20, 20, 10, 10]
old.abs - new.abs yields [-10, -10, 0, 0] when the real difference is [30, 30, 20, 0]

this can be fixed like so

if old[i] < 0 && new[i] < 0
  rate[i] = old[i].abs - new[i].abs
else
  rate[i] = new[i] - old[i]
end
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: lonely_cubone on November 20, 2010, 08:33:24 am
I have no idea if this syntax would work, but if you're just trying to find the difference between two arrays, wouldn't it be this?
rate[i] = (old[i] - new[i]).abs


I'm guessing that's not correct RGSS syntax, but even if it takes 2 lines (subtract first then get absolute value) it seems like it'd be a little bit easier.

:P
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Ryex on November 20, 2010, 09:08:09 am
the thing is that you need the correctly signed difference
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on November 22, 2010, 07:59:33 am
I can look into it, but if memory serves me right, whatever I did, the final tone is correct. What is configured is what it will be. If that is right, not sure, it is not flawed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on November 22, 2010, 08:15:31 am
Quote from: ForeverZer0 on November 22, 2010, 07:59:33 am
I can loo into it


Rose, we have another case of Mimispelling.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on December 11, 2010, 01:03:57 pm
Mimispelling? Sounds worryingly like memespelling...

Anyway, Zero I've got a problem. Just updated to the latest version, haven't touched the settings, so it may be that I need to reconfigure it. Getting to the point, whenever I try to test the game, it comes up with a syntax error in line 306 of the...main script, I believe. To give you a bit more situation detail, I'm using: Your advanced title script. CCOA's UMS. Kread-ex's ais. Maws 1.2. BABS. The active action information script by Little Drago. BABS auto targeting. Visual equipment for BABS. BABS rapid fire. Continuous maps. Blizzard's stat growing. Midge's secondary weapons script. Your resolution script. Zeriab's disc changer script.

I know that's a lot of information, which is probably unnecessary, but this problem is confusing me. THe newest scripts are the advanced title and the resolution.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 11, 2010, 03:49:18 pm
Are you sure you have the newest version? I only ask because you say it is in the "main" script, but as of version 2.0 the scripts have all been combined into one. I just checked the script and it appears line 306 is only a comment.

Either way, I did find a blatant error (I thought I had already fixed this...), but it is around line 870 or so in the "refresh_switched" method. I had forgot to add the instance variable that the game variables are supposed to be set to. I will re-upload the script here today, but in the meantime if you feel like fixing it yourself, you can simply remove the old "refresh_switches" method and replace it with this:


  def refresh_switches
    # Set Day/Night switches if time is in configured ranges.
    if @hour.between?(CCTS::DAY_START_HOUR, CCTS::NIGHT_START_HOUR - 1)
      $game_switches[CCTS::DAY_SWITCH] = true
      $game_switches[CCTS::NIGHT_SWITCH] = false
    else
      $game_switches[CCTS::DAY_SWITCH] = false
      $game_switches[CCTS::NIGHT_SWITCH] = true
    end
    # Set Season Variable
    CCTS::SEASON_MONTHS.each_index {|i|
      if CCTS::SEASON_MONTHS[i].include?(@month)
        $game_variables[CCTS::SEASON_VARIABLE] = i
      end
    }
    # Set variables to the current time if configured to do so.
    $game_variables[MINUTE_VARIABLE] = @minute if MINUTE_VARIABLE != nil
    $game_variables[HOUR_VARIABLE] = @hour if HOUR_VARIABLE != nil
    $game_variables[DAY_VARIABLE] = @day if DAY_VARIABLE != nil
    $game_variables[MONTH_VARIABLE] = @month if MONTH_VARIABLE != nil
    $game_variables[YEAR_VARIABLE] = @year if YEAR_VARIABLE != nil
    # Have $game_map refresh to have events, etc. respond to changed switches.
    $game_map.need_refresh = true
  end
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on December 11, 2010, 05:11:31 pm
Yeah, I split it out of personal preference. I redid it as one script and the error's in line 876.

The line is

Game_Climate = Struct.new(:id, :name, :weather, :tinting, :sound, :speed, :maps)

I've tried it in a blank project as well, with no other scripts. This is distinctly odd.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 12, 2010, 12:52:55 pm
The Script download is now fixed.

I'm in the middle of some maintanence on my PC at the moment and I have RMXP uninstalled, so I can't fix the demo at the moment, but I will soon as I get all this business taken care of.


Anyways, the actual error is not on that line, that is just where it pops up at. If you used the fix from my previous post it would do it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on December 12, 2010, 02:44:30 pm
I only just noticed that now. I am really not with it today...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on December 28, 2010, 02:54:54 pm
I know this is going to sound nooby as always, but is there a way to output the current map climate to a variable?
The reason for this is that the player character graphic (and various other things) needs to change based on the climate and it would make it way simpler to just have one PP event with conditional branches running that change these things instead of having an event on every map.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: [Luke] on December 28, 2010, 03:27:30 pm
Find the refresh_switches method. Add a line

$game_variables[CLIMATE_VARIABLE_ID] = map_climate($game_map.map_id)

Haven't test, not sure, etc.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on December 28, 2010, 03:44:08 pm
Quote from: [Luke] on December 28, 2010, 03:27:30 pm
Find the refresh_switches method. Add a line

$game_variables[CLIMATE_VARIABLE_ID] = map_climate($game_map.map_id)

Haven't test, not sure, etc.

I tried putting it in various places in the script, but it didn't seem to work. The only place I put it where it didn't produce a crashing error it didn't seem to change the variable.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 28, 2010, 04:28:27 pm
If you are using it in a script call or event, you need to access the variable through its instance:

$game_map.map_climate($game_map.map_id)


I could be wrong. I honestly don't remember all the method names I used. I'll be home in about an hour and will double check for you what the exact syntax is.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on December 28, 2010, 04:58:57 pm
Quote from: ForeverZer0 on December 28, 2010, 04:28:27 pm
If you are using it in a script call or event, you need to access the variable through its instance:

$game_map.map_climate($game_map.map_id)


I could be wrong. I honestly don't remember all the method names I used. I'll be home in about an hour and will double check for you what the exact syntax is.

Hmm... I'm not sure I quite understand what you mean.
Ideally what I'd like to do is put it in a script call inside an event so I can then set an event variable to whatever the climate script variable is then use that event variable in a conditional branch.
Or if it's easier to explain, I could get a conditional branch to check if an expression is true or not.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 28, 2010, 06:34:48 pm
Try this as a condition:

$game_map.climate.id == INSERT_ID_HERE


It will return true if the climate ID is equal to what you defined.
You can also check if the ID is NOT equal the ID you define with:

$game_map.climate.id != INSERT_ID_HERE
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on December 28, 2010, 07:44:25 pm
It seems to work! Thanks! :haha:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 07, 2011, 08:37:02 pm
Fixed the link for the script.
Both demo and script are up to data now, without the annoying syntax error that would occur.

Thanks DeXus for reminding me.  ;)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: CountVlad on January 19, 2011, 07:43:05 pm
I've come across another problem with the script. It seems that when you change between two climates (by moving from one map to another) it resets the weather timer. Is there a way to make it so that the timer carries over between climates and continues even if the weather effects are turned off (e.g. indoors)?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: megaman30796 on January 25, 2011, 08:04:33 am
how do u set how long a minute is?

and how can u deactivate certain switches whenever the clock hits 12 am?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: LiTTleDRAgo on January 25, 2011, 09:32:42 am
Quote from: megaman30796 on January 25, 2011, 08:04:33 am
how do u set how long a minute is?



# * time.change_speed(SPEED)
#     - Will set the time speed to SPEED. Use time.speed_freeze if you would
#       would like to keep it there indefinitely


Quote from: megaman30796 on January 25, 2011, 08:04:33 am
and how can u deactivate certain switches whenever the clock hits 12 am?


eventing


  # IDs of variables that will be equal to their named value. They can be used
  # for eventing, etc. Set any to nil that you do not want to use.
  MINUTE_VARIABLE = 1
  HOUR_VARIABLE = 2
  DAY_VARIABLE = 3
  MONTH_VARIABLE = 4
  YEAR_VARIABLE = 5


just create parallel process at common event like this


Conditional Branch : Variable [0002 : Hour] == 12
    Control Switches : [0001 : Switch 1]  = On
Branch End


 
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: megaman30796 on January 26, 2011, 04:00:08 am
oh thanks! ;)

shouldn't the hour be 24 instead of 12?

what line is the one with the SPEED thingy. i cant find it.

i think i have 2 use the SPEED Thingy with a command script.

nope. when i use command script, a syntax error will occur.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: megaman30796 on January 28, 2011, 10:20:33 am
any1 gonna answer my question?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 28, 2011, 12:19:09 pm
I'm not sure what your problem is. The method to change the speed is explained pretty clearly in the directions. If you are getting a syntax error, it is highly likely that you typing the command wrong. Maybe an example would help let me know exactly how to help you.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: sellyx on January 30, 2011, 08:06:36 pm
Hello, I am new subscribed in this forum but I have almost all the script from here.
I use Zero cms for 1 of my games and it said in it it need CCTS or ATES.
I just want to know to switch off the clock, because I have an HUD and I can't see it because of the clock
But I still using the CCTS because it is a wonderful script


P.S. Sorry if my english is poor but my first language is french so ...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 30, 2011, 10:20:58 pm
You can simply run a script call at the start of the game like this:
time.clock = false

Or you can find the Game_System section in the script and change the initial value of @clock to false there and avoid the script call.

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: sellyx on January 31, 2011, 04:59:25 pm
Thanks for your help !
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Killingmachine on February 01, 2011, 09:59:59 am
sorry for the trouble, how can i edit the script? I'm worst at scripts, so...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 01, 2011, 11:20:29 am
Quote from: Killingmachine on February 01, 2011, 09:59:59 am
sorry for the trouble, how can i edit the script? I'm worst at scripts, so...


It would help to know what you want to edit.
If you just mean in general, learn RGSS.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Killingmachine on February 04, 2011, 04:17:49 am
sorry, but how to change the timespeed? well, in the demo time speed is 120, right? I want to change it into 3600 for real time....
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: LiTTleDRAgo on February 04, 2011, 04:40:48 am
Quote from: Killingmachine on February 04, 2011, 04:17:49 am
sorry, but how to change the timespeed? well, in the demo time speed is 120, right? I want to change it into 3600 for real time....


look at my post above  :

Quote from: LiTTleDRAgo on January 25, 2011, 09:32:42 am

# * time.change_speed(SPEED)
#     - Will set the time speed to SPEED. Use time.speed_freeze if you would
#       would like to keep it there indefinitely
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 27, 2011, 01:34:35 pm
I updated the post.

1. Added screenshots (woo hoo! I love the new host!)
2. Added a configuration program to make setting CCTS up easier (similar to the BABS config program)

The program is my first full application using a programming language other than Ruby, so if you come across any bugs in it please be sure to let me know so I can fix them.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: AliveDrive on February 27, 2011, 01:40:50 pm
O.O
i repeat O.O
this is spectacular.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 27, 2011, 01:58:42 pm
@AliveDrive:
Thank you glad you like.  ;)

I just noticed one minor problem. The minimum/maximum weather wait is not setup by default, and is limited to 100 seconds each.
I will update in a few little bit. I got a massive compression going, a video converting and virus scan running at the moment on my PC, so I think I might wait to start up VS 2010. Things are slow enough as it is. :wacko:

(I can't wait till I get my new computer)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on February 27, 2011, 04:34:38 pm
Zer0, you sexy beast, you. <3
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 27, 2011, 06:45:47 pm
Alright, I fixed the little bug with the Weather Wait in the Configuration program. It's how it was meant to be where the user cannot accidentally set the minimum higher than the maximum or vice-versa, and it has a default value set.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: AliveDrive on February 27, 2011, 06:51:46 pm
i dont know coding at all.

that being said, what did you make that super fly gui out of?

'cause thats the stuff to learn right there kids.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 27, 2011, 06:57:06 pm
I coding in C#, though the same thing can be done with about any language. Some languages are just better and easier to do it than others. Visual Studio makes it much easier and helps take away most of the tedious aspects of finding the exact coodinates and sizes to place the controls.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 20, 2011, 03:45:27 pm
* double-posts *

I fixed the link to the .NET Framework download. I discovered that it does not work properly with the compact installation.  :P

I apologize to anyone who wasted there time downloaded that one, but the new link has been tested, and I guarantee 100% that the CCTS Configuration will work with it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on March 20, 2011, 03:47:17 pm
That might explain why the BlizzABS configuration still isn't working...thanks for that, Zer0!
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 20, 2011, 03:52:04 pm
I made a virtual machine that ran XP, where I have RMXP installed and all other related stuff. I attempted to run the CCTS Config after installing from the link I gave, and was surprised to see that it didn't work. I'd get this:

The application failed to initialize (0x0000135). Click to terminate.


After a little investigation, I came across the correct version, installed it, and it now works. I never tested it before.  :wacko:

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: The Niche on March 21, 2011, 02:19:01 pm
You silly goose...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Xuroth on March 22, 2011, 11:20:58 am
Zer0, I used your updated script/config program. I was browing the code when I noticed in the configuration for case climate, all the climates are "when 0 #climate" are they all supposed to be 0? Or am I missing something? its around line 390 - 480. in the hourly tints area

Also, tints seem to not update unless changing maps. did I configure it wrong?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 22, 2011, 12:22:12 pm
I'll look into it a little later, at work at the second.  :P

What other scripts are you using?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Xuroth on March 22, 2011, 12:44:04 pm
Leon_Westbrooke's shop menu
LiTTleDRAgo's show event names
your cms
your advanced weather
this ccts
blizzard's pay to heal
Your add-ons (only below PTH for the scene converter)
tons 1-3
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 22, 2011, 06:29:09 pm
I fixed the configuration program and the link has been updated.
I mistakenly forgot to add one line in a constructor for Climates.

this.Id = id;


This constructor is only used in the program to set the default settings, so I apparently missed it while debugging. Either way, I apologize for the mistake, but it is working correctly now.  ;)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Xuroth on March 23, 2011, 06:07:16 am
perhaps im not doing something correctly. the system still doesnt change tint by hour. Im using an event script call to jump the time forward by 3 hours and then I let it sit for a few minutes (in real time) and no tinting takes, place. however if I change maps... it suddenly tints...

it also doesnt tint if I just let it sit for a while so I dont think its a problem with the script call...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 23, 2011, 11:57:02 am
I will look into the script today, I really only looked at the config yesterday.  :P

Are you sure that "tinting" variables are set to true?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Xuroth on March 23, 2011, 12:37:19 pm
I'd imagine they were true. I looked through but couldnt find anything in the config that wasnt working.  also, the hourly tints work fine, but only if I change maps. changing scenes seems to have no effect...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 10, 2011, 06:20:28 pm
Sorry for the bump.
Nothing has changed. I reorganized my dropbox and had to update the links so I can delete files that are out of place.
I fixed a few spelling errors in the main post, added a link to .Net Framework 4.0, and made a few other minor edits, as well.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: winkio on May 22, 2011, 05:42:06 pm
I don't really mean to bother you, but battle test doesn't work (errors out after around 10 seconds) because of how you set up game screen.  While the functionality is great, it's not written very efficiently, and you broke a lot of the organizational barriers set up in RMXP.  Would you have time to make some changes to the script in the next few weeks?  If not, I'll probably just create my own modified version, so don't feel like you have to.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 22, 2011, 06:33:18 pm
I have no doubt there is a some room to improve efficiency. I was not a huge fan of using floats myself, but it is needed to keep accuracy. I can think of a better way to actually use them. They don't need applied to the actual tone each frame, but just stored and apply the change once the float rolls over to an integer other than what it is.

As for the battle test, I don't really understand what you mean. I assumed at first that I had a major problem because I always use a little title skip script when testing, and that could have slipped by me if I had forgot to test it in an unedited project, but I placed it in a new project, and there were no problems with the battle test. I can't seem to get any "script is hanging" error. I assume you are testing in the SoD with a CBS, so it may be simply a clash between the two, though I have never seen the CBS to know, so its just a thought.

EDIT:
Either way, yes, I'll look into it to answer your question.
I guess I forgot to answer your actual question... :P



Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: winkio on May 22, 2011, 07:25:25 pm
well yeah, I first got the error with the battle system in SOD, but then I tested it with a new project, and I still got it:

Quoteline 1163: NoMethodError

Undefined method 'weather' for nil:NilClass


so obviously, the system is not fully initialized.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: astheroth on May 31, 2011, 11:04:06 am
Hello,
I have a concern with this great script.
When the player goes to a "Outdoor" climate map, the game crash with a message:
(http://data.imagup.com/7/1121519209.jpg) (http://www.imagup.com/data/1121519209.html)
and the log:
Spoiler: ShowHide
---------- Erreur de script : CCTS ----------
----- Type
Errno::ENOENT

----- Message
No such file or directory - Audio/BGS/

----- Position dans CCTS
Ligne 953

----- Backtrace
Script : CCTS | Ligne : 953 | Méthode : in `bgs_play'
Script : CCTS | Ligne : 953 | Méthode : in `change_bgs_volume'
Script : CCTS | Ligne : 974 | Méthode : in `update'
Script : Scene_Map | Ligne : 52 | Méthode : in `alias_update'
Script : Scene_Map | Ligne : 47 | Méthode : in `loop'
Script : Scene_Map | Ligne : 66 | Méthode : in `alias_update'
Script : MAPPANEL | Ligne : 90 | Méthode : in `update_passminimap'
Script : Minimap | Ligne : 44 | Méthode : in `zer0_clock_upd'
Script : CCTS | Ligne : 1290 | Méthode : in `update'
Script : Scene_Map | Ligne : 25 | Méthode : in `main_passminimap'
Script : Scene_Map | Ligne : 19 | Méthode : in `loop'
Script : Scene_Map | Ligne : 30 | Méthode : in `main_passminimap'
Script : Minimap | Ligne : 31 | Méthode : in `zer0_clock_main'
Script : CCTS | Ligne : 1281 | Méthode : in `main'
Script : Main | Ligne : 49


Here the script with my config:
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Complete Climate and Time System (CCTS)
# Author: ForeverZer0
# Version: 1.2.3
# Date: 2.10.2011
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                             VERSION HISTORY
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# v.1.0   5.12.2010
#   - Original Release
# v.1.1   5.26.2010
#   - Added an attr_reader I mistakenly placed in the debugger that would make
#     the debugger a requirement for the script to work.
#   - Added some commands for message text to display the time, day, month, etc.
# v.1.2   10.10.10
#   - Added the "Good Weather Switch" by popular demand.
#   - Added ability to have game variables set to the current time values.
#   - Fixed bug so that the map refreshes properly when switches change.
#   - Fixed it so that window returns when scene changes and returns.
#   - Cleaned up overall code and added comments to help follow the main flow
#     of the script and understand it better.
#   - Changed the debug. No longer just prints to the standard output, but now
#     displays all the same info on-screen in real-time as it occurs.
#   - Built the Missing Climate Logger into the script. Will create a text file
#     in the directory listing any errors every time the game is play-tested.
#   - Added configurable format for how time is displayed.
#   - Added configuration for the look of the clock's windowskin
#   - Added Analog Clock spriteset.
#   - Consolidated the scripts into one.
# v.1.2.1  10.12.10
#   - Fixed a syntax error (Thanks rim1000 for pointing out)
# v.1.2.2  10.16.10
#   - Actually fixed the bug I should have fixed in 1.2.1
#   - Altered 'calculate_time' method, which would not allow the switches to
#     refresh correctly until the next game hour passed. Switches will not
#     update each game minute as they were intended to.
# v.1.2.3  2.25.11
#   - Added configuration for setting bold and italic in the clock.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
# Introduction:
#
#   This script will give you TOTAL control of weather and time in your game. It
#   will allow you to set up different climates that use different weather
#   patterns, tints, sounds, and effects. It is also a complete Time System that
#   gives you full control of, and keeps track of, time, with every possible
#   configuration at your disposal. Note this script comes with a preset config
#   that will be suitable for most's needs, but it can be configured to the most
#   extreme level if so desired, which will require more work. It is not
#   neccessary to do this, but the ability is there.
#
# Features:
#
#   - Automatic weather control with defined types, frequency, probabilities,
#     tints, and sounds for any and every map in your game.
#   - Weather tint and BGS will fade in/out smoothly with the weather for a very
#     realistic feel
#   - Configurable screen tints for every climate, month, and hour that will
#     smoothly transition over the course of each hour, not transition to day
#     or night in matter of seconds.
#   - Completely configurable calendar system that can use custom names for days
#     and months, custom month lengths, etc.
#   - Can easily use configurable switches and variables for event conditions
#     based off the hour of the day, the season of the year, or the current
#     weather.
#   - Comes with a clock that can be toggled on/off by the player, with custom
#     location, opacity, and font name/size options.
#   - Also have option to use an analog clock.
#   - Complete control to freeze the time, screen tone, weather, or time speed,
#     seperately or together, with simple script calls.
#   - Comes with error checking and a debugger for easily testing your own
#     customization, and to help understand the system.
#   - Short, simple script calls for easy manipulation
#   - Compatible with Zero Advanced Weather and MAWS (v.1.2 or higher)
#
# Instructions:
#
#   All instructions for configuration are explained below in each section.
#
#   ------------------------------------------------------------------------
#
#   Script Calls:
#
# * time.freeze(true/false)
#   time.freeze = true
#     - Will freeze/unfreeze time, tone, and weather.
#
# * time.tone_freeze(true/false)
#     - Will freeze/unfreeze the screen tone from updating automatically. Use
#       before you would like to set a custom screen tone, otherwise the system
#       will override it.
#
# * time.weather_freeze(true/false)
#     - Will freeze/unfreeze the weather from updating. Freeze if you would like
#       to manually set the weather and do not want the system to override it.
#
# * time.speed_freeze(true/false)
#     - Will keep the time speed set at a specific rate, and not change per each
#       map as the system usually does.
#
# * time.change_speed(SPEED)
#     - Will set the time speed to SPEED. Use time.speed_freeze if you would
#       would like to keep it there indefinitely
#
# * time.set(m, h, d, m, y)
#     - Sets the time to time defined in (minute, hour, day, month, year)
#       This will also allow you to 'go back' in time.
#
# * time.advance_minute(NUMBER)
#     - Advances minute by NUMBER
#
# * time.advance_hour(NUMBER)
#     - Advances hour by NUMBER
#
# * time.advance_day(NUMBER)
#     - Advances day by NUMBER
#
# * time.advance_month(NUMBER)
#     - Advances month by NUMBER
#
# * time.advance_year(NUMBER)
#     - Advances year by NUMBER
#
# * time.memorize(INDEX)
#     - Memorizes the current time to an array at INDEX. The INDEX can be any
#       integer you like, it is used to reference later if the time is restored.
#       This will allow for you to memorize as many 'times' as you need. Using
#       an existing INDEX will over-write the old one.
#
# * time.restore(INDEX)
#     - Sets the time to memorized time at INDEX. Does nothing if INDEX does not
#       exist. Obviously, you must have a memorized time before using.
#
# * time.clock(true/false)
#     - Enables/Disables player from toggling clock. Will dispose the clock
#       if disabled when clock is showing.
#
# * time.simple_clock(true/false)
#     - By default, the clock displays the time, day, and date. If this is true,
#       the clock will only display the time, nothing else.
#
# * time.analog_clock(true/false)
#     - Sets Analog Clock flag ON/OFF. If true, analog clock will be used,
#
# * time.clock_face(x, y, opacity, fontname, fontsize, bold, italic)
#     - Changes the clock settings to defined values. Can be called with any
#       number of arguments that you would like to change.
#
# * time.analog_face(filename, handoffset, x, y, opacity)
#     - Changes the settings for the analog clock. Can be called with any number
#       of arguments that you would like to change. (see note below for analog)
#
# * time.show_clock
#     - Forcibly toggles the clock ON. Used for showing the clock when it is
#       unknown if the player will have it ON or OFF at that time. The clock must
#       be enabled for this method to work. (Only during Scene_Map)
#
# * time.change_climate(MAP_ID, CLIMATE_ID)
#     - Will permanently change map with MAP_ID from its current climate to the
#       the one defined by CLIMATE_ID. Will not have an immediate effect on the
#       current map, but will be applied next time the player returns.
#
# * CCTS.debug
#     - Toggles the debug sprite ON/OFF. Shows almost every relevant variable
#       associated with the system and how it changes in real-time. See bottom
#       of script (around line 1500) for more information.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                         BEGIN CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

  #    ** Script Generated at 26/05/2011 00:45:31.

module CCTS

  # The names for your days. Use as many as you want.
  DAYS = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi',
          'Dimanche']

  # The name for your months. Use as many as you want.
  MONTHS = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet',
            'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']

  # How many days in a month? (Per each index above)
  MONTH_LENGTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

  # Set up as follows: [Minute, Hour, Day, Month, Year]
  START_DATE = [30, 21, 6, 11, 1003]

  # Button used to toggle clock ON/OFF (if enabled). This is the game button,
  # not just the key on your keyboard.
  CLOCK_BUTTON = Input::Z

  # Default settings for the clock.
  # Set up using this pattern. [X, Y, OPACITY, FONTNAME, FONTSIZE, BOLD, ITALIC]
  # All can be changed in-game with a script call at any time.
  CLOCK_FACE = [1, 1, 100, 'Pokemon DP', 16, false, true]

  # Default settings for the analog clock.
  # Set up using this pattern: ['FILENAME', HAND_OFFSET, X, Y, OPACITY]
  # Can be changed at any time during the game with a script call.
  ANALOG_FACE = ['square', 0, 0, 0, 0]

  # Set the skin for the clock (normal). Configure like one of the following:
  #   Set to nil to not use a skin
  #   Set to 'DEFAULT SKIN' to use whatever the player is using.
  #   Set to 'FILENAME' of the skin. Must be in Windowskins folder of game.
  CLOCK_SKIN = 'DEFAULT SKIN'

  # If true, the analog clock will be used by default. Can be changed later.
  ANALOG_CLOCK = false

  # Configure how the time will be displayed. Ignore this if you are unsure of
  # how to set this up. Look up "sprintf Format" in the Help File of the game to
  # learn more of how it works.
  TIME_FORMAT = '%2d:%02d'

  # The minimun/maximum number of seconds before the system re-calculates what
  # weather pattern will be used. The number will be randomly selected from
  # within the defined range.
  WEATHER_WAIT = [5, 10]

  # This variable will be always be equal to the weather type. Lets you create
  # event conditions based off the weather. (must be raining to do this, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Weather_Type_Variable"
  WEATHER_VARIABLE = 307

  # This switch will only be ON during "bad" weather effects (below). Used for
  # event conditions. (Villagers go inside if it is raining, storming, etc...)
  # If using Zer0 Advanced Weather, just set to same as "Adverse_Weather_Switch"
  BAD_WEATHER_SWITCH = 23
  # This switch will always be the opposite of the BAD_WEATHER_SWITCH.
  GOOD_WEATHER_SWITCH = 24

  # Include all "bad" weather types in this array. The above switch will only
  # be on when one of them is occurring
  # Same as from Zer0 Advanced Weather, if using.
  BAD_WEATHER_TYPES = [1, 2, 4, 5, 9, 16, 35]

  # This variable will be set by the "season" of the year. This can also be used
  # as a condition in events.
  SEASON_VARIABLE = 306
  # 0 = Summer
  # 1 = Autumn
  # 2 = Winter
  # 3 = Spring
  # Define the months for each season.
  SEASON_MONTHS = [ [5, 6, 7],   # Summer
                    [8, 9, 10],   # Autumn
                    [0, 1, 11],   # Winter
                    [2, 3, 4]]   # Spring

  # These switches will be used as conditions for events, etc. They will only
  # be ON during the hours defined below.
  DAY_SWITCH = 40
  NIGHT_SWITCH = 41

  # Define the hours that are considered "Day" and "Night". The respective
  # switch above will be ON/OFF depending on the hour of the day.
  DAY_START_HOUR = 6
  NIGHT_START_HOUR = 20

  # IDs of variables that will be equal to their named value. They can be used
  # for eventing, etc. Set any to nil that you do not want to use.
  MINUTE_VARIABLE = 301
  HOUR_VARIABLE = 302
  DAY_VARIABLE = 303
  MONTH_VARIABLE = 304
  YEAR_VARIABLE = 305

  # If true, and $DEBUG, a text file will be created each load in the games
  # directory that lists maps that do not have a climate defined, or those that
  # are defined more than once.
  WRITE_MISSING_DATA =
  #-----------------------------------------------------------------------------
  # Weather Tints
  #   Set the tint influence for each weather type. These are NOT the values
  #   the screen tint will be, rather they are the amount applied to whatever
  #   the current screen tint already is. They will transition in/out at the
  #   same rate of the weather transition.
  #-----------------------------------------------------------------------------
  def self.weather_tint(type)
    case type
  # when WEATHER_TYPE then return [RED, GREEN, BLUE, GRAY]
    when 1, 2, 4  # Rain
      return [-20, -20, -15, 10]
    when 5, 9, 35  # Storm
      return [-30, -30, -20, 15]
    when 3, 16  # Snow
      return [-15, -15, -15, 20]
    end
    return [0, 0, 0, 0]
  end
  #-----------------------------------------------------------------------------
  # Weather BGS
  #   Define the BGS used for each weather type. They BGS will fade in/out at
  #   the same rate of the weather's transition. Volume will be 50% for maps
  #   that do not have weather, but still have weather sound.
  #-----------------------------------------------------------------------------
  def self.weather_BGS(type)
    case type
  # when WEATHER_TYPE then return ['FILENAME', VOLUME, PITCH]
    when 1  # Rain
      return ['005-Rain01', 80, 100]
    when 2  # Heavy Rain
      return ['006-Rain02', 80, 100]
    when 3  # Snow
      return ['001-Wind01', 80, 100]
    when 4  # Hail
      return ['005-Rain01', 60, 75]
    when 5, 9, 35  # Thunder Storm
      return ['007-Rain03', 80, 100]
    when 6, 7  # Blowing Leaves
      return ['003-Wind03', 80, 100]
    when 8, 16  # Swirling Leaves
      return ['004-Wind04', 80, 100]
    when 22  # Falling Rocks
      return ['015-Quake01', 100, 125]
    end
  end
  #-----------------------------------------------------------------------------
  # Weather Probability
  #   Define the weather probabilities for each climate. The climate ID and the
  #   month are passed as arguments for branching. This will allow you to make
  #   it snow in the winter, storm in the summer, etc.
  #
  #   Set up like this:
  #
  #   case climate_id
  #   when CLIMATE_ID
  #     case month
  #     when MONTH then return [[TYPE, PROB], [TYPE, PROB], [TYPE, PROB], etc]
  #
  #   If you are using Zer0 Advanced Weather or MAWS (v.1.2 or >) where the
  #   "variation" is used, just add the variation value into the respective
  #   array, like this:
  #                     [TYPE, PROBABILITY, VARIATION]
  #
  #   You need not define a probability for 0, or no weather. It is the default
  #   value used for undefined weather and when the weather probability is not
  #   high enough when the system calculates it.
  #
  #   The actual weather will be chosen randomly from all types that have a
  #   probability above the randomly chosen 'chance' at each weather update.
  #-----------------------------------------------------------------------------
  def self.weather_prob(climate_id, month)
    case climate_id
    when 0  # Outdoor
      case month
      when 1, 2, 12
        return [[1, 15], [2, 15], [3, 10], [4, 5], [9, 10], [35, 25]]
      when 3, 4, 5
        return [[1, 10], [2, 20], [9, 15]]
      when 6, 7, 8
        return [[1, 10], [2, 20], [35, 10]]
      when 9, 10, 11
        return [[1, 15], [9, 15], [2, 25], [6, 20, 3]]
      end
    when 1  # Indoor
      case month
      when 1, 2, 12
        return [[1, 15], [2, 15], [3, 10], [4, 5], [9, 10], [16, 5], [35, 25]]
      when 3, 4, 5
        return [[1, 10], [2, 20], [9, 15]]
      when 6, 7, 8
        return [[1, 10], [2, 20], [35, 10]]
      when 9, 10, 11
        return [[1, 15], [9, 15], [2, 25], [6, 20, 3]]
      end
    when 2  # Snow
      return [[3, 80], [16, 50]]
    when 3  # Desert
      return [[1, 5]]
    end
  end
  #-----------------------------------------------------------------------------
  # Hourly Tints
  #   Define the target tints for each hour of the day, for each climate.
  #   The month, hour, and climate_id are all passed as arguments so you can
  #   create as in-depth of a configuration as you like. Just create branches
  #   within branches using the climate, month, and hour as conditions to define
  #   the desired screen tone. There will be no tint (0, 0, 0, 0) for anything
  #   left undefined. (see presets below for examples)
  #
  #   Setup: [RED, GREEN, BLUE, GRAY]
  #-----------------------------------------------------------------------------
  def self.time_tint(climate_id, hour, month)
    case climate_id
    #-------------------------------------------------------------------
    when 0  # Outdoor
      case month
      when 1, 2, 12
        case hour
        when 0, 1, 2, 3, 4, 5, 6, 19, 20, 21, 22, 23
          return [-100, -100, -20, 15]
        when 7
          return [-15, -15, -25, 10]
        when 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
          return [-10, -10, -10, 10]
        end
      when 3, 4, 5
        case hour
        when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
          return [-100, -100, -20, 10]
        when 6
          return [-5, -5, -20, 0]
        when 18
          return [0, 0, -15, 5]
        when 19
          return [-15, -15, -30, 10]
        end
      when 6, 7, 8
        case hour
        when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
          return [-100, -100, -20, 15]
        when 6
          return [10, 10, -10, 0]
        when 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
          return [5, 5, -5, 0]
        when 18
          return [-25, -25, -10, 5]
        when 19
          return [-50, -50, -15, 10]
        end
      when 9, 10, 11
        case hour
        when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
          return [-100, -100, -20, 10]
        when 6
          return [10, 5, -10, 10]
        when 18
          return [5, 5, -20, 0]
        when 19
          return [-5, -5, -25, 10]
        end
      end
    #-------------------------------------------------------------------
    when 0  # Snow
      case month
      when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
        case hour
        when 0, 1, 2, 3, 4, 5, 6, 19, 20, 21, 22, 23
          return [-100, -100, -20, 15]
        when 7
          return [-15, -15, -25, 10]
        when 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
          return [-10, -10, -10, 10]
        end
      end
    #-------------------------------------------------------------------
    when 0  # Desert
      case month
      when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
        case hour
        when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
          return [-100, -100, -20, 15]
        when 6
          return [10, 10, -10, 0]
        when 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
          return [5, 5, -5, 0]
        when 18
          return [-25, -25, -10, 5]
        when 19
          return [-50, -50, -15, 10]
        end
      end
    #-------------------------------------------------------------------
    when 0  # Underground
      case month
      when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
        case hour
        when 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
          return [-20, -20, -20, 0]
        end
      end
    #-------------------------------------------------------------------
    end
    # Default return value for undefined time/climate (Don't edit)
    return [0, 0, 0, 0]
  end
end

  #-----------------------------------------------------------------------------

class Climate

  attr_accessor :maps

  def initialize
    @climate = []
  #-----------------------------------------------------------------------------
  # Initialize New Climates
  #   Simply follow the same pattern for each new climate you create.
  #-----------------------------------------------------------------------------
    @climate[0] = Game_Climate.new(0)
    @climate[1] = Game_Climate.new(1)
    @climate[2] = Game_Climate.new(2)
    @climate[3] = Game_Climate.new(3)
    @climate[4] = Game_Climate.new(4)
  #-----------------------------------------------------------------------------
  # Climate Names
  #   Create names for the different climates.
  #-----------------------------------------------------------------------------
    @climate[0].name = 'Outdoor'
    @climate[1].name = 'Indoor'
    @climate[2].name = 'Snow'
    @climate[3].name = 'Desert'
    @climate[4].name = 'Underground'
  #-----------------------------------------------------------------------------
  # Weather for this Climate?
  #   If false, no weather will be shown for climate, although weather sound and
  #   tinting can still be used if desired.
  #-----------------------------------------------------------------------------
    @climate[0].weather = true
    @climate[1].weather = false
    @climate[2].weather = true
    @climate[3].weather = true
    @climate[4].weather = false
  #-----------------------------------------------------------------------------
  # Weather Tinting?
  #   If true, different weather patterns will influence the screen tint
  #-----------------------------------------------------------------------------
    @climate[0].tinting = true
    @climate[1].tinting = false
    @climate[2].tinting = true
    @climate[3].tinting = true
    @climate[4].tinting = true
  #-----------------------------------------------------------------------------
  # Weather Sound?
  #   If true, weather BGS will be played automatically for that climate
  #-----------------------------------------------------------------------------
    @climate[0].sound = true
    @climate[1].sound = true
    @climate[2].sound = true
    @climate[3].sound = true
    @climate[4].sound = false
  #-----------------------------------------------------------------------------
  # Time Speed
  #   This will be the default time speed used for the climate. It can be
  #   overridden with script calls in-game if needed. "1" is real-time, and
  #   any other number is multiples of real-time, so "5" is 5 times as fast as
  #   the real world. (unless you live in a videogame)
  #-----------------------------------------------------------------------------
    @climate[0].speed = 8
    @climate[1].speed = 10
    @climate[2].speed = 8
    @climate[3].speed = 8
    @climate[4].speed = 15
  #-----------------------------------------------------------------------------
  # Maps for each climate
  # Include IDs of maps that use each respective climate.
  #-----------------------------------------------------------------------------
    @climate[0].maps = [2, 3, 9, 11, 13, 20, 21, 22, 23, 24, 25, 26, 29, 30, 32, 35, 37, 41, 45]
    @climate[1].maps = [12, 15, 16, 17, 18, 19, 27, 28, 31, 34, 36, 42, 43, 44, 46, 50, 51]
    @climate[2].maps = []
    @climate[3].maps = []
    @climate[4].maps = [10, 39, 40, 47]
  #-----------------------------------------------------------------------------
  end
#-------------------------------------------------------------------------------
  def map_climate(map_id)
    @climate.each {|climate| return climate if climate.maps.include?(map_id)}
    # Returns a dummy climate with empty settings if not defined.
    return Game_Climate.new(-1, 'DUMMY', false, false, false, 5, [])
  end
end


I've tried to look for the error for a few days.
The directory seems correct :
Name of my game/Audio/BGS 

and the config too.

I hope you can help me find this error and sorry for my poor English expression  :wacko:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 31, 2011, 11:45:32 am
You tried playing a BGS file with no filename.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: astheroth on May 31, 2011, 12:15:43 pm
Thanx for the reply but i don't understand. Where am i playing a BGS file with no filename?

In the script there is one line here: (953, the line, where is the bug)
#-------------------------------------------------------------------------------
 def change_bgs_volume(volume)
   # Changes the BGS volume to VOLUME. Does not change the BGS name.
   return if @playing_bgs == nil
   bgs = @playing_bgs
   Audio.bgs_play('Audio/BGS/' + bgs.name, volume, bgs.pitch)
 end

But this isn't configurable, is it?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 31, 2011, 12:57:35 pm
That means that you either have an event command that tries to play a BGS without having specified a filename or you have a map BGS without having specified a filename.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: astheroth on May 31, 2011, 02:51:06 pm
I checked my map and the events and i have neither event with BGS nor in the properties...


I've made a test map, add the id in the config, and without any event, bgm, bgs... The same error happened.
Another test in this map when i put in the properties a bgs and a bgm = same error.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on May 31, 2011, 04:01:20 pm
Did you try it without the script? Does the error still happen?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: astheroth on May 31, 2011, 04:38:57 pm
Yes sorry i should have said that before  :wacko:
If i delete the script i haven't any bug.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on May 31, 2011, 05:46:08 pm
I think I may know the problem. I was stupid and made the BGS call directly through the Audio module, I should have used the call for $game_system, which will not throw an error when a no filename is passed to it.

Until I update, try replacing this line:
return if @playing_bgs == nil


With this one:
return if @playing_bgs == nil || @playing_bgs.name == ''


Its a temp fix, but should do it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: astheroth on June 01, 2011, 07:31:22 pm
Thanx a lot! The bug is no more  :)


Edit:
I think i have found another error. I don't know if i must continue to post there or create a topic in the Troubleshooting section?


At any change of weather system seems cumulative tints of color.
The screen becomes increasingly white ...

Here some screenshots:
Spoiler: ShowHide
(http://data.imagup.com/9/1121636111.jpg) (http://www.imagup.com/data/1121636111.html)
---
(http://data.imagup.com/8/1121636130.jpg) (http://www.imagup.com/data/1121636130.html)
---
(http://data.imagup.com/9/1121636172.jpg) (http://www.imagup.com/data/1121636172.html)


I think the problem is on the lines where the tint is update but i'm not a scripter   :uhm:

Thanks in advance  :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Darkner on June 05, 2011, 07:39:22 am
Hi, I'm new to this forum. I've started using Zer0's CMS, which requires ATES or CCTS. I ran into trouble with ATES showing an error for the CMS: undefined method 'day' for #<ATES::Time:0x3eb1718 @min=0, @hour=0>. Therefore I started using the CCTS.

But I don't want time in my game, nor do i want weather or tints. How do i disable everything from the ATES or CCTS, but to still allow me to use the CMS?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: mroedesigns on July 21, 2011, 04:37:49 am
i know it's been talked about, but has anyone actually finished an RMX-OS plugin for this? I love the script and how flexible it is, but I can't use it in my game without the plugin, and i'm not script-savvy enough to write it myself.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 08, 2011, 03:31:24 pm
The  only thing that is working for me is the clock which shows the date, etc. Nothing else. T_T No tinting. Is this because I touched the change color screen tone event just to use for a cutscene? If that's the case, ... O_O making cutscenes and using this system at the same time for me, will not work.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 08, 2011, 04:50:07 pm
Read the instructions, they explain how to override the automatic system.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 09, 2011, 11:29:09 am
I've read them plenty of times, but there is no place addressing the screen tinting problem that I'm having. Like, it just doesn't work.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: hyakkivn on September 10, 2011, 07:34:05 am
I found a problem with this system. Just a small problem...
When there have rain in a map, you go to the next map, the rain gone but the sound is still be there.
And when it is night in this map, you go to the next map and it turn into day.
Does it make sense?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 10, 2011, 09:52:58 am
Speaking of sounds, sometimes out of nowhere, when I make rain effect (for Negative's cutscene in Generation) , after leaving that map, a rain sound effect occurs. Luckily, I simply made sure the next map uses auto bgs to none.
Title: Seriously....
Post by: Magus on September 22, 2011, 02:40:31 pm
Spoiler: ShowHide
Okay, I thought this script was good, but man... I've never had so many problems, so I'm just going to stop and also don't recommend this to anyone.  
Your call scripts were working at first, then suddenly, time got screwed up and it went night at 3:00 PM.  So I tried to add a parallel process which would enable me to secret adjust it in the background. Now keep note, this call script works perfectly on any other map, except one. (time.advance_hour(9))After it hits that one, it stops working for others. Now I've checked the script, I checked the game, and here is the error message I keep getting:
[spoiler](http://img94.imageshack.us/img94/4328/unledufn.png)


Spoiler: ShowHide
Now, I managed to solve error after error that this thing gave me.... but this is the one mystery that CANNOT be solved without additional help. If anyone can help me out, please, please and many thanks in advanced.


Weird.... AND AWESOME: it just started working on its on. YES! YES. I don't have to terminate my game.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 22, 2011, 04:35:09 pm
So is the problem fixed, or do you still need help?  I can take a look at your project if you'd like.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 23, 2011, 12:39:59 am
Quote from: ForeverZer0 on September 22, 2011, 04:35:09 pm
So is the problem fixed, or do you still need help?  I can take a look at your project if you'd like.

I'll see what happens later because it does appear to be working for now thanks to: time.set(11, 7, 6, 4, 1812)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: goth1sniper on September 25, 2011, 06:19:54 pm
i need help with 1 or 2 things.
I understand your script but im having a dumb moment .
the good/BAD_WEATHER_SWITCH i dont know how to use. how do i get npc to know?
same for time day/NIGHT_SWITCH like fire on at night off on day.
Thats all

thanks for the grate script
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 25, 2011, 06:50:59 pm
You configure it to the switch ID you want to use with it.  Say you want switch number 17 to control it, set it to 17.  Now you can control it by switching the game switch on/off with events, etc., or use that switch as a condition for events.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: goth1sniper on September 25, 2011, 07:32:51 pm
im sorry i dont get it. :facepalm:
i tried
Conditional branch: Script: Bad_weather_switch = true
go inside
else
outside

not just like that but you get it.

can you show me a small code how please and thank you
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 25, 2011, 07:58:53 pm
You don't access it by script, its the ID of the normal game switch:

Spoiler: ShowHide
Set the ID of the switches in the script...
(http://dl.dropbox.com/u/20787370/Temp/example1.png)

...give the respective switches names to reflect what they are...
(http://dl.dropbox.com/u/20787370/Temp/example2.png)

...and use them as conditions for events.
(http://dl.dropbox.com/u/20787370/Temp/example3.png)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: goth1sniper on September 25, 2011, 08:01:35 pm
wow that was fast thanks i get it.
lol duh
sorry about that
thank you so much
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Magus on September 26, 2011, 04:00:11 pm
I thought about searching for a way to fix the tinting, but I'll just stick to common event use instead.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on September 26, 2011, 05:20:54 pm
Quote from: Magus on September 26, 2011, 04:00:11 pm
I thought about searching for a way to fix the tinting, but I'll just stick to common event use instead.


Sounds like a plan.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on October 17, 2011, 01:15:33 am
Ok it's been a long time since I've been on here, but I decided to update to 1.2.2, and now switches run over and over lol. It's a little funny to see doors open and shut almost at random, but I'd like to see how to fix it, if it's possible. It seems all switches run automatically or something.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 17, 2011, 01:20:35 am
The switches are supposed to work automatically. You define the switch ID's. and they turn ON/OFF automatically. If the daytime switch is set to 4, then switch 4 will be on during the hours you define as daylight hours, and off when not.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: rlm1000 on October 17, 2011, 01:35:36 am
Thanks for the quick response, it looks like it's actually a variable causing the trouble, so I will have to read down through the script and make sure everything is defined properly and that I didn't accidentally use a variable twice when updating the script.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Fenriswolf on October 18, 2011, 12:01:14 pm
This script seemed like a great addition to the project i'm working on,
so I decided to use it and just now I finished configuring.
When testing it, there were no errors and my game ran like normal,
except that it may have been a bit laggier than before.

This is how the test went:
After the intro, the clock was turned on as supposed to,
but after about 1 hour (script time) my game froze (permanently, so no lag :P).

I'm wondering what's causing the freeze.
I figured that possible causes are one of my other scripts or my huge database (about 600mb, mostly music, at least 80% will be removed after finishing my project :P).

Any idea as of what's causing it?
I'll post my scripts if that is the most probable cause
(since I have a hunch that my database is the cause, since there are no errors).

I just hope that it is something that can be fixed,
since I've already come up with so many ideas to use the script for. :(
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Fenriswolf on October 20, 2011, 03:57:46 pm
*bump*

My guess is that it was kind of a stupid question and that the solution is simple,
but I'd really appreciate it if some one told me what he thinks is the problem.
If nobody has a clue, then I'll continue my project without the script.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on October 20, 2011, 04:41:11 pm
To be honest, I really don't know by what you're saying. If I had to guess, I would say you have a switch setup that is triggering and starting something it shouldn't be.  Try changing all the switch/variable IDs in the CCTS config to new values, and see if it still freezes.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Fenriswolf on October 20, 2011, 06:37:22 pm
I'll try that, thank you for the response.

EDIT:
Aaa lol, you were right, switches and variables were the problem.
I configured CCTS correctly, but I forgot to configure the switches for Zer0's Advanced Weather as well.  :stupid:

Thank you for the response, without it, it might have been the end of me.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: LiTTleDRAgo on November 06, 2011, 10:53:21 pm
can I request a feature?

the hour, minute, seconds, etc can controlled by variable (not a call script)

in the script: ShowHide
  MINUTE_VARIABLE = 1
  HOUR_VARIABLE = 2
  DAY_VARIABLE = 3
  MONTH_VARIABLE = 4
  YEAR_VARIABLE = 5


so if I want to change the year, I just change from the variable

QuoteControl Variables: [0005: Year] = 2011

 
not

QuoteScript: time.set(4, 1, 6, 5, 2011)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Grimm on November 19, 2011, 06:03:39 pm
QuoteAnd when it is night in this map, you go to the next map and it turn into day.


mhhh, i've got the same problem -.- anybody knows the solution???

Edit, It's only night on the Map n°1
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on December 13, 2011, 10:01:29 pm
There is a mistake in your new demo and script on the time speed freeze.

In the code it's written as speed freeze while in your demo it's called as freeze speed which gives it an error.

Even the help in the code states it should be freeze speed but it crashes the game unless you switch the words in the call script.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: vincent329 on December 23, 2011, 04:23:18 pm
i have a problem with part of the script i was trying to make it so the window of the time is not seen or is not as big useing the nil part of the code where it says
#   Set to nil to not use a skin
  #   Set to 'DEFAULT SKIN' to use whatever the player is using.
  #   Set to 'FILENAME' of the skin. Must be in Windowskins folder of game.
  CLOCK_SKIN = 'nil'
when i did that i kept getting an error saying that nil is not in the window skin folder do i have to get a diffrent window skin?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 23, 2011, 08:34:18 pm
Its nil, not 'nil' without the quotes.

CLOCK_SKIN = nil
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: vincent329 on December 23, 2011, 08:56:41 pm
thx but now i cant get the clock to hide when i hit the button signed to it
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 25, 2011, 01:53:49 am
What are you using as the configuration? Keep in mind that you define the game button (the constant in the Input module), not just a key on the keyboard.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: vincent329 on December 25, 2011, 02:36:11 am
for the time being i left it as the input::Z
when i tried to change it the code kept showing error's i dont get an error when i put B insted of Z but anytime i try changeing it to even an example it only gives error
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on December 25, 2011, 03:00:31 am
As I said, it has to be one of the GAME buttons that are defined. Unless you are using a custom input script, you will be limited to the following:

UP, DOWN, LEFT, RIGHT, F5, F6, F7, F8, F9, CTRL, ALT, SHIFT, L, R, C, Z, B, Y, A, and X

In the config, each of these must be preceded by Input::

Now, keep in mind that C does not mean the C key on your keyboard, but the C button defined by pressing F1 during gameplay, which is by default the space bar and enter key. The same goes with the other single letter keys.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 03, 2012, 10:56:50 am
Hi was wondering if it's possible to make the night darker or it gets darker the more time pass?

Say in my project night starts at 8:00 pm, will at 2:00 am get darker or remain the same?

Thanks.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 03, 2012, 03:06:21 pm
It depends how you configure it, You can do whatever you please with the tints, and set the target tint for each hour of the day.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 03, 2012, 05:15:07 pm
I'm using the one in the demo didn't edit much as I have few experience with scripts didn't want to make it wrong.

So which line exactly is the night tint if you don't mind?

Also does the advanced weather inside the demo work randomly like the climate or only with a script call?

Thanks.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 03, 2012, 05:48:08 pm
The demo setup is simply a generic setup that provides some very basic climates. The line that changes it is going to depend totally on the config. I suggest reading the instructions in the script, or using the included configuration program, which will hopefully take a lot of the confusion out of it. I admit the config is not the most user friendly thing in the world, which is my reason for making the small app.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 04, 2012, 10:02:22 pm
I'm having some weird problems with the script :S

1 - The biggest problem is I am starting infront of a house and the weather is clear, if I enter and exit the house (Once or twice) it starts raining. When it's already raining and I enter/exit the house again it starts raining heavily.

Any idea what's the problem here?

I configured the maps and obviously inside houses they are set 1 as indoors but why is it updating most of the times when I exit a house?

Any idea what could be my problem for these errors?

Thanks.

[Edit]

Nevermind the tinting problem seems to have been fixed putting the advanced script over the climate instead of under it.

Still 1 tiny problem I'm having is that I test the game and it's sunny then when I enter a house a go out it starts raining BUT if I remain outside it won't start raining so fast.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Trollses on January 06, 2012, 04:45:09 pm
Hey!
Everytime i try to use the * time.change_speed() command i get an: "SyntaxError occured while running script."
I have tried everything but i cant seem to get it to work :( I'm a noob at scripting though:P
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on January 07, 2012, 01:06:00 pm
Quote from: Trollses on January 06, 2012, 04:45:09 pm
Hey!
Everytime i try to use the * time.change_speed() command i get an: "SyntaxError occured while running script."
I have tried everything but i cant seem to get it to work :( I'm a noob at scripting though:P

remove the * and it'll work.


ForeverZer0, is it possible this system conflicts with fog graphics? i added a fog graphic of clouds to the advanced weather system, using $game_map.start_fog_opacity_change() to make them transition smoothly, then a boolean to true so it doesn't keep changing the opacity every update. when the weather ends, it again uses $game_map.start_fog_opacity_change() to fade the graphic out until it's invisible. if new weather starts right away, it keeps the graphic instead of defining a new one.

the problem is after a couple weather changes, the screen tone becomes increasingly bright until there's only a white glare.O_O fog opacity has nothing to do with screen tone does it? any ideas what is causing this?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Trollses on January 07, 2012, 02:21:15 pm
Thanks! I feel so dumb now. XD
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 08, 2012, 09:49:04 am
How would I go on making a switch go off when a day has passed?

I'm making an inn in my game and I want to make it that the room you rent lasts you a whole day before having to rent another room.

I tried using that variable for the day but have no idea how to make it work for this type of event.

In my game a day lasts 24 minutes (IRL) but I need it that the room keeps rented to you till day switch is switched on again. (But the thing is that the inn is open 24/7 so you can rent a room during the day when the day switch is on resulting in a simple conditional if switch is on useless.)

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 08, 2012, 01:47:08 pm
Use the hour variable.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 08, 2012, 01:50:46 pm
In a conditional branch?

Say:

If hour variable is equal to xxx?

I started using variables today lol have very basic knowledge on them (Tough managed to make randomise room between 1 to 5 for your character)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 08, 2012, 01:57:24 pm
Yes, for instance, say you don't want the player to be able to sleep at an inn until 16 hours have passed since his last visit. Create a variable, called "Inn Wait" or whatever. Then, in the end of the sleeping event, have set the variable to something like this:

Script:
(time.hour + 16) % 24


This will add 16 hours to the current time, and then take the remainder of it after being divided by 24. That will ensure that is always an actual hour of the day.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 08, 2012, 02:07:50 pm
Thanks I managed to make it work I think.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on January 08, 2012, 03:06:32 pm
i think i figured it out, but it's not something i did, it's in your demo as well.:/ if you let it run for a couple hours, the screen tone will have completely turned black or completely white. according to my observations, my guess would be that if new weather follows directly, instead of fading out and returning to 0 weather, the tint is added/substracted again without resetting the screen to the original tone first.

it's hard to believe no one noticed this before, especially after being out there so long...could you please check this?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on January 08, 2012, 03:55:46 pm
Well no one I know would run a demo for an hour or 2 so they wouldn't find out about the tinting.

I tried it on my project and in the night it gets very dark almost black on trees at around 2-4 am didn't check it during the day.

[Edit]

Fixed it.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on January 08, 2012, 04:12:11 pm
i meant ingame hours lol. but yeah that makes sense.

this is how it looks if you start the demo time on 19h:
Spoiler: ShowHide
(http://dl.dropbox.com/u/56282677/rmxp/ccts%20normally.jpg)


and this is how it looks after it's been running since 14h:
Spoiler: ShowHide
(http://dl.dropbox.com/u/56282677/rmxp/ccts%20runningsince2pm.jpg)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 11, 2012, 11:53:19 pm
I'm gonna fix the errors in this script once and for all. It will likely be a complete re-write, because I have some ideas that will make it much more modular and efficient, while maintaining nearly all the same features and power.  Looking back now, how I implemented the tone changing is quite ugly, and it bugs me. I'll likely make a new config program as well, and improve upon that as well. The config program was my very first C# app, so needless to say I have learned quite a bit since then.

Not quite sure when I'll get the time to do it, but I should manage to squeeze it in between other things throughout the next week or so, so be ready for the all new 2.0 version. 8)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on January 12, 2012, 10:32:51 am
in that case, there's also something strange going on using it with advanced weather and setting variations. at the end of the weather, it switches to the "0 variation" for a bit. ie white sparkles weather becomes blue sparkles for a couple seconds before ending. not sure if this is due to the ccts but that's where i've seen it happening. just thought i'd put it out there:p

i'm glad you're redoing this. i learn by looking through scripts to see how they do things, i found this a bit messy and hard to understand what i was looking at, at times, especially the tinting parts.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on January 12, 2012, 11:53:09 am
The problem with the tinting is its a bit too precise, more so than it has to be or that makes any significant difference. I sacrificed too much efficiency without getting a lot of benefit, but  I devised a new method that allows for nearly the same smoothness of transition, but is many times better on performance. Instead of every frame calculating tint, I chose to simply limit hourly transition periods to 10 seconds, and use built-in methods to actually make the change.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: TheCableGuy on February 15, 2012, 11:11:21 am
Could anyone tell me why the Time/Date isn't being displayed on the Digital Display? Would display in neither the Demo nor my project.

(http://i2.photobucket.com/albums/y2/WindKami/Image6.png)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 15, 2012, 12:27:58 pm
The font needs set to a different face. I believe it is set to Calibri, which you must not have installed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: TheCableGuy on February 15, 2012, 07:50:49 pm
The font, yeah. Font problems seam to hit me regularly.

Got that working but would you know why, when using the Script linked on the OP or copied straight from the Demo has no problems running but When i use the configuration tool Provided, I get this Error Message?

(http://i2.photobucket.com/albums/y2/WindKami/Image1.png)

Also, is there any suppose for this script using regular am/pm time instead Military time?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: tatasz on February 22, 2012, 09:02:25 am
Just wonder if its possible to implement some overlay pictures (for example, to show a picture imitating sunlight during the day - with good weather of course).
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on February 22, 2012, 09:44:05 am
Its very possible, just not part of the script. You can use the variables to make a common event or something easy enough, though.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: tatasz on February 22, 2012, 11:34:29 am
Was trying to do it, but its a bit annoying to make it smooth =)
<-- lazy one
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on February 27, 2012, 10:22:18 am
is this still getting a rewrite? i could try to get this black/white screen bug out myself but...O_O
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: TheCableGuy on February 27, 2012, 10:26:53 am
Is there a way to disable the Clock display in the Script? I can only find the script call to turn it off in the game but would it be possible to turn it off from within the script?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on February 28, 2012, 09:39:00 am
There's an error I keep on getting randomly while testing battles and was wondering if there's anything you could do to fix it.

(http://img831.imageshack.us/img831/7728/errormm.png)

Line is:

unless $game_map.climate.weather


I don't know if this error comes during the game too but it's annoying when I can't test the enemies vs players because of the error.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: LiTTleDRAgo on February 28, 2012, 10:47:30 am
try change it to

unless $game_temp.in_battle || $game_map.climate.weather
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on February 28, 2012, 11:34:12 am
Thanks I'll see if it works now.

[Edit]

Seems like it works, thanks :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Poe on March 16, 2012, 07:19:19 am
one of the problems i was having was that, if the weather changes, while the screen tone change from previous weather is not complete, the calculated change will bring it too far. i believe this was because the time between weather changes (weather_wait) was smaller than the transition lasted. i kicked it up a notch for debugging purposes, and caused a problem doing so, silly. but maybe you should put a warning for that or a minimal setting?

another problem that's now become clear is, if old weather is directly followed by new weather (without returning to 0 first), and then weather that does not change screen tone starts, it changes screen tone anyway (perhaps from previous values that didn't get cleared?) wrecking the system. i would appreciate any help on this, i feel like Krillin fighting Frieza here.:p
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on March 28, 2012, 05:44:47 pm
Any news on v2.0? :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on March 28, 2012, 08:31:12 pm
Haven't really been working on it. I stopped for some reason at about 85% completion. The only real thing left to make it functional is to implement weather tinting. I'll get around to it at some point...
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Vexus on March 29, 2012, 09:55:50 am
Ok thanks.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Danger Force on June 28, 2012, 09:39:35 pm
why is it not working climates was I clicked on the script but instead an empty climates
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 12, 2012, 05:28:22 pm
Hi,
I'm not good at scripting so I ask to you: is there a way to make the lenght of a minute in the game equals the lenght of a real second?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 12, 2012, 05:41:43 pm
If I remember correctly, setting the speed to 40 will be one minute. A minute's length is equal to the (Graphics.frame_rate / SPEED) * 60. One second in a game is 40 frames, so setting speed to 40 should have the effect you are looking for.

time.change_speed(40)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 12, 2012, 05:46:14 pm
thanks a lot
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 12, 2012, 07:05:01 pm
oh, another thing: I can't use the hourly tints, I used this config:
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                         BEGIN CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

 #    ** Script Generated at 12/07/2012 20.01.49.

module CCTS

 # The names for your days. Use as many as you want.
 DAYS = ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì',
         'Sabato']

 # The name for your months. Use as many as you want.
 MONTHS = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio',
           'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre']

 # How many days in a month? (Per each index above)
 MONTH_LENGTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

 # Set up as follows: [Minute, Hour, Day, Month, Year]
 START_DATE = [30, 6, 1, 1, 628]

 # Button used to toggle clock ON/OFF (if enabled). This is the game button,
 # not just the key on your keyboard.
 CLOCK_BUTTON = Input::Z

 # Default settings for the clock.
 # Set up using this pattern. [X, Y, OPACITY, FONTNAME, FONTSIZE, BOLD, ITALIC]
 # All can be changed in-game with a script call at any time.
 CLOCK_FACE = [0, 0, 160, 'MS PGothic', 14, false, false]

 # Default settings for the analog clock.
 # Set up using this pattern: ['FILENAME', HAND_OFFSET, X, Y, OPACITY]
 # Can be changed at any time during the game with a script call.
 ANALOG_FACE = ['', 0, 0, 0, 0]

 # Set the skin for the clock (normal). Configure like one of the following:
 #   Set to nil to not use a skin
 #   Set to 'DEFAULT SKIN' to use whatever the player is using.
 #   Set to 'FILENAME' of the skin. Must be in Windowskins folder of game.
 CLOCK_SKIN = 'DEFAULT SKIN'

 # If true, the analog clock will be used by default. Can be changed later.
 ANALOG_CLOCK = false

 # Configure how the time will be displayed. Ignore this if you are unsure of
 # how to set this up. Look up "sprintf Format" in the Help File of the game to
 # learn more of how it works.
 TIME_FORMAT = '%02d:%2d'

 # The minimun/maximum number of seconds before the system re-calculates what
 # weather pattern will be used. The number will be randomly selected from
 # within the defined range.
 WEATHER_WAIT = [0, 1]

 # This variable will be always be equal to the weather type. Lets you create
 # event conditions based off the weather. (must be raining to do this, etc...)
 # If using Zer0 Advanced Weather, just set to same as "Weather_Type_Variable"
 WEATHER_VARIABLE = 6

 # This switch will only be ON during "bad" weather effects (below). Used for
 # event conditions. (Villagers go inside if it is raining, storming, etc...)
 # If using Zer0 Advanced Weather, just set to same as "Adverse_Weather_Switch"
 BAD_WEATHER_SWITCH = 4
 # This switch will always be the opposite of the BAD_WEATHER_SWITCH.
 GOOD_WEATHER_SWITCH = 3

 # Include all "bad" weather types in this array. The above switch will only
 # be on when one of them is occurring
 # Same as from Zer0 Advanced Weather, if using.
 BAD_WEATHER_TYPES = []

 # This variable will be set by the "season" of the year. This can also be used
 # as a condition in events.
 SEASON_VARIABLE = 7
 # 0 = Summer
 # 1 = Autumn
 # 2 = Winter
 # 3 = Spring
 # Define the months for each season.
 SEASON_MONTHS = [ [5, 6, 7],   # Summer
                   [8, 9, 10],   # Autumn
                   [0, 1, 11],   # Winter
                   [2, 3, 4]]   # Spring

 # These switches will be used as conditions for events, etc. They will only
 # be ON during the hours defined below.
 DAY_SWITCH = 1
 NIGHT_SWITCH = 2

 # Define the hours that are considered "Day" and "Night". The respective
 # switch above will be ON/OFF depending on the hour of the day.
 DAY_START_HOUR = 6
 NIGHT_START_HOUR = 21

 # IDs of variables that will be equal to their named value. They can be used
 # for eventing, etc. Set any to nil that you do not want to use.
 MINUTE_VARIABLE = 1
 HOUR_VARIABLE = 2
 DAY_VARIABLE = 3
 MONTH_VARIABLE = 4
 YEAR_VARIABLE = 5

 # If true, and $DEBUG, a text file will be created each load in the games
 # directory that lists maps that do not have a climate defined, or those that
 # are defined more than once.
 WRITE_MISSING_DATA =

 #-----------------------------------------------------------------------------
 # Weather Tints
 #   Set the tint influence for each weather type. These are NOT the values
 #   the screen tint will be, rather they are the amount applied to whatever
 #   the current screen tint already is. They will transition in/out at the
 #   same rate of the weather transition.
 #-----------------------------------------------------------------------------
 def self.weather_tint(type)
   case type
 # when WEATHER_TYPE then return [RED, GREEN, BLUE, GRAY]
   when 1, 4  # Rain
     return [-20, -20, -15, 10]
   when 2, 5, 9  # Storm
     return [-30, -30, -20, 15]
   when 3, 16  # Snow
     return [-15, -15, -15, 20]
   end
   return [0, 0, 0, 0]
 end
 #-----------------------------------------------------------------------------
 # Weather BGS
 #   Define the BGS used for each weather type. They BGS will fade in/out at
 #   the same rate of the weather's transition. Volume will be 50% for maps
 #   that do not have weather, but still have weather sound.
 #-----------------------------------------------------------------------------
 def self.weather_BGS(type)
   case type
 # when WEATHER_TYPE then return ['FILENAME', VOLUME, PITCH]
   when 1  # Rain
     return ['005-Rain01', 80, 100]
   when 2  # Heavy Rain
     return ['006-Rain02', 80, 100]
   when 3  # Snow
     return ['001-Wind01', 80, 100]
   when 4  # Hail
     return ['005-Rain01', 60, 75]
   when 5, 9  # Thunder Storm
     return ['007-Rain03', 80, 100]
   when 7  # Blowing Leaves
     return ['003-Wind03', 80, 100]
   when 8, 16  # Swirling Leaves
     return ['004-Wind04', 80, 100]
   when 22  # Falling Rocks
     return ['015-Quake01', 100, 125]
   end
 end
 #-----------------------------------------------------------------------------
 # Weather Probability
 #   Define the weather probabilities for each climate. The climate ID and the
 #   month are passed as arguments for branching. This will allow you to make
 #   it snow in the winter, storm in the summer, etc.
 #
 #   Set up like this:
 #
 #   case climate_id
 #   when CLIMATE_ID
 #     case month
 #     when MONTH then return [[TYPE, PROB], [TYPE, PROB], [TYPE, PROB], etc]
 #
 #   If you are using Zer0 Advanced Weather or MAWS (v.1.2 or >) where the
 #   "variation" is used, just add the variation value into the respective
 #   array, like this:
 #                     [TYPE, PROBABILITY, VARIATION]
 #
 #   You need not define a probability for 0, or no weather. It is the default
 #   value used for undefined weather and when the weather probability is not
 #   high enough when the system calculates it.
 #
 #   The actual weather will be chosen randomly from all types that have a
 #   probability above the randomly chosen 'chance' at each weather update.
 #-----------------------------------------------------------------------------
 def self.weather_prob(climate_id, month)
   case climate_id
   when 0  # Outdoor
     case month
     when 1, 2, 12
       return [[3, 17], [16, 12]]
     when 3, 4, 5
       return [[1, 30], [2, 25], [9, 25]]
     when 6, 7, 8
       return [[1, 20], [9, 20], [2, 10]]
     when 9, 10, 11
       return [[1, 15], [9, 10], [6, 25] [7, 25], [8, 25]]
     end
   when 1  # Indoor
     case month
     when 1, 2, 12
       return [[3, 17], [16, 12]]
     when 3, 4, 5
       return [[1, 30], [2, 25], [9, 25]]
     when 6, 7, 8
       return [[1, 20], [9, 20], [2, 10]]
     when 9, 10, 11
       return [[1, 15], [9, 10], [6, 25] [7, 25], [8, 25]]
     end
   when 2  # Snow
     return [[3, 80], [16, 50]]
   when 3  # Desert
     return [[1, 5]]
   end
 end
 #-----------------------------------------------------------------------------
 # Hourly Tints
 #   Define the target tints for each hour of the day, for each climate.
 #   The month, hour, and climate_id are all passed as arguments so you can
 #   create as in-depth of a configuration as you like. Just create branches
 #   within branches using the climate, month, and hour as conditions to define
 #   the desired screen tone. There will be no tint (0, 0, 0, 0) for anything
 #   left undefined. (see presets below for examples)
 #
 #   Setup: [RED, GREEN, BLUE, GRAY]
 #-----------------------------------------------------------------------------
 def self.time_tint(climate_id, hour, month)
   case climate_id
   when 0  # Outdoor
     case month
     when 1, 2, 12
       case hour
       when 0, 1, 2, 3, 4, 5, 6, 19, 20, 21, 22, 23
         return [-100, -100, -20, 15]
       when 7
         return [-15, -15, -25, 10]
       when 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
         return [-10, -10, -10, 10]
       end
     when 3, 4, 5
       case hour
       when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
         return [-100, -100, -20, 10]
       when 6
         return [-5, -5, -20, 0]
       when 18
         return [0, 0, -15, 5]
       when 19
         return [-15, -15, -30, 10]
       end
     when 6, 7, 8
       case hour
       when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
         return [-100, -100, -20, 15]
       when 6
         return [10, 10, -10, 0]
       when 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
         return [5, 5, -5, 0]
       when 18
         return [-25, -25, -10, 5]
       when 19
         return [-50, -50, -15, 10]
       end
     when 9, 10, 11
       case hour
       when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
         return [-100, -100, -20, 10]
       when 6
         return [10, 5, -10, 10]
       when 18
         return [5, 5, -20, 0]
       when 19
         return [-5, -5, -25, 10]
       end
     end
   #-------------------------------------------------------------------
   when 1  # Snow
     case month
     when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
       case hour
       when 0, 1, 2, 3, 4, 5, 6, 19, 20, 21, 22, 23
         return [-100, -100, -20, 15]
       when 7
         return [-15, -15, -25, 10]
       when 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
         return [-10, -10, -10, 10]
       end
     end
   #-------------------------------------------------------------------
   when 2  # Desert
     case month
     when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
       case hour
       when 0, 1, 2, 3, 4, 5, 20, 21, 22, 23
         return [-100, -100, -20, 15]
       when 6
         return [10, 10, -10, 0]
       when 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
         return [5, 5, -5, 0]
       when 18
         return [-25, -25, -10, 5]
       when 19
         return [-50, -50, -15, 10]
       end
     end
   #-------------------------------------------------------------------
   when 3  # Underground
     case month
     when 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
       case hour
       when 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
         return [-20, -20, -20, 0]
       end
     end
   #-------------------------------------------------------------------
   end
   # Default return value for undefined time/climate (Don't edit)
   return [0, 0, 0, 0]
 end
end

 #-----------------------------------------------------------------------------

class Climate

 attr_accessor :maps

 def initialize
 #-----------------------------------------------------------------------------
 # Initialize New Climates
 #   Simply follow the same pattern for each new climate you create.
 #-----------------------------------------------------------------------------
   @climate[0] = Game_Climate.new(0)
   @climate[1] = Game_Climate.new(1)
   @climate[2] = Game_Climate.new(2)
   @climate[3] = Game_Climate.new(3)
   @climate[4] = Game_Climate.new(4)
 #-----------------------------------------------------------------------------
 # Climate Names
 #   Create names for the different climates.
 #-----------------------------------------------------------------------------
   @climate[0].name = 'Outdoor'
   @climate[1].name = 'Indoor'
   @climate[2].name = 'Snow'
   @climate[3].name = 'Desert'
   @climate[4].name = 'Underground'
 #-----------------------------------------------------------------------------
 # Weather for this Climate?
 #   If false, no weather will be shown for climate, although weather sound and
 #   tinting can still be used if desired.
 #-----------------------------------------------------------------------------
   @climate[0].weather = true
   @climate[1].weather = false
   @climate[2].weather = true
   @climate[3].weather = true
   @climate[4].weather = false
 #-----------------------------------------------------------------------------
 # Weather Tinting?
 #   If true, different weather patterns will influence the screen tint
 #-----------------------------------------------------------------------------
   @climate[0].tinting = true
   @climate[1].tinting = false
   @climate[2].tinting = true
   @climate[3].tinting = true
   @climate[4].tinting = true
 #-----------------------------------------------------------------------------
 # Weather Sound?
 #   If true, weather BGS will be played automatically for that climate
 #-----------------------------------------------------------------------------
   @climate[0].sound = true
   @climate[1].sound = true
   @climate[2].sound = true
   @climate[3].sound = true
   @climate[4].sound = false
 #-----------------------------------------------------------------------------
 # Time Speed
 #   This will be the default time speed used for the climate. It can be
 #   overridden with script calls in-game if needed. "1" is real-time, and
 #   any other number is multiples of real-time, so "5" is 5 times as fast as
 #   the real world. (unless you live in a videogame)
 #-----------------------------------------------------------------------------
   @climate[0].speed = 40
   @climate[1].speed = 40
   @climate[2].speed = 40
   @climate[3].speed = 40
   @climate[4].speed = 40
 #-----------------------------------------------------------------------------
 # Maps for each climate
 # Include IDs of maps that use each respective climate.
 #-----------------------------------------------------------------------------
   @climate[0].maps = [001]
   @climate[1].maps = []
   @climate[2].maps = []
   @climate[3].maps = []
   @climate[4].maps = []
 #-----------------------------------------------------------------------------
 end
#-------------------------------------------------------------------------------
 def map_climate(map_id)
   @climate.each {|climate| return climate if climate.maps.include?(map_id)}
   # Returns a dummy climate with empty settings if not defined.
   return Game_Climate.new(-1, 'DUMMY', false, false, false, 5, [])
 end
end

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#                           END CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:


Please use the 'code' tags. ~KK20
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 13, 2012, 12:00:26 am
I see that the climate configuration only defines one map, the map with ID:1. Are you using this configuration in a brand new project with only one map?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 13, 2012, 07:10:30 am
yes
EDIT: I tried the script ina new blank project with just one map, and i got this error:
????? 'CCTS_Configuration' ? 493 ??? NoMethodError ???????
undefined method '[]= for nil:NilClass

line 493 is the line in which the first climate is created...
so i think the problem with the first project is that the climates aren't created, so weather and hourly tint don't work.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 13, 2012, 05:36:03 pm
Might be an error with the config generator (it was my first C# project I ever made). Add the following line directly before the line where the error is.

@climate = []
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 13, 2012, 06:10:31 pm
i did it, and a new error showed up:
CCTS_Configuration 561 NoMethodError
undefined method 'maps' for nil:NilClass

the line is:
   @climate.each {|climate| return climate if climate.maps.include?(map_id)}

it's at the end of the script, so i hope it's the last error *_*
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 13, 2012, 06:40:48 pm
That doesn't make a whole lot of sense...
Somehow or another, on of the climates in the array is nil.

Double-check the first part of the Climates class. Make sure that the first index is 0, and that no numbers are skipped. It should look like something like this:

    @climate[0] = Game_Climate.new(0)
    @climate[1] = Game_Climate.new(1)
    @climate[2] = Game_Climate.new(2)
    @climate[3] = Game_Climate.new(3)
    @climate[4] = Game_Climate.new(4)


If the first index is not 0 let me know. It might look like this:
    @climate[1] = Game_Climate.new(1)
    @climate[2] = Game_Climate.new(2)
    @climate[3] = Game_Climate.new(3)
    @climate[4] = Game_Climate.new(4)


Or let me know if the the numbers in the brackets do not run in order. (0, 1, 2, 3, etc., etc.)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 14, 2012, 06:53:25 am
Don't ask me why, but the fourth climate was missing...
I added it, and it works, but there's a problem:
the screen gradually becomes white, regardless of the hour i start the game.
also, if i change map, the screen tint returns to the "normal" one.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 16, 2012, 05:22:33 am
bump?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 17, 2012, 05:54:23 am
bump?
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 17, 2012, 11:12:47 pm
Upload a demo that reproduces the problem, I can't say for sure without seeing what's going on.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 18, 2012, 06:59:09 am
http://www.4shared.com/rar/l991vtHD/Project1.html
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ForeverZer0 on July 19, 2012, 05:20:02 pm
I'm sorry, but I am not signing up and joining 4shared just to download a file.
Could you please upload to a file sharing service that is less of a pain the ass, I hate 4shared for that reason.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 20, 2012, 04:47:14 am
Sorry, i used it only because i had an old account.
http://www.mediafire.com/?mhsewc9437dbvjd
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sbus on July 21, 2012, 05:23:13 pm
Meh, I managed to find another time system and I did.
It suits better my needs so, I think theresn't a problem anymore.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: AnimeGirl on December 14, 2012, 11:19:34 am
I need help with CCTS, What I want to do is lock buildings for a specific time
Example
Spoiler: ShowHide
http://imgur.com/ZZxP4  (http://imgur.com/ZZxP4)

If anybody knows how to do it that would help me a lot, because I'm a newbie in gamemaking. :D
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on December 14, 2012, 07:25:25 pm
In your event (most likely a door), put the first event command to turn a switch OFF (we will use this to determine whether the place is open/closed). Then use a script call and copy something like this:

return if ['Thursday', 'Saturday',
'Sunday'].include?(time.day_name)
return unless (10..14).include?(
time.current_time[1])
$game_switches[ID] = true

Replace ID with the same number as the switch we used at the beginning of our example.

Then, use a conditional branch and, under tab 4, use a script. Write this in the box:

$game_switches[ID]

Again, replacing ID with the switch we are using for this example.

If it's true, then the place is open. Otherwise, it's closed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: AnimeGirl on December 18, 2012, 04:57:54 pm
Quote from: KK20 on December 14, 2012, 07:25:25 pm
In your event (most likely a door), put the first event command to turn a switch OFF (we will use this to determine whether the place is open/closed). Then use a script call and copy something like this:

return if ['Thursday', 'Saturday',
'Sunday'].include?(time.day_name)
return unless (10..14).include?(
time.current_time[1])
$game_switches[ID] = true

Replace ID with the same number as the switch we used at the beginning of our example.

Then, use a conditional branch and, under tab 4, use a script. Write this in the box:

$game_switches[ID]

Again, replacing ID with the switch we are using for this example.

If it's true, then the place is open. Otherwise, it's closed.


Thanks a lot, it really helped :D .

Edit:
When I tried to use the script this window opened
Spoiler: ShowHide
http://imgur.com/KEDft
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on December 19, 2012, 07:30:41 pm
Please don't double post.
Also, c'mon guys... no one could post the answer for me? D:

You're supposed to replace ID with an actual number. If you want to use Switch 20, replace ID with 20. I even clearly said
QuoteReplace ID with the same number as the switch we used at the beginning of our example.


If you're still confused, I'll post a screenie later.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on December 21, 2012, 03:24:24 pm
This script doesn't modify the weather effects. This script, however, does: http://forum.chaos-project.com/index.php/topic,5980.0.html

Under the class RPG::Weather, you'll see that it's nothing more than creating a bunch of sprites. This is where the actual splash effect is made:
Spoiler: ShowHide

    # Splash Bitmap

    @rain_splash = Bitmap.new(8, 5)
    case $game_screen.weather_variation
    when 1 # Blood splash
      splash_color1 = Color.new(141, 9, 9)
      splash_color2 = Color.new(141, 9, 9, 128)
    when 2 # Oil splash
      splash_color1 = Color.new(0, 0, 0)
      splash_color2 = Color.new(15, 15, 15)
    when 4 # Golden splash
      splash_color1 = Color.new(227, 217, 56)
      splash_color2 = Color.new(218, 207, 36)
    when 5 # Sepia splash
      splash_color1 = Color.new(167, 149, 139)
      splash_color2 = Color.new(100, 75, 63)
    else # Normal (Default)
      splash_color1 = Color.new(255, 255, 255)
      splash_color2 = Color.new(255, 255, 255, 128)
    end
   
    @rain_splash.fill_rect(1, 0, 6, 1, splash_color2)
    @rain_splash.fill_rect(1, 4, 6, 1, splash_color2)
    @rain_splash.fill_rect(0, 1, 1, 3, splash_color2)
    @rain_splash.fill_rect(7, 1, 1, 3, splash_color2)
    @rain_splash.set_pixel(1, 0, splash_color1)
    @rain_splash.set_pixel(0, 1, splash_color1)

I don't script in VXA so someone else will have to help you with that.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ThallionDarkshine on December 21, 2012, 06:07:12 pm
Quote from: KK20 on December 21, 2012, 03:24:24 pm
This script doesn't modify the weather effects. This script, however, does: http://forum.chaos-project.com/index.php/topic,5980.0.html


I might work on converting that script that KK20 mentioned to VXA, now that I'm off from school for winter break.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ThallionDarkshine on December 21, 2012, 09:18:42 pm
Done.

http://pastebin.com/raw.php?i=7CLeVWrR (http://pastebin.com/raw.php?i=7CLeVWrR)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Lamsah on December 21, 2012, 11:05:31 pm
Oh you got it completed :o  Thank you very much ThallionDarkshine  :shy:

Please PM me for payment method and total :)

quick question, on the script says use this method to test $game_map.screen.weather(type, power, transition, variation)

i tried that method and an error occurred:

undefined method `weather' for nil:NilClass

EDITED:
Mr. Thallion solved the issue and thanks to him in making live  :shy:
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ArcaneAlchemy on January 14, 2013, 02:17:28 am
Hey, so I recently had a problem that had stumped me for about 2 days. For anyone who had this same problem, you will be glad that I wrote this, 'cause holy crap it was annoying. Probably a result of my laziness in rewriting the audio module. Anyway, for those of you who want to both use this script, and to have your Map BGM return to its place after a battle here is an easy solution. I tried to use the MCI player script on here, but it had a problem with the fade in/out of the weather effects of this script. So, I found this script. http://www.hbgames.org/forums/viewtopic.php?t=55486

If you comment out lines 1171 through 1195 then you will have both the awesome weather/time and have your map bgm return to where it was at before a battle. The link above has 3 scripts. Find the one called FmodEX and comment out these lines:

# def Audio.bgs_play(filename, volume = 100, pitch = 100, position = 0)
   # if @bgs_fading_out
   #   @next_bgs = RPG::AudioFile.new(filename, volume, pitch)
   #   @next_bgs_position = position
   #   return
   # end
   # FMod::bgs_play(filename, volume, pitch, position)
# end
  #--------------------------------------------------------------------------
  # * Stops BGS Playback
  #--------------------------------------------------------------------------
# def Audio.bgs_stop
   # FMod::bgs_stop
   # @bgs_fading_out = false
  #end
  #--------------------------------------------------------------------------
  # * Starts BGS fadeout.
  #     time            : Length of the fadeout in milliseconds.
  #--------------------------------------------------------------------------
# def Audio.bgs_fade(time)
  #  return unless FMod::bgs_playing?
  #  @bgs_fading_out = true
  #  time = time / 1000
  #  @bgs_fade_decrement = FMod::bgs_volume / (time * 5)
  #end

That's it. Man, that was annoying. Since ForeverZero wrote both this script and the MCI, he probably has a much better way to do this, but this will get the job done for now.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Moshan on February 02, 2013, 10:05:15 am
 Hello! How can I set the default show clock to false and how can I see what key is assigned as L?(CLOCK_BUTTON = Input::L)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ThallionDarkshine on February 02, 2013, 10:19:41 am
If you are using custom controls from tons of addons or babs, then set it to Input::Key['L']
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Moshan on February 02, 2013, 02:04:06 pm
 Thank you very much! Btw for disabling clock as default I tried to change this  def clock(value = false)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on May 29, 2013, 07:34:05 pm
A potential bug has been found--requiring others to confirm if this is the appropriate solution.

Bug: If a climate was configured to not have sound played (like being Underground), the sound is still heard.

Solution:
Spoiler: ShowHide
 Find
    # Reset BGS if climate has changed.
    if $game_map.climate.id != $game_map.old_climate.id &&
      $game_map.climate.sound

and replace with
    # Reset BGS if climate has changed.
    if $game_map.climate.id != $game_map.old_climate.id


Then find

      if weather_bgs_playing?
        $game_system.bgs_fade(0)
        $game_system.bgs_play($game_map.map.bgs) if $game_map.map.autoplay_bgs
        return
      end

and replace with

        $game_system.bgs_fade(0)
        $game_system.bgs_play($game_map.map.bgs) if $game_map.map.autoplay_bgs
        return

Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ArcaneAlchemy on July 07, 2013, 03:30:45 pm
Nice. Thanks for that. :)
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: X-Law on July 29, 2013, 07:50:32 am
Quote from: KK20 on May 29, 2013, 07:34:05 pm
A potential bug has been found--requiring others to confirm if this is the appropriate solution.

Bug: If a climate was configured to not have sound played (like being Underground), the sound is still heard.

Solution:
Spoiler: ShowHide
 Find
    # Reset BGS if climate has changed.
    if $game_map.climate.id != $game_map.old_climate.id &&
      $game_map.climate.sound

and replace with
    # Reset BGS if climate has changed.
    if $game_map.climate.id != $game_map.old_climate.id


Then find

      if weather_bgs_playing?
        $game_system.bgs_fade(0)
        $game_system.bgs_play($game_map.map.bgs) if $game_map.map.autoplay_bgs
        return
      end

and replace with

        $game_system.bgs_fade(0)
        $game_system.bgs_play($game_map.map.bgs) if $game_map.map.autoplay_bgs
        return




After testing this (sorry didn't found it until now xD) i got this error:
NoMethodError occurred
undefined method 'autoplay_bgs' for nil:NilClass
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on July 30, 2013, 12:38:22 am
Could you tell me how it happened and what your configuration is? It's been a while since I've looked at this and retesting it from no base is time consuming.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: X-Law on August 06, 2013, 06:58:09 am
Ouch sorry! i completely forgot about this.
I managed to "fix" it just deleting the ISO script by MGC. Looks like there was some missing part in his spriteset_map overwrite and others. I tried pointing every class call in CCTS to the new ones in MGSISO and it worked fine until i applied your fix.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on August 07, 2013, 03:20:57 am
Because I have no idea how that script works (nor am I going to learn it O_o) try doing this:

        $game_system.bgs_fade(0)
        $game_system.bgs_play($game_map.map.bgs) if ($game_map.map != nil && $game_map.map.autoplay_bgs)
        return
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sasquatch927 on August 22, 2013, 03:16:10 pm
I've got a couple errors with this script, not sure if anyone else has had this issue but here they are

--every time the new month starts, it starts on the 2nd and not the 1st.

--when the game starts the new year from 1991-1992, I get this error

Script 'time' line 812: type error occurred

nil can't be coerced into fixnum

If anyone has any ideas, It'd be much appreciated

EDIT: I just now discovered that the above errors only occur whenever you make the script call 'time.advance_day(1)'
these don't occur when you let time pass on its own.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Terv on August 23, 2013, 03:08:45 am
Quote from: Sasquatch927 on August 22, 2013, 03:16:10 pmEDIT: I just now discovered that the above errors only occur whenever you make the script call 'time.advance_day(1)'

I can confirm that -- when manually advancing the day from January 1st on, the starting days of the next month are as follows (default setup):

February: 5, 30, 3, 1, 3, 1, 2, 3, 1, 3, 1, next year: nil can't be coerced into Fixnum
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Sasquatch927 on August 23, 2013, 03:53:31 am
I'm guessing what the script is doing... I believe it handles the advance day and time tracking separately. When the script call advances the month to the next, the script processes the advance via script call and also advances by time tracking. I'm thinking whatever process the calculations are undergoing, they're calculating twice. I think this relates somehow to how the new year keeps bringing up that nil-fixnum error. My belief is that since the calculations are made twice, that somehow, the days subtract themselves into becoming a nil value which bring up the error. I am in no way a scripter lol... These are just my theories.

I'm gonna roll with a temporary fix. If I want to advance in time a little bit, I bring up a script call:

time.speed_frozen(false)
time.change_speed(6000)
time.speed_frozen(true)

This speeds up time extremely fast. Then when the clock strikes a certain time of the day, a switch triggers a parallel process that does this script call:

time.speed_frozen(false)
time.change_speed(60)
time.speed_frozen(true)

Since the error doesn't come from the time ticking away on its own, the above method works perfectly fine. It is a temporary fix, so I can make due for now until the bug is fixed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ArcaneAlchemy on June 23, 2014, 01:59:24 am
Hey ForeverZero,

I found a bug with the advance time script calls. Particularly the month advancement. I set up a little testing game so that I could sample all of the really awesome elements of your script, but when I advance from "December"(or the last month in the array) to "January" of the next year it gets a nil definition error. It sends me to line 810 where your time advancement calculations are.

  I noticed that it does in fact trigger right at line 810 for some reason because it will let me print() a debug message right before it, but if it's inside the if statement then it doesn't get reached. I also noticed that the month reads 13 or "month_array.size +1" right then. I'm gonna take a crack at it, but it looks right to me, especially considering that the normal advancement of time without the in-game script calls works perfectly well. I'll post a solution if it bugs me enough to fix it, but I thought I'd throw that out there.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on June 23, 2014, 11:58:11 am
Yeah, the logic of time_fix is completely broken. If you were to, say, call time.advance_day(1) on August 31, it would spit out September 3. The absolute best way to handle this would be a loop, checking the number of days in each month and subtracting @day until it is within a reasonable range.

And it really should be
@month > CCTS::MONTHS.size

I can fix this up pretty quick.

EDIT: And first post-ed.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: Blizzard on June 23, 2014, 01:03:06 pm
It won't work with leap years. You can't do it like this.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: KK20 on June 23, 2014, 01:10:29 pm
Are there even leap years in this script? :P
The idea really is to come up with your own months and days to them. The default template just so happens to be the Gregorian calendar.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ArcaneAlchemy on June 24, 2014, 09:26:18 pm
Yeah, thanks for the insight. I'm not using that feature anyway, but I've been picking it apart the best I could and ended up finding that error.

A leap year would be cool and likely easy to add. I am also trying to use a lighting system with this script and it's proving to be somewhat of a pain. I'm probably going to use an overlayed image for the light and change the opacity over time rather than the tinting(r,g,b,grey) system. It still won't give me the ability to turn on/off a switch for the light, but whatever. If I use this in conjunction with the Frech lighting script on here http://forum.chaos-project.com/index.php?topic=14062.0 (http://forum.chaos-project.com/index.php?topic=14062.0) then it seems possible. If I get it working and the addition is short enough I may add a switch option for it and post it here.
Title: Re: [XP] Complete Climate and Time System (CCTS)
Post by: ArcaneAlchemy on July 01, 2014, 04:40:25 am
I'm not sure if I'll get crap for double-posting or not, but this issue is completely different from what I was talking about on the last post. Anyway, so there's a major bug in this script. I know that ForeverZero isn't really looking at these anymore but I figure that I'll point out the bug anyway.

Here's the bug:

Let's say that you have map 1 with a climate of raining with a 100% probability. You have map 2, which is a house located on map 1 and has no weather "case/when" set. There is a transfer event between the two. Then, you have map 3, which is a snow 100% probability climate. If you go into the snow map(map 3) and it starts snowing, then you go back to map 1(rain), and into the transfer event to get to map2(no weather) and then go back outside to map 1. Map 1 will show snow even though snow is not a part of it.

From what I've seen from the debugger, it will do this if the weather count has not finished with the current weather type. Once the count is done, it will choose a weather type within the climate. Mind you, this has nothing to do with the months or anything else.

The only way to fix this from what I see is to have each new map instance check if the weather type that is being used is part of the weather types of the new map climate. So, for instance if map 1 is getting snow(let's say weather type 16 for example), and 16 is not listed in that climate's weather array, then it stops the weather for 0 frames, therefore resetting the count and weather type to no weather until it is randomized again within that climate's proper list.

I'll try and add this to the code as a switch to prove my point and I can provide an example if anyone is interested in troubleshooting this. Anyway, I have a solution, but if ForeverZero isn't here maybe someone else can verify the cleanliness of my patch and update it?

Edit: Figured it out. Script add-on below.

Just add on below the CCTS to try it out whomever the script updater may be...

Spoiler: ShowHide
CCTS_MAP_CHANGE_FIX = true
if CCTS_MAP_CHANGE_FIX == true
 
class Game_Map
alias ccts_fix_ini setup
  def setup(map_id)
  ccts_fix_ini(map_id)
   # Gets the current climate and month to determine weather for the season.
   climate, month = $game_map.climate.id, $game_system.time.month
   climate_weather = CCTS.weather_prob(climate, month)

     weather_list = []
     if climate_weather != nil
       climate_weather.each do |x|
       ###print x[0]
       weather_list.push(x[0])
     end
     
     end
     current_weather = $game_screen.weather_type_target
     if current_weather != 0
       if weather_list.include?(current_weather)
         #print("this weather is inside the list")
       else
         #print("fixing it")
         $game_screen.weather(0,0,0)
       end
     end
 end#end def setup
end#end Game_Map class

end#end if CCTS_MAP_CHANGE_FIX statement