Forum

> > CS2D > Scripts > FOW area
Forums overviewCS2D overview Scripts overviewLog in to reply

English FOW area

13 replies
To the start Previous 1 Next To the start

old FOW area

if
User Off Offline

Quote
Is it possible to create a area where there is FOW and the rest isn't?

old Re: FOW area

if
User Off Offline

Quote
LoL,
I mean a script that creates FOW area in a server without FOW.

old Re: FOW area

DC
Admin Off Offline

Quote
no, this is not possible via script.
flares and info_nofow entities are the only way to do it

old Re: FOW area

if
User Off Offline

Quote
does this no_fow act like a flare or effects the whole map?
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

old Re: FOW area

if
User Off Offline

Quote
3*3 means 3 tiles wide?
How many entities to I have to add?
edited 1×, last 08.10.11 01:46:34 pm

old Re: FOW area

Yates
Reviewer Off Offline

Quote
1 for a 3x3 area
The entity will be in the middle of the 3x3 area.

old Re: FOW area

Apache uwu
User Off Offline

Quote
Urm, see through walls? You can already see through with fog, that's only if you turn alpha up or down.

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
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.

old Re: FOW area

cortz
Super User Off Offline

Quote
Use black map sprites to cover the area fow isnt needed nor any scripts

old Re: FOW area

Apache uwu
User Off Offline

Quote
Smart, however in a multi-player game there is still need for scripts.

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.

old Re: FOW area

cortz
Super User Off Offline

Quote
I dont think u can detect where a player is looking at
Though if its possible u need a series of dynamic and static(non viewable) tiles and have them properly syncd etc..

Difficulty: Extremely Difficult

old Re: FOW area

DannyDeth
User Off Offline

Quote
@Zetroc:
You can find which tile a player is looking at with ease:
1
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)
looking_x and looking_y are the coordinates of the tile directly in front of the player.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview