Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to make check if there's a message window?
#1
Photo 
So basically, I have a little common event that runs commands depending on which number key you press, and I wanted to enable it only if there's not message windows, or maybe to make it to force to shut all the message windows, but how I do that?

 I tried to put the commands in a conditional branch with the script "$scene != Window_Message.new" but it didn't work. I mean, the game keeps doing the commands even if there's a message window, so it's like if the game ignored that code for some reason.
(This below is my signature, it's not part of the post/message)

I'm a male and italian indie game developer, spriter and musician.
I'm currently working on my own indie game, called Our Destiny.
Follow it on it's GameJolt page: https://gamejolt.com/games/ourdestinyofficial/449988

----Contacts----
Twitter: https://twitter.com/Andrea87Sky
SoundCloud: https://soundcloud.com/skycraft-team-official/tracks
YouTube: https://www.youtube.com/channel/UCjPA_e7...subscriber
Reply }
#2
You could try something like...

$game_temp.message_window_showing = false

...or add a snippet...

Code:
class Window_Message
  alias :forum_request_win_mess_up :update
  def update
    forum_request_win_mess_up
    return unless @contents_showing and $game_temp.common_event_id > 0
    if Input.trigger?(Input::BUTTON) or Input.trigger?(Input::ANOTHER_BUTTON)
      terminate_message
    end
  end
end

There you need to replace BUTTON and ANOTHER_BUTTON with the actual names of the buttons you will use. You don't know what are their names!? Then Take a look at the window that opens whenever you press F1! There you can find all of them.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX
Reply }
#3
(10-27-2019, 12:06 AM)kyonides Wrote: You could try something like...

$game_temp.message_window_showing = false

...or add a snippet...

Code:
class Window_Message
 alias :forum_request_win_mess_up :update
 def update
   forum_request_win_mess_up
   return unless @contents_showing and $game_temp.common_event_id > 0
   if Input.trigger?(Input::BUTTON) or Input.trigger?(Input::ANOTHER_BUTTON)
     terminate_message
   end
 end
end

There you need to replace BUTTON and ANOTHER_BUTTON with the actual names of the buttons you will use. You don't know what are their names!? Then Take a look at the window that opens whenever you press F1! There you can find all of them.

I dunno if it's compatible with UMS and some other scripts I have, also the keys are from a keyboard script. So it's more simple if i simply check if there's a message window showing.
(This below is my signature, it's not part of the post/message)

I'm a male and italian indie game developer, spriter and musician.
I'm currently working on my own indie game, called Our Destiny.
Follow it on it's GameJolt page: https://gamejolt.com/games/ourdestinyofficial/449988

----Contacts----
Twitter: https://twitter.com/Andrea87Sky
SoundCloud: https://soundcloud.com/skycraft-team-official/tracks
YouTube: https://www.youtube.com/channel/UCjPA_e7...subscriber
Reply }
#4
Then replace Input::BUTTON and Input::ANOTHER_BUTTON with those found in such script.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX
Reply }
#5
(10-27-2019, 10:33 PM)kyonides Wrote: Then replace Input::BUTTON and Input::ANOTHER_BUTTON with those found in such script.

I also said that i don't know if UMS it's compatible, and if I interrupt a message the event keeps going and it shows the other one that it's next it. Really, I'd prefer to use the other method instead, can someone tell me how to check if there's a message window then?

Or maybe to enable a switch everytime a message window is shown and disable it everytime it will be disposed.
(This below is my signature, it's not part of the post/message)

I'm a male and italian indie game developer, spriter and musician.
I'm currently working on my own indie game, called Our Destiny.
Follow it on it's GameJolt page: https://gamejolt.com/games/ourdestinyofficial/449988

----Contacts----
Twitter: https://twitter.com/Andrea87Sky
SoundCloud: https://soundcloud.com/skycraft-team-official/tracks
YouTube: https://www.youtube.com/channel/UCjPA_e7...subscriber
Reply }
#6
I know you think that might be better for you, and probably it'd be... The issue here is that there are times where you can only rely on scripts to alter the default behavior of the engine. I should yell this at you to let you understand what it means, but I'll try to be nice here. Laughing + Tongue sticking out You or any if the scripters can make it compatible with any script if given the chance and enough data to work with. What I suggested some time ago isn't complicated... for a scripter at least.

If you plan to use such feature only once, perhaps it'd be better for you to use an event or common event. Otherwise a script should care of it to avoid getting a cluttered event that gets hard to get debugged. And nope, I don't focus on eventing. Laughing
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX
Reply }
#7
Let's not over-analyze this. If you just want to make some action work in an event, consider this bit of code....

Code:
@>Conditional Branch: Script: $game_temp.message_window_showing != true
    @> Play SE: '032-Switch01' 80, 100
    @> Wait 20 frame(s)
    @>
: Branch End
@>

This plays the Tick sound effect and throws up a 20frame delay afterwards, but it only runs IF the message window is not showing. This example SHOULD work with ccoa's UMS as it still uses the message_window_showing value in Game_Temp.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]

Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
  [REQUEST] Anyone know how to make a professional looking world map? fgsfds 15 18,112 04-11-2015, 06:17 AM
Last Post: JayRay
  Any way to make events trigger other events? MechanicalPen 3 5,296 04-01-2013, 11:54 PM
Last Post: MechanicalPen
  How to make a Final Fantasy styled cutscene JWCaisa 3 6,320 06-15-2012, 02:40 PM
Last Post: Kain Nobel
  [Ask]how to make our own Tileset ? felicalexa 2 4,908 05-26-2012, 04:11 AM
Last Post: MetalRenard
  how to make an event touch another event mangamaniacs2064 2 5,007 08-24-2011, 01:55 PM
Last Post: RosyPosy
  How do i make a trap? kikonami123 5 6,688 03-24-2010, 11:04 PM
Last Post: kikonami123



Users browsing this thread: