entity passable! help

Posted By: gagamBRYAN

entity passable! help - 02/10/09 12:10

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!
Posted By: Kaizen_31

Re: entity passable! help - 02/10/09 12:41

only the back stabbing part??
why will happen when your character attacks your AI in front??
ahmmm...

try to post your sample code..
Posted By: Widi

Re: entity passable! help - 02/10/09 17:17

set(my,POLYGON)
Posted By: MrGuest

Re: entity passable! help - 02/11/09 00:17

i think you need to change the size of your bounding box to include the weapon

c_setminmax(ent); but create a dummy model around the whole entity
Posted By: gagamBRYAN

Re: entity passable! help - 02/11/09 08:14

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:
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
Posted By: Jaxas

Re: entity passable! help - 02/11/09 09:44

try c_updatehull wink
Posted By: gagamBRYAN

Re: entity passable! help - 02/11/09 09:59

@Jaxas: how? i don't know how to put it in my code..
Posted By: Jaxas

Re: entity passable! help - 02/11/09 14:57

else you can try to change entity.max_x or y or z. I use it when my player is crouching smile

example:

if(key_cud )
{
my.max_z = 20;
}
else
{
my.max_z = 50;
}
© 2024 lite-C Forums