ID:156945
 
How do I convert the location of an object to a location on a clients screen?
EX:
obj.loc -> obj.screen_loc
You need to be more descriptive like i said when you asked in the code problems thing.

Most people including me will tell you to go look at the DM Guide and search the forum.

Or at the very least explain in more detail so we can help you.
This code assumes client's map is square shaped, not rectangular.
var
xx
yy
px
py
px = obj.pixel_x
py = obj.pixel_y
xx = obj.x - usr.x + usr.client.view
yy = obj.y - usr.y + usr.client.view
obj.screen_loc = "[xx]:[px], [yy]:[py]"
In response to Midgetbuster
I couldn't be more descriptive than that so you need to be more understanding.
In response to Lcooper
Its not my job to be "understanding"

You want help you supply the information, some people can interpret it some cant so yeah i require more info then one sentence that comes across as a help vampire
In response to Midgetbuster
Midgetbuster wrote:
Its not my job to be "understanding"

You want help you supply the information, some people can interpret it some cant so yeah i require more info then one sentence that comes across as a help vampire

If you can't understand, then you have 2 main options:

A) Don't attempt to help.
B) Be patient with the original poster.

Anyways, it's quite clear what they want.
They want to grab the "visual" location of an /obj that's location is on the Map. Then they want to transfer that /obj into a client's screen, but have the screen_loc the same as the "visual" location.

The /obj's loc or x,y,z doesn't matter. Look at it in a visual perspective.

If the /obj is let's say, at the equivalent to 5x 5y on the person's view.
They want the screen_loc to be 5x5. Let's say the /obj's x = 200, y = 500, z = 2.

That doesn't matter since it's irrelevant. But, while being 200x 500y 2z, the /obj is at the bottom left of the Player's view. The screen_loc would be like 1x1.