.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Assist Needed, couple last pieces of info needed...
Old
  (#1)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Assist Needed, couple last pieces of info needed... - 05-02-2004

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






  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#2)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Assist Needed, couple last pieces of info needed... - 05-02-2004

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.







Last edited by BAStumm; 05-02-2004 at 08:32..
  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Assist Needed, couple last pieces of info needed... - 05-02-2004

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



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#4)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Assist Needed, couple last pieces of info needed... - 05-02-2004

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.






  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Assist Needed, couple last pieces of info needed... - 06-02-2004

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 >

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#6)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Assist Needed, couple last pieces of info needed... - 06-02-2004

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...






  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Assist Needed, couple last pieces of info needed... - 06-02-2004

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"))



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#8)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Assist Needed, couple last pieces of info needed... - 06-02-2004

ugg stupid mistake in the code... sentry angles were working just not getting output correctly LOL






  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#9)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Assist Needed, couple last pieces of info needed... - 07-02-2004

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").



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Assist Needed, couple last pieces of info needed...
Old
  (#10)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Assist Needed, couple last pieces of info needed... - 09-02-2004

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






  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com