Multi Layer Fog

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
Just discovered that if I use fogs but without assigning them movement with Version 2, the "stationary" fogs are effectively "anchored" into the map instead of the screen creating a looping series of the fog image across the map, making the usage of stationary fogs pretty much impossible.

Interestingly this isn't the case for the original version, so I'd imagine the logic behind 'fog no longer sticks to player' has also prevented non-moving fogs from following the player (and the screen), while this can obviously be circumvented by simply using pictures instead of fogs, is there any chance that can be fixed?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,225
First Language
English
Primarily Uses
RMMV
Can you please show a screenshot of (or copy/paste) your fog command, as well as your map properties? I'll take a look.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
The fog command:
show_fog(1, "Fog_sun01", 0, 255, 0, 100)

I am basically using a non-scrolling fog (ie. sunlight) with the size of 640x480 on an empty, blank map straight out of a fresh project so there are no map properties, and yes this is tested on a new project just to be sure.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,225
First Language
English
Primarily Uses
RMMV
So you want it to not move with the map at all? Why not just use a picture?

It's anchored to the map intentionally. Would require a rewrite to anchor it to the screen, and then your fogs on other maps would be the same.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
So that was intended behavior? That's fine then. Thought it was weird since the first version was able to do it, guess I'll make due with the picture method instead. Thanks.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,225
First Language
English
Primarily Uses
RMMV
The changes between the two versions is very minor, to fix the "stick with player" issue. It added the offset based on the map display position, and nothing else. If you don't want that behaviour, why not just use the original?
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
I simply preferred the fog movement of the 2nd version as it looked more natural for my fogs under normal circumstances and will work regardless of movement speed, and several other fog scripts I've tested before also works that way but does not anchor stationary fogs to the map. Further testing may prove me wrong however.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,225
First Language
English
Primarily Uses
RMMV
No, because one version used the map and the other didn't. I might be able to write a little mod for you to use both versions and just issue a command when you want to use the less-frequent one.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
Thanks for considering that option, I'm deeply grateful for this.

Simply a way to toggle between the two "versions" would be a nice addition to the script (As long as it doesn't require you to rewrite the thing or do too many modifications). I'm sorry if this sounds nitpicky but that's all it really needs for now to address the drawback of each version (if possible).
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,225
First Language
English
Primarily Uses
RMMV
Okay, I haven't tested this, but give it a go ...

Install version 2 of the script.
Find this method:

Code:
    def update_move
        @sx2 -= @sx / 8.0
        @sy2 -= @sy / 8.0
        @ox = $game_map.display_x * 32 + @sx2
        @oy = $game_map.display_y * 32 + @sy2
    end
and replace it with this:
Code:
    def update_move
        if $game_switches[15]
            @ox = @sx / 8.0
            @oy = @sy / 8.0
        else
            @sx2 -= @sx / 8.0
            @sy2 -= @sy / 8.0
            @ox = $game_map.display_x * 32 + @sx2
            @oy = $game_map.display_y * 32 + @sy2
        end
    end
Replace 15 with an available switch number. Then prior to each show_fog call, turn switch 15 (or whatever number you use) on to activate version 1, or turn it off to activate version 2. If you only want to use version 1 for a single map, you could just turn the switch on before the show_fog on that one map, then turn it off whenever you leave the map, and not have to worry about it on any other map.

Let me know how it goes.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
210
Reaction score
300
First Language
Not English
Primarily Uses
RMVXA
Sorry for the late reply, finally managed to get some time to open RPGMaker again after two consecutive busy workdays (heh)..

Your method works as expected, though I needed to make a little correction by also including the switch check on the def show method (on line 174), else it pops up an error when you try to toggle the switch back to off again when the fog is in place (probably not necessary since fogs are disposed of upon map change but just to be on the safe side) I feel so dumb now for not realizing the minor differences between each versions and just opt to combine the two with a simple if-else statement...:kaoswt:

Anyways, wonderful script and thanks so much for your support again! A mere like couldn't express my gratitude here.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I have been listening to the new music tracks for MZ included in the sample game projects ... for way too long. Quite catchy!
Small rant: While using SRD Hud maker for a battle hud, I typed in the wrong script call and got an error, but then forgot to delete the piece that caused the error before closed the Hud maker and hit F5 to restart the game. Now everytime I engage in a battle my game crashes...
:kaolivid:
Would Jump into Javascript be best off continuing to break down the MV core files, or would people prefer a quick detour to cover everything that's changed in the core from MV to MZ?

Forum statistics

Threads
100,531
Messages
976,930
Members
132,081
Latest member
Kaezyelnatz
Top