Hey, was wondering if there was a script out there similar to Yanfly’s MV Common Event Menu but for VX Ace, I know of Common Event SHOP where you can buy CEs. But for my uses it would be weird if I just make everything free for it.
Yanfly Common Event Menu but for VXA?
RGSS3 Script RequestsHey! I could not find anything like this for VX Ace, so I tried to recreate the script in VX Ace by following as much as possible the available commands from the MV plugin webpage. Please read the description to have more insight on the commands.
I reused a bit of code from Yanfly's Common Event Shop script (mostly the regexp reading in
Since there are no plugin's command in RGSS, I replaced them by script calls to
Feel free to tell me if anything is missing or if there is any bug, I did not try all possibilities so I might have missed a few things.
I reused a bit of code from Yanfly's Common Event Shop script (mostly the regexp reading in
DataManager and RPG::CommonEvent) while the rest is made from scratch.Since there are no plugin's command in RGSS, I replaced them by script calls to
$game_system.common_event_menu Feel free to tell me if anything is missing or if there is any bug, I did not try all possibilities so I might have missed a few things.
Ruby:
#==============================================================================
# Common event menu VX Ace v1.1
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 22/09/2025
#==============================================================================
# Update history:
# 21/09/2025: v1.0 - Initial release
# 22/09/2025: v1.1 - Updated description and fixed a disable_confirm bug,
# you can now replace $game_system.common_event_menu with
# common_event_menu in your script calls for lighter code
#==============================================================================
# Description: recreates Yanfly's common event menu for MV in VX Ace
# Here is what you can put in common events comments (following a similar patern
# to http://www.yanfly.moe/wiki/Common_Event_Menu_(YEP)):
#
# <Menu Name: x>
# - This changes the appearance of the common event's text when displayed in
# the common event menu list. If this tag isn't used, the text displayed
# will be the common event's name. You can use text codes.
#
# <Icon: x>
# - This changes the icon of the common event to x. If this tag isn't used,
# the icon used will be the one set in the script's parameters.
#
# <Picture: x>
# - This sets a picture to be associated with this common event when it is
# highlighted. If this isn't used, no picture will be displayed and it will
# be left empty.
#
# <Help Description>
# text
# text
# </Help Description>
# - This sets the help description used for the common event when it is
# selected in the common even menu list. Multiple lines in the comments will be
# strung together. Use | for a line break. Text codes may be used inside of the
# help description.
#
# <Subtext>
# text
# text
# </Subtext>
# - This sets the subtext used for the common event menu's subtext window
# while this common event is selected in the common event menu list. Multiple
# lines in the comments will be strung together. Use | for a line break. Text
# codes may be used inside of the help description.
#
#
#
# In your menu you can put the following script calls to setup your menu:
#
# $game_system.common_event_menu.clear
# - This clears all the listed common events from the Common Event Menu Data
# pool meaning it has to be filled again. You can do so with the next script call:
#
# ---
#
# $game_system.common_event_menu.add(1)
# - or -
# $game_system.common_event_menu.add(2,3,4,5)
# - or -
# - This will add the listed common event numbers into the common event list
# that will be shown in the common event menu.
#
# ---
#
# $game_system.common_event_menu.set_common_event_cancel(20)
# - This will set the cancel button for the common event menu to run common
# event 20 when canceled. If it is left at 0, no event will run, but the
# menu can allow the cancel button to be pressed (and prematurely end it).
#
# ---
#
# $game_system.common_event_menu.enable_cancel
# $game_system.common_event_menu.disable_cancel
# - This will enable or disable the cancel button for the common event menu from being
# pressed. Pressing cancel while the common event menu is active will do
# nothing.
#
# $game_system.common_event_menu.disable_confirm
# $game_system.common_event_menu.enable_confirm
# - This will disable the confirm button for the common event menu from
# being pressed. This is made for those who wish to use the menu only as a
# list and not a selectable menu. The Enable version will reenable the
# confirm function.
#
# ---
#
# open_common_event_menu
# - After you've set everything up, this command will be used to open up the
# common event menu. All of the common events listed by
# $game_system.common_event_menu.add will appear in this list.
#
# ---
#
# $game_system.common_event_menu.menu.x = 0
# $game_system.common_event_menu.menu.y = fitting_height(2)
# $game_system.common_event_menu.menu.width = Graphics.width/2
# $game_system.common_event_menu.menu.height = Graphics.height/2 - fitting_height(2)
# $game_system.common_event_menu.menu.opacity = 255
# $game_system.common_event_menu.menu.columns = 1
# - These script calls allow you to adjust the x, y, width, height,
# opacity, and the number of columns used for the main common event menu
# list. Make sure all of these settings are done BEFORE the common event
# menu is opened with the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_help.show
# $game_system.common_event_menu.menu_help.hide
# - This will allow you to decide if the help window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_help.x = 0
# $game_system.common_event_menu.menu_help.y = 0
# $game_system.common_event_menu.menu_help.width = Graphics.width
# $game_system.common_event_menu.menu_help.height = fitting_height(2)
# $game_system.common_event_menu.menu_help.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the help window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_picture.show
# $game_system.common_event_menu.menu_picture.hide
# - This will allow you to decide if the picture window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_picture.x = Graphics.width/2
# $game_system.common_event_menu.menu_picture.y = fitting_height(2)
# $game_system.common_event_menu.menu_picture.width = Graphics.width/2
# $game_system.common_event_menu.menu_picture.height = fitting_height(10)
# $game_system.common_event_menu.menu_picture.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the picture window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_subtext.show
# $game_system.common_event_menu.menu_subtext.hide
# - This will allow you to decide if the subtext window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_subtext.x = Graphics.width/2
# $game_system.common_event_menu.menu_subtext.y = fitting_height(2) + fitting_height(10)
# $game_system.common_event_menu.menu_subtext.width = Graphics.width/2
# $game_system.common_event_menu.menu_subtext.height = Graphics.height - fitting_height(2)- fitting_height(10)
# $game_system.common_event_menu.menu_subtext.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the subtext window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# $game_system.common_event_menu.default_setup
# $game_system.common_event_menu.basic_setup
# - This allows you to set the common event windows to position themselves
# to the default setup provided by the script parameters or a basic setup
# made of just the main list and a help window.
#
#==============================================================================
# Term of use: free for both commercial and non commercial projects, credit is
# required. Please add credit to Yanfly too as this script uses some code from
# common event shop and uses the same interface as his plugin for MV.
#==============================================================================
# Installation: put it above main
#==============================================================================
$imported = {} if $imported.nil?
$imported["TIM-CommonEventMenu"] = true
module TIM
module COMMON_EVENT_MENU
module REGEXP
MENU_NAME = /<(?:MENU_NAME|(?:M|m)enu (?:n|N)ame):[ ](.*)>/i
PICTURE = /<(?:PICTURE|(?:p|P)icture):[ ](.*)>/i
ICON_INDEX = /<(?:ICON|(?:i|I)con):[ ](\d+)>/i
HELP_DESCRIPTION_ON = /<(?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
HELP_DESCRIPTION_OFF = /<\/(?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
SUBTEXT_ON = /<(?:SUBTEXT|(?:S|s)ubtext)>/i
SUBTEXT_OFF = /<\/(?:SUBTEXT|(?:S|s)ubtext)>/i
end #REGEXP
DEFAULT_ICON = 0
HELP_WINDOW_LINES = 2
PICTURE_WINDOW_LINES = 10
LINE_HEIGHT = 24
STANDARD_PADDING = 12
def self.fitting_height(line_number)
line_number * LINE_HEIGHT + STANDARD_PADDING * 2
end
#==============================================================================
# Window_Parameters
#==============================================================================
class Window_Parameters
attr_accessor :x, :y, :width, :height, :opacity
def initialize(x = 0, y = 0, width = 0,height = 0,opacity = 255, show = true)
@x = x
@y = y
@width = width
@height = height
@opacity = opacity
@show = show
end
def to_a; [@x,@y,@width,@height]; end
def show; @show = true; end
def hide; @show = false; end
def show?; @show; end
end #Window_Parameters
#==============================================================================
# Window_Select_Parameters
#==============================================================================
class Window_Select_Parameters < Window_Parameters
attr_accessor :columns
def initialize(x = 0, y = 0, width = 0,height = 0,opacity = 255, columns = 1)
super(x,y,width,height,opacity)
@columns = columns
end
def to_a; super + [@columns]; end
end #Window_Select_Parameters
#==============================================================================
# CEM_Parameters
#==============================================================================
class CEM_Parameters
attr_reader :list
attr_reader :menu_cancel_common_event
attr_reader :menu, :menu_help, :menu_picture, :menu_subtext
#--------------------------------------------------------------------------
# method: initialize
#--------------------------------------------------------------------------
def initialize
clear
set_common_event_cancel(0)
enable_cancel
enable_confirm
default_setup
end
def clear
@list = []
end
def add(*args)
@list += args
end
def set_common_event_cancel(id)
@menu_cancel_common_event = id
end
def enable_cancel; @cem_cancel = true; end
def disable_cancel; @cem_cancel = false; end
def cancel?; @cem_cancel; end
def disable_confirm; @cem_confirm = false; end
def enable_confirm; @cem_confirm = true; end
def confirm?; @cem_confirm; end
def fitting_height(line_number)
TIM::COMMON_EVENT_MENU.fitting_height(line_number)
end
def default_setup
h1 = fitting_height(HELP_WINDOW_LINES)
h2 = fitting_height(PICTURE_WINDOW_LINES)
@menu = Window_Select_Parameters.new(0, h1, Graphics.width/2, Graphics.height - h1, 255, 1)
@menu_help = Window_Parameters.new(0, 0, Graphics.width, h1, 255)
@menu_picture = Window_Parameters.new(Graphics.width / 2, h1, Graphics.width / 2, h2, 255)
@menu_subtext = Window_Parameters.new(Graphics.width / 2, h1+h2, Graphics.width / 2, Graphics.height - h1-h2, 255)
end
def basic_setup
h1 = fitting_height(HELP_WINDOW_LINES)
@menu = Window_Select_Parameters.new(0, h1, Graphics.width, Graphics.height - h1, 255, 1)
@menu_help = Window_Parameters.new(0, 0, Graphics.width, h1, 255)
@menu_picture = Window_Parameters.new
@menu_subtext = Window_Parameters.new
end
end #Game_System
end #COMMON_EVENT_MENU
end #TIM
#==============================================================================
# Game_System
#==============================================================================
class Game_System
attr_reader :common_event_menu
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias tim_cem_initialize initialize
def initialize
@common_event_menu = TIM::COMMON_EVENT_MENU::CEM_Parameters.new
tim_cem_initialize
end
end #Game_System
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# new method: open_common_event_menu
#--------------------------------------------------------------------------
def open_common_event_menu
SceneManager.call(Scene_MenuCommonEvent)
end
#--------------------------------------------------------------------------
# new method: fitting_height
#--------------------------------------------------------------------------
def fitting_height(n)
$game_system.common_event_menu.fitting_height(n)
end
#--------------------------------------------------------------------------
# new method: common_event_menu
#--------------------------------------------------------------------------
def common_event_menu
$game_system.common_event_menu
end
end #Game_Interpreter
#==============================================================================
# DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_cem load_database; end
def self.load_database
load_database_cem
load_notetags_cem
end
#--------------------------------------------------------------------------
# new method: load_notetags_cem
#--------------------------------------------------------------------------
def self.load_notetags_cem
groups = [$data_common_events]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_cem
end
end
end
end # DataManager
#==============================================================================
# RPG::CommonEvent
#==============================================================================
class RPG::CommonEvent
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :description
attr_accessor :icon_index
attr_accessor :picture
attr_accessor :menu_name
attr_accessor :subtext
#--------------------------------------------------------------------------
# common cache: load_notetags_cem
#--------------------------------------------------------------------------
def load_notetags_cem
@picture = ""
@menu_name = name
@description = ""
@subtext = ""
@icon_index = TIM::COMMON_EVENT_MENU::DEFAULT_ICON
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when TIM::COMMON_EVENT_MENU::REGEXP::ICON_INDEX
@icon_index = $1.to_i
when TIM::COMMON_EVENT_MENU::REGEXP::MENU_NAME
@menu_name = $1.to_s
when TIM::COMMON_EVENT_MENU::REGEXP::PICTURE
@picture = $1.to_s
#---
when TIM::COMMON_EVENT_MENU::REGEXP::HELP_DESCRIPTION_ON
@help_description_on = true
when TIM::COMMON_EVENT_MENU::REGEXP::HELP_DESCRIPTION_OFF
@help_description_on = false
when TIM::COMMON_EVENT_MENU::REGEXP::SUBTEXT_ON
@subtext_on = true
when TIM::COMMON_EVENT_MENU::REGEXP::SUBTEXT_OFF
@subtext_on = false
else
@description += line.to_s if @help_description_on
@subtext += line.to_s if @subtext_on
#---
end
} # self.note.split
#---
@description.gsub!(/[|]/i) { "\n" }
@subtext.gsub!(/[|]/i) { "\n" }
end
#--------------------------------------------------------------------------
# new method: note (copy from Yanfly's common event shop)
#--------------------------------------------------------------------------
def note
@note = ""
@list.each { |event|
next if event.nil?
next unless [108, 408].include?(event.code)
@note += event.parameters[0] + "\r\n"
} # Do not remove
return @note
end
end # RPG::CommonEvent
#==============================================================================
# Window_CEM
#==============================================================================
class Window_CEM < Window_Base
attr_accessor :cem_cmd_window
#--------------------------------------------------------------------------
# * Object Initialization
# cem_params is a Window_Parameters object
#--------------------------------------------------------------------------
def initialize(cem_params)#x, y, width, height, opacity = 255)
@event_id = 0
super(*cem_params)
self.opacity = cem_params.opacity
hide unless cem_params.show?
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
refresh if @cem_cmd_window && @cem_cmd_window.current_common_event_id != @event_id
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@event_id = @cem_cmd_window.current_common_event_id if @cem_cmd_window
contents.clear
draw_contents
end
#--------------------------------------------------------------------------
# new method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
end
end #Window_CEM
#==============================================================================
# Window_CEM_Picture
#==============================================================================
class Window_CEM_Picture < Window_CEM
#--------------------------------------------------------------------------
# override method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
ce = $data_common_events[@event_id]
return unless ce
bitmap = Cache.picture(ce.picture)
rect = Rect.new(0,0,bitmap.width,bitmap.height)
contents.blt(0, 0, bitmap, rect)
bitmap.dispose
end
end #Window_CEM_Picture
#==============================================================================
# Window_CEM_Subtext
#==============================================================================
class Window_CEM_Subtext < Window_CEM
#--------------------------------------------------------------------------
# override method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
ce = $data_common_events[@event_id]
return unless ce
draw_text_ex(4, 0, ce.subtext)
end
end #Window_CEM_Subtext
#==============================================================================
# Window_CEM_Subtext
#==============================================================================
class Window_CEM_Help < Window_Help
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
w_params = $game_system.common_event_menu.menu_help
super(TIM::COMMON_EVENT_MENU::HELP_WINDOW_LINES)
self.x = w_params.x
self.y = w_params.y
self.width = w_params.width
self.height = w_params.height
self.opacity = w_params.opacity
hide unless w_params.show?
end
end #Window_CEM_Help
#==============================================================================
# Window_CEM_Command -> list of all common events to select
#==============================================================================
class Window_CEM_Command < Window_Command
attr_reader :common_events
#--------------------------------------------------------------------------
# override method: initialize
#--------------------------------------------------------------------------
def initialize
@w_params = $game_system.common_event_menu.menu
@common_events = $game_system.common_event_menu.list.dup
super(@w_params.x,@w_params.y)
self.opacity = @w_params.opacity
hide unless @w_params.show?
end
#--------------------------------------------------------------------------
# new method: item
#--------------------------------------------------------------------------
def item; current_common_event; end
#--------------------------------------------------------------------------
# override method: update_help
#--------------------------------------------------------------------------
def update_help; @help_window.set_item(item); end
#--------------------------------------------------------------------------
# new method: command_ext
#--------------------------------------------------------------------------
def command_ext(index); @list[index][:ext]; end
#--------------------------------------------------------------------------
# new method: current_common_event
#--------------------------------------------------------------------------
def current_common_event; $data_common_events[current_ext] rescue nil; end
#--------------------------------------------------------------------------
# new method: current_common_event_id
#--------------------------------------------------------------------------
def current_common_event_id; current_common_event ? current_common_event.id : 0; end
#--------------------------------------------------------------------------
# override method: col_max
#--------------------------------------------------------------------------
def col_max; @w_params.columns; end
#--------------------------------------------------------------------------
# override method: window_width
#--------------------------------------------------------------------------
def window_width; @w_params.width; end
#--------------------------------------------------------------------------
# override method: window_height
#--------------------------------------------------------------------------
def window_height; @w_params.height; end
#--------------------------------------------------------------------------
# override method: ok_enabled?
#--------------------------------------------------------------------------
def ok_enabled?; handle?(:ok); end
#--------------------------------------------------------------------------
# override method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
@common_events.each{|id| add_command_common_event(id)}
end
#--------------------------------------------------------------------------
# new method: add_command_common_event
#--------------------------------------------------------------------------
def add_command_common_event(id)
ce = $data_common_events[id]
add_command(ce.name, :common_event, true, id) if ce
end
#--------------------------------------------------------------------------
# override method: draw_item(index) -> adds an icon if available
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect_for_text(index)
ce = $data_common_events[command_ext(index)]
draw_common_event(ce, rect.x, rect.y, command_enabled?(index))#, rect.width)
end
#--------------------------------------------------------------------------
# new method: draw_common_event
#--------------------------------------------------------------------------
def draw_common_event(ce, dx, dy, enabled = true)#, dw = 172)
return if ce.nil?
draw_icon(ce.icon_index, dx, dy, enabled)
draw_text_ex(dx+24, dy, ce.menu_name)
#draw_text(dx+24, dy, dw, line_height, ce.menu_name)
end
end #Window_CEM_Command
#==============================================================================
# Scene_MenuCommonEvent
#==============================================================================
class Scene_MenuCommonEvent < Scene_MenuBase
#--------------------------------------------------------------------------
# override method: start
#--------------------------------------------------------------------------
def start
super
create_ce_windows
end
#--------------------------------------------------------------------------
# new method: create_cem_command_window
#--------------------------------------------------------------------------
def create_cem_command_window
@ce_window = Window_CEM_Command.new
@ce_window.viewport = @viewport
@ce_window.help_window = @help_window
@ce_window.set_handler(:ok, method(:on_item_ok)) if $game_system.common_event_menu.confirm?
@ce_window.set_handler(:cancel, method(:cancel)) if $game_system.common_event_menu.cancel?
end
#--------------------------------------------------------------------------
# new method: create_cem_picture_window
#--------------------------------------------------------------------------
def create_cem_picture_window
@ce_picture_window = Window_CEM_Picture.new($game_system.common_event_menu.menu_picture)
@ce_picture_window.viewport = @viewport
@ce_picture_window.cem_cmd_window = @ce_window
end
#--------------------------------------------------------------------------
# new method: create_cem_subtext_window
#--------------------------------------------------------------------------
def create_cem_subtext_window
@ce_subtext_window = Window_CEM_Subtext.new($game_system.common_event_menu.menu_subtext)
@ce_subtext_window.viewport = @viewport
@ce_subtext_window.cem_cmd_window = @ce_window
end
#--------------------------------------------------------------------------
# overwrite method: create_help_window
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_CEM_Help.new
@help_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# new method: create_ce_windows
#--------------------------------------------------------------------------
def create_ce_windows
create_help_window
create_cem_command_window
create_cem_picture_window
create_cem_subtext_window
end
#--------------------------------------------------------------------------
# new method: on_item_ok
#--------------------------------------------------------------------------
def on_item_ok
$game_temp.reserve_common_event(@ce_window.current_common_event_id)
return_scene
end
#--------------------------------------------------------------------------
# new method: cancel
#--------------------------------------------------------------------------
def cancel
$game_temp.reserve_common_event($game_system.common_event_menu.menu_cancel_common_event)
return_scene
end
end #Scene_MenuCommonEvent
Yo! I deeply appreciate the time you took to work on this!
I got these two crashes with undefined methods. Everything else that I need at present moment seems to be good!
Wanted this as like a Message Board for the town in game, grabbing side quests from it and stuff like that!
Little change to make if possible, with the command $game_system.common_event_menu.disable_confirm if you use the menu afterwards you can visually/audibly select the option, but nothing happens (as intended, just seems weird that it can still play the select sound)
I was also gonna forward it into the FNaFb community for them to use as well so if anymore crashes/errors get discovered, I'll 100% be reporting them.
Edit:
Found another bug; When adding a Help Description I'm unable to make a 2nd line of text by putting a second line like it is displayed in the Script, \n didn't seem to work either, it did remove \n in the game's help description.
Seems like the subtext has this same issue.
The "DEFAULT_ICON" also seems to point to icon 236 on its own; while modifying it seemingly not doing anything. But adding <Icon: #> to overwrite it working properly. The rest of the customizable things to be working proper.
I got these two crashes with undefined methods. Everything else that I need at present moment seems to be good!
Wanted this as like a Message Board for the town in game, grabbing side quests from it and stuff like that!
Little change to make if possible, with the command $game_system.common_event_menu.disable_confirm if you use the menu afterwards you can visually/audibly select the option, but nothing happens (as intended, just seems weird that it can still play the select sound)
I was also gonna forward it into the FNaFb community for them to use as well so if anymore crashes/errors get discovered, I'll 100% be reporting them.
Edit:
Found another bug; When adding a Help Description I'm unable to make a 2nd line of text by putting a second line like it is displayed in the Script, \n didn't seem to work either, it did remove \n in the game's help description.
Seems like the subtext has this same issue.
The "DEFAULT_ICON" also seems to point to icon 236 on its own; while modifying it seemingly not doing anything. But adding <Icon: #> to overwrite it working properly. The rest of the customizable things to be working proper.
Oh I forgot to update my comment: use
enable_cancel anddisable_cancel instead of enable_menu_cancel and disable_menu_cancelIf you want to share the script, please share the original link to my post here please!
I decided to follow the same pattern as Yanfly Common Event Shop, so use
| as separator between lines for the description and the subtext.That's probably because you are using Yanfly's common event shop. Internally the icon index and the help description are both using the same code. If you put Yanfly's script below mine, then Yanfly's default icon will prevail while if you put mine below, my default icon will prevail in the shop too. Do you want me to separate these values?
Thanks for reporting the bug!
I updated the script in my first post to include your bug reports and change a bit the comments!
Also you can now use
common_event_menu instead of$game_system.common_event_menu in your script calls for lighter code (both options do the same).If you can do the edit so they both dont use the same code, that would be great! No clue why my reply posted when I didn’t press Reply yet-
Mobile weird lol
Since I like having both scripts dealt with at the same time, I won't include this in the main script but in another one.
Here is an updated version of the main script that will use different internal values from Yanfly's Common Event Shop. It won't change anything unless you use it alongside the small script below.
Ruby:
#==============================================================================
# Common event menu VX Ace v1.2
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 22/09/2025
#==============================================================================
# Update history:
# 21/09/2025: v1.0 - Initial release
# 22/09/2025: v1.1 - Updated description and fixed a disable_confirm bug,
# you can now replace $game_system.common_event_menu with
# common_event_menu in your script calls for lighter code
# 22/09/2025: v1.2 - Added more compatibility with Yanfly's Common Event Shop
# (distinguish internal values for icon and help description)
#==============================================================================
# Description: recreates Yanfly's common event menu for MV in VX Ace
# Here is what you can put in common events comments (following a similar patern
# to http://www.yanfly.moe/wiki/Common_Event_Menu_(YEP)):
#
# <Menu Name: x>
# - This changes the appearance of the common event's text when displayed in
# the common event menu list. If this tag isn't used, the text displayed
# will be the common event's name. You can use text codes.
#
# <Icon: x>
# - This changes the icon of the common event to x. If this tag isn't used,
# the icon used will be the one set in the script's parameters.
#
# <Picture: x>
# - This sets a picture to be associated with this common event when it is
# highlighted. If this isn't used, no picture will be displayed and it will
# be left empty.
#
# <Help Description>
# text
# text
# </Help Description>
# - This sets the help description used for the common event when it is
# selected in the common even menu list. Multiple lines in the comments will be
# strung together. Use | for a line break. Text codes may be used inside of the
# help description.
#
# <Subtext>
# text
# text
# </Subtext>
# - This sets the subtext used for the common event menu's subtext window
# while this common event is selected in the common event menu list. Multiple
# lines in the comments will be strung together. Use | for a line break. Text
# codes may be used inside of the help description.
#
#
#
# In your menu you can put the following script calls to setup your menu:
#
# $game_system.common_event_menu.clear
# - This clears all the listed common events from the Common Event Menu Data
# pool meaning it has to be filled again. You can do so with the next script call:
#
# ---
#
# $game_system.common_event_menu.add(1)
# - or -
# $game_system.common_event_menu.add(2,3,4,5)
# - or -
# - This will add the listed common event numbers into the common event list
# that will be shown in the common event menu.
#
# ---
#
# $game_system.common_event_menu.set_common_event_cancel(20)
# - This will set the cancel button for the common event menu to run common
# event 20 when canceled. If it is left at 0, no event will run, but the
# menu can allow the cancel button to be pressed (and prematurely end it).
#
# ---
#
# $game_system.common_event_menu.enable_cancel
# $game_system.common_event_menu.disable_cancel
# - This will enable or disable the cancel button for the common event menu from being
# pressed. Pressing cancel while the common event menu is active will do
# nothing.
#
# $game_system.common_event_menu.disable_confirm
# $game_system.common_event_menu.enable_confirm
# - This will disable the confirm button for the common event menu from
# being pressed. This is made for those who wish to use the menu only as a
# list and not a selectable menu. The Enable version will reenable the
# confirm function.
#
# ---
#
# open_common_event_menu
# - After you've set everything up, this command will be used to open up the
# common event menu. All of the common events listed by
# $game_system.common_event_menu.add will appear in this list.
#
# ---
#
# $game_system.common_event_menu.menu.x = 0
# $game_system.common_event_menu.menu.y = fitting_height(2)
# $game_system.common_event_menu.menu.width = Graphics.width/2
# $game_system.common_event_menu.menu.height = Graphics.height/2 - fitting_height(2)
# $game_system.common_event_menu.menu.opacity = 255
# $game_system.common_event_menu.menu.columns = 1
# - These script calls allow you to adjust the x, y, width, height,
# opacity, and the number of columns used for the main common event menu
# list. Make sure all of these settings are done BEFORE the common event
# menu is opened with the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_help.show
# $game_system.common_event_menu.menu_help.hide
# - This will allow you to decide if the help window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_help.x = 0
# $game_system.common_event_menu.menu_help.y = 0
# $game_system.common_event_menu.menu_help.width = Graphics.width
# $game_system.common_event_menu.menu_help.height = fitting_height(2)
# $game_system.common_event_menu.menu_help.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the help window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_picture.show
# $game_system.common_event_menu.menu_picture.hide
# - This will allow you to decide if the picture window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_picture.x = Graphics.width/2
# $game_system.common_event_menu.menu_picture.y = fitting_height(2)
# $game_system.common_event_menu.menu_picture.width = Graphics.width/2
# $game_system.common_event_menu.menu_picture.height = fitting_height(10)
# $game_system.common_event_menu.menu_picture.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the picture window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# ---
#
# $game_system.common_event_menu.menu_subtext.show
# $game_system.common_event_menu.menu_subtext.hide
# - This will allow you to decide if the subtext window will be shown or hidden
# for the next 'open_common_event_menu' plugin command usage.
#
# $game_system.common_event_menu.menu_subtext.x = Graphics.width/2
# $game_system.common_event_menu.menu_subtext.y = fitting_height(2) + fitting_height(10)
# $game_system.common_event_menu.menu_subtext.width = Graphics.width/2
# $game_system.common_event_menu.menu_subtext.height = Graphics.height - fitting_height(2)- fitting_height(10)
# $game_system.common_event_menu.menu_subtext.opacity = 255
# - These script calls allow you to adjust the x, y, width, height and
# opacity of the subtext window for the common event menu list. Make sure all
# of these settings are done BEFORE the common event menu is opened with
# the 'open_common_event_menu' script call.
#
# $game_system.common_event_menu.default_setup
# $game_system.common_event_menu.basic_setup
# - This allows you to set the common event windows to position themselves
# to the default setup provided by the script parameters or a basic setup
# made of just the main list and a help window.
#
#==============================================================================
# Term of use: free for both commercial and non commercial projects, credit is
# required. Please add credit to Yanfly too as this script uses some code from
# common event shop and uses the same interface as his plugin for MV.
#==============================================================================
# Installation: put it above main
#==============================================================================
$imported = {} if $imported.nil?
$imported["TIM-CommonEventMenu"] = true
module TIM
module COMMON_EVENT_MENU
module REGEXP
MENU_NAME = /<(?:MENU_NAME|(?:M|m)enu (?:n|N)ame):[ ](.*)>/i
PICTURE = /<(?:PICTURE|(?:p|P)icture):[ ](.*)>/i
ICON_INDEX = /<(?:ICON|(?:i|I)con):[ ](\d+)>/i
HELP_DESCRIPTION_ON = /<(?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
HELP_DESCRIPTION_OFF = /<\/(?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
SUBTEXT_ON = /<(?:SUBTEXT|(?:S|s)ubtext)>/i
SUBTEXT_OFF = /<\/(?:SUBTEXT|(?:S|s)ubtext)>/i
end #REGEXP
DEFAULT_ICON = 0
HELP_WINDOW_LINES = 2
PICTURE_WINDOW_LINES = 10
LINE_HEIGHT = 24
STANDARD_PADDING = 12
def self.fitting_height(line_number)
line_number * LINE_HEIGHT + STANDARD_PADDING * 2
end
#==============================================================================
# Window_Parameters
#==============================================================================
class Window_Parameters
attr_accessor :x, :y, :width, :height, :opacity
def initialize(x = 0, y = 0, width = 0,height = 0,opacity = 255, show = true)
@x = x
@y = y
@width = width
@height = height
@opacity = opacity
@show = show
end
def to_a; [@x,@y,@width,@height]; end
def show; @show = true; end
def hide; @show = false; end
def show?; @show; end
end #Window_Parameters
#==============================================================================
# Window_Select_Parameters
#==============================================================================
class Window_Select_Parameters < Window_Parameters
attr_accessor :columns
def initialize(x = 0, y = 0, width = 0,height = 0,opacity = 255, columns = 1)
super(x,y,width,height,opacity)
@columns = columns
end
def to_a; super + [@columns]; end
end #Window_Select_Parameters
#==============================================================================
# CEM_Parameters
#==============================================================================
class CEM_Parameters
attr_reader :list
attr_reader :menu_cancel_common_event
attr_reader :menu, :menu_help, :menu_picture, :menu_subtext
#--------------------------------------------------------------------------
# method: initialize
#--------------------------------------------------------------------------
def initialize
clear
set_common_event_cancel(0)
enable_cancel
enable_confirm
default_setup
end
def clear
@list = []
end
def add(*args)
@list += args
end
def set_common_event_cancel(id)
@menu_cancel_common_event = id
end
def enable_cancel; @cem_cancel = true; end
def disable_cancel; @cem_cancel = false; end
def cancel?; @cem_cancel; end
def disable_confirm; @cem_confirm = false; end
def enable_confirm; @cem_confirm = true; end
def confirm?; @cem_confirm; end
def fitting_height(line_number)
TIM::COMMON_EVENT_MENU.fitting_height(line_number)
end
def default_setup
h1 = fitting_height(HELP_WINDOW_LINES)
h2 = fitting_height(PICTURE_WINDOW_LINES)
@menu = Window_Select_Parameters.new(0, h1, Graphics.width/2, Graphics.height - h1, 255, 1)
@menu_help = Window_Parameters.new(0, 0, Graphics.width, h1, 255)
@menu_picture = Window_Parameters.new(Graphics.width / 2, h1, Graphics.width / 2, h2, 255)
@menu_subtext = Window_Parameters.new(Graphics.width / 2, h1+h2, Graphics.width / 2, Graphics.height - h1-h2, 255)
end
def basic_setup
h1 = fitting_height(HELP_WINDOW_LINES)
@menu = Window_Select_Parameters.new(0, h1, Graphics.width, Graphics.height - h1, 255, 1)
@menu_help = Window_Parameters.new(0, 0, Graphics.width, h1, 255)
@menu_picture = Window_Parameters.new
@menu_subtext = Window_Parameters.new
end
end #Game_System
end #COMMON_EVENT_MENU
end #TIM
#==============================================================================
# Game_System
#==============================================================================
class Game_System
attr_reader :common_event_menu
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias tim_cem_initialize initialize
def initialize
@common_event_menu = TIM::COMMON_EVENT_MENU::CEM_Parameters.new
tim_cem_initialize
end
end #Game_System
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# new method: open_common_event_menu
#--------------------------------------------------------------------------
def open_common_event_menu
SceneManager.call(Scene_MenuCommonEvent)
end
#--------------------------------------------------------------------------
# new method: fitting_height
#--------------------------------------------------------------------------
def fitting_height(n)
$game_system.common_event_menu.fitting_height(n)
end
#--------------------------------------------------------------------------
# new method: common_event_menu
#--------------------------------------------------------------------------
def common_event_menu
$game_system.common_event_menu
end
end #Game_Interpreter
#==============================================================================
# DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_cem load_database; end
def self.load_database
load_database_cem
load_notetags_cem
end
#--------------------------------------------------------------------------
# new method: load_notetags_cem
#--------------------------------------------------------------------------
def self.load_notetags_cem
groups = [$data_common_events]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_cem
end
end
end
end # DataManager
#==============================================================================
# RPG::CommonEvent
#==============================================================================
class RPG::CommonEvent
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :cem_description
attr_accessor :cem_icon_index
attr_accessor :picture
attr_accessor :menu_name
attr_accessor :subtext
#--------------------------------------------------------------------------
# common cache: load_notetags_cem
#--------------------------------------------------------------------------
def load_notetags_cem
@picture = ""
@menu_name = name
@cem_description = ""
@subtext = ""
@cem_icon_index = TIM::COMMON_EVENT_MENU::DEFAULT_ICON
cem_help_description_on = false
subtext_on = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when TIM::COMMON_EVENT_MENU::REGEXP::ICON_INDEX
@cem_icon_index = $1.to_i
when TIM::COMMON_EVENT_MENU::REGEXP::MENU_NAME
@menu_name = $1.to_s
when TIM::COMMON_EVENT_MENU::REGEXP::PICTURE
@picture = $1.to_s
#---
when TIM::COMMON_EVENT_MENU::REGEXP::HELP_DESCRIPTION_ON
cem_help_description_on = true
when TIM::COMMON_EVENT_MENU::REGEXP::HELP_DESCRIPTION_OFF
cem_help_description_on = false
when TIM::COMMON_EVENT_MENU::REGEXP::SUBTEXT_ON
subtext_on = true
when TIM::COMMON_EVENT_MENU::REGEXP::SUBTEXT_OFF
subtext_on = false
else
@cem_description += line.to_s if cem_help_description_on
@subtext += line.to_s if subtext_on
#---
end
} # self.note.split
#---
@cem_description.gsub!(/[|]/i) { "\n" }
@subtext.gsub!(/[|]/i) { "\n" }
end
#--------------------------------------------------------------------------
# new method: note (copy from Yanfly's common event shop)
#--------------------------------------------------------------------------
def note
@note = ""
@list.each { |event|
next if event.nil?
next unless [108, 408].include?(event.code)
@note += event.parameters[0] + "\r\n"
} # Do not remove
return @note
end
end # RPG::CommonEvent
#==============================================================================
# Window_CEM
#==============================================================================
class Window_CEM < Window_Base
attr_accessor :cem_cmd_window
#--------------------------------------------------------------------------
# * Object Initialization
# cem_params is a Window_Parameters object
#--------------------------------------------------------------------------
def initialize(cem_params)#x, y, width, height, opacity = 255)
@event_id = 0
super(*cem_params)
self.opacity = cem_params.opacity
hide unless cem_params.show?
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
refresh if @cem_cmd_window && @cem_cmd_window.current_common_event_id != @event_id
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@event_id = @cem_cmd_window.current_common_event_id if @cem_cmd_window
contents.clear
draw_contents
end
#--------------------------------------------------------------------------
# new method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
end
end #Window_CEM
#==============================================================================
# Window_CEM_Picture
#==============================================================================
class Window_CEM_Picture < Window_CEM
#--------------------------------------------------------------------------
# override method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
ce = $data_common_events[@event_id]
return unless ce
bitmap = Cache.picture(ce.picture)
rect = Rect.new(0,0,bitmap.width,bitmap.height)
contents.blt(0, 0, bitmap, rect)
bitmap.dispose
end
end #Window_CEM_Picture
#==============================================================================
# Window_CEM_Subtext
#==============================================================================
class Window_CEM_Subtext < Window_CEM
#--------------------------------------------------------------------------
# override method: draw_contents
#--------------------------------------------------------------------------
def draw_contents
ce = $data_common_events[@event_id]
return unless ce
draw_text_ex(4, 0, ce.subtext)
end
end #Window_CEM_Subtext
#==============================================================================
# Window_CEM_Subtext
#==============================================================================
class Window_CEM_Help < Window_Help
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
w_params = $game_system.common_event_menu.menu_help
super(TIM::COMMON_EVENT_MENU::HELP_WINDOW_LINES)
self.x = w_params.x
self.y = w_params.y
self.width = w_params.width
self.height = w_params.height
self.opacity = w_params.opacity
hide unless w_params.show?
end
#--------------------------------------------------------------------------
# override method: set_item
#--------------------------------------------------------------------------
def set_item(item)
set_text(item ? item.cem_description : "")
end
end #Window_CEM_Help
#==============================================================================
# Window_CEM_Command -> list of all common events to select
#==============================================================================
class Window_CEM_Command < Window_Command
attr_reader :common_events
#--------------------------------------------------------------------------
# override method: initialize
#--------------------------------------------------------------------------
def initialize
@w_params = $game_system.common_event_menu.menu
@common_events = $game_system.common_event_menu.list.dup
super(@w_params.x,@w_params.y)
self.opacity = @w_params.opacity
hide unless @w_params.show?
end
#--------------------------------------------------------------------------
# new method: item
#--------------------------------------------------------------------------
def item; current_common_event; end
#--------------------------------------------------------------------------
# override method: update_help
#--------------------------------------------------------------------------
def update_help; @help_window.set_item(item); end
#--------------------------------------------------------------------------
# new method: command_ext
#--------------------------------------------------------------------------
def command_ext(index); @list[index][:ext]; end
#--------------------------------------------------------------------------
# new method: current_common_event
#--------------------------------------------------------------------------
def current_common_event; $data_common_events[current_ext] rescue nil; end
#--------------------------------------------------------------------------
# new method: current_common_event_id
#--------------------------------------------------------------------------
def current_common_event_id; current_common_event ? current_common_event.id : 0; end
#--------------------------------------------------------------------------
# override method: col_max
#--------------------------------------------------------------------------
def col_max; @w_params.columns; end
#--------------------------------------------------------------------------
# override method: window_width
#--------------------------------------------------------------------------
def window_width; @w_params.width; end
#--------------------------------------------------------------------------
# override method: window_height
#--------------------------------------------------------------------------
def window_height; @w_params.height; end
#--------------------------------------------------------------------------
# override method: ok_enabled?
#--------------------------------------------------------------------------
def ok_enabled?; handle?(:ok); end
#--------------------------------------------------------------------------
# override method: make_command_list
#--------------------------------------------------------------------------
def make_command_list
@common_events.each{|id| add_command_common_event(id)}
end
#--------------------------------------------------------------------------
# new method: add_command_common_event
#--------------------------------------------------------------------------
def add_command_common_event(id)
ce = $data_common_events[id]
add_command(ce.name, :common_event, true, id) if ce
end
#--------------------------------------------------------------------------
# override method: draw_item(index) -> adds an icon if available
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect_for_text(index)
ce = $data_common_events[command_ext(index)]
draw_common_event(ce, rect.x, rect.y, command_enabled?(index))#, rect.width)
end
#--------------------------------------------------------------------------
# new method: draw_common_event
#--------------------------------------------------------------------------
def draw_common_event(ce, dx, dy, enabled = true)#, dw = 172)
return if ce.nil?
draw_icon(ce.cem_icon_index, dx, dy, enabled)
draw_text_ex(dx+24, dy, ce.menu_name)
#draw_text(dx+24, dy, dw, line_height, ce.menu_name)
end
end #Window_CEM_Command
#==============================================================================
# Scene_MenuCommonEvent
#==============================================================================
class Scene_MenuCommonEvent < Scene_MenuBase
#--------------------------------------------------------------------------
# override method: start
#--------------------------------------------------------------------------
def start
super
create_ce_windows
end
#--------------------------------------------------------------------------
# new method: create_cem_command_window
#--------------------------------------------------------------------------
def create_cem_command_window
@ce_window = Window_CEM_Command.new
@ce_window.viewport = @viewport
@ce_window.help_window = @help_window
@ce_window.set_handler(:ok, method(:on_item_ok)) if $game_system.common_event_menu.confirm?
@ce_window.set_handler(:cancel, method(:cancel)) if $game_system.common_event_menu.cancel?
end
#--------------------------------------------------------------------------
# new method: create_cem_picture_window
#--------------------------------------------------------------------------
def create_cem_picture_window
@ce_picture_window = Window_CEM_Picture.new($game_system.common_event_menu.menu_picture)
@ce_picture_window.viewport = @viewport
@ce_picture_window.cem_cmd_window = @ce_window
end
#--------------------------------------------------------------------------
# new method: create_cem_subtext_window
#--------------------------------------------------------------------------
def create_cem_subtext_window
@ce_subtext_window = Window_CEM_Subtext.new($game_system.common_event_menu.menu_subtext)
@ce_subtext_window.viewport = @viewport
@ce_subtext_window.cem_cmd_window = @ce_window
end
#--------------------------------------------------------------------------
# overwrite method: create_help_window
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_CEM_Help.new
@help_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# new method: create_ce_windows
#--------------------------------------------------------------------------
def create_ce_windows
create_help_window
create_cem_command_window
create_cem_picture_window
create_cem_subtext_window
end
#--------------------------------------------------------------------------
# new method: on_item_ok
#--------------------------------------------------------------------------
def on_item_ok
$game_temp.reserve_common_event(@ce_window.current_common_event_id)
return_scene
end
#--------------------------------------------------------------------------
# new method: cancel
#--------------------------------------------------------------------------
def cancel
$game_temp.reserve_common_event($game_system.common_event_menu.menu_cancel_common_event)
return_scene
end
end #Scene_MenuCommonEvent
Put below my script this small script to change the text used to have icons/help description in the common event menu:
Ruby:
#==============================================================================
# Common event menu VX Ace 1.2 alternative patch
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 22/09/2025
#==============================================================================
# Description: Changes the index and description regexp to be distinct from
# Yanfly's Common Event Shop, use this only if you don't want the same icon
# and help description for a common event in the shop and the added menu.
#
# <CEM Icon: x>
#
# <CEM Help Description>
# text|text
# </CEM Help Description>
#==============================================================================
# Term of use: free for both commercial and non commercial games
#==============================================================================
# Installation: put it below Common Event Menu script
#==============================================================================
$imported = {} if $imported.nil?
$imported["TIM-CommonEventMenu-alt"] = true
if $imported["TIM-CommonEventMenu-alt"]
module TIM
module COMMON_EVENT_MENU
module REGEXP
ICON_INDEX = /<CEM (?:ICON|(?:i|I)con):[ ](\d+)>/i
HELP_DESCRIPTION_ON = /<CEM (?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
HELP_DESCRIPTION_OFF = /<\/CEM (?:HELP_DESCRIPTION|(?:h|H)elp description)>/i
end #REGEXP
end #COMMON_EVENT_MENU
end #TIM
end #$imported["TIM-CommonEventMenu-alt"]
Well, I appreciate all your help my friend!
I'll share the link to this in the FNaFb discord I'm in; someone seemed interested in it.
If any bugs are found I'll ask them to comment or let me know about it and I'll come a knockin'!
Heya! I’m back again.
Was curious if you could add a multiple menu type function? Similar to the CE shop script? Could take the door and expand the use cases for the script wide open.
Was curious if you could add a multiple menu type function? Similar to the CE shop script? Could take the door and expand the use cases for the script wide open.
Hello, I'm not sure I understand your request?
Do you want something like the shop lists where you have premade list of common events linked to some menu id?
The CEM script is parameter-heavy since you can modify dynamically the size and position of the windows, I can provide a small premade list of events if that's what you want, but the rest of the parameters should still be set by your hand.
Edit: Btw I adapted the menus layout from Yanfly's Pack1 & Pack2 into an addon for the script here:
Ruby:
#==============================================================================
# Common Event Menu VX Ace - addon More Setups
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 19/10/2025
# Requires : Common Event Menu Ace 1.2 or later by me
#==============================================================================
# Description: adds more setups to the common event menu following Pack1 & 2
# from Yanfly's page
# http://www.yanfly.moe/wiki/Common_Event_Menu_Setup_Pack_1_(YEP)
# http://www.yanfly.moe/wiki/Common_Event_Menu_Setup_Pack_2_(YEP)
#
# New script calls are the following:
# (you can either use common_event_menu or $game_system.common_event_menu)
#
# -from Pack1:
# common_event_menu.reverse_setup
# common_event_menu.full_single_setup
# common_event_menu.full_double_setup
# common_event_menu.double_common_setup
# common_event_menu.double_subtext_setup
# common_event_menu.double_picture_setup
# common_event_menu.double_hybrid_setup
# common_event_menu.double_reverse_hybrid_setup
# common_event_menu.sandwich_single_setup
# common_event_menu.sandwich_double_setup
# common_event_menu.sandwich_picture_setup
# common_event_menu.sandwich_reverse_picture_setup
#
# -from Pack2:
# common_event_menu.side_subtext_setup
# common_event_menu.side_reverse_subtext_setup
# common_event_menu.subtext_picture_setup
# common_event_menu.subtext_reverse_picture_setup
# common_event_menu.picture_subtext_setup
# common_event_menu.picture_reverse_subtext_setup
# common_event_menu.side_picture_setup
# common_event_menu.side_reverse_picture_setup
# common_event_menu.left_half_setup
# common_event_menu.left_half_subtext_setup
# common_event_menu.left_half_picture_setup
# common_event_menu.right_half_setup
# common_event_menu.right_half_subtext_setup
# common_event_menu.right_half_picture_setup
#==============================================================================
# Term of use: free for both commercial and non commercial projects, credit is
# required. Credit Yanfly too since this script follows his original plugin.
#==============================================================================
# Installation: put it below the required script, should be compatible with
# almost anything
#==============================================================================
$imported = {} if $imported.nil?
$imported["TIM-CommonEventMenu-MoreSetups"] = true
module TIM
module COMMON_EVENT_MENU
#height for double_subtext_setup, double_picture_setup, double_hybrid_setup
#and double_reverse_hybrid_setup modes
PICTURE_SUBTEXT_LINES = 4
#height of event list for subtext_picture_setup,subtext_reverse_picture_setup
#picture_subtext_setup and picture_reverse_subtext_setup
MAINLIST_LINES_PACK2 = 4
#==========================================================================
# CEM_Parameters
#==========================================================================
class CEM_Parameters
#========================================================================
# Pack 1
#========================================================================
#------------------------------------------------------------------------
# new method: reverse_setup -> premade setup like this:
# ----------------
# help
# ----------------
# picture| list
# -------| of
# subtext| events
# ----------------
#------------------------------------------------------------------------
def reverse_setup
default_setup
@menu.x = Graphics.width/2
@menu_picture.x = 0
@menu_subtext.x = 0
end
#------------------------------------------------------------------------
# new method: full_single_setup -> premade setup like this:
# ----------------
# list
# of
# events
# ----------------
#------------------------------------------------------------------------
def full_single_setup
@menu = Window_Select_Parameters.new(0, 0, Graphics.width, Graphics.height, 255, 1)
@menu_help = Window_Parameters.new
@menu_picture = Window_Parameters.new
@menu_subtext = Window_Parameters.new
end
#------------------------------------------------------------------------
# new method: full_double_setup -> premade setup like this:
# ----------------
# list of
# events on
# two columns
# ----------------
#------------------------------------------------------------------------
def full_double_setup
full_single_setup
@menu.columns = 2
end
#------------------------------------------------------------------------
# new method: double_common_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events on
# two columns
# ----------------
#------------------------------------------------------------------------
def double_common_setup
basic_setup
@menu.columns = 2
end
#------------------------------------------------------------------------
# new method: double_subtext_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events
# ----------------
# subtext
#
# ----------------
#------------------------------------------------------------------------
def double_subtext_setup
double_common_setup
h2 = fitting_height(PICTURE_SUBTEXT_LINES)
@menu.height -= h2
y = @menu.y + @menu.height
@menu_subtext = Window_Parameters.new(0,y,Graphics.width,h2)
end
#------------------------------------------------------------------------
# new method: double_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events
# ----------------
# picture
#
# ----------------
#------------------------------------------------------------------------
def double_picture_setup
double_subtext_setup
@menu_picture = @menu_subtext.dup
@menu_subtext.hide
end
#------------------------------------------------------------------------
# new method: double_hybrid_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events
# ----------------
# picture | subtext
# |
# ----------------
#------------------------------------------------------------------------
def double_hybrid_setup
double_picture_setup
@menu_picture.width = Graphics.width/2
@menu_subtext = @menu_picture.dup
@menu_subtext.x = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: double_reverse_hybrid_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events
# ----------------
# subtext | picture
# |
# ----------------
#------------------------------------------------------------------------
def double_reverse_hybrid_setup
double_hybrid_setup
@menu_picture.x = Graphics.width/2
@menu_subtext.x = 0
end
#------------------------------------------------------------------------
# new method: sandwich_single_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list
# events
# ----------------
# subtext
# ----------------
#------------------------------------------------------------------------
def sandwich_single_setup
h1 = fitting_height(HELP_WINDOW_LINES)
@menu = Window_Select_Parameters.new(0, h1, Graphics.width, Graphics.height - 2*h1, 255, 1)
@menu_help = Window_Parameters.new(0, 0, Graphics.width, h1, 255)
@menu_picture = Window_Parameters.new
@menu_subtext = Window_Parameters.new(0,Graphics.height-h1,Graphics.width, h1)
end
#------------------------------------------------------------------------
# new method: sandwich_double_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list of
# events on
# ----------------
# subtext
# ----------------
#------------------------------------------------------------------------
def sandwich_double_setup
sandwich_single_setup
@menu.columns = 2
end
#------------------------------------------------------------------------
# new method: sandwich_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list | picture
# events |
# ----------------
# subtext
# ----------------
#------------------------------------------------------------------------
def sandwich_picture_setup
h1 = fitting_height(HELP_WINDOW_LINES)
sandwich_single_setup
@menu.width = Graphics.width/2
@menu_picture = Window_Parameters.new(Graphics.width/2,h1,Graphics.width/2,Graphics.height - 2*h1)
end
#------------------------------------------------------------------------
# new method: sandwich_reverse_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# picture| list
# | events
# ----------------
# subtext
# ----------------
#------------------------------------------------------------------------
def sandwich_reverse_picture_setup
sandwich_picture_setup
@menu.x = Graphics.width/2
@menu_picture.x = 0
end
#========================================================================
# Pack 2
#========================================================================
#------------------------------------------------------------------------
# new method: side_subtext_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list |
# of | subtext
# events |
# ----------------
#------------------------------------------------------------------------
def side_subtext_setup
default_setup
@menu_subtext.y = @menu.y
@menu_subtext.height = @menu.height
@menu_picture.hide
end
#------------------------------------------------------------------------
# new method: side_reverse_subtext_setup -> premade setup like this:
# ----------------
# help
# ----------------
# | list
# subtext| of
# | events
# ----------------
#------------------------------------------------------------------------
def side_reverse_subtext_setup
side_subtext_setup
@menu_subtext.x = 0
@menu.x = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: subtext_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list |
# -------| subtext
# picture|
# ----------------
#------------------------------------------------------------------------
def subtext_picture_setup
side_subtext_setup
h2 = fitting_height(MAINLIST_LINES_PACK2)
@menu.height = h2
@menu_picture.x = 0
@menu_picture.y = @menu.y + @menu.height
@menu_picture.height = Graphics.height - @menu_picture.y
@menu_picture.show
end
#------------------------------------------------------------------------
# new method: subtext_reverse_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# | list
# subtext| -------
# | picture
# ----------------
#------------------------------------------------------------------------
def subtext_reverse_picture_setup
subtext_picture_setup
@menu.x = Graphics.width/2
@menu_picture.x = Graphics.width/2
@menu_subtext.x = 0
end
#------------------------------------------------------------------------
# new method: picture_subtext_setup
# ----------------
# help
# ----------------
# list |
# -------| picture
# subtext|
# ----------------
#------------------------------------------------------------------------
def picture_subtext_setup
subtext_picture_setup
w = @menu_subtext
@menu_subtext = @menu_picture
@menu_picture = w
end
#------------------------------------------------------------------------
# new method: picture_reverse_subtext_setup
# ----------------
# help
# ----------------
# | list
# picture| -------
# | subtext
# ----------------
#------------------------------------------------------------------------
def picture_reverse_subtext_setup
picture_subtext_setup
@menu.x = Graphics.width/2
@menu_subtext.x = Graphics.width/2
@menu_picture.x = 0
end
#------------------------------------------------------------------------
# new method: side_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# list |
# of | picture
# events |
# ----------------
#------------------------------------------------------------------------
def side_picture_setup
default_setup
@menu_picture.height = @menu.height
@menu_subtext.hide
end
#------------------------------------------------------------------------
# new method: side_reverse_picture_setup -> premade setup like this:
# ----------------
# help
# ----------------
# | list
# picture| of
# | events
# ----------------
#------------------------------------------------------------------------
def side_reverse_picture_setup
side_picture_setup
@menu_picture.x = 0
@menu.x = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: left_half_setup
# --------
# help
# --------
# list
# of
# events
# --------
#------------------------------------------------------------------------
def left_half_setup
basic_setup
@menu.width = Graphics.width/2
@menu_help.width = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: left_half_subtext_setup
# --------
# help
# --------
# list
# of
# events
# --------
# subtext
# --------
#------------------------------------------------------------------------
def left_half_subtext_setup
sandwich_single_setup
@menu.width = Graphics.width/2
@menu_help.width = Graphics.width/2
@menu_subtext.width = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: left_half_picture_setup
# --------
# help
# --------
# list
# of
# --------
# picture
#
# --------
#------------------------------------------------------------------------
def left_half_picture_setup
subtext_picture_setup
@menu_help.width = Graphics.width/2
@menu_subtext.hide
end
#------------------------------------------------------------------------
# new method: right_half_setup
# --------
# help
# --------
# list
# of
# events
# --------
# subtext
# --------
#------------------------------------------------------------------------
def right_half_setup
left_half_setup
@menu.x = Graphics.width/2
@menu_help.x = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: right_half_subtext_setup
# --------
# help
# --------
# list
# of
# --------
# picture
#
# --------
#------------------------------------------------------------------------
def right_half_subtext_setup
left_half_subtext_setup
@menu.x = Graphics.width/2
@menu_help.x = Graphics.width/2
@menu_subtext.x = Graphics.width/2
end
#------------------------------------------------------------------------
# new method: right_half_picture_setup
# --------
# help
# --------
# list
# of
# events
# --------
#------------------------------------------------------------------------
def right_half_picture_setup
left_half_picture_setup
@menu.x = Graphics.width/2
@menu_help.x = Graphics.width/2
@menu_picture.x = Graphics.width/2
end
end #CEM_Parameters
end #COMMON_EVENT_MENU
end #TIM
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-common-event-menu-but-for-vxa.180187/