Fog

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
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
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,361
First Language
French
Primarily Uses
where I can give hug o3o?

edit : oh you too you didn't find how to dispose sprite right?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
mmm ... I just followed the logic used with parallaxes.  I'll take a look.
 

MikePjr

Artist
Veteran
Joined
Nov 7, 2012
Messages
555
Reaction score
234
First Language
English
Primarily Uses
Any way to use more than one at a time or even set the Z and use fogs for backgrounds to?
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,361
First Language
French
Primarily Uses
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 :/
 

MikePjr

Artist
Veteran
Joined
Nov 7, 2012
Messages
555
Reaction score
234
First Language
English
Primarily Uses
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?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

MikePjr

Artist
Veteran
Joined
Nov 7, 2012
Messages
555
Reaction score
234
First Language
English
Primarily Uses
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?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
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.
 

MikePjr

Artist
Veteran
Joined
Nov 7, 2012
Messages
555
Reaction score
234
First Language
English
Primarily Uses
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.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
For doing this -

 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,361
First Language
French
Primarily Uses
hey shaz actually why not taking inspiration of Game_Picture? 

it's build a false z value so you can make unlimited fogs
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
Yeah, no.  You know what fog looks like in game.  If you don't, then you have no need for this plugin ;)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
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?
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,361
First Language
French
Primarily Uses
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
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
@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 kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,361
First Language
French
Primarily Uses
@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
 

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

Latest Threads

Latest Profile Posts

Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Forum statistics

Threads
97,980
Messages
948,320
Members
129,243
Latest member
SoloJou
Top