ID:161748
 
Slightly incorrect topic title, I apologize, but what I'm trying to achieve is, while MOB is in /area/cave/ MOB cannot see other MOB's.

So if for example players John and Dave entered someplace, and it's area was /area/cave/

John could see himself, but not Dave
Dave could see himself, but not John

Unfortunately the invisibility variable isn't going to help in achieving this, either that or im tackling it in the wrong fashion.

area
maze_area
Enter()
//Do stealthy stuff here
return ..()
Exit()
//End stealthy stuff here
return ..()





    Entered()
usr.sight |= SEE_SELF
usr.invisibility = 1
Exited()
usr.sight &= ~SEE_SELF
usr.invisibility = 0


This is the solution I came up with thanks to Kaioken and Hiead, thanks for your insightful debate.

I was originally only applying one, I didn't know to mix them both to get the desired effect, thanks again.
Bunnie wrote:
John could see himself, but not Dave
Dave could see himself, but not John

It sounds to me like you're looking to combine the invisibility var with the sight var. Look up sight var (mob) in your local DM Reference (F1 in DreamMaker) for more info.

area
> maze_area
> Enter()
> //Do stealthy stuff here
> return ..()
> Exit()
> //End stealthy stuff here
> return ..()


You'll want to look at both of these procs in the DM Reference as well; you're using the wrong ones. Enter() and Exit() are used to test if the atom can move into or out of another atom. Rather, you should handle the "Stealthy stuff" inside of Entered() and Exited().

Hiead
Luckily, there's a special built-in variable that comes in handy when implementing things like that. Look up the 'sight' variable in the DM Reference; I'm not sure what Hiead means, but that var will be enough for you.
Reading threw the documentation for it, you will see that you want to turn off the SEE_MOBS field and activate the SEE_SELF one. If you're having trouble with handling bit flags, you can look for, or we can refer you to, a bit flags tutorial or two. There are some good ones.
In response to Kaioken
Kaioken wrote:
Luckily, there's a special built-in variable that comes in handy when implementing things like that. Look up the 'sight' variable in the DM Reference; I'm not sure what Hiead means, but that var will be enough for you.

I meant that it would need to still be combined with the invisibility var, because if everything is visible, setting SEE_SELF won't matter. The sight var defaults to 0, as stated by the DM Reference:

"The default value of 0 means that the mob can see all objects that are visible and lit."

So, what you'd want to do is make mob.sight equal to SEE_SELF (as well as any other relevant flags), and then make mobs in caves have invisibility values greater than the mob.see_invisible variable.

Hiead
In response to Hiead
Ah, I see. Then you could might as well do it with see_invisibility (or infra) instead, if you already use invisibility. Yeah though, using sight is better and more robust.