Garry's Mod

Garry's Mod

SGM's Vehicle Model Attaching Framework
 Tämä aihe on kiinnitetty, joten se on todennäköisesti tärkeä
SGM ツ  [kehittäjä] 23.10.2022 klo 12.58
How to use
For vehicle developers
Add the following code at the bottom of the lua file for your vehicle:
SGM = SGM or {} SGM.AttachModels = SGM.AttachModels or {} SGM.AttachModelsByClass = SGM.AttachModelsByClass or {} SGM.AttachedModels = SGM.AttachedModels or {} SGM.AttachModels["models/my/car.mdl"] = { { Model = "models/my/car_model2.mdl", Pos = Vector(0,0,0), Ang = Angle(0,0,0), Color = Color(255,255,255), Scale = 1, -- BodyGroups = { -- {1,1}, -- {2,1}, -- }, BoneMerge = true, --bone merging, pretty self-explanatory BoneParent = "", --bone parenting, this makes the prop follow a specific bone RenderMode = RENDERMODE_NORMAL, --render mode just in case you need it, although you usually shouldn't Sync = true, --sync colors,materials, and bodygroups between the two models SyncSubMaterials = true, --sync submaterials between the models -- SyncFunction = function(car, prop) -- if !IsValid(car) or !IsValid(prop) then return end --if you really know what you're doing you can add custom functions for interactions between the vehicle and the prop, these get called each sync (default: every 2 seconds) -- end, -- SubMaterials = { -- [0] = "sentry/shared/skin0", --ability to change the submaterials of the prop if necessary -- }, }, }
All of these properties are optional, for optimization, make sure to disable syncing functions if you don't need them.

For Photon "developers"
Add the following code at the bottom of the lua file for your vehicle:
SGM = SGM or {} SGM.AttachModels = SGM.AttachModels or {} SGM.AttachModelsByClass = SGM.AttachModelsByClass or {} SGM.AttachedModels = SGM.AttachedModels or {} SGM.AttachModelsByClass["class_name_of_my_photon_car"] = { { Model = "models/tadano/fumo/pack/cirno.mdl", Pos = Vector(0,0,0), Ang = Angle(0,0,0), Color = Color(255,255,255), Scale = 1, -- BodyGroups = { -- {1,1}, -- {2,1}, -- }, BoneMerge = false, --bone merging, pretty self-explanatory BoneParent = "", --bone parenting, this makes the prop follow a specific bone RenderMode = RENDERMODE_NORMAL, --render mode just in case you need it, although you usually shouldn't Sync = false, --sync colors,materials, and bodygroups between the two models SyncSubMaterials = false, --sync submaterials between the models -- SyncFunction = function(car, prop) -- if !IsValid(car) or !IsValid(prop) then return end --if you really know what you're doing you can add custom functions for interactions between the vehicle and the prop, these get called each sync (default: every 2 seconds) -- end, -- SubMaterials = { -- [0] = "sentry/shared/skin0", --ability to change the submaterials of the prop if necessary -- }, }, }

Example of adding two models to the same car
You can add as many models as you want, as long as you add them properly.
SGM = SGM or {} SGM.AttachModels = SGM.AttachModels or {} SGM.AttachModelsByClass = SGM.AttachModelsByClass or {} SGM.AttachedModels = SGM.AttachedModels or {} SGM.AttachModels["models/my/car.mdl"] = { { Model = "models/my/car_model2.mdl", Pos = Vector(0,0,0), Ang = Angle(0,0,0), Color = Color(255,255,255), Scale = 1, -- BodyGroups = { -- {1,1}, -- {2,1}, -- }, BoneMerge = true, --bone merging, pretty self-explanatory BoneParent = "", --bone parenting, this makes the prop follow a specific bone RenderMode = RENDERMODE_NORMAL, --render mode just in case you need it, although you usually shouldn't Sync = true, --sync colors,materials, and bodygroups between the two models SyncSubMaterials = true, --sync submaterials between the models -- SyncFunction = function(car, prop) -- if !IsValid(car) or !IsValid(prop) then return end --if you really know what you're doing you can add custom functions for interactions between the vehicle and the prop, these get called each sync (default: every 2 seconds) -- end, -- SubMaterials = { -- [0] = "sentry/shared/skin0", --ability to change the submaterials of the prop if necessary -- }, }, { Model = "models/my/car_model3.mdl", Pos = Vector(0,0,0), Ang = Angle(0,0,0), Color = Color(255,255,255), Scale = 1, -- BodyGroups = { -- {1,1}, -- {2,1}, -- }, BoneMerge = true, --bone merging, pretty self-explanatory BoneParent = "", --bone parenting, this makes the prop follow a specific bone RenderMode = RENDERMODE_NORMAL, --render mode just in case you need it, although you usually shouldn't Sync = true, --sync colors,materials, and bodygroups between the two models SyncSubMaterials = true, --sync submaterials between the models -- SyncFunction = function(car, prop) -- if !IsValid(car) or !IsValid(prop) then return end --if you really know what you're doing you can add custom functions for interactions between the vehicle and the prop, these get called each sync (default: every 2 seconds) -- end, -- SubMaterials = { -- [0] = "sentry/shared/skin0", --ability to change the submaterials of the prop if necessary -- }, }, }
Viimeisin muokkaaja on SGM ツ; 25.10.2022 klo 12.24
< >
Näytetään 1-10 / 10 kommentista
W4nou 25.10.2022 klo 10.24 
is there already a way to change the body groups of the added model? if not, is it planned for a future update?
SGM ツ  [kehittäjä] 25.10.2022 klo 11.17 
W4nou lähetti viestin:
is there already a way to change the body groups of the added model? if not, is it planned for a future update?
it's possible to add, but the original idea was that as a vehicle developer you'd only want to either sync bodygroups between two models if they match, or not change bodygroups at all because you would have already set up the model how you wanted it. it can be added though
W4nou 25.10.2022 klo 11.29 
it's not for a vehicle it's only for a skin without emergency lights and i would have like to add models to it
Viimeisin muokkaaja on W4nou; 25.10.2022 klo 11.35
SGM ツ  [kehittäjä] 25.10.2022 klo 12.25 
W4nou lähetti viestin:
it's not for a vehicle it's only for a skin without emergency lights and i would have like to add models to it
added, make sure to disable syncing otherwise the vehicles bodygroups will take priority
W4nou 25.10.2022 klo 13.11 
amazing, thank you
sol 28.10.2022 klo 6.21 
sgm can i pm u in any way i need help with my vcmod purchase, i tried reaching out to free and he didnt respond
I hate SGM. Just waste of internet for bloatware and more lag.
Sanya 18.1.2023 klo 10.57 
porkicurtu lähetti viestin:
I hate SGM. Just waste of internet for bloatware and more lag.
yeah ur mother told me how much she hated you last night when i got done with her, Told her we should of aborted
its no working
Is simfphys supported?
< >
Näytetään 1-10 / 10 kommentista
Sivua kohden: 1530 50