Triggered Model Animations?

Hello. I am currently working on a few massive starships (props) which are currently 100% static.

They have multiple rooms ajoined by the typical automatic star trek sliding door. As things stand, I will either have to make the doors non-collidable so players can pass through them, or remove them completely - both of which will look rediculous.

Is it possible to do the following:

Can I make an animated sub-object (the sliding door) that has 2 keyframes: open and closed.

‘Open’ or ‘Closed’ should be based on player proximity to the SUBOBJECT, and only that subobjects animation should trigger.
It doesnt have to be collidable. I just want the doors animation to somehow correspond to players proximity

Even crazier, bind a sound to the animation. (You know the one :wink: )

If thats possible, you will see the godliest 2 ships ever created for gmod.

Revamped USS Enterprise-D, and Enterprise-E (Both are nearing completion, and their sizes have been perfectly scaled to canon with the USS Voyager found on GarrysMod.org)

Thanks,
Pwn

Use lua. Source doesn’t support animated collision models.

It doesnt have to be collidable. I just want the doors animation to somehow correspond to players proximity.

Edit: Can lua be worked into the compiled model itself at the subobject level to accomplish this? I would want it to run right out of the box when installed into addons.

Well, you probably could use LOD models, but that way only one door would work (You need to put the origin in the centerpoint of the door)

It does, look at the Combine doors. ( or all the door models, actually)

As for the triggers, you’d have to use lua.

LOD Models, thats genius. By 1 door, your saying the whole ship would have to adhere to 1 set of LODs?

He means that it would only work for the door at the origin, ,as when you neared it it would switch to the “door open” LOD. The only problem with this approach is that you can’t make that work for any other doors. Also, there’s no animation, it will just snap open.

I suppose i could do incremental distance levels of LOD, which seems to be doable, to create a crude animated effect.

On that note, can multiple .smds (while preserving their respective scene origins) be somehow compiled into 1 singular, spawnable cluster? Sort of like advanced duplicator, but at the compilation level.

If I model the door animation by itself with the LOD effect, can I then compile Door.smd and Ship.smd into the same .mdl and solve all my problems? - except for other players not seeing the effect when you pass through the door that is.

Edit: The prefabs in Hammer, however they are organized, are evidence that Valve at least has some sort of official means of linking models together. The question is: are prefabs spawnable in gmod?

Is any of this possible?

I’m not sure if this is possible, but you could have bones where the doors are supposed to be and then just attach the door models to the bones in the .qc like they attached the chef’s hat to the vortigaunts and so on. And then have each door have their own LOD.

I will definitely get started on that PLing. Thanks.

Lastly, is there any way to bind sound files to the LOD swap via qc? Can emitters be bound to the bones for directional sound?
(Such as the engine idle on the Jeep)

This would also allow alot of amazing ambient noises to be integrated into the prop, such as engine hum and so forth.

I can’t wait for these ships!

Huh yeah, bodygroups are a good idea.

Yeah that’s the term i was after.