ID:161131
 
hi, can someone show me a turtorial that can allow me to put names underneth the mob, so you will know what there name is just by lookng at them. for example theres a guy named "mike" you can see mike in letters underneth his mob? help is appreciated.
There are various demos (and libraries, I believe) that handle showing text on the map. While not all of them are quite good, they do demonstrate how to do it. To accomplish what you want, you'd use pixel-offseted overlays to show an icon in a tile next to the mob (in our case the tile beneath him). To do this, you will need to learn about the pixel_x, pixel_y, and overlays variables, so look them up in the DM Reference. To make a pixel-offsetted overlay, you'd create an atom or an /image, and set its icon and pixel variables to the desired values, then add it to overlays, like so:
var/obj/O = new //create a new obj (without any location)
O.icon = 'overlay.dmi' //set the icon...
O.pixel_x = 32 //make the icon appear on the tile EAST (right) of its actual position
mymob.overlays += O //add it to the overlays of the player


In order to do this as soon as a player logs in, you could override client/New(), or mob/Login(), whatever is appropriate kind of depends on your game.

Something else you'd need is a system to create icons for words, for player names in this case. It is a bit of hassle since you're going to need to have an icon for each letter/character but there are libraries for this as well. Look into hub://LummoxJR.DMIFonts .
In response to Kaioken
i tried to understand what u wrote, then i didint get it that much, i tried using your code but ended up with a lot of errors, so, it looks like the code u showed me does work, but i dont know a way to make it without any errors. mind showing me more, thanks
In response to Agrey123
Agrey123 wrote:
i tried to understand what u wrote, then i didint get it that much,

I have no problem with explaining things more until you understand them, or with answering your questions. What didn't you understand?

i tried using your code but ended up with a lot of errors,

This is because it was just example code to show what how what I was speaking about is done. It's not meant to be used and isn't the exact thing you need to do in your game. Copying any code in sight isn't very beneficial, so you shouldn't do it.

mind showing me more, thanks

I don't mind somewhat guiding you through this, but I don't really want to code this whole feature into your game for you, either. Bear in mind that you also wouldn't learn much that way.
Remember to look into Lummox' library I linked to. It's going to be handy.