monster_dogs in QW?
Moderator: InsideQC Admins
43 posts
• Page 3 of 3 • 1, 2, 3
It's returned as an error, not merely a warning in FrikQCC, because a prototype defines the variable as constant. Any constants not assigned a value at the end cause an error.
Last edited by FrikaC on Thu Sep 27, 2007 4:09 pm, edited 1 time in total.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
Still crashing
Server error messages:
Client redrum connected
redrum entered Spisi's Fragfest!
walkmonster in wall at: '463.0 -543.0 185.0'
CALL1 13893(anglemod)()
ai.qc : FacingIdeal
ai.qc : ai_run_melee
ai.qc : ai_run
dog.qc : dog_run2
<NO FUNCTION>
NULL function
SV_Error: Program error
It seems once cujo senses me, it then crashes.
I have all those functions called in their respective files.
This is in ai.qc
and dog.qc...
Server error messages:
Client redrum connected
redrum entered Spisi's Fragfest!
walkmonster in wall at: '463.0 -543.0 185.0'
CALL1 13893(anglemod)()
ai.qc : FacingIdeal
ai.qc : ai_run_melee
ai.qc : ai_run
dog.qc : dog_run2
<NO FUNCTION>
NULL function
SV_Error: Program error
It seems once cujo senses me, it then crashes.
I have all those functions called in their respective files.
This is in ai.qc
- Code: Select all
/*
============
FacingIdeal
============
*/
float() FacingIdeal =
{
local float delta;
delta = anglemod(self.angles_y - self.ideal_yaw);
if (delta > 45 && delta < 315)
return FALSE;
return TRUE;
};
//=============================================================================
float() DogCheckAttack;
float() CheckAnyAttack =
{
if (!enemy_vis)
return FALSE;
if (self.classname == "monster_dog")
return DogCheckAttack ();
return CheckAttack ();
};
/*
=============
ai_run_melee
Turn and close until within an angle to launch a melee attack
=============
*/
void() ai_run_melee =
{
self.ideal_yaw = enemy_yaw;
ChangeYaw ();
if (FacingIdeal())
{
self.th_melee ();
self.attack_state = AS_STRAIGHT;
}
};
/*
=============
ai_run_missile
Turn in place until within an angle to launch a missile attack
=============
*/
void() ai_run_missile =
{
self.ideal_yaw = enemy_yaw;
ChangeYaw ();
if (FacingIdeal())
{
self.th_missile ();
self.attack_state = AS_STRAIGHT;
}
};
/*
=============
ai_run_slide
Strafe sideways, but stay at aproximately the same range
=============
*/
void() ai_run_slide =
{
local float ofs;
self.ideal_yaw = enemy_yaw;
ChangeYaw ();
if (self.lefty)
ofs = 90;
else
ofs = -90;
if (walkmove (self.ideal_yaw + ofs, movedist))
return;
self.lefty = 1 - self.lefty;
walkmove (self.ideal_yaw - ofs, movedist);
};
/*
=============
ai_run
The monster has an enemy it is trying to kill
=============
*/
void(float dist) ai_run =
{
local vector delta;
local float axis;
local float direct, ang_rint, ang_floor, ang_ceil;
movedist = dist;
// see if the enemy is dead
if (self.enemy.health <= 0)
{
self.enemy = world;
// FIXME: look all around for other targets
if (self.oldenemy.health > 0)
{
self.enemy = self.oldenemy;
HuntTarget ();
}
else
{
if (self.movetarget)
self.th_walk ();
else
self.th_stand ();
return;
}
}
self.show_hostile = time + 1; // wake up other monsters
// check knowledge of enemy
enemy_vis = visible(self.enemy);
if (enemy_vis)
self.search_time = time + 5;
// look for other coop players
if (coop && self.search_time < time)
{
if (FindTarget ())
return;
}
enemy_infront = infront(self.enemy);
enemy_range = range(self.enemy);
enemy_yaw = vectoyaw(self.enemy.origin - self.origin);
if (self.attack_state == AS_MISSILE)
{
//dprint ("ai_run_missile\n");
ai_run_missile ();
return;
}
if (self.attack_state == AS_MELEE)
{
//dprint ("ai_run_melee\n");
ai_run_melee ();
return;
}
if (CheckAnyAttack ())
return; // beginning an attack
if (self.attack_state == AS_SLIDING)
{
ai_run_slide ();
return;
}
// head straight in
movetogoal (dist); // done in C code...
};
and dog.qc...
- Code: Select all
void() dog_run1 =[ $run1 , dog_run2 ] {
if (random() < 0.2)
sound (self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE);
ai_run(16);};
void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);};
void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);};
void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);};
void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);};
void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);};
void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);};
void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);};
void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);};
void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);};
void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);};
void() dog_run12
Last edited by redrum on Thu Sep 27, 2007 7:38 pm, edited 2 times in total.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
Redrum, I'm sorry.. I've taken off anglemod(), visible() and infront from my modified ai.qc to use with my bots...
Just paste this at the very top of ai.qc:
And to avoid the walkmonster in wall at 'origin', change the setsize() line at monster_dog to this:
This will make the dog to don't get stuck in the wall.
Just paste this at the very top of ai.qc:
- Code: Select all
float(float v) anglemod =
{
while (v >= 360)
v = v - 360;
while (v < 0)
v = v + 360;
return v;
};
And to avoid the walkmonster in wall at 'origin', change the setsize() line at monster_dog to this:
- Code: Select all
setsize (self, '-16 -16 -24', '16 16 40');
This will make the dog to don't get stuck in the wall.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
Cujo is working great! Killing people at will!
One small problem. When Cujo telefrags a player it just says "you were telefragged by". How can I add "Cujo" to the end.
I tried this in ClientObituary:
Problem is Cujo doesn't have a .netname (I think this is the problem).
How can I get him one?
One small problem. When Cujo telefrags a player it just says "you were telefragged by". How can I add "Cujo" to the end.
I tried this in ClientObituary:
- Code: Select all
if (attacker.classname == "teledeath" && (attacker.classname == "monster_dog"))
{
bprint (PRINT_MEDIUM,targ.netname);
bprint (PRINT_MEDIUM," was telefragged by ");
bprint (PRINT_MEDIUM,attacker.owner.netname); ???
bprint (PRINT_MEDIUM,"\n");
return;
}
Problem is Cujo doesn't have a .netname (I think this is the problem).
How can I get him one?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
At monster_dog(), add this line at the very top:
This will give it a name to be displayed on the obituary.
- Code: Select all
self.netname = "Cujo";
This will give it a name to be displayed on the obituary.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
so cujo has turned out to be quite the best eh?
he ain't so tough
http://www.racingstable.com/sitebuildercontent/sitebuilderpictures/cujo.jpg NWS
he ain't so tough
http://www.racingstable.com/sitebuildercontent/sitebuilderpictures/cujo.jpg NWS
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
43 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest
