Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
need help....... #101254
12/06/06 06:49
12/06/06 06:49
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
i got this error after start to let my char running in the level.
malfunction W1503
invalid array index in enemy: (paths[(my.start_node-1)*50+(target_node-1)*node_id*50+current_node]!=0)
this is a while loop for my AI, it will do everything i code except chase the player.
so i think that the proble is with the run instruction, but i have no idea on fixing the problem
Code:
 

while (paths[(my.start_node - 1) * 50 + (target_node - 1) * node_id * 50 + current_node] != 0) // loop until you encounter the end of the path (a zero)
{
destination_node.x = nodex[paths[(my.start_node - 1) * 50 + (target_node - 1) * node_id * 50 + current_node]]; // get the previously stored coordinates for this node
destination_node.y = nodey[paths[(my.start_node - 1) * 50 + (target_node - 1) * node_id * 50 + current_node]]; // on x and y
destination_node.z = my.z; // use enemy's height for z
while ((vec_dist (destination_node.x, my.x) > 20) && (relax == 0) && (my.free_to_move == 1)) // if the player isn't dead yet
{
vec_set (temp.x, destination_node.x);
vec_sub (temp.x, my.x);
vec_to_angle (my.pan, temp); // turn the enemy towards destination_node
ent_cycle("run", my.skill46); // play "run" frames animation
my.skill46 += 10 * time; // "run" animation speed
my.skill46 %= 100; // loop animation
my.skill1 = 10 * time;
my.skill2 = 0;
my.skill3 = 0;
move_mode = ignore_passable + glide;
result = ent_move(my.skill1, nullvector);
if (result == 0) // got stuck?
{
break; // get out of both while loops, find the path again
}
if (my.gentle == off)
{
if (trace (my.pos, player1.pos) == 0) // if the enemy can see the player
{
break; // get out of the while loop (start shooting as soon as you see the player)
}
}
wait (1);
}
current_node += 1;
if (trace (my.pos, player1.pos) == 0) // if the enemy can see the player
{
break; // get out of the while loop (don't follow the old path anymore)
}
wait (1);
}






---------------------------------------------------------------------------


Code:
 
function decrease_health()
{
// wait(1);
if(you.skill47 == 9999) // collided with the enemy?
{
my.health = 0; // instant death
}
else
// hit by a bullet
{
my.health -= 20;
}
if (my.health <= 0)
{
my.event = null;
snd_play (death_wav, 40, 0);
ent_animate(me, "death", 100, anm_cycle);
}
}


i got an error of empty pointer for you.skill47 == 9999 but i aready set skill47 = 9999 in the eney function
anyone know what s going on?

it can run only when i remove the if(you.skill47 == 9999)
but neither the main charater or the enemy die and i keep seeing bullet go throught my body and hit on the wall.
when i collide with the enemy, both entity stuck and cant be move anymore

-----------------------------------------------------------------------------
anyone can help me with these problem?
thx in advance

Re: need help....... [Re: alex5801] #101255
12/06/06 16:09
12/06/06 16:09
Joined: Nov 2006
Posts: 18
Deutschland, Gelsenkirchen / ...
D
DukE_7009 Offline
Newbie
DukE_7009  Offline
Newbie
D

Joined: Nov 2006
Posts: 18
Deutschland, Gelsenkirchen / ...
Reduce the Skill48 or use another skill.


Come, get some!

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