AlertWindow ACE

AlertWindow ACE
versions 1.2.0 & 0.8.0

by Kyonides
​

Introduction

There was a forumer that "stubbornly" wanted to use pop up windows that looked pretty much like VX ACE's default Window_MapName class. This means that it would show up the same way the map name does.

Obviously, it will not be triggered after a map transfer for obvious reasons. :eswt:

Just in case you did not know this, my script allows you to pass either a single line of text or an Array of lines as its first parameter.

:eswt: Don't worry, my friends! The rest of the parameters are totally optional! 😉

Convenient Features

You can set an additional button to close the alerts.
\gs[1] gets replaced by the corresponding game switch, i.e. ON or OFF.
\v[1] gets replaced by the corresponding game variable.
Set the Alert Window's Coordinates: $game_system.set_alert_xy(X, Y)

Examples for Passing a Single Line of Text:

Ruby:
pop_up("Some text")
Alert.add("Some text")

Examples for Passing 2+ Lines of Text:

Ruby:
texts = ["Line1", "Line2"]
pop_up(texts)
Alert.add(texts)

Optional Parameters:

Ruby:
pop_up(text, 60)
Alert.add(text, frames, 60)

Ruby:
pop_up(text, 60, 120, 1, 80)
Alert.add(text, 60, 120, 1, 80)

...and a few other arguments. :eswt:

DOWNLOAD DEMO
Either 1.2.0 or 0.8.0
​

Terms & Conditions

Free for use in ANY game. 😀
Due credit is mandatory. :eswt:
That's it! 😀
List of the Latest Features Added to My Script​

1. You can set an additional button to close the alerts.
2. \gs[1] gets replaced by the corresponding game switch, i.e. ON or OFF.
3. \v[1] gets replaced by the corresponding game variable.
4. Set the Alert Window's Coordinates: $game_system.set_alert_xy(X, Y)

Side Note:
\gs needs to be used here because a simple \s escape character could be treated as a white space by Ruby.
@kyonides Almost perfect solution for me, however, I cannot align.

Using...

Ruby:
pop_up(text, frames, align, x, y)

... or ...

Ruby:
Alert.add(text, frames, align, x, y)

... gives me always wrong argument number (5 of 4)
Since version 0.8.0 you can't change the text alignment, sadly. The good news are that you might get other stuff you badly wanted like color changes and icons and others. Just download the demo and you'll see the color change in action!
The Script Brings Brand New Extra Features Now!​

The recent release of version 1.0.0 comes with some extra goodies:
  • \ev[1] gets replaced with the corresponding event's name.
  • \en[1] gets replaced with the corresponding enemy's name.
  • \i! makes the alert take precedence over the remaining ones.
    It will try to display it on screen as soon as possible.
:eswt: Keep in mind that you better use 'single quotes' if you're planning to use those custom escape characters.
Since version 0.8.0 you can't change the text alignment, sadly. The good news are that you might get other stuff you badly wanted like color changes and icons and others. Just download the demo and you'll see the color change in action!
Yes, I noticed this. Thanks for that. :LZScheeze: However, I badly need that center text function, else the displayed text would look quite off. If I have this, I will kindly throw my current script solution away and use your masterpiece. 🙂
The Script's Latest Feature is a Very Old one!​

:eswt: I know that doesn't seem to make any sense to you, but it's totally true! 😮

The text alignment that was lost in version 0.8.0 has made a great comeback :thumbs: in version 1.1.0, my dear friends. 😀

And nope, you don't have to fear anything for you won't lose any of the typical escape codes at all. 😉

Just in case you want to manually set the text alignment before a group of alerts show up, use this:

Ruby:
$game_system.alert_align = 1
@kyonides I noticed two minor things that I need to be fixed. First thing is when I add a pop-up like this...

Ruby:
pop_up('\i[12] \c[6]Test\c[0] Message.', 80, 1)

... the icon doesn't get aligned with the text. Instead, it stays on the left.

Second one is when I set either the duration or wait for input, in both cases, other events continue like the player can move around freely while the popup is there. I want to prevent this. Can I set a switch maybe so the popup behaves like a autostart event meaning the player is not able to move around while the popup is active either as long as the duration lasts or the proper key defined is being pressed?
First of all, being able to move while the alert is still visible is not a bug but a feature. I never intended to completely freeze the player because of any alert so it's working just as intended.

I'll have to thoroughly test the demo to see why the icon doesn't get included in the realignment like the text does. :eswt: Yet, I've got my suspicions on what happened there.
A New Release Has Come!​

Since version 1.2.0 came out, you can include icons in your alerts and they will get aligned just like as rest of its contents does by default.

:eswt: Oh but it also includes a new feature, one I personally dislike but some forumers might find it useful under certain circumstances.

Did you ever feel like the player shouldn't move an inch while the alert is displayed on screen?
Well, some mysterious guy called Tw0Face certainly did so now anybody can set the STOP_PLAYER_MOVEMENT Constant to true to make sure the hero won't move at all.

Ruby:
STOP_PLAYER_MOVEMENT = true

Set it to false or nil to enable all movements at any time.

Do you need to change that setting in game?
:eswt: Guess what? You can do it if you feel like it! 😀

Ruby:
$game_system.alert_stop_player = true
@kyonides Just because of interests, is there a way to keep the alert open for like forever but have a scriptcall to have it closed manually via Event? If I display a variable in the window and the variable value changes while the alert window is already displayed, will the change be visible inside the alert window dynamically?
You do understand that would make it incompatible with the no move feature you requested some time ago? I mean that under certain circumstances you could create a situation where the player could get frozen, thus making your game unplayable... So in your position, I'd first find out if there's no other way you could achieve it without changing the current script's implementation.

About variables, I'd have to say that you better create a new alert identical to the previous one right after you changed the value of such a variable.

Original thread: https://forums.rpgmakerweb.com/threads/alertwindow-ace.162368/