IceDragon200

Call Common Events

Jul 29th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.87 KB | None | 0 0
  1. # // $game_map.interpreter
  2. # // call_common_event( common_event_id )
  3. # // force_common_event( common_event_id )
  4. # // Dont forget, to update the interpreter
  5. # // $game_map.interpreter.update
  6. # // If the scene isn't the map, or battle, stay away from message based commands.
  7. # // ELSE
  8. # // add the @message_window from the Scene_Map to your current scene
  9. # // .x. Dont forget to update it
  10. class Game_Interpreter
  11.  
  12.   # //
  13.   def call_common_event( com_id, ev_id=@event_id )
  14.     common_event = $data_common_events[com_id]
  15.     if common_event != nil
  16.       @child_interpreter = Game_Interpreter.new(@depth + 1)
  17.       @child_interpreter.setup(common_event.list, ev_id)
  18.     end
  19.   end
  20.  
  21.   # // Forces the interpreter to run a common event.
  22.   def force_common_event( com_id )
  23.     common_event = $data_common_events[com_id]
  24.     self.setup(common_event.list)
  25.   end
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment