Unfortunately I don't think ATS can do the simple feature I want it to.
Basically all I need a is a System Message text box.
Something that displays a message until it's either called to be erased or after a given time. The message shouldn't impede the players button pressing though, unlike the normal Message box. It should simply show up like a System Message.
A fine example is from wortana's Get Item Window. Basically, it shows a message on the screen that tells you how many of what item you've obtained, but you can move around and after a short period of about 2 seconds the message is erased. Unfortunately it only supports item obtaining, when what I need is a simple message like "Press X!"
I don't need it specifically like this, but it should have some functionality to blend well with minigames and whatnot.
Sample:
What I had in mind was either adapting wortana's, or boosting this Simple Display Text. Thanks for the help.
This post has been edited by Titanhex: Aug 8 2011, 06:49 AM
Well, the ability to choose your text color between different script calls would be nice, though I think I may be able to handle this. I also wanted to have some sort of "Flash" where the color will change on the text rapidly.
Having more options to choose where it appears would be nice. In particular, I could definitely use a feature where it could show text over the head of the player or an object on the map.
Right now there's two practical uses I need for it. I'm using it for a minigame, where the text gives you instructions such as "Hit X!" and "Hold Left!" The flash idea makes it flashier for the player than a simple "Hit X!" in white, giving that sort of that old contra feel. However, any special effects that would help make the text more interesting for a mini-game would be nice.
The other use is to show a change in value of anything. For example, you talk to someone and your relationship goes up by 1. I want it to show that message over a characters head.
It'd be awesome if the text could fade away instead of disappear suddenly, but I only ask for that because it has an aesthetic charm to it. (You see it in the sims amongst other games.) It could just be an alternate dispose which fades the text before disposing it. It's in no way a necessity.
Beyond that, any extras uses would be up to the imagination of the scripter.
No matter what though any help and I'd be grateful. All I really need at this point is a Text Display system that can do more than or is a build up on Simple Display Text.
I also feel something like this could be of a lot of use to others, while remaining simple and easy to use.
It probably could be easier to use as a Window_Base child than a Scene_Base child.
Since it is going into my game, I thought that maybe seeing my game in action would assure whoever does this task that it'll be put to good use. Perhaps give an idea of what I'm going for. This fix-up will complete the first part of my chat system, so I can start creating some NPCs with it.
After selecting your character and mode you talk to the dog to see the chat system. At the end, a text pops up that tells you how much your relationship increased with the person.
Heading south out the house you'll reach two giant stone buildings. The one on the left has a man inside on the first floor. Talk to him to start the lumberjack minigame, where you chop trees down by hitting a random sequence of buttons. There's only two trees atm, both just a short ways south. They only appear when you're a certain distance away from them, so if you chop them down you'll need to walk away before they reappear. Right now, only the southernmost tree is choppable, since there's no point in duplicating the system until it needs little to no changing.
As far as my own attempt at editing the script, I haven't had much luck making something bug free. (Fade and flash don't work. Probably because there's no refresh or update method. But since it's attached to Scene_Base I don't know how to do it.)
This post has been edited by Titanhex: Aug 11 2011, 02:55 PM
#------------------------------------------------------------------------------ # * Munkis' Message pop-up V 1.0 # * Made by munkis # ╔══════════╗ # ║ FEATURES ║ # ╚══════════╝ # * Makes a pop-up message window appear without blocking player movement. # Script configuration is handled a little differently; I made all # changeable values into required arguments for the script call. This way # you can dynamically change the window, in case you want different looking # windows for different events. # * You can call this script with: # # ╔═════════════════════════════════════════════════════════════════════════╗ # ║ $scene.show_message("text", window_x, window_y, window_width, ║ # ║ window_height, icon, manual_disable_switch, display_time, "font", size, ║ # ║ bold, italic, shadow, align, color, "sound", opacity) ║ # ╚═════════════════════════════════════════════════════════════════════════╝ # # "text": The text to be displayed. # window_x: The X-coordinate of the window. # window_y: The Y-coordinate of the window. # window_width: The wdth of the window. # window_height: The height of the window. # icon: The ID of the icon to be displayed. # manual_disable_switch: In-game switch used to manually disable the # message. Does not disable the button press. # display_time: How long (in frames) to keep the window visible. # "font": The name of the font to use for the message. # size: The size of the text in the message. # bold: Wether or not to make the text bold. TRUE/FALSE # italic: Wether or not to make the text italic. TRUE/FALSE # shadow: Wether or not to let the text have shadows. TRUE/FALSE # align: Alignment of text. 0 = LEFT 1 = CENTER 2 = RIGHT # color: Window text color to be used. Color.new(Red,Green,Blue,Alpha). 0-255 # "sound": The name of the SE to be played when the window pops up. Use nil # for no SE. # opacity: The opacity of the window displayed. 0-255 # # All you really need to use though is $scene.show_message("text"), the rest # of the settings have default values. You also have the ability to hide the # window with Input::X or an in-game switch # # * V 1.0: Initial release #------------------------------------------------------------------------------
class Pop_Up_Main < Window_Base def initialize super(0,((Graphics.height/2)-32),Graphics.width,64) self.visible = false end def show_message(text, window_x = 0, window_y=((Graphics.height/2)-32), window_width = Graphics.width, window_height = 64, icon=0, manual_disable_switch=0, display_time=240, font=Font.default_name, size=Font.default_size, bold=Font.default_bold, italic=Font.default_italic, shadow=Font.default_shadow, align=0, color=Font.default_color, sound=nil, opacity=255) @text = text @display_time = display_time @icon = icon @font = font @size = size @bold = bold @italic = italic @shadow = shadow @align = align @color = color if window_width > Graphics.width - window_x @window_width = Graphics.width - window_x else @window_width = window_width end @manual_disable_switch = manual_disable_switch Audio.se_play("audio/se/"+sound,100,100) unless sound.nil? self.opacity = opacity refresh self.visible = true self.x = window_x self.y = window_y if window_width > Graphics.width - window_x self.width = Graphics.width - window_x else self.width = window_width end if window_height > Graphics.height - window_y self.height = Graphics.height - window_y else self.height = window_height end end def refresh self.contents.clear self.contents.font.name = @font self.contents.font.size = @size self.contents.font.bold = @bold self.contents.font.italic = @italic self.contents.font.shadow = @shadow self.contents.font.color = @color x = 0 if @icon != 0 draw_icon (@icon, x, 0) x += @window_width-55 draw_icon (@icon, x, 0) x = 24 end if @window_width > Graphics.width @window_width = Graphics.width end if @align == 2 if @icon != 0 self.contents.draw_text(x-80, 0, @window_width, WLH, @text, @align) else self.contents.draw_text(x-32, 0, @window_width, WLH, @text, @align) end else self.contents.draw_text(x, 0, @window_width, WLH, @text, @align) end return end def update return unless self.visible @display_time -= 1 if Input.trigger?(Input::X) or $game_switches[@manual_disable_switch] == true @display_time = 0 $game_switches[@manual_disable_switch] = false end self.visible = (@display_time > 0) end end class Scene_Map < Scene_Base alias munkis_message_start start alias munkis_message_update update alias munkis_message_terminate terminate def start munkis_message_start @popupmain = Pop_Up_Main.new end def show_message(*args) @popupmain.show_message(*args) end def update munkis_message_update @popupmain.update end def terminate munkis_message_terminate @popupmain.dispose return end end
This post has been edited by munkis: Aug 17 2011, 07:40 AM
Script 'Message Pop-Up' Line 81: NoMethodError occured.
undefined method 'show_message' for #<Pop_Up_Main:0x3af3900>
Also, I want to remove it at a specific point (Button Press) as well as on a timer. So, I would call .terminate to remove it manually, correct?
This doesn't seem to have as many placement options as the Show Text, but that's fine as I can add them in. What I can't do though is figure out how to make the text appear over Events. From what I see of Wortana's TextBox script, this requires the Game_Characters though and seems difficult to do.
Also, just showing text doesn't seem flashy enough for a minigame. But I suppose I can just do events with show animation or balloons to jazz it up since there doesn't seem to be anything I can do with the text, like changing the color when the text is out or making it fade out.
I guess if I can figure out why it erred and it's better than the System Message I can use it. It doesn't seem to have that many more features that I can use, but maybe I'm wrong.
Thank you, munkis, for showing this script though. Perhaps I can learn something from it.
EDIT: Ah, I see this uses Window_Base, so that's good. If nothing else I can probably tweak this better than I could Simple Display Text.
This post has been edited by Titanhex: Aug 11 2011, 05:31 PM
Yeah, I don't really see why you should get that error, you didn't do anything wrong that I can see. The only thing I can think of is to use the last two arguments, but I don't know why that would do anything...?
No, but I know how to make it disappear by button press; I'll add that in.
I couldn't work out how to get it to appear over events either. so don't feel bad
Not a whole lot more you can do with the text that I know of, unless you want scrolling text.
Well from what I can tell you'd have to call the Window from the Game_Interpreter instead of the Scene_Base. From there you have to manipulate the Sprite_Character and Game_Character by passing data through them and adding to their scripts. It's definitely not easy. So no worries, I think I can do without it.
The only problem now is why that error pops up. Even after filling in the last two parameters it erred.
Isn't there a way to compress the window so it only takes up as much width and length as the text requires, instead of stretching the entire 544 length?
I ask this only because the way it is covering the length seems inefficient, and it seems like an easy fix. Also is there really no way to change the color of the text or the opacity of the text after the window and it's contents have been initialized?
Also the feature to terminate the window manually with X doesn't seem to work. However, what I was going for was to terminate the window manually on a script call more, so I could integrate it into events. So if you hit up when it says "Press Up!" I can call it to be disposed.
Also, is there an easy way for me to choose the X/Y of where I want it, either by creating a new X Y in the system and choosing it ( i.e.Option 4 = X 300 Y 200) or just inputting the X and Y manually. Sometimes having it in the middle of the screen is good, but there's times when I'd need it to be just slightly above the middle so it doesn't cover the character, but rather appears above him.
This post has been edited by Titanhex: Aug 12 2011, 06:40 PM
Thanks! I just looked at the code and it looks awesome, I'm excited to be using it!
I definitely appreciate the work you've done here. :3 By the way is there a way to skip inputting a parameter before the parameter you want? Like say I only want to put in the alignment and let everything else default, do I have to fil in all the parameters before align or how do I skip them?
EDIT: Updated the code again. You can now change the Y co-ordinate of the window, as well as pick the icon you want displayed (if any).
EDIT 2: Added X co-ordinate, width, and height manipulation. Currently there's a little white arrow displayed at the far end of the window if the window is narrower than Graphics.width, and I don't know how to get rid of it.
This post has been edited by munkis: Aug 14 2011, 06:25 PM
Awesome, I appreciate the edits, they've really helped me use the system. The only problem now is that Width issue. The arrow is a bit visually odd, and it seems the only way to avoid it is have the window stretch across the screen.
Fortunately I can use the code still while waiting for a reply.
I wanted to ask, isn't there a way to avoid filling out a bunch of the parameters to get to the one you wanted. I had an idea, but I couldn't get it to work. I'm novice scripter though so maybe you can. Honestly it's not a big issue, but if you want to release this it could be really helpful.
What I tried to do was create a variable used by your system. Say, windowx.
Now, you could change windowx with like $PopUpMenu.windowx = 5. It has an initial value of 0.
And in the parameters it'd be window_x = self.windowx or something.
So if windowx is really far in the parameters, you'd just change $PopUpMenu.windowx = 200 or something after reaching the end of the parameters you wanted to fill out. It'd look something like this.
I'm not sure how to do it with your system. I think I've seen it done before in a text system, but I don't know how they did it.
Obviously the coding would be a lot different than that. But I'm not sure how deep learning how to do that goes, so I'm not sure if you knew how to do it. Figured I'd suggest it though to help you cut back on a huge parameter list.
This post has been edited by Titanhex: Aug 15 2011, 10:37 PM