Heya people~
I've got a question and I hope you're able to help me.
First: I hope you've ever played Star Ocean 3 that might help you answering.
I want to make a camerasystem like in Star Ocean 3.
The Camera code isn't the problem to be honest, I already finished it.
my problem are the walls in interiors like houses and dungeons.
My Problem:
The green triangle is the field of view, just that you can get a feeling for the perspective.
the yellow line is a trace between the camera and the player.
now all i wanna do is the following:
If there is a wall between the camera and the player (like in the picture above) the wall which is beeing "traced" by the trace should disappear.
I already managed to do that but now I need to check whether the wall is being traced or not. Because if the wall is being traced it should disappear, If it's not the wall should fade back in.
now my question is, is there any possibility to check if an entity is being traced or not?
I already figured out that c_scan won't work for that, because my walls are map entity's and the origin of the wall is in the middle of the map entity. and c_scan scans only for the origin right?
at the moment my code looks roughly like this:
in the camera code:
...
while(1)
{
c_trace(vector(camera.x,camera.y,camera.z-100),charakter.x,IGNORE_ME | IGNORE_MODELS | IGNORE_SPRITES | ACTIVATE_SHOOT);
wait(1);
}
...
the wall holds this action
action fade_me()
{
my.emask |= ENABLE_SHOOT;
my.event = fading;
}
and is refering to
function fading()
{
if(event_type == EVENT_SHOOT)
{
my.flags = TRANSLUCENT;
while(my.alpha >= 0)
{
my.alpha -= 10* time_step;
wait(1);
}
}
}
so far it works.
now i need to check something like
if the wall is not being traced
> fade in again
*some while(my.alpha < 100){my.alpha += 10 * time_step; wait(1);}-stuff*
hope you can help me out here
greetings~ Roxas