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):
Any ideas what I'm missing? I'm stumped.
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.