![]() |
Condition Zero TraceLine() weirdness
I am creating a plugin that keeps humans from taking headshot damage and 1/2 the normal damage. I am trying to do all this in TraceLine()
The head shot part works fine. Code:
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) Code:
// --------------------------------------------------------------------------------------- |
Re: Condition Zero TraceLine() weirdness
Don't the bots use tracelines to find targets within their field of view?
Try halving the amount of damage done instead of the number of shots that hit. |
Re: Condition Zero TraceLine() weirdness
Quote:
Can I do that from traceline? If so How? Thanks. P.S. The plugin actually works as expected. No head shots to humans and only every other shot does damage. It is just the bots get weird when the every other hit section is enabled.. |
Re: Condition Zero TraceLine() weirdness
I don't think you can do that from a traceline unless you knew that the traceline was only used for a TraceAttack() command.
I'd hook the damage function like voogru suggested in the other post. You may be able to edit the network message info that has been sent. The bots probably go weird becuase they use the traceline function to see if their enemy is visible and will look for their head. |
Re: Condition Zero TraceLine() weirdness
Why are you writing a CZ bot, anyway? What's the point?
|
Re: Condition Zero TraceLine() weirdness
You can't change the amount of damage taken from the TraceLine that the bullet calls. You may be able to do it from a plugin by 1°) intercepting and changing on the fly all the "damage" network messages that the server sends and 2°) NOT FORGETTING to adapt the victim edict's health and armor on the server side too when you change one of them (but only after the messages are sent).
|
Re: Condition Zero TraceLine() weirdness
Thanks for all the suggestions.
I figured out what was wrong... The weird problems happen when you, 1) check if it is NOT a bot being traced lined and 2) you DON"T check for a body part hit and 3) you deny the damage! If it isn't a FL_FAKECLIENT it doesn't mean it IS a human. It could be anything! And when it ISN"T a HUMAN and you refuse the TraceLine() weird thigns will happen because ALL tracelines on most everything will fail. (as everyone was indicating...) To get done what I am trying to do: 1) no head shots to human and 2) every 4th bullet doesn't do damage, here is the code: This works fine. Code:
// --------------------------------------------------------------------------------------- |
Re: Condition Zero TraceLine() weirdness
If you want to be SURE it's a human client the target of the TraceLine (and not a bot nor anything else), you can do this:
Code:
// is a human taking damage? |
Re: Condition Zero TraceLine() weirdness
you could possibly tell if a bot is trying to use a traceline by checking "pentToSkip" and see if that is a bot. Incase you want to ignore any tracelines a bot wants to make incase it's just checking for visibles.
|
All times are GMT +2. The time now is 00:36. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.