Show Event Name
Authors: LiTTleDRAgo
Version: 5.00
Type: Graphical Add-on
Key Term: Environment Add-on
IntroductionShow event name in map
Features
- Screenshot should sums it up
Screenshots(http://3.bp.blogspot.com/-KFfiVZ3DoI8/Uf24l_2ox6I/AAAAAAAAASQ/6ppTA7ck43g/s320/78430015.jpg)
ScriptClick (http://littledrago.blogspot.com/2013/08/rgss23-show-event-name-v5.html)
InstructionsIn the script
CompatibilityCompatible with VX / VXA
Credits and Thanks
Author's NotesEnjoy~
You should alias methods instead of rewriting them.
Recommendation would to have a specific command you use in the events name to show the text. Example: \sn[Name of Event] (sn Show Name) just a suggestion. That would remove a lot of the configuration thats required in your script. And that way it would work with Blizz-Abs enemies.
*looks at Aqua being a mod*
*looks at G_G being a mod*
*looks at topic still not being in the database*
Also, I agree with Aqua and G_G.
I didn't want to move it without it having aliases.
Quote from: Aqua on December 22, 2010, 10:06:11 pm
I didn't want to move it without it having aliases.
sorry I forgot to aliasing them XD
This script makes me horny. Good job!
The script looks nice so far, but I think it really needs G_G's idea. But still, level up :D!
cya :urgh:!
Quote from: SBR* on December 26, 2010, 04:45:41 am
The script looks nice so far, but I think it really needs G_G's idea. But still, level up :D!
cya :urgh:!
sure, update to new version
look at the instruction
If you want ideas for your script, I'll tell you what I did in mine (screenshots are here (http://"http://forum.chaos-project.com/index.php/topic,52.msg127059.html#msg127059")):
- Plugin for Blizz-ABS: Add \(your tag) to the event name to set the shown name to the battler's name. See Screenshots.
- Various colors: Color of the name sprite depens on the alignment group of the battler (red - enemies, yellow - neutral, blue - allies).
- And make sure the name sprites aren't drawn outside Scene_Map as in RMX-OS.
PM me if you want to see my script. I would post it here but I just added it as an part of RMX-OS script, since I'm lazy as hell and I'm a terrible scripter.
forgot to update this script,
*updated to 3.02*
changes :
various colors based on alignment
coding improvement
could u put a very tiny demo. i'm a little stuck as the event name wont show up! :(
i tried giving the event a name and put comment:Show Name on the first line but it doesn't work.BTW, not using BABS atm
update the script (fixes incompatibility issues and minor error)
uhhh, r u listening?
Dude chill out. If he doesn't want to make a demo, he doesn't have to. If you can't figure it out then don't deal with it. Don't get mad when someone ignores you or doesn't wanna help you.
Quote from: EZ Destroyer on March 16, 2011, 08:44:58 am
uhhh, r u listening?
i think there is no need for a demo
just use comment in the first line and type
QuoteShow Name
that's all
i did but it's still not working!
Sorry, but I just have to ask: Do you even have the script in? There seems to be no reason it would work for everyone else except for you. Not to mention that you didn't give many details for us to help you.
duh! of course i have the script.
Did you put "Comment: Show Name" or "Show Name" in the comment box?
i put 'Show Name' in the comment box.(the seventh option in the event command)
Are you sure you defined the font name correctly?
well, the default is 'Calibri' so i didn't change it. i tried 'Comic Sans MS' and it suddenly works! THANKS!
...
here demo link
http://www.mediafire.com/?lssbdx1fk2phrc3
edit :
Quote from: EZ Destroyer on March 16, 2011, 08:40:56 pm
well, the default is 'Calibri' so i didn't change it. i tried 'Comic Sans MS' and it suddenly works! THANKS!
oh, already solved?
yeah but thx 4 the link too.
i think my com don't have calibri installed. same thing happened 2 your demo(no words until i change font). damn! i gotta install that font. well, my com's really old. maybe, that's why.
Just wanted to mention that when I tried this with 8 named events on a default map, I had major lag issues. is there a way to resolve this?
Simply edit Sprite_Character and you probably could make your script a lot less complicated.
Quote from: Xuroth on March 19, 2011, 05:42:37 pm
Just wanted to mention that when I tried this with 8 named events on a default map, I had major lag issues. is there a way to resolve this?
fixed
Quote from: game_guy on March 19, 2011, 08:18:10 pm
Simply edit Sprite_Character and you probably could make your script a lot less complicated.
if just that, the event name will be drawn even in outside scene map
Great script. unfortunately, when i use a Transfer player command, all the event names are still there. possible bug?
EDIT: Here's some more info after some more in-depth testing. I started the player on a new map with no named events. using a Transfer player command to a test map with about 30 named events, the names all appear. when going back to the original map, the names persist, until the screen was refreshed a few times by opening and closing the menu a few times. so the disposal might need improvement.
Ill keep testing this and trying to find a solution. Great script by the way!
EDIT2: So I thought it might be a compatibility issue with other people's scripts. However, I pasted it into a new project, set up the event and named it and I get a NoMethodError undefined method for 'name' (line 62) which is:
which is wierd cuz it works (with bugs) in my game, and this error came up in the new project with me edit of your script and the original (copied from the first post)... This is confusing...
script updated
not sure for the cheap fix, I'll look at it when I have the time
well the fix DID dispose names when transferring player. it just takes a moment after the movement for the names to update/clear. also, going into and exiting a scene (like the menu) causes the names to lag (and FPS to drop to 1) i would assume while the system updates the information to be displayed.
Now I do understand that a problem would be having ~30 or so named events on one map (in view) because graphics (sprites and bitmaps) are lag inducing in general. But I'm sure there has to be a way to update the graphics well
Suggestion: Maybe make it possible so the names only appear when you are within a (configurable) distance. ex: player is within 2 squares radius of event, the name(s) (assuming a couple of events) are drawn. and add an option to allow certain event names to show no matter what.
Please note, I am not trying to be offensive here, I am just trying to comment on certain things I see the system has problems with, and ways you might be able to improve it. This is a great script on its own, but I think you could extend it and make it more powerful. Just trying to help out.
I trying to make numerous moving events at the map and it seems not lag at all
(http://img220.imageshack.us/img220/1663/49811869.th.jpg) (http://img220.imageshack.us/i/49811869.jpg/)
---edit
Quotewell the fix DID dispose names when transferring player. it just takes a moment after the movement for the names to update/clear. also, going into and exiting a scene (like the menu) causes the names to lag (and FPS to drop to 1) i would assume while the system updates the information to be displayed.
yeah, I just didn't have enough time to properly fix the script, I have exam next week, not mentioning tons of PR (homework) at school
Include the name sprites in Spriteset_Map instead of Scene_Map. Then won't have to think about when you dispose it and when not.
I still think the proximity idea is viable. even if disposal is done correctly, it could cut down on lag dramatically by only showing the sprites (names) within range. so instead of 30+ sprites, it could just be 3-4 or less (unless the user piles all the events around the player to box him/her in...)
but back to the topic: it only seems to lag when updating after a scene change or the player transferring between maps. once it has a moment to "catch up" it works fine at about 39-40 FPS. Your screen shot there LiTTleDRAgo, shows an FPS of 18, indicating the system was either loading/drawing names, or just a little bogged down from so many events.
The best way to do it then would be to include the name sprite inside the Sprite_Character class. Since Blizz-ABSEAL destroys all sprites out of range, it would take care of that as well if you have it installed along with this script.
script updated
Great! It works fine now! I just had one last nitpick. When going into the menu (or any other scene) the names still stay on screen.
I've tried adding a check to see if Scene_Map is active, but no matter what method I add it to, the system comes up with really weird errors
if $scene != Scene_Map
return
else
<your original code/method>
end
they usually give errors with Tons (in addons that aren't even turned on) or it will throw up a NoMethodError for something random like a . or a /
You're using the Sprite class all wrong. First, inherit the class Sprite. Second, don't create a sprite within the sprite class, thats just a bit redundant. Instead just use this line of code in the initialize method.
self.bitmap = Bitmap.new(width, height)
Replace @name_event with self through the entire class. I also still think that the SpriteName should be created through Sprite_Character.
Quote from: Xuroth on March 24, 2011, 04:14:26 pm
Great! It works fine now! I just had one last nitpick. When going into the menu (or any other scene) the names still stay on screen.
can you put the screenshot?
because I didn't encounter that error (I calling scene_menu and the names did'nt appear)
Quote from: game_guy on March 24, 2011, 04:46:34 pm
You're using the Sprite class all wrong. First, inherit the class Sprite. Second, don't create a sprite within the sprite class, thats just a bit redundant. Instead just use this line of code in the initialize method.
self.bitmap = Bitmap.new(width, height)
Replace @name_event with self through the entire class. I also still think that the SpriteName should be created through Sprite_Character.
I'll look at it later
I figured out why the events in my game stay present. As they are drawn with Scene_Map, they persist because I have the map shown as background withe Zer0's CMS, Leon_Westbrooke's Advanced shop menu, and because I use Zer0's Scene converter (which shows map as background in any scene with blank space or transparency)
Is there a way to make the names dispose when the Scene changes so they disappear when you access the menu, even if it shows the map as background?
Or even just edit the z position of the names so windows appear over top of them?EDIT: I replaced
self.z = @character.screen_z(@ch)
with
now the windows all appear over top of the names. While the names are still technically present, this solution is slightly favorable over having to re-draw the names each time a scene chane occurs (which was what I was initially looking for). this produces less lag (though the lag in the system is not very noticable anyways)...
update 3.09
-cross engined
-added tag
\fontsize[ Size ]
\bold
\italic
\fontname[ Fontname ]
\color[ R, G, B, ALPHA ]
I get this error when I'm starting the game
Quotescript''line 246: NoMethodError occured.
undefined method `rpgvx?`for nil:NilClass
http://pastebin.com/Ket2fwXQ
fixed
Thanx^^ It's working now.
This is a great script :)
How can you edit the script to make it so that the name will appear above the event?
i tried editing the below lines and it didnt help at all:
#--------------------------------------------------------------------------
# * Draw Name
#--------------------------------------------------------------------------
def draw_name
if defined? Bitmap.draw_hemming_text
@name_event.bitmap.draw_hemming_text(0, 0, 100, 20, @char ,4)
else
@name_event.bitmap.draw_text(0, 0, 100, 20, @char ,4)
end
end
look at this part (bold)
Quote
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
super
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
(!rpgvx? && @character_hue != @character.character_hue)
@tile_id, @character_name = @character.tile_id, @character.character_name
@character_hue = @character.character_hue if !rpgvx?
refresh_name
end
return @name_event.visible = false if !DIS_EV_SWITCH.nil? and
(@character.opacity < 50 or $game_switches[DIS_EV_SWITCH])
visibility if !PRESS_BTN.nil?
if @name_event.visible
refresh_name if @cw.nil?
@name_event.x = @character.screen_x - (@cw.nil? ? 0 : @cw/2)
@name_event.y = @character.screen_y - @ch
@name_event.z = 1
@name_event.opacity = @character.opacity
@name_event.blend_type = @character.blend_type
@name_event.bush_depth = @character.bush_depth
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh_name
return if @name_event.nil? or @name_event.bitmap.nil? or
!@name_event.visible or @name_event.disposed? or @character.name_effect.nil?
@name_event.bitmap.clear
@character.name_effect.each {|@char| coloring
event_name_check }
draw_name if($BlizzABS && @character.is_a?(Map_Battler) && PLAYER_NAME) or
(@character.is_a?(Game_Event) && @character.nametag) or
(@character.is_a?(Game_Player) && PLAYER_NAME) or
($xas_caterpillar && @character.is_a?(Game_Party) && PLAYER_NAME)
@x_frame, @y_frame = 4, 4
bit = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bit.width / @x_frame / 2
@ch = bit.height / @y_frame + 10
end
Thank you littledrago... i love your script :naughty:
If you set a switch to toggle the event names off (by turning switch on) the names clear.
But, if you allow the names to display (via turning the switch off) the names do not reappear until the scene changes or is manually updated. Just thought I'd let you know. I'm not trying to tear apart your work, I just love this script, so I play around with it. The only changes made so far are to display names above events again...
Though I may try to merge this and ForeverZer0's event proximity icons script so that names only appear when within a couple tiles. I think this would be cool addition to this script.
maybe one of you guys (you or F0) should give that a whirl... just an idea
Quote from: Xuroth on September 15, 2011, 10:07:36 am
If you set a switch to toggle the event names off (by turning switch on) the names clear.
But, if you allow the names to display (via turning the switch off) the names do not reappear until the scene changes or is manually updated. Just thought I'd let you know. I'm not trying to tear apart your work, I just love this script, so I play around with it. The only changes made so far are to display names above events again...
did u use blizz abs? I don't know what's wrong but when I use this without blizz abs it works fine
Quote from: Xuroth on September 15, 2011, 10:07:36 amThough I may try to merge this and ForeverZer0's event proximity icons script so that names only appear when within a couple tiles. I think this would be cool addition to this script.
maybe one of you guys (you or F0) should give that a whirl... just an idea
*updated*
How to disable show name for enemies? (I'm using Blizz-Abs)
Quote from: adytza001 on October 02, 2011, 03:17:29 am
How to disable show name for enemies? (I'm using Blizz-Abs)
just dont use
Comment : Show Name
in their event page
I wasn't using the comment.....But now I change the opacity for enemies names to 0. It's solved! :)
Quote from: adytza001 on October 02, 2011, 02:36:51 pm
I wasn't using the comment.....
that means it's a bug, sorry, now it's fixed
No, I am not using Blizz-ABS. I used a game switch and turned it off via event. the names disappeared when the switch was off, but failed to return when the switch was on again unless you change scenes.
FIXED! With your distance mod it works perfectly. Names appear when they are supposed to. No z-layer issues... Great job!
another suggestion: perhaps add an option in the config to allow a small picture to be shown behind the names. Like a graphic that acts as a background for the names (i.e. a picture frame style graphic). This could allow more visually appealing design, improve readability over certain areas (though you could just use colors) of the tileset/map, and/or help extend the graphic "theme" of a user's game. I think this feature would help immerse players in the game and complete the experience... what do you think?
Quote from: JanraeMendoza on October 03, 2011, 02:57:45 pm
May I ask how this can work in XAS III? It doesn't have errors on the script but rather, shows the event name too far from the event
xas use different template for character's graphic
well, the solution is simple :
edit the character graphic to match it's size or replace these lines
@cw = bit.width / @x_frame / 2
@ch = bit.height / @y_frame + 15
to
@cw = @name_event.bitmap.width / @x_frame / 2
@ch = @name_event.bitmap.height / @y_frame - 5
Quote from: Xuroth on October 04, 2011, 07:12:24 pm
another suggestion: perhaps add an option in the config to allow a small picture to be shown behind the names. Like a graphic that acts as a background for the names (i.e. a picture frame style graphic). This could allow more visually appealing design, improve readability over certain areas (though you could just use colors) of the tileset/map, and/or help extend the graphic "theme" of a user's game. I think this feature would help immerse players in the game and complete the experience... what do you think?
I'll see what I can do after my exam period is finished
sounds great! I'm sure it could be done easily. In fact, I bet the comments and the config together will be longer than the actual code to make it function.
updated to ver 4.00
*change
* Method of setting event name
* Adds an image in the back event name
Sorry for the necro, but how to disable the show name in the latest version? I can't find anything about it nor figure it out. :/ I 'solved' it by changing the event name to an empty space with the command, however the name is shown again once I close the game and return to it. Need this in order to make npc names disappear who leave the map in a cutscene and are never supposed to be seen there again. The event switches to the next page (empty) but the name continues to show.
update the script, now the event name won't show if the event graphic is empty
Great, thank you! :)
sorry for the Necroposting
I tried adding it to a new project and it gives me the error
QuoteScript 'Event-Name' line 120: NoMethodError Occurred
undefined method 'width' for #<sprite:0x3175780>
Im trying to play around with it but I just can't figure out whats wrong, its on a new project there are no other scripts
fixed a typo in the script
ok so you know im using a CMS, here is what happens
(http://imageshack.us/scaled/landing/189/zfhm.png)
is there a way to make it so it is at the bottom of the bubble?
that the bubble overlaps and the name is under?
search this line
Quote@name_event.z = self.z + 1000
change that value as you need
EDIT: NVM I FIXED IT BY MESSING WITH THE CMS! thanks Drago :)
Just one more suggestion, to add opacity option
altough for me I just changed this line
"@name_event.opacity = self.opacity" to a number
This is a perfect script for my game. but the name doesn't show up. The actor's name is showing but the event name isn't. I put a comment: Show Name on the event but still, it doesn't show its name. I'm using rpgmxp btw. thanks :)
EDIT: Is it possible to change the event name in auto run? I'm using one event but will change its graphics after they talk.
Quote from: LeviAlvi on September 13, 2013, 08:53:28 am
This is a perfect script for my game. but the name doesn't show up. The actor's name is showing but the event name isn't. I put a comment: Show Name on the event but still, it doesn't show its name. I'm using rpgmxp btw. thanks :)
did you add the name like this? (Aluxes is an example)
<Show Name>
Name: Aluxes
Quote from: LeviAlvi on September 13, 2013, 08:53:28 am
EDIT: Is it possible to change the event name in auto run? I'm using one event but will change its graphics after they talk.
use switch / self switch / variable to change events page,
and in that new event page, add in comment at first line
<Show Name>
Name: Aluxes2nd
Silly me :^_^': thanks, it worked. is didn't use the "<>" thing
can i disable the actor's name first then enable it again later?
this line
@char = name_var if @character.is_a?(Game_Player)
change it into
if @character.is_a?(Game_Player)
@char = name_var
@char = "" if $game_switches[DISABLE_SWITCH]
end
change DISABLE_SWITCH into whatever switch ID (Integer)
How exactly do you activate this switch so that the character's overhead name is turned off?
if you're talking about this :
just enable the switch in event command and the name in player head will disappear
example: change $game_switches[DISABLE_SWITCH] into $game_switches[1]
now if you want to hide player name, just turn on switch 1
----
if you want to hide all of the event name completely, look at the configuration
SWITCH = 50 # Switch for Disable Show Event Name
turn on that switch and all of the event name will disappear
How and where would I turn my switch on/off?
(http://i.imgur.com/mZXPRfas.jpg) (http://i.imgur.com/mZXPRfa.jpg)
I just have to say: Awsome script!
keep up the great work!
Great script.
Is it possible to make the name/names disappear automatically whenever I'm talking to a character or having an event run? That is, without having to add a switch on/off whenever I make a new event.
in this part, add the bolded word
Quote
def update_name_visibility
disable_switch = false
disable_switch = @character.opacity < 50 if DIS_EV_SWITCH
disable_switch ||= $game_switches[DIS_EV_SWITCH] if DIS_EV_SWITCH
disable_switch ||= @character.transparent
disable_switch ||= $game_map.interpreter.running?
@name_event.visible = false if disable_switch
update_name_visibility_press if PRESS_BTN && !disable_switch
update_name_visibility_range if RANGE != nil && !@pressed
end
Didn't work. The name is still there :roll:
fixed
Quote
def update_name_visibility
disable_switch = false
disable_switch = @character.opacity < 50 if DIS_EV_SWITCH
disable_switch ||= $game_switches[DIS_EV_SWITCH] if DIS_EV_SWITCH
disable_switch ||= @character.transparent
disable_switch ||= $game_map.interpreter.running?
@name_event.visible = false if disable_switch
return if $game_map.interpreter.running?
update_name_visibility_press if PRESS_BTN && !disable_switch
update_name_visibility_range if RANGE != nil && !@pressed
end
That did the trick. Thank you :)