Thread: TF2 Stocks
View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-22-2012 , 10:43   Re: TF2 Stocks
Reply With Quote #7

Quote:
Originally Posted by ntp View Post
is there an updated version of this?
Which function specifically are you looking for?

  • tf2_ammo may still work, but Valve introduced energy weapons since then, so this likely needs an update.
  • tf2_build... I haven't had a chance to check this one out. However, SourceMod is currently having issues with entity creation, so it's likely broken right now until that issue is fixed even if the method it's using still works.
  • tf2_cloak should still be working fine.
  • tf2_flag should still be working fine.
  • tf2_game_text... I'm not sure about that one.
  • tf2_objects was moved into SourceMod itself under tf2_stocks, check its documentation for changes. You also need TF2_GetObjectMode to find out which end of a teleporter is which.
  • tf2_optional will cause issues with the TF2 extension, as it already contains the function named there.
  • tf2_player... see below.
  • tf2_uber should still be working fine.


tf2_player:

The following functions were moved into SourceMod itself:
  • enum TFPlayerCond is now enum TFCond in the tf2 extension (note: docs are slightly out of date; there are some new conditions not mentioned in there).
  • TF2_GetPlayerCond became TF2_GetPlayerConditionFlags, which got deprecated when TF2 changed how conditions worked.
  • TF2_Is<condition> and TF2_IsPlayer<condition> were unified into a single command: TF2_IsPlayerInCondition in tf2_stocks. This officially replaced TF2_GetPlayerConditionFlags.
  • In addition to the above, there are also TF2_AddCondition, TF2_RemoveCondition, TF2_OnConditionAdded callback, and TF2_OnConditionRemoved callback. All are in the tf2 extension.
The following were only slightly useful, as items modified things:
  • TF2_GetClassHealth - Scout, DemoMan, Heavy, Medic, and Spy all have items that change their starting health. You should GetEntProp(client, Prop_Send, "m_iMaxHealth") instead.
  • TF2_GetClassSpeed - This was pretty useless before due to Scout, Soldier, Pyro, DemoMan, and Heavy having items that adjusted movespeed. With the introduction of MvM, in which every class has the ability to buy move speed increases, it's even less useful. Use the code for TF2_GetPlayerSpeed below.
These were not carried over:
  • TF2_GetClassName - A shortcut for GetEntPropString(client, Prop_Data, "m_iClassname", classname, sizeof(classname))
  • TF2_GetPlayerSpeed - A shortcut for GetEntProp(client, Prop_Data, "m_flSpeed")
  • TF2_GetNumHealers - A shortcut for GetEntProp(client, Prop_Send, "m_nNumHealers")
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline