Inside3D!
     

Unknown Command

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



Joined: 23 Sep 2007
Posts: 23

PostPosted: Sat Oct 06, 2007 4:10 pm    Post subject: Unknown Command Reply with quote

hi!

is there such a command in dp?
i highlighted it red, cause i dont want that the grunt gib a corpse.


if (killed or shoot by a grunt)
self.health=0;
else if (killed or shoot by the player)
self.health=25;

self.th_stand = SUB_Null;
self.th_walk = SUB_Null;
self.th_run = SUB_Null;
self.th_pain = SUB_Gib;
self.th_die = army_really_die;
self.th_melee = SUB_Null;
self.th_missile = SUB_Null;
self.takedamage= DAMAGE_YES;
self.flags = self.flags &! FL_MONSTER;
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Sun Oct 07, 2007 3:59 pm    Post subject: Reply with quote

If what you're asking is for the grunt to lose interest in a corpse, then all you have to do is set the classname of whatever's become a corpse to well, "corpse" and then have a check in ai_run() (it's in ai.qc) to make sure that what it's attacking is NOT a corpse.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
smd



Joined: 23 Sep 2007
Posts: 23

PostPosted: Sun Oct 07, 2007 8:20 pm    Post subject: Reply with quote

worksssssss Laughing

thank u very much!!!


great forum

Cool
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Sun Oct 07, 2007 8:24 pm    Post subject: Reply with quote

Don't just thank 'u'. Also thank 'y' and 'o'.
_________________
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Oct 07, 2007 9:36 pm    Post subject: Re: Unknown Command Reply with quote

smd wrote:
self.flags = self.flags &! FL_MONSTER;


Are you actually doing this?
It may work for the case where FL_MONSTER is the only flag set, but what it actually does is remove ALL flags.

FL_MONSTER = 32
!FL_MONSTER = 0

anything & 0 = 0

So you're setting self.flags to 0.

! (logical not) is not a substitute for ~ (bitwise complement). QuakeC doesn't have ~ because it wouldn't work so well with floats. So in QuakeC the correct way to remove a flag is:

self.flags = self.flags - (self.flags & FL_MONSTER);

Or the equivalent:

if (self.flags & FL_MONSTER)
self.flags = self.flags - FL_MONSTER;
_________________
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.
Back to top
View user's profile Send private message
smd



Joined: 23 Sep 2007
Posts: 23

PostPosted: Mon Oct 08, 2007 3:55 pm    Post subject: Reply with quote

sorry, but i need your help again Confused

i have gibbable corpses, so i can also walk through them and gib them.

all works good, but sometimes suddendly all corpses become solid and i cant walk through them anymore and also all the teleporters in the map dont work then. So i cant finish shub-nigguraths pit for example, cause the teleport dont work. thats really weird!

i hope for a little help Cool
Back to top
View user's profile Send private message
smd



Joined: 23 Sep 2007
Posts: 23

PostPosted: Mon Oct 08, 2007 8:39 pm    Post subject: Reply with quote

i found out that it has something to do with the w_fireaxe


void() W_FireAxe =
{
local float oldsolid;
local vector source;
local vector org;

makevectors (self.v_angle);
source = self.origin + '0 0 16';
if (ext_solidcorpse == TRUE)
{
oldsolid = self.solid;
self.solid = SOLID_BBOX;
}

traceline (source, source + v_forward*64, FALSE, self);
if (trace_fraction == 1.0)
return;

org = trace_endpos - v_forward*4;

if (trace_ent.takedamage)
{
trace_ent.axhitme = 1;
SpawnBlood (org, '0 0 0', 20);
T_Damage (trace_ent, self, self, 20);
}
else
{ // hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
if (ext_solidcorpse == TRUE)
self.solid = oldsolid;

};


wihtout the red code pieces = its the original fireaxe, i cant gib the corpses.


with the red code = i can gib with the axe, but after one slash with the axe, the corpses are all solid and the teleporters dont work!
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Mon Oct 08, 2007 11:12 pm    Post subject: Reply with quote

Put the second red bit before the 'if (trace_fraction == 1) return;' bit.

Otherwise, everytime you miss, the player is stuck as SOLID_BBOX forever.

It's customary to reset the solid right after the traceline. I usually make a function called traceline_hitcorpse to make this easy.
_________________
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.
Back to top
View user's profile Send private message
smd



Joined: 23 Sep 2007
Posts: 23

PostPosted: Tue Oct 09, 2007 4:46 am    Post subject: Reply with quote

1000 thanks again, works perfect now


great Very Happy
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