[XP][VX][VXA] Show Event Name

Started by LiTTleDRAgo, December 22, 2010, 10:00:05 am

Previous topic - Next topic

LiTTleDRAgo

December 22, 2010, 10:00:05 am Last Edit: August 03, 2013, 10:42:42 pm by LiTTleDRAgo
Show Event Name
Authors: LiTTleDRAgo
Version: 5.00
Type: Graphical Add-on
Key Term: Environment Add-on



Introduction

Show event name in map


Features


  • Screenshot should sums it up



Screenshots

Spoiler: ShowHide



Script

Click


Instructions

In the script



Compatibility

Compatible with VX / VXA


Credits and Thanks


  • LiTTleDRAgo



Author's Notes

Enjoy~

Aqua

You should alias methods instead of rewriting them.

G_G

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.

Blizzard

*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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Aqua

I didn't want to move it without it having aliases.

LiTTleDRAgo

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

Spaceman McConaughey

This script makes me horny. Good job!

SBR*

The script looks nice so far, but I think it really needs G_G's idea. But still, level up :D!

cya :urgh:!

LiTTleDRAgo

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

[Luke]

If you want ideas for your script, I'll tell you what I did in mine (screenshots are here):

  • 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.

LiTTleDRAgo

forgot to update this script,

*updated to 3.02*

changes :
various colors based on alignment
coding improvement

EZ Destroyer

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

LiTTleDRAgo

update the script (fixes incompatibility issues and minor error)

EZ Destroyer


G_G

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.

LiTTleDRAgo

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

EZ Destroyer

i did but it's still not working!

Wizered67

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.

EZ Destroyer

duh! of course i have the script.

Aqua

Did you put "Comment: Show Name" or "Show Name" in the comment box?

EZ Destroyer

i put 'Show Name' in the comment box.(the seventh option in the event command)

Aqua

Are you sure you defined the font name correctly?

EZ Destroyer

well, the default is 'Calibri' so i didn't change it. i tried 'Comic Sans MS' and it suddenly works! THANKS!

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

LiTTleDRAgo

March 16, 2011, 11:14:31 pm #24 Last Edit: March 16, 2011, 11:15:54 pm by LiTTleDRAgo
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?

EZ Destroyer

March 17, 2011, 07:26:53 am #25 Last Edit: March 17, 2011, 07:30:24 am by EZ Destroyer
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.

Xuroth

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?

G_G

Simply edit Sprite_Character and you probably could make your script a lot less complicated.

LiTTleDRAgo

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

Xuroth

March 22, 2011, 11:32:26 am #29 Last Edit: March 22, 2011, 05:21:45 pm by Xuroth
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:
      next if event.name == ""

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...

LiTTleDRAgo

March 22, 2011, 09:37:54 pm #30 Last Edit: March 22, 2011, 09:39:47 pm by LiTTleDRAgo
script updated

not sure for the cheap fix, I'll look at it when I have the time

Xuroth

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.

LiTTleDRAgo

I trying to make numerous moving events at the map and it seems not lag at all



---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

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Xuroth

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.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

LiTTleDRAgo


Xuroth

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 /

G_G

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.

LiTTleDRAgo

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

Xuroth

March 30, 2011, 04:01:07 am #40 Last Edit: March 30, 2011, 06:47:46 am by Xuroth
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
self.z = 10


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)...

LiTTleDRAgo

update 3.09

-cross engined
-added tag
     \fontsize[ Size ]
     \bold
     \italic
     \fontname[ Fontname ]
     \color[ R, G, B, ALPHA ]

Daclopeda

I get this error when I'm starting the game

Quotescript''line 246: NoMethodError occured.
undefined method `rpgvx?`for nil:NilClass
"What goes around, comes around."


Daclopeda

"What goes around, comes around."

Susanm

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



LiTTleDRAgo

August 12, 2011, 12:53:36 am #46 Last Edit: August 12, 2011, 12:54:50 am by LiTTleDRAgo
look at this part (bold)

Spoiler: ShowHide
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

Susanm

Thank you littledrago... i love your script  :naughty:

Xuroth

September 15, 2011, 10:07:36 am #48 Last Edit: September 15, 2011, 11:35:21 am by Xuroth
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

LiTTleDRAgo

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*

Moshan

How to disable show name for enemies? (I'm using Blizz-Abs)

LiTTleDRAgo

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

Moshan

I wasn't using the comment.....But now I change the opacity for enemies names to 0. It's solved! :)

LiTTleDRAgo

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

Xuroth

October 04, 2011, 07:12:24 pm #54 Last Edit: October 12, 2011, 03:14:32 am by Xuroth
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?

LiTTleDRAgo

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

Xuroth

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.

LiTTleDRAgo

updated to ver 4.00

*change

* Method of setting event name
* Adds an image in the back event name


exile360

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.

LiTTleDRAgo

update the script, now the event name won't show if the event graphic is empty

exile360


Shalaren

August 13, 2013, 07:22:28 pm #61 Last Edit: August 13, 2013, 07:23:30 pm by Shalaren
sorry for the Necroposting

I tried adding it to a new project and it gives me the error
Spoiler: ShowHide
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

LiTTleDRAgo


Shalaren

ok so you know im using a CMS, here is what happens

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?

LiTTleDRAgo

search this line

Quote@name_event.z = self.z + 1000


change that value as you need

Shalaren

August 13, 2013, 09:30:20 pm #65 Last Edit: August 13, 2013, 09:46:16 pm by Shalaren
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

LeviAlvi

September 13, 2013, 08:53:28 am #66 Last Edit: September 13, 2013, 09:24:33 am by LeviAlvi
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.
Spoiler: ShowHide
hahahahaha

LiTTleDRAgo

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

LeviAlvi

Silly me  :^_^':   thanks, it worked. is didn't use the "<>" thing

can i disable the actor's name first then enable it again later?
Spoiler: ShowHide
hahahahaha

LiTTleDRAgo

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)

firevenge007

How exactly do you activate this switch so that the character's overhead name is turned off?

LiTTleDRAgo

if you're talking about this :

Spoiler: ShowHide
Quote from: LiTTleDRAgo on September 13, 2013, 07:52:15 pm
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)


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



firevenge007

How and where would I turn my switch on/off?


syldocaine

I just have to say: Awsome script!

keep up the great work!

MarkHest

December 31, 2013, 08:59:19 pm #75 Last Edit: December 31, 2013, 09:00:56 pm by MarkHest
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.
   

LiTTleDRAgo

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

MarkHest

Didn't work. The name is still there  :roll:
   

LiTTleDRAgo

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

MarkHest