Evaluating Common Event Outside Map?

● ARCHIVED · READ-ONLY
Started by Mike 4 posts View original ↗
  1. Hi folks, I'm wondering if there's a better way to evaluate common event outside map?

    The below code would only work on simple value assignment. Evaluating graphical command would crash the code.

    Spoiler
    class Game_Interpreter attr_accessor :map_id, :event_id, :list, :index, :fiberendclass Scene_X < Scene_Basedef evalCommonEventID ceid ce = $data_common_events[ceid] if ce begin c = Game_Interpreter.new c.clear c.map_id = $game_map.map_id c.event_id = 0 c.list = ce.list c.create_fiber c.wait_for_message while c.list[c.index] do c.execute_command c.index += 1 end c.fiber = nil return true rescue msgbox("Error:Script ABC") msgbox("Common Event #" + ceid.to_s + " cannot be evaluated") end else return false endendend
    Another way to evaluate common event that I found to be working would be

    save player progress -> leave scene x -> call scene map -> run common event -> leave scene map -> call scene x -> load player progress

    Though that's not evaluating common event outside the map.

    Another thought would be creating game_interpreter clone that's portable through any scene, but it would raise compatibility issue against other scripts that expand the Game_Interpreter.

    Any thoughts?
  2. That's interesting.

    I also found the following script on that thread

    http://forums.rpgmakerweb.com/index.php?/topic/11063-scene-interpreter/

    Unless a message window is reserved in the scene x before the eval of common event, the message inside the common event won't be displayed on the scene x, instead it would be reserved until  the user loads a scene with a message window.

    And another note would be #update would evaluate the common event itself.

    I got some ideas now, thanks. : )
  3. I pretty much copied the code from Game_Map and Game_Troop. Not sure if there's a better way.