.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   cs weapons modification (http://forums.bots-united.com/showthread.php?t=4017)

BotUser 26-05-2005 01:30

cs weapons modification
 
Hi all,

I'm notoriously annoyed by the low damage HE grenades inflict in CS
(I'm talking of CS 1.6).

Hence, I decided to tackle on this on my own, such as to write an own metamod plugin in order to modify the HE grenades' damage.

Now the question: can this be done at all ?

How would one do it ? Modify the grenade's damage somehow or alter the damage that is inflicted on a player entity ?

Thanks and regards,

BotUser

Lazy 26-05-2005 02:06

Re: cs weapons modification
 
You can't modify the damage it does but it is possible to fake it by adding more damage after it's been done.
You need to look for the server->client messages that say a grenade is exploding, get the origin and apply damage to people in that radius.
To find out who threw it, do a FindEntityInSphere at the origin and check for grenade entities. The grenade's owner should be in edict_t*->v.owner.

Somewhere on here I posted a function to do damage on players using trigger_hurts, can't find it for some reason but if you can that should work well enough.

BotUser 08-09-2005 16:04

Re: cs weapons modification
 
Thanks for your input. I browsed through the SDK and I think I could gather what I need (function RadiusDamage to inflict damage, just needs the Vector of the nade, the inflictor, the attacker etc etc).

However, I did not get how to determine if a grenade is exploding to trigger the RadiusDamage function. You're writing about a server->client messages thing. Could you elaborate that a bit more for me poor newbie ? How do I catch the event of an exploding nade ?

Thanks a lot

botuser

PS: yes, I'm, still on the hunt concerning this, though it's a long time I posted my question :-)

Pierre-Marie Baty 08-09-2005 16:16

Re: cs weapons modification
 
All grenades explode after the same amount of time. You could start a timer when the grenade is fired? (that's the simplest of the solutions, perhaps not the most elegant, ok).

BotUser 08-09-2005 17:00

Re: cs weapons modification
 
Hi PMB,but that seems to boil down to the same problem. Finding out the point of time when a grenade is thrown would require me to react to a "throw-event" as well.

Maybe I didn't get it right. Please bear with me.

On the other hand, I'd like to not just make it work, but do it in the "right" way.
So if someone could kindly enlighten me concerning this message interception from server to client regarding an explosion event.

Thanks

botuser

Pierre-Marie Baty 08-09-2005 21:38

Re: cs weapons modification
 
I don't know by heart the type of message that is fired when a grenade explodes, but if I were you, here's what I'd do:

First, I'd download PMTools (get it from the filebase) and I'd set it to log all network messages to a text file with full details on.

Then, I'd run a game, spawn, buy a grenade, throw it, let it explode and after that I'd quit.

All the details about the network message that is involved when a grenade explodes will be in the PMTools log file you specified.

Then, in order to know how to hook a network message, I'd just look at the PMTools source code, since that's basically what it does :)

BotUser 09-09-2005 09:06

Re: cs weapons modification
 
Hi PMB,


many thanks for your suggestions. Well, that sounds like a plan. I'll try that and report back :)

botuser

The Storm 09-09-2005 11:33

Re: cs weapons modification
 
I have one question,
PMB where I can find the log file that is exported by PMtools?

BotUser 09-09-2005 13:47

Re: cs weapons modification
 
Hi,

I just used the PMTools plugin to log the messages.

Just enter
logfile "C:\msg.txt"
(for example) in the console to set the logfile output to C:\msg.txt

botuser

BotUser 09-09-2005 16:59

Re: cs weapons modification
 
So, I had a look at the log which PMTools was spitting out.
Since I didn't know which message to hook into, I had to change the source code a little to have it hook into every message. I didn't find a way to tell PMTools to log just any message. But nevertheless.

What I found is that there seems no special message associated with the detonation of a HE grenade. The only message I got was a "Damage" message since I dropped the nade directly in front of me. Hmmm .....

Well, but if I can get a "Damage" message for an entity, might it be possible to determine the damage inflictor, and if the inflictor is a HE grenade, just modify the damage/health of the respective entity ?

Input more than welcome.

botuser


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

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