Hello all,
please, I have a little doubt: I made an action and set up an entity to it:
#define TIPO_OBJETO skill57 //type of object, for other tests
ENTITY* entObstaculo; //entity for traps
action acao_obst_rampa1 (){
while (!player){
wait(1);
}
entObstaculo = my;
my.TIPO_OBJETO = 4;
while (1){
my.pan += 1 * time_step;
wait(1);
}
}
I put this script into 2 of my models. As the command says, it needs to keeps rotating into pan angle. Simple.
Ok so far... but, inside my player script I put some commands to show a text when the player hits the model from above:
VECTOR temp[3];
var dist_chao; //distance to ground
vec_set(temp.x, my.x);
temp.z -= 5000;
dist_chao = c_trace(my.x, temp.x, IGNORE_PASSABLE);
if (hit.entity == entObstaculo){
set (mypanel, VISIBLE);
} else {
reset (mypanel, VISIBLE);
}
The "mypanel" panel only appears in the second model my player touches. In my point fo view, it is like the engine is setting the entObstaculo ENTITY first defined into first model and then it replaces into the second model.
Somebody can explain this, please?!
Why my pointer cant recognize my 2 entities? Do I need to create one entity for each model I have?
Example:
ENTITY* model1; //then I place this in model 1
ENTITY* model2; //then I place this in model 2