Forum
CS2D Scripts FOW areaFOW area
13 replies 1
I mean a script that creates FOW area in a server without FOW.
flares and info_nofow entities are the only way to do it
I'm adding a maze to my city life map and I don't want people to see through walls.
edited 1×, last 08.10.11 01:30:34 pm
How many entities to I have to add?
edited 1×, last 08.10.11 01:46:34 pm
The entity will be in the middle of the 3x3 area.
Potentially you could spawn a bot, give it a flare, and then tell it to attack. LOL
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function add_flare(X,Y) 	parse("bot_add") 	parse("setpos "..(#player(0,"table")+1).." "..X.." "..Y) 	parse("equip "..(#player(0,"table")+1).." 54") 	parse("setweapon "..(#player(0,"table")+1).." 54") 	ai_attack(#player(0,"table")+1) 	parse("kick "..(#player(0,"table")+1)) end add_flare(20,20)
Untested, potentially DC could add a function to add any item to a certain position? Like spawnitem, but like spawnitem when thrown? I realize there is that function for the flash grenade (flashlocation), but what about flare (flareloaction), and gas grenade (gaslocation).
With that in-mind it would also be possible to emulate a shot from a weapon set at a certain location and rotation.
Potentially using your idea you can design a maze system, covering the unseen spots with the black tile, and remove it when it is in sight.
Remember that image() can take another parameter, allowing certain players to see the image and others can't.
Though if its possible u need a series of dynamic and static(non viewable) tiles and have them properly syncd etc..
Difficulty: Extremely Difficult
You can find which tile a player is looking at with ease:
1
2
3
4
5
6
7
2
3
4
5
6
7
player_x = player(id,"tilex") player_y = player(id,"tiley") pivot = math.pi /180 looking_x = player_x + math.cos(player(id,"rot")/pivot) looking_y = player_y + math.sin(player(id,"rot")/pivot)
1