Forum

Blue head in FitzQuake

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Blue head in FitzQuake

Postby Chrispy » Sat Feb 26, 2011 11:09 pm

Hey guys, have you ever encountered this problem before?

When I try run my mod in FitzQuake, and shoot a soldier, I get a blue head instead of a regular head... This does not happen in regular WinQuake and DarkPlaces when running my own mod.

Image

(Sorry for the console being in the way... but you can see the head anyway)

I've pinpointed the problem to my progs.dat... but what is the problem?

I've tried using both the FitzQuake executable, as well as compiling my own FitzQuake. If I run FitzQuake without my mod on the target line, there's no blue heads.

Thanks in advance.

All my mod is, is a couple of editted .mdls, and some QC edits where you get pretty much more gore and what not.
Chrispy
 
Posts: 15
Joined: Fri Feb 25, 2011 3:39 am

Postby Sajt » Sat Feb 26, 2011 11:51 pm

Just a guess.. do you have painskins in your mod? When gibbed I think a monster entity actually turns into the head instead of spawning a new entity for it. Maybe .skin is still set to 1, and maybe FitzQuake shows blue for invalid skins.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Chrispy » Sun Feb 27, 2011 12:07 am

As a matter of fact I do... removing the pain skin code has fixed it, but I'd really like to keep that feature in FitzQuake...

I'll try look at what you said about the monster entity turning into a head.

* Edit: Fixed! Thanks man!

Code: Select all
void() army_die =
{
   self.skin = 0;
// check for gib
   if (self.health < -20) // -35 default
   {
      sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
      ThrowHead ("progs/h_guard.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
      //return;
      // return effectively skips the else statement
   }
   else {
   // else if our weapon doesn't do so much damage, throw less gibs
      ThrowHead ("progs/h_guard.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
   }
// regular death
   sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM);
   if (random() < 0.5)
      army_die1 ();
   else
      army_cdie1 ();
};


Below army_die you'll see the "self.skin = 0" which has fixed it. When the soldier dies you don't see his actual body (you just see gibs), so a self.skin = 0 works just fine.

Feel free to suggest better code though, even though this seems to be fixed... for now.
Chrispy
 
Posts: 15
Joined: Fri Feb 25, 2011 3:39 am

Postby Nahuel » Sun Feb 27, 2011 1:36 am

Chrispy wrote:As a matter of fact I do... removing the pain skin code has fixed it, but I'd really like to keep that feature in FitzQuake...

I'll try look at what you said about the monster entity turning into a head.

* Edit: Fixed! Thanks man!

Code: Select all
void() army_die =
{
   self.skin = 0;
// check for gib
   if (self.health < -20) // -35 default
   {
      sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
      ThrowHead ("progs/h_guard.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
      //return;
      // return effectively skips the else statement
   }
   else {
   // else if our weapon doesn't do so much damage, throw less gibs
      ThrowHead ("progs/h_guard.mdl", self.health);
      ThrowGib ("progs/gib1.mdl", self.health);
      ThrowGib ("progs/gib2.mdl", self.health);
      ThrowGib ("progs/gib3.mdl", self.health);
   }
// regular death
   sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM);
   if (random() < 0.5)
      army_die1 ();
   else
      army_cdie1 ();
};


Below army_die you'll see the "self.skin = 0" which has fixed it. When the soldier dies you don't see his actual body (you just see gibs), so a self.skin = 0 works just fine.

Feel free to suggest better code though, even though this seems to be fixed... for now.



You only need to duplicate the skin of the model h_guard.mdl

Image


Image

If you use QME is very easy (right button in the skin)


Enjoy!
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby Nahuel » Sun Feb 27, 2011 1:48 am

Sorry, my solution (duplicating skins) works fine, but is some stupid. You do not need duplicate skins.
Sorry, I never test my pain skin code in fitzquake.

the correct code is ;


void() army_die =
{
// check for gib
if (self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_guard.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
return;
}
// regular death
sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM);
if (random() < 0.5)
{
army_die1 ();
self.skin=1;
}
else
{
army_cdie1 ();
self.skin=1;
}
};
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby leileilol » Sun Feb 27, 2011 1:59 am

i'd rather fix the engine to make it use the skin 0 for invalid skins
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Sajt » Sun Feb 27, 2011 2:32 am

Actually it seems to me like a good feature to point out invalid skin index.

Anyway, you should set self.skin=0 only when the monster is gibbed. Otherwise set self.skin=1 as in Nahuel's code, so dead guards always have the pain skin.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Chrispy » Sun Feb 27, 2011 3:11 am

leileilol wrote:i'd rather fix the engine to make it use the skin 0 for invalid skins


Yeah I'm with you on that one. :)

Thanks everybody. Right now self.skin = 0 is doing the trick, since you won't see the soldier's body when he dies (just gibs/limbs). :)
Chrispy
 
Posts: 15
Joined: Fri Feb 25, 2011 3:39 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest