ID:265058
 
It's me again... heh! This time I'm thinking how great it would be if you could use JavaScript to update a html form filled with Byond variables. Right now I can't think of how to do it, but I feel that there must be a way.

It's funny how the mind expands. A couple of weeks ago I made a Fog of War routine where you can click on turfs out of range, and I thought it was fast and well optimized... Until yesterday, when I rewrote the whole thing to be 1000% faster, at least!

/Andreas
It's me again... heh! This time I'm thinking how great it would be if you could use JavaScript to update a html form filled with Byond variables. Right now I can't think of how to do it, but I feel that there must be a way.

Oh yes, there's a way, but it's much too complex for me to explain... and I haven't learned it yet, either. ;-)

It's funny how the mind expands. A couple of weeks ago I made a Fog of War routine where you can click on turfs out of range, and I thought it was fast and well optimized... Until yesterday, when I rewrote the whole thing to be 1000% faster, at least!

I'd like to compare libraries when you get yours done; mine's done but it's rather processor intensive and thus not really worthy of a release.

Do you have yours "gray out" areas that have been explored but aren't in view? I don't...
In response to Spuzzum
On 1/3/01 1:50 pm Spuzzum wrote:
Oh yes, there's a way, but it's much too complex for me to explain... and I haven't learned it yet, either. ;-)

Haha, sounds like my situation!

Do you have yours "gray out" areas that have been explored but aren't in view? I don't...

I use black Images all the time, so I have to think how to handle fog. My proc is making all the turfs clickable even if they are out of sight (so you can attack a turf out of view), and creating a border of images if your vision range is lower than world.view. It's not extremely fast though, but it could be solved if Dantom allowed mouse-clicks on turfs not in view() (hint hint:)

/Andreas
In response to Gazoot
Do you have yours "gray out" areas that have been explored but aren't in view? I don't...

I use black Images all the time, so I have to think how to handle fog. My proc is making all the turfs clickable even if they are out of sight (so you can attack a turf out of view), and creating a border of images if your vision range is lower than world.view. It's not extremely fast though, but it could be solved if Dantom allowed mouse-clicks on turfs not in view() (hint hint:)

Mine works about the same way! I image() a black icon on every turf that has its 'fog_covered' var set to one. Then when a player, or any mobs with their 'owner' var set to that player, move through the fog, it removes the image, removes that player from the fog_controller's 3D list of unexplored turfs, and redisplays it for all other players. It also renames all of the turfs to " " so you don't get to see what kind of turf it is by moving your mouse over the blackness, but because it still has a name you can click on it.

I have support for graying it out by performing icon arithmetic on the image (*0.5), then displaying that image. But I can't get that part of my code to work...