Posted By: deianthropus
alpha along vector (SOLVED!) - 07/23/10 21:43
EDIT: I just realized that just because C-trace runs, "you" is not necessarily set. Here's what I've come up with. Any entity without flag2 or skill30 is made translucent, and multiple obstructions can be made translucent.
That's it. Done deal.
(In case you're interested, here's the original question:)
I need to make translucent everything between the ball and camera. The code I have only hangs the program at startup. once I can set the opacity, I need to return the entity's alpha to is original opacity (not yet in code).
here's what I have:
also: putting a wait() function between setting translucency and alpha does not fix the hang-up.
Code:
function transpar_vector() { if(c_trace(vector(camera.x,camera.y,camera.z),vector(ball.x,ball.y,ball.z),USE_BOX|IGNORE_FLAG2)) { if (you) { if(!you.skill30) { set(you,TRANSLUCENT); set(you,FLAG2); you.alpha = 50; wait(1); reset(you,TRANSLUCENT); reset(you,FLAG2); } } wait(2); transpar_vector(); } wait(1); }
That's it. Done deal.
(In case you're interested, here's the original question:)
I need to make translucent everything between the ball and camera. The code I have only hangs the program at startup. once I can set the opacity, I need to return the entity's alpha to is original opacity (not yet in code).
here's what I have:
Code:
function transparency_along_vector() { VECTOR* stvec = vector(camera.x,camera.y,camera.z); VECTOR* tracer = vector(ball.x,ball.y,ball.z); c_trace(stvec,tracer,IGNORE_FLAG2 ); //ball object is flag2 if(trace_hit) { set(you,TRANSLUCENT); you.alpha = 50; wait(1); } }
also: putting a wait() function between setting translucency and alpha does not fix the hang-up.