Ulysses

General => Off-Topic => Topic started by: Bite That Apple on September 03, 2016, 03:13:32 AM

Title: Finding if material is used on Garry's Mod map
Post by: Bite That Apple on September 03, 2016, 03:13:32 AM
I have a new idea for Garry's Mod, that I don't think has been done in a long time now. Though for it to work, I need to be able to search a map to check if it uses a certain material, in this case the grass material.

I really want to try avoid going to facepunch, but if no one is entirely sure, I'd have to. So please stop me from going there :/
Title: Re: Finding if material is used on Garry's Mod map
Post by: JamminR on September 03, 2016, 11:50:25 AM
Do you mean material as in a "looks like"/texture/wireframe/shiny application?
Or surface friction type as in "feels/acts/grips like" ice/water/grass/dirt application?
Though I don't know the Gmod lua terms at this point of both , I'm not fully clear what you're asking and would help us (any reader seeing this discussion) determine what you're looking for and maybe find it at wiki or elsewhere.
Title: Re: Finding if material is used on Garry's Mod map
Post by: Bite That Apple on September 03, 2016, 04:55:42 PM
Do you mean material as in a "looks like"/texture/wireframe/shiny application?
Or surface friction type as in "feels/acts/grips like" ice/water/grass/dirt application?
Though I don't know the Gmod lua terms at this point of both , I'm not fully clear what you're asking and would help us (any reader seeing this discussion) determine what you're looking for and maybe find it at wiki or elsewhere.

Well, either would work. I'll explain what I'm doing a little more, so you imagine if there is such a function that already exists for this. I want to make an entity that will automatically grow on grass or dirt. So if I have to use the exact material of "grass.vmt", then fine, or if I could do the possibility of a "acts/feels like grass/dirt".
Title: Re: Finding if material is used on Garry's Mod map
Post by: roastchicken on September 03, 2016, 06:29:35 PM
I know you can get materials from traces, so maybe just do a bunch of traces in a grid configuration across the map? It wouldn't be perfect, but it's better than nothing.
Title: Re: Finding if material is used on Garry's Mod map
Post by: Bite That Apple on September 03, 2016, 06:36:59 PM
I know you can get materials from traces, so maybe just do a bunch of traces in a grid configuration across the map? It wouldn't be perfect, but it's better than nothing.

I've never used that function before. Though, from my understanding of this, it looks like it can only be used on entities. If I'm correct, I'm also sure world is not an entity.
Title: Re: Finding if material is used on Garry's Mod map
Post by: Stickly Man! on September 03, 2016, 10:10:01 PM
The world should be an entity:
https://wiki.garrysmod.com/page/game/GetWorld

Also found this after a quick search, might be helpful? This is an area of Gmod I'm not familiar with. :P
https://wiki.garrysmod.com/page/Entity/GetMaterials
Title: Re: Finding if material is used on Garry's Mod map
Post by: Bite That Apple on September 03, 2016, 11:17:38 PM
The world should be an entity:
https://wiki.garrysmod.com/page/game/GetWorld

Also found this after a quick search, might be helpful? This is an area of Gmod I'm not familiar with. :P
https://wiki.garrysmod.com/page/Entity/GetMaterials

Thanks for suggestions. I'll try something out, but I'm getting the idea that I'll have to use hammer to do this correctly, or make it like my last gamemode.