OcRam - Weather_EX plugin [v2.07 updated 2020/03/14]

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
great update. i've implemented it somewhat, but am having some difficulty with a custom weather cycle. i'm trying to do weather pools by Region ID. i think i got it for the most part, but whenever i set a random weather pool, the debug F8 runs indefinitely. i have another solution that i'm working on now.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
473
Reaction score
563
First Language
Finnish
Primarily Uses
RMMV
great update. i've implemented it somewhat, but am having some difficulty with a custom weather cycle. i'm trying to do weather pools by Region ID. i think i got it for the most part, but whenever i set a random weather pool, the debug F8 runs indefinitely. i have another solution that i'm working on now.
Thank you for the message,

You set random weather in common event or do you use parallel event or how do you call random weather?

EDIT: BTW you got different climates in same map?
 
Last edited:

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
Thank you for the message,

You set random weather in common event or do you use parallel event or how do you call random weather?

EDIT: BTW you got different climates in same map?
yes and yes. I had to also come up with a custom duration CE, which turns on a debit back, which checks a another switch based on region id variable, which then sets the weather pool.

for my world map I have several biomes such as wasteland, tundra, arctic, desert, plains, forest, etc. each with their own weather pool.

Hope that helps lol.
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
@OcRam so this is the code i added under "function setRandomWeather(pool)" at line 1084 to the Weather plugin to check by Region where game variable 12 is my region ID, checked by a parallel process:
switch ($gameVariables.value(12)) {
case 1:
_possibleWeatherPools = [1,2];
break;
case 2:
_possibleWeatherPools = [3,4];
break;
}
and it almost works for Region ID 1 (default pools 1 and 2), and Region 2 (default pools 3,4). it works fine in region 1, but the weather's cycle very fast, and when i move to region 2, it goes to snow and stays snow permenantly regarldless if i go back to region 1. SO CLOSE lol. i may have to not use the built-in weathers and design my own, but i feel i'm on the right track. all of this would not be possible without your work though.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
473
Reaction score
563
First Language
Finnish
Primarily Uses
RMMV
@OcRam so this is the code i added under "function setRandomWeather(pool)" at line 1084 to the Weather plugin to check by Region where game variable 12 is my region ID, checked by a parallel process:
switch ($gameVariables.value(12)) {
case 1:
_possibleWeatherPools = [1,2];
break;
case 2:
_possibleWeatherPools = [3,4];
break;
}
and it almost works for Region ID 1 (default pools 1 and 2), and Region 2 (default pools 3,4). it works fine in region 1, but the weather's cycle very fast, and when i move to region 2, it goes to snow and stays snow permenantly regarldless if i go back to region 1. SO CLOSE lol. i may have to not use the built-in weathers and design my own, but i feel i'm on the right track. all of this would not be possible without your work though.
Hi,

Try this:

JavaScript:
function setRandomWeather(pool) {

        if (_possibleWeatherPools == null) getWeatherPools();

        switch ($gameVariables.value(12)) {
            case 1:
                _possibleWeatherPools = [1, 2]; pool = null;
                break;
            case 2:
                _possibleWeatherPools = [3, 4]; pool = null;
                break;
        }

        var randomized_pool_id = 0;
        randomized_pool_id = (!pool) ? _possibleWeatherPools[Math.randomInt(_possibleWeatherPools.length)] : pool;

        if (randomized_pool_id !== undefined) {
            _this.debug("Randomized pool id:", randomized_pool_id);
            _currentRndPool = getJsonPoolById(randomized_pool_id);
            getPossibleWeathers(randomized_pool_id);
            var randomized_weather_id = _possibleWeathers[Math.randomInt(_possibleWeathers.length)];
            if (randomized_weather_id !== undefined) {
                _this.debug("Randomized weather id:", randomized_weather_id);
                setWeatherById(randomized_weather_id, (Math.randomInt(8) + 1));
            }
        }

    }
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
Hi,

Try this:

JavaScript:
function setRandomWeather(pool) {

        if (_possibleWeatherPools == null) getWeatherPools();

        switch ($gameVariables.value(12)) {
            case 1:
                _possibleWeatherPools = [1, 2]; pool = null;
                break;
            case 2:
                _possibleWeatherPools = [3, 4]; pool = null;
                break;
        }

        var randomized_pool_id = 0;
        randomized_pool_id = (!pool) ? _possibleWeatherPools[Math.randomInt(_possibleWeatherPools.length)] : pool;

        if (randomized_pool_id !== undefined) {
            _this.debug("Randomized pool id:", randomized_pool_id);
            _currentRndPool = getJsonPoolById(randomized_pool_id);
            getPossibleWeathers(randomized_pool_id);
            var randomized_weather_id = _possibleWeathers[Math.randomInt(_possibleWeathers.length)];
            if (randomized_weather_id !== undefined) {
                _this.debug("Randomized weather id:", randomized_weather_id);
                setWeatherById(randomized_weather_id, (Math.randomInt(8) + 1));
            }
        }

    }
it works! many thanks! i'm sure i can find a way to change it automatically when you enter a new region (shouldn't be hard). i can use this same template as well to set weather by day phase now (and inevitably temperature) and it will still be automated. i'm one step closer to having a complex weather system for RMMV. none of would be possible without your work @OcRam.
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
Failed but not giving up. I’ll have to go back into using CEs but now I’m adding temperatures by region. And yes, I’ve worked all the math out. And yes again, weather will be influenced by the temperature and current day phase. My goal is to build the most complex weather system know to the RM community.
 

BurningOrca

Veteran
Veteran
Joined
Apr 14, 2019
Messages
174
Reaction score
130
First Language
German
Primarily Uses
RMMV
Just one quick little notice:
In
Code:
Weather.prototype._createBitmaps
you create 4 bitmaps per weather type, but in
Code:
Weather.prototype._rebornSprite
you only ever use 3 of them as
Code:
Math.randomInt(3);
only returns integers from 0 to 2 unless overwritten by you. But I haven't found any overwrite.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
473
Reaction score
563
First Language
Finnish
Primarily Uses
RMMV
Just one quick little notice:
In
Code:
Weather.prototype._createBitmaps
you create 4 bitmaps per weather type, but in
Code:
Weather.prototype._rebornSprite
you only ever use 3 of them as
Code:
Math.randomInt(3);
only returns integers from 0 to 2 unless overwritten by you. But I haven't found any overwrite.
Thank you for the message,

I will fix this in next version. I have somehow missed this - I remember that I tested it with 4 bitmaps, but result wasn't as nice as with 3 bitmaps so I have forgot to edit _rebornSprite.

Anyways nice job! And thank you for reporting it!
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
53
Reaction score
6
First Language
English
Primarily Uses
RMMV
This plugin is trying to call audio/bgs/rain3.ogg -- which is a file I don't have. Is that something I am supposed to download somewhere? Even if I create a new project there isn't a rain3.ogg, so it doesn't seem like it's part of the RTP.

I went ahead and put something in there, but I'm just curious.

Also was wondering if there's anything in place to adjust lighting to match the automated weather system, so that it gets slightly darker out when it starts to rain for instance, and darker still during a storm.
 
Last edited:

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
473
Reaction score
563
First Language
Finnish
Primarily Uses
RMMV
This plugin is trying to call audio/bgs/rain3.ogg -- which is a file I don't have. Is that something I am supposed to download somewhere? Even if I create a new project there isn't a rain3.ogg, so it doesn't seem like it's part of the RTP.

I went ahead and put something in there, but I'm just curious.

Also was wondering if there's anything in place to adjust lighting to match the automated weather system, so that it gets slightly darker out when it starts to rain for instance, and darker still during a storm.
Thank you for the message,

I'll change default rain BGS.
Actually this plugin will adjust weather effect darker than normal, but it's great idea to have it as plugin parameter!
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
53
Reaction score
6
First Language
English
Primarily Uses
RMMV
Cool, thanks. Yeah, when I've made my less elegantly scripted weather systems in previous iterations of RPGmaker I always had a slow fade to screen tint come before the rain actually starts to fall.

It helps sell the illusion... like, storm clouds are rolling in and then the rain hits.
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
53
Reaction score
6
First Language
English
Primarily Uses
RMMV
Also, I noticed that if I quit to main menu during an automated weather event the BGS will keep right on playing. Is there something I should be doing to kill it? A common event or something?
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
473
Reaction score
563
First Language
Finnish
Primarily Uses
RMMV
Also, I noticed that if I quit to main menu during an automated weather event the BGS will keep right on playing. Is there something I should be doing to kill it? A common event or something?
Thank you for the message,

Are you using any audio plugins? All BGS should stop automatically when you quit. Also plugin order matters a lot.
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
53
Reaction score
6
First Language
English
Primarily Uses
RMMV
None that are specifically audio related, but some that call sound effects at various points. In my main project I have BGS audio which is getting called by events and tied to maps -- those all stop when I quit to menu. Only the weather effects keep going.

As a test, I just created a new project, installed this plugin alone, and was able to recreate the problem. Could be I'm doing something wrong. Here were the steps I took:

1. Create new project.
2. Copy OcRam_Weather_EX.js into plugins folder.
3. Copy images to \img\ocram
4. Put random rain sound effect in as audio\bgs\rain3.ogg
4. Enable plugin.
5. Create map, tag with <weather-pools:1>
6. Turn down volume on main menu BGM so that you can hear anything at all.
7. Start new game, get rain or other weather. I waited until the effect had fully faded in. Not sure if timing matters.
8. Quit to main menu, weather BGS still playing. Map BGS (if any) is not.

On this new test project I have only the following running:

Capture.JPG

Edit: It also keeps doing thunder sounds in case those are called differently.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Currently playing final fantasy 3 on DS. It's an old one but its a classic.
BCj
Gotta love some gossip :D
Please do not buy games from g2a.com. The sellers have total power over you. The website has many scam sellers. It looks cheap, but the key code didn't work.
A while back I was having fun making my own custom tiles, then I hit carpet... why is it so difficult!? Lol.

Forum statistics

Threads
97,946
Messages
948,074
Members
129,200
Latest member
jakeofblades
Top