Multi Layer Fog

@JamieSquire1991: Remove ".png" so it looks like show_fog(1, "Fog01")
@JamieSquire1991: Remove ".png" so it looks like show_fog(1, "Fog01")
Thanks, all working now 🙂
EDIT

Didn't see that it had been answered before I hit 'post'.
So with the ID can it just be 1 or does it need to be 001?


(also the fogs folder I have put in my game doesn't appear in the actual resource manager list, should it?)


and 1 last thing, the filename I am guessing its the full name without the .png? 🙂
It's best NOT to use leading zeros in ANY scripts. Sometimes it causes problems.


No, the fogs folder won't show up in your resource manager list. The script affects the game, not the editor (no script will ever make your editor look different).


The .png is not needed, but as you've discovered, any text must be in quotes. So the correct line is show_fog(1, "Fog01")

If these Fogs had an Altitude, they could work like a Cloud Altitude script I wrote for XP.
There IS an altitude - it's called "z". You can have the fogs appear below your map (visible between the parallax and the map, or even behind the parallax if part of it is transparent), or above the map. You can have several layers of fog, moving in different directions or at different speed.


This script actually could be used for multiple parallaxes, where those at the front move faster and those at the back move slower, giving the appearance of travelling with a slight 3D effect.
I'm curious if there is a way to have the script calls work inside the battle scene? 

I tried using a place holder skill that calls a common event with the desired script call however nothing happens.

I'm attempting to make a skill that brings forth a certain fog effect and then fades itself out after the attack animation sequence is done. But I seem to be stuck at getting any of the fog commands to work in the battle scene.

BTW, the script works fine for me otherwise outside of battle and there is no compatibility issues since I tried the same thing in a new project. 

Any help would be appreciated thanks in advance 🙂
Do you have the BATTLE_FOGS constant (line 52) set to true? If not, the script will not run in a battle scene.
Just want to say thank you for this script! works so nicely with everything I am currently using 🙂
Yea it's set to true it will work if I call fog before battle however inside battle I cannot call a new fog so I was curious if theres a way to get the script calls to work once in a active battle.

Actually once inside battle none of the calls work I cant fade a fog, tint, add.  
That's a bit strange. It LOOKS like it should work. I'll experiment with it a bit if I get time tonight.


To clarify ... the common event IS actually being called? Can you put a Show Text in there or something just to confirm that? If it's just turning on a switch that activates a parallel/autorun common event, they don't run during battle.


Can you try putting the commands into the troop event instead of on a skill and see if it makes a difference?
Thanks like I said I attempted it a new project as well by using a skill to call a common event with the various script calls in it but nothing happens. I do know the CE is getting called though cause it I set it to change a variable as well and that part happens. Thanks for your time.

I'll try that now gimme me a few minutes.

Hmm nope doesn't seem to work with troops either. I tried adding a new fog in battle both my project and a clean one with it activating on turn[0] battle with no results. A error would be more comforting least I could work with that inside the script.

And to clarify yea the show text shows up immedietly both through a troop use and through the CE method above.

Also my z level is set to 150 so its not that cause the fog shows if the same command is used before battle scene.
Only realised my fog images are still

what would be an example of a  script call to get it moving independently 

as at the moment basically its a still image on my screen that follows the hero around rather than moving independently. 
Only realised my fog images are still

what would be an example of a  script call to get it moving independently 

as at the moment basically its a still image on my screen that follows the hero around rather than moving independently. 
You should read the instructions at the top of the script. 

"To add fog to a map, use the following in a Call Script event command: show_fog(number, "filename", hue, opacity, blend_type, zoom, speed-x, speed-y, z)"

Example: Show_fog(1, "fog1", 0, 100, 0, 100, 1, 2, 300) 

This would create fog with index 1 from filename fog1 with hue 0, opacity 100, blendtype normal, zoom 100, speed x 1, speed y 2 and Z-position 300
Yes, if you want it to move, you need to set the x and/or y movement speed.
I had set them but again the image only sits still on my character 

I even used the persons above show_fog(1, "fog01", 0, 100, 0, 100, 1, 2, 300) guessing I may have a conflicting script somewhere..
Try just this script with the same script call in a brand new project, without any other scripts, and see if it works.


If you don't move around, does the fog look like it's moving? x=1 and y=2 for speed would be VERY slow - if you're moving in the same direction, it could look like it's not moving at all.


It should not conflict with other scripts, unless they happen to use exactly the same class names as I've used (and if you have other scripts that use classes whose names have anything to do with 'fog', I'd be looking at why you're using them both).
Its not moving even when I am still I cranked up the x/y as well.

Tried on a new project and getting same issue of fog not moving, I must be doing something wrong but can't see what!
Its not moving even when I am still I cranked up the x/y as well.

Tried on a new project and getting same issue of fog not moving, I must be doing something wrong but can't see what!
Are you activating the script somehow? I mean how does your event look like? Is it parallax process, autorun, etc? Try making an NPC with dialog and before that dialog make that script call so you can actually see if the whole event is working. Also make the opacity 255 just to test if the "fog" is too transparent with opacity value 100.
Is your command in a parallel process event? Are you erasing the event afterwards? If you're doing that, and it's still not working, please take and post a screenshot of the FULL event window.


Also, can you go into the script editor and do a global search (control+shift+f) for show_fog? The only results that come up should be in my script. If you get more, it means you're using more than one fog script and they're clashing (most likely with the method name for showing it, not the classes themselves).
Bah I forgot to delete the event afterwards, thanks Shaz, sorry to bother you with issues that are solved so easily!
On the contrary ... issues that are solved so easily are my preferred type 😉

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