Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Slvr_BoneParentingGuide
- @inputs
- @outputs
- @persist [O E HED BODY SP1]:entity
- if(first()|duped()){
- # Base variable setup
- # SCALE is a debug variable. Set to 0 for regular use!
- SCALE=0
- E=entity()
- O=owner()
- # Create the holos used for the body itself,
- # This is better than relying on the actual player skeleton. This also makes it usable in sandbox!
- # Two are required as separately some bones are broken.
- BODY=holoCreate(1005,E:pos(),vec(1),E:angles(),vec(255),"models/willardnetworks/citizens/male07.mdl")
- holoParent(1005,O)
- holoBonemerge(1005,1)
- BOD2=holoCreate(1000,E:pos(),vec(1),E:angles(),vec(255),"models/Humans/corpse1.mdl")
- holoParent(1000,1005)
- holoBonemerge(1000,1)
- # Makes them invisible,
- # Not rendering the models entirely sounds better but on rare occasion that breaks the entirety of the bones
- BOD2:setMaterial("effects/ar2_altfire1b")
- BODY:setMaterial("effects/ar2_altfire1b")
- # Bone setup,
- # DO NOT TOUCH THIS IF YOU DO NOT KNOW WHAT YOU'RE DOING.
- SPINE1=BOD2:getModelBoneIndex("ValveBiped.Bip01_Spine")
- SPINE3=BOD2:getModelBoneIndex("ValveBiped.Bip01_Spine2")
- HEAD=BOD2:getModelBoneIndex("ValveBiped.Bip01_Head1")
- RSHOULDER=BOD2:getModelBoneIndex("ValveBiped.Bip01_R_Clavicle")
- RUPPERARM=BOD2:getModelBoneIndex("ValveBiped.Bip01_R_UpperArm")
- RLOWERARM=BODY:getModelBoneIndex("ValveBiped.Bip01_R_Forearm")
- LSHOULDER=BOD2:getModelBoneIndex("ValveBiped.Bip01_L_Clavicle")
- LUPPERARM=BOD2:getModelBoneIndex("ValveBiped.Bip01_L_UpperArm")
- LLOWERARM=BODY:getModelBoneIndex("ValveBiped.Bip01_L_Forearm")
- RTHIGH=BOD2:getModelBoneIndex("ValveBiped.Bip01_R_Thigh")
- RCALF=BOD2:getModelBoneIndex("ValveBiped.Bip01_R_Calf")
- LTHIGH=BOD2:getModelBoneIndex("ValveBiped.Bip01_L_Thigh")
- LCALF=BOD2:getModelBoneIndex("ValveBiped.Bip01_L_Calf")
- # Holo setup
- # Same as above, don't touch this.
- SP1=holoCreate(1,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(1,BOD2,SPINE1)
- SP3=holoCreate(2,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(2,BOD2,SPINE3)
- HED=holoCreate(3,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(3,BOD2,HEAD)
- LUA=holoCreate(4,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(4,BOD2,LUPPERARM)
- LLA=holoCreate(5,BODY:pos(),vec(SCALE),BODY:angles())
- holoParentBone(5,BODY,LLOWERARM)
- RUA=holoCreate(6,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(6,BOD2,RUPPERARM)
- RLA=holoCreate(7,BODY:pos(),vec(SCALE),BODY:angles())
- holoParentBone(7,BODY,RLOWERARM)
- RTH=holoCreate(8,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(8,BOD2,RTHIGH)
- RCA=holoCreate(9,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(9,BOD2,RCALF)
- LTH=holoCreate(10,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(10,BOD2,LTHIGH)
- LCA=holoCreate(11,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(11,BOD2,LCALF)
- LSH=holoCreate(12,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(12,BOD2,LSHOULDER)
- RSH=holoCreate(13,BOD2:pos(),vec(SCALE),BOD2:angles())
- holoParentBone(13,BOD2,RSHOULDER)
- # Usage guide:
- # This parents a simple holo cube to your left upper arm:
- holoCreate(100,LUA:toWorld(vec(0,0,0)),vec(1,1,1),LUA:toWorld(ang(0,0,0)),vec(255,255,255),"")
- holoParent(100,LUA)
- }
Advertisement
Add Comment
Please, Sign In to add comment