OcRam - Weather_EX plugin

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
510
Reaction score
597
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
510
Reaction score
597
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
181
Reaction score
146
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
510
Reaction score
597
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
86
Reaction score
23
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
510
Reaction score
597
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
86
Reaction score
23
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
86
Reaction score
23
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
510
Reaction score
597
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
86
Reaction score
23
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:

OpenTangent

Villager
Member
Joined
Mar 15, 2020
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMV
I've set up my weather pools and my weathers, I've added the note tags to the tilesets (I've also tried adding them to the individual map notes) . I've tried adding [auto-weather on] to a parallel event on each map. I've tried leaving the game running for about 15 minutes to see if it's just a low probability issue. I've triple and quadruple checked the instructions yet I don't get any weather effects in any of my maps.

[weather-random *] works immediately but then there's a chance of getting snow in a desert biome for example. I've had no trouble setting up your time and lighting plugins (they are incredible by the way, well done), I just can't figure out this weather plugin. What am I doing wrong? I use a lot of Yanfly plugins.
 

OpenTangent

Villager
Member
Joined
Mar 15, 2020
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMV
I found the problem; the plugin help text says <weather_pools:1,2,3> but the instructions in this forum thread say <weather-pools:1,2,3> (the one uses underscore and the other uses hyphen). I copy/pasted the plugin help text notetags which used the underscore. You should fix that in the help text so that others don't make the same mistake.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
510
Reaction score
597
First Language
Finnish
Primarily Uses
RMMV
I found the problem; the plugin help text says <weather_pools:1,2,3> but the instructions in this forum thread say <weather-pools:1,2,3> (the one uses underscore and the other uses hyphen). I copy/pasted the plugin help text notetags which used the underscore. You should fix that in the help text so that others don't make the same mistake.
Thank you for reporting this issue and I'm really sorry for the trouble it has caused,

I have now fixed this (version remains as v2.08, since there are no code changes).
 

OpenTangent

Villager
Member
Joined
Mar 15, 2020
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thanks for the quick response @OcRam. Another thing; I can't seem to hear any audio while <indoors> except for the sound of thunder. I have set [Disable weather indoors] to "false". Am I missing something?

One last last thing; before I switched to your weather plugin I wrote my own weather system (which was very basic in comparison to yours). With mine, instead of reducing just volume indoors I also reduced pitch which sounded quite good for an indoor environment. In your plugin I found AudioManager._currentBgs[2/3].pitch and I added * 0.2 at the end. Hopefully that works but I can't test it because I don't hear the weather audio indoors.

Other than that I am very pleased with all your plugins, they are a huge improvement over my own attempts at a weather and day/night system and some of the other plugins will be very useful too. I'm definitely going to buy the full 40€ commercial pack for my project. Thanks for all the great work.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Sometimes you think you know people, then the next thing you know it's below freezing outside, and they're falling from the sky. And no two are exactly alike.
Karen: Hi, I have a condition that prevents me from wearing a mask. :)

Employee: Can you tell me what it is?

Karen: >:(
Feeling a little overwhelmed... There are so many things to do.
- Building a simple website for portfolio
- Setup *******
- Manage social media
There are so many things inside of these tasks :(
Meet the cute little ghost, FhooFhoo. :kaopride:

Forum statistics

Threads
99,577
Messages
966,852
Members
131,234
Latest member
frepoppo
Top