![]() |
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++) 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 |
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. |
Re: Assist Needed, couple last pieces of info needed...
Quote:
Quote:
Quote:
http://racc.bots-united.com/releases/pmtools_plugin.exe |
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.
|
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. |
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...
|
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")) |
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
|
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"). |
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 ;) |
Re: Assist Needed, couple last pieces of info needed...
Quote:
Quote:
Like I said, a DROPPED bomb is a "weaponbox" type of entity. A PLANTED bomb is a "grenade" type of entity A CARRIED bomb is a "weapon_c4" one, but you could also check if (pPlayer->v.weapons & WEAPON_C4) to tell if a player is carrying a bomb or not. Quote:
Quote:
|
Re: Assist Needed, couple last pieces of info needed...
haven't gotten to bot chat yet still looking into server say, yes I meant when "say" is typed on the console.
I set up to log all pfnMessageBegin along with the various writestring, writebyte etc (all of them) to a file. Upon diggin though around a half gig of text logging I can find no messages that look like a command "say" that was issued on the console. My server has some auto reply stuff (map voting, timeleft, etc) so it spits out server say messages quite often. Are you sure this info is available inside a WriteString or other such? Which is it contained in? ie sayText hudText etc... /me thinks hooking pfnServerCommand is the only way to do this... |
Re: Assist Needed, couple last pieces of info needed...
...and how do you think pfnServerCommand sends the text over the network to the clients, hmmm ? :)
|
Re: Assist Needed, couple last pieces of info needed...
hmmm.... ok so i hooked pfnServerCommand and just printf() all of them for now to see whats going on. Oddly if *I* kick a player from console it doesn't show but if sturmbot kicks a player it does show. it also shows things like exec map.cfg... Never does it show a say course since it doesn't show kick commands made on console that doesn't surprise me...
|
Re: Assist Needed, couple last pieces of info needed...
Yes, because some commands you type in the DS console go directly to the engine, which doesn't bother passing them to the game DLL. This goes for generic commands like "kick", and perhaps "say" indeed. Since these commands are low level commands that are the same for all game DLLs, they are not passing through the game DLL API.. But it's not because you CAN'T hook these messages in the engine<=>gameDLL interface that these messages don't exist. They are simply sent by the engine directly over the network. You can ensure this by using some utility like TCPdump.
Remember how the Half-Life engine works. Every command, every input, everything you type on your keyboard, every move you make with your mouse, be you a client or the server admin in front of his DS console, goes to the engine. The engine then decides if it knows what to do with it, and if so, does its job. In this case, end of the story. If the engine does NOT know what to do with this new input, it passes it forth to the game DLL which is behind, using the API we all know and use, in the hope that the game DLL will know what to do. The game DLL does its job, and the chain is terminated. Using the gameDLL interface you can only hook those messages which are passing through that interface. In order to hook the others, you'll have to use other methods, such as proxying the whole network traffic between the HL server process and the wire. Personally, I never felt any use in trying these, and my message catching experiences stopped at the gameDLL interface level only, but this is doable. Just a bit harder. |
Re: Assist Needed, couple last pieces of info needed...
ok can someone do a sanity check on me? I've been down this road a couple times before but tonight I called on Alfred Reynolds of valve to help me out... He pointed me to this...
Code:
PF_MessageBegin_I( MSG_ONE, RegUserMsg( "SayText", -1 ), NULL, &sv.edicts[j+1] ); Code:
void pfnWriteString( const char * sz ) Usually I can sort this stuff but I just can't sort this. I've been after this data for almost 2 months now and have been down this road a few times already before tonight and tried this road again tonight after alfreds response but still no luck? What am I missing? |
Re: Assist Needed, couple last pieces of info needed...
I just glanced at the topic but I think I may have an idea for some of your questions...
For the first part, after glancing at the code from Alfred it looks like that is part of the engine. It may be possible to view the text by hooking pfnAlertMessage when its called with at_logged, but it is not possible to block the say from happening. Just one check you can add to your code to make it more reliable... - Do a null pointer check after opening a file Oh, you do not need the pfn prefix on MessageBegin. pfn Is generally used to prefix function pointers. |
Re: Assist Needed, couple last pieces of info needed...
hell if you guys can offer help im all ears. I got a later message from Alfred such as:
Quote:
phpUA is the future Titan Web side of things. PM prolly understands that. |
Re: Assist Needed, couple last pieces of info needed...
Ah, seeing the email you sent to Alfred I suspect you didn't understand my post completely.
Like Alfred says, it's the way the engine works that doesn't allow you to catch the WriteStrings that are sent by the engine without the game DLL to be aware of it. Read my previous post again :) EVERYTHING you input to the game or in the DS console goes to the engine FIRST. and ONLY if the engine doesn't know what to do with it, your input is then passed forth to the game DLL. But if your input represents something the engine knows and is told to take care of, such as a "kick" or a "say" server command, the engine does its job and sends bytes over the network without needing to notify the game DLL of it. That's why nothing of the sort passes through the game DLL interface. To hook the network traffic that is handled at the engine level you must PROXY all the network traffic between the wire and the HL engine process. For example, write a small application that will listen on port 27015 and send all packets it sees to port 27115 on localhost, and set the HL server to listen on that port (27115). Do a bidirectional interface like this. Externally, everything will look like as if your HL Server is installed on port 27015, but in fact it's just your proxy that will be seen, and you will be able to hook all network frames and look for WriteString packets (although at the byte level, but it's better than nothing). This (proxying) is a method that can work with ANY game engine by the way *hint* *hint* ;) *edit* after reading my post again I realize my stupidity: it won't work. The HL engine protocol uses some blowfish cryptography, I completely forgot that. Unless you want to decode all the stream by hand it's useless to go that way. Sorry. What you can do then, is what Alfred tells you to: proxy not the network traffic of the game, but the network traffic of the log packets. This is exactly the same principle, but it's much simpler: the interface needs only to be unidirectional and you'll decode clear text packets, which is easy. I'm sure there are other ideas, just don't have time to think about it, lots of {boring} work to do, sorry. :) |
Re: Assist Needed, couple last pieces of info needed...
Well I've got BuzzKill (Titan, statsme, etc) working on it. He's the one that ported all our tcp stuff to windows. Thanks for trying to dumb it down for me PM but I'm afraid no amount of dumbing down is going to be clear enough to help me write something like this in C. :D
|
All times are GMT +2. The time now is 07:41. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.