Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem mit trace(vectorfrom,vectorto) #224625
08/31/08 12:29
08/31/08 12:29
Joined: Aug 2008
Posts: 43
Germany, Baden-Württemberg
M
Mageron Offline OP
Newbie
Mageron  Offline OP
Newbie
M

Joined: Aug 2008
Posts: 43
Germany, Baden-Württemberg
Hallo, habe folgendes Problem:

VIEW Sicht
{
layer = 1;
pos_x = 0;
pos_y = 0;
size_x = 800;
size_y = 600;
offset_x = 0;
offset_y = 0;
arc = 45;
aspect = 1;
fog = 70;
flags = visible;
}

ACTION Player
{
WHILE(1)
{
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);

temp.x = mouse_pos.x;
temp.y = mouse_pos.y;
temp.z = 0;
vec_for_screen(temp,Sicht);
trace_mode = ignore_me + ignore_passable + activate_shoot +
use_box;
on_mouse_left = Trace(my.x,temp);
WAIT(1);
}
}

FUNCTION Treffer()
{
if(event_type == event_shoot)
{
vec_to_angle(my.pan,you.x);
}
}

ACTION Feind
{
WHILE(1)
{
my.enable_shoot = on;
my.event = Treffer;
WAIT(1);
}
}

Die Probleme: 1. Wenn ich die linke Maustaste drücke, passiert nichts.
2. Nur wenn ich direkt neben dem Feindmodell stehe, passiert was, die Engine stürzt ab.
Kann mir jemand helfen?

Last edited by Mageron; 08/31/08 18:00.
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
M
Mageron Offline OP
Newbie
Mageron  Offline OP
Newbie
M

Joined: Aug 2008
Posts: 43
Germany, Baden-Württemberg
Sorry, I'm again here grin

Now, I have another problem. Here is the Code:

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 grin
hier ist das Problem:
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);
 }
 
}


Wenn ich also die linke Maustaste drücke und der Feind in der Mitte des Mauszeigers ist, passiert nix! Erbitte Hilfe!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1