1 registered members (TipmyPip),
18,709
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Problem mit trace(vectorfrom,vectorto)
[Re: Mageron]
#226523
09/10/08 06:49
09/10/08 06:49
|
Joined: Aug 2008
Posts: 43 Germany, Baden-Württemberg
Mageron
OP
Newbie
|
OP
Newbie
Joined: Aug 2008
Posts: 43
Germany, Baden-Württemberg
|
Sorry, I'm again here Now, I have another problem. Here is the Code: FUNCTION Event_Feind()
{
// Primärwaffe
if (event_type == event_sonar)
{
my.skill5 -= you.skill7;
if(my.skill5 <= 0)
{
ent_remove(my);
}
}
//Sekundär
if (event_type == event_shoot)
{
my.skill5 -= you.skill8;
if(my.skill5 <= 0)
{
sleep(3);
ent_remove(my);
}
}
if(event_type == event_push)
{
vec_to_angle(my.pan,bounce);
my.skill6 -= you.push - my.push;
if(my.skill6 <= 0)
{
my.skill5 -= you.push - my.push;
}
if(my.skill5 <= 0)
{
ent_remove(my);
}
}
WAIT(1);
}
ACTION I_Warhound
{
my.frame = 1;
my.push = 10;
WHILE(1)
{
my.skill1 = 1;
force.pan = -10 * key_force.x;
my.skill14 = time * force.pan + max(1-time*0.7,0) * my.skill14;
my.pan += time * my.skill14;
vec_set(temp,my.x);
temp.z = -4000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
result = trace(my.x,temp);
if (result > 5)
{
force.x = 0;
force.y = 0;
force.z = -0.5 * result;
friction = 0.5;
}
else
{
force.x = 5 * key_force.y;
force.y = 0;
force.z = -2 * result;
friction = 0.5;
if(force.x == 5){ my.frame += time * 0.2;
if(my.frame > 7)
{
my.next_frame = 1;
}
else
{
my.next_frame = 0;
}
if(my.frame >= 8)
{
my.frame -= 5;
}
}
if(force.x == -5){ my.frame += time * 0.2;
if(my.frame > 7)
{
my.next_frame = 1;
}
else
{
my.next_frame = 0;
}
if(my.frame >= 8)
{
my.frame -= 5;
}
}
}
my.skill11 = time * force.x + max(1-time*friction,0) * my.skill11;
my.skill13 = time * force.z + max(1-time*friction,0) * my.skill13;
dist.x = time * my.skill11;
dist.y = 0;
dist.z = time * my.skill13;
move_mode = ignore_passable + glide;
ent_move(dist,nullvector);
Plasmaabschuss.x = my.x + 20;
Plasmaabschuss.y = my.y + 10;
Plasmaabschuss.z = my.z - 5;
vec_diff(temp,nullvector,sicht_dist);
vec_to_angle(sicht_ang,temp);
sicht_ang.tilt = -10;
vec_set(Sicht.x,sicht_dist);
vec_rotate(Sicht.x,my.pan);
vec_add(Sicht.x,my.x);
vec_set(Sicht.pan,sicht_ang);
ang_add(Sicht.pan,my.pan);
on_p = Camera_Wechsel;
on_m = menue_aufruf;
my.enable_push = on;
my.enable_shoot = on;
WHILE(key_pressed(280) == 1)
{
temp.x = mouse_pos.x;
temp.y = 0;
temp.z = 250 + mouse_pos.y;
vec_for_screen(temp,Sicht);
trace_mode = ignore_me + ignore_passable + activate_sonar + use_box;
trace(my.x,temp);
WAIT(1);
}
WHILE(key_pressed(281) == 1)
{
temp.x = mouse_pos.x;
temp.y = 0;
temp.z = 250 + mouse_pos.y;
vec_for_screen(temp,Sicht);
trace_mode = ignore_me + ignore_passable + activate_shoot + use_box;
trace(my.x,temp);
WAIT(1);
}
WAIT(1);
}
} If I press the left mousekey with the Enemy in the middle of the mouse, nothing happens! Please help! Auf Deutsch: Ich bins schon wieder  hier ist das Problem: FUNCTION Event_Feind()
{
// Primärwaffe
if (event_type == event_sonar)
{
my.skill5 -= you.skill7;
if(my.skill5 <= 0)
{
ent_remove(my);
}
}
//Sekundär
if (event_type == event_shoot)
{
my.skill5 -= you.skill8;
if(my.skill5 <= 0)
{
sleep(3);
ent_remove(my);
}
}
if(event_type == event_push)
{
vec_to_angle(my.pan,bounce);
my.skill6 -= you.push - my.push;
if(my.skill6 <= 0)
{
my.skill5 -= you.push - my.push;
}
if(my.skill5 <= 0)
{
ent_remove(my);
}
}
WAIT(1);
}
ACTION I_Warhound
{
my.frame = 1;
my.push = 10;
WHILE(1)
{
my.skill1 = 1;
force.pan = -10 * key_force.x;
my.skill14 = time * force.pan + max(1-time*0.7,0) * my.skill14;
my.pan += time * my.skill14;
vec_set(temp,my.x);
temp.z = -4000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
result = trace(my.x,temp);
if (result > 5)
{
force.x = 0;
force.y = 0;
force.z = -0.5 * result;
friction = 0.5;
}
else
{
force.x = 5 * key_force.y;
force.y = 0;
force.z = -2 * result;
friction = 0.5;
if(force.x == 5){ my.frame += time * 0.2;
if(my.frame > 7)
{
my.next_frame = 1;
}
else
{
my.next_frame = 0;
}
if(my.frame >= 8)
{
my.frame -= 5;
}
}
if(force.x == -5){ my.frame += time * 0.2;
if(my.frame > 7)
{
my.next_frame = 1;
}
else
{
my.next_frame = 0;
}
if(my.frame >= 8)
{
my.frame -= 5;
}
}
}
my.skill11 = time * force.x + max(1-time*friction,0) * my.skill11;
my.skill13 = time * force.z + max(1-time*friction,0) * my.skill13;
dist.x = time * my.skill11;
dist.y = 0;
dist.z = time * my.skill13;
move_mode = ignore_passable + glide;
ent_move(dist,nullvector);
Plasmaabschuss.x = my.x + 20;
Plasmaabschuss.y = my.y + 10;
Plasmaabschuss.z = my.z - 5;
vec_diff(temp,nullvector,sicht_dist);
vec_to_angle(sicht_ang,temp);
sicht_ang.tilt = -10;
vec_set(Sicht.x,sicht_dist);
vec_rotate(Sicht.x,my.pan);
vec_add(Sicht.x,my.x);
vec_set(Sicht.pan,sicht_ang);
ang_add(Sicht.pan,my.pan);
on_p = Camera_Wechsel;
on_m = menue_aufruf;
my.enable_push = on;
my.enable_shoot = on;
WHILE(key_pressed(280) == 1)
{
temp.x = mouse_pos.x;
temp.y = 0;
temp.z = 250 + mouse_pos.y;
vec_for_screen(temp,Sicht);
trace_mode = ignore_me + ignore_passable + activate_sonar + use_box;
trace(my.x,temp);
WAIT(1);
}
WHILE(key_pressed(281) == 1)
{
temp.x = mouse_pos.x;
temp.y = 0;
temp.z = 250 + mouse_pos.y;
vec_for_screen(temp,Sicht);
trace_mode = ignore_me + ignore_passable + activate_shoot + use_box;
trace(my.x,temp);
WAIT(1);
}
WAIT(1);
}
} Wenn ich also die linke Maustaste drücke und der Feind in der Mitte des Mauszeigers ist, passiert nix! Erbitte Hilfe!
|
|
|
|