New account registration is temporarily disabled.

[RMXP] ADVANCED SCRIPTING HELP

Posts

Pages: 1
Hey all! I've got a bug I'm trying to squash, but its related to parts of the engine I don't very well.

I'm trying to use fogs in Pokemon Essentials. The way that the engine connects maps is that it loads multiple maps into the game, (and all of the accompanying data). When the second map is loaded, it generates the fog overlay effect on both the new map, and the currently loaded map, creating an annoying bug.


(as you can see, the above map has two copies of the fog on it. I was moving south, which loaded the map beneath the route I'm on)

I've tried digging deeper into the code; I can see where the game loads the map data in, but I cannot find the method that is used to draw the fog graphic over the map.

Ideas?
Hello there.

Assuming you are using the event system and not script to draw the fog. When it comes to fog, in the default code, RMXP have a set of related parameters in Game_Map. I think they are something like:

attr_accessor :fog_name # fog file name
attr_accessor :fog_hue # fog hue
attr_accessor :fog_opacity # fog opacity level
attr_accessor :fog_blend_type # fog blending method
attr_accessor :fog_zoom # fog zoom rate
attr_accessor :fog_sx # fog sx
attr_accessor :fog_sy # fog sy
attr_reader :fog_ox # fog x-coordinate starting point
attr_reader :fog_oy # fog y-coordinate starting point
attr_reader :fog_tone # fog color tone

So the fogs are set as variables (do a ctrl+F in the script page for Interpreter 5 for any of these variables to see how they work).

While the part for drawing the fog is in Spriteset_Map:
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000

And most of the drawing stuff is in Spriteset_Map, just do a Ctrl+F for "fog".

Though in your case... I guess one of the things you can try to do without altering the scripts is to find the point where the new map enters from the edge of screen and use events to cause the fog to fade before the second map enters.

Hope it helps.
Pages: 1