Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood), 1,268 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Event doesn't start #232011
10/18/08 19:15
10/18/08 19:15
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
Does anyone know why the event doesn't start?
Code:
 ACTION I_Warhound
{
 var Gesundheit = 100;
 var Bewegung;
 var Gravitation;
 var Distanz_zum_Boden;
 var Laufgeschwindigkeit = 40;      // Grundwert
 var Drehgeschwindigkeit = 5;       // Grundwert
 var Animationsfortschritt = 0;     // Grundwert
 var Animationsgeschwindigkeit = 10; // Grundwert
 my.shadow = on;
 my.push = 10;
 WHILE(1)
 {
 	c_setminmax(me);
  //Gravitation
  
  Distanz_zum_Boden = c_trace(my.x,vector(0,0,-4000),ignore_me | ignore_sprites | ignore_models | use_box);
  Gravitation.z = -Distanz_zum_Boden;
  Gravitation.z = max (-250 * time, Gravitation.z);
  // rennen
  Bewegung.x = Laufgeschwindigkeit * (key_w  - key_s) * time;
  Bewegung.y = 0;
  my.pan    += Drehgeschwindigkeit * (key_a  - key_d) * time;

  if (Bewegung.x != 0)
  {
   Animationsgeschwindigkeit = 3;
   ent_cycle("walk", Animationsfortschritt);
  }
  else
  {
   Animationsgeschwindigkeit = 6;
   ent_cycle("stand", Animationsfortschritt);
  }
  Animationsfortschritt += Animationsgeschwindigkeit * time;

 

  c_move(me,Bewegung, nullvector,glide | ignore_passable);
  c_move(me,Gravitation,nullvector,glide);
  
  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);
  
  
  WAIT(1);
 }
 
}

//////////////////////////////////
// Events
//////////////////////////////////

//////////////////////////////////
// Event Gegner
//////////////////////////////////

FUNCTION Gegner()
{

	if(event_type == event_shoot ){
		ent_remove(my);
	}
	if(event_type == event_push){
		ent_remove(my);
	}

}

ACTION Feind
{  my.push = 5;
  var Gravitation;
 var Distanz_zum_Boden;
 WHILE(1){
 	Distanz_zum_Boden = c_trace(my.x,vector(0,0,-4000),ignore_me | ignore_sprites | ignore_models | use_box);
  Gravitation.z = -Distanz_zum_Boden;
  Gravitation.z = max (-250 * time, Gravitation.z);
 	
	c_move(me,Gravitation,nullvector,glide);
	my.enable_push = on;
	my.event = Gegner;
	WAIT(1);
}
}


mfG
Benny

Re: Event doesn't start [Re: Mageron] #232104
10/19/08 14:48
10/19/08 14:48
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
my.emask |= ENABLE_SHOOT;

i think you need something like this at the beginning of your code

plus now that i look closer that looks like wdl code not lite c


Last edited by badapple; 10/20/08 01:54.
Re: Event doesn't start [Re: badapple] #232289
10/20/08 23:01
10/20/08 23:01
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi Mageron!

Try putting your line event :
my.event = Gegner;

outside the while loop.

Ottawa

Re: Event doesn't start [Re: Ottawa] #232392
10/21/08 16:42
10/21/08 16:42
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
Thank you Ottawa, now it works!


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

Gamestudio download | chip programmers | 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