Pre-caching models

Ælement

Comfortably mediocre
aa
Dec 21, 2010
1,481
1,616
While working on a custom Demoman robot, i stumbled over an attribute called "Custom projectile model".

Naturally, i immediately set forth to implement it. This is what it looks like in the .pop file:

Code:
ItemAttributes
            {
                "custom projectile model" "models/props_2fort/frog.mdl"
            }

Now, this works for some models. Most notably, it works with the bomb model used for the flag in MvM.

The problem is that this model is turning the wrong way when it comes out of the barrel, so i went to try some other models (There's a plain bomb in the decker pack that happens to face the right direction). However, most models instantly crash my game when the demoman starts firing, leaving me with this error message:

0FP5X3d.png


My best hypothesis would be that it tries to use a model before the game has loaded it into memory, but i honestly have no clue. I tried placing the prop in my map in an attempt to cache it (whatever that means), but that didn't do anything.

Any idea how this may be solved?
 

Diva Dan

hello!
aa
Mar 20, 2016
1,024
1,951
Try placing a prop down of different type, I think prop_physics_override or props_physics_multiplayer work, something like that. It should appear invisible in game once you compile the map
 

Ælement

Comfortably mediocre
aa
Dec 21, 2010
1,481
1,616
That worked. Thank you both!

Now, do you reckon it's possible to change the origin and orientation of the fired projectile somehow? Whenever my demoman fires a shot, the bomb model is launched in an upright position and it twirls around a point outside the model itself. Currently using the mortar from the frontline pack.
 
Last edited:

Diva Dan

hello!
aa
Mar 20, 2016
1,024
1,951
Not without using a different model. Most models come with their origin point on the very bottom center except for a few exceptions like the pass time jack or some hats and other projectiles. It takes some browsing of the model viewer