Common Event Menu Troubles

Ronove

♫꒰・‿・๑꒱
Veteran
Joined
Mar 12, 2012
Messages
1,031
Reaction score
346
First Language
English
Primarily Uses
RMMV
Hello!

In this game I've been working on I wanted a "Ask Party Member" menu if you press a button and have basically made it, but I've run into one problem: I can't make the images that make up the menu disappear if using the same button you used to open the menu.

It might help if I explained what I did to make it work.
I have a script set up so if you press A, it turns on a switch which is attached to a common event that runs the menu. If you press A again, the common event DOES turn off but I can't figure out how to make the images disappear. I have it so you can press Esc and the common event stops and the images disappear, but the same method won't work to make A work.

Here's how the Common Event looks:

If I do the Condintional Branch: Script: Input.trigger?( :X) with the same stuff as the :B trigger branch, it does get rid of the images for a brief moment, but then makes them appear again. I think it's because of what's at the top of the common event but without it, the images will keep trying to load.

The script I am using is below (and is also used to turn another switch on and off and that works fine):
Code:
class Scene_Map
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    old_update
    unless $game_message.visible
      update_arrows
      update_ask
    end
  end
  #--------------------------------------------------------------------------
  # * Directional Arrows Switch
  #--------------------------------------------------------------------------
  def update_arrows
    if Input.trigger?(Input::Y) #S on the keyboard
      $game_switches[3] = !$game_switches[3]
      $game_map.refresh
    end
  end
  def update_ask
    if Input.trigger?(Input::X) #A on the keyboard
      $game_switches[12] = !$game_switches[12]
      $game_map.refresh
    end
  end
end
Any ideas what I'm missing? I'm stumped.
 

Acetonide

Event Coordinator
Veteran
Joined
Apr 16, 2012
Messages
660
Reaction score
30
First Language
English
Primarily Uses
N/A
Okay, sorry. So basically the script would turn off the switch so your autorun common event would stop running and it is in the event that erases the pictures. B works because that is from the common event itself and that includes erasing the pictures.

I'm pretty sleep deprived and I suck at explaining in the first place so sorry if that didn't make sense but... er...
So A is connected to a script that that changes a switch between on and off. When the switch is on your event runs. It is in the event that the pictures get erased, so if the switch turns off the event stops processing so it won't process the erase pictures command.

If you use B to get out of the event it runs that part of the event until the end so it erases the pictures as part of turning off the switch as it finishes processing first.

That is how I understand things to work.
 
Last edited:

Ronove

♫꒰・‿・๑꒱
Veteran
Joined
Mar 12, 2012
Messages
1,031
Reaction score
346
First Language
English
Primarily Uses
RMMV
OK so basically, if you press A again, the common event just turns off--no time to run the turn pictures off because the script is working like it should. Think there's any way around it or would I be better to just take that part of the script out and have a parallel process running throughout the game that checks if you're pressing the button to turn on the menu?

EDIT: Well, I tried making a parallel process to decide if the button to open the menu is pressed, but it doesn't respond well so I don't think that's the answer unless I'm also doing that wrong.

EDIT2: There's a script for everything apparently and I found one to assign button pressing to common events and made everything easier.

Thank you for the attempt, Acetonide!
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Love it when someone confuses "RPG Maker (or script/plugin) has a bug" with "I didn't set it up right and it's not working as I want (or gives an error)"
Is animation really as hard as I think it is?
Out of sudden, snow. Everywhere.
Blech. I hate coming up with stories. Making gameplay is fun but coming up with lore and reasons for these areas/mechanics just makes me sleepy.

Forum statistics

Threads
94,574
Messages
922,006
Members
124,441
Latest member
nanaya07
Top