Forum

> > CS2D > Scripts > FOW area
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch FOW area

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt FOW area

if
User Off Offline

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

alt Re: FOW area

if
User Off Offline

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

alt Re: FOW area

DC
Admin Off Offline

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

alt Re: FOW area

if
User Off Offline

Zitieren
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.
1× editiert, zuletzt 08.10.11 13:30:34

alt Re: FOW area

if
User Off Offline

Zitieren
3*3 means 3 tiles wide?
How many entities to I have to add?
1× editiert, zuletzt 08.10.11 13:46:34

alt Re: FOW area

Yates
Reviewer Off Offline

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

alt Re: FOW area

Apache uwu
User Off Offline

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

alt Re: FOW area

cortz
Super User Off Offline

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

alt Re: FOW area

Apache uwu
User Off Offline

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

alt Re: FOW area

cortz
Super User Off Offline

Zitieren
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

alt Re: FOW area

DannyDeth
User Off Offline

Zitieren
@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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht