Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need RMXP House System 1.6

I have no guarantee that it'll work as expected, or that it's close to being the most recent version, but I found this copy of the script in this thread:

Code:
#==============================================================================

# ** House System (a.k.a Secret Base System - The Sims House Customizer)

#------------------------------------------------------------------------------

# MephistoX

# Version 1.6

# 25/02/09

# SDK : Version 2.3+

#------------------------------------------------------------------------------

# * Version History :

#

#   Version 0.9---------------------------------------------------- (07/02/09)

#    - Log : First Released Version

#   Version 1 ----------------------------------------------------- (14/02/09)

#    - Log :  First Stable Version (Never Released)

#    Version 1.1 ------------------------------------------------- (15/02/09)

#     - Update : Add 'Move' Furniture Feature

#    Version 1.2 ------------------------------------------------- (16/02/09)

#     - Update : Merge with Meph's Icon Commands

#    Version 1.3 ------------------------------------------------- (17/02/09)

#     - Update : Add Help Texts to each action

#    Version 1.5 --------------------------------------------------(20/02/09)

#     - Log : Final Script Revision, beta tested, code revision

#    Version 1.6 --------------------------------------------------(25/02/09)

#     - Update: Multiple Terrain tags for Furniture Types

#------------------------------------------------------------------------------

# * Requirements :

#

#   Method & Class Library (2.3 +)

#   SephirothSpawns's Event Spawner (2.2+)

#   Meph's Icon Commands(1.0+)

#------------------------------------------------------------------------------

# * Description :

#

#   This Script allow you to decorate, put furnitures, and other types of

#   objects to one Map(eg.House).

#   This Script simulates the 'Pokemon Secret Base System' or 'The Sims'.

#  

#   This Script is a Kind of Remake of NearFantastica's Dynamic Maps, but

#   this one was made from 0, no copy from near script.

#------------------------------------------------------------------------------

# * Instructions :

#

#   Place The Script Below the MACL, SDK & Seph's Event Spawner

#   Refer to Modules to Customize the System

#------------------------------------------------------------------------------

# * Syntax :

#

#   Get Furniture :

#    - Script : $game_party.get_furniture('Furniture Name')

#  

#==============================================================================

 

#------------------------------------------------------------------------------

# * SDK Log Script

#------------------------------------------------------------------------------

SDK.log('House System', 'MephistoX', 1.6, '25/02/09')

SDK.check_requirements(2.4, [], {'Method & Class Library' => 2.2})

 

#------------------------------------------------------------------------------

# * Begin SDK Enable Test

#------------------------------------------------------------------------------

if SDK.enabled?('House System')

 

 

#==============================================================================

# ** Furnitures

#==============================================================================

 

module Furnitures

  #--------------------------------------------------------------------------

  # ► Furnitures

  #

  #  ~ Store the Furniture Information, to create new furnitures use:

  #    Furnitures = {'Name' => [Object_id, description, Type, Icon]}

  #

  #  |Where|:

  #        ~ 'Name'(Key)        => The Furniture Name

  #        ~ 'Object_ID'(0)     => The Furniture Event ID, at Furnitures Map

  #        ~ 'Icon'(1)          => Icon for Command Windows

  #        ~ 'Description'(2)   => The Furniture Description or Help Text

  #        ~ 'Type'(3)          => Decoration Type, see Types in the Module

  #

  #  The 'Name' will be used in the next constants, so be carefull with this.

  #--------------------------------------------------------------------------

  Furnitures = {

    'Picasso'  => [3, 'MP_001-Barril01', "Picasso's Famous Picture",'Wall'],

    'Water Can'=> [1, 'MP_001-Barril01', 'A can for water','Tables'],

    'Bucket'   => [2, 'MP_001-Barril01', 'A Bucket to put Plants','Floor'],

    'Basket'   => [4, 'MP_001-Barril01', 'A Basket to put Items', 'Table&Floor']

  }

  #--------------------------------------------------------------------------

  # ► Furniture Install Type

  #

  #  ~ Store Furniture decoration/furniture 'Installation' Type

  #    Types = { 'Name' => [Terrain Tag 1, Terrain Tag 2]}

  #

  #  This was created to avoid that classic Cliche "Install Picture on the Floor"

  #--------------------------------------------------------------------------

  Types  = {

    'Floor' => [1],

    'Wall' => [2],

    'Tables' => [3],

    'Table&Floor' => [1,3]

  }

  Types.default = 0

  #--------------------------------------------------------------------------

  # ► Houses Maps

  #

  #  ~ Store the Maps Ids when it's possible call Decoration Scene

  #    and the Furniture limit per Map.

  #    Houses_Maps = {map_id, furnitures_limit, ....}

  #--------------------------------------------------------------------------                  

  House_Maps = {3 => 10}

  #--------------------------------------------------------------------------

  # ► Furniture Maps

  #

  #  ~ Store the Map ID, where are stored the furniture events

  #    Map = ID

  #--------------------------------------------------------------------------

  Map  = 4

  #--------------------------------------------------------------------------

  # ► Error Help Message

  #

  #  ~ Store the Message for Prohibitions, used Decoration Scene

  #    Error_Help = { Ocassion => 'Text or Message'}

  #

  #  ~ Ocassion Case ~

  #

  #  'No_Furni'  : When Party has no selected furniture

  #  'Cant_Put'  : When It's Impossible to put the furniture at place

  #  'Cant_Grab' : When It's Impossible to Grab that Furniture (No Furnitures)

  #--------------------------+------------------------------------------------

  Error_Help  = {

    'Putted'      => 'You Put',

    'Grabbed'     => 'You Remove',

    'No_Furni'    => 'No Furniture Selected',

    'Cant_Put'    => 'You can not put that there!!',

    'Cant_Put2'   => 'Already there is an Object there!!',

    'Cant_Grab'   => 'You can not remove this!!',

    'Limit_Reach' => 'You can not put more objects!',

    'Cant_Move'   => 'You can not move this!!',

    'Cant_Move_h' => 'You can not move that to here!!',

    'Set_Place'   => 'Selec a new spot to move the object',

    'Moved'       => 'You moved'

  }

  #--------------------------------------------------------------------------

  # ► Decoration Scene Main Command Parameters

  #

  #  ~ Store the Map ID, where are stored the furniture events

  #    Commands = {command.index => ['Name', 'Icon', 'Help Text']}

  #

  #  |Where|:

  #        ~ 'command.index'(Key)  => Option Index ¡¡DONT TOUCH!!

  #        ~ 'Name'(0)          => Command Name (See Index Case)

  #        ~ 'Icon'(1)          => Icon command

  #        ~ 'Help Text'(2)     => The Command Description or Help Text

  #

  #  |Index Case|:

  #

  #  0  : Put Furniture

  #  1  : Remove/Grab Furniture

  #  2  : Exit from Scene to Map

  #--------------------------------------------------------------------------

  Commands = {

    0 => ['Put', 'MP_001-Hand01', 'Put Furnitures'],

    1 => ['Move', '001-Weapon01', 'Move furnitures'],

    2 => ['Remove','MP_001-Hammer01', 'Remove Furnitures'],

    3 => ['Exit', 'MP_001-Normal01', 'Exit from House MOde']}

  #--------------------------------------------------------------------------

  # ► Call Scene Buton

  #

  #  ~ Store The Button to Call Decoration Scene

  #    Buttons  = {'Action' => Input::Button}

  #--------------------------------------------------------------------------

  Call_Button = Input::Z

  #--------------------------------------------------------------------------

  # ► Cursor Graphic

  #

  #  ~ Store the Cursor Name for House Decoration Scene

  #    Cursor_Graphic = 'Cursor Name' <= Must be Character Graphic

  #--------------------------------------------------------------------------

  Cursor_Graphic = 'Cursor'

  #--------------------------------------------------------------------------

  # ► Furnitures Name Suffix

  #

  #  ~ Store the Furniture Events Name, used in several methods.

  #    Suffix = 'string' => DON'T TOUCH, UNLESS YOU KNOW WHAT YOU WILL DO!!

  #--------------------------------------------------------------------------

  Suffix  = '_Furniture'

  #--------------------------------------------------------------------------

  # * Put

  #--------------------------------------------------------------------------

  def self.put(furni_map, furni_id, x, y, name)

    # Call Event_Spawer.clone_event2 method

    Event_Spawner.clone_event2(furni_map, furni_id, x, y,

    "#{name}#{Suffix}", true, true)

    # Delete the setted object from the furnitures array

    $game_party.furnitures.delete_once(name)

  end

  #--------------------------------------------------------------------------

  # * Pick

  #--------------------------------------------------------------------------

  def self.pick(x, y)  

    # Push the Event Name without '_Furni' string to Party's furniture array

    $game_party.furnitures << $game_map.event_at(x, y).name.chomp("#{Suffix}")

    # Delete the Furniture at [x, y] Position

    $game_map.delete_event_at(x, y)

  end

end

 

#==============================================================================

# ** Event_Spawner

#==============================================================================

 

module Event_Spawner::Events

  #--------------------------------------------------------------------------

  # * Event_Spawner:: Spawn Dummy Event

  #--------------------------------------------------------------------------

  def self.dummy_event(x, y, d, graphic)

    Event_Spawner.create_event(x, y, 'Character Clone')

    Event_Spawner.set_page_graphic({'c_name' => "#{graphic}", 'dir' => d})

    Event_Spawner.end_event

  end

end

 

#==============================================================================

# ** Array

#==============================================================================

 

class Array

  #--------------------------------------------------------------------------

  # * Name      : Delete Once

  #   Info      : Deletes object object in array

  #   Author    : SephirothSpawn

  #   Call Info : One Argument, item in array

  #--------------------------------------------------------------------------

  def delete_once(object)

    # Pass Through self

    each_index do |i|

      if self[i] == object

        delete_at(i)

        return

      end

    end

  end

end

 

#==============================================================================

# ** Game_Temp

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :putting_furniture        # Putting Furniture?

  attr_accessor :grabbing_furniture       # Grabbing Furniture?

  attr_accessor :moving_furniture          # Moving FUrniture?

  attr_accessor :moving

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias_method :meph_furni_gtemp_init, :initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    # Original Initialize

    meph_furni_gtemp_init

    @putting_furniture = false

    @grabbing_furniture = false

    @moving_furniture = false

    @moving = false

  end

end

 

#==============================================================================

# ** Game_Party

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :furnitures             # Party furnitures

  attr_accessor :held_furniture         # Held furniture

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias_method :meph_furni_gparty_init, :initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    # Original Initialize

    meph_furni_gparty_init

    # Set Party Furnitures to Nil

    @furnitures     = []

    # Set held furniture to nil

    @held_furniture = nil

  end

  #--------------------------------------------------------------------------

  # * Get Furniture

  #--------------------------------------------------------------------------

  def get_furniture(name)

    # If Furniture exists

    if Furnitures::Furnitures.has_key?(name)

      # Add Furniture to Party's Furniture Array

      $game_party.furnitures << name

      # Sort Furnitures in list by name

      $game_party.furnitures.sort!

    end

  end

end

 

#==============================================================================

# ** Game_Map

#==============================================================================

 

class Game_Map

  #-------------------------------------------------------------------------

  # * Name      : delete_event_at

  #   Info      : Delete event at [x,y] position

  #   Author    : MephistoX

  #   Call Info : Two Arguments Integer X, Y - Event coordinates to delete

  #-------------------------------------------------------------------------

  def delete_event_at(x, y)

    # If exist an event at [x,y] position, store the event id

    id = event_at(x, y).id if event?(x,y)

    # Delete event with id = id

    delete_event(id)

  end

  #-------------------------------------------------------------------------

  # * Name      : Events names have string?

  #   Info      : If any event on map include string

  #   Author    : MephistoX

  #   Call Info : One Argument, String to check

  #-------------------------------------------------------------------------

  def events_name_has_string?(string)

    # Pass through all Map Events

    @events.each_value do |event|

      # If any map events names include the string

      return true if event.name.include?(string)

    end

    return false

  end

end

 

#==============================================================================

# ** Game_Character

#==============================================================================

 

class Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :through                  # Through  

  attr_accessor :always_on_top            # Always on Top

  attr_accessor :old_graphic              # Old Character Graphic

  attr_accessor :old_x                    # Old Character X spot

  attr_accessor :old_y                    # Old Character Y spot

  attr_accessor :old_direction            # Old Chaaracter Direction

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias_method :meph_furni_gmchara_init, :initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    # Original Initialize

    meph_furni_gmchara_init

    @old_graphic        = ''

    @old_x              = 0

    @old_y              = 0

    @old_direction      = 2

  end

  #--------------------------------------------------------------------------

  # * Store Coordinates

  #     Store Character [x,y]Coordinates, direction and Graphic

  #--------------------------------------------------------------------------

  def store_coordinates

    @old_graphic = @character_name

    @old_x = @x  

    @old_y = @y

    @old_direction = @direction

  end

end

 

#==============================================================================

# ** Game_Event

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :name

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias_method :meph_furni_gvent_init, :initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize(*args)

    # Original Initialize

    meph_furni_gvent_init(*args)

    # Set Event Name

    @name = @event.name

  end

end

 

#==============================================================================

# ** Scene_Map

#==============================================================================

 

class Scene_Map

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias_method :meph_furni_scnmap_update, :update

  alias_method :meph_furni_scnmp_ucm, :update_call_menu

  alias_method :meph_furni_scnmp_uca, :update_calling

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # Original Update

    meph_furni_scnmap_update

    # If Input Furnitures::Buttons::Call_Scene, unless furniture flag  

    # & actual map ($Game_Map) is included in Furnitures::Houses_ID

    if (Input.trigger?(Furnitures::Call_Button) &&

      $game_temp.putting_furniture == false &&

      $game_temp.grabbing_furniture == false &&

      $game_temp.moving_furniture == false &&

      Furnitures::House_Maps.include?($game_map.map_id))  

      $game_system.se_play($data_system.decision_se)

      # Call Scene for House Decoration : Furniture Select

      $scene = House_Decoration.new

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update : Menu Calling

  #--------------------------------------------------------------------------

  def update_call_menu

    # Return if Putting or Grabbing

    if ($game_temp.putting_furniture || $game_temp.grabbing_furniture ||

       $game_temp.moving_furniture)

      return

    end

    # Original Menu Calling

    meph_furni_scnmp_ucm

  end

  #--------------------------------------------------------------------------

  # * Frame Update : Calling

  #--------------------------------------------------------------------------

  def update_calling  

    # If Putting Furniture

    if $game_temp.putting_furniture

      # Call Method

      putting_furniture

      return

    end

    # If Moving

    if $game_temp.moving_furniture

      # Call Method

      moving_furniture

      return

    end

    # If Grabbing Furniture

    if $game_temp.grabbing_furniture

      # Call Method

      grabbing_furniture

      return

    end

    # Update Orginal Map

    meph_furni_scnmp_uca

  end

  #--------------------------------------------------------------------------

  # * Begin Decorating House Process

  #--------------------------------------------------------------------------

  def begin_decorating_house

    # Set instance variable

    gp = $game_player

    # Assign Player x,y actual position and store them

    gp.store_coordinates

    # Create local variable for Player's [x,y] position & direction

    x, y, direction = gp.old_x, gp.old_y, gp.old_direction

    # Create local variable for Player's graphic

    graphic = gp.old_graphic

    # Call Event_Spawner Pre-Created Event

    Event_Spawner::Events.dummy_event(x, y, direction, graphic)

    # Move Cursor (Player) to [x,y] coordinates

    gp.moveto(5,5)

    # Change Player's Character Graphic to defined (default is a cursor)

    gp.character_name = Furnitures::Cursor_Graphic

    # Change Player Movement conditions : through, always on top, d_fix

    gp.through, gp.always_on_top, gp.direction_fix  = true, true, true

    gp.disable_player_trigger = true, true

  end

  #--------------------------------------------------------------------------

  # * Set Help Window : Set Help Window with Easy call

  #--------------------------------------------------------------------------

  def set_help_window(text, align = 1)

    # Set Help Window

    @help_window = Window_Help.new

    @help_window.back_opacity = 160

    @help_window.set_text(text, 1)

    # Disable Player movement

    $game_player.disable_player_movement = true

  end

  #--------------------------------------------------------------------------

  # * Dispose Help

  #--------------------------------------------------------------------------

  def dispose_help

    # Dipose Window

    @help_window.dispose

    # Set Window to nil

    @help_window = nil

    # Enable Cursor Movement

    $game_player.disable_player_movement = false

  end

  #--------------------------------------------------------------------------

  # * Frame Update : When Putting Furniture Flag

  #--------------------------------------------------------------------------

  def putting_furniture

    # Set instance variable

    gp = $game_player

    # Set variable for holded furniture

    h_furni = ($game_party.furnitures.include?($game_party.held_furniture) ?

    $game_party.held_furniture  : nil)

    # If B Button is Pressed

    if Input.trigger?(Input::B)

      unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Dispose Help

        dispose_help

        return

      end

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      decorating_house_exit

      return

    end

    # If C Button is Pressed

    if Input.trigger?(Input::C)

      # If Exist Window_Help on scene

      unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        dispose_help

        return

      end

      if $game_map.events.keys.size >= Furnitures::House_Maps[$game_map.map_id] + 1

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Window Help & Message

        set_help_window(Furnitures::Error_Help['Limit_Reach'])

        return

      end

      # If hold furniture == nil

      if h_furni == nil

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Window Help & Message

        set_help_window(Furnitures::Error_Help['No_Furni'])

        return

      end

      # Set variable to module

      furni = Furnitures::Furnitures

      # Store Cursor Actual Position

      cx, cy = gp.x, gp.y

      # If can't put Furniture

      # Unless Tile Terran Tag inlcude terrain Type for furniture & Event

      if $game_map.event?(cx, cy)

        $game_system.se_play($data_system.buzzer_se)

        # Set Window Help & Message

        set_help_window(Furnitures::Error_Help['Cant_Put2'])

        return

      end

      # If Terrain Tag is not Include in the Terran Types

      unless Furnitures::Types[furni[h_furni][3]].include?($game_map.terrain_tag(cx,cy))

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Window Help & Message

        set_help_window(Furnitures::Error_Help['Cant_Put'])

        return

      end

      # Play Equip SE

      $game_system.se_play($data_system.equip_se)

      # Put furniture in Parameters

      Furnitures.put(Furnitures::Map, furni[h_furni][0], cx, cy, h_furni)

      set_help_window("#{Furnitures::Error_Help['Putted']} #{h_furni}")

      return

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update : When Moving Furniture Flag

  #--------------------------------------------------------------------------

  def moving_furniture

    # Set instance variable

    gp     = $game_player

    furni  = Furnitures

    # If B Button is Pressed

    if Input.trigger?(Input::B)

      unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Dispose Help

        dispose_help

        return

      end

      unless $game_party.held_furniture == nil

        # Play Equip SE

        $game_system.se_play($data_system.equip_se)

        # Set Moving Flag

        $game_temp.moving = false

        # Set Held furniture to nil

        $game_party.held_furniture = nil

        return

      end

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      decorating_house_exit

      return

    end

    # If C Button is Pressed

    if Input.trigger?(Input::C)

      unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Dispose Help

        dispose_help

        return

      end

      # Unless $game_temp.moving

      if $game_temp.moving == false

        # If cursor 'on' event & include furnitures Suffix

        if ($game_map.event?(gp.x, gp.y) &&

          $game_map.event_at(gp.x, gp.y).name.include?(furni::Suffix))

          # Store Furniture ID to Held Furniture

          $game_party.held_furniture = $game_map.event_at(gp.x, gp.y).id

          # Set Moving Flag

          $game_temp.moving = true

          # Set Help Window for Cant' move here

          set_help_window(furni::Error_Help['Set_Place'])

          return

        end

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Help for Can't Move

        set_help_window(furni::Error_Help['Cant_Move'])

        return

      end

      # Set variable for Event Name

      name = $game_map.events[$game_party.held_furniture].name.chomp(furni::Suffix)  

      # Set Variable for Funiture Type

      type = furni::Furnitures[name][3]

      # If Furniture Type == Cursor Terrain Tag & no event on x,y

      if (furni::Types[type].include?($game_map.terrain_tag(gp.x,gp.y)) &&

        !$game_map.event?(gp.x, gp.y))

        # Play Equip SE

        $game_system.se_play($data_system.equip_se)

        # Move Furniture to Actual cursor position

        $game_map.events[$game_party.held_furniture].moveto(gp.x, gp.y)

        # Set Help for putted furniture

        set_help_window("#{furni::Error_Help['Moved']} #{name}")

        # Set furniture to Nil

        $game_party.held_furniture = nil

        # Set Moving Flag to false

        $game_temp.moving = false

        return

      end

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Help for Can't move here

        set_help_window("#{furni::Error_Help['Cant_Move_h']}")

      return

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update : When Grabbing

  #--------------------------------------------------------------------------

  def grabbing_furniture

    # Set instance variable

    gp = $game_player

    # If B Button is Pressed

    if Input.trigger?(Input::B)

      unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Dispose Help

        dispose_help

        return

      end

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      decorating_house_exit

      return

    end

    # If C Button is Pressed

    if Input.trigger?(Input::C)

       unless @help_window == nil

        # Play Cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Dispose Help

        dispose_help

        return

      end

      cx, cy = gp.x, gp.y

      furni = Furnitures

      unless ($game_map.event?(cx, cy) &&

        $game_map.event_at(cx, cy).name.include?(furni::Suffix))

        # Play Buzzer SE

        $game_system.se_play($data_system.buzzer_se)

        # Set Window Help & Message

        set_help_window(Furnitures::Error_Help['Cant_Grab'])

        return

      end

      h_furni = $game_map.event_at(cx, cy).name.chomp(furni::Suffix)

      # Play Equip SE

      $game_system.se_play($data_system.equip_se)

      # Remove Furniture from map

      Furnitures.pick(cx, cy)

      # Set Help for putted furniture

      set_help_window("#{furni::Error_Help['Grabbed']} #{h_furni}")

      return

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update : When Press B

  #--------------------------------------------------------------------------

  def decorating_house_exit

    # Set instance variable

    gp = $game_player

    # Call Scene Again

    $scene = House_Decoration.new

    # Delete Player's Clone, at old [x, y] position

    $game_map.delete_event_at($game_player.old_x, $game_player.old_y)

    # Move Player to old [x, y] position

    gp.moveto($game_player.old_x, $game_player.old_y)

    # Return Player's original character graphic

    gp.character_name = $game_player.old_graphic

    # Change Player Movement conditions : through, always on top, d_fix

    gp.through, gp.always_on_top, gp.direction_fix = false, false, false          

    gp.disable_player_trigger = false

    # Set Putting & Grabbing flag to false

    $game_temp.putting_furniture   = false

    $game_temp.grabbing_furniture  = false

    $game_temp.moving_furniture    = false

    $game_party.held_furniture     = nil

  end

end

 

#==============================================================================

# ** House Decoration

#------------------------------------------------------------------------------

#  This class is the main scene for House Decoration Add-On for mod::Furnitures

#==============================================================================

 

class House_Decoration < SDK::Scene_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor_index : actor index

  #--------------------------------------------------------------------------

  def initialize

    super()

  end

  #--------------------------------------------------------------------------

  # * Main Sprite_Set

  #--------------------------------------------------------------------------

  def main_spriteset

    # Sets Up Spriteset

    @spriteset = Spriteset_Map.new

  end

  #--------------------------------------------------------------------------

  # * Main Processing : Window Initialization

  #--------------------------------------------------------------------------

  def main_window

    super

    # Create main contents (Main Command Window, and Help Window)

    main_command_window

    help_window

  end

  #--------------------------------------------------------------------------

  # * Main Processing : Main Command Window

  #--------------------------------------------------------------------------

  def main_command_window

    # Create Commands

    commands = [[Furnitures::Commands[0][0], Furnitures::Commands[0][1]],

                [Furnitures::Commands[1][0], Furnitures::Commands[1][1]],

                [Furnitures::Commands[2][0], Furnitures::Commands[2][1]],

                [Furnitures::Commands[3][0], Furnitures::Commands[3][1]]]

    @command_window = Window_IconCommand .new(160, commands)

    @command_window.y = 64

    @command_window.back_opacity = 160

    # Disable Item 'Put' if Party has no Furnitures

    @command_window.disable_item(0) if $game_party.furnitures.size == 0

    # Disable Item 'Get' if map events don't include string for furniture

    has_string = $game_map.events_name_has_string?(Furnitures::Suffix)

    @command_window.disable_item(1) unless has_string

    @command_window.disable_item(2) unless has_string

  end

  #--------------------------------------------------------------------------

  # * Main Processing : Furniture List Command

  #--------------------------------------------------------------------------

  def furniture_list_command

    # Clear Data

    c = []

    # Pass through all furnitures

    $game_party.furnitures.each do |furniture|

      # Push furnitures

      c << [furniture , Furnitures::Furnitures[furniture][1]]

    end

    # Configure Command for Furniture List

    @furniture_list = Window_IconCommand.new(160, c)

    @furniture_list.y = 64

    @furniture_list.height = [[32 * (c.size + 1)].max, 160].min

    @furniture_list.back_opacity = 160

    @furniture_list.active  = true

    @furniture_list.visible = true

  end

  #--------------------------------------------------------------------------

  # * Main Processing : Help_Window

  #--------------------------------------------------------------------------

  def help_window

    # Create Window Help & Set Text

    @help_window = Window_Help.new

    @help_window.back_opacity = 160

    @help_window.set_text(Furnitures::Commands[0][2], 1)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #-------------------------------------------------------------------------

  def update

    super

    # Update Help Window

    update_help

    # Upate Main_Command if Main Command is active

    if @command_window.active

      update_main_command

      return

    end

    # Upate Furniture if Furniture List is Active

    if @furniture_list.active

      update_furniture_list

      return

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update  : Help Window update by Command Index

  #--------------------------------------------------------------------------

  def update_help

    # If Main Command is active

    if @command_window.active

      # Set help text to Command description

      @help_window.set_text(Furnitures::Commands[@command_window.index][2], 1)

      # If Furniture List is active

    elsif @furniture_list.active

      # Set Help text to furniture description

      index = @furniture_list.index

      command = @furniture_list.commands[index][0]

      @help_window.set_text(Furnitures::Furnitures[command][2], 1)

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update  : When Main command is Active

  #--------------------------------------------------------------------------

  def update_main_command

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      # Return to Map

      $scene = Scene_Map.new

      return

    end

    # If C button was pressed

    if Input.trigger?(Input::C)

      # Branch by command window cursor position

      case @command_window.commands[@command_window.index][0]

      # When Command 'Put'

      when Furnitures::Commands[0][0]

        # If party has no furnitures, return

        if $game_party.furnitures.size == 0

          # Play Buzzer SE

          $game_system.se_play($data_system.buzzer_se)

          return

        end

        # Play Decision SE

        $game_system.se_play($data_system.decision_se)

        # Create Furniture List

        furniture_list_command

        # Hide and Inactive Main Command

        @command_window.active = false

        @command_window.visible = false

      # When Command 'Move'

      when Furnitures::Commands[1][0]

        # If Map events not Include string, return

        unless $game_map.events_name_has_string?(Furnitures::Suffix)

          # Play Buzzer SE

          $game_system.se_play($data_system.buzzer_se)

          return

        end

        # Play Decision SE

        $game_system.se_play($data_system.decision_se)

        # Return to Scene_Map

        $scene = Scene_Map.new

        # Call Put_Furniture method for Scene_Map

        $scene.begin_decorating_house if $scene.is_a?(Scene_Map)

        $game_temp.moving_furniture = true

      # When Command 'Get'

      when Furnitures::Commands[2][0]

        # If Map events not Include string, return

        unless $game_map.events_name_has_string?(Furnitures::Suffix)

          # Play Buzzer SE

          $game_system.se_play($data_system.buzzer_se)

          return

        end

        # Play Decision SE

        $game_system.se_play($data_system.decision_se)

        # Return to Scene_Map

        $scene = Scene_Map.new

        # Call Put_Furniture method for Scene_Map

        $scene.begin_decorating_house if $scene.is_a?(Scene_Map)

        $game_temp.grabbing_furniture = true

      # When Command 'Exit'

      when Furnitures::Commands[3][0]

        # Play cancel SE

        $game_system.se_play($data_system.cancel_se)

        # Return to Scene_Map

        $scene = Scene_Map.new

      end

      return

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update  : When Furniture List is Active

  #--------------------------------------------------------------------------

  def update_furniture_list

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      # Re-Active Main Command

      @command_window.visible = true

      @command_window.active = true

      # Dispose and Remove the Furniture List

      @furniture_list.dispose

      @furniture_list = nil

      return

    end

    # If C button was pressed

    if Input.trigger?(Input::C)

      # Create Variable

      c_furni = @furniture_list.commands[@furniture_list.index][0]

      # Branch by command window cursor position

      case c_furni

      when c_furni

        # Play Decision SE

        $game_system.se_play($data_system.decision_se)

        # Set Hold Furniture to command item

        $game_party.held_furniture = c_furni

        # Return to Scene Map

        $scene = Scene_Map.new

        # Call Scene method to Put furnitures

        $scene.begin_decorating_house if $scene.is_a?(Scene_Map)

        # Set putting flag to true

        $game_temp.putting_furniture = true

      end

      return

    end

  end

end

 

#--------------------------------------------------------------------------

# * End SDK Enable Test

#--------------------------------------------------------------------------

end

It appears to require the SDK.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top