Inside3D!
     

A few door questions.

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Tue Jul 27, 2010 5:52 am    Post subject: A few door questions. Reply with quote

1. I'm having an issue with making doors only open with my universal action/use command. I thought it would be as simple as changing self.touch = door_use to th_use = door_use. But no avail. I thought it was because my use command uses trace_ent, so i made it trace_ent || trace_ent.takedamge just to be sure. Still, nothing. Here is my use code.

Code:
void() use_ent =
{

local entity oldself;

   if (trace_ent.th_use)
   {
   oldself = self;
   other = self;
   self = trace_ent;
   self.th_use();
   self = oldself;
   }
};


void() use_cmd =
{

   local   vector   source;
   local   vector   org;

   makevectors (self.v_angle);
   source = self.origin + '0 0 16';
   traceline (source, source + v_forward*64, FALSE, self);
   if (trace_fraction == 1.0)
      return;
   
   org = trace_endpos - v_forward*4;

   if (trace_ent || trace_ent.takedamage)
   {
      if (trace_ent.classname == "player" && trace_ent.capenabled == 0)
         return;
      if (trace_ent.capenabled == 1)
         HelpOther();
      use_ent();
   }
};



2. Another thing i want to add to doors is have monsters attack it if if stands between them and the player and be able to be destroyed, so basically if they are enraged from seeing a player they will attack the door but the door is a lower priority. Is this simple to do? I am terrible at AI so please help haha.

3. Would giving the door health and usable conflict?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group