Raised This Month: $51 Target: $400
 12% 

[TF2] Weapon Physics Object?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SparkyMcSparks
Junior Member
Join Date: Jul 2014
Old 08-17-2015 , 03:15   [TF2] Weapon Physics Object?
Reply With Quote #1

This isn't directly pertinent to SourceMod but figure someone here may have some insight which will be much appreciated.

Basically I want to create an object that an be tossed around and picked up by all players. The Sandman bat / baseball on the scout is a great example of what I want to achieve (minus the bat, so more like a football)!

I want it to function as a weapon so you commit to holding (temp swap out of primary weapon) and hitting the fire button will toss it so then any player can grab it next (with your primary coming back up).

It seems like replicating however the Sandman works would be easiest rather than trying to hack around in SourceMod -- at least for the weapon tossing part of it? But I've never messed with the weapon files so I'm lost there and whenever I Google for tutorials config "scripts" only come up.

Last edited by SparkyMcSparks; 08-17-2015 at 03:17.
SparkyMcSparks is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-17-2015 , 15:27   Re: [TF2] Weapon Physics Object?
Reply With Quote #2

Hmm.... a few thoughts on the matter:
  • The pickup and drop could be replicated by using the intelligence (item_teamflag entity) or one of the Mannpower powerups (item_powerup_rune entity).
  • The plugin would have to somehow deal with temporarily blocking a user's weapons. Maybe force them to have the melee-only Mannpower powerup?
  • Throw would be a problem. L (by default) drops the intelligence or Mannpower powerup. Intelligence drops at your feet while Mannpower powerups are tossed in a short arc. Maybe if the player is carrying the item, make OnPlayerRunCmd check for IN_ATTACK1 or IN_ATTACK2 and make the player use the dropitem command?

There's still going to be an issue with the player not having a viewmodel for the item.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
SparkyMcSparks
Junior Member
Join Date: Jul 2014
Old 08-17-2015 , 21:26   Re: [TF2] Weapon Physics Object?
Reply With Quote #3

Thanks Powerlord for the response! These sounds like great alternatives to be thinking about.

I was really hoping for sticking to a weapon file since it'd handle all the caveats you brought up to alternate methods.


Simply put, is it not possible for me to just take the gnome "weapon" from L4D2 and port that into TF2 changing the model? From what I gather, making a custom weapon for TF2 is limited to merely model replacements?

It sounds like I'm trying to do something complicated but really I just want to take the L4D2 Gnome or TF2 Sandman (minus the bat) to have an object that be thrown around w/ viewmodel support. My background is deeply in Quake / Call of Duty engine where something like this is as simple as using the weapon editor to point to a model, animation, and projectile physics and scripting a watcher thread for pickup.
SparkyMcSparks is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-18-2015 , 18:44   Re: [TF2] Weapon Physics Object?
Reply With Quote #4

http://www.teamfortress.com/post.php?id=17833

Valve/Bad Robot beat you to it.

Incidentally, the new ball gun is definition index 1155 and has the item class "tf_weapon_passtime_gun" and no attributes.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-18-2015 at 19:04.
Powerlord is offline
SparkyMcSparks
Junior Member
Join Date: Jul 2014
Old 08-18-2015 , 20:44   Re: [TF2] Weapon Physics Object?
Reply With Quote #5

Yeah saw that and quickly played a few rounds. I always like less work I need to do exactly what I need (at least for the whole ball mechanic)!

The game mode itself, PASS, I'm not a huge fan of but that's not the mode I wanted to make.

Time to get busy designing now!
SparkyMcSparks is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-19-2015 , 15:27   Re: [TF2] Weapon Physics Object?
Reply With Quote #6

There's some new entities to play around with too.

For example, there's:
  • info_passtime_ball_spawn - This is where PassTime game modes drop the ball from.
  • passtime_ball - The ball itself.
  • passtime_logic - This a point entity that tells TF2 this is a PassTime game. (similar to how tf_logic_arena tells the game that you're in an arena map). It has some settings and outputs that can be used to control the game. The SpawnBall input is in here too.
  • trigger_passtime_ball - A brush entity that triggers when the ball enters it. Not sure of its use because...
  • func_passtime_goal - ...the goal is its own brush entity.
  • trigger_catapult - A brush representing the jumppads. OnCatapulted should call the JumpPadUsed input on passtime_logic.
  • _ballplayertoucher - No idea what this is, but it's likely involved with picking up the ball. It only has DataMaps and is otherwise a CBaseEntity.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-19-2015 at 16:44.
Powerlord 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 15:27.


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