Don't have one, but you mean something like this right?
[url]http://www.garrysmod.org/downloads/?a=view&id=110052[/url]
Yep, that's no longer supported and doesn't work in GM13.
I knew that, and not jabbing at you in particular, but is it that hard to just include the lower body a model on your screen? I'm surprised something like that takes so much work.
Anyone? :C
I love this addon to much. and this could help me improve on my lua skills im a bit of a beginner so ill do my best to fix it up for gmod 13 :D
I think it was broken due to BuildBonePosition not working anymore.
I also thought it was a great mod.
Somebody did something similar for L4D2:
[url]http://www.youtube.com/watch?v=tVhudU7mbN0[/url]
However, it uses commands that just so happen to be exclusively part of the L4D engine. I'm sure it's possible, somehow.
It's just thirdperson with the camera position moved.
[QUOTE=Chessnut;38660442]It's just thirdperson with the camera position moved.[/QUOTE]
It works pretty effectively, though. Simple solutions are almost always better solutions.
Elevator Source has this feature working in Gmod 13. You might be able to take the code from there.
AFAIK Garrysmod Tower also has this feature.
Here have fun :smile:
[lua]
--[[
Fix by Valkyrie
--]]
if SERVER then
AddCSLuaFile( "cl_legs.lua" )
return
end
local Legs = {}
Legs.LegEnt = nil
function ShouldDrawLegs()
return IsValid( Legs.LegEnt ) and
( LocalPlayer():Alive() or ( LocalPlayer().IsGhosted and LocalPlayer():IsGhosted() ) ) and
!Legs:CheckDrawVehicle() and
GetViewEntity() == LocalPlayer() and
!LocalPlayer():ShouldDrawLocalPlayer() and
!LocalPlayer():GetObserverTarget() and
!LocalPlayer().ShouldDisableLegs
end
function GetPlayerLegs( ply )
return ply and ply != LocalPlayer() and ply or ( ShouldDrawLegs() and Legs.LegEnt or LocalPlayer() )
end
Legs.FixedModelNames = {
["models/humans/group01/female_06.mdl"] = "models/player/group01/female_06.mdl",
["models/humans/group01/female_01.mdl"] = "models/player/group01/female_01.mdl",
["models/alyx.mdl"] = "models/player/alyx.mdl",
["models/humans/group01/female_07.mdl"] = "models/player/group01/female_07.mdl",
["models/charple01.mdl"] = "models/player/charple01.mdl",
["models/humans/group01/female_04.mdl"] = "models/player/group01/female_04.mdl",
["models/humans/group03/female_06.mdl"] = "models/player/group03/female_06.mdl",
["models/gasmask.mdl"] = "models/player/gasmask.mdl",
["models/humans/group01/female_02.mdl"] = "models/player/group01/female_02.mdl",
["models/gman_high.mdl"] = "models/player/gman_high.mdl",
["models/humans/group03/male_07.mdl"] = "models/player/group03/male_07.mdl",
["models/humans/group03/female_03.mdl"] = "models/player/group03/female_03.mdl",
["models/police.mdl"] = "models/player/police.mdl",
["models/breen.mdl"] = "models/player/breen.mdl",
["models/humans/group01/male_01.mdl"] = "models/player/group01/male_01.mdl",
["models/zombie_soldier.mdl"] = "models/player/zombie_soldier.mdl",
["models/humans/group01/male_03.mdl"] = "models/player/group01/male_03.mdl",
["models/humans/group03/female_04.mdl"] = "models/player/group03/female_04.mdl",
["models/humans/group01/male_02.mdl"] = "models/player/group01/male_02.mdl",
["models/kleiner.mdl"] = "models/player/kleiner.mdl",
["models/humans/group03/female_01.mdl"] = "models/player/group03/female_01.mdl",
["models/humans/group01/male_09.mdl"] = "models/player/group01/male_09.mdl",
["models/humans/group03/male_04.mdl"] = "models/player/group03/male_04.mdl",
["models/player/urban.mbl"] = "models/player/urban.mdl",
["models/humans/group03/male_01.mdl"] = "models/player/group03/male_01.mdl",
["models/mossman.mdl"] = "models/player/mossman.mdl",
["models/humans/group01/male_06.mdl"] = "models/player/group01/male_06.mdl",
["models/humans/group03/female_02.mdl"] = "models/player/group03/female_02.mdl",
["models/humans/group01/male_07.mdl"] = "models/player/group01/male_07.mdl",
["models/humans/group01/female_03.mdl"] = "models/player/group01/female_03.mdl",
["models/humans/group01/male_08.mdl"] = "models/player/group01/male_08.mdl",
["models/humans/group01/male_04.mdl"] = "models/player/group01/male_04.mdl",
["models/humans/group03/female_07.mdl"] = "models/player/group03/female_07.mdl",
["models/humans/group03/male_02.mdl"] = "models/player/group03/male_02.mdl",
["models/humans/group03/male_06.mdl"] = "models/player/group03/male_06.mdl",
["models/barney.mdl"] = "models/player/barney.mdl",
["models/humans/group03/male_03.mdl"] = "models/player/group03/male_03.mdl",
["models/humans/group03/male_05.mdl"] = "models/player/group03/male_05.mdl",
["models/odessa.mdl"] = "models/player/odessa.mdl",
["models/humans/group03/male_09.mdl"] = "models/player/group03/male_09.mdl",
["models/humans/group01/male_05.mdl"] = "models/player/group01/male_05.mdl",
["models/humans/group03/male_08.mdl"] = "models/player/group03/male_08.mdl",
["models/monk.mdl"] = "models/player/monk.mdl",
["models/eli.mdl"] = "models/player/eli.mdl",
}
function Legs:FixModelName( mdl )
mdl = mdl:lower()
return self.FixedModelNames[ mdl ] or mdl
end
function Legs:SetUp()
self.LegEnt = ClientsideModel( Legs:FixModelName( LocalPlayer():GetModel() ), RENDER_GROUP_OPAQUE_ENTITY )
self.LegEnt:SetNoDraw( true )
self.LegEnt:SetSkin( LocalPlayer():GetSkin() )
self.LegEnt:SetMaterial( LocalPlayer():GetMaterial() )
self.LegEnt.LastTick = 0
end
Legs.PlaybackRate = 1
Legs.Sequence = nil
Legs.Velocity = 0
Legs.OldWeapon = nil
Legs.HoldType = nil
Legs.BoneHoldTypes = { ["none"] = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
},
["default"] = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Upperarm",
"ValveBiped.Bip01_L_Clavicle",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Upperarm",
"ValveBiped.Bip01_R_Clavicle",
"ValveBiped.Bip01_L_Finger4",
"ValveBiped.Bip01_L_Finger41",
"ValveBiped.Bip01_L_Finger42",
"ValveBiped.Bip01_L_Finger3",
"ValveBiped.Bip01_L_Finger31",
"ValveBiped.Bip01_L_Finger32",
"ValveBiped.Bip01_L_Finger2",
"ValveBiped.Bip01_L_Finger21",
"ValveBiped.Bip01_L_Finger22",
"ValveBiped.Bip01_L_Finger1",
"ValveBiped.Bip01_L_Finger11",
"ValveBiped.Bip01_L_Finger12",
"ValveBiped.Bip01_L_Finger0",
"ValveBiped.Bip01_L_Finger01",
"ValveBiped.Bip01_L_Finger02",
"ValveBiped.Bip01_R_Finger4",
"ValveBiped.Bip01_R_Finger41",
"ValveBiped.Bip01_R_Finger42",
"ValveBiped.Bip01_R_Finger3",
"ValveBiped.Bip01_R_Finger31",
"ValveBiped.Bip01_R_Finger32",
"ValveBiped.Bip01_R_Finger2",
"ValveBiped.Bip01_R_Finger21",
"ValveBiped.Bip01_R_Finger22",
"ValveBiped.Bip01_R_Finger1",
"ValveBiped.Bip01_R_Finger11",
"ValveBiped.Bip01_R_Finger12",
"ValveBiped.Bip01_R_Finger0",
"ValveBiped.Bip01_R_Finger01",
"ValveBiped.Bip01_R_Finger02"
},
["vehicle"] = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
}
}
Legs.BonesToRemove = {}
Legs.BoneMatrix = nil
function Legs:WeaponChanged( weap )
if IsValid( self.LegEnt ) then
if IsValid( weap ) then
self.HoldType = weap:GetHoldType()
else
self.HoldType = "none"
end
for boneId = 0, self.LegEnt:GetBoneCount() do
self.LegEnt:ManipulateBoneScale(boneId, Vector(1,1,1))
self.LegEnt:ManipulateBonePosition(boneId, Vector(0,0,0))
end
Legs.BonesToRemove = {
"ValveBiped.Bip01_Head1"
}
if !LocalPlayer():InVehicle() then
Legs.BonesToRemove = Legs.BoneHoldTypes[ Legs.HoldType ] or Legs.BoneHoldTypes[ "default" ]
else
Legs.BonesToRemove = Legs.BoneHoldTypes[ "vehicle" ]
end
for _, v in pairs( Legs.BonesToRemove ) do
local boneId = self.LegEnt:LookupBone(v)
if boneId then
self.LegEnt:ManipulateBoneScale(boneId, vector_origin)
self.LegEnt:ManipulateBonePosition(boneId, Vector(-10,-10,0))
end
end
end
end
Legs.BreathScale = 0.5
Legs.NextBreath = 0
function Legs:Think( maxseqgroundspeed )
if IsValid( self.LegEnt ) then
if LocalPlayer():GetActiveWeapon() != self.OldWeapon then
self.OldWeapon = LocalPlayer():GetActiveWeapon()
self:WeaponChanged( self.OldWeapon )
end
if self.LegEnt:GetModel() != self:FixModelName( LocalPlayer():GetModel() ) then
self.LegEnt:SetModel( self:FixModelName( LocalPlayer():GetModel() ) )
end
self.LegEnt:SetMaterial( LocalPlayer():GetMaterial() )
self.LegEnt:SetSkin( LocalPlayer():GetSkin() )
self.Velocity = LocalPlayer():GetVelocity():Length2D()
self.PlaybackRate = 1
if self.Velocity > 0.5 then
if maxseqgroundspeed < 0.001 then
self.PlaybackRate = 0.01
else
self.PlaybackRate = self.Velocity / maxseqgroundspeed
self
Thanks for sharing, Valkyrie_! ^_^
Edit.: Why did you remove this from the beginning?
[CODE]if SERVER then
AddCSLuaFile( "cl_legs.lua" )
return
end[/CODE]
Is it better to put the whole code in autorun/client/?
[QUOTE=itkuitkzhji;38682588]Thanks for sharing, Valkyrie_! ^_^
Edit.: Why did you remove this from the beginning?
[CODE]if SERVER then
AddCSLuaFile( "cl_legs.lua" )
return
end[/CODE]
Is it better to put the whole code in autorun/client/?[/QUOTE]
Because I was using it in one of my gamemodes, so it was not in autorun.
Thanks
Copying the legs script from Elevator Source works!
[editline]3rd December 2012[/editline]
Well, I guess there isn't any need for that anymore
[QUOTE=Valkyrie_;38680440]Here have fun :smile:
[lua] -code-[/lua][/QUOTE]
[video=youtube;9fWvub_WBho]http://www.youtube.com/watch?v=9fWvub_WBho[/video] (A song about you)
Where do I put that code for a server? lua/autorun?
lua/autorun/client/
Congrats, Valkyrie, you even fixed the in-water bug. Many thanks.
[QUOTE=Valkyrie_;38680440]Here have fun :smile:
[lua]
--[[
Fix by Valkyrie
--]]
[/lua][/QUOTE]
Nice, but the only issue with this is that the color doesn't render properly when the player color is set. - I changed it to support GetPlayerColor, and yellow renders as green, red shows up as deep red, pink shows up as purple etc... Also this doesn't support when the player is scaled. Any ideas on those problems?
I wrote a new type of legs mod that supports proper coloring, weight etc but the view model doesn't draw, unfortunately, I'm hoping garry will add that one hook I requested for pretty much a 7 line leg mod; I'm still toying around with it, trying to fool it into showing up.
Edit: Actually, nm, figured the rendering of custom color out, now I just need to do the weight.
Well, my garrysmod folders seem like they are missing something. I don't have a lua folder at all! :O
[editline]6th December 2012[/editline]
Nevermind, i just made one. Thanks anyway c:
[QUOTE=SpyWolf;38731408]Well, my garrysmod folders seem like they are missing something. I don't have a lua folder at all! :O[/QUOTE]
Create it.
[QUOTE=Valkyrie_;38680440]Here have fun :smile:
-mad codes here-[/QUOTE]
You're a cool guy you, thank you!
[QUOTE=MonkeysLP;38732886]You're a cool guy you, thank you![/QUOTE]
No problem, I love to help.
Can you Put a download up on the workshop or something i am no good with scripts im a noob at them.
[QUOTE=Gazzyer;38817625]Can you Put a download up on the workshop or something i am no good with scripts im a noob at them.[/QUOTE]
It's really self explanatory if you can't do what has been mentioned like 4 times then you really aren't trying
Sorry, you need to Log In to post a reply to this thread.