Forum

A damagable, non-solid entity?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

A damagable, non-solid entity?

Postby OneManClan » Thu Jan 26, 2012 4:09 am

Hi all,

SHORT VERSION:
Is it possible to have a non-solid entity that can receive damage via a weapon using traceline()?


LONG VERSION:
Objective: A floating entity which goes through walls. It needs to:

1. Be non-solid (ie move through walls, doors, other entities)
2. Receive projectile damage
3. Receive direct fire damage
4. Not trigger doors!

The closest I can get is:
camera.movetype = #MOVETYPE_FLY;
camera.solid = #SOLID_CORPSE;
camera.takedamage = #DAMAGE_AIM;
camera.health = 10;
camera.think = Camera_Think;
camera.nextthink = time + 60;

This is a non solid camera, which if damaged, disappears (temporarily), via:

Code: Select all
void ()Camera_Think =
{
   // self is the camera
   if(self.health <= 0)
      {
         setmodel (self, ""); // the camera becomes invisible
         self.solid = #SOLID_NOT; // I don't remember why this is necessary
         self.health = 10;
      }
   else
      setmodel (self, "progs/camera.mdl");
      self.takedamage = #DAMAGE_AIM; // this needs to be reset after the entity dies
      self.solid = #SOLID_CORPSE;
      }

      self.think = Camera_Think;
      self.nextthink = time + 60;
      
};


I'm using FTEQW, so it's possible to use dimension_solid but a non-solid entity doesn't respond to tracelines.. Otoh, I notice there's an ftetraceline with a reference to something called FL_FINDABLE_NONSOLID... so...

can it be done?
OneManClan
 
Posts: 243
Joined: Sat Feb 28, 2009 2:38 pm

Re: A damagable, non-solid entity?

Postby OneManClan » Thu Jan 26, 2012 6:26 am

UPDATE:
OneManClan wrote:4. Not trigger doors!

This is actually as simple as editing doors.qc, and adding the condition that they do not respond to these particular entities. Thanks to Xavior for pointing this out!

This only leaves the traceline issue...
OneManClan
 
Posts: 243
Joined: Sat Feb 28, 2009 2:38 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest