UBBFriend: Email This Page to Someone!
  AQDT Message Board
  AQDT Discussion, We are NOT the A-Team
  damage

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   damage
Lt.Hawkins
Citizen
posted 04-18-99 09:17 PM     Click Here to See the Profile for Lt.Hawkins   Click Here to Email Lt.Hawkins     Edit/Delete Message
i'm posting this here, because its more likely that you guys (and gals?) will know than the others in the Gen Discussion.

where is the fxn that deals out damage and adjusts your score?

as near as i can tell, its g_combat.c, in T_Damage(). i'm trying to make grenades friendlyfire by only running the FF check if mod!=(all the grenade-type MOD defines.) but this doens't seem to be working. no damage to teammates. :-(

(i run this check twice in this fxn, and then in another (i forget which one), i do a check to see if OnSameTeam(targ,attacker), and if so, subtract 5 from attacker score.

------------------
[ST7]Lt.Hawkins
"Tango down"
Linux user and AQ2-Addict
Carpe Daemon- Sieze the background process

IP: 128.230.218.32

Eek[AQK]
Peon
posted 04-19-99 01:11 AM     Click Here to See the Profile for Eek[AQK]   Click Here to Email Eek[AQK]     Edit/Delete Message
Howdy,


Take the following with a mine of salt. I'm
pretty punchy right now, so I might have missed some obvious stuff. That said:


Yes, T_Damage is where I also think such checks would go. Make sure you
modify the code at the very top which does an immediate return if the
attacker is on the same team. Perhaps something like changing:


if (targ != attacker && targ->client && attacker->client &&
targ->client->resp.team == attacker->client->resp.team)
return;

which says to immediatly return if attacker and targ are two seperate clients
on the same team, to

if (targ != attacker && targ->client && attacker->client &&
(targ->client->resp.team == attacker->client->resp.team && mod != MOD_GRENADE))
return;

which qualifies that the weapon used was not a grenade. If it was a
grenade, pass it on down.

There are various other routines in there which check to see if targ and
attacker are on the same team, but I think most of them are wrapped around
in the if() test which checks to see if it is a bullet weapon being used.
Oh, and make sure you know that (targ->client) and (attacker->client)
is true before passing it on to OnSameTeam() -- that function doesn't
bother to do the checking it should and will core dump if you don't pass
it client entities.


Eek[AQK]
http://www.aqk.org/

IP: 208.138.45.20

Lt.Hawkins
Citizen
posted 04-19-99 02:50 AM     Click Here to See the Profile for Lt.Hawkins   Click Here to Email Lt.Hawkins     Edit/Delete Message
Eek- thanks a lot. have yet to actually test this now (everyones asleep, and i need 3 people to test it ), but i never would have found that top one you told me about, and i would have scratched my head every time the server cored w/o that tip on the targ->client and attacker->client stuff. i'm just beginning to get intimate with this stuff, and i'm not clear on a lot of things.

where can i find info on this stuff? is there a documented quake "API" or is this all just experience? for example- what exactly is an entity? where can i find the struct definition? what fxns are available to me for vector manipulation?

i suppose i just never happened across the appropriate web pages.

thnx, [ST7]Lt.Hawkins

IP: 128.230.218.32

Eek[AQK]
Peon
posted 04-19-99 04:43 PM     Click Here to See the Profile for Eek[AQK]   Click Here to Email Eek[AQK]     Edit/Delete Message
I've asked before, and never got an answer as to whether or not an API was around. I know some people are working on a general API doc because I've found partial copies of one online, but it only covered maps.

I think an entity is pretty much any object in the Quake model -- walls, clients, bullets, etc. You can find most of the useful structures in g_local.h.

Jim

IP: 36.48.0.102

Lt.Hawkins
Citizen
posted 04-23-99 05:19 PM     Click Here to See the Profile for Lt.Hawkins   Click Here to Email Lt.Hawkins     Edit/Delete Message
Eek, thanks a lot, grenades finally kill everyone

only thing is, they get a frag for it, even killing their own team.

in g_combat.c, Killed()

// 990418.2145 dschin: if death by teammate, subtract 6
if(targ->client && attacker->client)

if(OnSameTeam(targ,attacker)){

attacker->client->resp.score-=6;

if(attacker->client->resp.score<-10)

cmd_Kick(attacker);
}


this code *seems* correct, but alas, people gain frags for killing roommates. :-(

oh, and the cmd_Kick() is a guess, but it compiles

(More) Help appreciated. Thanks a lot.


------------------
[ST7]Lt.Hawkins
"Tango down"
Linux user and AQ2-Addict
Carpe Daemon- Sieze the background process

[edited for layout]

[This message has been edited by Lt.Hawkins (edited 04-23-99).]

IP: 128.230.218.32

Lt.Hawkins
Citizen
posted 04-23-99 08:56 PM     Click Here to See the Profile for Lt.Hawkins   Click Here to Email Lt.Hawkins     Edit/Delete Message
sorry for spamming this thread (it is my thread though )

i think i got it. i just have to test it out. Theres code to adjust frag counts in p_client.c. If i add to ... i think its ClientObit() or something, near the end it adds frags, i just added a case for FF Grens.

hopefully this'll work.

IP: 128.230.218.32

All times are ET (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | AQDT: The Webpage

Powered by: Ultimate Bulletin Board, Version 5.38b
© Madrona Park, Inc., 1998 - 1999.