• Way to get material type/surface properties of entity clientside
    8 replies, posted
I'm trying to figure out when a trace hits glass, however, some windows, like the ones in cs_office have a NoDraw on the backside, causing the trace's table to have MatType as MAT_CONCRETE and SurfaceProps as 0. This can be worked around serverside with Entity:GetMaterialType(), however, that is not available on the client.
This is probably no help whatsoever since the window probably isn't an entity with a model but I found that using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/GetModelInfo]util.GetModelInfo[/url] clientside gives you the surface material for a model at some point in the table Also, why do you need to do a clientside trace rather than a networked one?
[QUOTE=MPan1;50859273]This is probably no help whatsoever since the window probably isn't an entity with a model but I found that using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/GetModelInfo]util.GetModelInfo[/url] clientside gives you the surface material for a model at some point in the table Also, why do you need to do a clientside trace rather than a networked one?[/QUOTE] Entity's model returns *2 instead of **notexture**; never seen that before. And I need it clientside since it's in a predicted weapon context, so it can be ran multiple times.
Wait, so it actually did something? Wow, I didn't expect that... maybe try doing [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/GetSurfacePropName]util.GetSurfacePropName[/url] on that *2? You probably meant that it's a string with the characters '*' and '2' in it though
[QUOTE=MPan1;50859337]Wait, so it actually did something? Wow, I didn't expect that... maybe try doing [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/GetSurfacePropName]util.GetSurfacePropName[/url] on that *2? You probably meant that it's a string with the characters '*' and '2' in it though[/QUOTE] No, the GetMaterial string was "*2". The trace's SurfaceProps was still 0. [editline]10th August 2016[/editline] 2 is "metal_box" anyway.
[QUOTE=code_gs;50859347]No, the GetMaterial string was "*2."[/QUOTE] Is this a case of [url=http://thedailywtf.com/articles/Its-a-Different-Set-of-Rules]this[/url]? (just being nitpicky, ignore me)
[QUOTE=NeatNit;50859692]Is this a case of [url=http://thedailywtf.com/articles/Its-a-Different-Set-of-Rules]this[/url]? (just being nitpicky, ignore me)[/QUOTE] Yeah, you're right. English was not my first written language so I tend to follow grammar really strictly.
[QUOTE=code_gs;50859323]Entity's model returns *2 instead of **notexture**; never seen that before. And I need it clientside since it's in a predicted weapon context, so it can be ran multiple times.[/QUOTE] FYI, *2, *3 and stuff are map brush models. They are unique for each map (obviously).
Tracing past on HitNoDraw seems to be the only way
Sorry, you need to Log In to post a reply to this thread.