Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Request(?)] Editing Fog of War from the API

So, after poking around some in the objects of a page I found that you can turn FoW on and off from the api. My question is thus: Can one edit the fog of war map from the api? Some background for what I'm thinking of. I have a world map that the party travels around, and they take great joy in revealing each new tile and collecting maps of the various areas to reveal extra area. Now, as I'm sure you can imagine. Manually showing every tile can get a little tedious. So I was looking for a way to just always reveal a 35px radius area from wherever the tokens current position is. And when you buy a town map, make it 10x that or something via !mapGet or some junk like that. Is this doable or just something I should slot with some other ideas into my "I wish" pile?
That sounds like an awesome idea. Maybe have a token on the gm layer that triggers it whenever a player steps on it?
1432395516

Edited 1432395667
The Aaron
Pro
API Scripter
So, you can't manipulate the fog of war from the API. But you CAN manipulate the Dynamic Lighting. If I were writing this, my approach would be: mark pages as using this reveal technique set the page so that it uses dynamic lighting, blocks movement, global illumination on for each token on the page, be sure they are "in" an object on the DL layer, if not, add one with a 35px offset from them. on token move, if on one of those pages, adjust the DL object containing the token to maintain the 35px offset. provide a command that opens a DL object around a given region (your 10x map thing). If there isn't a token in the area, add an invisible token with full player control that can see the area Something along those lines.
1432396183
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Anyone recall this game.... <a href="https://www.youtube.com/watch?v=Oi0be1ghcMs" rel="nofollow">https://www.youtube.com/watch?v=Oi0be1ghcMs</a> Relevant part is the the map about 3 seconds in.
I've thought about using dynamic lighting for it too, but that also doesn't quite work for the purpose. A gradually revealed overworld. Mostly because of the simple fact that my world map is 143x143 grid. Total horizontal distance is representative of 4576 miles This is a clip of my world map. The darker shaded areas are pitch black for the player, using Fog of War, I can see more to tell how close they are to an overworld event or a city. That screenshot alone is 800mi x 448mi. As you can see they like to meander about (Mostly trying to avoid Dharenvale as it's the capitol of a BBEG.) Each day the party moves reveals a new 70px x 70px (1 square) tile. A city/town map reveals 9x9 tiles. I was just hoping to have a way to say; If world map is active map then, on character update find token party x/y co-ordinates on fog-of-war layer, erase square (start partyx-36, partyy-36)(end partyx+36 partyy+36) (the 36 is to make it 72x72px centered on current pos, to remove any black gridlines you get when shift-click-draging one tile at a time manually.) As far as I can tell (at least in my head) an example like The Aaron had.I can't see it scaling to something of this magnitude.
1432418660
The Aaron
Pro
API Scripter
It shouldn't be any worse than FoW.You could try duplicating your current map and drawing in the boxes to obscure with DL, then see how it does. Stephen S. puts the DL through it's paces quite a bit and I don't think he's had much trouble. large square regions are the best case for DL performance wise (in my experience), You could do some optimization of the DL paths as you change them to keep the polygon count down. Using Ambient light, then you just have to worry about seeding enough invisible markers on the page that everyone can see everything that is revealed.
1432421720
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Can you drop in breadcrumb trail light sources? Use the dugoen draw pathing stuff to drop in lights.... then you get a nice soft edge. No paths, no FOW.... you just use the pathing tool to difine an area to be populated with light souces. 1) Define.... with path 2) Lights get dropped on the map layer (clear PNG) with short light sources (10, fade at 5) 3) Path is removed (by API) The map just gains lights.