I've been working on a game mode for some time now and the newest job is the truck driver. Basically people ask an NPC for a truck driver job and gets different jobs/tasks they have to complete.
Right now i'm working on the vehicle mod and I want it to be able to couple the truck with the trailer. I know I could properly buy VC mod or something, but i'm more like the "do it yourself guy" :D
I understand the basic bone/attachment, but would like some help to make it work and yeah maybe others could use it too.
The trailer spawn at a specfic place and the truck driver drives close the trailer and should then couple with it.
The trailer itself ( TDM truck ) has a Attach position called "trailer_pin"
So...
[code]
local function LookupAttachment( ent, findwhat )
local entLookup = ent:LookupAttachment( find )
local entAttach = ent:GetAttachment( entLookup )
return entAttach
end
Attachment = LookupAttachment( vehicle, "trailer_pin" )
AttachmentPos = Attachment:GetPos()
AttachmentAng = Attachment:GetAngles()
[/code]
So now we have the Position and Angles for the trailer's "pin".
Now for the truck itself, I haven't been able to find out if there's a attachment point.
Maybe someone could help with that?
Btw here's the vehicle panel i'm still working on:
[img]http://puu.sh/dnqnt/86b6583424.jpg[/img]
[img]http://puu.sh/dnqCT/93dd6e4bbb.jpg[/img]
Use my "Easy Entity Inspector" tool to see all attachments/bones/etc on an entity. If the truck doesn't have an attachment where you need it.. well, you will have to improvise :v:
Good idea! Thats a step forward...
[editline]9th December 2014[/editline]
[QUOTE=TeddyBear;46674954]Good idea! Thats a step forward...[/QUOTE]
[img]http://puu.sh/dns0i/1b0a085fc6.jpg[/img]
Hmm? Does not seem like it.
So I guess I would have to define it from the pos/angles for each truck.
You could get the exact position between wheel_rr and wheel_rl +height, which is close to being the right position.
Sorry, you need to Log In to post a reply to this thread.