-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetBonePosition and GetBoneMatrix on the player clientside during server lag or hiccups will return the position on the server instead of on the client #884
Comments
Until this is resolved, personally what I would do is create a model that has no actual mesh, and is just a bone merge-able skeleton. Maybe one that only has a ValveBiped.Bip01_Head1 bone. Give each player their own clientside instance of this model, bonemerge it to them, and then parent the hat to that ClientsideModel. 💌 |
I am not sure if studiomdl.exe will allow you to compile a model without mesh. |
@thedaneeffect Interesting workaround. I'll probably make a toggleable clientside fix that does this with the players player model. @robotboy655 Sorry, I don't see what that has to do with this. |
@CapsAdmin, It is a reply to that suggested workaround. |
@robotboy655 I know you can for sure, because I made a view model before that had not a single vertex and I got it to compile successfully, and bonemerge in-game. :) @CapsAdmin bm_head.smd
bm_head.qc
If you're on windows, I made a batch for just typing in the .qc name without extension. (You can do sub-directories too like 'subfolder/another/file') @echo off
set drive=C
set common=%drive%:\Program Files (x86)\Steam\SteamApps\common\
set studiomdl=%common%Counter-Strike Source\bin\studiomdl.exe
set game=%common%GarrysMod\garrysmod\
:input
echo Enter a .QC name.
set /p name="] " %=%
"%studiomdl%" -game "%game%" "%name%.qc"
pause
cls
goto input Entity AddCSLuaFile()
DEFINE_BASECLASS( "base_anim" )
ENT.PrintName = "Bonemerge Test";
ENT.Spawnable = true;
ENT.AdminOnly = false;
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT;
ENT.AutomaticFrameAdvance = true;
function ENT:SpawnFunction( ply, tr, ClassName )
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 64;
local ent = ents.Create( ClassName )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
ent:GetPhysicsObject():Sleep();
return ent
end
local function Merge( Entity, Parent )
Entity:AddEffects( EF_BONEMERGE );
Entity:SetParent( Parent );
Entity:SetMoveType( MOVETYPE_NONE );
Parent:CallOnRemove( tostring( Entity ), function() Entity:Remove() end );
return Entity;
end
function ENT:Initialize()
if ( SERVER ) then
local size = 32;
self:SetModel( "models/alyx.mdl" )
self:PhysicsInitSphere( size )
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
self:SetCollisionBounds( Vector( -size, -size, -size ), Vector( size, size, size ) )
else
self.m_Head = Merge( ClientsideModel( "models/bm_head.mdl" ), self );
-- We're going to attach a non-bonemerge-able model with our custom bonemerge model.
self.m_Model = ClientsideModel( "models/props_junk/PlasticCrate01a.mdl" );
self.m_Model:SetParent( self.m_Head );
self:CallOnRemove( tostring( self.m_Model ), function() self.m_Model:Remove() end );
end
end Here's a picture of what all of this produces: http://puu.sh/7HKRu/1dbf5970ae.png You can adjust the relative position and angles of the prop simply by setting :SetAngles() and :SetPos() Edit: I always end up putting so much time into things like this... I read this and suddenly got the idea originally posted. Turns out it works perfectly with any prop and I just made this http://puu.sh/7HLSc/fbf11dede5.png IT'S SO CUTE |
Any success on fixing it 5 years later? Still having some issues with my custom camera thingies and waiting for the fix ;) |
Any news on this? |
This is bad when using these functions to make something follow the player (like a hat)
The text was updated successfully, but these errors were encountered: