.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Assist Needed, couple last pieces of info needed... (http://forums.bots-united.com/showthread.php?t=630)

BAStumm 05-02-2004 06:55

Assist Needed, couple last pieces of info needed...
 
Angle Sentry Gun is Facing
Code:

for (i = 0; (pent = UTIL_FindEntityByClassname(pent, "building_sentrygun")) != NULL; i++)
                {
                                8<----SNIP----
                                sprintf(temp_sg[SG_ANGLE][i + 1], "%f", pent->v.angles.y);
                                8<----SNIP----
}

Swear this worked for a while and then stopped... But not positive. I want the angle the Sentry Gun is facing. Any help?

Player Total Time Connected
Currently I am looking at client connect or something. I was told i can get the same data as "status" uses for player total connected time by someone on the statsme team but for the life of me I can't find it, searched their source too...

Entity is held by player
Think bomb in cs or flag in tfc. An entity that can be picked up and carried. I want to add a flag to the info about the player that he is holding the "goal item" or whatever. How can I determin that the bomb is carried by "this" player when looping through indexent. Looking for a solution hopefully works for bomb in cs, flag in tfc, documents in dod, etc. but will settle for mod specifics...

TFC Buildings
How can I tell which player built/owns a sentry gun? do i have to track it when its built and remember or is there a way to get on the fly? referring to sentry guns, teleporters and dispensers...

I may have a couple more but thats the bulk for now.

TIA

BAStumm 05-02-2004 07:05

Re: Assist Needed, couple last pieces of info needed...
 
server say messages would be cool too... Ive not even looked into it, is it fairly easy? Method other than hooking server_command?

And of course credit is given where credit is due :). Click my sig image, special thanks goes out to various bots-united guys as well as others and specific comments are included for specific code like pm and stefan for the cs model/team stuff or pm for the reading bsp stuff for determining world size and offset or center... in the mm code.

Pierre-Marie Baty 05-02-2004 14:37

Re: Assist Needed, couple last pieces of info needed...
 
Quote:

Originally Posted by BAStumm
Angle Sentry Gun is Facing
Code:

for (i = 0; (pent = UTIL_FindEntityByClassname(pent, "building_sentrygun")) != NULL; i++)
                {
                                8<----SNIP----
                                sprintf(temp_sg[SG_ANGLE][i + 1], "%f", pent->v.angles.y);
                                8<----SNIP----
}

Swear this worked for a while and then stopped... But not positive. I want the angle the Sentry Gun is facing. Any help?

Tried pent->v.v_angle.y ?

Quote:

Entity is held by player
Think bomb in cs or flag in tfc. An entity that can be picked up and carried. I want to add a flag to the info about the player that he is holding the "goal item" or whatever. How can I determin that the bomb is carried by "this" player when looping through indexent. Looking for a solution hopefully works for bomb in cs, flag in tfc, documents in dod, etc. but will settle for mod specifics...
Tried pent->v.owner ?

Quote:

TFC Buildings
How can I tell which player built/owns a sentry gun? do i have to track it when its built and remember or is there a way to get on the fly? referring to sentry guns, teleporters and dispensers...
Same as above... when you've got questions like these, USE and ABUSE my pmtools plugin... it displays an entvars dump of any entity, draw its bounding box and resolves pointers and bitmasked values directly in the game... fire up a listenserver, run around, point at an entity and order, it answers ;)

http://racc.bots-united.com/releases/pmtools_plugin.exe

BAStumm 05-02-2004 20:39

Re: Assist Needed, couple last pieces of info needed...
 
yes I use pmtools and according to it pent->v.angles.y is populated but my code above isn't working :( v.owner is not valid for either. Im using pmtools from command line on a linux server. I stripped out your ingame stuff and re-compiled it. But listent and printent still work from command line.

Pierre-Marie Baty 06-02-2004 01:23

Re: Assist Needed, couple last pieces of info needed...
 
You may need to add or substract 90 degrees or 180 degrees from the sentry gun's angle depending on how the game initializes building_sentryguns.

Also you have to know that building_sentrygun is NOT the sentry gun itself, it's just the sentry BASE (the three-legged metal slab). The actual sentry gun is a monster_sentry that is built on top of it at the end of the building process. If you had ran pmtools with a listenserver you would know </nitpicking :P >

Perhaps it's these monster_ entities you should check for v.owner, dunno. I find it strange though because back in the days of TFC 1.1.0.8 that's how I was doing with my bot and it worked this way.

You should really fire up a listen server and test it out, it would me much easier for comparing the sentry's angles with your player's angles when you're standing next to it, and you could compare easily the contents of the entvars of your player, the sentry gun base, and the sentry gun monster.

BAStumm 06-02-2004 03:03

Re: Assist Needed, couple last pieces of info needed...
 
My current method was working and stopped at some point in the last few months. Not sure when. not it always reports 0 for the y angle. hmmm...

Pierre-Marie Baty 06-02-2004 13:33

Re: Assist Needed, couple last pieces of info needed...
 
Your loop may not work the way it is meant to. Make SURE you initialize pent to NULL beforehand, this is a must. Also, try replacing the stop condition with
Code:

!FNullEnt (pent = UTIL_FindEntityByClassname(pent, "building_sentrygun"))

BAStumm 06-02-2004 20:24

Re: Assist Needed, couple last pieces of info needed...
 
ugg stupid mistake in the code... sentry angles were working just not getting output correctly LOL

Pierre-Marie Baty 07-02-2004 15:18

Re: Assist Needed, couple last pieces of info needed...
 
Anyway, what I can say is, in TFC, to check if the flag is carried by a player, pent->v.owner works. Positively.

You can't do that in CS because the "bomb" itself is not really a particular type of entity. There is one entity to represent a bomb lying on the ground ("weaponbox"), but it's another type of entity when this is a planted bomb ("grenade"), and yet another type of entity when the bomb is carried on the back of a player ("weapon_c4").

BAStumm 09-02-2004 07:08

Re: Assist Needed, couple last pieces of info needed...
 
pEntity->v.aiment = Entity #7 ("player")
pEntity->v.owner = Entity #7 ("player")

hmmm interesting... Do hostages in CS do this too? Anyone have knowledge of DoD with similar such as the "papers" or "plans" or whatever the secret docs you rescue are?

as for cs though, the entity type doesn't change does it? Just the model changes for that ent... I'm just using a findentity function on weapon_c4 and the v.model changes as its planted or dropped or carried.

What about server say messages? Is that just a matter of hooking pfnServerCommand or is there some other way?

Bot chat? No real way to do this for ALL bots is there? Other than grabbing SayText on the fly? Does me no good to get bot chat if it only works for BOBSLEETBOT but not for JOHNSLEETBOT ;)


All times are GMT +2. The time now is 19:19.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.