Hiya :haha:
I've been wondering about something a while now. I've been playing some RPG Maker games that seems to use animated panoramas in some maps. It moves X or Y just like a fog but reside in the background of the map where the tiles are transparent.
Is there a sertain script for it that i chould get my hands on? :roll:
the effect is achieved via that editor I believe. there should be options for moving the panorama just like there is for fog.
Ryex: No, there is no option for moving the panorama in the Database Editor.
JanraeMendoza: Not sure what you mean :huh:
It's just a background that moves either X or Y (Up/Down or Left/Right). I've seen in in three games now, but only one of them were from RPG Maker XP and that game is Lexima Legends IV that Blizzard created.
(He even had an animated battleback in the room where the background were animated O_o)
The other two games i've seen it in was: Worst RPG Ever and Mario&Luigi: Seven Sages but they were from RPG Maker 2000 (or whatever the number was)
Didn't I make a script for that?
weird I thought it was in the editor.
well anyway, it is really simple to do in code. I don;t have the time really to go make something that will work but as the panorama is a plane object simply adding to the ox and oy properties will cause it to scroll.
you can see how the fog is moved in the same way by looking at Spriteset_Map.
Quote from: Blizzard on August 30, 2011, 04:52:41 pm
Didn't I make a script for that?
if you haven't then it would make a good tons of addons add on
I don't understand :^_^':
Here, I made this real quick for you.
class Game_Map
attr_accessor :panorama_sx, :panorama_sy
alias zer0_panorama_scroll_setup setup
def setup(map_id)
@panorama_sx = @panorama_sy = 0
zer0_panorama_scroll_setup(map_id)
end
end
class Spriteset_Map
alias zer0_panorama_scroll_init initialize
def initialize
@px = @py = 0
zer0_panorama_scroll_init
end
alias zer0_panorama_scroll_upd update
def update
zer0_panorama_scroll_upd
if @panorama.bitmap != nil && !@panorama.bitmap.disposed?
@px = (@px + 1) % @panorama.bitmap.width
@py = (@py + 1) % @panorama.bitmap.height
@panorama.ox += (@px * $game_map.panorama_sx)
@panorama.oy += (@py * $game_map.panorama_sy)
end
end
end
Just use script calls to set the scroll like this:
$game_map.panorama_sx = 4
$game_map.panorama_sy = -2
It will reset with each map automatically, so you only need to make calls to start it on maps that use it, you don't need to worry about "turning it off".
YAY! :clap:
That's exactly what i wanted! Thank you so much Zero! :hi:
*Presses the Level++ button*
The problem is you can just simply add or subtract from the origin point normally with a panorama because of how Spriteset_Map handles the update method. Because the method resets the panorama's origin every update to the display coordinate, you would have to totally over-write the method to achieve this. I simply made a variable that calculates its current position and adds the correct value to achieve the same effect. Much less code this way.
Does anyone have an idea on how to add a speed variable or function to the fantastic script Zer0 posted? I was poking around trying to copy stuff from the GameMap class that had speed for fog scroll, but I just kept breaking things.
Can you be more specific? The script calls to change the panorama sx and sy ARE your speed variables.