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

Solved [TF2] Fixing laggy physics-affected health packs?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 07-20-2020 , 05:10   [TF2] Fixing laggy physics-affected health packs?
Reply With Quote #1

SOLVED: The solution was to do this:
Spoiler


I'm trying to find a way to spawn a physics-affected health pack, like the ones dropped by players when killed in Medieval Mode or by a candy cane Scout.
Preferably within the boundaries of normal Sourcemod entity-spawning of CreateEntityByName and such.


So far, I got it to work except for one crucial thing:
The physics are updating in just half-seconds, resulting in it being slow and laggy.

Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (SpawnPhysicsHealthKit.sp - 100 views - 7.1 KB)
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 07-22-2020 at 09:56.
Shadowysn is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-20-2020 , 05:17   Re: [TF2] Spawning physics-affected health packs?
Reply With Quote #2

The robust way would be an SDKCall on either CTFPowerup::DropSingleInstance() (applied to your health / ammo pack), or CTFPlayer::DropHealthPack() (which calls the former internally).

Internally, it sets MOVETYPE_FLYGRAVITY and MOVECOLLIDE_FLY_BOUNCE and a few other properties, including removing itself after some time and setting the owner.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 07-20-2020 at 05:18.
nosoop is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 07-20-2020 , 05:54   Re: [TF2] Spawning physics-affected health packs?
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
The robust way would be an SDKCall on either CTFPowerup::DropSingleInstance() (applied to your health / ammo pack), or CTFPlayer::DropHealthPack() (which calls the former internally).

Internally, it sets MOVETYPE_FLYGRAVITY and MOVECOLLIDE_FLY_BOUNCE and a few other properties, including removing itself after some time and setting the owner.
Yeah, but that does require a signature.
I know I said 'screw it, go full sig', but my mind is kind of inconsistent. :I

If 1 week goes by and there still hasn't been a solution to this without using one, I'll mark this as Solved and use a signature instead.
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 07-20-2020 at 05:55.
Shadowysn 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 08:48.


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