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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, Akow, monk12), 1,413 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem: Emty Pointer #230306
10/04/08 17:18
10/04/08 17:18
Joined: Feb 2008
Posts: 85
Germany
Schloder87 Offline OP
Junior Member
Schloder87  Offline OP
Junior Member

Joined: Feb 2008
Posts: 85
Germany
I GOT A PROBLEM with this action, i always get an EMTY POINTER when i start it.


action enemy_fight // attached to the enemy
{

enemy = me; // I'm the enemy
enemy.healthpoints = 100; // and I have 100 healthpoints
c_setminmax(me);
vec_set(temp, enemy.x);
temp.z -= 4000;
Distanz_zum_Boden = c_trace (my.x, temp.x, ignore_me | use_box | ignore_passable);
Gravitation.z =- Distanz_zum_Boden; // Fuesse der Spielerfigur auf Boden setzen
Gravitation.z = max (-50 * time_step, Gravitation.z); // 25 = Fallgeschwindigkeit

while (my.healthpoints > 0) // as long as I'm alive
{you = null;

if (vec_dist (my.x, player.x) < 500 && player.healthpoints > 0) // the player approaches the enemy
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0; // I'm a maniac smile
enemy_distance.x = 6 * time_step;
enemy_distance.y = 3* time_step;
enemy_distance.z = 0;

c_move (my, Gravitation, nullvector, ignore_passable);
c_move (my, enemy_distance, nullvector, glide | ignore_passable);


ent_cycle("run", my.skill19); // play walk frames animation


my.skill19 += 7 * time; // "walk" animation speed
if (my.skill19 > 100) {my.skill19 = 0;} // loop animation
if (vec_dist (my.x, player.x) < 60) // if the player comes closer than 50 quants attack him
{
my.skill20 = 0; // reset "attack" frames
while (my.skill20 < 100)
{
ent_vertex(my.sword_tip, 1256); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 1114); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable;
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // hit something, could be the player or another enemy
{

if (you != null) {you.healthpoints -= 4 * time;
effect (particle_blood, 1, target, normal);}
}
ent_cycle("punch", my.skill20); // play attack frames animation
my.skill20 += 5 * time; // "attack" animation speed
wait (1);
}
waitt (6); // slows down the enemy and reduces the number of traces per second
}

}
else // the player is farther than 200 quants away
{
ent_cycle("idle", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}
wait (1);
}
while (my.skill22 < 80) // the enemy is dead
{

my.event = null;
my.enable_shoot = on;
my.enable_scan = on;
ent_cycle("die", my.skill22);
my.skill22 += 6 * time;
wait(1);}
my.passable = on;
wait(90);

blutlache();

}


Visit IGRAVISION at: http://www.igravision.com
_________________________
Re: Problem: Emty Pointer [Re: Schloder87] #230396
10/05/08 10:01
10/05/08 10:01
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
action enemy_fight // attached to the enemy
{

enemy = me; // I'm the enemy
enemy.healthpoints = 100; // and I have 100 healthpoints
c_setminmax(me);
vec_set(temp, enemy.x);
temp.z -= 4000;
Distanz_zum_Boden = c_trace (my.x, temp.x, ignore_me | use_box | ignore_passable);
Gravitation.z =- Distanz_zum_Boden; // Fuesse der Spielerfigur auf Boden setzen
Gravitation.z = max (-50 * time_step, Gravitation.z); // 25 = Fallgeschwindigkeit

while(!player) { wait(1); }

while (my.healthpoints > 0) // as long as I'm alive
{you = null;

if (vec_dist (my.x, player.x) < 500 && player.healthpoints > 0) // the player approaches the enemy
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0; // I'm a maniac smile
enemy_distance.x = 6 * time_step;
enemy_distance.y = 3* time_step;
enemy_distance.z = 0;

c_move (my, Gravitation, nullvector, ignore_passable);
c_move (my, enemy_distance, nullvector, glide | ignore_passable);


ent_cycle("run", my.skill19); // play walk frames animation


my.skill19 += 7 * time; // "walk" animation speed
if (my.skill19 > 100) {my.skill19 = 0;} // loop animation
if (vec_dist (my.x, player.x) < 60) // if the player comes closer than 50 quants attack him
{
my.skill20 = 0; // reset "attack" frames
while (my.skill20 < 100)
{
ent_vertex(my.sword_tip, 1256); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 1114); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable;
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // hit something, could be the player or another enemy
{

if (you != null) {you.healthpoints -= 4 * time;
effect (particle_blood, 1, target, normal);}
}
ent_cycle("punch", my.skill20); // play attack frames animation
my.skill20 += 5 * time; // "attack" animation speed
wait (1);
}
waitt (6); // slows down the enemy and reduces the number of traces per second
}

}
else // the player is farther than 200 quants away
{
ent_cycle("idle", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}
wait (1);
}
while (my.skill22 < 80) // the enemy is dead
{

my.event = null;
my.enable_shoot = on;
my.enable_scan = on;
ent_cycle("die", my.skill22);
my.skill22 += 6 * time;
wait(1);}
my.passable = on;
wait(90);

blutlache();

}


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