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

TFW you discover how the script batching works in VNMaker... after you've had the program for almost 3 years.
Writes that the characters have to climb a mountain.

Realized that I have to draw six sets of models where characters are climbing.

At least I know how to draw something. :)
I'm currently scratching my head on how to design plains. What do I even put in plains? Some trees (but not too many or it turns into a forest)? Grass? A few bushes? That's a bit dull.
I'm looking for tutorials but Google didn't seem to find much (or maybe I have the wrong keywords). I don't know how to map plains and I don't know how to learn.
I should probably be dragged kicking and screaming away from Daz3D... I was playing with 8.1 models and came up with this. Thoughts?
and_remember_tomorrow_miranda_8_1.jpg

Forum statistics

Threads
111,403
Messages
1,060,852
Members
144,750
Latest member
corvid
Top