ID:149528
 
I'm trying to get a team-based fog of war thing going and I have to use images to do it, but whenever the user moves their view, all the black tiles I generate to simulate this move along with the user. I either need a more efficient way of doing fog of war, or I just need to know how to get images to not move with the client that they're visible to. BLAST IT, BELL!!! gotta go
DerDragon wrote:
I'm trying to get a team-based fog of war thing going and I have to use images to do it, but whenever the user moves their view, all the black tiles I generate to simulate this move along with the user. I either need a more efficient way of doing fog of war, or I just need to know how to get images to not move with the client that they're visible to. BLAST IT, BELL!!! gotta go

If you want images to stay in the same place on the screen no matter where the user moves (that is, to display as if part of the screen, not part of the map), use screen_loc and client.screen. Otherwise, /image is still the way to go--just make sure it's attached to the right thing.

Is the problem that you want this fog to appear in a specific turf and then stay in that spot as the player walks away? If so, then you need to attach the image to the turf, not the player.

Lummox JR
I've been having trouble with images not staying put as well: id:78648
In response to Lummox JR
Is there some special way of attaching images to turfs? I am attempting to get them to stay on the turf, but they move with the usr.

var/i = image('blackness.dmi',T)
src << i


Thats the basics of what I have in my code. I have this constantly refreshing by setting the client's images var to null. The black tiles appear on the turfs but the move with the src who is viewing them. I think with the creation of the screen_loc var it now moves the images along with the client thats viewing them by default.
In response to DerDragon
DerDragon wrote:
Is there some special way of attaching images to turfs? I am attempting to get them to stay on the turf, but they move with the usr.

var/i = image('blackness.dmi',T)
src << i

Thats the basics of what I have in my code. I have this constantly refreshing by setting the client's images var to null. The black tiles appear on the turfs but the move with the src who is viewing them. I think with the creation of the screen_loc var it now moves the images along with the client thats viewing them by default.

This shouldn't be the case; my guess is that T is set incorrectly before going into the image() proc.

Lummox JR
In response to DerDragon
I just recompiled one of my own experiments with fog of war (I could never get it to work with satisfactory speed on large view sizes). image() is definately broken in the latest BYOND version.