![]() |
Detecting fall damage in a safe way?
I am trying to figure out how to get a 100% solid method to know a bot recieved damage due falling. This is to let bots learn from their mistakes in some nodes.
I tried using the DMG_FALL and DMG_CRUSS bits, but they gave me no luck! I saw in the SDK only bits gets sent that require a HUD drawing on the client, this stinks! My code: Code:
// This message gets sent when the bots are getting damaged. Code:
if (pev->dmg_take || pev->dmg_save || m_bitsHUDDamage != m_bitsDamageType) |
Re: Detecting fall damage in a safe way?
The IGNORE_DAMAGE bits don't work in Counter-Strike.
Do this instead Code:
// is this player falling fast enough to get some damage ? Code:
#define PLAYER_FATAL_FALL_SPEED 1024// approx 60 feet |
Re: Detecting fall damage in a safe way?
I have a similar problem. How to detect if a bot is getting damage from being attacked, and who the attacker is. I tried using the "Damage" message, but it does not indicate what the cause of the damage is, or who (or what) is the source. I ended up doing a traceline back to the source origin to see what it is, but the method is cpu intensive and inaccurate.
|
Re: Detecting fall damage in a safe way?
lol, I feel like I'm your savior for each problem you have :D
botmeister: already checked: pEdict->v.dmg_inflictor ? :) |
Re: Detecting fall damage in a safe way?
Quote:
How in the hell do you find this stuff anyway? ???:( |
Re: Detecting fall damage in a safe way?
the hell you're talking about is called "PMTools plugin", and it's available for download with source code on my site, hehe :P
|
Re: Detecting fall damage in a safe way?
BTW: Whether function UpdateClientData in dll.cpp is necessary? Count Floyd spoke, that she is not necessary.
|
Re: Detecting fall damage in a safe way?
It is not necessary. You can delete it.
This function is used by clients to ask the server to send a network message containing various data about the client, so that the client can update itself and synchronize with the server. It would be useful for a client-side bot. But since your bot is a server-side bot, all the data concerning your bots is available through pBot->pEdict, and you don't need to ask the server to send you anything because you use the same structures as the server. |
Re: Detecting fall damage in a safe way?
UpdateClientData is only used in the bot code to find out if the bots weapons have been changed and it's weapons haven't been updated yet. You only need to use it if a bot drops its weapon, as it doesnt get removed from the bots weapons bitmask (but it does in the pev->weapons bitmask).
UpdateClientData uses some cpu I think, so I just replaced it by checking pev->weapons instead of cd.weapons that comes from UpdateClientData. |
Re: Detecting fall damage in a safe way?
thanks guys, i think i can work with this stuff! :D
|
All times are GMT +2. The time now is 04:58. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.