Multi Layer Fog

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?
Can you please show a screenshot of (or copy/paste) your fog command, as well as your map properties? I'll take a look.
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.
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.
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.
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?
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.
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.
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).
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.
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...😅

Anyways, wonderful script and thanks so much for your support again! A mere like couldn't express my gratitude here.
I don't know if anyone else was having this problem, but for me, when I'd transfer between two maps with fog, the new fog's blend type wouldn't update until the scene changed; it would be the same as the previous fog's. I eventually fixed this by editing the script slightly. I thought I'd post my edit here, just for the sake of anyone else who's having this problem.

The tiny edit I made is clearly labelled with "#EDIT".
Hope Shaz doesn't mind.
Hope Shaz doesn't mind.


I don't mind at all! What do you mean, "until the scene changed"?

Did you post something? I don't see it. If you let me know, I can throw it into the original script.

@Kes, this might be the real solution to your old problem.
"until the scene changed"?
I understand this. It's the same as another script I had a problem with a long time ago.
The effect doesn't update until the scene changes, that means something like opening the menu and exiting. Going from scene_map to scene_menu.
The tiny edit I made is clearly labelled with "#EDIT".
Please share, I would like to know as well.
Huh... I swore I attached the file, but it looks like I didn't!
And yes, it's just like Roninator2 said, about the scene changing.

All I did was add this line at 339:
self.blend_type = @fog.blend_type #EDIT

EDIT
Well it looks like I'm having some trouble attaching a file to this post.
I'll do this instead:

Spoiler: class Plane_Fog < Plane
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
update_bitmap
update_move
update_tone
update_opacity
self.blend_type = @fog.blend_type #EDIT
end
@BrokenAnkle21
Thank you for finding this solution. It is been a problem for me for a long time.
@Shaz
Thank you for the alert.

@Kes​

You're very welcome. I sort of figured I couldn't have been the only one with this issue.
Believe it or not it actually took me an entire afternoon to figure this out.
Bug fixing can be a real migraine.
Fix added to both versions. Thank you again for this.
@Shaz
You're quite welcome.
I've been stalking the forums from the shadows for years now; it was about time I gave something back.
Sorry to dig up such an old post, I just have absolutely know clue what's going on.
Can you try adding this, as a temporary NEW script? If it works, and you have multiple save files, open ALL your save files so this code runs, then save them again, and then you can get rid of the temp script.

Code:
class Game_Screen  def create_fog    @fogs = Game_Fogs.new  endendclass Spriteset_Map  alias save_fix_update_fogs update_fogs  def update_fogs    $game_map.screen.create_fog if !$game_map.screen.fogs    @fog_planes = [] if !@fog_planes    save_fix_update_fogs  endend
Let me know if that helps.
What should I do if this doesn't work? Currently have this as it's own script along with the full Multi Layer Fog script and my game is crashing on startup.
1660263418550.png

Am I understanding your instructions wrong? Does this fix script go somewhere else?
I'm in the exact same dilemma Kes was in back in 2013 but I'm not sure what the difference is here.

Edit: Figured out how to make it stop crashing. Had no idea the large spaces were supposed to be new lines, and there needs to be three ends at the very end, not two. Now my problem is that the fix just does nothing. I still get the same error I was getting without it.
1660264527925.png

Very frustrating.

Original thread: https://forums.rpgmakerweb.com/threads/multi-layer-fog.18835/