Nelderson 55 Posted March 17, 2012 (edited) N.A.S.T.Y. Text Pop Over EventsBy: Nelderson IntroductionThis script makes text appear over event's, player's or follower's sprites on a map. I included a timer function, so that you can really go nuts with making complex scenes and coolness with this.Features- Text over event's, player's, or follower's heads- Change the font, size, bold, italic, and time as it appears each time you call it!Screenshots How to UseI'll update this later with more specifics, for now the instructions on the script itself has everything you need!DemoI'll make one if you guys want one!Script #=============================================================================== # N.A.S.T.Y. Text Pop Over Events # Nelderson's Awesome Scripts To You # # By: Nelderson # Last Updated: 3/18/20112 # # Version 1.0 - 3/17/2012 # #=============================================================================== # # Update History: # - Version 1.0 - Initial release, 1st Resource Script for rpgmakervxace.net #=============================================================================== # *Features: # - This script creates text above an event or the player on a map # # *Initial Setup # - This script has a small setup section to define a few Defaults when # text is first put up above an event's head: # # DEF_TEXT_COLOR - Is the default text color when not defined in the # script call. When you pick a color you have to use # the form: # # Color.new(r,g,b,a) - Where r = red, g = green, # b = blue, and a = alpha # # DEF_TEXT_SIZE - This is the default text font size, pretty easy here. # # DEF_TEXT_FONT - This is the name of the default font that'll be used # for text pops that don't specify one in the script call # # *Script Call: # # - nel_textpop(:attribute => value, # :attribute2 => value, # :attribute3: => value, # ) # # ** Where :attributes can be any one of the following: # # :text => Values will be in "quotes", and displays over event # (Defaults to "" when not defined) # # :event_id => The Event ID that will display text. # 0 = Current Event ID, -1 = Player, # -2 1stFollower, -3 2ndFollower, -4 3rdFollower # (Defaults to 0 when not defined) # # :time => This is the time that the text will last in FRAMES. # 60 FRAMES = 1 second, # *Note: Set :time => nil for the text to last forever* # (Defaults to nil when not defined) # # :font => This is the name of the font you want for the text. # Values with be in "quotes" # (Defaults to DEF_TEXT_FONT when not defined) # # :size => This changes the font size on the text displayed # (Defaults to DEF_TEXT_SIZE when not defined) # # :color => This changes the color of the text displayed # Values need to be => Color.new(r,g,b,a) # (Defaults to DEF_TEXT_COLOR when not defined) # # :bold => This makes the displayed text bold # Values need to be => true or false # (Defaults to false when not defined) # # :italic => This makes the displayed text italic # Values need to be => true or false # (Defaults to false when not defined) # # *Instructions # -You can place the script call nel_textpop in any event # # -You don't have to define every attribute, they will automatically # go to the defaults to make things easier. # # *Sample Call # # nel_textpop( # :text => "I hate you!", # :event_id => -1, # :bold => true, # :italic => true, # :time => 120, # :font => "Vrinda", # :size => 64, # :color => Color.new(220,20,60), # ) # #=============================================================================== # Credits: # -Nelderson, tomoaky, and IceDragon #=============================================================================== # Based off: RGSS2_namepop Ver0.02 # tomoaky (http://hikimoki.sakura.ne.jp/) #=============================================================================== module NEL #Default text pop font DEF_TEXT_FONT = "Myriad" #Default text pop font size DEF_TEXT_SIZE = 16 #Default text pop color DEF_TEXT_COLOR = Color.new(255,255,255,255)# <== White end #<=== Don't Touch #========#======================#====#================================#========# #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------# #--------# End of Customization #----# Editing will cause death by #--------# #--------# #----# Zetu Stabbing your heart </3 #--------# #========#======================#====#================================#========# # // 02/03/2012 [ #Collects the hash keys in order, and then passes the values class Hash # // IceDragon <=== *The Ultimate in Awesome OTL def get_values(*args) args.collect {|a|self[a]} end end # // 02/03/2012 ] class Game_Interpreter include NEL #IceDragon helped make this script call easier with awesomeness...Thanks Icy! def nel_textpop(*args) if(args[0].is_a?(Hash)) text, ev_id, time, size, color, font, bold, ital = args[0].get_values(:text,:event_id,:time,:size,:color,:font,:bold,:italic) else text, ev_id, time, size, color, font, bold, ital = *args end char = nel_get_character(ev_id || 0) return unless(char) char.namepop_size = size || DEF_TEXT_SIZE char.namepop_color= color || DEF_TEXT_COLOR char.namepop_time = time || nil char.namepop = text || "" char.namepop_font = font || DEF_TEXT_FONT char.namepop_bold = !!bold # // Convert to Bool char.namepop_ital = !!ital char.textpop_flag = true #Forces refresh end #-------------------------------------------------------------------------- # *New Method: nel_get_character # # Instead of original get_character, this include Followers in the argument #-------------------------------------------------------------------------- def nel_get_character(param) if $game_party.in_battle nil elsif param < 0 case param when -1; return $game_player else; return $game_player.followers[(param + 2) * (-1)] end else events = same_map? ? $game_map.events : {} events[param > 0 ? param : @event_id] end end #-------------------------------------------------------------------------- end #============================================================================== # ¡ Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # Å“ œöŠJÆ’Cƒ“ƒXÆ’^ƒ“ƒX•Æ#-------------------------------------------------------------------------- attr_accessor :namepop attr_accessor :namepop_size attr_accessor :namepop_color attr_accessor :namepop_time attr_accessor :namepop_font attr_accessor :namepop_bold attr_accessor :namepop_ital attr_accessor :textpop_flag #Instant update if script call is used #-------------------------------------------------------------------------- alias nel_font_type_init initialize def initialize @namepop_font = NEL::DEF_TEXT_FONT @namepop_bold = false @namepop_ital = false @textpop_flag = false nel_font_type_init end end #============================================================================== # ¡ Sprite_Character #============================================================================== class Sprite_Character < Sprite_Base alias nel_textx_pop_initi initialize def initialize(*args) @timer = 0 nel_textx_pop_initi(*args) end #-------------------------------------------------------------------------- # Å“ ‰ð•ú #-------------------------------------------------------------------------- alias tnpop_sprite_character_dispose dispose def dispose dispose_namepop tnpop_sprite_character_dispose end #-------------------------------------------------------------------------- # Å“ Æ’tÆ’Å“[ƒ€XV #-------------------------------------------------------------------------- alias tnpop_sprite_character_update update def update tnpop_sprite_character_update #Original Update if @timer > 0 && @character.textpop_flag == false#Skip when script called @timer -= 1 update_text_pos if @timer <= 0 @namepop_sprite.visible = false @namepop_sprite.opacity = 255 #Reset opacity just in case @namepop_sprite = nil @character.namepop = nil @namepop = nil @tmer_rat = nil #Reset ratio, just to avoid issues elsif @timer < 60 #Fade out text gradually within the last 60 frames @tmer_rat ||= 255/@timer @namepop_sprite.opacity -= @tmer_rat end else update_namepop if @character.textpop_flag == true #If script call @namepop = @character.namepop start_namepop end end end def update_text_pos @namepop_sprite.x = x @namepop_sprite.y = y - height @namepop_sprite.z = z + 200 end #-------------------------------------------------------------------------- # › namepop‚ÌŠJŽn #-------------------------------------------------------------------------- def start_namepop dispose_namepop return if @namepop == "none" or @namepop == nil @namepop_sprite = ::Sprite.new(viewport) b_width = @namepop.size * 8 b_height = @character.namepop_size + 20 @namepop_sprite.ox = 80 + (b_width/2) @namepop_sprite.oy = 16 + (b_height/2) #16 @namepop_sprite.bitmap = Bitmap.new(b_width+160, b_height) ###Change Font, Font Size, Color, and Time based off Character values## @namepop_sprite.bitmap.font.color = @character.namepop_color @namepop_sprite.bitmap.font.size = @character.namepop_size @namepop_sprite.bitmap.font.name = [@character.namepop_font] @namepop_sprite.bitmap.font.bold = @character.namepop_bold @namepop_sprite.bitmap.font.italic = @character.namepop_ital @namepop_sprite.bitmap.draw_text(0, 0, b_width+160, b_height, @namepop, 1) @namepop_time = @character.namepop_time update_namepop(@namepop_time) #Pass a timer variable @character.textpop_flag = false end #-------------------------------------------------------------------------- # › namepop‚ÌXV #-------------------------------------------------------------------------- def update_namepop(time = nil) #Add a timer variable if @namepop_sprite != nil @namepop_sprite.x = x @namepop_sprite.y = y - height @namepop_sprite.z = z + 200 if time != nil @timer = time @namepop_time = 0 end end end #-------------------------------------------------------------------------- # › namepop‚̉ð•ú #-------------------------------------------------------------------------- def dispose_namepop if @namepop_sprite != nil @namepop_sprite.bitmap.dispose @namepop_sprite.dispose @namepop_sprite = nil end end end FAQQ: What does N.A.S.T.Y. stand for?A: Nelderson's Awesome Scripts To You!Credit and Thanks- Nelderson- Tomoaky: He originally made something similar for VX, that I took and pimped out with RGSS3!- IceDragon: The Ultimate in Awesome OTL Edited May 23, 2013 by Nelderson 2 Share this post Link to post Share on other sites
Asixex 1 Posted March 18, 2012 Look awesome, but it's not something I'd be using. Might be useful for MMORPGs made in Ace. Also, why's it called N.A.S.T.Y? Share this post Link to post Share on other sites
ShinGamix 101 Posted March 18, 2012 here is the logo he used to use for his shops that explains your question Asixex (I made it for him back in the day.) Share this post Link to post Share on other sites
Nelderson 55 Posted March 18, 2012 Thanks for the explanation Shin! @Shin - The reason I don't use it, is because it say Script Shop, and I honestly don't have the ridiculous amounts of time needed to be running a shop. If you can possibly remove the Script Shop part, I'll be more than glad to use your logo once again! And since this is the second time I've been asked what N.A.S.T.Y. stands for, I decided to throw it in the Q:/A: section @Asixex - This script could be used in other various ways. Let's say instead of making a message box for opening chests, you do a text pop instead. It wouldn't require any additional input to move on with the game, and your player can keep moving on the map, while the text disappears on its own. Another idea would be making multiple events communicate to each other with just text pops over their heads, to give a crowded street, or "Bazaar" effect. This way, the player can feel involved without having to go up to each individual event, and talk with it. It can also be used from major events. Let's say you have an event that represents a boss up ahead, and you want the boss to taunt the player. It can say stuff like "You're Mine" and "Come meet your Death", without you actually having to interact with the event. So while I understand that this can seem like a mmorpg thing...it can really be used for so much more with the right mindset! Share this post Link to post Share on other sites
Rosenblack 79 Posted March 18, 2012 I know that it says how but i cannot make the text last forever. this is my script call nel_textpop( :text => "Wonderland", :event_id => 0, :size => 40, :time => nil, :color => Color.new(0,0,0), ) am i not reading your script right? Share this post Link to post Share on other sites
Nelderson 55 Posted March 18, 2012 Oh....crapity crap crap....you're right! I'm on it! EDIT: Script has been updated. I changed the default time to nil, because it had to do with an oversight on my part. So now when :time is not defined it'll default to nil instead of 60 frames. I tested it out really quick as well just to make sure and we should be good. I'm going to catch some shut eye, but I'll be on in a little while to make sure everything works good now Rosenblack. 1 Share this post Link to post Share on other sites
Rosenblack 79 Posted March 18, 2012 Thank you Nelderson, I like this script, it has a lot options 1 Share this post Link to post Share on other sites
Sly 10 Posted March 22, 2012 Nelderson would you be willing modifiy the script to display text within a textbox? Share this post Link to post Share on other sites
Nelderson 55 Posted March 22, 2012 Nope! Someone else will be bound to do that. I would have to change the entire script, and it's not going to happen right now. 1 Share this post Link to post Share on other sites
Nicke 151 Posted March 22, 2012 Looks neat, I was actually just gonna do a script like this but now I don't have too I guess 1 Share this post Link to post Share on other sites
Elith 0 Posted March 23, 2012 (edited) Great script, I will credit!! I'm going to try to edit this so when you move 1 step the text vanishes after stepping on the tile. Its great for a overworld map Thanks!! Edited March 23, 2012 by brandonMichealWells Share this post Link to post Share on other sites
Nelderson 55 Posted May 23, 2013 I forgot I made this script.....maybe I'll fix the broken screenshots and make a demo :3 Share this post Link to post Share on other sites
D. B 2 Posted May 29, 2013 (edited) Hi there Nelderson! I'm actually using this script and seeing you mention it in the script request area jarred my memory that I meant to ask some things about it- Is it possible to alter the... shoot I'm not sure what it is... it's not x or y, but the layering? I have a fog script and a lighting script that end up layering over the text, making it very hard to read the text bubbles at 'night'. I'm not asking you to rewrite your script or anything, but is there a value I can alter to change it's layer order so I can put it above my other visual scripts? And second... I'm actually using this script because I do want to use it for dialogue when your character isn't 'talking' to npcs, like background chatter. It helps things seem more 'alive' without the players direct involvement. But I can't seem to use the full amount of characters available, because they all display on one line. Is there a way to format the text or at least dictate where there should be a break? Edited May 29, 2013 by D. B Share this post Link to post Share on other sites
Nelderson 55 Posted May 30, 2013 (edited) Hi D.B., glad to hear you are using my script. As for your questions: 1. You are thinking of "z" value. I'll probably add it in the next update sometime this week or next. 2. This one is a little more intense, and something I honestly might not do. The original purpose was to make short things easy to pop up, but whole conversations made more sense to me with the default text system. HOWEVER: I have been thinking about doing multiple lines, so let's see if I can actually do it without throwing my laptop against the wall Edited May 30, 2013 by Nelderson Share this post Link to post Share on other sites
D. B 2 Posted May 30, 2013 That'd be great! Thank you for looking into this, I really appreciate it! Share this post Link to post Share on other sites
Stradar 0 Posted July 20, 2013 (edited) How am I suppose to put this script call in???? It keeps crashing can you give an example....Ok I managed to get it to work but how do I make the text popup without having to talk or walk over the event?? Edited July 20, 2013 by Stradar Share this post Link to post Share on other sites
omegarion 0 Posted August 31, 2016 I really hate to necro, but I couldn't help noticing no ToU. So can this be used for commercial? Share this post Link to post Share on other sites
leequangson 4 Posted July 1, 2017 Can you make the texts pop up like crazy? I mean like text over text over text over text... Share this post Link to post Share on other sites