Ghost_Fang
Joined: 12 Nov 2009 Posts: 162
|
Posted: Tue Jul 27, 2010 5:52 am Post subject: A few door questions. |
|
|
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? |
|