Is It possible to do cargo compartments for vehicles?

Hello again. The title says it all. I know that a proper caro compartment, such as the inside of a trunk for a car is possible to model, bu is it possible to, say, make that trunk an openable, articulated part of the model? I’ve heard of older bus models using something akin to it, but I’ve never seen it in action before. Was hoping to have an articulated hatch for one of my projects here:

Any help on this would be great, thanks.

You could just add a physics enabled bone there probably.
Alternatively a bodygroup might be more stable.
Thirdly there might be some option to make a button there that plays an animation.

Option 3 is what I’m thinking of, something similar to the animation from Master Chris’s dodge charger, but probably with a bone that keeps it open while the user is away from the vehicle, like a standard door.

Maybe its possible to exploit buggy’s ammo box cover in this case? It acts like a trunk: you open it and it stays open (if I remember correctly).

oh god i need this so bad… i would use it for a proper tow truck

http://www.youtube.com/watch?v=n0D346EeAro&feature=channel_video_title

Fast-forward to :31. I think Inaki found some way to do it.

Remember the old Jeep with the opening ammo box? find that in HL2 models and review

Well, is there a reason why Valve could not finish the Episode Two Dodge Charger with a working trunk then? Also, I never seen any car in HL2 with working passenger doors. Is it because there would of been too much extra animation? There must be some reason they skipped out animating that, but I don’t know what for.

Well, we know that animating the doors is quite possible, as seen on Master Chris’s Dodge, but I think that it’s something to do with optimizing the engine to make it run as smoothly as possible. Besides, there would’ve been much more work for the animation team, especially with Alyx.

@Jynx and Partent Z: I would If I had any idea how to code in Lua.

Modelling isn’t lua.

Adding switches and buttons is.

That can be handled by C++/Source.

Not without creating a new mod for Source or Hammer implementation on a map by map basis.

You would need to use lua.

As for animations, yes it is doable. But you have to remember entities will often not collide with vehicles in source. (I.e. ammo, health, etc.) whereas props will.

So uhh supposing I have a car and I animated it so the trunk can open, how can I trigger it opening then staying open in game?

After reading this again I was thinking maybe it could be done with an Entity Input and doing the AddOutput one, but I don’t know how to code a key value output in the .qc if that’s how it’s done and I am understanding it correctly. If it is able to work this way it could be rigged so you open the trunk by doing something simple like right-clicking when inside the car or whatever.

Now that’s a pretty cool idea. Sounds like something that is not unlike mounting a weapon on the vehicle, except instead of a weapon, it would be a physics-enabled bone that simply changes position. I like your thinking!

I am really waiting for like an annimating expert to weigh in on this thread, or at least someone who has worked with cars before because I don’t know where to look for further information about this.

Okay I asked someone else who knows a lot of information about vehicles and he said that we could do something to change m_nSequence (this is an entity property, I can use SourceMod to manipulate it for a given entity) to tell the car what animation to use. I’m going to experiment and see if I can get this to open a trunk on a car.