[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Quake Amphibian

Quake Amphibian

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Quake Amphibian

Postby Madfox » Sat Aug 22, 2009 1:53 am

I know it isn't a usual subject but I'm trying it out.
I made two models, one with the normal stand,walk, attack , pain and death functions.
And another one with the swim, atack, pain and death functions.
So they both behave as a land monster and the other one as a water monster.

I compared these two in one qc file, and made them go apart with an extra function.
This function is added as a "harpo_to_harpo" and a Harpo_to_harpi" function.
It took a while before I could make the qc running, but for sofar I have it made.
The both are running apart in Quake except for the fact I have to make a decision to make them glide into eachother.

Now I'm chewing on the last and hardest part as I realize I can make the monster get into the water and make it swim (I hope),
but I'm aware it will be really hard to get it out of it.
So Now I'm in the FIGHT.QC, added a new HarpCheckAttack and I lost my maths on the last part...


To keep it short I will only post the last part to make clear how this function is specified.
Code:
void() harpo_to_harpi =
{
self.th_stand = h_stand1;
self.th_walk = h_walk1;
self.th_run = h_run1;
self.th_die = harpi_die;
self.th_pain = harpi_pain;
self.th_missile = h_attack1;
self.th_melee = h_faint1;
self.flags = self.flags - (self.flags & FL_SWIM);
};

void() monster_harpi =
{
if (deathmatch)
{
remove(self);
return;
}
precache_model2 ("progs/harpi.mdl");
precache_model2 ("progs/pioen.mdl");
precache_model2 ("progs/h_model.mdl");

self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;

setmodel (self, "progs/harpi.mdl");

setsize (self, '-16 -16 -24', '16 16 24');
self.health = 25;
harpo_to_harpi ();
walkmonster_start ();
};

void() harpi_to_harpo =
{
self.th_stand = h_dwell1;
self.th_walk = h_swim1;
self.th_run = h_crawl1;
self.th_die = h_die1;
self.th_pain = harpo_pain;
self.th_melee = h_harp1;
self.flags = self.flags | FL_SWIM;
};

void() monster_harpo =
{
if (deathmatch)
{
remove(self);
return;
}
precache_model2 ("progs/harpo.mdl");
precache_model2 ("progs/pioen.mdl");

self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;

setmodel (self, "progs/harpo.mdl");

setsize (self, '-16 -16 -24', '16 16 24');
self.health = 25;
harpi_to_harpo ();
swimmonster_start();
};

I added the
self.flags = self.flags - (self.flags &|FL_ SWIM)]
for the land model and the
self.flags = self.flags | FL_SWIM;
for the water model.

To get a function for making the engine know when the model is on land and when it is in water I thought to make a CHeck_Attack function in the FIGHT.QC.
So I added a line in the AI.QC to the CheckAnyAttack and added

if(self.classname == "monster_harpio")
return HarpCheckAttack();


Now I am on the last part of the FIGHT.QC and I realize it might be possible to get the monster into the water and swim (I hope) but I might not get it out of it.
But it is this last part I can't get filled in.
I made a regular CheckAttack and started at the top with something like


float() HarpCheckAttack =
{
local vector spot1, spot2;
local entity targ;
local float chance;

targ = self.enemy;

// see if any entities are in the way of the shot
spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs;

traceline (spot1, spot2, FALSE, self);

if(self.th_stand = harpo_stand1) //if not swimming
{
if (self.waterlevel == 3)
harpo_to_harpi();
return TRUE;
}
// else
// {
// if( /*insert decision making code for standing up here*/)
// harpi_to_harpo();
// }

if (trace_inopen && trace_inwater)
return FALSE; // sight line crossed contents

if (trace_ent != targ)
return FALSE; // don't have a clear shot
etc


The FIGHT.QC keeps giving the error "harpo_stand1 not defined"
and I can't find a way to get the right thread.

I know it is a rather long thread to post, but I'm wrenching myself so long with it I wondered if someone had a clue to it.
Maybe it just ain'rt possible and I'm looking for something that doesn't fit in the Quake engine, but I was curious.

Thanks.
User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby jim » Thu Aug 27, 2009 1:58 am

I made monsters that were able to swim and walk on land. I didn't make them two different entities.. but seems like I didn't back up my files properly...

Well, have you defined harpo_stand1 anywhere? In your harpo_to_harpi you're using h_stand1, so maybe you should use that in the later parts of the code too?
zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Madfox » Fri Aug 28, 2009 11:25 pm

User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby ceriux » Sat Aug 29, 2009 9:48 pm

couldnt you just... when it goes from walking to swimming switch its move type to that of a flying/swimming type?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Madfox » Sun Aug 30, 2009 12:35 am

User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby Dr. Shadowborg » Sun Aug 30, 2009 1:27 am

User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Postby Madfox » Tue Sep 01, 2009 8:14 pm

Thanks for your reply in this for me sticky problem, Dr.Shadowborg.

So if I have it right the fight.qc has to be something like:

if(self.th_stand == h_stand1)
return TRUE;

{
if (self.frame=h_mour1 )
harpo_to_harpi();
return TRUE;
}
if(self.th_stand == h_dwell1)
return TRUE;
{
if(self.frame= h_jive1)
harpi_to_harpo();
}
User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby Dr. Shadowborg » Tue Sep 01, 2009 8:42 pm

That looks more or less right, just bear in mind stuff like h_mour1, h_jive1, etc. won't work unless you actually define those framemacros inside fight.qc.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Postby Madfox » Wed Sep 02, 2009 12:33 am

User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby Dr. Shadowborg » Wed Sep 02, 2009 1:05 am

User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

jonas and the amphibian

Postby Madfox » Thu Sep 24, 2009 2:22 am

Last edited by Madfox on Thu Sep 24, 2009 9:26 pm, edited 2 times in total.
User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Postby Electro » Thu Sep 24, 2009 7:23 am

Benjamin Darling


Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
Electro
 
Posts: 312
Joined: Wed Dec 29, 2004 11:25 pm
Location: Brisbane, Australia

Postby Chip » Thu Sep 24, 2009 7:45 pm





Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland

Postby ceriux » Thu Sep 24, 2009 7:49 pm

User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Madfox » Thu Sep 24, 2009 9:24 pm

User avatar
Madfox
 
Posts: 106
Joined: Sat Jan 15, 2005 3:13 pm
Location: Holland

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest