Raised This Month: $ Target: $400
 0% 

Some TF2 and Misc Questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chase
Junior Member
Join Date: Oct 2009
Location: California
Old 10-11-2009 , 22:02   Some TF2 and Misc Questions
Reply With Quote #1

The past few weeks I've started to get into writing server mods since I've been bored with my usual projects. I found AlliedModders to be, by far, the best resource for this kind of thing. I've handled most the "quirks" of scripting this system but there's a few questions I still have. And although I haven't read all of the resources available regarding scripting, I still haven't found answers to these questions.
  • Is there a good (and clean) way to find the default health for a player, without running through equipment checks for Sandman and the like?
  • What exactly is the Action: prefix in function headers, and why would it be necessary for things like hooking events but not hooking convar changes?
  • Can we detect teammates hitting one-another without mp_friendlyfire? And if not, would it be alright (in terms of modder practice) to modify this cvar temporarily for a particular plugin?
  • The player_healedbymedic event seems to not be firing for me. Is it broken functionality or am I just stupid?
That's all the questions I can think of at the moment. Some ideas on these things would be greatly appreciated.

Last edited by Chase; 10-12-2009 at 01:02.
Chase is offline
Send a message via MSN to Chase
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 10-11-2009 , 22:41   Re: Some TF2 and Misc Questions
Reply With Quote #2

1.
Code:
new iDefaultHealth = GetEntProp(client, Prop_Send, "m_iMaxHealth");
4. The player_healedbymedic event is probably client-side and not fired on the server.
pheadxdll is offline
Chase
Junior Member
Join Date: Oct 2009
Location: California
Old 10-11-2009 , 22:47   Re: Some TF2 and Misc Questions
Reply With Quote #3

Thanks. And that reminds me of another question, is there a centralized reference for all the various entity properties and who they apply to, or do I have to dig around in header files myself?

Also would there be an alternate way to check for medic healing? Or general increase in HP, without using any sort of constantly looping check.
__________________

Last edited by Chase; 10-11-2009 at 22:51.
Chase is offline
Send a message via MSN to Chase
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 10-11-2009 , 23:02   Re: Some TF2 and Misc Questions
Reply With Quote #4

Yes, the data and net props can be found on this page: http://wiki.alliedmods.net/Category:Game_Resources You can run the command sm_dump_netprops to generate a list for your mod as well.

I can't think of anyway to hook medic healing offhand without the use of an extension, sorry.
pheadxdll is offline
Theme97
Senior Member
Join Date: Mar 2009
Old 10-12-2009 , 00:19   Re: Some TF2 and Misc Questions
Reply With Quote #5

Quote:
Originally Posted by Chase View Post
  • What exactly is the Action: prefix in function headers, and why would it be necessary for things like hooking events but not hooking convar changes?
If you recall this bit on handles, it's a special type of handle that comes from an enum (see here) that consists of Plugin_Continue, Plugin_Changed, Plugin_Handled, and Plugin_Stop.

For events, you only need Action: when it's a pre-hook, as you can change stuff. For post hooks, you don't need Action: at all as the return value is ignored.

As for ConVar changes, they're just like event post hooks, since there's really nothing you can do about the change but resend a change if you want to overwrite it.

Quote:
Originally Posted by Chase View Post
  • Can we detect teammates hitting one-another without mp_friendlyfire? And if not, would it be alright (in terms of modder practice) to modify this cvar temporarily for a particular plugin?
Probably not, but it's probably fine to mess if you know it's the only way and it doesn't conflict with anything else. Just remember to keep a disclaimer somewhere and try to make changes to the variable hidden.
__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All
Theme97 is offline
Chase
Junior Member
Join Date: Oct 2009
Location: California
Old 10-12-2009 , 00:42   Re: Some TF2 and Misc Questions
Reply With Quote #6

Oh wow, I completely overlooked the fact that Action would be a type/enumeration.

Thanks guys, you cleared up quite a bit that's been bugging me, as well as pointing me to some other quite handy resources.
__________________
Chase is offline
Send a message via MSN to Chase
Theme97
Senior Member
Join Date: Mar 2009
Old 10-12-2009 , 02:39   Re: Some TF2 and Misc Questions
Reply With Quote #7

Hah, just realized my "Probably not" wasn't in reply to what I wanted it to.

It was an answer to the first part of your question.
__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All
Theme97 is offline
Reply



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 12:13.


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