Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Heretic86

RMXP Script - Cloud Altitude (with Alpha Channel Fog)

Question

This script will help you simulate Clouds with Altitude. Clouds are basically just a Fog, but move different than a normal Fog. Imagine it this way, you have a ground level, then higher up is a cloud, then your "Camera". When the screen moves, the Clouds move a different direction to simulate that they are much higher than the ground level.

 

The Default Fogs included with RMXP do NOT contain an Alpha Channel. I made one for you WITH an Alpha Channel so you can turn your Opacity all the way up and still be able to see your surroundings! I think it looks quite nice!

 

alphafog.jpg

 

(You need to play because it deals how the "Clouds" or "Fog" moves, screenshots dont cut it)

 

fog2.jpg

 

Notice how you can only see half of your Party? That is the Alpha Channel!

 

---

 

Script and Fog are included in the Demo. Just put somewhere above Main.

 

http://www.775.net/~...oudAltitude.exe

 

Heck, if you dont want the Script, you might want the Fog because of the Alpha Channel!

 

---

 

EDIT: This was my original post. Special thanks to ForeverZer0!

 

Im trying to write a script or an event that allows me to check if the Screen is Scrolling. Short and easy, you get close to the edge of a map, your character moves but the screen doesnt scroll. If your character is in the middle of a big map and moving around, the screen is scrolling.

 

I've tried a bunch of different things to try use this, but I cant ever seem to get it to Eval to either TRUE or FALSE.

 

Can anyone help?

 

---

 

Long version: My intended goal is to make it appear as if a fog layer is high above the players head by changing the speed and direction of the fog. But in order to do that, I need to be able to check if the screen is scrolling or not. I've tried creating new variables in the $game_map.scrolling? class and set them to TRUE if that is ever called, but apparently it is not, which is strange...

Edited by Heretic86

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

#--------------------------------------------------------------------------
 # * Determine if Scrolling
 #--------------------------------------------------------------------------
 def scrolling?
return @scroll_rest > 0
 end

 

The default script already comes with a method to determine if the map is scrolling...

 

Did I misunderstand the question?

 

EDIT:

 

$game_map.scrolling?

returns true or false, true if the map is currently scrolling false otherwise.

 

i.e.

if $game_map.scrolling?
 # Do something, map is scrolling
else
 # Do something else, map is NOT scrolling
end

Share this post


Link to post
Share on other sites
  • 0

I tried that already. $game_map.scrolling? == true only evals to true when the Scroll Map Event is used, not when the Player is just walking around. It seems like an obvious answer, but no luck so far.

Share this post


Link to post
Share on other sites
  • 0


class Game_Map

attr_writer :map_scrolling

alias map_scrolling_init initialize
def initialize
@map_scrolling = false
map_scrolling_init
end

def map_scrolling?
return @map_scrolling
end
end


class Spriteset_Map

alias map_scrolling_update update
def update
$game_map.map_scrolling = (@tilemap.ox != $game_map.display_x / 4) ||
(@tilemap.oy != $game_map.display_y / 4)
map_scrolling_update
end
end

 

This works. The following will return true/false if the map is currently scrolling or not.

$game_map.map_scrolling?

Share this post


Link to post
Share on other sites
  • 0

Ah, I figured I missed something... I figured you would have noticed that xD

 

FZer0's solution looks like the way to go.

Share this post


Link to post
Share on other sites
  • 0

Ok, I got exactly what I needed! Even made a Demo! Had to modify some other of the core scripts to be able to do what I wanted, although I am sure there were other ways to go about it. But namely, because the speed of the fog adjusts based on the players speed, I had to modify $game_character and make move_speed attr_accessor so I could read its value, then base the fog speed off of that. I dont think it will work with 8 directional movement scripts cuz Im only checking for 4 directional movement.

 

The effect is supposed to make it feel like the Fog Layer is actually a Cloud Layer and the Camera is above that. Check it out if you want.

 

http://www.775.net/~...ogScrolling.exe

Share this post


Link to post
Share on other sites
  • 0

Im glad you like it! If anyone else is interested, I can clean it up to be more compatible, but for now, it suits my needs.

 

Has anyone ever played the old Phantasy Star 2 on the Sega Genesis? That was the effect I was going after. I could replace the Cloud Layer with something like Electrical Conduits overhead to give a more "Techy" feel...

Share this post


Link to post
Share on other sites
  • 0

Ok, I cleaned up the code so you can just copy one script and put it above main. It does require the use of a Parallel Process to work correctly. I am sure that can be redone to run better, but that will have to come with time and practice on my end. Im not exactly a super duper coder, and needed quite a bit of help to get this script running to begin with.

 

I never liked the Fogs that came with RMXP because, although RMXP supports Alpha Channels in their fogs, none of their fogs have one. So I included a very nice looking super easy to customize (white, just tint it as you wish) totally tileable Fog with an Alpha Channel. See the pic in the original post.

 

Enjoy!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...