Fog in maps

Hello, I'm looking to see an easy and functional solution to adding fog to maps, I desire to have these only happen on certain maps and if possible controlled by map notes/events etc if possible.

Basically I'm looking for something that gives me the fog effects much like RPG Maker Xp provided. Why in gods name does Enterbrain leave awesome things out with there newer programs is beyond me.

I have looked on the script list provided here on the forums but sadly the scripts are not quite satisfactory, there was one script I found that looked promising but required XP itself. I used to have XP on my old computer several years back, but since then we no longer have it handy.

Fog graphics are no problem for me as there are many sources on the internet and myself am a capable artist. Preferably I'd like to be able to tinker how the fog moves/speed/transparency/screen looping but whatever can do the job I do not mind.

Thank you for your time 🙂
http://forums.rpgmakerweb.com/index.php?/topic/18835-multi-layer-fog/


based on XP's fog logic


There shouldn't be any scripts here for Ace that require you to have XP, unless they use the XP fog graphics, and since you said you can make your own, that wouldn't be an issue for you.
Ah I think this is the script I came across earlier.

How can I make sense of this further?

show_fog(id, "filename", hue, opacity, blend_type, zoom, speed_x, speed_y, z)
I have a file called Fog, and input the Id as 80 just like you would do with "picture 80" on a picture command, the rest I am not sure how to work it out without crashing, I am assuming the speed functions act as the direction the fog travels and at what speed?
There are some examples in that thread you could play around with.


id will be 80


"filename" will be "Fog"


hue is the colour. It defaults to 90. If you want to experiment, change it a bit - I'm not sure what the allowable ranges are (if you go to the help file in Ace and type in HUE on the search panel, it might tell you what the lower and upper limits are). If you don't want to experiment with that just yet, put in 90 there.


opacity is how transparent it will be. The default is 64.


blend type is 0 for normal, 1 for add and 2 for subtract. The default is 0.


zoom is a percent - the default is 200.


sx and sy is the movement. If you want it to scroll slowly to the left, put 1 for sx; if you want it to scroll quickly, make it 3. Just experiment with the numbers.


z is the layer the fog will go onto - if you leave it out, it'll show above the characters, just like a normal fog. But the ability is there to use it as a parallax, so you could try setting it to a negative number to see if it will display behind the tiles (you would need a part of the map that has no tiles in order for this to be effective, of course).


You could actually just input the id and the file name. As everything else has defaults, it will use those values if you don't key them in.
Ah it's starting to show better now, i've experiemented a bit more particularly on the speed settings.

This is what I have

show_fog(80, "Fog", 0, 60, 0, 150, 3, 1, )
For some reason the fog graphic does not scroll, I've muddled with the numbers for the sx and sy but nothing happens.

Sorry if my posting here is straying off the topic you linked, I did look to find answers.
Does it have to be XP style? As far as i remember, XP's fog has the ability to scroll a few times slower than the VX parallax.

If you are after that, then this script probably does what you want:

http://blueredzone.com/script/vxace/vxace_mapfog.html

To use the fog, add this to your map's note box:

==マップフォグFILENAME[XSPEED,YSPEED,LAYER_Z,OPACITY,BLEND_TYPE]==

FILENAME = the file name you have in parallax folder (without the file extension ".xxx")

XSPEED, YSPEED = how fast you want the fog to scroll (20 = 1 frame/pixel)

eg, -5, 8

LAYER_Z = the Z layer the fog should be showing

eg -1 = below map tiles, 0~50 = below weather, 51~99 = below message window, 101~ up will probably shows it above everything.

OPACITY = the alpha setting of the fog

eg. 0 = full transparent, 128 = half, 255 = no transparency

BLEND_TYPE = the blend type of the fog

eg 0 = normal, 1 = add in, 2 = substract

Usage example: 

==マップフォグfogfile[-5,2,10,128,0]==

And if i remember correctly, you own a copy of XP right? So you might even want this script that allows you to directly loads XP maps into VX ace. 😉

http://littledrago.blogspot.my/2014/08/rgss3-xp-map-loader-ii.html
I'm comfortable with the speed VX provides, but mimicking Xp's style is acceptable. As long as I can have a nice easy working fog all together I'm happy with it, as for me having Xp, I had a copy given to me by my brother years ago before Steam got it's hands on it.

With the links and guidelines provided for that script it keeps telling me I require the drago extension higher or above etc, I did so and after a while or restarting the game stopped crashing, but no fog. Nothing happens. Unfortunately I don't understand Japanese either.

Shaz's script works good, but I just need to know how I can get it to scroll and loop.
I have used Shaz's script often, and this is the setting which I find works best for most situations.  One big difference is in the ID number at the beginning.  I always use 1.

So in the script call, I have

show_fog(1, "fog", 0, 150, 0, 250, -2, 1)
The script on the top link is simply a plug and play script, just copy it and paste it somewhere below material and above main, then follow the instruction i typed to setup your map's notebox should get it to work. You don't have to understand the instructions written in Japanese as i already have those translated in the post above.

As for the drago's script. It has nothing to do with the top link.

It's a script that allows you to make maps in XP's editor, then copy the map files to VX ace and let VX ace runs them just like XP will do. So all you need is to make a fully fuctional map in XP with fogs and such and copy the map file over to VX ace. Remember the compatibility talk we did awhile back? This is one of those scripts that makes it possible. 😉
I have used Shaz's script often, and this is the setting which I find works best for most situations.  One big difference is in the ID number at the beginning.  I always use 1.

So in the script call, I have

show_fog(1, "fog", 0, 150, 0, 250, -2, 1)
Copy and pasted, but I don't understand why the graphic won't move, it is intended that the fog is meant to drift given the speeds?

The script on the top link is simply a plug and play script, just copy it and paste it somewhere below material and above main, then follow the instruction i typed to setup your map's notebox should get it to work. You don't have to understand the instructions written in Japanese as i already have those translated in the post above.

As for the drago's script. It has nothing to do with the top link.

It's a script that allows you to make maps in XP's editor, then copy the map files to VX ace and let VX ace runs them just like XP will do. So all you need is to make a fully fuctional map in XP with fogs and such and copy the map file over to VX ace. Remember the compatibility talk we did awhile back? This is one of those scripts that makes it possible. 😉
For some reason the map notes where deadly picky for the file name, I ended up just changing the parralax image filefog, and it works perfectly.

Aside from speed, do you tinker the direction by adding subtraction to x-y speeds?

Also slight issue picked up, putting the map note in a room with already a parralx bg crashes it, I spose because the engine does not know which one to use with the fog interfering.
With the settings that I have given the fog drifts at a nice steady pace from top right corner to bottom left corner.  I think that looks better than a horizontal drift.

I'm wondering if you have something else which is interfering with this script, because those settings always work for me, and I'm no scripting genius.  Maybe a parallax script, or a picture fixing script?
I am in total agreement with diagonal movement, but if i wanted it to move a different diagonal direction i mean 😛 It's no issue but the knowledge would be good if I needed to switch it.

As for the map, I have no idea- I had a parralax bg running in a map to test and it just kept crashing, sadly I didnt get around to finding crash report because I quit it too fast :/ all that was in the map was fire animating events.

I deleted the map but made a new one emulating what i had there-but no crashes. It's a complete mystery but I will let you know if I come across it again.
To move it in a different diagonal, try 1, -2 for your settings.  I now don't have Ace open to check that.
Yes - it just does a + to the position. So if you want it to move in the opposite direction, use a negative figure.


This script shouldn't conflict with others, because it uses all new classes. However, if other scripts OVERWRITE existing classes rather than aliasing them, there could be issues. Put my script at the bottom of all the custom scripts and see if it makes a difference.
+/- in the x,y numbers will indicates it moves left/right, down/up

Certainly sounds like you have a script that conflicts with how the graphic is drawing or moving.

Since Shaz's script doesn't update the fog movement, and Blue Red Zone's script has a chance of crashing.

And Shaz said he's using new methods so chances of conflict is low, from what i see in his script, he did properly alias the methods in spriteset map class, and i believe BRZ has properly alias the methods use in spriteset map and game map classes too.

So the compatibility of both script shouldn't be a huge problem unless you have a script that modifies some methods used in spriteset map without properly alias them.

Try do this, ctrl+shift+f and look for "class Spriteset_Map" and see how many scripts you currently use are shown in the search list.
Yeah, thinking the same thing. My guess would be something's overwritten the Spriteset_Map update method and isn't calling an aliased version, and you have that script below mine. Putting mine at the bottom of the list should indicate fairly quickly whether that's true.

Original thread: https://forums.rpgmakerweb.com/threads/fog-in-maps.44707/