action ogre_action()
{
...
if(ogre_dead == 0)
{
ent_movepath(me, "path_003", 2, 1+2); // IF I COMMENT
// THIS OUT, THE game_load LOADS FINE.
}
...
}
action knight_action()
{
...
if(knight_dead == 0)
{
my.STATE = 1;
ent_movepath(me, "path_003", 2, 1+2); // IF I COMMENT
// THIS OUT, THE game_load WORKS FINE.
}
if(knight_dead == 1)
{
my.STATE = 4;
ent_movepath(me, NULL, NULL, NULL); // IF I COMMENT
// THIS OUT, THE game_load WORKS FINE.
}
while (1)
{
knight_loc();
knight_health();
// state 1: wait until player comes close enough //////
if(my.STATE == 1)
{
my.tilt = 0;
my.z = -544;
my.ANIMATION += 3*time_step;
ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
// detect all FLAG2 entities within 750
// quants
c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
if (you) // player detected?
{
my.tilt = 0;
my.z = -544;
ent_movepath(my,NULL,0,0); // IF I COMMENT
// THIS OUT, THE game_load WORKS FINE.
snd_stop ( songHandle );
songHandle = snd_loop ( sndObBtl, 80, 0 );
my.STATE = 2;
enemy = your.CREATOR;
}
}
...
}
}
void temple_ogre()
{
if(ogre_dead == 0)
{
ogre = ent_create ( "ogre.mdl", vector(-693,-36,-567), ogre_action );
...
// CREATES PATH THAT OGRE WALKS ON.
path_create(ogre, 3, 3);
path_setnode(ogre, 1, vector(-692, -36, -567), NULL);
path_setnode(ogre, 2, vector(-269, -140, -567), NULL);
path_setnode(ogre, 3, vector(-773, 739, -567), NULL);
vec_set(ogre.min_x,vector(-9,-9,0)); // set bounding box to individual values
vec_set(ogre.max_x,vector(9,9,75));
}
else if(ogre_dead == 1)
{
ogre = ent_create ( "ogre.mdl", vector(ogre_x_loc,ogre_y_loc,ogre_z_loc), ogre_action );
ogre.scale_x = 0.23; // TEMPLE LEVEL OGRE SCALE
ogre.scale_y = 0.23;
ogre.scale_z = 0.23;
}
}
void temple_knight()
{
if(knight_dead == 0)
{
knight = ent_create ( "a_knight.mdl", vector(-879,-1744,-550), knight_action );
// CREATES PATH THAT KNIGHT WALKS ON.
path_create(knight, 3, 3);
path_setnode(knight, 1, vector(-1061, -1335, -567), NULL);
path_setnode(knight, 2, vector(-1224, -177, -567), NULL);
path_setnode(knight, 3, vector(-1964, -304, -567), NULL);
vec_set(knight.min_x,vector(-9,-9,-25)); // set bounding box to individual values
vec_set(knight.max_x,vector(9,9,35));
}
else if(knight_dead == 1)
{
knight = ent_create ( "a_knight.mdl", vector(knight_x_loc,knight_y_loc,knight_z_loc), knight_action );
}
}
function to_STemple_door_f() // ENTERING THE SOUTH DOOR OF TEMPLE ROOM
{
if(event_type == EVENT_IMPACT) // TOUCHING THE DOOR THAT LEADS INTO
// SOUTH ENTRANCE OF TEMPLE ROOM
// LOADS CODE BELOW.
{
...
temple_knight();
temple_ogre();
...
}
}