Author Topic: [XP] Advanced Weather  (Read 13684 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Advanced Weather
« on: April 01, 2010, 12:12:02 AM »
Advanced Weather
Authors: ForeverZer0, Ccoa
Version: 1.1
Type: Complete Weather System
Key Term: Custom Environment System

Introduction

First off, let me state that this is a modification, albeit a heavy one, of Ccoa's Advanced Weather System. If you use Ccoa's script, and have other scripts that are dependent on it, this script can still replace it with only some very minor edits.

Although I love the original script (a great staple for any game), I found that there was room for many improvements in basic data handling, configurability, and the simple overview of it.  Then came the MAWS script by Agckuu Coceg. I loved the idea (it's what inspired this script), but it only further added to the number of redundancies that bugged me.I didn't see the point in caching 50+ different bitmaps, when there are essentially less than 30 types of weather, and the rest are just color variations. For example, Rain, Blood Rain, Acid Rain, Sepia Rain, Golden Rain, and Oil Rain all use the exact same image, just with different color, so why cache all of them separately?

So, here it is, with totally over-hauled coding. You no longer have to remember 60+ different numbers for weather types. If it is rain, the type will always be 1, but with an added number at the end of the script call, it can quickly become any color variation of rain (see instructions). It's easier than ever to add your own custom color schemes to the weather, I added some extra configurable values, and the coding has been improved immensely. To give you an idea of how many redundant lines of code there were, before I added some of my new custom weather effects, the code was over 1000 lines shorter than the MAWS script. Even now, if you include all the various color schemes, this script offers 95 different weather patterns, compared to the 54 offered by MAWS, and it is still shorter!


Features

  • New weather effects include, butterflies, birds, falling rocks, and arrows.
  • Including color variations, offers 95 different weather patterns.
  • Easy to quickly add more or alter existing weather patterns.
  • Configurable switch that will be ON during bad weather (Good for event conditions)
  • Configurable in-game variable that will be equal to the weather type.
  • Realistic thunder with random volume and pitch.
  • Easily configure how constant the over-all thunder/lightning is.
  • Fixed an error from the original script with the snow bitmap. It looks better now.
  • More RAM friendly and over-all much cleaner code

Screenshots

(click to show/hide)
(click to show/hide)
(click to show/hide)

Demo

Demo Link

If you would like to create custom weather patterns, check out the WeatherCreator, it will help you create your own, and generate Advanced Weather 2.0 to use them with.

Script

Script is too large for code box. View by following link.
Script Link

Instructions

Place script anywhere below Spriteset_Map.
Click here for some quick instructions.
(click to show/hide)

Compatibility

Should be compatible with everything.
I tried to keep most of the weather types set to the same value as they were in Ccoa's original script, but a few
of them have been combined with other ones under the new system (i.e. different leave colors, Blood Rain, etc.)

Credits and Thanks

  • ForeverZer0, for the script
  • Ccoa, for the original base script
  • Agckuu Coceg, for some additional weather colors, and the inspiration to write this script.

Author's Notes

Hope you enjoy. Be sure to give some feedback and let me know how you like it.
I'm running out of ideas for weather effects, so if you have an idea for any weather effects you would like, let me know and I'll include them in future updates.
If any bugs are found, let me know and I'll be happy to try and fix them.
« Last Edit: February 18, 2013, 09:36:46 AM by Blizzard »
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.

Offline lilbrudder917

  • SDK's fault, I swear.
  • Awakened Visionist
  • **
  • Posts: 66
  • LV: 21
  • Gender: Male
  • It's a shroom.
    • View Profile
Re: [XP] Advanced Weather
« Reply #1 on: April 01, 2010, 07:19:37 AM »
I like. I'll probably use this. -levels up-

Just one thing, the demo link you gave leads to your Advanced Title demo, not Weather.  :P Might want to fix that.

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Advanced Weather
« Reply #2 on: April 01, 2010, 07:29:49 AM »
You know, you've shown up on this forum seemingly outta no where, and your slamming script after script out, and I have to say I'm not only impressed, but appreciative, cuz their all useful!

Thumbs up to you, and thanks again for another addition to the collection of l33t scripts here on Chaos Project.


--JeR
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline Tyril132

  • Transcended Spirit
  • ***
  • Posts: 182
  • LV: 11
  • Gender: Male
  • 8-bit Style, 16-bit Attitude
    • View Profile
Re: [XP] Advanced Weather
« Reply #3 on: April 01, 2010, 08:14:31 AM »
Great script, great effort, and I'm sure I'll make good use of it.

Level up.  :haha:
Lv. 7 Writer | Lv. 7 Composer | Lv. 7 Mapper | Lv. 4 Eventer | Lv. 0 Scripter | Lv. 1 Spriter
DSC Project Soundtrack
(click to show/hide)

Offline Agckuu Coceg

  • Transcended Spirit
  • ***
  • Posts: 154
  • LV: 0
  • Gender: Male
  • Hail to the Gin, baby!!!
    • View Profile
    • RMK-Space
Re: [XP] Advanced Weather
« Reply #4 on: April 02, 2010, 10:14:27 AM »
Good to see the superiority of leveled scripter like you. I just created a rough work on the code Ccoa, because I - just spriter, not scripter.

Glad I could inspire you to this remarkable work. I think it would be nice if I can use your work to improve my MAWS on your script base (or to make an addon on your base ...)

Level up, keep it up. Let them know that small communities can not be underestimated.

P.S. 5.04.2010. Actually, today I have already done. Look at your masterpiece in my cut. I hope you like it.
« Last Edit: April 05, 2010, 10:30:21 AM by Agckuu Coceg »
I'm not retarded, but I'm busy. Sorry for patience.


Offline Caligatio

  • Trained Member
  • *
  • Posts: 21
  • LV: -9
  • Gender: Male
  • See the rainbow in your eyes~
    • View Profile
Re: [XP] Advanced Weather
« Reply #5 on: April 05, 2010, 01:14:06 PM »
I like this one better than the original script, thanks!

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Advanced Weather
« Reply #6 on: April 08, 2010, 12:23:59 AM »
Ok, I finally fixed the Demo link. Sorry about that :(

I've updated the script to Version 1.1. (Script only, not the demo)

The following changes have been added:
   - New weather effects (4)
       - Bats
       - Bees
       - Fish (good for an underwater scene)
       - Ravens
   - Butterfly flight pattern has been improved. They move about a little bit more randomly
     instead of just flying in a more or less straight line until they reach the end of the screen.
   - Updated credits (Forgot to credit Blizzard for Bitmap2Code)
   - Some minor coding improvements

If anybody has been experienced any lag when the weather variation is changed, let me know.
I thought about re-writing the make_bitmaps and disposal methods to only dispose and re-cache
the weather pattern that is being changed, and leaving the weather bitmaps that are not being
used alone. This will give the CPU a little less to do, especially since more and more elaborate
weather effects are being added.

I haven't personally experienced any lag, but I see the possibility of it because of how it works, so if you have,
tell me and I'll get to work on it and make an updated version.
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.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Advanced Weather
« Reply #7 on: April 08, 2010, 12:28:42 AM »
Quote
Glad I could inspire you to this remarkable work. I think it would be nice if I can use your work to improve my MAWS on your script base (or to make an addon on your base ...)

Yes, by all means use any of this code you like. I wouldn't have really undertook this if your modification wasn't released.

That goes with pretty much all of my scripts. Anybody can use or modify the coding as they seem fit.
I hope others can learn from my work same as I learn from theirs.
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.

Offline Agckuu Coceg

  • Transcended Spirit
  • ***
  • Posts: 154
  • LV: 0
  • Gender: Male
  • Hail to the Gin, baby!!!
    • View Profile
    • RMK-Space
Re: [XP] Advanced Weather
« Reply #8 on: April 09, 2010, 06:00:30 AM »
It would be nice if you could make this and VX. I personally can not do this  :^_^':...
I'm not retarded, but I'm busy. Sorry for patience.


Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Advanced Weather
« Reply #9 on: May 15, 2011, 04:34:24 PM »
NECRO-BUMP!!!

Fixed the post and the dead links.
Added screenshots.
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.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 837
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Advanced Weather
« Reply #10 on: May 23, 2011, 07:05:44 AM »
can I add a request to make weather effect by event graphics?

ex : aluxes / arshes raining from the sky

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Advanced Weather
« Reply #11 on: May 23, 2011, 11:26:44 PM »
You can use the "User Defined" (Type 15) weather type for custom graphics that you don't want to have defined via script.
You can set the names images to load in the $WEATHER_IMAGES array, and set the movement with the other variables.

Code: [Select]
#-------------------------------------------------------------------------------
$WEATHER_UPDATE = false   # the $WEATHER_IMAGES array has changed, please update
$WEATHER_IMAGES = []      # the array of picture names to use
$WEATHER_X = 0            # the number of pixels the image should move horizontally (positive = right, negative = left)
$WEATHER_Y = 0            # the number of pizels the image should move vertically (positive = down, negative = up)
$WEATHER_FADE = 0         # how much the image should fade each update (0 = no fade, 255 = fade instantly)
$WEATHER_ANIMATED = false # whether or not the image should cycle through all the images
#-------------------------------------------------------------------------------

This part could be improved, and I may sometime soon here when I get a chance.  It is a remnant of Ccoa's base script that never really got changed.
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.

Lamsah

  • Guest
Re: [XP] Advanced Weather
« Reply #12 on: May 19, 2013, 08:27:01 PM »
Hi! I was wondering how i can call or set the weather animation to off but keep the audio running? What im trying to do is when the actor goes indoor then set the weather to off but keep the audio running and i cant seem to do just that. I know how to turn the entire weather off including audio but thats not what im trying to accomplish in the project. It seems to  come prebuilt for your advance climate script but not this one. I dont want to use the other script but only this one so is there a script call for my request in turning off the weather but leave the audio sound of the weather on? Thanks in advance =)

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1511
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP] Advanced Weather
« Reply #13 on: May 19, 2013, 08:39:03 PM »
Why don't you just play the sound effect by event? You use an event to teleport the player right? Why not start the background sound then, or just set up the sound effect in the map settings?

Lamsah

  • Guest
Re: [XP] Advanced Weather
« Reply #14 on: May 19, 2013, 11:04:36 PM »
Hi Zexion  :^_^':

That is indeed a good temporary solution but, what if it stopped raining outside because of the duration inside made the changed in weather. That would be kinda weird when the thunderstorm audio is still running inside and by the time u come outside, the rain stops... that would be weird?

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Advanced Weather
« Reply #15 on: May 20, 2013, 02:32:42 AM »
Then make it rain again with another script call. (?)

Or try this edit. You're only replacing the few lines in the script itself:
Code: [Select]
  def type=(type)
    return if @type == type
    @type = type
    case @type
    when 1, 5, 9, 100                            # Rain, Thunder, Real Thunder
      bitmap = @type == 100 ? nil : @rain_bitmap
      @thunder = true if @type == 5
      @realistic_thunder = true if @type == 9 || @type == 100
Use a type of 100 when calling the script.

By the way, FZer0 is practically dead. It's funny how you address to him as if he's still here.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Lamsah

  • Guest
Re: [XP] Advanced Weather
« Reply #16 on: May 20, 2013, 05:01:59 AM »
Hi KK20!

I didn't know Zero wasnt here anymore. :'(

Well, i can see what your saying by recalling the script to rain again but, i have the rain set to random power every certain amount of frames by event on parallel process set to different power of type weather to certain times. So, if i make it where an exit event of the area calls the rain again at random like you said, then it would look funny if the actor reenters and re-exits the area consistently just to see how it would turn out; the rain would change rapidly just by exiting and would look unrealistic. It would look funny to see the weather change so fast in a second by repeatedly reentering the area and in that case, player would know that weather changes when zoning the area. Thats giving the player control to manipulate the weather. So to fix this, i just need script call code for a temporary halt or pause to the weather while actor is indoor and at this, ill just set weather audio by event to make it feel that the weather outside is on OR find a way to temporarily disable the weather animation in the meantime while audio is currently playing and set by the weather script; example: rainstorm audio is running inside the house but no raindrops on screen and at the same time the global weather is constantly running with the random event i had set it to. Isn't there a script call for this? Sorry, but i am not a scripter and im still figuring things out. :shy:
 

Offline Gears

  • Trained Member
  • *
  • Posts: 49
  • LV: 1
  • Gender: Male
  • Advance wars/ Red alert CO
    • View Profile
Re: [XP] Advanced Weather
« Reply #17 on: January 20, 2015, 08:38:13 PM »
I seem to be having weird trouble getting the variations to work in the script. the script is included in KK20's Advance wars engine, but if i try to call it there trough the game with the $game_screen.weather(1, 25, 40, 1)  function, i get normal rain instead of the bloodrain that's supposed to fall. Any idea what might cause the lack of variation?

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Advanced Weather
« Reply #18 on: January 21, 2015, 11:37:35 PM »
Turns out I was a total noob at the time. I didn't alias Spriteset_Map#update. So just move this script below it and you should be good to go. I have it fixed in the later version, where I went back and cleaned up stupid copy-paste things I did.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Gears

  • Trained Member
  • *
  • Posts: 49
  • LV: 1
  • Gender: Male
  • Advance wars/ Red alert CO
    • View Profile
Re: [XP] Advanced Weather
« Reply #19 on: January 27, 2015, 02:58:11 AM »
I'm afraid i don't quite follow. I did move the weather script below the spriteset_Map script, but that did not seem to do anything.