ID:167239
 
Hi, I don't think I've ever seen a player-only viewable overlay or underlay such as an overlay on a character's mob that only that client that is attached to that mob can only see that overlay while the other players around can't see it. Is it possible to make something like this?
Look up image()
In response to Joseph Constantine
Or you could just
mob/verb/addimage(mob/M, i as icon)
var/image/I=image(i,M)//Put i on M
usr<<I // Let usr see it
In response to Joseph Constantine
Joseph Constantine wrote:

> client/New(args[])
> {
> ..();
> var image/image = new;
> image.icon = [insert gfx here];
> mob.overlays += image;
> images += image;
> //the above could be replaced with [object] << [image]
> //where [object] is who you want to see the image.
> };
>


Other than your ridiculous syntax and the unneeded argument list, that is not how you can create an image object that only a select few can see. When you add the overlays, everyone automatically sees it. You have to set the image's loc on whoever you want to stick the image on. image() creates and returns a new image object based on what arguments you supply.

var/image/I = image('icon.dmi', src, "icon state")
src << I


~~> Unknown Person
In response to Joseph Constantine
Dude, DM!=C. The braces are useless, the semicolons are pointless, and args[] is a complete waste of time. Not to mention, of course, that "var image/image" is bogus syntax that will cause the compile to fail entirely. Best to avoid handing out code help until you sort out which language you're using.

Lummox JR
In response to Unknown Person
In response to Joseph Constantine
Again, C!=DM. Your code is bogus. Most of the syntax is just harmless garbage, but some of it is outright erroneous and will cause a compiler error.

If you can't figure out what langauge you're talking about, you're not in a position to help people, so please refrain from trying until you can get that sorted out.

Lummox JR
In response to Lummox JR
Lummox JR might have said:
STFU.

Lummox JR

There's a paraphrase, in case you're a terse kinda guy.
In response to PirateHead
In response to Joseph Constantine
Joseph Constantine wrote:
Lummox Jr,I'll see to it that my syntax is readable at first glance from now on.
ps:I'm keeping the brackets.

Then don't bother posting code help. You'll only confuse people.

Using braces (they're not brackets, FYI) is fine for your own code, but for demos or code that people need to study, it's not. This is BYOND; braces are irrelevant. Code is much much clearer in its standard indented form. If you're going to explore strange forms of presentation, do it on your own time.

And for future reference:

( ) - parentheses
[ ] - brackets
{ } - braces (or "curly braces")
< > - angle brackets

Lummox JR
In response to Lummox JR
Braces aren't exactly 'irrelevant'. When you tested a whole chunk of code and you know it works, and it's taking a heck of space, you could shorten it.
It would not increase, and possible not decrease any lag, and it looks a bit cluttered, but it is by no means irrelevant. Or so, that's what I have experienced.

Of course, using braces as used in C++ is irrelevant. In my opinion, you were quite wrong to say that braces are irrelevant in whole of BYOND. The point of view that code is much neater and more easy to understand is coding preference.
In response to Lummox JR
In response to Joseph Constantine
On the subject of horrid syntax, you should be using more than one space for a tab, so it's readable. Two will do fine.

Lummox JR
In response to Mysame
Mysame wrote:
Braces aren't exactly 'irrelevant'. When you tested a whole chunk of code and you know it works, and it's taking a heck of space, you could shorten it.
It would not increase, and possible not decrease any lag, and it looks a bit cluttered, but it is by no means irrelevant. Or so, that's what I have experienced.

Of course, using braces as used in C++ is irrelevant.

Which was the context I was talking about. Obviously when it's preferable to put, say, all of an if() block on the same line, braces can come in handy there.

In my opinion, you were quite wrong to say that braces are irrelevant in whole of BYOND.

That would be wrong, but it happens not to be what I said--particularly when context is taken into account.

Lummox JR
In response to Lummox JR
@_@
Write... a... book... about it...
*dies*