Raised This Month: $13 Target: $400
 3% 

Solved [TF2] Acquire player's weapon_bone coordinates?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 10-15-2019 , 06:52   [TF2] Acquire player's weapon_bone coordinates?
Reply With Quote #1

(SOLVED, GO TO SECOND LAST POST FOR SOLUTION)
SetParent and SetParentAttachment don't work this time, unfortunately.

I'm trying to make a dropped clone of the player's weapon, but after switching to using offsets to spawn the weapon it's physics now freeze.
(If you don't know what offsets I'm talking about, it's like signatures but easier to find due to asherkin's vtable dumper)

I soon found out that the cause was the parenting, where it had previously worked for a CreateEntityByName-spawned weapon drop.

Before I wrote up the code utilizing SetParent on the given entity, I had experimented with getting an origin and angles from a parented info_target but it didn't work too well once I found out it doesn't have an origin property...

Now I brought back that old info_target thing after finally discovering datamaps existed, but GetEntPropVector reports the datamap as out of bounds, only having 1 element... (Happens to m_vecOrigin, m_angRotation plus their Abs counterparts m_vecAbsOrigin, m_angAbsRotation respectively)

Anyone willing to offer some help? I don't exactly use IDA so... er...

EDIT:
DeadRinger.smx
DeadRinger.sp
tf2.allclass-deadringer.txt
Put the .txt file into the gamedata folder.

Last edited by Shadowysn; 10-19-2019 at 11:54.
Shadowysn is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-15-2019 , 15:43   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #2

Lets skip past what you think the solution is a double check your XY problem.

What are you trying to do?
__________________
Neuro Toxin is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 10-16-2019 , 01:32   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
Lets skip past what you think the solution is a double check your XY problem.

What are you trying to do?
I'm trying to create a dropped weapon with the same properties of the player's active weapon without removing the active weapon A.L.A dead ringer weapon drop. I'm trying to recreate a feign death
I want to spawn the dropped weapon on the coordinates of the player's weapon bone.

I initially used SetParent and SetParentAttachment but after I decided to spawn a dropped weapon using gamedata, it's physics no longer work/sleep and it stays frozen in the air if I used the parent method, which I don't want it to. The physics'll work if I just leave it alone after spawning, but then it won't spawn on the player's weapon bone.

Yes I tried the Wake input and no, it doesn't work because the dropped weapon doesn't have the input.

Last edited by Shadowysn; 10-16-2019 at 01:35.
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
Old 10-16-2019 , 02:35   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #4

Quote:
Originally Posted by Shadowysn View Post
I'm trying to create a dropped weapon with the same properties of the player's active weapon without removing the active weapon A.L.A dead ringer weapon drop. I'm trying to recreate a feign death
I want to spawn the dropped weapon on the coordinates of the player's weapon bone.

I initially used SetParent and SetParentAttachment but after I decided to spawn a dropped weapon using gamedata, it's physics no longer work/sleep and it stays frozen in the air if I used the parent method, which I don't want it to. The physics'll work if I just leave it alone after spawning, but then it won't spawn on the player's weapon bone.

Yes I tried the Wake input and no, it doesn't work because the dropped weapon doesn't have the input.
I had that issue where physics were frozen on L4D2_Defib_Ragdolls

So i had to damage the ragdoll with DMG_CLUB or DMG_BLAST
https://github.com/LuxLuma/L4D2_Defi...s.sp#L337-L357

https://github.com/LuxLuma/L4D2_Defi...gdolls.sp#L276

Because using TeleportEntity() would cause the ragdoll to sleep.

Maybe this will work in TF2?
Incase you have an issue with damage forces and can't disable it, you can make a damage hook and edit damage forces in there to 0

https://github.com/LuxLuma/L4D2_Defi...s.sp#L232-L240

Like here i do with the ragdoll editing the damage forces.
__________________

Last edited by Lux; 10-16-2019 at 02:36.
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 10-16-2019 , 06:49   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #5

Quote:
Originally Posted by Lux View Post
I had that issue where physics were frozen on L4D2_Defib_Ragdolls

So i had to damage the ragdoll with DMG_CLUB or DMG_BLAST
https://github.com/LuxLuma/L4D2_Defi...s.sp#L337-L357

https://github.com/LuxLuma/L4D2_Defi...gdolls.sp#L276

Because using TeleportEntity() would cause the ragdoll to sleep.

Maybe this will work in TF2?
Incase you have an issue with damage forces and can't disable it, you can make a damage hook and edit damage forces in there to 0

https://github.com/LuxLuma/L4D2_Defi...s.sp#L232-L240

Like here i do with the ragdoll editing the damage forces.
I tried what you said, but it also didn't work. The point_hurt is spawned and works, but the weapon remains frozen in the air.
Shadowysn is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 10-16-2019 , 08:27   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #6

https://forums.alliedmods.net/showthread.php?t=266692 ?
__________________
Pelipoika is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 10-16-2019 , 09:17   Re: [TF2] Spawn weapon drop onto player's hands properly WITHOUT SetParentAttachment?
Reply With Quote #7

Quote:
Originally Posted by Pelipoika View Post
I've already checked that discussion before I came up with spawning a dropped weapon, and there isn't anything that can help wake up the physics of the dropped weapon, or even prevent it sleeping in the first place.
I'm spawning the weapon through the signatures, yeah.
Spawning that weapon through the sig, then using SetParent + SetParentAttachment causes it to sleep/remain frozen in the air.

That bug didn't happen on a dropped weapon made by CreateEntityByName.

I've decided to post the full Dead Ringer sp file on the first post. Check up there.
Oh yeah, it's also the first time I'm using attachments so forgive me for it looking like a link.
EDIT: My dumbass forgot to include the gamedata, sorry for throwing any of you off.

Last edited by Shadowysn; 10-16-2019 at 09:22.
Shadowysn is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 10-18-2019 , 14:35   Re: [TF2] Spawn weapon drop on player's hand coords properly WITHOUT SetParentAttachm
Reply With Quote #8

Quote:
Spawn weapon drop on player's hand coords properly WITHOUT SetParentAttachment?
What is a whole idea of what you doing? Is EquipPlayerWeapon() not work for you?

If you need a clone, that should be something like CreateEntityByName + tf_weapon_* - see:
https://developer.valvesoftware.com/...ess_2_Entities
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Location: Methamphetamine
Old 10-18-2019 , 19:03   Re: [TF2] Spawn weapon drop on player's hand coords properly WITHOUT SetParentAttachm
Reply With Quote #9

If tf2 has features like this you can try through signatures like I did but this is for l4d2

Using the signatures I got the coordinates of the bones
what you need should be in the 44-56 lines
Attached Files
File Type: txt GetBone.txt (541 Bytes, 77 views)
File Type: sp Get Plugin or Get Source (Test.sp - 183 views - 6.5 KB)
__________________
Heart

Last edited by BHaType; 10-18-2019 at 19:39.
BHaType is offline
Send a message via AIM to BHaType
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 10-19-2019 , 00:52   Re: [TF2] Spawn weapon drop on player's hand coords properly WITHOUT SetParentAttachm
Reply With Quote #10

Quote:
Originally Posted by Dragokas View Post
What is a whole idea of what you doing? Is EquipPlayerWeapon() not work for you?

If you need a clone, that should be something like CreateEntityByName + tf_weapon_* - see:
https://developer.valvesoftware.com/...ess_2_Entities
F***, I knew I should've worded it more properly to avoid confusion. Then again, I had flu at the time so I wasn't really paying attention.
I want to replicate the effect of dropping a weapon like in a feign death.
Quote:
Originally Posted by BHaType View Post
If tf2 has features like this you can try through signatures like I did but this is for l4d2

Using the signatures I got the coordinates of the bones
what you need should be in the 44-56 lines
Well, thanks. Unsure of whether it'll work in TF2 or not, something tells me it may not.
If it doesn't, then I'm in a bit of a pickle regarding IDA; I don't know how to use it to find signatures.
I'd like to find signatures by myself, but all of the tutorials I found only gave a bit of info at it's best.
Plus, I really don't want to get a VAC ban and I don't have any other PC operating system other than Windows.
__________________

Last edited by Shadowysn; 10-19-2019 at 01:36.
Shadowysn 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 05:47.


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