Liam0102 / Star-Wars-Vehicles

Star Wars Vehicles addon for Garrys Mod (Code only)
3 stars 2 forks source link

New repair tool model (view and world) #11

Closed Servius closed 7 years ago

Servius commented 7 years ago

A long while back I was trying to update the repair tool with a better view and world model to be a bit more immersive. For some reason I couldn't get the code to work. This is from SWEP Creation Kit.

Note: I just tried the code found in the repo referenced and it still doesn't work. I hope someone can point out the problem to me.

SWEP.ViewModelBoneMods = {
    ["v_dh17_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
    ["ValveBiped.Bip01_R_Finger11"] = { scale = Vector(1, 1, 1), pos = Vector(0, 1.5, 0), angle = Angle(-30, 0, 0) },
    ["ValveBiped.Bip01_R_Finger32"] = { scale = Vector(1, 1, 1), pos = Vector(0.555, -0.186, 0), angle = Angle(-3.333, 0, 0) },
    ["ValveBiped.Bip01_R_Finger42"] = { scale = Vector(1, 1, 1), pos = Vector(0.925, -0.186, 0), angle = Angle(-3.333, 0, 0) }
}
SWEP.VElements = {
    ["element_view"] = { type = "Model", model = "models/props/starwars/weapons/fusion_cutter.mdl", bone = "v_dh17_reference001", rel = "", pos = Vector(0.2, 0.1, -5), angle = Angle(0, 94.675, 0), size = Vector(0.699, 0.699, 0.699), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
    ["element_world"] = { type = "Model", model = "models/props/starwars/weapons/fusion_cutter.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(2.4, 1.6, 5), angle = Angle(0, 0, 180), size = Vector(0.99, 0.99, 0.99), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}

--[[
SWEP.HoldType = "slam"
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/synbf3/c_dh17.mdl"
SWEP.WorldModel = "models/weapons/w_c4.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.ViewModelBoneMods = {
    ["v_dh17_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
    ["ValveBiped.Bip01_R_Finger11"] = { scale = Vector(1, 1, 1), pos = Vector(0, 1.5, 0), angle = Angle(-30, 0, 0) },
    ["ValveBiped.Bip01_R_Finger32"] = { scale = Vector(1, 1, 1), pos = Vector(0.555, -0.186, 0), angle = Angle(-3.333, 0, 0) },
    ["ValveBiped.Bip01_R_Finger42"] = { scale = Vector(1, 1, 1), pos = Vector(0.925, -0.186, 0), angle = Angle(-3.333, 0, 0) }
}
SWEP.VElements = {
    ["element_view"] = { type = "Model", model = "models/props/starwars/weapons/fusion_cutter.mdl", bone = "v_dh17_reference001", rel = "", pos = Vector(0.2, 0.1, -5), angle = Angle(0, 94.675, 0), size = Vector(0.699, 0.699, 0.699), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
    ["element_world"] = { type = "Model", model = "models/props/starwars/weapons/fusion_cutter.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(2.4, 1.6, 5), angle = Angle(0, 0, 180), size = Vector(0.99, 0.99, 0.99), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
]]
Servius commented 7 years ago

Looks like we would have to add the base code to the swep for the stuff to work. The TFA Base set it up automagically so all you do is copy pasta in the stuff and it auto works. https://github.com/Servius/tfa_base_rp_friendly/blob/81fef42371b68c178d337fe15ec1bb6eb2a2b3e5/tfa_base/lua/weapons/tfa_gun_base/cl_mods.lua

If a similar system could be setup here that would be great. Otherwise I guess I can merge the base code of the SCK with the repair tool but it would look over the top sloppy. https://github.com/Clavus/SWEP_Construction_Kit/blob/master/lua/weapons/swep_construction_kit/base_code.lua

Liam0102 commented 7 years ago

Do what the creator of that base says and copy the code into the SWEP.

Servius commented 7 years ago

Alright. I guess that's fine. Honestly just wanted to avoid having the swep be over the top ridiculous in terms of the amount of code. If it isnt a problem I guess Ill just merge as instructed.