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.
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?
The below code would only work on simple value assignment. Evaluating graphical command would crash the code.
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
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?