Rendering models client-side only?

FloofCollie

I really suck!
aa
Nov 5, 2016
600
670
I'm trying to set up a system where specific models are only visible to certain players, under certain conditions. Ideally this would change according to a player's targetname, since that's what will decide other things in the map and would simplify things.

One of the first ideas suggested was to change the model visibility with Material Proxies - control the players' health via inputs (which is perfectly reasonable on this occasion for the map; I would use damage filters to prevent players changing these values), and use the "PlayerHealth" proxy to change visibility if it falls within a range, but from a test it seems like the game doesn't even recognize that proxy (even though it's listed on the VDC under TF2!), or "Health".

I'm new to material proxies/editing so I don't really know what else I could try with materials.

I did see the ConVar proxy, so maybe if there are ConVars that are reliably set per player, like a join ID or something, I could use that? But this is very alien to me, so I'm not sure if it would be worth investing time in that or trying something else.

I would appreciate any ideas!
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
Yea, those proxies are not functional. One alternative you could do would be exploting the behavior of material_modify_control: Clients are only informed of updates to the material's variables when they see the entity being controlled by the mat_mod_ctrl, and that change will be reflected in all instances of the material that lack an associated material_modify_control. So if you teleport the player out of the map for a hot second, into a little box where they see the updated material_modify_control, then immediately teleport them back, you can control which players see what material variables.