ID:138503
Jul 10 2000, 5:17 pm
|
|
Anyone know of a way to give a couple of my races the ability to see in the dark, but not through walls?
|
In response to Spuzzum
|
|
When you do that, players can see things through walls, I just want them to be able to see in the dark. Drow have nightvision, but they can't see through things.
|
In response to DerDragon
|
|
On 7/12/00 5:21 pm DerDragon wrote:
When you do that, players can see things through walls, I The only way I was able to come up with a satisfactory way of doing it was by creating a seperate function for vision instead of the built-in one. mob/var/vision=1 // 0=blind|1=normal|2=low-light|3=thermographic mob/proc/checkVision(mob/M) if(M.vision == 0) ... // etc if(M.vision == 1) ... // etc I've actually got a pretty good system that checks for temperature and light on each turf. Penalties and mechanics revolve around it. For example, a troll (with thermographic vision) has to work under a huge penalty under the noon sun and is, for all practicle purposes, blind. Even if there is no sun, but the turfAmbientTemperate is greater than a certain point it still works. For blocking sight, I just used the density variable but I think I'll have to change this as well to allow for heavy fog. Probably just add obj/var/blockvision=0 //0=false|1=true and put in the functions for output map and text. I did something similar with hidden objects/mobs. obj/var/isHidden=0 //0=false|1=true The map and output text checked to see if something was hidden before allowing it to be displayed. - - |
In response to DerDragon
|
|
On 7/12/00 5:21 pm DerDragon wrote:
When you do that, players can see things through walls, I just want them to be able to see in the dark. Drow have nightvision, but they can't see through things. Odd. I seem to recall that it sets the turf's icon to null on any turf not in sight. Unlit turfs and invisible turfs are supposed to be different... unless Dantom has a reason? |
In response to Spuzzum
|
|
On 7/12/00 10:56 pm Spuzzum wrote:
On 7/12/00 5:21 pm DerDragon wrote: I'll have to do some testing, but I'm pretty sure that unlit turfs and invisible turfs have the same behavior (the only difference being that invisible turfs are always hidden, even in the presence of lighting). That behavior is to hide the icon and remove the item from view(). Of the top of my head I can't think of a quick way to manage the vision as you'd like, aside from doing some things manually. It probably won't be difficult to just add a few more sight flags to do this. I'm kind of adverse to the whole flag system in the first place because it is pretty restrictive. Eventually I hope that we can have an entire client-side vision system. It's entirely possible that I'm just overlooking something; maybe this can already be done. I'll get back to you. |
Yeah, just turn on the bits in mob.sight.
mob.sight |= SEEMOBS
mob.sight |= SEEOBJS
mob.sight |= SEETURFS
Turn 'em off by
mob.sight &= ~SEEMOBS
mob.sight &= ~SEEOBJS
mob.sight &= ~SEETURFS
This lets you see stuff in unlit areas as if they weren't unlit at all. One of my favorite GM cheats =)