Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: fugibo on March 10, 2008, 06:08:36 AM

Title: [XP] Advanced Time and Environment System
Post by: fugibo on March 10, 2008, 06:08:36 AM
This script has been finished and rereleased! Please click here (http://forum.chaos-project.com/index.php/topic,12869.0) for the new version!

Advanced Time and Environment System (ATES)
Authors: Blizzard
Version: 0.4
Type: Autonomous Timeflow and Environment Controller
Key Term: Environment Add-on

Introduction

This Time System will make your game have daytime and nighttime periods. The screen will be tinted accordingly. You can set up the length of the day. Other features are explained below. Please be sure to configure this system appropriately.

This work is protected by the following license:
Quote
Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
( http://creativecommons.org/licenses/by-nc-sa/3.0/ )

You are free:

to Share - to copy, distribute and transmit the work
to Remix — to adapt the work

Under the following conditions:

Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

Noncommercial. You may not use this work for commercial purposes.

Share alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

- For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

- Any of the above conditions can be waived if you get permission from the copyright holder.

- Nothing in this license impairs or restricts the author's moral rights.

Features


Screenshots

N/A for this sort of script

Demo

N/A

Script

Just make a new script above main and paste this code into it.
Script Download (http://downloads.chaos-project.com/scripts/Advanced Time and Environment System.txt)

Instructions

Inside the script in the first comment.

Compatibility

99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old savegames. Can cause incompatibilty issues with DNS-es.

Credits and Thanks


Author's Notes

Keep in mind that ATES is initially turned off, you need to turn it on by using the ATES.on and ATES.tint_on commands together.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! Enjoy! =D

EDIT:

Nice, Blizz  ;D
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 11, 2008, 12:39:20 PM
Merge successful. :3
Title: Re: [XP] Advanced Time and Environment System
Post by: Nortos on March 11, 2008, 12:57:53 PM
ohhhhh is this your new time system? I been waiting for this for ages I have to go in a sec though so cnt comment about it but looking now :)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 11, 2008, 01:04:34 PM
It's a completely new code. But so far it only tints the screen. The full system will support stuff like calender, seasons bad weather probability, temperature... =X
Title: Re: [XP] Advanced Time and Environment System
Post by: Nortos on March 11, 2008, 01:10:01 PM
wow i just looked through it and it looks good the code so small more than half of it alone is instructions :P gj on this when get time I'll get round to swapping to this instead DDNS
Title: Re: [XP] Advanced Time and Environment System
Post by: Flermza on March 11, 2008, 02:38:37 PM
New time system, awesome work!
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on March 11, 2008, 02:49:30 PM
:P And I was gonna start working on my own full-blown Environmental Effects scripts, with water reflections, time, tints, weather, and everything, but you already beat me to it...
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 11, 2008, 04:54:30 PM
I can give you the code I have so far. I took out the planned options for this release. You can finish it instead. I barely have time to do it myself.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on March 11, 2008, 05:05:27 PM
0_o

Okay, then, I'll do that. Thank you, Blizz!
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 11, 2008, 05:15:35 PM
I just sent you a download via PM. Alright, I'll make something happen that this turns into YOUR topic... ;)

EDIT: I MADE IT HAPPEN!!!111oneonetwothreeeight
Title: Re: [XP] Advanced Time and Environment System
Post by: Nortos on March 11, 2008, 11:37:18 PM
lol anyway looking forward to it WcW
Title: Re: [XP] Advanced Time and Environment System
Post by: Gilmerrambo on July 18, 2008, 07:04:56 PM
I cannot figure out how to make the time of day stay the same from one room to another. The clock still works but the tinting stops. Will someone help? :plz:
Title: Re: [XP] Advanced Time and Environment System
Post by: Starrodkirby86 on July 18, 2008, 07:11:38 PM
Did you enable tinting? I'll quote from the Instructions within the script:
(click to show/hide)
Turn it on through a Call script command and insert ATES.tint_on

Make sure the time system is already on, but I'm sure it is considering time is moving. xD
Title: Re: [XP] Advanced Time and Environment System
Post by: TheHackMan on August 15, 2008, 10:52:59 PM
I just tried out the script and whenever I have it turn on with
Call Script: ATES.on
I end up with ArgumentError on line 353
"wrong number of arguments(5 for 2)"

It would seem line 353 is:
      ATES.advance(1, 0, 0, 0, 0) if @frame_count % (ATES::LENGTH / 36) == 0

When I change it to:
      ATES.advance(1, 0) if @frame_count % (ATES::LENGTH / 36) == 0
Then it works without any problems


Now I have run into a second problem, whenever I set the clock display to false(so it wont show) I get an error that says:
Code: [Select]
NoMethodError on line 445
undefined method ` draw' for nil:NilClass
Line 445 is:
Code: [Select]
   @clock.draw if $game_system.ates.frame_count % 40 == 0
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on August 16, 2008, 01:30:39 AM
I put up a fixed version.
Title: Re: [XP] Advanced Time and Environment System
Post by: TheHackMan on August 16, 2008, 03:09:08 AM
Awesome, clock is now not displaying as it should when its set to false with no errors :D
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on September 03, 2008, 10:33:18 PM
Hello.  I know nothing of RGSS, but I like this script a lot.
I have a question though.  How do I make it so things happen at certain times of the day.
All I really need is some sort of "Condition Branch" for my eventing.

I ask because I'm making a Harvest Moon kind of game, and it would be cool if I could have townsfolk be in one place at 4:00 and a different place at 6:00.

Thanks, and this script is pretty cool :)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on September 03, 2008, 10:36:47 PM
Look in the script. Day and Night trigger switches which you can use to determine the daytime. You can obtain the hour by using "$game_system.ates.time.hour" (without the double quotes).
Your best idea would be to assign the value to a variables (using "$game_variables[ID_NUMBER] = $game_system.ates.time.hour") and adding that to the event's precondition.
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on September 03, 2008, 10:50:40 PM
Look in the script. Day and Night trigger switches which you can use to determine the daytime. You can obtain the hour by using "$game_system.ates.time.hour" (without the double quotes).
Your best idea would be to assign the value to a variables (using "$game_variables[ID_NUMBER] = $game_system.ates.time.hour") and adding that to the event's precondition.

Thanks!  That sounds like a good idea, and it actually makes sense to me.
This helps a lot :)
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on October 12, 2008, 03:52:23 PM
Sounds good, I been struggling with DDNS so I'm looking for something new to try, this one should be sweet.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 13, 2008, 10:49:58 AM
Yeah. Just too bad WcW left and didn't have time to improve my basic version. =/
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on October 17, 2008, 01:57:35 PM
...I'm probably gonna replace this with a system called "Hyperion" soon.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 17, 2008, 02:56:23 PM
Hyperion is the name of the second spaceship of the main villain in CP. :P
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on October 17, 2008, 05:12:02 PM
Hyperion is also a Greek god, father of the Sun and Moon. The "sun" and "moon" effects are created by this script. Seemed an apt name to me.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 17, 2008, 05:47:50 PM
Hm, interesting. I knew that Hyperion was a god or something, but I didn't know he was the god of "sun and moon". Good idea for the system.
Title: Re: [XP] Advanced Time and Environment System
Post by: ali madan on October 18, 2008, 09:22:19 AM
sorry but I can't figure out where's the downlaod link
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 18, 2008, 01:34:24 PM
Good you noticed. This post seems to have been damaged during the move. =/ I restored it.
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 27, 2008, 10:23:19 PM
Look in the script. Day and Night trigger switches which you can use to determine the daytime. You can obtain the hour by using "$game_system.ates.time.hour" (without the double quotes).
Your best idea would be to assign the value to a variables (using "$game_variables[ID_NUMBER] = $game_system.ates.time.hour") and adding that to the event's precondition.

I really don't understand this statement lol...I want to make it so that i.e. a certain person may be in a certain place in a certain time frame.  Or they may say different things at different times in the day.  Can you tell me how to do that?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 27, 2008, 10:54:03 PM
(http://img135.imageshack.us/img135/3055/snap281db4.th.png) (http://img135.imageshack.us/img135/3055/snap281db4.png) (http://img259.imageshack.us/img259/1010/snap282rz4.th.png) (http://img259.imageshack.us/img259/1010/snap282rz4.png) (http://img368.imageshack.us/img368/7196/snap283es3.th.png) (http://img368.imageshack.us/img368/7196/snap283es3.png)

This will make the girl be there only between 8:00 and 20:00. I'm sure that you know how to use the conditional branch event command. Just do it the same way there.
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 27, 2008, 11:18:10 PM
(http://img135.imageshack.us/img135/3055/snap281db4.th.png) (http://img135.imageshack.us/img135/3055/snap281db4.png) (http://img259.imageshack.us/img259/1010/snap282rz4.th.png) (http://img259.imageshack.us/img259/1010/snap282rz4.png) (http://img368.imageshack.us/img368/7196/snap283es3.th.png) (http://img368.imageshack.us/img368/7196/snap283es3.png)

This will make the girl be there only between 8:00 and 20:00. I'm sure that you know how to use the conditional branch event command. Just do it the same way there.

Ok i followed your directions but I get a Syntax error now when i press new game

EDIT

Ok let me tell you what i did....My game hour variable is set on number 0500 so i set my parallel process to run the script as...

$game_variables[0500] =
$game_system.ates.time.hour

Then i set a bat on the map to only show up when variable 0500 = 12, but then the second page it makes him invisible when the var = 20

So i created an event that advances time 12hrs when i step on it (this was to test the system) but when my time is advanced to 12:00 the bat still doesn't show up
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 27, 2008, 11:30:35 PM
No, NOT with leading zeroes. Leading zeroes convert your number into the octal system making it 320 in the decimal system. -_-
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 27, 2008, 11:52:06 PM
Yea, see i set the bat to show up at like, let's say 1 and vanish at 6....even if I switch those two numbers of when he shows/vanishes, he repeatedly keeps showing up at 8.  Why is that?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 28, 2008, 12:30:22 AM
I'm not sure as I haven't tested it myself.
Keep in mind that if the condition of a higher page is valid, then the higher page will be displayed as it has priority. Maybe it's that?
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 28, 2008, 04:19:54 AM
I'm not sure as I haven't tested it myself.
Keep in mind that if the condition of a higher page is valid, then the higher page will be displayed as it has priority. Maybe it's that?

Hmm, well i don't think that is it, but I made you some screens so you can see what's going on

(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: Aqua on October 28, 2008, 04:30:47 AM
Just to let you know, the way you named your event, the monster id 1 will ALWAYS be on the map when the event is present, it just might not be visible.

To fix it, you should get rid of \e[1] from the name, then on page 1 with the bat graphic, set it to parallel process and have:

Code: [Select]
$game_map.rename_event(EVENT_ID, '\\e[1]')
Note that the 2 backslashes are important.
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 28, 2008, 06:10:20 AM
Just to let you know, the way you named your event, the monster id 1 will ALWAYS be on the map when the event is present, it just might not be visible.

To fix it, you should get rid of \e[1] from the name, then on page 1 with the bat graphic, set it to parallel process and have:

Code: [Select]
$game_map.rename_event(EVENT_ID, '\\e[1]')
Note that the 2 backslashes are important.

Ok thanks for the heads up, but will this fix my time problem?

and do I need to replace EVENT_ID with something?

I really think this may some sort of bug in the script.  I don't see why in the hell it won't do what i'm trying to get it to do  :???: lol.  I mean sometimes if i set the variable on the first page to 6, the sprite set to show up doesn't show up until 8, almost like 2 hours late.  I had thought that to be some kind of bug and tested it seeing if it would vanish at 20 if set at 18 and it did, then when i tested with new numbers it wouldn't work....actually it either didn't appear at all, or wouldn't vanish.  It's really aggravating.  And i can't set an event on parallel process all the time especially if i need that event to be triggered by the players button....like talking to a character. 

Also Blizz i tried the variable numbers you showed me in your screenshots.  Well Shot one shows the sprite appearing at Var. 8 and vanishing at 20, well when i tested that, the sprite didn't appear till 20 and then vanished at 8.  Could i be doing something wrong? or is there a bug in this script?

I also tired eraseing the second page and putting the sprite to show up at 1 and guess what? It showed up at 20!!! I mean like wtf?!? it didn't even have anything to do with the number 20 lol.  So no matter what number i set the page to make the sprite vanish, it always vanishes at 20.  So i've gone into the script and found that night begins at 20, so i changed that to 22 to test if that had something to do with it and my sprites began vanishing at the number 22 instead of 20.

And Blizz if you read this, I put some screenshots on the post before this one

I'm sorry for the constant edits and long post, but IF it's a bug then I wanted to make sure I get across all the facts I found towards it.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 28, 2008, 02:02:24 PM
Weel, first off, your third screenshot's event uses variable number 1 instead of 500 and secondly, the "Through" option is not activated.
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 28, 2008, 04:47:54 PM
Yea i know, i realized that.  You see I had made 2 variables for game hour by accident, but even so i corrected that and had the same issues.  I even used the through option.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 28, 2008, 05:09:43 PM
Alright, I can't see any mistakes on your side anymore so there might be a problem. I'll look into it as soon as I can.
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 28, 2008, 09:27:07 PM
Alright, I can't see any mistakes on your side anymore so there might be a problem. I'll look into it as soon as I can.

There's no hurry lol.  I just wanted to give my game a cool system where i can havfe certain times made for certain events, but it's really not a big deal, I can just make them start 20 = Night and 12/8 = Day and have the events set to work at day OR night.  But i just thought you guys should know about the problem
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 30, 2008, 01:52:19 AM
Ok, so is there a call script i can use to hide the clock in the upper right corner?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on October 30, 2008, 02:39:17 AM
Code: [Select]
$game_system.show_clock =
false
Title: Re: [XP] Advanced Time and Environment System
Post by: Vein Pyroclasm on October 30, 2008, 03:28:33 AM
Code: [Select]
$game_system.show_clock =
false

Thanks Blizz
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on December 30, 2008, 04:28:17 PM
i have a little prob, when i enter a new map and disable the tint at night it works fine but when i leave that map and turn the tint back on there is a small delay from when you enter that map to the tint taken place. is there a way to make it look more fluid when you enter a new map.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on December 30, 2008, 04:56:46 PM
It's probably a bug.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on December 30, 2008, 09:20:21 PM
can it be fixed
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on December 31, 2008, 01:36:29 PM
Of course. Every bug can be fixed. :P I just have to find some time to do so.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on December 31, 2008, 04:25:58 PM
ok, thanks blizz
Title: Re: [XP] Advanced Time and Environment System
Post by: Exiled_by_choise on January 09, 2009, 03:53:14 AM
Hi i added this script into my game but it wont work. At the start of the game it turns on and the clock shows up but the clock doesn't have the time and there is no change in the environment and no day and night.

Can you help??
Title: Re: [XP] Advanced Time and Environment System
Post by: Aqua on January 09, 2009, 03:56:01 AM
Read the instructions...
It is off by default; gotta turn it on.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on January 09, 2009, 01:19:03 PM
has that bug i get been fixed yet
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 09, 2009, 01:19:55 PM
No. I didn't have time to look into it yet.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on January 10, 2009, 11:29:54 PM
thats fine, i was just wondering.
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 11, 2009, 03:44:58 PM
just wondering..what bug?

the turn tint on when you change lvl?
fixed it.

use this in the event you wane use for changing lvl

(click to show/hide)

i think u can change this yourself to the stuff that works for you :P
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 11, 2009, 04:26:21 PM
i have a little prob, when i enter a new map and disable the tint at night it works fine but when i leave that map and turn the tint back on there is a small delay from when you enter that map to the tint taken place. is there a way to make it look more fluid when you enter a new map.
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 11, 2009, 04:40:17 PM
in that case use:
(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 11, 2009, 06:23:11 PM
Then it's not a bug. :D BTW, is the waiting command necessary?
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 11, 2009, 08:04:32 PM
Strange enough yes.

the tint will get applied to the next frame... so you need to wait 1 frame before its get applied... strange thing
but you won't see it that he is waiting 1 frame.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 11, 2009, 08:38:16 PM
I think I know why this bug is happening. I'll fix it anyway.

EDIT: Fixed.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 11, 2009, 08:30:22 PM
i get this error

(click to show/hide)

bump
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 13, 2009, 09:44:44 PM
New game or saved game? What did you do to cause it? Are your scripts in the right order? (Lol, who am I asking?! xD) Do you have the clock turned on or off?
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 13, 2009, 10:32:59 PM
the clock is turned off when i get the error (i havent tried is with in on yet)

its a new game and i have no save files any way

and yep my scripts are in the right order ( i check all the time)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 13, 2009, 10:56:22 PM
The order question was rhethorical. xD I'll look into it in a couple of minutes. Expect v0.32 in a few minutes then.

EDIT: Done.

@WcW: Are you gonna continue working on this?
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 13, 2009, 11:21:34 PM
new error, 
(click to show/hide)

Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 13, 2009, 11:28:18 PM
I think that you didn't copy the script properly or that you got a cached version. Press F5 in the window where you usually copy the script to paste it into your window editor. It clearly takes 2 arguments in the version I uploaded. Only my dev version has a 5 argument constructor.
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 13, 2009, 11:42:11 PM
nope i copied it correctly, and i pressed F5 but all it does is it goes to the next script.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 13, 2009, 11:46:53 PM
Can you post the ATES you are using? Something's wrong here.
Title: Re: [XP] Advanced Time and Environment System
Post by: nathmatt on April 14, 2009, 08:18:27 PM
I just tried out the script and whenever I have it turn on with
Call Script: ATES.on
I end up with ArgumentError on line 353
"wrong number of arguments(5 for 2)"

It would seem line 353 is:
      ATES.advance(1, 0, 0, 0, 0) if @frame_count % (ATES::LENGTH / 36) == 0

When I change it to:
      ATES.advance(1, 0) if @frame_count % (ATES::LENGTH / 36) == 0
Then it works without any problems
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 14, 2009, 08:25:03 PM
im using the one in the download link

here

(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: nathmatt on April 14, 2009, 08:38:20 PM
do what i said in my last post will fix it
Title: Re: [XP] Advanced Time and Environment System
Post by: Shadonking on April 14, 2009, 10:30:03 PM
okay i'll try, i didnt see your email (which is wierd becuase i should have)

edit

it works thanks, also where do i change it so it counts in 1 sec at a time becuase it does 2 (i know it can be done its just its late and my brain is turned off)
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 04, 2009, 12:24:48 PM
new error, 
(click to show/hide)

Well you locked the other thread and told me to come here, but I tried this new script and its giving me errors :S

Same one as above, I copied it properly, ordered it the way you said in your script order thread, started a new game and made an event to call script: ATES.on

Error points to this block of code:

Code: [Select]
      @frame_count += 1
      ATES.advance(1, 0, 0, 0, 0) if @frame_count % (ATES::LENGTH / 36) == 0
    end

Other then changing the day switch to 1 and night switch to 2, i didnt change anything else <_<

Please help, so far I prefered your DDNS, it actually worked :P
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 04, 2009, 01:23:50 PM
1.

Quote
# Compatibility:
#
#   99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old
#   savegames.
Can cause incompatibilty issues with DNS-es.

2. If you don't post the error message, I can't do shit.

3. If you give me a block of code, I can't do shit either because there could be half a million reasons in just 5 lines of code. The error ALWAYS points to 1 line. Not more, not less.
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 04, 2009, 01:45:47 PM
The error was in the spoiler, and i did start a new game 0.0 Are you ok, I havent posted any problems in a wile and you act like I bug you all the time, im sorry...

I linked the other guys screenshot cause it was the same as mine:

(click to show/hide)

And I used the newest version of it, I removed the old ddns, I dont know what other info I can provide you, im really sorry if I bothered you.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 04, 2009, 02:20:45 PM
I'm sorry. My day practically just started and it's already been a rough one. -_- And a few minutes ago I found out that I have 2 weeks to make an application that will consume at least 20 working hours while I have a blitz-exam at friday, I have to finish my hands-on seminar till monday and next week are exams. Plus I have to finish the demo of "Shaman" for the publishers and I need to learn for the exams actually. And I bet I forgot something on this list. All of that would have been fine if I didn't have to make that f*cked up application for the course "Development of Information Systems". >:/ Man, I hate that professor.

The solution is basically what nathmatt said a few posts before. Or you can redownload the script, I put up v0.33.
Again, sorry for being rude. -_-
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 04, 2009, 02:52:28 PM
Sorry to hear about your day, I tried the new script and it seems to work now but all your other scripts are going funny on me now...

The lagless hud from tons is showing up even when I set it to hide and stormtronics now crashes, ughh i'll try to solve this on my own, I guess I have to redownload every scripts newest version again <_<

I hope you have a better day and im sorry to bug you, some things are just more important then games :P
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 04, 2009, 03:32:26 PM
Thanks. And yeah, updating the versions of my scripts would be a good idea. xD
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 05, 2009, 01:13:52 AM
Well everything works now cept for 1 thing, I cant get the clock to show and hide, I am using the command mentioned a few posts ago and it is also the same one I used in the older version:

Code: [Select]
$game_system.show_clock = true
Code: [Select]
$game_system.show_clock =
false

Am I sappose to use something else now, what is it?

Oh and I love the new tinting, best ddns system out there ^_^
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 05, 2009, 09:45:05 AM
I forgot to make that work properly. I uploaded v0.34. You can do it either this way or with the new commands ATES.clock_on and ATES.clock_off.
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 05, 2009, 09:55:27 AM
I like the new commands better :)

Oh no :(

Syntax Error:

Code: [Select]
  def draw<
    self.bitmap.clear
    hours = $game_system.ates.time.hour
    minutes = sprintf('%02d', $game_system.ates.time.min)
    if @odd % 2 == 0
      self.bitmap.draw_text_full(0, 0, 128, 32, "#{hours} #{minutes}", 2)
    else
      self.bitmap.draw_text_full(0, 0, 128, 32, "#{hours}:#{minutes}", 2)
    end
    @odd = (@odd + 1) % 2
  end
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 05, 2009, 10:33:21 AM
Lol, I think you messed up. It should be "def draw" there.

EDIT: Or I did. #_# Fixed.
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 05, 2009, 10:49:59 AM
Thanks for puttin in the extra work, its perfect now, I only got 1 question, is there a way to turn overlighting on and off through an event? I got my own season system and i dont want overlighting to happen during winter.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 05, 2009, 01:59:32 PM
Actually ATES was supposed to be a system that can handle seasons so they would be season controlled. No, there is no way to turn it off now.
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 05, 2009, 11:51:06 PM
still working on it then :P sounds awesome
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 06, 2009, 03:23:53 PM
Actually WcW was supposed to finish it. ._.;
Title: Re: [XP] Advanced Time and Environment System
Post by: Mightylink on May 07, 2009, 05:09:21 AM
Oh well, I got a pretty good evented system going, I just need a way to run a common event every day.
Title: Re: [XP] Advanced Time and Environment System
Post by: Valcos on May 12, 2009, 05:13:53 AM
Well... think someone should finish it :^_^':. Its a good system, just want those cool features :naughty:

Edit: Just realized... theres no weather in this. I thought that was updated already -_-"
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 14, 2009, 12:21:47 PM
It says v0.3x. :P
Title: Re: [XP] Advanced Time and Environment System
Post by: Darok on May 16, 2009, 02:09:17 AM
Does it works with your StormTronics CMS - Hybrid Edition? Becouse with my ex-CMS does not. (Im talking about showing the date in menu)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 16, 2009, 10:08:06 AM
This system does not have a calender subsystem added yet.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on May 16, 2009, 11:31:47 PM
...I really, really need to get something done for this.

But note that my version will be named Hyperion, not ATES (too close to something you'd find in FF).
Title: Re: [XP] Advanced Time and Environment System
Post by: Valcos on May 17, 2009, 05:41:43 AM
Hyperion ATES? And looking for to a update  :<_<:
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on May 17, 2009, 03:32:46 PM
Hyperion = Greek father of the Sun and Moon, IIRC. Seems fitting for a system dedicated totally to Day/Night/Time effects.
Title: Re: [XP] Advanced Time and Environment System
Post by: Valcos on May 17, 2009, 04:46:53 PM
So, im guessing you are going to put in any weather effects? :huh:
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 18, 2009, 10:59:00 AM
Even though Chronos would suit better because it's supposed to be a complete time system with calender and stuff. :/
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on May 18, 2009, 07:30:38 PM
Even though Chronos would suit better because it's supposed to be a complete time system with calender and stuff. :/

I'm not entirely sure his role dealt that much with time.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 19, 2009, 10:41:32 AM
Tempus/Tempos maybe? I still like ATES better because most people don't know Greek or Roman mythology. "Name a system after what's it doing." I always hated bullshit names like "Blitz". I mean WTF. WTF is an "Blitz"?! Sure, it sounds nice, but you have absolutely no idea what it does. Or "Advanced Files". What files? There are many files in RMXP. Maybe character graphics? What's advanced about them? Or what about "Map Auto-Setup"? WTF does one need that for? Is it supposed to substitute a parallel process at the beginning of the map (which is dumb)? Or is it supposed to do something else. (Ok this last example is more an example of dumb scripts than dumb names, but my point remains valid.)
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on May 19, 2009, 02:51:37 PM
What WOULD Blitz do? How would lightning involve RMXP? 0_O
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 19, 2009, 09:00:59 PM
I have no idea. And I honestly don't wanna know.
Title: Re: [XP] Advanced Time and Environment System
Post by: legacyblade on May 19, 2009, 09:21:51 PM
I agree with the script name thing. Like Blitz? WTF...

Though I did think the same thing when I saw the script name "DREAM" (until I looked at what the abbreviation meant). I think if you're going to use a greek god for the title, you should use Cronos (or whatever the real spelling of that name is). Most people are familiar with that name, but the other name? I had never heard of him.
Title: Re: [XP] Advanced Time and Environment System
Post by: Valcos on May 20, 2009, 06:22:53 AM
How bout we name it after its finished :roll:
Title: Re: [XP] Advanced Time and Environment System
Post by: King Munkey on May 20, 2009, 06:44:14 AM
With a finished product you know what it can do and what it cannot do then that way you can name it accordingly.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on May 20, 2009, 04:16:16 PM
Well, it has the specs so I chose a name according to it even though the "Environment" and the "Advanced" part isn't supported in 0.3x. ._.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 01, 2009, 08:38:05 PM
Oh, yeah. I've got a lot of work done on this now, guys, btw. Calendar is implemented through months (as in, it has days, weeks, and named months with differing days), and clock is fully implemented (configurable number of seconds in a minute, minutes in an hour, and hours in a day, as well as configurable names). I'm working on optimizing and getting actually useful stuff (ie the effects) ready, then I'll release it.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 01, 2009, 08:46:52 PM
Nice work. What about generated temperatures, seasons and bad weather probability?
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 01, 2009, 08:57:32 PM
That will be added in when I implement the Weather module (right now I only have Clock and Calendar, both of which are working perfectly)

Right now, I'm planning on implementing Weather by having the user be able to set different periods -- for example, have Summer generally be hotter and Winter generally be colder by setting which day of which month each season starts and what kind of season it is, then blending season together (ie summer cools back down to the upper 70s nearing Fall), then having El Nina/El Nino like situations, etc. On top of all that I'll have randomly-generated weather. Of course, I'll also have to add stuff like beginning and ending temperatures for the day and ways to make that change based on location (ie deserts have much higher temperatures than everywhere else during the day, as well as much colder nights). This'll be a LOT of work.
Title: Re: [XP] Advanced Time and Environment System
Post by: Aqua on June 01, 2009, 11:03:01 PM
Oh, yeah. I've got a lot of work done on this now, guys, btw. Calendar is implemented through months (as in, it has days, weeks, and named months with differing days), and clock is fully implemented (configurable number of seconds in a minute, minutes in an hour, and hours in a day, as well as configurable names). I'm working on optimizing and getting actually useful stuff (ie the effects) ready, then I'll release it.
That will be added in when I implement the Weather module (right now I only have Clock and Calendar, both of which are working perfectly)

Right now, I'm planning on implementing Weather by having the user be able to set different periods -- for example, have Summer generally be hotter and Winter generally be colder by setting which day of which month each season starts and what kind of season it is, then blending season together (ie summer cools back down to the upper 70s nearing Fall), then having El Nina/El Nino like situations, etc. On top of all that I'll have randomly-generated weather. Of course, I'll also have to add stuff like beginning and ending temperatures for the day and ways to make that change based on location (ie deserts have much higher temperatures than everywhere else during the day, as well as much colder nights). This'll be a LOT of work.

*drools*
It'll be soooo fun to make up holidays and seasons...

Can't wait :D
Title: Re: [XP] Advanced Time and Environment System
Post by: Calintz on June 01, 2009, 11:27:35 PM
It really sounds like this script has come a long way.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 01, 2009, 11:59:53 PM
Very nice. Just be sure to have Celsius temperature as well if you use Fahrenheit as default.
Title: Re: [XP] Advanced Time and Environment System
Post by: Calintz on June 02, 2009, 04:29:13 AM
You really think when you create scripts, don't you Blizzard?
Title: Re: [XP] Advanced Time and Environment System
Post by: Valcos on June 02, 2009, 06:15:34 AM
(ie summer cools back down to the upper 70s nearing Fall)

 :o WHAT THE EFF!!! 70!! WE ARE ALL GONNA DIE!!!

*drools*
It'll be soooo fun to make up holidays and seasons...

Can't wait :D

I second that  8)
Title: Re: [XP] Advanced Time and Environment System
Post by: Calintz on June 02, 2009, 06:31:49 AM
Before you get too excited ...
Remember that you will need to make seasonal adjustments to each tileset that you actively use before you can design fully functional season changes for your game ... This would be hard considering you would be adding snow to them, and leaves all over and what not.

I don't know how the script works, but I would assume that a common event or two would probably need to be made to help the efficiency ... (could be wrong)

And not to mention setting the 4separate teleport locations to make sure you are arriving in the proper location, Lol.

**OR ... Have you considered adding a tileset updater WCW??
Like, when the script updates the current season, it will also automatically update each tileset accordingly.

You could do it like so ...
Create your custom tilesets and name them accordingly.
 Example - [013-PostTown01_Summer, 013-PostTown01_Fall, 013-PostTown01_Winter, 013-PostTown01_Spring].

Allow the script to update the tileset along with the season.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 02, 2009, 09:46:21 AM
You really think when you create scripts, don't you Blizzard?

I generally think when I program. Very often I type down some code and go through it a few times checking if it's conceptually ok. When I make 5-10 pieces of code at different positions and in different classes that are properly thought through and checked properly, it often happens that I don't only have no syntax errors but the code works fully from the first try.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 02, 2009, 09:14:52 PM
Lol, exact opposite of me.

And didn't I respond to the celsius comment above...? Oh well. And 70F is only around 20C, sheesh.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 02, 2009, 09:54:17 PM
Yeah, but 0°F isn't -50°C. :/

I used to prefer "hack-testing" earlier as well. Today I only use it to quickly identify small mistakes as mistyped variable/class names and small syntax errors but never for conceptual mistakes.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 03, 2009, 06:03:42 PM
You're right. 0F is between -15C and -20C. (5/9)(F - 32), anyone?
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on June 04, 2009, 09:16:22 AM
Fahrenheit is not really a great way to display a temperature (am a chemist.. i know it)
because its really strange how Gabriel Fahrenheit thought it up.
(the freezing point of water is 32 °F and the boiling point 212 °F ) I don't see the logic
its also hard to calculate to a easy understandable notation

be ready for some math:

to kelvin:
[K] = ([°F] + 459.67) × 5⁄9
[°F] = [K] × 9⁄5 − 459.67

to Celsius:
[°C] = ([°F] − 32) × 5⁄9
[°F] = [°C] × 9⁄5 + 32
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 04, 2009, 09:59:22 AM
It's just important that WcW decides how he will store it and that he adds an interface so it can get and set the temperature in °C properly. An option for which scale to use would be useful.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 04, 2009, 03:07:20 PM
Fahrenheit is not really a great way to display a temperature (am a chemist.. i know it)
because its really strange how Gabriel Fahrenheit thought it up.
(the freezing point of water is 32 °F and the boiling point 212 °F ) I don't see the logic
its also hard to calculate to a easy understandable notation

be ready for some math:

to kelvin:
[K] = ([°F] + 459.67) × 5⁄9
[°F] = [K] × 9⁄5 − 459.67

to Celsius:
[°C] = ([°F] − 32) × 5⁄9
[°F] = [°C] × 9⁄5 + 32

Err... Kelvins from Fahrenheit is (5/9)(F - 32) + 273, if I'm not mistaken... Just convert to Celsius then add 273. 0_o
Therefore, to get there from Kelvins, it's (9/5)(K - 273) + 32. It's not that hard, just one extra step. If you find adding/subtracting 273 hard, I have to question your merits as a chemist.

Note that I am not defending customary units, I'd much rather use metric. Sadly 'nuff, I live in the states :/

And Celsius is just as inferior to Kelvins as Fahrenheit are. I mean, -273 degress C is really stupid for an "absolute zero" measure as opposed to an actual 0K.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 04, 2009, 04:20:40 PM
But it's more practical. How often do you have something at 0°K? And how often do you have something on 0°C? Kelvin are mostly used in physics and not so much in normal life.
Title: Re: [XP] Advanced Time and Environment System
Post by: fugibo on June 04, 2009, 05:22:16 PM
Meh, good point. But I still don't see the point in defining the temperature in Fahrenheit or Celsius when the user can just decide on the ranges and give it a name :/
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on June 04, 2009, 06:20:40 PM
Translation AND scaling, please. :P
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on June 04, 2009, 09:16:52 PM
more added it this way because of the standard calculations I know.
ofc its probably more easy to calculate K first from F to C and than - 273
but K was more an extra... should not be added because its only really used in the science

F and C are the important 1
Title: Re: [XP] Advanced Time and Environment System
Post by: Zare on October 31, 2009, 10:01:13 PM
Hey i would like to know if someone could make a menu window with the time in it instead of the timedisplay on the map.
i thought of something like this (clock instead of playtime window)

this is the playtime window

(click to show/hide)

now how do i replace the playtime with the clock??

plz help^^ (sorry if this is necropost...)

EDIT: Ok i found the solution in the help section

http://forum.chaos-project.com/index.php?topic=4626.0

Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on November 18, 2009, 01:32:27 AM
Would it be possible to script something that stops time while text windows are being displayed, just like how time stops when the player opens the menu?

I really don't want to script command ATES.on and ATES.off before and after every bit of text.
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on November 18, 2009, 03:17:17 AM
without a lot of edits in the code of RMXP self you need to stick with the ATES.on and ATES.off before and after every bit of text.
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on November 18, 2009, 07:55:13 AM
That is sad to hear.  :(

Oh well.  This script is great, btw.  I love it.   :haha:
Title: Re: [XP] Advanced Time and Environment System
Post by: Aqua on November 18, 2009, 11:58:55 PM
Nah uh... o.o
You'd just have to edit the method that draws the text boxes.
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on November 19, 2009, 01:54:00 AM
tryed. could not get it to work (probably cause I'm crap at scripting)
Title: Re: [XP] Advanced Time and Environment System
Post by: ShinyToyGuns on November 19, 2009, 03:06:49 AM
I've encountered a glitch with this script...When I enter the menu, it keeps the time clock on, and when I exit the menu, it has a frozen time behind the current time.
Example:
(click to show/hide)
I've also made a few minor changes to the script, I don't know if that, or one of the other scripts I'm using could be affecting the way it works?

Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Advanced Time and Environment System (ATES) by Blizzard
# Version: 0.34
# Type: Autonomous Timeflow and Environment Controller
# Date v0.3: 11.3.2008
# Date v0.31: 8.4.2009
# Date v0.32: 13.4.2009
# Date v0.33: 4.5.2009
# Date v0.34: 5.5.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#   99% compatible with SDK v1.x. 90% compatible with SDK 2.x. WILL corrupt old
#   savegames. Can cause incompatibilty issues with DNS-es.
#
#
# Features:
#
#   - complete control over and easy manipulating of time
#   - nice day and night tinting
#   - HUD clock optional
#   - easier to control and more powerful than DDNS
#
#
# IMPORTANT NOTES:
#
# - This system has a working preconfiguration, be aware that a custom setup
#   will need you to understand what each option does, so please read the
#   configuration instructions.
# - Why does this system use switches to determine whether it's day or night?
#   Simple: You can use conditions in enemy attacks to determine whether an
#   attack should be used only at night or only at day.
#
#
# Instructions:
#
# - Explanation:
#
#   This Time System will make your game have daytime and nighttime periods.
#   The screen will be tinted accordingly. You can set up the length of the
#   day. Other features are explained below. Please be sure to configure this
#   system appropriately.
#
#
# - Basic manipulation of ATES:
#
#   This system is based upon your eventing. It will work basically if you
#   want, but with a little bit of using the "Call Script" event command you
#   are able to control this system fully. You can call following commands:
#
#     ATES.on
#   Turns ATES on.
#
#     ATES.off
#   Turns ATES off.
#
#     ATES.tint_on
#   Turns ATES's screen tinting on.
#
#     ATES.tint_off
#   Turns ATES's screen tinting off.
#
#     ATES.clock_on
#   Turns ATES's clock display on.
#
#     ATES.clock_off
#   Turns ATES's clock display off.
#
#     ATES.active?
#   Returns true if ATES is turned on, otherwise false.
#
#     ATES.tinting?
#   Returns true if ATES tinting is turned on, otherwise false.
#
#     ATES.day?
#   Returns true if it's day, otherwise false. Alternatively you can check the
#   assigned switch instead.
#
#     ATES.night?
#   Returns true if it's night, otherwise false. Alternatively you can check
#   the assigned switch instead.
#   
#     ATES.advance(M, H)
#   This will make the time advanced by M minutes and H hours. Any negative
#   value used will cancel the execution of this command.
#   
#     ATES.make_it_day
#   This is a feature from DDNS which allows you to quickly jump to the
#   daytime.
#   
#     ATES.make_it_night
#   This is a feature from DDNS which allows you to quickly jump to the
#   nighttime.
#   
#
# - Enhancement hints:
#
#   If you wish to implement the DDNS further into your game and e.g. allow
#   different behavious of monsters during day and night, you only need to
#   check the the state of the appropriate switch. e.g. If NSWITCH is turned
#   on inflict "Sleep" on one enemy.
#
#
# Additional info:
#
#   The daytime and nighttime tintings were tested appropriately and optimal
#   tinting is being used.
#   Keep in mind that ATES is initially turned off, you need to turn it on by
#   using the ATES.on and ATES.tint_on commands together.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

module ATES
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # switch ID of the "day" switch
  DSWITCH = 51
  # switch ID of the "night" switch
  NSWITCH = 52
  # length of a day in seconds in-game, can't be less than 36, is being
  # quantized into intervals of 36 seconds
  LENGTH = 1440
  # how much time is it when the "day" starts
  DAY_START = 8
  # how much time is it when the "night" starts
  NIGHT_START = 20
  # makes the screen brighter during "summer" days
  OVERLIGHTING = true
  # makes the screen darker during the night, not recommended
  OVERDARKENING = false
  # display HUD clock
  SHOW_CLOCK = true
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  $ates = 0.34
 
  #============================================================================
  # ATES::Time
  #============================================================================
 
  class Time
   
    attr_accessor :min
    attr_accessor :hour
   
    def initialize(m, h)
      @min, @hour = m, h
    end
   
  end
 
  def self.on
    $game_system.ates.active = true
    return true
  end
 
  def self.off
    $game_system.ates.active = false
    return true
  end
 
  def self.tint_on
    $game_system.ates.tinting = true
    return true
  end
 
  def self.tint_off
    $game_system.ates.tinting = false
    return true
  end
 
  def self.clock_on
    $game_system.show_clock = true
    return true
  end
 
  def self.clock_off
    $game_system.show_clock = false
    return true
  end
 
  def self.active?
    return $game_system.ates.active
  end
 
  def self.tinting?
    return $game_system.ates.tinting
  end
 
  def self.day?
    return ($game_system.ates.time.hour.between?(DAY_START, NIGHT_START - 1))
  end
 
  def self.night?
    return ($game_system.ates.time.hour.between?(DAY_START, NIGHT_START - 1))
  end
 
  def self.make_it_day
    $game_system.ates.time.hour = DAY_START
    $game_system.ates.time.min = 0
    return true
  end
 
  def self.make_it_night
    $game_system.ates.time.hour = NIGHT_START
    $game_system.ates.time.min = 0
    return true
  end
 
  def self.day_start
    return DAY_START
  end
 
  def self.night_start
    return NIGHT_START
  end
 
  def self.advance(m, h)
    return false if [m, h].any? {|i| i < 0}
    h += ($game_system.ates.time.min + m) / 60
    $game_system.ates.time.min = ($game_system.ates.time.min + m) % 60
    $game_system.ates.time.hour = ($game_system.ates.time.hour + h) % 24
    return true
  end
 
end

if ATES::DAY_START > ATES::NIGHT_START
  raise 'ATEScfgError: A night can\'t start earlier than a day.'
elsif ATES::LENGTH < 36
  raise 'ATEScfgError: A day\'s length must be equal to or greater than 36 seconds!'
end

#==============================================================================
# Game_System
#==============================================================================

class Game_System
 
  attr_accessor :ates
  attr_accessor :show_clock
 
  alias init_ates_later initialize
  def initialize
    init_ates_later
    @ates = Game_ATES.new
    @show_clock = ATES::SHOW_CLOCK
  end

end

#==============================================================================
# Game_ATES
#==============================================================================

class Game_ATES
 
  attr_accessor :active
  attr_accessor :tinting
  attr_accessor :time
  attr_accessor :frame_count
 
  def initialize
    @time = ATES::Time.new(0, 8)
    @active = true
    @tinting = true
    @frame_count = 0
  end
 
  def get_tint
    red = 0
    green = 0
    blue = 0
    grey = 0
    if ATES.day?
      red = green = 0
      day = ATES.day_start
      night = ATES.night_start
      ratio = ((@time.hour-day)*60+@time.min) * 255 / (60*(night-day))
      if ratio >= 224
        red = (232-ratio)*4
        green = (208-ratio)*2
      elsif ratio >= 192
        red = ratio-192
        green = 192-ratio
      elsif ATES::OVERLIGHTING
        if ratio >= 160
          red = green = blue = 192-ratio
        elsif ratio >= 96
          red = green = blue = 32
        elsif ratio >= 64
          red = green = blue = ratio-64
        end
      end
    else
      red = green = -96
      day = ATES.day_start
      night = ATES.night_start
      hour = (@time.hour >= night ? @time.hour : @time.hour+24)
      ratio = ((hour-night)*60+@time.min) * 255 / (60*(day+24-night))
      if ratio >= 224
        red = (ratio-256)*2
        green = (ratio-256)*2
        blue = 255-ratio
      elsif ratio >= 192
        red = ratio-288
        green = ratio-288
        blue = ratio-192
      elsif ATES::OVERDARKENING
        if ratio >= 160
          red = ratio-288
          green = ratio-288
          blue = ratio-192
        elsif ratio >= 96
          red = -128
          green = -128
          blue = -32
        elsif ratio >= 64
          red = -32-ratio
          green = -32-ratio
          blue = 64-ratio
        end
      end
    end
    return Tone.new(red, green, blue, grey)
  end
 
  def update
    if @active
      @frame_count += 1
      ATES.advance(1, 0) if @frame_count % (ATES::LENGTH / 36) == 0
    end
    if ATES.day?
      $game_map.need_refresh = true if $game_switches[ATES::NSWITCH]
      $game_switches[ATES::DSWITCH] = true
      $game_switches[ATES::NSWITCH] = false
    else
      $game_map.need_refresh = true if $game_switches[ATES::DSWITCH]
      $game_switches[ATES::DSWITCH] = false
      $game_switches[ATES::NSWITCH] = true
    end
    $game_screen.start_tone_change(get_tint, 0) if @tinting
  end
 
end

#==============================================================================
# Bitmap
#==============================================================================

class Bitmap

  if $tons_version == nil || $tons_version < 1.6
    alias draw_text_shaded_later draw_text
  end
  def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
    if x2.is_a?(Rect)
      x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
    else
      x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
    end
    save_color = self.font.color.clone
    self.font.color = Color.new(0, 0, 0)
    [x-1, x+1].each {|xx| [y-1, y+1].each {|yy|
            draw_text_shaded_later(xx, yy, w, h, text, a)}}
    self.font.color = save_color
    draw_text_shaded_later(x, y, w, h, text, a)
  end
 
end

#==============================================================================
# Clock_Sprite
#==============================================================================

class Clock_Sprite < Sprite
 
  def initialize
    super
    self.x, self.y, self.z = 480, 8, 5000
    self.bitmap = Bitmap.new(128, 32)
    if $fontface != nil
      self.bitmap.font.name = $fontface
    elsif $defaultfonttype != nil
      self.bitmap.font.name = $defaultfonttype
    end
    self.bitmap.font.size = 26
    @odd = 0
    draw if $game_system.ates.active
  end
 
  def draw
    self.bitmap.clear
    hours = $game_system.ates.time.hour
    minutes = sprintf('%02d', $game_system.ates.time.min)
    if @odd % 2 == 0
      self.bitmap.draw_text_full(0, 0, 128, 32, "#{hours}:#{minutes}", 2)
    else
      self.bitmap.draw_text_full(0, 0, 128, 32, "#{hours}:#{minutes}", 2)
    end
    @odd = (@odd + 1) % 2
  end
   
end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
  alias main_ates_later main
  def main
    @clock = Clock_Sprite.new if $game_system.show_clock
    main_ates_later
    @clock.dispose unless @clock == nil
  end
 
  alias update_ates_later update
  def update
    $game_system.ates.update
    update_ates_later
    if $game_system.show_clock
      @clock = Clock_Sprite.new if @clock == nil
      @clock.draw if $game_system.ates.frame_count % 40 == 0
    elsif @clock != nil
      @clock.dispose
      @clock = nil
    end
  end
 
  alias transfer_player_ates_later transfer_player
  def transfer_player
    $game_system.ates.update
    transfer_player_ates_later
  end
 
end

The other scripts I'm using are:
Auto Font Install by Wachunga
Advanced Message Script by Dubealex
Zeriab's Questbook
Tons of Add-ons
Blizzard ABS
RO Job/Skill System
Blizz-ABS Party HUD by Winkio
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on November 19, 2009, 09:06:52 AM
looking at the screen it can be that you miss a refresh ore something in the script
Title: Re: [XP] Advanced Time and Environment System
Post by: ShinyToyGuns on November 20, 2009, 02:31:00 AM
looking at the screen it can be that you miss a refresh ore something in the script
in English please? :P (I'm not too script-saavy)
Title: Re: [XP] Advanced Time and Environment System
Post by: Alton Wyte on November 20, 2009, 06:23:31 AM
I may be new to these forums but I'm experienced with XP.
Im having a problem with my game(many actually) but one has to do with this.
 I set the screen tinting off and set it to my own color but the normal tinting is still there and at 5:08 or 5:12 it randomly switches from night to day with no transition. Help?
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on November 20, 2009, 09:32:31 AM
to ShinyToyGuns:

I'm unable to recreate your problem. i would suggest to look into using a different script order. try to put this script under all your other custom scripts. hope that will fix it.

to Alton Wyte:

you probably made some mistake in the editing of the script. if you can post your edit version so we can take a look at it
Title: Re: [XP] Advanced Time and Environment System
Post by: Alton Wyte on November 20, 2009, 10:16:56 AM

All I did was put in the configuration. And also I noticed at 6:30 it changes back to night and begins to fade to daytime.
(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: ShinyToyGuns on November 21, 2009, 02:38:04 AM
to ShinyToyGuns:

I'm unable to recreate your problem. i would suggest to look into using a different script order. try to put this script under all your other custom scripts. hope that will fix it.

OMG! you are a GOD!!! Thank you so much :D
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on November 21, 2009, 03:11:57 PM
to Alton Wyte:
Quote
All I did was put in the configuration. And also I noticed at 6:30 it changes back to night and begins to fade to daytime.

hearing the problem i think the problem lies in a other script that is causing errors with this 1.
can you write up the scripts you use?

to ShinyToyGuns:
Np m8. Most problems in scripts are always about script oreders
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on December 28, 2009, 07:47:42 PM
I posted up v0.4 which has a few small changes to the RMX-OS GDNS plugin can be shorter.
Title: Re: [XP] Advanced Time and Environment System
Post by: legacyblade on January 11, 2010, 12:56:29 AM
Is there a way to have different lengths of day based on what region you're in? My game takes place where two of the main areas are 3 latitude lines apart, which would cause a different length of day, as well as different tinting (one's tropical, one's more temperate). If that's not possible, it won't hurt the game much, but it'd really add to the immersion.
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 11, 2010, 03:54:41 AM
that's easy to do.. just needs some edits

I'm just wondering why you (the awesome guy that got me into scripting thanks to your class change script) can't do it?
I was thinking about adding an ats2 config
putting some "if" switches and it should work

anyway. if you want i can make it.. but not faster than next week (need to finish work rapport)
Title: Re: [XP] Advanced Time and Environment System
Post by: legacyblade on January 11, 2010, 05:00:06 AM
Well I could make it, it's just blizz knows the way through his script better than I do (his scripts are really complex), and it'd be easier if he knew how to do it off the top of his head. It's just when I try editing scripts, it usually appears to work, but then causes a bunch of bugs that I didn't notice at first (simply because I don't understand fully how the script works together).

And I guess I could make it myself, but if you wanted to, you could make it :D (I'm not being lazy, it's just I've got lots of homework now).

BTW, thanks for the comment about the class change script. Glad it helped you get you into scripting :)
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 11, 2010, 05:02:58 AM
to be fair.. that script is also the reason for me joining here.
so your the reason me doing scripts and joining this forum :P

Atm I can't do the script until next week.
will do it than if nobody else did it than already
Title: Re: [XP] Advanced Time and Environment System
Post by: legacyblade on January 11, 2010, 05:14:18 AM
sweet o.o I created a scripter!!! MWAHAHHAHAHAHAH

Well that's really nice of you to be willing to do that script addon for me. I'll try and do it myself, but I don't know if I'll have time. But if I don't do it, I (and I'm sure all sorts of other people) would be very grateful to you for doing it.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 11, 2010, 01:08:40 PM
Maybe I'll add that later. Or LF will if he finally decides to work on the script a bit. ;>_>
Title: Re: [XP] Advanced Time and Environment System
Post by: Ilitsa on January 16, 2010, 09:13:23 AM
Hi everyone, me again =x

I was wondering if someone could help me out with this script. I got it working just fine for the most part, just wanted a few things changed

length of day/night (I wanted it to last maybe 5 minutes? The way its set up default is something like 32 seconds for a full cycle) another issue I had was when I enter a building, I want to turn it off, so I call script and write ATES.off and thought that was it, but it kept scrolling through the tints, so I added ATES.tint_off, but now when I leave a building, the tint jumps to what it would be had I stayed outside.

I'm not sure if it would be easier to explain it to me here, or on msn, I'm a complete Scripting nubcake, so I might take a while before FULLY understanding(though I have made some good steps forward today, just by playing around)

Thanks in advance
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 16, 2010, 12:18:04 PM
The default is 36 seconds, not 32. The value has to be a divider of 36, so 300 is not possible. You can use 288 or 324. I did that limitation for a reason, but I can't remember what it was. >.<

If you turn off the tinting, there should be no change in screen tinting controlled by ATES at all.

There's also a demo.
Title: Re: [XP] Advanced Time and Environment System
Post by: Ilitsa on January 16, 2010, 12:39:57 PM
Thank you Blizzard, I fully understand now actually :) I'll try not to ask any more dumb questions for a while lol.
Title: Re: [XP] Advanced Time and Environment System
Post by: G_G on January 18, 2010, 09:43:00 PM
How do we make it not tint on certain maps?
Title: Re: [XP] Advanced Time and Environment System
Post by: Tazero on January 18, 2010, 10:56:57 PM
ATES.tint_off...

RTS(Read the script man =P  )
Title: Re: [XP] Advanced Time and Environment System
Post by: raijaku on January 28, 2010, 12:16:30 AM
I keep getting an error.

in the call script function i put "$ATES.on" and several of the other commands but i always get

NoMethodError occured while running script.

undefined method 'on' for nilNilClass

and any and all variations of what is between ' ' tint_on and the other commands are the same. i do not know if i am doing something wrong

or what but if i could get some help with this it would be greatly appreciated
Title: Re: [XP] Advanced Time and Environment System
Post by: Aqua on January 28, 2010, 12:26:47 AM
Did you insert the ATES script in a new script slot below RTP scripts but above Main in the right order?
Title: Re: [XP] Advanced Time and Environment System
Post by: raijaku on January 28, 2010, 02:10:39 AM
Yes here is the order of my scripts

SDK
Mog_Animated_Title
Pixelmovement script v1.3
ATES
Weather Effects
Average Level

also am i even using the right commands? i know very little about scripting and even less about the script call command. my other scripts that use it work fine but this one just does not like me for some reason

Edit: i changed the ATES script location to the bottom of the above list same effect. im gonna try to place directly above main and see what happens

Edit #2: nope no change. please help!
Title: Re: [XP] Advanced Time and Environment System
Post by: Jackolas on January 28, 2010, 10:30:05 AM
if i'm correct this script has mayor issues with SDK.
Title: Re: [XP] Advanced Time and Environment System
Post by: raijaku on January 28, 2010, 12:20:17 PM
well in the script there is

class Game_ATES
 
  attr_accessor :time
  attr_accessor :frame_count
  attr_accessor :active
  attr_accessor :tinting
 
  def initialize
    @time = ATES::Time.new(0, 0)
    @frame_count = 0
    @active = false
    @tinting = false
  end
 now thos falses after active control wheather ATES runs when you start the game or not. i can use the ATES system when i set those to true and i have no issues the clock works and all else. however the problem comes from the fact that i cannot not use the call script function to control the system meaning that it is always on. for the time being i have it set to off, seeing as this is one of the few day-night systems i have seen for xp i would really like to have this working. if someone has any idea how it can be fixed please help me

Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 28, 2010, 12:48:00 PM
Not "$ATES.on" but "ATES.on".
Title: Re: [XP] Advanced Time and Environment System
Post by: raijaku on January 28, 2010, 07:56:34 PM
... ... ... I am a complete idiot. lol. I don't know much about the script call commands like i said before and i thought that all commands had to have $ in front of it. this makes me look like a complete noob despite the fact ive been using rpgmaker for going on about 3 years now. thank you for fixing my error and sorry to bother everyone with such a noob mistake
Title: Re: [XP] Advanced Time and Environment System
Post by: Lost King on January 28, 2010, 08:27:52 PM
Nothing to feel nooby about, I've been using XP for 3 years now too and still find new stuff, and that's only with default event stuff, scripting's a whole nother story.

If this script gets any more new and exciting features I may consider using it in a project of mine.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on January 29, 2010, 12:27:37 PM
Happens to everybody. xD
Title: Re: [XP] Advanced Time and Environment System
Post by: Jragyn on February 02, 2010, 12:54:01 PM
Could this script be modified in some way to project REAL time into the game, versus implanted 5 minute days, 5 minute nights (or whatever they are set to)?

I currently use a script I butchered and modified for use from VX...for XP!
(click to show/hide)

And well, honestly, I just feel like if it was made FOR XP, and not just me hacking up the script until it functions as I need it, mayhaps the world could utilize this script as well as me :D

Just a thought.
Title: Re: [XP] Advanced Time and Environment System
Post by: Lost King on February 06, 2010, 12:30:34 AM
Not sure if I should be asking here or in the RMX-OS plugin thread, but I decided to try using ATES today in my RMX-OS game. I believe I managed to input the scripts properly, I'm not getting errors, I'm just getting a very Yellow screen. It comes up regardless of whether ATES is on or tinting is on. From what I've read, people here don't seem to be experiencing it so I think it's something with the RMX-OS extension. I tried to go into the script and fiddle with the tinting colors...but there's a lot of different little tinting sections and I'm not sure which to mess with. Oh, and the clock displays in a weird format. Like I'm getting the time: 300:40

Any help?

EDIT: Alright, I think I fixed it by making the ATES turn on with a parallel process event that also changes the screen color tone back to normal colors. Not sure if this will change when entering another map or when the tinting happens, I should probably have posed this question in the plugin thread though as it seems to be the cause.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on February 06, 2010, 12:05:12 PM
There actually is a RMX-OS plugin. *points to Global DNS for RMX-OS topic*
Title: Re: [XP] Advanced Time and Environment System
Post by: element on February 06, 2010, 07:01:52 PM
Could this script be modified in some way to project REAL time into the game, versus implanted 5 minute days, 5 minute nights (or whatever they are set to)?

I currently use a script I butchered and modified for use from VX...for XP!
(click to show/hide)

And well, honestly, I just feel like if it was made FOR XP, and not just me hacking up the script until it functions as I need it, mayhaps the world could utilize this script as well as me :D

Just a thought.


I have 2 questions about this :

Does it reads the actual Time setted up on the PC or just you configuring the scrip ?
Is this 100% compatible with XP ?
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on February 07, 2010, 08:37:28 AM
Could this script be modified in some way to project REAL time into the game, versus implanted 5 minute days, 5 minute nights (or whatever they are set to)?

I currently use a script I butchered and modified for use from VX...for XP!
(click to show/hide)

And well, honestly, I just feel like if it was made FOR XP, and not just me hacking up the script until it functions as I need it, mayhaps the world could utilize this script as well as me :D

Just a thought.


I have 2 questions about this :

Does it reads the actual Time setted up on the PC or just you configuring the scrip ?
Is this 100% compatible with XP ?
(click to show/hide)

From what I see, it reads the time set up on the PC.
Title: Re: [XP] Advanced Time and Environment System
Post by: Alton Wyte on February 14, 2010, 03:32:44 AM
to Alton Wyte:
Quote
All I did was put in the configuration. And also I noticed at 6:30 it changes back to night and begins to fade to daytime.

hearing the problem i think the problem lies in a other script that is causing errors with this 1.
can you write up the scripts you use?
Thanks for wanting to help, but I started a new game and now there are no issues.
Title: Re: [XP] Advanced Time and Environment System
Post by: element on March 04, 2010, 09:09:31 PM
Can I use the code breloom showed me in keylocks script in ates.
and if yes can someone show me where to implement this code ?

In other words:
I need to know if i can makes ates work with real time,day year,... set up on PC
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on March 04, 2010, 09:32:28 PM
Can I use the code breloom showed me in keylocks script in ates.
and if yes can someone show me where to implement this code ?

In other words:
I need to know if i can makes ates work with real time,day year,... set up on PC

I'm not 100% sure about this script because I haven't used it, but this is what I like to do.

(click to show/hide)

and then in a Common Event...

(click to show/hide)

...Basically, it changes Screen Color Tone if you are outside. When going inside (or in a cutscene), turn the Inside switch on.
Title: Re: [XP] Advanced Time and Environment System
Post by: element on March 06, 2010, 10:44:28 AM
Can I use the code breloom showed me in keylocks script in ates.
and if yes can someone show me where to implement this code ?

In other words:
I need to know if i can makes ates work with real time,day year,... set up on PC

I'm not 100% sure about this script because I haven't used it, but this is what I like to do.

(click to show/hide)

and then in a Common Event...

(click to show/hide)

...Basically, it changes Screen Color Tone if you are outside. When going inside (or in a cutscene), turn the Inside switch on.

Can you make this work in ATES ? Or do you want to show me where to implement it :p
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on March 06, 2010, 04:22:26 PM
Well, when I said
Quote
I'm not 100% sure about this script because I haven't used it

I was referring to ATES. I'll attempt to make a plugin if nobody else is up to it.

EDIT: I just opened up a new project to try it out.

On line 309, replace:
Code: [Select]
@time = ATES::Time.new(0,0)with
Code: [Select]
@time = Time.new
and it'll use real time from the internal clock.

EDIT2: It won't update on its own, though.
Title: Re: [XP] Advanced Time and Environment System
Post by: element on March 06, 2010, 09:44:37 PM
Jheej ! it gives the real time for 1 sec !!!  :haha:

And then it gives me a error like you said
EDIT2: It won't update on its own, though.

I'm totally requesting this XD
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 08, 2010, 09:51:23 AM
EDIT2: It won't update on its own, though.

If you change line 325, it will.

Code: [Select]
@frame_count += 1
Code: [Select]
@time = Time.now
BTW, Time.new and Time.now do the same. I prefer .now because it's more descriptive of what it actually does.
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on March 08, 2010, 02:07:32 PM
Uh.. you sure about that, Blizzard? I just tried that out, the clock didn't change.

Also, I know Time.new and Time.now are the same.

EDIT: Ah, it's because @active is false by default. But when I changed it to true, it crashed.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 08, 2010, 05:40:48 PM
Then the other method that's being called when @active is one should be disabled.
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on March 08, 2010, 10:44:29 PM
Then the other method that's being called when @active is one should be disabled.

There's only one method that's being called when @active is on. There is no other one.

Anyway, I found out how to make it automatically update.

(click to show/hide)

and

(click to show/hide)

There's probably a different way to do it. That's just one I got working.
Title: Re: [XP] Advanced Time and Environment System
Post by: element on March 09, 2010, 08:58:38 AM
It works !
Initially it didn't but then I removed the parralel event that turns on ATES
Dous that mean that coloring doesnt work ?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 09, 2010, 09:45:07 AM
CONGRATULATIONS! YOU JUST CAUSED A HEAVY MEMORY LEAK.

Clock_Sprite.new will make your game run so slowly so quickly that you won't even realize what hit you. You're instantiating a sprite there each frame, you're not destroying it and you're not even storing it into a variable.

Code: [Select]
   if @active # condition check
      update_progress # first method
      update_ates_progress # second method
    end # maybe you wanna count again just to be sure
Title: Re: [XP] Advanced Time and Environment System
Post by: Magus on March 10, 2010, 02:03:36 AM
I have a question:

What happens if the character is in the inside of a building, especially a lit up one. Is there anyway you can adjust it to temporarily turn off  the script when a character walks inside a building.
Title: Re: [XP] Advanced Time and Environment System
Post by: Alton Wyte on March 10, 2010, 02:08:47 AM
Quote
Code: [Select]
#     ATES.tint_on
#   Turns ATES's screen tinting on.
#
#     ATES.tint_off
#   Turns ATES's screen tinting off.
Title: Re: [XP] Advanced Time and Environment System
Post by: lilbrudder917 on March 10, 2010, 03:05:03 AM
CONGRATULATIONS! YOU JUST CAUSED A HEAVY MEMORY LEAK.

Clock_Sprite.new will make your game run so slowly so quickly that you won't even realize what hit you. You're instantiating a sprite there each frame, you're not destroying it and you're not even storing it into a variable.

Code: [Select]
   if @active # condition check
      update_progress # first method
      update_ates_progress # second method
    end # maybe you wanna count again just to be sure

Odd, my game didn't lag much at all and used just as much memory as it normally does.

Also, I misunderstood you when you said the other method. I thought you meant elsewhere in the script it checks if @active = true. In any case, sorry.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on March 10, 2010, 10:00:52 AM
No problem. Just make sure to double check next time. When I look for the appearance of a variable, I check for @variable, .variable and :variable. :)
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on August 10, 2010, 08:25:24 PM
How can I set up this script so that I call a common event at midnight?

I want everything to pause and the screen to fade to black, where big words say "Day 2" or something like that.  Also, certain variables in my game will change at this time.  Right now I have a parallel common event, but it's slowing down my game because it's constantly checking for midnight.  Obviously, this is stupid, so I would like the script to call a common event at midnight.

Or is there a better way?
Title: Re: [XP] Advanced Time and Environment System
Post by: stripe103 on August 10, 2010, 08:40:25 PM
I don't think that is possible to do. So it is either a parallel common event or a script that checks instead of the common event. It may be less laggy, but I'm not sure. That would be a script like this
Code: [Select]
# The id for the common event that is going to start
EVENT = 1
class Scene_Map
  alias :ori_update :update
  def update
    if $game_system.ates.time.hour == 0 && $game_system.ates.time.min == 0
      common_event = $data_common_events[EVENT]
      $game_system.map_interpreter.setup(common_event.list, 0)
    end
    ori_update
  end
end
I don't know if it works, but I think it does. But I don't know if it is less laggy.
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on August 25, 2010, 09:01:23 PM
I realized that my game isn't laggy because it's constantly checking for midnight. It's laggy because I have too many parallel common events running at the same time (Just 3, but apparently that's enough).

So, about this bit of script you posted...  I knew it would be just a few lines, and it looks good.  Would this be an entirely new script (that I post under MAIN), or do I plug it into the ATES script somewhere?  And if I wanted to call common event number 2 at midnight, what do I have to edit?
Title: Re: [XP] Advanced Time and Environment System
Post by: stripe103 on August 26, 2010, 03:51:47 PM
It should be inserted in a new script section below ATES.
The second line (EVENT = 1) change it into what common event you would like to run.
Title: Re: [XP] Advanced Time and Environment System
Post by: happyman on August 26, 2010, 09:05:17 PM
It works!  Yay!  Thanks Stripe!
Title: Re: [XP] Advanced Time and Environment System
Post by: ojp2010 on August 27, 2010, 03:58:08 AM
I installed the script runs fine. However, I can't get the clock not to show. I am using ATES and the RMX-OS addon for it. Also the screen doesn't change tint from night to day. When the game starts up the screen is tinited for night, but it never changes, anyone help me?
Title: Re: [XP] Advanced Time and Environment System
Post by: Magus on September 25, 2010, 03:39:01 AM
Okay, maybe this question was asked before, but I can't find it in the thread. (So, I guess it doesn't hurt to ask anyone a simple question; after all, its just a question and its not hurting anything xD)

Question:   Okay, this thing is beyond amazing, however, the counter on the clock is counting by "20's"  I really wouldn't mind slowing down the time. Like maybe have it count by one's or two's. ANYTHING is better than having a "20 second day and 3 second night :/"

I tried increasing the "length" but of course found out that was a bad idea since the counter didn't go beyond 23 and so that idea destroyed night and caused it to flash a strange yellow.

So anyway... I'd rather have  longer times... May I ask of anyone's assistance please? Thanks very much ^_^
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on September 25, 2010, 09:47:51 AM
Make sure that you properly configured everything. It seems to me that you didn't configure everything properly. Read the instructions again and see which option does what.
Title: Re: [XP] Advanced Time and Environment System
Post by: Magus on September 25, 2010, 09:45:10 PM
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # switch ID of the "day" switch
  DSWITCH = 51
  # switch ID of the "night" switch
  NSWITCH = 52
  # length of a day in seconds in-game, can't be less than 36, is being
  # quantized into intervals of 36 seconds
  LENGTH = 70
  # how much time is it when the "day" starts
  DAY_START = 1
  # how much time is it when the "night" starts
  NIGHT_START = 40
  # makes the screen brighter during "summer" days
  OVERLIGHTING = true
  # makes the screen darker during the night, not recommended
  OVERDARKENING = false
  # display HUD clock
  SHOW_CLOCK = true


^That's how I thought it could be set up, but the 36 rule is absolute, which makes it impossible to have longer days and longer nights
Title: Re: [XP] Advanced Time and Environment System
Post by: Magus on September 26, 2010, 04:44:26 PM
I know double posting fails, but I really wouldn't mind having longer days and night: however, whenever I set the length any longer, the game deletes night.
Title: Re: [XP] Advanced Time and Environment System
Post by: RenegadeNick27 on December 01, 2010, 02:00:30 AM
i am having the same problem. i have it set up so every second, another minute is added to the clock. (+00:01) but every time i start the clock, the screen fills with an solid yellow tint.

Here are my stats

Code: [Select]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # switch ID of the "day" switch
  DSWITCH = 51
  # switch ID of the "night" switch
  NSWITCH = 52
  # length of a day in seconds in-game, can't be less than 36, is being
  # quantized into intervals of 36 seconds
  LENGTH = 1440
  # how much time is it when the "day" starts
  DAY_START = 320
  # how much time is it when the "night" starts
  NIGHT_START = 800
  # makes the screen brighter during "summer" days
  OVERLIGHTING = false
  # makes the screen darker during the night, not recommended
  OVERDARKENING = false
  # display HUD clock
  SHOW_CLOCK = true

I dont know if i have to change the DSWITCH and NSWITCH. how do i fix this so i can see the game in day and night. :???:
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on December 01, 2010, 09:38:45 AM
Why do your day and night start at 320:00 and 800:00 hours respectively?
Title: Re: [XP] Advanced Time and Environment System
Post by: RenegadeNick27 on December 01, 2010, 02:05:56 PM
WHAT :^_^': i thought that i should have multiplied them the same amount as i did the seconds/per day. do you thin if i change them back to 8 and 20 it will balance out again?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on December 01, 2010, 05:31:25 PM
It should. I set it to hours so it's easier to configure and you don't have to calculate. You can also use 6 and 19 or whatever you like.
Title: Re: [XP] Advanced Time and Environment System
Post by: crow5derlock on July 27, 2011, 06:46:34 AM
is there a way to change how fast the game minutes go by in the script? :???:


i apologize if this has already been answered but i'm kinda in a hurry.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 24, 2012, 04:16:55 AM
I've looked and searched, does the night and day time monsters work with BABS? Sorry to nerco   :facepalm:

*EDIT* Is the time settings real time or game time, there seems to be a lot of discuss about this and I got lost. I am wanting to know because I am going to event random weather condition and fogs for each period and I need to know how long to make the effects last and the wait times.  Unless I am missing something and that can be done with the script. I am still playing with and learning it.
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 24, 2012, 07:49:03 PM
It can be real time if you want to (you just have to configure it properly), but I suggest you use game time. Real time in game never worked out too well since people don't usually spend that many hours playing a game. Also, "real time" doesn't take your PC's actual time, it only advanced like real time i.e. a second in the game takes an actual second in real life (as opposed to e.g. a minute in game takes a second in real life).

Day and night time monsters should work with Blizz-ABS if you use the switches that have been assigned in ATES as day and night switches.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 24, 2012, 07:59:28 PM
Okay, sweet that is what I wanted to know. I will have to play with it when I get home from work. Another quick question when I have monster for Day and Night, when night occurs will the day monster "de-spawn" or disappear from the view of the player? Or will they stay on screen just "sleeping" and not attacking or moving?   
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 24, 2012, 08:36:51 PM
That depends on how you implement it. For example, if you want enemies to fall asleep and wake up, you should probably use a common event that inflicts a special "sleep" on all enemies that have certain IDs (i.e. an array of IDs of enemies that sleep during the night) during day and night, depending on the switches. Blizz-ABS has all necessary script calls for you, but it would be good if you asked somebody to put those script calls together as it gets a bit complicated if you want something like this. It's not too difficult, it only requires some careful eventing and obviously the script calls to put a certain set of enemies to sleep or wake them up.
For other enemies, you can just make them vanish. e.g. if you have some ghosts, you can simply put a night switch on them and they will literally disappear during the day. It all depends on how you want things to work.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 24, 2012, 08:52:58 PM
Thanks Blizz, once I get my enemies made I will make a request. Of course after I try to mess it all up myself first  ;)

*EDIT* So I am looking at something like this. A common event that checks rather ATES.night? (don't remember the actually commands name) is true if so effect all enemies with ID 1-8 with sleep and switch out their events for enemies ID 8-16 then the new enemies will "spawned" in their place. Their place being the normal start point of the day time monsters. Something along those lines? I am going to differently try to do this on my own first.

I can see why this would take very careful eventing.

**EDIT**

This is what I came up with so far, not much and I've tested it yet. Don't think it is correct anyways. Needs a bit of work still, but I need to get the special commands from BABS.

Event of Map
(click to show/hide)

Common Event
(click to show/hide)

State "Sleep" I named them Night and Day. Night being a state where day monsters are asleep and day being a state where night monsters are asleep.
(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 25, 2012, 08:58:17 AM
You don't need the first one. Simply use the switches assigned to ATES.

Code: [Select]
  # switch ID of the "day" switch
  DSWITCH = 51
  # switch ID of the "night" switch
  NSWITCH = 52

As you can see, by default they are #51 and #52. Obviously you can change that to suit your needs.

As for the second event, in Blizz-ABS you can't inflict a state to an enemy like that. Look up in the manual how it's done.

And you only need one state for sleep during day and night since it does the same thing.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 25, 2012, 04:03:42 PM
I see, seems I over complicated things. Okay I will double check the manual.

*EDIT* I got it to work! Thanks I do have a question, can I make the switch between monsters "fade" out? When the switch flips and I have the re-spawn  ID array in the event name will the monster re-spawn at the spawn point out just change where ever it is as on the map? I am going to test while I wait. :) Thanks blizz, I feel I might make things more complicated then they seem cause they can't be that easy to do. Never the less you make everything easy  :^_^':
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 25, 2012, 04:20:39 PM
Fading is a lot more complicated than just making them appear/disappear, because you have to use the switches for something else and then manually remove enemies, etc.. This here is straight-forward and the simplest way. But it's up to you.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 25, 2012, 04:24:33 PM
Is that might be something I want to tickle later or leave out for the moment. Alright, is there a special command to make if when D or N switch is flipped that the monster will pop at respawn point inside of just changing?
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 25, 2012, 04:35:25 PM
Not really, no. As I said, fading and extra stuff like that requires more complicated eventing. It's up to you whether you want to try it or not.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 25, 2012, 04:39:54 PM
Okay thanks Blizz!

*EDIT* Is there a way to add a ATES.morning and evening? I am wanting to make a event sundial that changes when the switches are flipped.

(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 28, 2012, 01:26:54 AM
Add this below ATES:

Code: [Select]
module ATES
  
  def self.morning?
    $game_system.ates.morning?
  end
  
  def self.evening?
    $game_system.ates.evening?
  end
  
end

class Game_ATES
  
  def morning?
    return (@time.hour.between?(ATES::DAY_START - 2, ATES::DAY_START + 2))
  end
  
  def evening?
    return (@time.hour.between?(ATES::NIGHT_START - 2, ATES::NIGHT_START + 2))
  end
  
end

This script is specific for days from 8 AM to 8 PM and might not work well with other times. Feel free to adjust them.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 28, 2012, 01:40:15 AM
Thanks Blizz,  here is what I have right now and I the pictures for morning and evening aren't showing up and night and day are being eased. They just keep posting over each other again, again and again. :/

(click to show/hide)

(click to show/hide)
Title: Re: [XP] Advanced Time and Environment System
Post by: Blizzard on April 28, 2012, 10:12:46 AM
Your conditions will never be fulfilled as either NIGHT or DAY will capture it previously. Put the morning? and evening? conditions first and the DAY and NIGHT conditions in the else branch.
Title: Re: [XP] Advanced Time and Environment System
Post by: Andreavnn on April 28, 2012, 05:25:18 PM
Thank you Blizz always the best! +1