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. :) |
Re: Flashlight in HLSDK
|
Re: Flashlight in HLSDK
Quote:
|
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. |
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.
|
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.