Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Stray on February 19, 2013, 06:53:59 pm

Title: [RESOLVED]Vertically Screen Shaking: Pictures aren't fixed onto map
Post by: Stray on February 19, 2013, 06:53:59 pm
Pictures aren't fixed while shaking on the map with this script. How can I change this?
Vertically Shaking Screen Script: ShowHide

Code: ruby

#by Shining Advances

class Game_Screen
 attr_accessor :vertikal
end
class Spriteset_Map
 alias shake_update update
 def update
   shake_update
   if $game_screen.vertikal == true
     @viewport1.oy = $game_screen.shake
     @viewport1.ox = 0
   else
     @viewport1.ox = $game_screen.shake
     @viewport1.oy = 0
   end
 end
end


I have nearly no experience in scripting, but I guess it's a small problem.
Title: Re: [Small Issue]Vertically Screen Shaking: Pictures aren't fixed onto map
Post by: Ryex on February 24, 2013, 03:29:36 am
it's because the pictures arn't in the same viewport as the map spriteset, here this should do it.

Code: ruby

#by Shining Advances

class Game_Screen
 attr_accessor :vertikal
end
class Spriteset_Map
 alias shake_update update
 def update
   shake_update
   if $game_screen.vertikal == true
     @viewport1.oy = @viewport2.oy = $game_screen.shake
     @viewport1.ox = @viewport2.ox = 0
   else
     @viewport1.ox = @viewport2.ox = $game_screen.shake
     @viewport1.oy = @viewport2.oy = 0
   end
 end
end
Title: Re: [Small Issue]Vertically Screen Shaking: Pictures aren't fixed onto map
Post by: Stray on February 26, 2013, 02:21:50 pm
Thank you; now my picture-animated cutscenes look way better. :]