Multi Layer Fog

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
251
Reaction score
376
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
40,098
Reaction score
13,704
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
251
Reaction score
376
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
40,098
Reaction score
13,704
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
251
Reaction score
376
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
40,098
Reaction score
13,704
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
251
Reaction score
376
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
40,098
Reaction score
13,704
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
251
Reaction score
376
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
40,098
Reaction score
13,704
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
251
Reaction score
376
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 Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top