|
2 registered members (steyr, alibaba),
534
guests, and 4
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Entity should be visible behind a wall / "Wall hack"
[Re: darkinferno]
#299076
11/21/09 03:04
11/21/09 03:04
|
Joined: Aug 2002
Posts: 2,183 Germany, BaW�
Rondidon
OP
Expert
|
OP
Expert
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
|
Yes, but it should be visible above both models and level geometry. Is this possible? This is you, the wall, and the sprite: o | x The sprite should be visible even when hidden by a wall like in my illustration. I want to script a lense flare effect that slowly fades out when it gets behind a wall. This looks smoother than most of the other methods. And it has the pro that you can use 3D glasses with lense flares activated. Now is this possible  ?
Last edited by Rondidon; 11/21/09 03:22.
|
|
|
Re: Entity should be visible behind a wall / "Wall hack"
[Re: Rondidon]
#299158
11/21/09 21:49
11/21/09 21:49
|
Joined: Aug 2002
Posts: 2,183 Germany, BaW�
Rondidon
OP
Expert
|
OP
Expert
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
|
Okay now here`s my code. It works, but still just for one entity. Is it possible to get it working for more than one entity using the same action? If so, how? EDIT: Got it. It was quite easy. You can watch and use the code shown further down. Another problem: The flare varies its size depending on the screen resolution. If I try to manage this problem by varying the size_x / size_y variable of the panel, it doesn`t show anymore. Is this a coding error of me? Is there any other solution out there away from using Entities?
action adr_flarewhite()
{
proc_mode = PROC_LATE;
PANEL* flare;
STRING* flare_white = { bmap = "lens_white.tga"; flags = TRANSLUCENT; layer = 1; alpha = 0; }
flare = pan_create(flare_white,1);
var flarepos[3];
set(my,INVISIBLE|PASSABLE);
while(1)
{
vec_set(flarepos,my.x);
result = c_trace(camera.x,my.x,IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_CONTENT|USE_AABB);
if((result == 0) && (vec_to_screen(flarepos,camera) != NULL) )
{
set(flare,SHOW);
while(flare.alpha<40)
{
vec_set(flarepos,my.x);
vec_to_screen(flarepos,camera);
flare.pos_x = flarepos[0]-64;
flare.pos_y = flarepos[1]-64;
flare.alpha += 10*time_step;
wait(1);
}
vec_set(flarepos,my.x);
vec_to_screen(flarepos,camera);
flare.pos_x = flarepos[0]-64;
flare.pos_y = flarepos[1]-64;
}
else
{
while(flare.alpha>0)
{
vec_set(flarepos,my.x);
vec_to_screen(flarepos,camera);
flare.pos_x = flarepos[0]-64;
flare.pos_y = flarepos[1]-64;
flare.alpha-=10*time_step;
wait(1);
}
reset(flare,SHOW);
}
wait(1);
}
}
Last edited by Rondidon; 11/21/09 22:43. Reason: The solution
|
|
|
|