how to get the level of light.

Posted By: tzw

how to get the level of light. - 08/28/11 03:30

hi~again. i wanna do a splinter cell-like light bar.but i don't know how to get the level of light at a postion. i've already looked into the aum 32.but i don't know how to do this in a8?
thanks in advance. laugh
Posted By: snake67

Re: how to get the level of light. - 08/28/11 11:31

Hi

I do something like that in my game. The code is integrated in the movement routine where it traces for the ground. The "c_trace" is done with "SCAN_TEXTURE" set. The varibale "tex_light" afterwarts contains brightness below player entity.
Posted By: tzw

Re: how to get the level of light. - 08/28/11 12:24

yep i've tried this. but seem the var is not correct. when the hero is at a very dark place.the var's value still very high. and the hero stand below a hi-res light ,the var's value even slower than in the dark one......
i'm confused
Posted By: 3run

Re: how to get the level of light. - 08/28/11 15:35

Explain what you are trying to do. You can use hit.blue to with TRACE under player's feet (with SCAN_TEXTURE), but that works only with static ones.
For dynamic lights use "ent_nextlight", but I have no idea how to combine results from them...
Posted By: tzw

Re: how to get the level of light. - 08/29/11 00:17

yes !!!
use ent_nextlight and a for loop combine hit.blue can get result...
thx.

or a simple way, just check the cloest light'value



© 2024 lite-C Forums