Jump to content
Vlue

Basic Game Time + Night/Day

Recommended Posts

You know that error with "002,001... bla bla" really confuses me.

 

Usually it's all about being VERY specific with this stuff, lol

Share this post


Link to post
Share on other sites

(Probably a true fact):

The editor pads the numbers with 0's for looks. In data form it wouldn't be practical to do so.

That or they like to confuse people. :3

This might not clear things up.

Failed Haiku.

  • Like 1

Share this post


Link to post
Share on other sites

I have a problem with the compatibility script for Khas light effects. I put the ids of the maps that I wanna to be "indoors" but anyway they get tinted, not by the time but by the previous map tint... I dunno if I be clear

 

PD: English is not my native language..... I'm originally speak spanish, so if you don´t understood well what i'm trying to say and if you understand spanish, then tell me to explain it again in spanish.. xd

 

Try using this compatibility script instead:

 

module GameTime
 def self.init
       $game_time = 0
       $game_time_surface = $game_map.effect_surface
       $game_time_pause_time = false
 end
 def self.tint(tint = 60)
       if USE_TINT != true then return end
       for i in NOTINTMAPS
         if $game_map.map_id == i
               $game_map.effect_surface.change_color(tint,0,0,0,0)
               return
         end
       end
       if SceneManager::scene_is?(Scene_Map) then else return end
       case $game_time
       when PRESUNRISE_TIME .. SUNRISE_TIME
         $game_map.effect_surface.change_color(tint,PRESUNRISE_TONE.red,PRESUNRISE_TONE.green,PRESUNRISE_TONE.blue,PRESUNRISE_TONE.gray)
       when SUNRISE_TIME .. NOONSTART_TIME
         $game_map.effect_surface.change_color(tint,SUNRISE_TONE.red,SUNRISE_TONE.green,SUNRISE_TONE.blue,SUNRISE_TONE.gray)
       when NOONSTART_TIME .. NOONEND_TIME
         $game_map.effect_surface.change_color(tint,NOONSTART_TONE.red,NOONSTART_TONE.green,NOONSTART_TONE.blue,NOONSTART_TONE.gray)
       when NOONEND_TIME .. PRESUNSET_TIME
         $game_map.effect_surface.change_color(tint,NOONEND_TONE.red,NOONEND_TONE.green,NOONEND_TONE.blue,NOONEND_TONE.gray)
       when PRESUNSET_TIME .. SUNSET_TIME
         $game_map.effect_surface.change_color(tint,PRESUNSET_TONE.red,PRESUNSET_TONE.green,PRESUNSET_TONE.blue,PRESUNSET_TONE.gray)
       when SUNSET_TIME .. 1440
         $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
       when 0 .. MIDNIGHT_TIME
         $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
       when MIDNIGHT_TIME .. PRESUNRISE_TIME
         $game_map.effect_surface.change_color(tint,MIDNIGHT_TONE.red,MIDNIGHT_TONE.green,MIDNIGHT_TONE.blue,MIDNIGHT_TONE.gray)
       end
 end
end

 

Edited by Vlue
  • Like 1

Share this post


Link to post
Share on other sites

Try using this compatibility script instead:

 

module GameTime
 def self.init
	$game_time = 0
	$game_time_surface = $game_map.effect_surface
	$game_time_pause_time = false
 end
 def self.tint(tint = 60)
	if USE_TINT != true then return end
	for i in NOTINTMAPS
	  if $game_map.map_id == i
			$game_map.effect_surface.change_color(tint,0,0,0,0)
			return
	  end
	end
	if SceneManager::scene_is?(Scene_Map) then else return end
	case $game_time
	when PRESUNRISE_TIME .. SUNRISE_TIME
	  $game_map.effect_surface.change_color(tint,PRESUNRISE_TONE.red,PRESUNRISE_TONE.green,PRESUNRISE_TONE.blue,PRESUNRISE_TONE.gray)
	when SUNRISE_TIME .. NOONSTART_TIME
	  $game_map.effect_surface.change_color(tint,SUNRISE_TONE.red,SUNRISE_TONE.green,SUNRISE_TONE.blue,SUNRISE_TONE.gray)
	when NOONSTART_TIME .. NOONEND_TIME
	  $game_map.effect_surface.change_color(tint,NOONSTART_TONE.red,NOONSTART_TONE.green,NOONSTART_TONE.blue,NOONSTART_TONE.gray)
	when NOONEND_TIME .. PRESUNSET_TIME
	  $game_map.effect_surface.change_color(tint,NOONEND_TONE.red,NOONEND_TONE.green,NOONEND_TONE.blue,NOONEND_TONE.gray)
	when PRESUNSET_TIME .. SUNSET_TIME
	  $game_map.effect_surface.change_color(tint,PRESUNSET_TONE.red,PRESUNSET_TONE.green,PRESUNSET_TONE.blue,PRESUNSET_TONE.gray)
	when SUNSET_TIME .. 1440
	  $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
	when 0 .. MIDNIGHT_TIME
	  $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
	when MIDNIGHT_TIME .. PRESUNRISE_TIME
	  $game_map.effect_surface.change_color(tint,MIDNIGHT_TONE.red,MIDNIGHT_TONE.green,MIDNIGHT_TONE.blue,MIDNIGHT_TONE.gray)
	end
 end
end

 

 

Yikes! Is working well... You're awesome xD

Finally I can go ahead with my little game =)

 

Thanks for your help!

 

==============================================================================================

 

EDIT:

Err.. I got another... "problem"... =S

Now when I enter in a "indoor" map the tint takes 60 frames to restore to normal, I solved it with a new line

$game_map.effect_surface.set_alpha(0)

 

Into

 

if $game_map.map_id == i
		    $game_map.effect_surface.change_color(tint,0,0,0,0)
		  return

 

Result:

 

 def self.tint(tint = 60)
    if USE_TINT != true then return end
    for i in NOTINTMAPS
	  if $game_map.map_id == i
	    $game_map.effect_surface.change_color(tint,0,0,0,0)
	    $game_map.effect_surface.set_alpha(0)
	    return
	  end
    end

 

And that work well when I enter in a "indoor" map, restoring back to "normal tint" instantly and not with strange effects... But I can't figure out how to do so when I get out of the "indoor" and the map start to tint again the screen based on time, taking again the 60 frames over and over every time that I change of map, so is not instantly like your original script...

 

PD: Oh my... I'm practicing more english here that all my years on institutes xD

Edited by Mutazek
  • Like 1

Share this post


Link to post
Share on other sites

Vlue, I absolutely love this script. Unfortunately I suck at scripting. How would I make it so that when I sleep at an inn it passes by about 8-10 hours?

Share this post


Link to post
Share on other sites

Hi Vlue, i'm still having the problem that I described above... I can't find anything to solve it =/

 

 

PD: Can I have your permission to put a link to this post in a spanish forum? I like so much this Script that I wanna give to know it

Share this post


Link to post
Share on other sites

Vlue, I absolutely love this script. Unfortunately I suck at scripting. How would I make it so that when I sleep at an inn it passes by about 8-10 hours?

 

Have a script call:

GameTime::change(#) where # is the number of minutes to increase/decrease by (480 is 8 hours, 600 is 10)

  • Like 1

Share this post


Link to post
Share on other sites

Hi Vlue, i'm still having the problem that I described above... I can't find anything to solve it =/

 

 

PD: Can I have your permission to put a link to this post in a spanish forum? I like so much this Script that I wanna give to know it

 

Ah, you edited your message instead of posting anew so I didn't even know about it :(

That is a bugger... this seems to work out pretty well tho:

 

 

module GameTime
 def self.init
   $game_time = 0
   $game_time_surface = $game_map.effect_surface
   $game_time_pause_time = false
 end
 def self.tint(tint = 0)
   if USE_TINT != true then return end
   for i in NOTINTMAPS
     if $game_map.map_id == i
       $game_map.effect_surface.change_color(tint,0,0,0)
       $game_map.effect_surface.set_alpha(0)
       return
     end
   end
   if SceneManager::scene_is?(Scene_Map) then else return end
   case $game_time
   when PRESUNRISE_TIME .. SUNRISE_TIME
     $game_map.effect_surface.change_color(tint,PRESUNRISE_TONE.red,PRESUNRISE_TONE.green,PRESUNRISE_TONE.blue,PRESUNRISE_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(PRESUNRISE_TONE.gray) end   
   when SUNRISE_TIME .. NOONSTART_TIME
     $game_map.effect_surface.change_color(tint,SUNRISE_TONE.red,SUNRISE_TONE.green,SUNRISE_TONE.blue,SUNRISE_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(SUNRISE_TONE.gray) end
   when NOONSTART_TIME .. NOONEND_TIME
     $game_map.effect_surface.change_color(tint,NOONSTART_TONE.red,NOONSTART_TONE.green,NOONSTART_TONE.blue,NOONSTART_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(NOONSTART_TONE.gray) end
   when NOONEND_TIME .. PRESUNSET_TIME
     $game_map.effect_surface.change_color(tint,NOONEND_TONE.red,NOONEND_TONE.green,NOONEND_TONE.blue,NOONEND_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(NOONEND_TONE.gray) end
   when PRESUNSET_TIME .. SUNSET_TIME
     $game_map.effect_surface.change_color(tint,PRESUNSET_TONE.red,PRESUNSET_TONE.green,PRESUNSET_TONE.blue,PRESUNSET_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(PRESUNSET_TONE.gray) end
   when SUNSET_TIME .. 1440
     $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(SUNSET_TONE.gray) end
   when 0 .. MIDNIGHT_TIME
     $game_map.effect_surface.change_color(tint,SUNSET_TONE.red,SUNSET_TONE.green,SUNSET_TONE.blue,SUNSET_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(SUNSET_TONE.gray) end
   when MIDNIGHT_TIME .. PRESUNRISE_TIME
     $game_map.effect_surface.change_color(tint,MIDNIGHT_TONE.red,MIDNIGHT_TONE.green,MIDNIGHT_TONE.blue,MIDNIGHT_TONE.gray)
     if tint < 60 then $game_map.effect_surface.set_alpha(MIDNIGHT_TONE.gray) end
   end  
 end
end

 

 

And yup, you're certainly allowed to link to any of my work. I won't complain to that~

Edited by Vlue

Share this post


Link to post
Share on other sites

Well, now the problem is a "wrong number of arguments" ... I just tried the new script today and get that error... I put this just below your original "Basic Game Time + Night/Day" and get this:

 

56695799.jpg

 

In the line 88:

 

49717280.jpg

 

I'm very bad with scripting so I don't understand this problem...

Share this post


Link to post
Share on other sites

I ran across the same problem, what's supposed to be in the parentheses in your event is "true" or "false".

 

At least I'm pretty sure that's the issue, we can't see your event in those screens, and thus cannot make a meaningful conclusion about your issue. Try my solution, if that doesn't work, what your supposed to put in the box is either a 0 or a 1. Anything higher and you encounter an error.

Share this post


Link to post
Share on other sites

But I Don't have any event process calling to the script, don't even a little part... until I get the script working well, I will not create any event

 

Anyway the unique event that use part of the script is this:

 

Conditional Branch: Script: GameTime::hour? >= 6 and GameTime::hour? < 19
  Control Switches: [0003:Es de noche] = OFF
  Else
  Control Switches: [0003:Es de noche] = ON
Branch End

 

PD: I get the error just when loading the game, not even show the Title screen.

Share this post


Link to post
Share on other sites

I see that you're setting up a day & night event system, I have the same thing in mine and do not encounter this issue at all.

Share this post


Link to post
Share on other sites

Hey Vlue, ol' pal, help me figure this out if you have the time XD I would like an event to take place, say, five days after the flipping of a switch takes place.

I'm thinking of making it so that every time one of the day switches gets flipped, a variable is also increased by one... but only if another switch, say, called "COUNTING DAYS" is flipped. That way I'm counting days only when such switch is being used. What do you think? Seems solid?

Share this post


Link to post
Share on other sites

But I Don't have any event process calling to the script, don't even a little part... until I get the script working well, I will not create any event

 

Anyway the unique event that use part of the script is this:

 

Conditional Branch: Script: GameTime::hour? >= 6 and GameTime::hour? < 19
  Control Switches: [0003:Es de noche] = OFF
  Else
  Control Switches: [0003:Es de noche] = ON
Branch End

 

PD: I get the error just when loading the game, not even show the Title screen.

 

Oh, my bad. On my end. I edited that blurb up there, re copy and paste.

 

Hey Vlue, ol' pal, help me figure this out if you have the time XD I would like an event to take place, say, five days after the flipping of a switch takes place.

I'm thinking of making it so that every time one of the day switches gets flipped, a variable is also increased by one... but only if another switch, say, called "COUNTING DAYS" is flipped. That way I'm counting days only when such switch is being used. What do you think? Seems solid?

 

Sounds like it should work! I don't see why not.

  • Like 1

Share this post


Link to post
Share on other sites

Well... It solved the previous problem but now I got this:

 

 

18859209.jpg

 

In this Line:

59351485.jpg

 

Kinda frustrating... I wish to know more about Scripting... :(

Share this post


Link to post
Share on other sites

Hey Vlue,

 

A while back I asked this question on another forum for VX, however my computer died before I could read your reply.

I ended up getting Ace and wanted to ask you again.

 

How do you prevent the clock from tinting while using Khans? I also use Blasphemia ABS and need the hp bars ect. not to tint as well.

Is there just a script to pop in? Sorry I really stink at code :D

Share this post


Link to post
Share on other sites

The pause tint thingy should work to pause tint with Khan's as well. As for the hp bar thingys not tinting, that's part of their script not being 'above' the tint. (Or of Khan's tint not being below those, hehe)

 

If you can toss a link to that script I can take a look and see what can be done.

Share this post


Link to post
Share on other sites

###

 

Replace the HUD marked script with this one and see if it works.

Edited by Vlue

Share this post


Link to post
Share on other sites

unfortunaty it did not work, it says: "System stack error occurred, Stack level too deep"

 

I took a screen shot so you could see:

 

EDIT: Okay new at forums so I cannot figure out how to link this to photo bucket, please check the attached file for the pic :D

Edited by BlaineA97

Share this post


Link to post
Share on other sites

Make sure you completely replace the HUD portion with this. That's usually the cause of stack errors.

 

Also you should be able to use url to embed images say from photobucket.

Share this post


Link to post
Share on other sites

Hmmm, well I used ctrl-A to select the entire thing to no avail, same error occurs :( Do I need to place it in a different location?

 

(5 minutes later...)

Also, I figured maybe another script was interfering so I just checked it with the Blasphemia ABS demo, replaced the HUD entirely but no go :(

 

Ideas?

Share this post


Link to post
Share on other sites

Remove all of Blashp ABS scripts and start it, see if it still occurs. I don't seem to get the error

Share this post


Link to post
Share on other sites

Ok, tried removing all of the ABS scripts, except the fix you made, same error.

Removed every script except the fix you made, same error

Removed the fix you made and left everything else: works ...

 

Blast it all lol.

 

Would it help if I sent you a copy of my game itself?

I assume you don't get errors, so perhaps I should remove and test with other scripts one by one?

 

Sorry to take up so much time on this :D

Share this post


Link to post
Share on other sites

Okay, we'll do what I should have made in the first place.

Just place this portion of the script anywhere below the original HUD portion instead of replacing it, and use the original HUD portion.

 

Z_Position = 199
class Sprite_HUD < Sprite
 alias new_initialize initialize
 def initialize(viewport)
   new_initialize(viewport)
   self.z = Z_Position
 end
end
class Sprite_Hotkeys < Sprite
 alias new_initialize initialize
 def initialize(viewport)
   new_initialize(viewport)
   self.z = Z_Position
 end
end
class Sprite_Actions < Sprite
 alias new_initialize initialize
 def initialize(viewport)
   new_initialize(viewport)
   self.z = Z_Position
 end
end

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted