English What Does The fow_in Function Do

6 replies
Goto Page
To the start Previous 1 Next To the start
Up
Mami Tomoe
User
Offline Off
While snooping around with CS2D I found a function called
fow_in
, but I do not know what it does.

Does anybody know?
Does this script come with insurance?
24.09.21 03:34:09 pm
Up
mrc
User
Offline Off
Yes, I know. But I don't wanna do that.
CS2DBR @ Comunidade Brasileira de CS2D | https://www.cs2dbr.com
24.09.21 07:17:48 pm
Up
DC
Admin
Offline Off
Oh interesting. It's not documented.
It checks if something is inside fog of war or not.
parameters:
• player ID (it checks if the coordinate is inside the visible area of THAT specific player)
• X coordinate to check (in pixels, not tiles)
• Y coordinate to check (in pixels, not tiles)

returns:
0: coordinate is NOT covered by fog of war (= visible)
1: coordinate IS covered by / is inside the fog of war (= invisible)
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
25.09.21 04:41:58 am
Up
Cure Pikachu
User
Offline Off
@user DC: Does that function always return 0 if fog of war is disabled?
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
25.09.21 09:00:40 am
Up
Masea
Super User
Offline Off
Jesus Christ, user DC. I even asked for that in the ideas thread back in the day. Also remember user Rainoth was against the idea because he didn't get the point of such a function and he claimed you can do a very similar checker with just basic Lua on your own. I always thought it'd be cool to have it in the original game since it is kinda expensive to do it yourself (also would be less accurate). I wish it was documented all these years, can't imagine how many beautiful things you could have done with it...
Shit your pants: file cs2d Outlast II Mod (29) | Create your UI faster: CS2D UI Framework
25.09.21 09:57:59 am
Up
SQ
Moderator
Offline Off
@user Masea: I've added it not long ago. Probably in the last version.
I might have looked at old ideas thread at that time and this seemed like easy implementation to do.
Took a few minutes.
25.09.21 11:11:46 am
Up
DC
Admin
Offline Off
Documented!
cs2d lua cmd fow_in
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
To the start Previous 1 Next To the start