First of all I want to thank everyone that have helped me with my previous subjects, you know who you are! <img src="smileys/smiley1.gif" border="0" align="middle">
Please bear with me, english is not my native language.
Today I will share a little top-down demo I have made using Construct Classic.
In this demo the AI units will run for cover, prefering cover points distributed on the map. For each tile I have distributed a LOS node which is a sprite. Due to the fact that the tiles always have their hotspots in the top left corner.
In this demo I have the walls on the inside of the tile square. I realize now that I could have made them inside on the south and east walls and outside on the north and west walls. Maybe even using the same tile but putting the north and west wall in the outdoor tile next to the floor tile. Anyways...
Each LOS Node gets a "hide value" like so:
clamp(int((distance(player.x,player.y,los_node.x,los_node.y))) - (los_node.Value('in_los')*100000) + los_node('cover_point')*240,0,480)
You can get a very dynamic formula here if you play with the values and add more values like if there is a grenade thrown etc...
Well since alot of people have been so nice to me on this forum I feel that I want to give something in return, if this has any value to anyone that is. <img src="smileys/smiley36.gif" border="0" align="middle">
Here it is:
Example file here!
However for the love of all green jelly in the world, I can't make this work when using the nodes as tiles. Does anyone know how to do it?
It creates alot of overhead using sprites for such a simple task.
Have a nice day!