Raised This Month: $ Target: $400
 0% 

attempting to make medigun hurt players using tf2items.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
possibly_yaboi_mark
Junior Member
Join Date: Jul 2022
Old 07-17-2022 , 02:35   attempting to make medigun hurt players using tf2items.
Reply With Quote #1

for various reasons, i need to make the mediguns in tf2 hurt players, as opposed to heal, and after messing with tf2items, specifically the attributes of heal rate penalty (index seven), attributes of heal rate bonus (index eight), and even negative numbers, i cannot figure out how to get it to function in the way i wish. is it possible i am missing something?
possibly_yaboi_mark is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-25-2022 , 04:59   Re: attempting to make medigun hurt players using tf2items.
Reply With Quote #2

TF2Items can generally only do things that are already done in the game.
__________________
asherkin is offline
Blinx
Senior Member
Join Date: Oct 2013
Old 08-12-2022 , 06:18   Re: attempting to make medigun hurt players using tf2items.
Reply With Quote #3

Quote:
Originally Posted by possibly_yaboi_mark View Post
for various reasons, i need to make the mediguns in tf2 hurt players, as opposed to heal, and after messing with tf2items, specifically the attributes of heal rate penalty (index seven), attributes of heal rate bonus (index eight), and even negative numbers, i cannot figure out how to get it to function in the way i wish. is it possible i am missing something?
It's probably just not going to be possible, it's likely that it's hardcoded in TF2 that the medigun can only provide health, not take it away.

You'd probably have a better chance of hooking the "player_healed" event, and then either trying to set the "amount" to a negative value, or, setting it to 0 and then hurting the patient.

PHP Code:
"player_healed"
{
    
"patient"    "short"
    "healer"    "short"
    "amount"    "short"

Edit:

I had an explore of this myself, player_healed does not fire on every heal event, it fires every time that number pops up in the world that says how much you healed, so it's not reliable, it also doesn't consider overheal.

The method I ended up using was hooking the players prethink, checking to see if their medigun had a heal target, and if so, damage that heal target. If you need more guidance let me know.

Last edited by Blinx; 08-12-2022 at 09:06.
Blinx is offline
possibly_yaboi_mark
Junior Member
Join Date: Jul 2022
Old 08-29-2022 , 22:30   Re: attempting to make medigun hurt players using tf2items.
Reply With Quote #4

Quote:
Originally Posted by Blinx View Post
It's probably just not going to be possible, it's likely that it's hardcoded in TF2 that the medigun can only provide health, not take it away.

You'd probably have a better chance of hooking the "player_healed" event, and then either trying to set the "amount" to a negative value, or, setting it to 0 and then hurting the patient.

PHP Code:
"player_healed"
{
    
"patient"    "short"
    "healer"    "short"
    "amount"    "short"

Edit:

I had an explore of this myself, player_healed does not fire on every heal event, it fires every time that number pops up in the world that says how much you healed, so it's not reliable, it also doesn't consider overheal.

The method I ended up using was hooking the players prethink, checking to see if their medigun had a heal target, and if so, damage that heal target. If you need more guidance let me know.
thank you, that seems to have worked.
possibly_yaboi_mark is offline
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 03:48.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode