FAQ  •  Register  •  Login

A damagable, non-solid entity?

Moderator: Inside3D Admins

<<

OneManClan

Posts: 187

Joined: Sat Feb 28, 2009 2:38 pm

Post Thu Jan 26, 2012 4:09 am

A damagable, non-solid entity?

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:
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: 187

Joined: Sat Feb 28, 2009 2:38 pm

Post Thu Jan 26, 2012 6:26 am

Re: A damagable, non-solid entity?

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...

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft