func_pushable with a model instead of a brush Created 10 months ago2024-01-02 19:53:32 UTC by Xawdlan Xawdlan

Created 10 months ago2024-01-02 19:53:32 UTC by Xawdlan Xawdlan

Posted 10 months ago2024-01-02 19:53:32 UTC Post #348388
Hi all, I know that func_pushable is a brush-based entity, but I'd like to know if there's a trick to use a .mdl instead, so the movable object would have more detail than anything made out of brushes in Hammer.

If the answer is no, could this be done in code? (Probably not, I don't recall seeing this in the SDK)
Posted 10 months ago2024-01-03 05:33:50 UTC Post #348389
using a model is possible, but it would have no collision. it'd still movable with use key though.
Posted 10 months ago2024-01-03 09:17:55 UTC Post #348390
Using the model key (or zhlt_usemodel targetting an env_sprite using the model for example) you can set most brush entities to use a model instead (remember to give them an ORIGIN brush where you want the model's origin to be), but that'll replace the entire brush model including the cliphulls resulting in it having no collisions as kimilil says.
(Also if using model you need to make sure the model is already precached in the map somewhere otherwise it'll crash).

Using game code would be the better way to go. That it's not already in the SDK doesn't mean it cannot be done.

You could implement a sort of "attach model" key directly in func_pushable for your mod that places a model at the origin and updating its position within the pushable's Move() method, or even more useful would be implementing an entity that can "parent" one entity to another so they move together, like trigger_setorigin in Sven Co-Op or the movewith (iirc) feature in Spirit of Half-Life.
It's possible the Featureful SDK already has some entity parenting feature that you could use, so that's worth checking out.
Posted 10 months ago2024-01-03 11:10:23 UTC Post #348391
oh yeah, Featureful has a motion_manager that can do this
Posted 10 months ago2024-01-03 17:49:55 UTC Post #348393
Thank you all. Using the model key did not work, but zhlt_usemodel did when pointing to a env_sprite. As you said, I could still move it with "use" but not by running into it. Funny, I didn't know that.

@Erty, I meant to say that I hadn't found the code for func_pushable in the SDK, but I've located it now, it's inside func_break.cpp as it inherits from func_breakable. I think it will be easier to modify it so the entity uses a .mdl than to keep using nasty hacks to achieve the same.
You must be logged in to post a response.