Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: MarkHest on August 30, 2011, 02:51:21 pm

Title: [XP] - Animated Panorama?
Post by: MarkHest on August 30, 2011, 02:51:21 pm
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:
Title: Re: [XP] - Animated Panorama?
Post by: Ryex on August 30, 2011, 02:56:15 pm
the effect is achieved via that editor I believe. there should be options for moving the panorama just like there is for fog.
Title: Re: [XP] - Animated Panorama?
Post by: MarkHest on August 30, 2011, 04:43:54 pm
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)

Title: Re: [XP] - Animated Panorama?
Post by: Blizzard on August 30, 2011, 04:52:41 pm
Didn't I make a script for that?
Title: Re: [XP] - Animated Panorama?
Post by: Ryex on August 30, 2011, 04:55:41 pm
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
Title: Re: [XP] - Animated Panorama?
Post by: MarkHest on August 30, 2011, 05:22:02 pm
I don't understand  :^_^':
Title: Re: [XP] - Animated Panorama?
Post by: ForeverZer0 on August 30, 2011, 06:13:21 pm
Here, I made this real quick for you.

Spoiler: ShowHide
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".
Title: Re: [XP] - Animated Panorama?
Post by: MarkHest on August 30, 2011, 07:21:00 pm
YAY!   :clap:

That's exactly what i wanted! Thank you so much Zero!  :hi:

*Presses the Level++ button*
Title: Re: [XP] - Animated Panorama?
Post by: ForeverZer0 on August 30, 2011, 07:31:39 pm
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.
Title: Re: [XP] - Animated Panorama?
Post by: goblinhoney on July 19, 2024, 03:46:08 am
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.
Title: Re: [XP] - Animated Panorama?
Post by: KK20 on July 19, 2024, 03:29:57 pm
Can you be more specific? The script calls to change the panorama sx and sy ARE your speed variables.