|
|
entity passable! help
#250865
02/10/09 12:10
02/10/09 12:10
|
Joined: Nov 2008
Posts: 42 Philippines
gagamBRYAN
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 42
Philippines
|
guys,
i have a problem.. with regards to my entity. I have a player but it passes his enemy. i mean when he does the attack animation, specifically the stabbing part his hands pass through the enemy's body.
how to declare it to not become passable?
i'm sure u know the answer to my problem. tnx!
Secrets are stolen from deep inside..
|
|
|
Re: entity passable! help
[Re: MrGuest]
#251007
02/11/09 08:14
02/11/09 08:14
|
Joined: Nov 2008
Posts: 42 Philippines
gagamBRYAN
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 42
Philippines
|
yeah, i try to c_setminmax(ent); it works! however, the player is blinking in the idle state (referring if he reach the point of the location after walking or running). but when i remove the c_setminmax, he perform the idle animation. how to set off the c_setminmax in lite c? here is the sample code:
action player_action()
{
VECTOR temp[3];VECTOR temp2[3];VECTOR temp_target[3];VECTOR pos1[3];VECTOR pos2[3];
var anim_percentage;
vec_set(temp_target,my.x);
while(1)
{
if(mouse_left)
{
while (mouse_left){wait(1);}
pos1.x = mouse_pos.x;pos1.y = mouse_pos.y;pos1.z = 0;
vec_for_screen (pos1, camera);
pos2.x = mouse_pos.x;pos2.y = mouse_pos.y;pos2.z = 20000;
vec_for_screen (pos2, camera);
c_trace (pos1,pos2,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS);
vec_set(temp_target,target);
}
if(vec_dist(my.x,temp_target.x)>20)
{
vec_set(temp.x,temp_target.x);
vec_sub(temp.x,my.x) ;
vec_to_angle(my.pan,temp);
my.tilt=0;
c_move (my, vector(30*time_step,0 , -2), nullvector, IGNORE_PASSABLE | GLIDE);
ent_animate(my, "walk", anim_percentage, ANM_CYCLE);
anim_percentage += 10 * time_step;
}
else
{
ent_animate(my, "idle", anim_percentage, ANM_CYCLE);
anim_percentage += 2 * time_step;
}
wait(1);
}
}
function main()
{
player = ent_create("player.mdl",vector(0,0,0),player_action);
c_setminmax(player);
}
pls help! tnx so much
Secrets are stolen from deep inside..
|
|
|
Re: entity passable! help
[Re: Jaxas]
#251032
02/11/09 09:59
02/11/09 09:59
|
Joined: Nov 2008
Posts: 42 Philippines
gagamBRYAN
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 42
Philippines
|
@Jaxas: how? i don't know how to put it in my code..
Secrets are stolen from deep inside..
|
|
|
Re: entity passable! help
[Re: gagamBRYAN]
#251081
02/11/09 14:57
02/11/09 14:57
|
Joined: May 2008
Posts: 331 Lithuania, Vilnius
Jaxas
Senior Member
|
Senior Member
Joined: May 2008
Posts: 331
Lithuania, Vilnius
|
else you can try to change entity.max_x or y or z. I use it when my player is crouching  example: if(key_cud ) { my.max_z = 20; } else { my.max_z = 50; }
The smaller the bug, the harder it is to kill. _________________________________________ Forklift DEMO (3dgs)
|
|
|
|