ID:1687645
 
Keywords: mouse, name, pointing
(See the best response by Kaiochao.)
Code:


Problem description:
I want to change the name that shows up in the lower left corner of dream seeker, depending on who is pointing their mouse at that atom.

The context I want to use it in is if you are the leader of a guild, or a high enough rank in a guild and you point at an obj you will see more than only its name.

If a non guild member points their mouse at a dagger they would see the name "Dagger" but if a guild member of high enough rank, or the guild leader points at it, it would say "Dagger (Attack 8, status: bleed)

Is there any easy way to do this, or any way at all to do this, or am I way off in thinking it can be done at all?
Best response
I've done this before. It's not really feasible unless you have a custom status bar, such as a HUD object with maptext, or a label in the game skin, or maybe a custom control in the webclient.

If you can figure out how to determine what text to display (I used an associative list on the player to set the names of other players in a strict-roleplaying game by associating a randomized character ID to the player-set name), then you can easily set your custom status bar to show that text.
Do you know the name of the little bar at the bottom of dream seeker where the name of atoms shows up when you point at it? I was really hoping to be able to use that bar for members of forging and crafting guilds to be able to just point at it and see the stats, without having to do any maptext or hud.

Is there a way to use MouseEntered to change the name of the obj and then display it on the bottom bar, and then change it back to its original name so fast that nobody else would be able to see the name that shows the stats of the dagger?
In response to LawnMower
LawnMower wrote:
Do you know the name of the little bar at the bottom of dream seeker where the name of atoms shows up when you point at it?
Status bar.

I was really hoping to be able to use that bar for members of forging and crafting guilds to be able to just point at it and see the stats,
Yeah, I know.

without having to do any maptext or hud.
No can do.

Is there a way to use MouseEntered to change the name of the obj and then display it on the bottom bar, and then change it back to its original name so fast that nobody else would be able to see the name that shows the stats of the dagger?
It's not about speed. If your method can't handle multiple people hovering over it simultaneously, then it's unusable. Besides, the status bar would update to the new name when you change it, or it wouldn't show the proper name as soon as you mouse over it.

A JavaScript-powered custom webclient control would probably be your best bet all things considered, but it would only really work in the web client, which is still very new.
This might be a long shot but if I knew the name of the byond proc that calls MouseEntered() I might be able to change the name of the dagger, let MouseEntered show it on the status bar, and then change it back, all before it had a chance for the next player hovering over the dagger to see its name.

Or is there a proc that can print to the status bar? If that could be done, this would work perfect.
In response to LawnMower
MouseEntered() has nothing to do with the status bar. The status bar text is updated on the client independently of the server.

If you think your method would work, you should try it and find out. Here's what would happen, though, if you tell MouseEntered to change the name of the item:
1. the player mouses over the item, the status bar changes.
2. MouseEntered() is called, changing the item's name, possibly changing the status bar.
3. A short time later (a frame or two), the item's name changes back, and the player's status bar shows the item's original name.

I've already given you a working alternative: custom status bar.
I have been reading about skins, and I don't understand how to really make a custom status bar. It sounds like it would be useful, but I'm stuck. I never used winset or anything like that, and don't even know where to begin.

Right now I made it so when you click the weapons it will say their name, for non crafting guild members, and their name, damage, and special effects in the main text box, but that is always getting spam from everything else like damage messages and world chat.

I want to try making a custom status bar. Could I have some examples of how to do it?
You should read up on all the skin-related tutorials in the forum, written by Lummox JR. Links in the resource repository.


Basically, you can place a Label in your default window and use winset to set its text to whatever.
winset(player, "label_id", "text=\"Text Goes Here\"")

You could also use an output or browser control instead, for more customization.