Garry's Mod

Garry's Mod

Traincar Grabber
 This topic has been pinned, so it's probably important
Anyone999991  [developer] 22 May, 2024 @ 2:05pm
Config Format
Example Config

local V = { --Okay. First we'll make the key for the table data the path for the model. ["models/goomzmodels/rollingstock/bethlehem3bay4000.mdl"] = {--Assign it a table ["ar"] = {--We'll key the data point with a string relevant to its actual location. "A" end right side. ("B" end of railcars in the US is the side with the brake equipment, the "forward" direction is B to A) pos = Vector(-57,-254,54), //position of the grab area detection box (TM) ang = Angle(0,-90,0), //angle of the grab area detection box (TM) size = Vector(24,1,125), //size of the grab area detection box (TM) vpos = Vector (-67,-254,0) //position of the vehicle (Footplate). Angle is relative to the detection box angle. }, ["ac"] = { pos = Vector(-42,-268,67), ang = Angle(0,0,0), size = Vector(24,1,100), vpos = Vector (-42,-278,65) }, ["al"] = { pos = Vector(57,-254,0), ang = Angle(0,90,0), size = Vector(24,1,20), vpos = Vector (67,-254,-10) }, ["bl"] = { pos = Vector(57,254,54), ang = Angle(0,90,0), size = Vector(24,1,125), vpos = Vector (67,254,0) }, ["bc"] = { pos = Vector(42,268,67), ang = Angle(0,180,0), size = Vector(24,1,100), vpos = Vector (42,278,65) }, ["br"] = { pos = Vector(-57,254,0), ang = Angle(0,-90,0), size = Vector(24,1,20), vpos = Vector (-67,254,-10) }, }, } list.Set("a91_railcargrabber_carlist", "models/goomzmodels/rollingstock/bethlehem3bay4000.mdl", V)

Config has to be a .lua file in the autorun folder.
There can be any number of points you want on your car config, they have to be named uniquely, but the name itself doesnt matter.
Type "developer 1" in your console to be able to see the target hitboxes and footplate locations when targeting a railcar.
Last edited by Anyone999991; 23 May, 2024 @ 4:05am