How to call a common event on the Script Editor (RMXP)

I have a Common-Event-based Quest system. I used to called the Quest from a particular Skill or Item. But now I want to call the Quest from the Menu. But I couldn't figure out how to call the common event from the script editor. In short, what script lines are use to call the Common Event? Please help me thank you very much. 😀
It'll be tricky.
Events only work on the map- even if you call the common event, it cannot start until you exit the menu.
I can think of 2 ways to solve this:
1. Make a menu using events (don't use Scene_Menu)
2. Close the menu after calling the common event.
You can always re-open the menu, by adding 'call menu screen' in the common event.

Script:
  1. class Interpreter
  2.   def call_common_event(id)
  3.     @parameters = [id]
  4.     command_117
  5.   end
  6. end
  7.  
  8. class Game_System
  9.   def call_common_event(id)
  10.     @map_interpreter.call_common_event(id)
  11.   end
  12. end
Expand to see the code.


To call common event 1, use
  1. $game_system.call_common_event(1)
Expand to see the code.
I used the script below in Scene_Menu but it doesn't seem to work. I try to use 001 (the event ID number) and add the line "$scene = Scene_Map.new" after it but it still doesn't work.

I try put all of your first codes in there too but it doesn't work either. I'm a newbie at Ruby script, it's so confusing. :?:

  1. when 3  # status
  2.         # Play decision SE
  3.         $game_system.se_play($data_system.decision_se)
  4.         # Make status window active
  5.         @command_window.active = false
  6.         @status_window.active = true
  7.         @status_window.index = 0
  8.      
  9. when 4  # QUEST
  10.   $game_system.call_common_event(1)
  11.  
  12.       when 5  # end game
  13.         # Play decision SE
  14.         $game_system.se_play($data_system.decision_se)
  15.         # Switch to end game screen
  16.         $scene = Scene_End.new
  17.       end
  18.       return
  19.     end
  20.   end
Expand to see the code.
The problem is that Scene_Menu does not update the interpreter. In other words, the events were called, but never updated.
Interesting. I tested it in scene_menu too, and it worked.


It works no matter what I do though. :huh:
first, it's 1 not 001, but it works either way.
I tested what happens if your common event is set to autorun/parallel + switch. Even when the switch is OFF it still calls the event (in parallel it'll only happen once).

Let's see..
Did you place the code in a new page above main?
A second, but unlikely, option is that one of your scripts has defined a call_common_event method and my code is above it.
try changing it to call_common_event2, and $game_system.call_common_event2(1)

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