Jump to content

Recommended Posts

ACE PERFECT FOG v1.0

by Rafael_Sol_Maker

Introduction

Hello there! This is my second time posting a script here, another experimental piece of RGSS3. Again, this is a conversion of some of my VX's scripts. VX PERFECT FOG v1.0a, to be exact. This time it was very easy to port. It could be a very simple graphic script, but if well used, can create the perfect 'atmosphere' for your game. I missed so much this feature in VX, and wanted it back on Ace, but Enterbrain didn't made it... Then this remake is necessary again (at least, for me)!

 

Features

* A script that allows you to add a fog effect in your maps. To be sincere, it's a perfectly working port of the "XP fog". Very easy to configure and use, you can gradually change the fog's tone and opacity, frame by frame, like it was possible in RPG Maker XP. Oh, and you can use the alpha blend mode you want too.

 

Screenshots

 

aceperfectfog.png

One screenshot. Infinite possibilities of customization within the script.

(Not shown in screenshot, obvioulsy.)

 

Script Usage

This script requires additional graphics and configurations to work properly. Instructions:

 

1. Plug the script somewhere above Main;

2. Configure the defaults in the configurable module (PPVXAce_General_Configs)

to put it to work the way you want, when all arguments are omitted;

3. Place the required or chosen graphics in the correct folder (Graphics/Fogs/).

4. Put some commands in events to test it. See instructions in the script itself.

5. And press F12 to play!

 

Any problems, contact me. Feedback is highly appreciated.

 

Demo

I think it's not needed, but who knows... Maybe soon!

 

Script (links)

Please check it out in Pastebin!

 

[ACE PERFECT FOG v1.0 - EN-US]

 

FAQ

Q: Can I use multiple fogs layers with this script?

A: No, sorry. It was made for the sake of the simplicity. But if you have scripting knowledge you can easily reuse my Game_Fog class and create as many fog layers you want. (Oh, take care with the FPS!) ;-)

 

Important!

Generally, there is no problem if you make any use of this. If you want to redistribute it, with or without any modifications, be welcome, only please ask me and I’ll give all support you need. And don’t forget in any hypothesis to credit me.

 

This scripts is free for every use, since you observe the utilization of the Creative Commons license (see below). You can use this script for freeware games, or even for commercial games if you keep me informed about this.

 

This script script here is distributed “as it isâ€, with no additional guarantees. In case of problems, please contact me, but I’m not responsible for any direct or indirect damage it can cause. I reserved

the right of changing the “Terms of Use†in any moment, so please be careful.

 

Oh, and make regular backups of your projects and files!

 

ACE PERFECT FOG v1.0, by Rafael Sol Maker, is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0).

 

88x31.png

Credits and Thanks

- Me, Rafael_Sol_Maker!

- Miget man12

- Woratana

 

Author's Notes

I hope you like it! Have fun!

Share this post


Link to post
Share on other sites

Pretty simple and useful script but as mitchi.exe was saying it'd be cool if we could place fogs in unused (un-tiled) areas or where a parallax map would be used. Would be great for mountainous areas^^

Share this post


Link to post
Share on other sites

Hello, guys!

 

Changing the 'z' of the fog?

Well, it's perfectly possible by editing the line 305. You can even put a customized Game Variable, and control it freely. Find this line:

@plane_fog.z = 100

And put this in its place:

@plane_fog.z = $game_variables[XXX]

Where 'XXX' is the id of the variable you want to use.

Share this post


Link to post
Share on other sites

I have a script i use in XP where i can use more than one, and i could set it below or above the tiles, it also had different types of scrolling, one where you can tell it to scroll at different speeds with and without movement, i used it to make my water a looping panorama that did not adjust to the players movement, looks awesome.

 

It had a set up like this.

 

 

 

$game_map.panoramas[0] = Panorama.new('city_pano.png', 0, -500, 2, -3, 1.0/12.0, 1.0/8.0)

 

[0] is specific place inside the panoramas array where panorama info saved

city_pano.png is the name of the panorama picture file in \Graphics\Panoramas

0 is the hue

-500 is the z ( higher z : draw on top of lower z )

2 is autoscroll x speed

-3 is the autoscroll y speed

1.0/12.0 is ratio of panorama moved / camera moved. Higher ration means faster

panorama scrolling as you move around horizontally

1.0/8.0 is ratio of panorama moved / camera moved vertically

 

Would be cool to see a similar set up for Ace.

 

 

By the way, your script keeps crashing my game when i use a call script in Ace..

 

"Script 'Game_Interpreter' line 1409: NameError occurred.

uninitialized constant Game_Interpreter::Clouds01"

 

And it goes to a line that says "eval(script)"

Edited by Michael Ponder Jr

Share this post


Link to post
Share on other sites

Hi, Michael!

 

The parameters of my script are the following:

setup_fog("filename",  hue, opacity, blend_type, zoom, vertical_speed, horizontal_speed, visible?)

 

It's very similar, but yours works as panoramas too, mine not. And as I said, I made it simple propositionally. But feel free to edit it if you want, if you follow my licensing. The features you suggested are splendid, but I don't have plans to edit this script right now, except for bugfixes.

 

Talking of bugfixes and bugs... One lil' question: Did you setup my script properly? Don't forget to put quotes in filename, or it will crash. Here's some examples:

setup_fog

setup_fog("Clouds01", nil, 128)

setup_fog("Clouds01", 0, 128, BLEND_ADD, 1.5, -2, 1, true)

 

Hope it helps. Cheers, matey.

Edited by Rafael Sol Maker

Share this post


Link to post
Share on other sites

>_< i was trying to give you ideas.... i can't script to save my life... i am lucky to make minor modifications here and there..

 

And yeah it's still giving me a bug.... a syntax error........... maybe you can give an example of a layout for the call script, i might not be typing something else out right..

It's saying check the given values.

 

this is what i have for a call script

setup_fog("Clouds", 128, 100, 0, -50, -50, true)

 

And it keeps refering to these lines in Game_Interpreter

  #--------------------------------------------------------------------------
 # â— Script
 #--------------------------------------------------------------------------
 def command_355
script = @list[@index].parameters[0] + "\n"
while next_event_code == 655
  @index += 1
  script += @list[@index].parameters[0] + "\n"
end
eval(script)
 end
end

eval(script) is the line it keeps referring to.

 

And there is something missing i noticed..... where do you put the blend type in the array for the call script?

 

-EDIT-

I figured it out, you had the wrong layout, this is the correct layout.

setup_fog("Clouds",0,255,0,100,-50,-50,true)

"Clouds" is the name of course...

0 is Hue

255 is Opacity

0 is = Blend Type

100 is zoom

- 50 is x speed

then the next -50 is the y speed

and the last one is if the fog shows.

 

It's even right in your script how the layout goes

 #--------------------------------------------------------------------------
 # Fog Initiaization
 #--------------------------------------------------------------------------  
 def setup_fog(filename = Fog_Filename, hue = Fog_Hue, opacity = Fog_Opacity,
			blend_type = Fog_Blend_Type, zoom = Fog_Zoom, sx = Fog_SpeedX,
			sy = Fog_SpeedY, visible = Fog_Visible)

 

I think VX Ace forces you to fallow the set up layout EXACTLY, and if you don't it gives those errors.

Edited by Michael Ponder Jr

Share this post


Link to post
Share on other sites

Oops, you're right. I forgot the 'blend_type' parameter. I'll correct everything here. Thanks for finding this, I'm grateful. =D

 

edit ----

 

Done. I corrected it right now, updated the script header. And added other examples in my previous post. Thanks again!

Edited by Rafael Sol Maker

Share this post


Link to post
Share on other sites

<p>how could i setup the clouds that they are starting with the map ? it is my startmap an the only thing i could think of was an event with an parallel process ... but that won't work ... with this option the fog layer is only be shown but won't move ... with a player touch event the script works very well and i love it :) i am a newbie with the maker so that are the only 2 options in my mind to start the fog ... </p>

Share this post


Link to post
Share on other sites

<p>how could i setup the clouds that they are starting with the map ? it is my startmap an the only thing i could think of was an event with an parallel process ... but that won't work ... with this option the fog layer is only be shown but won't move ... with a player touch event the script works very well and i love it :) i am a newbie with the maker so that are the only 2 options in my mind to start the fog ... </p>

Hmm, I'll check if it's possible, I never tested this way. I believe it's not hard to do. Soon I'll have the answer. Thanks for visiting!

Share this post


Link to post
Share on other sites

I have the same question as the above poster. There is no Fogs folder. I made one, but it doesn't show up in the Resource Manager.

 

 

Edit: Never mind. I changed the two places in the script that said "Graphics/Fogs/" to "Graphics/Pictures/".

Edited by MT Prower

Share this post


Link to post
Share on other sites

I also had the same problem Sheano had, but figured it out(one way at least). Not sure if it's posted elsewhere or common knowledge, but I made an event that calls the script and set to auto-run and then put the Erase Event command after...seems to be working so far.

Share this post


Link to post
Share on other sites

Sorry to bother, bur im having some problem on changing my fog to black, to pretend it is smoke, can someone post the needed script there? im stuck on:

 

Tone.new(-255, -255, -255, [0])

change_fog_tone(black, [120])

 

thaks

 

se puder me ajudar fico grato rafael =D

Edited by xsasukeex

Share this post


Link to post
Share on other sites

Sorry for all this time without answers, guys!

 

I have the same question as the above poster. There is no Fogs folder. I made one, but it doesn't show up in the Resource Manager.


Edit: Never mind. I changed the two places in the script that said "Graphics/Fogs/" to "Graphics/Pictures/".

Just create it and put the graphics in. As it's not a RTP default folder, Resource Manager never will show up this one. =/

 

 

Sorry to bother, bur im having some problem on changing my fog to black, to pretend it is smoke, can someone post the needed script there? im stuck on:

 

Tone.new(-255, -255, -255, [0])

change_fog_tone(black, [120])

 

thaks

 

se puder me ajudar fico grato rafael =D

Just remove the [ ], and name the variables correctly. This must work:

black = Tone.new(-255, -255, -255, 0)

change_fog_tone(black, 120)

Or simply:

change_fog_tone(Tone.new(-255, -255, -255, 0), 120)

Thanks for using my scripts! Hope it helps!

Share this post


Link to post
Share on other sites

Greetings, 

 

I must be a fraggin Dumbo cause no matterwhati do i cant get this script to work is there a chance i can get a demo or should i post mhat i am doing here so someone can help me figure out what i am doing wrong ? 

 

-Cazziuz

 

by the way the error code i am getting is a syntax error on line 272 in the script ..but i havent touched anything that far down in the script ??

Edited by cazziuz

Share this post


Link to post
Share on other sites

Hello, guys. I'm having a probelms. I can't seem to get the fog to move. Whenever i'm moving on the map the fog is just a static picture. However, if i'm talking to someone (as in having the text box to pop up) the fog starts moving (only as long as the dialogue box is displayed.)

 

My fog is configured as following:

 

setup_fog("Fog01", 0, 125, 0, 2, 4, 4, true)
Edited by itzphilip

Share this post


Link to post
Share on other sites

I have the same problem as the above poster. My fog does not animate. It does not move at all.

Share this post


Link to post
Share on other sites

@Rafael Sol Maker: I have a question. Is there a way to stop the scrolling fog from changing position when the character walks? The fog scrolls just fine, everything works good. But when the character walks, the fog picture (although it keeps scrolling like it should) moves around in relation to the character. Is it possible to stop that from happening?

Share this post


Link to post
Share on other sites

 

Hello, guys. I'm having a probelms. I can't seem to get the fog to move. Whenever i'm moving on the map the fog is just a static picture. However, if i'm talking to someone (as in having the text box to pop up) the fog starts moving (only as long as the dialogue box is displayed.)

 

My fog is configured as following:

 

setup_fog("Fog01", 0, 125, 0, 2, 4, 4, true)

 

me too!! please tell us how to fix this?! by the way my fog looks kinda like minecraft =.= squares everywhere..its not natural.. please help.. =(

Share this post


Link to post
Share on other sites

 

 

 

Hello, guys. I'm having a probelms. I can't seem to get the fog to move. Whenever i'm moving on the map the fog is just a static picture. However, if i'm talking to someone (as in having the text box to pop up) the fog starts moving (only as long as the dialogue box is displayed.)

 

My fog is configured as following:

 

setup_fog("Fog01", 0, 125, 0, 2, 4, 4, true)

 

me too!! please tell us how to fix this?! by the way my fog looks kinda like minecraft =.= squares everywhere..its not natural.. please help.. =(

 

http://henry997.picturepush.com/album/336016/14013292/Picture-Box/Rpg-maker-fog-problem-%3D-.html this is my problem,please help TT

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted