Ronove

♫꒰・‿・๑꒱
Veteran
Joined
Mar 12, 2012
Messages
1,067
Reaction score
367
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:
913af03933.png

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
31
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,067
Reaction score
367
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:

Latest Threads

Latest Posts

Latest Profile Posts

I realized that I don't talk about my game's plot too much. not that I'm hiding stuff, I just don't know what I should tell people in general that would be important. I know more so what plot points NOT to tell.
Have any of you read Sutter Kane?
jaynightwolf wrote on GalacticGod's profile.
hello GALACTICGOD I loved your characters especially the super heroes, I am new to this rpg program and I would like to know if you have more characters from DC comics, be they villains or heroes
My winter pack is now free on itch.io!
Writing music for Utara Forest, a location in All the King's Men. Nothing evokes a mysterious, dreamy sound like solo clarinet and modulation!

Forum statistics

Threads
111,471
Messages
1,061,347
Members
144,848
Latest member
YoSocrates
Top