biter_fow - Fog of War

biter_fow v1.03
By Lantiz

Discontinued
I am very confused as to what exactly this does.. what is "fog of war"? the black on the screen?
Yes, that effect of revealing the map as the player walks.


Like this one: link to youtube
Yes, that effect of revealing the map as the player walks.


Like this one: link to youtube

can we have round corner radius?


or is only square?


nice jobs friends
It's tile based so it's possible to change the shape chosing the tiles to be revealed around the player, some shapes won't fit the design to work with a changleable view range as a radius tho.


I've done another one with round corners (see it here) but I could not manage to save it when the player saves the game, so everytime the map is loaded, the fog of war is rebooted.
Hey. Thank you did it 🙂
But what am I doing wrong?

RPGMV_2016-07-13_18-57-27.png

Game_2016-07-13_18-57-16.png
There was a bug and has been fixed. You can download it again.
It's tile based so it's possible to change the shape chosing the tiles to be revealed around the player, some shapes won't fit the design to work with a changleable view range as a radius tho.


I've done another one with round corners (see it here) but I could not manage to save it when the player saves the game, so everytime the map is loaded, the fog of war is rebooted.

this one are geat with canva 


http://codepen.io/zyklus/pen/prvnb
Yes, the one I linked was made using canvas, the problem is that I didn't find a way to store the map canvas when saving the game.


It's drawn in a Bitmap object which has a cyclic reference with it's parent, so I can't parse it into a JSON object to store in the save file.
Yes, the one I linked was made using canvas, the problem is that I didn't find a way to store the map canvas when saving the game.


It's drawn in a Bitmap object which has a cyclic reference with it's parent, so I can't parse it into a JSON object to store in the save file.

am not shure but.


var ctx = canvas.getContext('2d'); //Get canvas and context
ctx.restore(); //So this should restore the canvas to what I save earlier, right?
ctx.save();




or

Code:
var lines = JSON.parse(localStorage.getItem(canvasName));
lines.forEach(function (line) {
    ctx.beginPath();
    ctx.strokeStyle = line.color;
    ctx.moveTo(line.x1, line.y1);
    ctx.lineTo(line.x2, line.y2);
    ctx.stroke();
});
Im not sure also, last time I tried, I needed to stringify the bitmap, where it was failing.


I'll probably remake that canvas plugin when I have time, maybe it works this time.


EDIT: I won't change it anymore, please check the first post.
Updated and fixed.


Even saying I would not change it, I took the time to fix the save bloating.


The fog of war won't be save anymore and it's going to reset everytime the player enters the map.


Also there was a bug and was not working at all, no one told me before... but it has been fixed and is working nicelly.
This is cool, I hope you keep working on it.
I'm not sure if there's much to add to it [:
Updated:


v1.03 - Fixed reset after pushing a new scene. It won't reset on scene transitions anymore (like shop)

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/biter_fow-fog-of-war.65258/