Jump to content

Recommended Posts

Popup WIndow v1.1
By Vlue


Introduction
Message boxes are nice for displaying information, but they can be just so bulky and unwiel.. uh unweild.. hmm.. unyielding? I give up, you win spell check. This script let's you popup up a window that's only as big as it needs to be and displays whatever information you want, and also takes all the same escape codes you can use in messages. I think. For the most part anyways.

Features
- Popup a window with text. Woot.

Screenshots
5DN8ndl.png
Ignore what the popup says, 'you' can't do that. (The screenshot would've been perfect for a banana joke, but I'm too lazy to make another)

How to Use
Plug and play, script calls to popup windows as usual.

Script
On the pastebin~ http://pastebin.com/duNznMc4

FAQ
Q: The escape codes aren't working! (Not a question, and no one asked, but I'm sure someone will)
A: Check the header of the script, it explains.

Credit and Thanks
- By Vlue
- Free to use in any project, commercial or otherwise, with credit given

Author's Notes
... post the rest...

Share this post


Link to post
Share on other sites

In theory, this could replace the default messaging system, couldn't it?

I'm gonna break this one as well. Thanks for another great script!

Share this post


Link to post
Share on other sites

I've updated the script, it should work in any scene provided you can find a way to make the script call. (Reread the header, because it's different if it's not called in an event)

Share this post


Link to post
Share on other sites

So I'm using the pop-ups and I'm noticing that contractions seem to cause script errors. I'm guessing the single apostrophe is setting the script off. Is there any way around this? The exact error I'm getting is

 

unexpected tIDENTIFIER, explecting ']'

pop_up(['can't'], 0, 50, 50)

 

I've taken out the single apostrophe in can't and it works fine.

Share this post


Link to post
Share on other sites

Try

pop_up(["can't"], 0, 50, 50)

It should work.

The code thinks that the string ends after n and not t. Because of the apostrophe there. If you change it to quotes, it'll go from a quote to a quote. Another fix could be using \' instead of ' in the can't (can\'t).

Share this post


Link to post
Share on other sites

Thank you! :D I tried using double apostrophes, and while it worked with can't by itself, it didn't work with another set of dialogue (not sure if I didn't do it right or what, but ah well). However, the backslash worked perfectly.

 

And many thanks to Vlue for this awesome script!

 

edit: Err, I feel bad having more questions, but I've run into another problem. It's a smaller one, at least, but I can't get the Y position correct. The exact script call is as follows:

 

pop_up(['\c[20]We should head back, before it gets dark.',
'\c[20]The caravan might leave without us. '],180,25,32)

 

The timer and X positioning work correctly, but the Y position is off and the pop-up window gets stuck at the top of my window screen, no matter what I change the Y to. If I don't include a Y, it stays at the default center position. Is this an error on my part?

 

Edit2: I solved the problem. It was in the script.

if x.nil?
      self.x = Graphics.width / 2 - self.width / 2
    else
      self.x = x
    end
    if y.nil?
      self.y = Graphics.height / 2 - self.height / 2
    else
      self.y
 
Should end with "self.y = y". That's why the y position wasn't working.  Error seems to be in the updated version as well (I'm still using 1.1, might upgrade now)
Edited by RaddRadda

Share this post


Link to post
Share on other sites

Vlue, I think you need your own theme song, to be played every time I check out a new script from you, some sort of cross between the "Shaft" theme and the "Pacific Rim" theme.

 

You know, for maximum cool meets badassery.

 

In other words, another awesome and useful script completed by Vlue.

Share this post


Link to post
Share on other sites

I've updated the script, it should work in any scene provided you can find a way to make the script call. (Reread the header, because it's different if it's not called in an event)

Hey, I can't seem to get this to work during battle. I have a script call Popup.add(['test']) in a troops battle event, and whenever the turn comes up where the popup should come the battle just freezes there.

Like if I try to add an popup at the very start of the battle it freezes before all the command menus appear etc.

Share this post


Link to post
Share on other sites

Anyone else getting forced line breaks in this script because the script call event command window is too small to hold the entire message on one line?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted