ID:150276
 
I am thouroughly stumped as to how I can come up with a good nightvision system without people seeing through walls. In addition, I also need to make it so certain mobs can't see others before they make a successful spot check to see them (i.e. if they're hiding or whatever). This wouldn't be a problem if Maeva was single played because I could easily make things just invisible, but then no one would be able to see them unless they had see invisible, which would make things difficult as well. I've pondered using the image proc to cover up areas for where users "aren't supposed to be able to see" for nightvision, but this would be cumbersome. I don't know, if anyone has any ideas feel free to let me know, hehe.

DerDragon, the Maevanator.
I don't think I've ever had a comment on my postings asking for this. Could we just add some sort of feature for levels of visibility beyond just seemobs, seeturfs, seeinvis and all that great stuff... pretty please?
In response to DerDragon
DerDragon wrote:
I don't think I've ever had a comment on my postings asking for this. Could we just add some sort of feature for levels of visibility beyond just seemobs, seeturfs, seeinvis and all that great stuff... pretty please?


Yes I would like to have those options too but for now you can do this:

mob
var
nightvisionon = 0

mob
proc
checknightvision()
for(var/turf/T in range(src,6))
if(src.nightvision)
T.opacity = 0
else
T.opacity = 1

obj/Night_Vision
icon='nightvision.dmi'
verb/Power()
set src in usr.contents
if(usr.nightvisionon)
usr.nightvisionon = 0
usr.checknightvision()
else
usr.nightvisionon = 1
usr.checknightvision()


That's probably not the easiest way of doing that but it's worth a try.
In response to Nadrew
That's a very interesting idea!

You wouldn't want to alter the opacity of actual turfs, since that would allow anyone to see or block the vision of people who should be able to see. Instead, you might be able to make a ring of opaque images visible only to that particular mob. It would reduce the complexity of the system DerDragon suggested in his first post in this thread, if it works.
In response to Shadowdarke
Ah, I just thought of that little snag in my code.
In response to Shadowdarke
Problem with that is that we still can't make things visible only to one person, besides using the image proc, which doesn't allow you to set things as opaque. My method was going to be to make a black tile object on top of every turf the player can't see, but they can still target things under the black tiles or right click them, not to mention it takes a lot of processor to check for what the player can see every tick and deleting and adding new black tiles to update the view.... so yeah.
Since it's possible to draw icons in the text window, maybe you could give the player a hotkey to generate a "night vision map" on command. Not exactly what you had in mind, I know, but it might be worth considering.