RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

how could i do this

Started by Joey_Noob, November 13, 2006, 07:39:25 PM

0 Members and 1 Guest are viewing this topic.

Joey_Noob

i have a scene on an airship deck and i need the sky panorama to move like so it looks as if the ship is moving how could i do this
I thought i was being attacked by ninjas yesterday but then i realised it was angry muslim protestors so i stole there veils and strapped myself to a C4 and gave them a taste of there own curry flavoured medicine

&&&&&&&&&&&&&

&&&&&&&&&&&&&&&&

Joey_Noob

i think i put the script in right but i didn'e get what the "[...]" were for and i got an error saying


Quote" nil can't be coerced into fixnum"
I thought i was being attacked by ninjas yesterday but then i realised it was angry muslim protestors so i stole there veils and strapped myself to a C4 and gave them a taste of there own curry flavoured medicine

&&&&&&&&&&&&&

BLIZZARD!

@joey_Noob- wait right here.

BLIZZARD WE NEED YOUR HELP!

I'll be right back...
&&&&&&&&&&&&&&&&

Blizzard

Don't forget to credit RPG Advocate and Guillaume777. Although I think it could have been done with less code... Instructions are inside.

#==============================================================================
# Autoscroll script
#------------------------------------------------------------------------------
# Script by RPG Advocate, modified by Guillaume777
# 1
# 2005/12/25
#==============================================================================

class Game_System
 
  #--------------------------------------------------------------------------
  # Adds accessor for $game_system.autoscroll_x_speed and autoscroll_y_speed
  #--------------------------------------------------------------------------
  attr_accessor :autoscroll_x_speed
  attr_accessor :autoscroll_y_speed
 
end

class Spriteset_Map
 
  #--------------------------------------------------------------------------
  # * Change the panorama x-y for new autoscroll values
  #--------------------------------------------------------------------------
  alias g7_as_spriteset_map_update update
  def update
    g7_as_spriteset_map_update # do the normal update
    if @panorama.bitmap == nil then return end # if no panorama then do nothing
      # if custom autoscroll values are set
      if self.autoscroll_x_speed != 0 or self.autoscroll_y_speed != 0
      self.scroll #get new scroll_point values
      @panorama.ox = self.scroll_point_x
      @panorama.oy = self.scroll_point_y
    end
  end
  #--------------------------------------------------------------------------
  # Set scroll point x and scroll point y to reflect autoscrolling
  #--------------------------------------------------------------------------
  def scroll
    w = @panorama.bitmap.width
    h = @panorama.bitmap.height
    self.scroll_frames_x += self.autoscroll_x_speed
    self.scroll_frames_y += self.autoscroll_y_speed
    while self.scroll_frames_x >= 8
      self.scroll_frames_x -= 8
      self.scroll_point_x += 1
    end
    while self.scroll_frames_x <= -8
      self.scroll_frames_x += 8
      self.scroll_point_x -= 1
    end
    while self.scroll_frames_y >= 8
      self.scroll_frames_y -= 8
      self.scroll_point_y += 1
    end
    while self.scroll_frames_y <= -8
      self.scroll_frames_y += 8
      self.scroll_point_y -= 1
    end
    self.scroll_point_x -= w if self.scroll_point_x > w
    self.scroll_point_x += w if self.scroll_point_x < -w
    self.scroll_point_y -= h if self.scroll_point_y > h
    self.scroll_point_y += h if self.scroll_point_y < -h
  end
  #--------------------------------------------------------------------------
  # Returns $game_system.autoscroll_x_speed or 0 if it is nil
  #--------------------------------------------------------------------------
  def autoscroll_x_speed
    return $game_system.autoscroll_x_speed != nil ? $game_system.autoscroll_x_speed : 0
  end
  #--------------------------------------------------------------------------
  # Returns $game_system.autoscroll_y_speed or 0 if it is nil
  #--------------------------------------------------------------------------
  def autoscroll_y_speed
    return $game_system.autoscroll_y_speed != nil ? $game_system.autoscroll_y_speed : 0
  end
  #--------------------------------------------------------------------------
  # Returns @scroll_frames_x or 0 if it is nil
  #--------------------------------------------------------------------------
  def scroll_frames_x
    return @scroll_frames_x != nil ? @scroll_frames_x : 0
  end
  #--------------------------------------------------------------------------
  # Set new @scroll_frames_x
  #--------------------------------------------------------------------------
  def scroll_frames_x=(value)
    @scroll_frames_x = value
  end
  #--------------------------------------------------------------------------
  # Returns @scroll_frames_y or 0 if it is nil
  #--------------------------------------------------------------------------
  def scroll_frames_y
    return @scroll_frames_y != nil ? @scroll_frames_y : 0
  end
  #--------------------------------------------------------------------------
  # Set new @scroll_frames_y
  #--------------------------------------------------------------------------
  def scroll_frames_y=(value)
    @scroll_frames_y = value
  end
  #--------------------------------------------------------------------------
  # Returns @scroll_point_x or 0 if it is nil
  #--------------------------------------------------------------------------
  def scroll_point_x
    return @scroll_point_x != nil ? @scroll_point_x : 0
  end
  #--------------------------------------------------------------------------
  # Set new @scroll_point_x
  #--------------------------------------------------------------------------
  def scroll_point_x=(value)
    @scroll_point_x = value
  end
  #--------------------------------------------------------------------------
  # Returns @scroll_point_y or 0 if it is nil
  #--------------------------------------------------------------------------
  def scroll_point_y
    return @scroll_point_y != nil ? @scroll_point_y : 0
  end
  #--------------------------------------------------------------------------
  # Set new @scroll_point_y
  #--------------------------------------------------------------------------
  def scroll_point_y=(value)
    @scroll_point_y = value
  end
 
end
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!