ID:271703
 
How could you make something appear on someones screen but no one else can, like an NPC that they can see and attack but no one else could...
Lt. Pain wrote:
How could you make something appear on someones screen but no one else can, like an NPC that they can see and attack but no one else could...

Dunno, but that would be really cool to find out, the thing about attacking that would be funny to see someone swinging away at a invisible npc, everyone all thinking he is nuts.
In response to Signaki Corp
While you might not be able to create an invisible one you can always create a visible one that only the certain person can attack.
In response to Signaki Corp
See this guy has the right idea lol
Images will let you display things to only a particular player. Associate them with an object that is set up to filter from selection lists for everyone but them, and you could have the whole hallucination thing.
In response to Jp
In English or mabe an example
In response to Lt. Pain
What Jp's referring to is that you'll want to check out /image or image() in the DM reference.

An image is a pseuso-object that is only seen by certain players.

Lummox JR
Bump


Yes i still need help so ppl post ideas and here is what i want if its not clear, a type of enemy that only one person can see and fight, an illusion...
In response to Lt. Pain
its not hard, make the monster invisible = 1
and make the guys see_invisible to 1

if u have an invisible verb for u or gm's and dont want them to also see it once they go invisible, just use invisible = 2 and see_invisible = 2 respectively

though this way i set is where only one guy would be able to do it, there are other ways that will do it



i did this once and made it so like also multiple people had their own monsters they could see, but i did it in such a manner that made the game a bit laggy, which was making it so the ground appears over the monsters if hes not supposed to see it, and such, it is just gonna take long to do it, and lots of CPU at the end...there are better ways...
In response to Lt. Pain
Your answer's already been given to you in Lummox's post here;
[link]

Images in the /image list of a client only display to that client. It's how HUDs and the like work. You can try setting up an invisible mob and showing it to the player seeing the illusion through /image. Keep a variable on the mob that indicates who it "belongs" to (or rather, who's seeing it), and then use that variable as an argument in your combat procs.
I don't have much time (I'm supposed to be working) but in my break (you're lucky I don't like breaks) I'm going to answer your question with code to boot!

The invisible man and the scientist!

npc
icon='icons/npcs.dmi'
parent_type=/obj
scientist
icon_state="scientist"
name="The Scientist"
Click()
if(usr in oview(1,src))
usr<<"\icon[src] My friend here has managed to make himself invisible! However, I have created a potion which will allow you to see him. If you can see him he is more likely to give up his secret to invisibility. Would you like to <a href=\"byond://?src=\ref[src];buy_potion\">buy</a> it?"
Topic(href,href_list[])
if("buy_potion" in href_list)
if(usr.gold>=25)
usr.gold-=25
usr<<"\icon[src] Pleasure doing business with you!"
for(var/npc/invisible_man/M in world) usr<<M.image
invisible_man
icon_state="invisible_man"
name="The Invisible Man"
invisibility=100
var/image/image
New()
.=..()
image=image(icon=src.icon,icon_state=src.icon_state)
Click()
if((usr in oview(1,src)) && usr.client)
if(image in usr.client.images) usr<<"\icon[src] You can see me? Wow! Perhaps you'd like to buy my <a href=\"byond://?src=\ref[src];buy_potion\">invisibility potion</a>."
else usr<<"\icon[src] Go away. I don't like you."
Topic(href,href_list[])
if("buy_potion" in href_list)
if(usr.gold>=25)
usr.gold-=25
usr<<"\icon[src] Pleasure doing business with you! This specific potion isn't as potent. It has been deluded so it will only work for five minutes. Complain as you may, pure invisibility is <i>not</i> what you want... The people can't see you coming, you're constantly tripped on, you're cold since only your body is invisible, not your clothes."
usr.contents+=new/item/invisibility_potion


You need to talk to the scientist, who will give you a potion to make the invisible man visible. Then you talk to the invisible man to buy a potion (deluded) that renders your body invisible for a few minutes.

I recommend elaborating on this. Instead of making the player completely invisible, you should only make their body invisible. This will force the invisible player to stop wearing clothes, and is going to look weird when the potion wears off!

Also, invisible players should not be able to talk to NPCs as they can't see the players; they'll go "huh?" and look around. The exception is the invisible man,whom will awknowledge them because he knows about your misfortune.

This will make invisibility a way for players to vent off -- they can punch and kick somebody else without them noticing and they are harder to fight because you can't aim. Escaping is also easier.
The penalty to this is that the player cannot communicate socially with others very well, because it will freak certain people (NPCs) out to the point of paranoia (perhaps an NPC will call a town guard which will patrol, possibly finding you and initiating a fight in an attempt to subdue you).

In any case, in my example the invisible man is only temporarily visible; once the player reconnects to the game client.images will be cleared, and the invisible man shall once again be invisible. If you want the condition to persist, you'll have to write it in a variable and re-apply the images list on login.

-- Data
In response to Android Data
Diluted. Deluded means something entirely different. :P
In response to Jp
Jp wrote:
Diluted. Deluded means something entirely different. :P

Odd. I wonder if that was subconcious.

-- Data