Hmm, I'll need to think on that one, but it'll be easy enough I think.
BUT, do you want it to "
need to press left mouse button" to move them, or
just purely on contact?
[EDIT]Heres the code update to make the enemy move when "hit" by attacking hands.
(Making the enemies move when just bumped into too much work. Write a new action to do that.)
WHOLE enemy.c(though only one "paragraph" added)
action enemy_dummy()
{
set(my,SHADOW);
my.entity_type = 2;
my.emask |= ENABLE_SCAN;
while(1)
{
if(my.hit_by_player == 1) //sucessful attack by player weapon
{
my.move_x = player.move_x;
my.move_y = player.move_y;
my.move_z = player.move_z;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if(player.animblend == blend || player.animblend < attack_a || my.animblend > attack_f) my.hit_by_player = 0;
}
else if(my.hit_by_player == 2) //sucessful HAND attack by player
{
my.move_x = player.move_x;
my.move_y = player.move_y;
my.move_z = player.move_z;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if(player.animblend == blend || player.animblend < attack_a || my.animblend > attack_f) my.hit_by_player = 0;
}
if((player.animblend >= stand && target_enemy == me && player_lock_on == 0) && (player.animblend < attack_a || player.animblend > attack_f))
target_enemy = NULL;
if(target_enemy == my && vec_dist(my.x, player.x) > 200)
target_enemy = NULL;
wait(1);
}
}
PARTIAL player.c(two functions to replace handle_sword_collisions(), found at end of script)
function handle_hand_collision()
{
vec_for_vertex(tempV.x, player, 1146); //thumb tip
vec_for_vertex(tempV2.x, player, 1144); //thumb joint
result = c_trace(tempV.x, tempV2.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX);
if(you != NULL)
{
if(you.entity_type == 2 && you.hit_by_player == 0)
{
if(airborne_attack == 1 && my.animblend == attack_a) my.movement_mode = 2;
you.hit_by_player = 2;
if(target_enemy == NULL) { target_enemy = you; player_lock_on = 1; }
}
}
}
function handle_sword_collision()
{
you = NULL;
if(player_weapon==NULL) { handle_hand_collision(); return; }
vec_for_vertex(tempV.x, player_weapon, 274); //sword base
vec_for_vertex(tempV2.x, player_weapon, 54); //sword tip
result = c_trace(tempV.x, tempV2.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX);
if(you != NULL)
{
if(you.entity_type == 2 && you.hit_by_player == 0)
{
if(airborne_attack == 1 && my.animblend == attack_a) my.movement_mode = 2;
you.hit_by_player = 1;
if(target_enemy == NULL) { target_enemy = you; player_lock_on = 1; }
}
}
}