AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Flashlight in HLSDK (https://forums.alliedmods.net/showthread.php?t=243025)

klippy 06-28-2014 13:41

Flashlight in HLSDK
 
Hello AlliedModders!
Maybe this is the wrong forum to post this into, but I couldn't find better place for this question(maybe in Off-Topic forum?).

Anyway, I can't seem to find how is flashlight handled in game. I guess it is purely done client-side, but I am still not sure.
I don't really think it is Dynamic Light (TE_DLIGHT tempentity) because when you create an DLight near the wall, it also lights other side of the wall, while that is not possible with the flashlight. I also tried with ELight, but it only lights entities up.
So after searching server-side stuff in HLSDK(dlls folder and few others) I began to search on client-side files(cl_dll). There is flashlight.cpp, but it is only for flashlight as a HUD element(in the upper right corner of the screen). So, is there a code in HLSDK that shows how flashlight works? I need it to create a flashlight but with a little bit more features, and with DLight you could update its position only once every 0.1 seconds, but real flashlight updates in real time, which makes me think it is handled client-side.
Thanks in advance. :)

4dead 06-28-2014 20:58

Re: Flashlight in HLSDK
 
Check those 3 lines
Edit : This ?

klippy 06-28-2014 22:26

Re: Flashlight in HLSDK
 
Quote:

Originally Posted by 4dead (Post 2158993)

I've seen that already, but that code only adds EF_DIMLIGHT effect and updates HUD, but it doesn't create flashlight effect.

klippy 08-05-2014 07:07

Re: Flashlight in HLSDK
 
Bump, I still need it. :)
I am about entirely sure it is handled client-side, since when someone turns his flashlight on, only he could see it, and other players can only see EF_DIMLIGHT on him.

meTaLiCroSS 08-06-2014 01:42

Re: Flashlight in HLSDK
 
Every visual effect is handled client-side. It's the same as sending a temp entity message, but this is added in a big packet (which is handled by AddToFullPack, then engine does the work). The EF_DIMLIGHT has 2 effects on client, if it's the player who owns it, the flashlight will be turned on in his screen; if isn't, you'll see a little aura sphere. Anyway, if flashlight radius and color were able to be modified, you wouldn't be searching it.

klippy 08-06-2014 06:44

Re: Flashlight in HLSDK
 
Yes, I knew that these network messages are all handled client-side, but still I didn't know that much about EF_DIMLIGHT. Thank you!


All times are GMT -4. The time now is 06:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.