Adding Weathereffects to Moghunter's Weather EX

Status
Not open for further replies.

Anyone

Veteran
Veteran
Joined
Aug 24, 2019
Messages
192
Reaction score
207
First Language
German
Primarily Uses
RMMV
Okay, so I've got an issue I need help with. Warning, I'm an absolute beginner who, for the most part, has no idea what he's doing.

The issue is with Moghunter's
RMV - Weather EX
.

I don't know the rules for posting someone else's scripts for support purposes, but just to be safe, I'll only link to the original page above where the script can be downloaded as part of his collection.

You'll probably have to do that to be able to help me, since I don't think the issue can otherwise be localized.

What I attempted was to add additional weather effects to the script, so that I have some more scrolling effects to work with, since, by default, only left to right and up to down are supported.

The first change I did was at line 244 under the Command Setup Weather part:
Code:
var mode_Real = Math.min(Math.max(mode, 0),35);
into
Code:
var mode_Real = Math.min(Math.max(mode, 0),37);
To have 2 more IDs to use, 36 and 37. I'm not sure if that's the correct way to go about.

There's also that line right in front of it:
Code:
var id_Real =  Math.min(Math.max(id, 0),$gameSystem._weatherEX_Data.length - 1);
But I've got no clue what to do with that.

The next change is at line 1482 at the Refresh Weather part:
At the original code
Code:
    case 35:
         this.setupParallax2(sprite,initial);       
        break;       
    default:
         this.setupRandom3(sprite);
        break;
I've inserted this:

Code:
    case 35:
         this.setupParallax2(sprite,initial);       
        break;       
    case 36:
         this.setupCloudParallax1(sprite,initial);       
        break;   
    case 37:
         this.setupCloudParallax2(sprite,initial);       
        break;   
    default:
         this.setupRandom3(sprite);
        break;
The next change I did was at 1612:
Into this:
Code:
    case 35:
        this.updateParallax2(sprite);
        break;
    default:
         this.updateRandom1(sprite);
        break;
I inserted this:
Code:
    case 35:
        this.updateParallax2(sprite);
        break;
    case 36:
        this.updateScroll(sprite);
        break;
    case 37:
        this.updateScroll(sprite);
        break;   
    default:
         this.updateRandom1(sprite);
        break;
    };
The this.updateScroll(sprite); is the same used for the FogXP1 and FogXP2 effect, which are the ones I'm trying to replicate as additional weathers, just with a different moving angle.

Then I've modified the script at line 2744 at "need Update Position":
I've modified this:
Code:
SpriteWeatherEX.prototype.needUpdatePosition = function() {
     if (this.mode() === 28) {return false};
     if (this.mode() === 31) {return false};
     if (this.mode() === 32) {return false};
     if (this.mode() === 33) {return false};
     if (this.mode() === 34) {return false};
     if (this.mode() === 35) {return false};
     return true;
};
to this:
Code:
SpriteWeatherEX.prototype.needUpdatePosition = function() {
     if (this.mode() === 28) {return false};
     if (this.mode() === 31) {return false};
     if (this.mode() === 32) {return false};
     if (this.mode() === 33) {return false};
     if (this.mode() === 34) {return false};
     if (this.mode() === 35) {return false};
     if (this.mode() === 36) {return false};
     if (this.mode() === 37) {return false};
     return true;
};
Since I figure if the FogXp effects I'm basing it on (32&33) don't need an update, my variants probably don't either. I'm assuming that this update position is for weather effects randomly popping up on screen.

Lastly at line 2465 I've copied the two Setup Fog XP1 & 2 parts and added my own variants underneath them:
Original:
Code:
//==============================
// * Setup Fog XP 1
//==============================
SpriteWeatherEX.prototype.setupFogXP1 = function(sprite,initial) {
     sprite._ani[1] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100;
     sprite._ani[2] = 0;
     sprite._sy = Math.randomInt(100);
};

//==============================
// * Setup Fog XP 2
//==============================
SpriteWeatherEX.prototype.setupFogXP2 = function(sprite,initial) {
     sprite._ani[1] = 0;
     sprite._ani[2] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100;
     sprite._sy = Math.randomInt(100);
};
My variants:
Code:
//==============================
// * Setup CloudParallax1
//==============================
SpriteWeatherEX.prototype.setupCloudParallax1 = function(sprite,initial) {
     sprite._ani[1] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100;
     sprite._ani[2] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100;
     sprite._sy = Math.randomInt(100);
};

//==============================
// * Setup CloudParallax2
//==============================
SpriteWeatherEX.prototype.setupCloudParallax2 = function(sprite,initial) {
     sprite._ani[1] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100 * (-1);
     sprite._ani[2] = (this._speed + 0.1 + Math.random() * 2)  * this.speed() / 100 * (-1);
     sprite._sy = Math.randomInt(100);
};
Using the sprite,_ani math for the Fog XP effects above has produced the exact scrolling effect I want.
But assigned to my new effects 36&37, they don't do anything, even though at the above case 36 & 37, the setupCloudParallax1 should connect to this part.

The update section for update.scroll that both the fog xp effects and mine use I left untouched like this:
Code:
//==============================
// * Update Fog 5
//==============================
SpriteWeatherEX.prototype.updateScroll = function(sprite) {
   sprite._sx -= sprite._ani[1];
   sprite._sy -= sprite._ani[2];
   sprite.origin.x = $gameMap.displayX() * $gameMap.tileWidth() + sprite._sx;
   sprite.origin.y = $gameMap.displayY() * $gameMap.tileHeight() + sprite._sy;   
};
And yet, it's not working.
when I call the effect via plugin command:
weather : 0 : 36 : 2 : 100 : 0 : Fog_01c
and
weather : 0 : 37 : 2 : 100 : 0 : Fog_01c
It only shows the Fog_01c picture as a small square in the upper left hand corner of the screen, static and unmoving.

This is what it should look like:
one.png

This is what it looks like:
two.png

I'd really appreciate it if someone could help me with this issue.
 

Anyone

Veteran
Veteran
Joined
Aug 24, 2019
Messages
192
Reaction score
207
First Language
German
Primarily Uses
RMMV
Update: The issue is resolved. The thread can be closed.
---------------------------------------------------------------

Answer:
Everything above is correct, but I missed adding entries to the tilling weather part.
Once I added entries 36 and 37 to it, the fog layer correctly adapted to the changes.

Code:
//==============================
// * is Tilling Weather
//==============================
SpriteWeatherEX.prototype.isTilingWeather = function() {
    if (this.mode() == 32) {return true};
    if (this.mode() == 33) {return true};
    if (this.mode() == 34) {return true};
    if (this.mode() == 36) {return true};
    if (this.mode() == 37) {return true};
    return false;
};
With this, and the changes above, I managed to introduce custom variants of scrolling overlay effects to the plugin.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,007
Reaction score
4,746
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Finally did a test of sorts for the opening of my game... ... including this shot here.
My current status!?
It might be... QUAKE!!! :o
At least that was true several hours ago. :p
Quexp wrote on Shaz's profile.
I absolutely love your profile/pic! :kaoluv:
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
I made a battle results screen for my minigame.. any feedback? :)

Forum statistics

Threads
100,685
Messages
978,408
Members
132,310
Latest member
hnhat
Top