Fog

Fog

2015.10.31

by Shaz

Introduction

This plugin allows you have a moving fog overlay on a map.

How to use

Add to your plugins folder (file name should be Fog.js).  There are no parameters to set.

Create a folder called fogs in your img folder.  Save the fog file in there.

Plugin call:

ChangeFog filename scroll-x scroll-y opacity

scroll-x and scroll-y indicate the movement (negative numbers move up or left, positive numbers move down or right).

opacity is 0-255

scroll-x, scroll-y and opacity can all be numbers or a formula (eg - $gameVariables.value(15) to pull the value from a variable).

You can call multiple times on the same map to speed up or slow down the fog movement.

Fog is removed when you leave the map.

Plugin

Download from pastebin

Credit

- Shaz

Terms

- free for use in commercial games
where I can give hug o3o?

edit : oh you too you didn't find how to dispose sprite right?
mmm ... I just followed the logic used with parallaxes.  I'll take a look.
Any way to use more than one at a time or even set the Z and use fogs for backgrounds to?
mmm ... I just followed the logic used with parallaxes.  I'll take a look.
actually nothing is disposed in MV ...who can actually provoke memory leak with a long term use because more you use your picture more it's stay in memory....I spoke with the people and the only thing's who are actually the method for dispose...well ramiro explained me is...

sprite.destroy();but I am unsure 

they just not see any ways to dispose properly your sprite .dispose don't even exist in MV

Any way to use more than one at a time or even set the Z and use fogs for backgrounds to?
no Z don't exist :/
Okay then what is in it's place?

What would be Z in MV?

There has to be a way to do layers and overlapping things.

By the way, i dunno what i am doing wrong but it keeps telling me x is not defined.

Maybe i am doing the plugin call wrong.

ChangeFog BigClouds scroll-x = 52 scroll-y = 52 opacity = 255

What am i doing wrong?
That's off topic for this thread.  If you want to discuss how MV handles z-index, please go to a different thread.

I MAY add multi-fogs down the track - thought about it, but I can't really see much use to do it when you're using it AS a fog, and since parallaxes are built in, ...  so at this stage I'm just keeping it simple because I have a whole heap of scripts that I want to convert.

ChangeFog BigClouds 52 52 255
255 means your fog will be fully opaque.  That's black.  You'd only do that if you actually have the transparency built into the image.

And 52 is probably WAY too high for scrolling.  Look at how parallaxes scroll when you just set their values to 1 or 2.
Is there any way to lock it so it scrolls with the map and not with your movement?

As it is, the fog kinda.. i can't explain it any better than what i just did.

It moves strangely when your party moves around.

I suck at describing things.

Also.. no blending options?
No, no blending options, because TilingSprite doesn't seem to support them.

I'll see what I can do about the "still" fog scrolling with the map.
That's odd...

It sounded like when MV was announced, that with JS there would be so many things that could be done, so to hear about anything that can't be done is rather disappointing.

I know there is blending options for pictures, i think it's just addition though.

I'm guessing you mean, anything that repeats like the fog or backgrounds do?

If it repeats it can't use any sort of blending?

I guess all i can ask for is a way to use more than 1 fog over another, and a way to lock it to a map, and that would be all i could ask for.
For doing this -

glass%20of%20champagne_zpswpqwsbpb.jpg
hey shaz actually why not taking inspiration of Game_Picture? 

it's build a false z value so you can make unlimited fogs
Please try to follow the format better in the future.

http://forums.rpgmakerweb.com/index.php?/topic/74-complete-script-submission-guidelines/

Screenshots
Including a screen shots of your script in-game is helpful. This does not apply to all scripts, specially to those which don't have any visual effect.

🤣   🤣   🤣  
Yeah, no.  You know what fog looks like in game.  If you don't, then you have no need for this plugin 😉
Trying to mod a staff member?  You must like walking the razors edge.
Fog is removed when you leave the map.
If we return to the same map, the fog will return right? (like going into and out of a house or something)
Just checking - there is no way to turn a fog off other than by leaving the map?  Also no way to alter the opacity of the fog while on the same map?
Just checking - there is no way to turn a fog off other than by leaving the map?  Also no way to alter the opacity of the fog while on the same map?
they actually have simples ways to do that by doing 

//scriptcall$gameMap._fogname = 'filename';it's will change the filename in game Unless shaz implemented the option to change the fog name with a plugin command...

the risk is also but I am unsure due she's inputed this via a anonymous function it's block the script call but I am unsure since it's a alias so...

anyways let's not get lost in scope stuffs

I do think for the moment Shaz is still experimenting but I do think she's will add more options and if she's don't have times I will try to help her a little :3
@nio

Thanks for that, but I was not asking about changing the name of the fog file (= changing the fog being displayed) but turning it off completely or changing the opacity of the same fog.
@nio

Thanks for that, but I was not asking about changing the name of the fog file (= changing the fog being displayed) but turning it off completely or changing the opacity of the same fog.
lol setting the fog name to null should erase it if I remember right

and doing this : 

$gameMap._fogOpacity = value;will change the opacity of the setting UNLESS shaz didn't inputed this into the update

Original thread: https://forums.rpgmakerweb.com/threads/fog.48653/