[VX ACE] Common Event as an Option in the Menu

Hi guys!!!

I've been using a script to add a common event option to the scene_menu and everything works great. However, there is only one problem, when activating the option in the menu, first you return to the scene_map and only then activate the common event, I would like you to open the common event without making this transition. It is possible ? Thanks in advance!

(OBS: I found the script here, https://www.rpgmakercentral.com/topic/21542-how-to-add-menu-option-to-common-event/)

Spoiler
=begin # ---------------------------------------------------------------------------- # # Phantasy Star IV Talk System (By Common Events) # By: SoulPour777 # Requested by: Silencher to change the number of the common event to call via script call: $common_event_number = n example: $common_event_number = 1 this will call Common Event #1 # ---------------------------------------------------------------------------- # =end $common_event_number = 60 class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias soul_create_command_window create_command_window def create_command_window soul_create_command_window @command_window.set_handler(:common_events_menu, method(:command_ce)) end def command_ce SceneManager.goto(Scene_Map) $game_temp.reserve_common_event($common_event_number) end end
The only way to accomplish this is to use TsukiHime Scene Interpreter script.
@dragolipe2 You need Himeworks's Scene Interpreter as it allows messages & common events to run inside of the menu.
Thank you very much for your help Roninator2 and RCXGaming ^^ So, I was going to use this for an attribute system that I made by events and I wanted to open it directly from the menu, but as it is "simple", I decided to learn how to program and create my attribute system script to really solve this problem and also to finally learn ruby.


And luckily I was able to create the script, but taking advantage of the question, I just have one problem with my script. In my stat system, with each point increasing in "dexterity", the actor received +0.33% dodge and +0.33% critical. To do this I used the Shaz - Dynamic Features script, but now I don't know how I can do this in my script, if anyone can help me I would be very grateful!


Here is my first script :

Spoiler
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# # ▼ Sistema de Atributos # # Autor: Dragolipe2 # # Data de Criação: 29/05/2022 # #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=# class Scene_Atributos < Scene_MenuBase def start super @ator = $game_party.menu_actor.id #Criação Background @background = Sprite.new @background.bitmap = Cache.load_bitmap("Graphics/Pictures/", "Atributos_Scene#{@ator}") @background.z = 0 #Criação Janela de Descrição @descricao = 1 #Inicia no Poder @info_status = Sprite.new @info_status.bitmap = Cache.load_bitmap("Graphics/Pictures/","Atributos Descrição#{@descricao}") @info_status.z = 100 #Criação da Janela de Status @info_base = Info_Base.new(192, 128, 256, 160) @info_base.opacity = 0 @info_base.z = 50 @info_base.contents.font.name = "Prototype" @info_base.contents.font.size = 17 @info_base.contents.font.out_color = Color.new(0, 0, 0, 255) #Desenho Pontos Atributos @info_base.draw_text(172, 3, 100, 12, $game_system.pt_atributo[@ator]) #Desenho dos Atributos @info_base.contents.font.name = "Eurotype" @info_base.draw_text(9, 100, 80, 12, $game_system.pt_poder[@ator]) @info_base.draw_text(9 + 64, 100, 80, 12, $game_system.pt_defesa[@ator]) @info_base.draw_text(9 + 128, 100, 80, 12, $game_system.pt_destreza[@ator]) @info_base.draw_text(9 + 192, 100, 80, 12, $game_system.pt_sabedoria[@ator]) #Criação da Janela de Status @info_texto = Info_Texto.new(0, 0, 640, 480) @info_texto.opacity = 0 @info_texto.contents.font.name = "Eurotype" @info_texto.contents.font.size = 14 @info_texto.contents.font.out_color = Color.new(0, 0, 0, 255) #Desenho dos Status @info_texto.draw_text(56, 397, 80, 12, $game_actors[@ator].atk) @info_texto.draw_text(57, 414, 80, 12, $game_actors[@ator].mat) #Criação Janela Selecionavel @window_escolha = Window_Escolha.new @window_escolha.opacity = 0 @window_escolha.z = 200 @window_escolha.set_handler(:poder, method(:atk)) @window_escolha.set_handler(:defesa, method(:guard)) @window_escolha.set_handler(:destreza, method(:dex)) @window_escolha.set_handler(:cura, method(:heal)) end #def Start class Info_Base < Window_Base #Janela Status def initialize(x, y, width, height) super end #initialize end #class Info_Base class Info_Texto < Window_Base #Janela Status def initialize(x, y, width, height) super end #initialize end #class Info_Texto class Window_Escolha < Window_HorzCommand #Janela Escolha Horizon def initialize super(201, 185) end #initialize def window_width() return 275 end # 230 def window_height() return 50 end # 48 def col_max return 4 end #def def item_rect(index) rect = super rect.width = 22 rect.height = 22 rect end def make_command_list add_command("", :poder) add_command("", :defesa) add_command("", :destreza) add_command("", :cura) end #def end #class Window_Escolha def atk if $game_system.pt_atributo[@ator] >0 #1 Cond $game_system.pt_atributo[@ator] -= 1 $game_system.pt_poder[@ator] += 1 $game_actors[@ator].add_param(2, 1) #Força $game_actors[@ator].add_param(4, 1) #Magia pontos_gerais status_update @window_escolha.activate else Sound.play_buzzer @window_escolha.activate end #1 Cond end #def atk def guard if $game_system.pt_atributo[@ator] >0 #1 Cond $game_system.pt_atributo[@ator] -= 1 $game_system.pt_defesa[@ator] += 1 $game_actors[@ator].add_param(0, 3) #HP Máximo $game_actors[@ator].add_param(3, 1) #Defesa $game_actors[@ator].add_param(5, 1) #Espírito pontos_gerais status_update @window_escolha.activate else Sound.play_buzzer @window_escolha.activate end #1 Cond end #def def def dex if $game_system.pt_atributo[@ator] >0 #1 Cond $game_system.pt_atributo[@ator] -= 1 $game_system.pt_destreza[@ator] += 1 $game_actors[@ator].add_param(6, 1) #Agilidade pontos_gerais status_update @window_escolha.activate else Sound.play_buzzer @window_escolha.activate end #1 Cond end #def dex def heal if $game_system.pt_atributo[@ator] >0 #1 Cond $game_system.pt_atributo[@ator] -= 1 $game_system.pt_sabedoria[@ator] += 1 $game_actors[@ator].add_param(7, 1) #Cura pontos_gerais status_update @window_escolha.activate else Sound.play_buzzer @window_escolha.activate end #1 Cond end #def heal def update super if Input.trigger?(:RIGHT) case @descricao when 1 @descricao = 2 descricao_update status_update when 2 @descricao = 3 descricao_update status_update when 3 @descricao = 4 descricao_update status_update when 4 @descricao = 1 descricao_update status_update end #case descricao end #(:RIGHT) if Input.trigger?(:LEFT) case @descricao when 4 @descricao = 3 descricao_update status_update when 3 @descricao = 2 descricao_update status_update when 2 @descricao = 1 descricao_update status_update when 1 @descricao = 4 descricao_update status_update end #case decricao end #(:LEFT) if Input.trigger?(:B) SceneManager.return end #Cond (:B) if Input.trigger?(:L) case @ator when 1 #@ator == 1 if $game_party.members.size >= 2 #game_party.size if $game_party.members.include?($game_actors[3]) #def ator 2 ? $game_party.menu_actor_prev Sound.play_cursor @ator = 3 else #ator 2 n esta $game_party.menu_actor_prev Sound.play_cursor @ator = 2 end #def ator 2 ? else #game_size menor 2 Sound.play_buzzer @ator = 1 end #game_party.size when 2 #@ator == 2 $game_party.menu_actor_prev Sound.play_cursor @ator = 1 when 3 #@ator == 3 if $game_party.members.include?($game_actors[2]) #def ator 3 ? $game_party.menu_actor_prev Sound.play_cursor @ator = 2 else $game_party.menu_actor_prev Sound.play_cursor @ator = 1 end #def ator 3 ? end #case pontos_gerais status_update background_update end #Cond (:L) if Input.trigger?(:R) case @ator when 1 #@ator == 1 if $game_party.members.size >= 2 #game_party.size if $game_party.members.include?($game_actors[2]) #def ator 2 ? $game_party.menu_actor_next Sound.play_cursor @ator = 2 else #ator 2 n esta $game_party.menu_actor_next Sound.play_cursor @ator = 3 end #def ator 2 ? else #game_size menor 2 Sound.play_buzzer @ator = 1 end #game_party.size when 2 #@ator == 2 if $game_party.members.include?($game_actors[3]) #def ator 3 ? $game_party.menu_actor_next Sound.play_cursor @ator = 3 else $game_party.menu_actor_next Sound.play_cursor @ator = 1 end #def ator 3 ? when 3 #@ator == 3 $game_party.menu_actor_next Sound.play_cursor @ator = 1 end #case pontos_gerais status_update background_update end #Cond (:R) end #update def descricao_update @info_status.bitmap = Cache.load_bitmap("Graphics/Pictures/","Atributos Descrição#{@descricao}") end def background_update @background.bitmap = Cache.load_bitmap("Graphics/Pictures/", "Atributos_Scene#{@ator}") end def pontos_gerais @info_base.contents.clear @info_base.contents.font.name = "Prototype" @info_base.contents.font.size = 17 @info_base.contents.font.out_color = Color.new(0, 0, 0, 255) #Desenho Pontos Atributos @info_base.draw_text(172, 3, 100, 12, $game_system.pt_atributo[@ator]) #Desenho dos Atributos @info_base.contents.font.name = "Eurotype" @info_base.draw_text(9, 100, 80, 12, $game_system.pt_poder[@ator]) @info_base.draw_text(9 + 64, 100, 80, 12, $game_system.pt_defesa[@ator]) @info_base.draw_text(9 + 128, 100, 80, 12, $game_system.pt_destreza[@ator]) @info_base.draw_text(9 + 192, 100, 80, 12, $game_system.pt_sabedoria[@ator]) end def status_update case @descricao when 1 @info_texto.draw_text(56, 397, 100, 12, $game_actors[@ator].atk) @info_texto.draw_text(57, 414, 100, 12, $game_actors[@ator].mat) when 2 @info_texto.contents.clear @info_texto.draw_text(39, 397, 100, 12, $game_actors[@ator].mhp) @info_texto.draw_text(65, 414, 100, 12, $game_actors[@ator].def) @info_texto.draw_text(67, 432, 100, 12, $game_actors[@ator].mdf) when 3 @info_texto.contents.clear @info_texto.draw_text(75, 397, 100, 12, $game_actors[@ator].agi) cri = $game_actors[@ator].cri.round(1) * 100 eva = $game_actors[@ator].eva.round(1) * 100 @info_texto.draw_text(69, 414, 100, 12, "#{cri} %") @info_texto.draw_text(90, 432, 100, 12, "#{eva} %") when 4 @info_texto.contents.clear @info_texto.draw_text(50, 397, 100, 12, $game_actors[@ator].luk) mev = $game_actors[@ator].mev.round(1) * 100 cnt = $game_actors[@ator].cnt.round(1) * 100 @info_texto.draw_text(112, 414, 100, 12, "#{mev} %") @info_texto.draw_text(106, 432, 100, 12, "#{cnt} %") end #case end #def status end #class Atributos #============================================================================== # ■ Dragolipe_Pontos Atributos/Level Up #============================================================================== class Game_System attr_accessor :pt_atributo attr_accessor :pt_poder attr_accessor :pt_defesa attr_accessor :pt_destreza attr_accessor :pt_sabedoria attr_accessor :pt_cristais attr_accessor :pt_cristais_max alias :my_test_initialize :initialize def initialize my_test_initialize @pt_atributo = [nil,0,0,5] #pontos atributos @pt_poder = [nil,10,10,10] #pontos poder @pt_defesa = [nil,10,10,10] #pontos defesa @pt_destreza = [nil,10,10,10] #pontos destreza @pt_sabedoria = [nil,10,10,10] #pontos sabedoria @pt_cristais = [nil,10,10,10] #pontos cristais atuais @pt_cristais_max = [nil,10,10,10] #pontos cristais máximos end #initialize end #class Game_System class Game_Actor < Game_Battler alias :drago_level_up :level_up def level_up drago_level_up $game_system.pt_atributo[self.id]+=5 end end

(OBS: Sorry for my english and in case I shouldn't post this question here, just let me know and I'll delete it.)
Have you looked at other stat distribution systems?
I use KMS distribution script
I looked at some and found really good scripts, but I would like something really simple and use my background images, so I decided to create my own system.

I managed to solve my problem, I tried not to use Shaz, to learn how to change the special parameters, but in the end I did it the simplest way, I called his method through my script.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-common-event-as-an-option-in-the-menu.147812/