[XP] - Animated Panorama?

Started by MarkHest, August 30, 2011, 02:51:21 pm

Previous topic - Next topic

MarkHest

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:
   

Ryex

the effect is achieved via that editor I believe. there should be options for moving the panorama just like there is for fog.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

MarkHest

August 30, 2011, 04:43:54 pm #2 Last Edit: August 30, 2011, 04:48:25 pm by MarkHest
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)

   

Blizzard

Didn't I make a script for that?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

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 no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

MarkHest

   

ForeverZer0

August 30, 2011, 06:13:21 pm #6 Last Edit: August 30, 2011, 06:14:35 pm by ForeverZer0
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".
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

MarkHest

August 30, 2011, 07:21:00 pm #7 Last Edit: August 30, 2011, 07:25:52 pm by MarkHest
YAY!   :clap:

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

*Presses the Level++ button*
   

ForeverZer0

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.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

goblinhoney

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.

KK20

Can you be more specific? The script calls to change the panorama sx and sy ARE your speed variables.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!