[XP] Complete Climate and Time System (CCTS)

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

Previous topic - Next topic

ForeverZer0

Might be an error with the config generator (it was my first C# project I ever made). Add the following line directly before the line where the error is.

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

Sbus

i did it, and a new error showed up:
CCTS_Configuration 561 NoMethodError
undefined method 'maps' for nil:NilClass

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

it's at the end of the script, so i hope it's the last error *_*

ForeverZer0

That doesn't make a whole lot of sense...
Somehow or another, on of the climates in the array is nil.

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

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


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


Or let me know if the the numbers in the brackets do not run in order. (0, 1, 2, 3, etc., etc.)
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Sbus

Don't ask me why, but the fourth climate was missing...
I added it, and it works, but there's a problem:
the screen gradually becomes white, regardless of the hour i start the game.
also, if i change map, the screen tint returns to the "normal" one.



ForeverZer0

Upload a demo that reproduces the problem, I can't say for sure without seeing what's going on.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.


ForeverZer0

I'm sorry, but I am not signing up and joining 4shared just to download a file.
Could you please upload to a file sharing service that is less of a pain the ass, I hate 4shared for that reason.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Sbus


Sbus

Meh, I managed to find another time system and I did.
It suits better my needs so, I think theresn't a problem anymore.

AnimeGirl

December 14, 2012, 11:19:34 am #251 Last Edit: December 14, 2012, 11:26:48 am by AnimeGirl
I need help with CCTS, What I want to do is lock buildings for a specific time
Example
If anybody knows how to do it that would help me a lot, because I'm a newbie in gamemaking. :D


KK20

In your event (most likely a door), put the first event command to turn a switch OFF (we will use this to determine whether the place is open/closed). Then use a script call and copy something like this:

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

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

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

$game_switches[ID]

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

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

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AnimeGirl

December 18, 2012, 04:57:54 pm #253 Last Edit: December 19, 2012, 07:25:42 pm by KK20
Quote from: KK20 on December 14, 2012, 07:25:25 pm
In your event (most likely a door), put the first event command to turn a switch OFF (we will use this to determine whether the place is open/closed). Then use a script call and copy something like this:

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

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

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

$game_switches[ID]

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

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


Thanks a lot, it really helped :D .

Edit:
When I tried to use the script this window opened


KK20

Please don't double post.
Also, c'mon guys... no one could post the answer for me? D:

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


If you're still confused, I'll post a screenie later.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

This script doesn't modify the weather effects. This script, however, does: http://forum.chaos-project.com/index.php/topic,5980.0.html

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

    # Splash Bitmap

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

I don't script in VXA so someone else will have to help you with that.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ThallionDarkshine

Quote from: KK20 on December 21, 2012, 03:24:24 pm
This script doesn't modify the weather effects. This script, however, does: http://forum.chaos-project.com/index.php/topic,5980.0.html


I might work on converting that script that KK20 mentioned to VXA, now that I'm off from school for winter break.


Lamsah

December 21, 2012, 11:05:31 pm #258 Last Edit: December 23, 2012, 05:27:33 pm by Lamsah
Oh you got it completed :o  Thank you very much ThallionDarkshine  :shy:

Please PM me for payment method and total :)

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

i tried that method and an error occurred:

undefined method `weather' for nil:NilClass

EDITED:
Mr. Thallion solved the issue and thanks to him in making live  :shy:

ArcaneAlchemy

Hey, so I recently had a problem that had stumped me for about 2 days. For anyone who had this same problem, you will be glad that I wrote this, 'cause holy crap it was annoying. Probably a result of my laziness in rewriting the audio module. Anyway, for those of you who want to both use this script, and to have your Map BGM return to its place after a battle here is an easy solution. I tried to use the MCI player script on here, but it had a problem with the fade in/out of the weather effects of this script. So, I found this script. http://www.hbgames.org/forums/viewtopic.php?t=55486

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

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


That's it. Man, that was annoying. Since ForeverZero wrote both this script and the MCI, he probably has a much better way to do this, but this will get the job done for now.
"Wait? Do I look like a waiter?" -Kefka