[RGSS] Interactuable Objects 2.0b (UPDATED)

Interactuable Objects & Proyectile Library
Version: 2.0B
By: MephistoX

Introduction
This script was created to allow the user to create his owns interactuable objects, like proyectiles, enemys, and in the full version pullable, pushable, throwable, switches, and a lot of things.

In this version, you can create proyectiles with custom targets, with predefined behavior or custom behavior.

I think that watching the demo you can see how it's works.

This is not a copy of the XAS, just a library to create objects, light and easy. fully compatible with most of system.

Features
  • Very Customizable, at the point you can create a lot of objects, even customize the behavior of each object.
  • Acts also as a Proyectile Library, not just for RPGS, but for shooters or even an ABS (my plan)
  • Much more, believe me.

Screenshots
Not neccesary.

Demo
http://www.4shared.com/file/IJANAB0R/In ... cts_2.html

Script

Just the base, for the required scripts, see the demo.

Content Hidden Spoiler
  1.  
  2. #==============================================================================
  3. # ** Interactuable Objects & Object Caster System (BETA)
  4. #------------------------------------------------------------------------------
  5. # MephistoX
  6. # Version 2.0b
  7. # 08/08/2011
  8. # SDK : I, II, III, IV
  9. #------------------------------------------------------------------------------
  10. # * Version History :
  11. #
  12. #   Version 1 ---------------------------------------------------- (01/08/2011)
  13. #     - Log : First Version Released
  14. #   Version 2 ---------------------------------------------------- (08/08/2011)
  15. #     - Log : Reescripted Complete System, added new functions
  16. #------------------------------------------------------------------------------
  17. # * Requirements :
  18. #
  19. #   Method & Class Library (2.3 +)
  20. #   Meph's MACL Additions
  21. #   Sephirothspawn's Event Spawner 2.2
  22. #------------------------------------------------------------------------------
  23. # * Description :
  24. #
  25. #   This script was created to allow the developers to create interactuable
  26. #   map objects, like pushable, pullable, holdable, ..ables.
  27. #   Also includes a library to create proyectiles and dinamic objects,
  28. #   specially to create an ABS custom system or a shooter.
  29. #
  30. #   The systems are very customizable, at the point you can create a lot of
  31. #   differents objects, and determine the behavior of them.
  32. #------------------------------------------------------------------------------
  33. # * Instructions :
  34. #
  35. #   Place The Script Below the SDK and Above Main.
  36. #   Refer to module to configure the system
  37. #  
  38. #   To Assign an item, to it's configuration in the list of objects,
  39. #   you must add a comment command in the event with the following.
  40. #
  41. #   Comment: INT::TYPE => object Type
  42. #            INT::OBID => object ID
  43. #            Creat your custom move route as you wish
  44. #
  45. #
  46. #   To create an object in the map, use:
  47. #    
  48. #   Comment: INT::TYPE => ROCK (type)
  49. #            INT::LIFE => 10
  50. #            INT::DESTROY => A, B, C D || ERASE
  51. #            INT::CUSTOM  => If custom behavior allowed
  52. #              
  53. #------------------------------------------------------------------------------
  54. # * To do List :
  55. #
  56. #   - Pull & Push Merge
  57. #   - Grab, put and throw events
  58. #   - Use SE, Use Requirements, new special types.
  59. #   - Reestructure destroy algorithm
  60. #==============================================================================
  61.  
  62. #------------------------------------------------------------------------------
  63. # * SDK Log Script
  64. #------------------------------------------------------------------------------
  65. SDK.log('Interactuable Objects', 'MephistoX', 2.0, '08/08/2011')
  66. SDK.check_requirements(2.4, [], {'Method & Class Library' => 2.3})
  67.  
  68. #------------------------------------------------------------------------------
  69. # * Begin SDK Enable Test
  70. #------------------------------------------------------------------------------
  71. if SDK.enabled?('Interactuable Objects')
  72.  
  73.  
  74. #==============================================================================
  75. # ** Interactuable Objects Module
  76. #    - The module contains all the created proyectiles and objects
  77. #      Refer to each header to check the configuration
  78. #==============================================================================
  79.  
  80. module Interactuable_Objects
  81.   #--------------------------------------------------------------------------
  82.   # * Defined Objects Map
  83.   #    - Map where the objects will copied (Objects_Map = ID)
  84.   #--------------------------------------------------------------------------
  85.   Objects_Map = 1
  86.   #--------------------------------------------------------------------------
  87.   # * Types, Objects & IDs
  88.   #   This Keep the list of objects types, feel free to create your own
  89.   #   type of object. The type is just a way to store the kind, and to use
  90.   #   in the proyectile or behavior of the map objects.
  91.   #   ** As a suggestion, use the simple way to create hashes to not mess
  92.   #      your list of objects.
  93.   #                            Types = {}
  94.   #                            Types['YOURTYPE'] => {}
  95.   #                            Types['YOURTYPE'][ID] => {'Parameter => value}
  96.   #
  97.   #  * Parameters (all capitalized)
  98.   #     - TAG    : Tag or name of your object
  99.   #     - OBJECT : Id of the event in the objects map, to copy.
  100.   #     - TARGET : Where should be the target of your object. [Type, range]
  101.   #         Options => AROUND, UNDER, FRONT, BEHIND (Range for around)
  102.   #     - AFFECT : List of affected objects, there is no list of objects,
  103.   #                you just assign them to your events.
  104.   #     - MAPS   : Array of map ids in wich you can use the objects
  105.   #     - LIMIT  : Limit of objects that you can spawn at once, just the
  106.   #                player has this limitation, other events that cast, no.
  107.   #     - ANIMATION : Animation Displayed on target at the moment of hit
  108.   #     - DAMAGE : Damage dealed for the target
  109.   #     - COOLDOWN : Cooldown before casting the same object again (just player)
  110.   #     - WAIT : seconds to wait before delete the casted object
  111.   #     - NOINSTANT : The object will affect the target at the end.
  112.   #     - CLOSER : Determine how many 'passable' tiles must be free to cast
  113.   #     - STOP : Should the caster be stopped to cast?
  114.   #     - AFCASTER : If the object affect caster or not (bombs, rays, etc)
  115.   #     - MDIR : Maintain object assigned dir, or change to caster
  116.   #     - SPOT : Where's the object will be casted (ON, RANGED)
  117.   #     - ESPECIAL : My predefined custom special objects (THROWABLE, etc).
  118.   #
  119.   #       Required parameters are TAG, TARGET and AFFECT, others are optional.
  120.   #
  121.   #  * Examples of use and type of object for parameters
  122.   #     Types['SKILLS'][1] => {'TAG'       => 'MYTAG',
  123.   #                            'OBJECT'    => 11,
  124.   #                            'MAPS'      => [ 2, 4]
  125.   #                            'TARGET'    => ['FRONT', 0],
  126.   #                            'AFFECT'    => ['ROCK', 'ROCK1', 'ENEMY']
  127.   #                            'LIMIT'     => 10
  128.   #                            'ANIMATION' => 5
  129.   #                            'DAMAGE'    => 5
  130.   #                            'COOLDOWN'  => 4
  131.   #                            'WAIT'      => 3
  132.   #                            'NOINSTANT' => true (only if used)
  133.   #                            'CLOSER'    => 3
  134.   #                            'STOP'      => true
  135.   #                            'AFCASTER'  => true
  136.   #                            'MDIR'      => true
  137.   #                            'SPOT'      => ['ON, 0] # ON, RANGED
  138.   #                            'SPECIAL'   => ['THROW', 3]
  139.   #
  140.   # ** Throw should be used with spot 'ON'
  141.   #--------------------------------------------------------------------------
  142.   Types = {}
  143.   #--------------------------------------------------------------------------
  144.   # * CREATED SKILLS
  145.   #--------------------------------------------------------------------------
  146.   Types['SKILLS'] = {}
  147.  
  148.  
  149.   Types['SKILLS'][1] =  {'TAG'       => '[ARROW_1]',
  150.                          'OBJECT'    => 1,
  151.                          'TARGET'    => ['FRONT', 0],
  152.                          'AFFECT'    => ['ROCK', 'HOOK', 'ENEMY'],
  153.                          'LIMIT'     => 1,
  154.                          'ANIMATION' => 11,
  155.                          'DAMAGE'    => 1,
  156.                          'CLOSER'    => 2}
  157.                          
  158.                          
  159.   Types['SKILLS'][2] =  {'TAG'       => '[BOMB]',
  160.                          'OBJECT'    => 5,
  161.                          'TARGET'    => ['AROUND', 5],
  162.                          'AFFECT'    => ['ROCK', 'ENEMY'],
  163.                          'LIMIT'     => 1,
  164.                          'ANIMATION' => 30,
  165.                          'DAMAGE'    => 10,
  166.                          'NOINSTANT' => true,
  167.                          'WAIT'      => 3,
  168.                          'MDIR'      => true,
  169.                          'CLOSER'    => 1,
  170.                          'AFCASTER'  => false}
  171.                          
  172.     Types['SKILLS'][3] = {'TAG'       => '[INDIANA]',
  173.                          'OBJECT'    => 2,
  174.                          'TARGET'    => ['FRONT', 0],
  175.                          'AFFECT'    => ['ROCK'],
  176.                          'LIMIT'     => 1,
  177.                          'ANIMATION' => 65,
  178.                          'DAMAGE'    => 1,
  179.                          'CLOSER'    => 3}
  180.    
  181.                          
  182.     Types['SKILLS'][4] = {'TAG'      => '[ACCORN]',
  183.                          'SPECIAL'   => ['THROW', 3],
  184.                          'OBJECT'    => 3,
  185.                          'TARGET'    => ['UNDER', 0],
  186.                          'AFFECT'    => ['ROCK'],
  187.                          'LIMIT'     => 2,
  188.                          'ANIMATION' => 4,
  189.                          'DAMAGE'    => 1,
  190.                          'SPOT'      => ['ON', 0]}
  191.                          
  192.                          
  193.     Types['SKILLS'][5] = {'TAG'      => '[THUNDER]',
  194.                          'OBJECT'    => 4,
  195.                          'TARGET'    => ['AROUND', 2],
  196.                          'AFFECT'    => ['ROCK'],
  197.                          'LIMIT'     => 10,
  198.                          'ANIMATION' => 33,
  199.                          'DAMAGE'    => 1,
  200.                          'SPOT'      => ['ON',0],
  201.                          'WAIT'      => 2,
  202.                          'AFCASTER'  => false}
  203.   #--------------------------------------------------------------------------
  204.   # * Non Proyectil
  205.   #    - The types that aren't proyectil.
  206.   #    Remember to add your types in move here, becase if not, this will
  207.   #    Cause a crash.
  208.   #--------------------------------------------------------------------------                      
  209.   Non_Proyectil = ['ENEMY', 'ROCK']
  210.   #--------------------------------------------------------------------------
  211.   # * Create Object : Creates an object in the map (Use EventSpawner)
  212.   #     caster_id : ID of the caster (event or player)
  213.   #     type      : object type (See created types)
  214.   #     id        : ID of the object type
  215.   #--------------------------------------------------------------------------
  216.   def self.create_object(caster_id, type, id)
  217.     # Get Caster
  218.     caster = caster_id == 0 ? $game_player : $game_map.events[caster_id]
  219.     # Get Object
  220.     object = Types[type][id]
  221.     # Do noting if interpreter is running, spawner is moving or invalid sector
  222.     return if ($game_system.map_interpreter.running? ||
  223.     !$game_map.valid?(*caster.tile_front) || object.nil?)
  224.     # Check if item has stop parameter
  225.     if object.member?('STOP')
  226.       # Return if caster is moving
  227.       return if caster.moving?
  228.     end
  229.     # If Maps list is defined
  230.     if object.member?('MAPS')
  231.       # Check if current map is included and allow to spawn if true
  232.       return unless object['MAPS'].include?($game_map.map_id)
  233.     end
  234.     # If CLOSER range is defined
  235.     if object.member?('CLOSER')
  236.       # Calculate Closer for distance
  237.       closer_xy = caster.tile_front(object['CLOSER'])
  238.       # Return if map coordinate is invalid or events are in range
  239.       return if (!$game_map.valid?(*closer_xy) ||
  240.       !caster.objects_front(object['CLOSER']).empty?)
  241.     end
  242.     # Check if cooldown defined
  243.     if object.member?('COOLDOWN')
  244.       # Return if caster is game_player & cooldown is not over
  245.       return if (caster == (gp = $game_player) &&
  246.       gp.cooldowns.member?(object['TAG']) && gp.cooldowns[object['TAG']] > 0)
  247.     end
  248.     # Create subname to add to main tag
  249.     subname = caster == $game_player ? 'PX' : caster.id.to_s
  250.     # Create Name
  251.     name = object['TAG'] + subname
  252.     # Get Number of Thrown objects in the map
  253.     objects_number = $game_map.events_with_name(name)
  254.     # Get objects in map limit
  255.     objects_limit = object.member?('LIMIT') ? object['LIMIT'] : 1
  256.     # Return if Thrown object limit is greater or equal to limit
  257.     return if objects_number >= objects_limit && caster == $game_player
  258.     # Check of Spot defined
  259.     if object.member?('SPOT')
  260.       # Get Start Coordinates
  261.       case object['SPOT'][0]
  262.       # If ON
  263.       when 'ON'
  264.         # Start Coordinate is on caster
  265.         ox, oy = caster.tile_on
  266.       # When RANGED
  267.       when 'RANGED'
  268.         # Start coordinate is in a distance in front of the caster
  269.         ox, oy = caster.tile_front(object['SPOT'][1])
  270.       end
  271.     # If not spot defined
  272.     else
  273.       # Start point is in front of the caster
  274.       ox, oy  = caster.tile_front
  275.     end
  276.     # Get the map ID for copying the objects
  277.     map_id = object.member?('MAPID') ? object['MAPID'] : Objects_Map
  278.     # Begin Event_Spawner algorithm
  279.     Event_Spawner.clone_event2(map_id, object['OBJECT'], ox, oy, name)
  280.     # Check if direction is mantain, if not, set caster direction
  281.     unless object.member?('MDIR')
  282.       Event_Spawner.set_page_graphic({'dir' => caster.direction})
  283.     end
  284.     # End Event Spawner algorithm
  285.     Event_Spawner.end_event
  286.     # If Cooldown is defined
  287.     if object.member?('COOLDOWN') && caster == $game_player
  288.       # Set Cooldown
  289.       $game_player.cooldowns[object['TAG']] = object['COOLDOWN']
  290.     end
  291.     # Get Self ID
  292.     seid = $game_map.event_with_name(object['TAG']).last
  293.     # Get map_object
  294.     map_object = $game_map.events[seid]
  295.     # Set caster for the object
  296.     map_object.object_attributes.caster = caster
  297.     # If Wait Defined
  298.     if object.member?('WAIT')
  299.       # Set Object Wait
  300.       map_object.object_attributes.time_counter = object['WAIT']
  301.     end
  302.     # Check if the Object is a special type
  303.     if object.member?('SPECIAL')
  304.       # Check the type of special object
  305.       case object['SPECIAL'][0]
  306.       # When Throwable
  307.       when 'THROW'
  308.         # Throw Object effect
  309.         map_object.throw_object(object['SPECIAL'][1])
  310.       # Reserved for special
  311.       when 'RESERVED'
  312.       end
  313.     end
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # * Do Action : Evaluates and process a defined action in the target
  317.   #     target  : target of the action
  318.   #     object  : object type (See created types)
  319.   #--------------------------------------------------------------------------
  320.   def self.do_action(target, object)
  321.     # Get target parameters
  322.     if target == $game_player
  323.       target.animation_id = object['ANIMATION']
  324.       $game_party.actors[0].hp -= object['DAMAGE']
  325.     else
  326.       target.animation_id = object['ANIMATION']
  327.       target.object_attributes.life -= object['DAMAGE']
  328.     end
  329.     target.damage = object['DAMAGE']
  330.     target.damage_pop = true
  331.     return if target == $game_player
  332.     if target.object_attributes.life <= 0
  333.       dk = target.object_attributes.destroy_kind
  334.       target.erase if dk == 'ERASE'
  335.       target.turn_switch(dk,true) if dk == 'A' || 'B' || 'C' || 'D'
  336.     end
  337.   end
  338. end
  339.  
  340. #==============================================================================
  341. # ** Game_Temp
  342. #==============================================================================
  343.  
  344. class Game_Temp
  345.   #--------------------------------------------------------------------------
  346.   # * Public Instance Variables
  347.   #--------------------------------------------------------------------------
  348.   attr_accessor :interactuable_action           # Assing interactuable action
  349.   #--------------------------------------------------------------------------
  350.   # * Alias Listing
  351.   #--------------------------------------------------------------------------
  352.   alias_method :meph_interobj_gtemp_init, :initialize
  353.   #--------------------------------------------------------------------------
  354.   # * Object Initialization
  355.   #--------------------------------------------------------------------------
  356.   def initialize
  357.     # Original Initialize
  358.     meph_interobj_gtemp_init
  359.     # Set interactuable Action
  360.     @interactuable_action = nil
  361.   end
  362. end
  363.  
  364.  
  365. #==============================================================================
  366. # ** Game_Player
  367. #==============================================================================
  368.  
  369. class Game_Player
  370.   #--------------------------------------------------------------------------
  371.   # * Public Instance Variables
  372.   #--------------------------------------------------------------------------
  373.   attr_accessor :cooldowns
  374.   #--------------------------------------------------------------------------
  375.   # * Alias Listing
  376.   #--------------------------------------------------------------------------
  377.   alias_method :meph_interobj_gplay_init,   :initialize
  378.   alias_method :meph_interobj_gplay_update, :update
  379.   #--------------------------------------------------------------------------
  380.   # * Object Initialization
  381.   #--------------------------------------------------------------------------
  382.   def initialize(*args)
  383.     # Original Initialize
  384.     meph_interobj_gplay_init(*args)
  385.     # Set Cooldowns
  386.     @cooldowns = {}
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # * Frame Update
  390.   #--------------------------------------------------------------------------
  391.   def update
  392.     # Orignial Update
  393.     meph_interobj_gplay_update
  394.     # Update Player Cooldowns
  395.     update_cooldowns
  396.   end
  397.   #--------------------------------------------------------------------------
  398.   # * Frame Update  : Update Cooldowns
  399.   #--------------------------------------------------------------------------
  400.   def update_cooldowns
  401.     # Do nothing if hash is empty
  402.     return if @cooldowns.empty?
  403.     # Pass through each cooldown
  404.     @cooldowns.each_key do |object|
  405.       # Next if cooldown is 0
  406.       next if @cooldowns[object] == 0
  407.       # Discount 1 if 1 second has pased
  408.       if Graphics.frame_count % 40 == 0
  409.         @cooldowns[object] -= 1
  410.         @cooldowns.delete(object) if @cooldowns[object] == 0
  411.       end
  412.     end
  413.   end
  414. end
  415.  
  416.  
  417. #==============================================================================
  418. # ** Interactuable_Objects::Attributes
  419. #     - This clase handles the interactuable attributes of the object
  420. #==============================================================================
  421.  
  422. class Interactuable_Objects::Attributes
  423.   #--------------------------------------------------------------------------
  424.   # * Public Instance Variables
  425.   #--------------------------------------------------------------------------
  426.   attr_accessor :type
  427.   attr_accessor :object_id
  428.   attr_accessor :life
  429.   attr_accessor :destroy_kind
  430.   attr_accessor :caster
  431.   attr_accessor :time_counter
  432.   attr_accessor :finish_action
  433.   attr_accessor :custom_action
  434.   #--------------------------------------------------------------------------
  435.   # * Object Initialization
  436.   #--------------------------------------------------------------------------
  437.   def initialize
  438.     @type          = nil
  439.     @object_id     = nil
  440.     @life          = 0
  441.     @destroy_kind  = nil
  442.     @caster        = nil
  443.     @time_counter  = 0
  444.     @finish_action = false
  445.     @custom_action = false
  446.   end
  447. end
  448.  
  449. #==============================================================================
  450. # ** Game_Event
  451. #==============================================================================
  452.  
  453. class Game_Event
  454.   #--------------------------------------------------------------------------
  455.   # * Public Instance Variables
  456.   #--------------------------------------------------------------------------
  457.   attr_reader   :move_route
  458.   attr_reader   :move_route_index
  459.   attr_reader   :object_attributes
  460.   #--------------------------------------------------------------------------
  461.   # * Alias Listing
  462.   #--------------------------------------------------------------------------
  463.   alias_method :meph_interobj_gvent_init,    :initialize
  464.   alias_method :meph_interobj_gevent_movetc, :move_type_custom
  465.   alias_method :meph_interobj_gvent_refresh, :refresh
  466.   #--------------------------------------------------------------------------
  467.   # * Object Initialization
  468.   #--------------------------------------------------------------------------
  469.   def initialize(*args)
  470.     meph_interobj_gvent_init(*args)
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # * Turn Switch : Turn event local switch
  474.   #     - Letter = Local Switch Letter  
  475.   #     - state = Bolean
  476.   #--------------------------------------------------------------------------
  477.   def turn_switch(letter, state)
  478.     key = [@map_id, @id, letter]
  479.     $game_self_switches[key] = state
  480.     $game_map.need_refresh = true
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # * Show Animation : Show animation on event
  484.   #--------------------------------------------------------------------------
  485.   def show_animation(animation_id)
  486.     @animation_id = animation_id
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # * Move Type : Custom
  490.   #--------------------------------------------------------------------------
  491.   def move_type_custom
  492.     # Original Update
  493.     meph_interobj_gevent_movetc
  494.     # Check interaction
  495.     check_interaction
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # * Check Interaction
  499.   #--------------------------------------------------------------------------
  500.   def check_interaction
  501.     # Get attributes
  502.     attributes = @object_attributes
  503.     # Return if type == nil (Not interactuable object)
  504.     return if (attributes.type.nil? ||
  505.     Interactuable_Objects::Non_Proyectil.include?(attributes.type))
  506.     # Begin Counter Discount
  507.     attributes.time_counter -= 1 if (attributes.time_counter != 0 &&
  508.     Graphics.frame_count % 40 == 0)
  509.     # Get Object to Check
  510.     object = Interactuable_Objects::Types[attributes.type][attributes.object_id]
  511.     # Get calculate number of left moves (including evals, waits...etc)
  512.     left_moves = (@move_route.list.size - 1)  - @move_route_index
  513.     # If no moves left
  514.     if left_moves == 0 && attributes.time_counter == 0
  515.       # Delete the object
  516.       $game_map.delete_event(@id)
  517.     end
  518.     # Return if the action is finished or object is nor-instant and there are
  519.     # left moves to be processed.
  520.     return if (attributes.finish_action ||
  521.     object.member?('NOINSTANT') && left_moves > 0)
  522.     # Create Targets array
  523.     targets = []
  524.     # Get Target or Targets
  525.     case object['TARGET'][0]
  526.     when 'UNDER'  ; targets << object_on
  527.     # When Front, the target must be in front of the object
  528.     when 'FRONT'  ; targets << object_front
  529.     # When Behind, the target must be in object's behind
  530.     when 'BEHIND' ; targets << object_behind
  531.     # When Around, the target must be around (range) the object
  532.     when 'AROUND' ; targets = objects_around(object['TARGET'][1])
  533.     end    
  534.     # Return if no targets
  535.     return if targets.empty?
  536.     # Pass through each target in range
  537.     targets.each do |target|
  538.       # Pass if target is self
  539.       next if target == self || target.nil?
  540.       # Check if this object affects the caster, and pass if caster is target
  541.       next if (object.member?('AFCASTER') && attributes.caster == target)
  542.       # Finalize action verifitacion
  543.       attributes.finish_action = true
  544.       # If there is a target and target is interactuable or target is player
  545.       if target && (target == $game_player ||
  546.       object['AFFECT'].include?(target.object_attributes.type))
  547.         # Check if time counter is 0 (no time_counter defined)
  548.         $game_map.delete_event(@id) if attributes.time_counter == 0
  549.         Interactuable_Objects.do_action(target, object)
  550.       elsif target.object_attributes.custom_action
  551.         # Check if time counter is 0 (no time_counter defined)
  552.         $game_map.delete_event(@id) if attributes.time_counter == 0
  553.         # Set Interactuable action to object tag (to check)
  554.         $game_temp.interactuable_action = object['TAG']
  555.         # Start the event
  556.         target.start
  557.       end
  558.       # If Object Action is defined
  559.     end
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # * Refresh
  563.   #--------------------------------------------------------------------------
  564.   def refresh
  565.     # Original Refresh
  566.     meph_interobj_gvent_refresh
  567.     # Clear Interactuable Flag
  568.     @object_attributes = Interactuable_Objects::Attributes.new
  569.     # Return if Erased
  570.     return if @erased || @list.nil?
  571.     # Pass through event commands
  572.     for ec in @list
  573.       # Skip if not comment or not comment next line
  574.       next unless [108, 408].include?(ec.code)
  575.       # Read Event Comment, turn downcase and delete blank spaces
  576.       comment = ec.parameters[0]
  577.       # If event is interactuable
  578.       if comment.include?('INT::TYPE')
  579.         # Get Type
  580.         object_attributes.type = comment.split(' => ')[1]
  581.         next
  582.       end
  583.       # If include OBID
  584.       if comment.include?('INT::OBID')
  585.         # Get Object ID
  586.         object_attributes.object_id = comment.split(' => ')[1].to_i
  587.         next
  588.       end
  589.       # If Include INT::LIFE (Life, resistance, or whatever)
  590.       if comment.include?('INT::LIFE')
  591.         # Get Resistance
  592.         object_attributes.life = comment.split(' => ')[1].to_i
  593.         next
  594.       end
  595.       # if include INT::DESTROY (Object is destroyable)
  596.       if comment.include?('INT::DESTROY')
  597.         # Set Destroyable
  598.         object_attributes.destroy_kind = comment.split(' => ')[1]
  599.         next
  600.       end
  601.       # if include INT::CUSTOM (Available for custom actions)
  602.       if comment.include?('INT::CUSTOM')
  603.         # Get erase type
  604.         object_attributes.custom_action = true
  605.         next
  606.       end
  607.     end
  608.   end
  609. end
  610.  
  611. #==============================================================================
  612. # ** Interpreter
  613. #==============================================================================
  614.  
  615. class Interpreter
  616.   #--------------------------------------------------------------------------
  617.   # * Alias Listing
  618.   #--------------------------------------------------------------------------
  619.   alias_method :meph_interobj_inter_c115, :command_115
  620.   #--------------------------------------------------------------------------
  621.   # * Exit Event Processing
  622.   #--------------------------------------------------------------------------
  623.   def command_115
  624.     # Set interactuable action to nil
  625.     $game_temp.interactuable_action = nil
  626.     # Original process
  627.     meph_interobj_inter_c115
  628.   end
  629. end
  630. #--------------------------------------------------------------------------
  631. # * End SDK Enable Test
  632. #--------------------------------------------------------------------------
  633. end
Expand to see the code.



Instructions
Place the script below SDK and MACL and Above Main, read the script header for configuration. See the demo to see how to configure the events.
Feel free to ask how to configure things at other things.

Compatibility
This Script requires MACL 2.3 and 2.4 beta methods included in the demo.
Also requires SephirothSpawn's Event Spawner (Included in the demo)
Also Requires some of my methods (like MACL new methods, included in the demo)

Credits and Thanks
Credits to MephistoX if you use this script.
MACL & SDK team.
SephirothSpawn for EventSpawner, that is the skelleton of this system of course, and for references (bluescope :P)

Author's Notes
For now, the script is in beta, but is fully usable, there are somethings that need a bit of fix, and some new features to add. actually, it's funny because i removed the Pull and push feature, to be included in the full version.

PD: Check action function for now, is a quite messy and ugly, in the final version this will be reescripted for better use.

I'll be waiting for comments of course :)
It's not terribly hard to event, but once you add the comment configuration I'm sure it'll save some work making those pushing puzzles. Here's a suggestion: make the push SE customizable (right now, it seems like it has to be '129-Earth01'). Otherwise, it looks good!
Oh look, it's a Map Object Manager! :D (and the scary part is, you actually listed Seph in your credits for references... might this actually be my ~ 5 year old concept, actually coming to life?)

It is a very simple approach, which I like, bloated with a lot of SDK scripting style, which I don't like... XD Definately got to give you points for execution there, though, especially if you manage to handle the rest of the features you planned this easily and lightweight. Definately keeping an eye on this!
@Regi: Yes I know doing this with events is easy, but as i said, it's just a teaser and the begining. About the SE, i know that i should have added that in the begining :P.

@bluescope: actually, i took that idea from one of the Sephirothspawn's test bed that said something like ('next update: Map Object Manager'.)

I'm ready with with arrows, bombs and stones (things that you can throw). but i realized that configuring this in a script, instead with comment will be easier.

Like:

  1.  Types['ITEMS'] = {}
  2.   Types['ITEMS'][1] = {'TAG' => '[BOMB_1]',
  3.                        'OBJECT' => 14,
  4.                        'TARGET' => ['AROUND', 2],
  5.                        'AFFECT' => ['ROCK', 'TREE'],
  6.                        'WAIT'   => [true, -1],
  7.                        'LIMIT'  => 2}
Expand to see the code.


and i'm thinking how to merge the pushing, pulling, and others, with this kind of configuration.

But well, i hope in a few days i'll finish the basic part.

Thanks for the comments.


EDIT: Here a little video about the arrows and the lil'demons (as other Events spawned objects).
Heh, nice... now, as a little background story on this: I got Seph interested with an idea I posted in Script Request forums that included interactive map objects, namely objects that can be pushed, thrown, carried, destroyed and put on switches and all... basically, a range between Lufia and the handheld Zelda titles back then ;)
So, Seph said he's going to do it, and repeatedly did... up to the point where he vanished from .org surface, and of course without finishing it. I remember I did some signature artwork to remind him of the fact, however yeah... didn't work out XD Well, I know he finally started to include it in his test bed projectory, but last thing I know, that didn't get too far.
And as I said, for a concept I made 5 years ago and got Seph to do it, it's quite funny to see it now, being developed by another scripter, and it actually looks like it's going somewhere :D

Good luck!
Updated script.
Removed till final version, pushable and pullable objects.

Enjoy it.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=75236