Jump to content

Material Type


IgorBgz90
 Share

Recommended Posts

Please add in the next update - opportunity to get a type from the file material. I think it will be very comfortable and functional.

 

You can make a return type int...

int Material::GetType(); //Returns the type of material "Metal, Concrete, Wood, Water, Flesh, Grass etc.."

 

Example of use:


--FPSPlayer Footsteps Get type
function Script:Collision(entity,position,normal,speed)
if speed>20 then
self:Hurt(100)
end
if entity:GetMaterial():GetType() ~! nil then
 if entity:GetMaterial():GetType() == Material:Type:Concrete then
self.sound.footsteps.type = 1
 end
 if entity:GetMaterial():GetType() == Material:Type:Metal then
 self.sound.footsteps.type = 2
 end
 --etc 
end
end

 

post-13485-0-77924500-1424484893_thumb.jpg

 

Useful for the sound of footsteps, traces of bullets, particles etc.

  • Upvote 2
Link to comment
Share on other sites

Bold request smile.png

 

I think you'd need a SetType() as well and then add a way to do this via the material editor.

 

Yes Rick smile.png

I liked this implementation still in GoldSrc...

Checking collision bullets, we can get the type of material object. And then draw the correct decals and particles.

Link to comment
Share on other sites

Bold request smile.png

 

I think you'd need a SetType() as well and then add a way to do this via the material editor.

 

+1 this would make this stuff to deal with much easier

 

Yes Rick smile.png

I liked this implementation still in GoldSrc...

Checking collision bullets, we can get the type of material object. And then draw the correct decals and particles.

 

valve's source engine's period wink.png has had this and would be awesome to have

  • Upvote 1

OS: Windows 10 Pro

CPU:  i3-10100 CPU @ 3.60GHz
GPU: NVIDIA 2060 Super - 8 GB

RAM: 32 GB

Link to comment
Share on other sites

+1

Who wants to hear boots clomping on concrete as the player walks through water ?

and why would you want to hear boots clomping on concrete as you walk on gravel or snow, etc.. ?

 

Is there a way to do this already ? 'cos i have not played with sounds yet with LE

 

+9,001

OS: Windows 10 Pro

CPU:  i3-10100 CPU @ 3.60GHz
GPU: NVIDIA 2060 Super - 8 GB

RAM: 32 GB

Link to comment
Share on other sites

+1

Who wants to hear boots clomping on concrete as the player walks through water ?

and why would you want to hear boots clomping on concrete as you walk on gravel or snow, etc.. ?

 

Is there a way to do this already ? 'cos i have not played with sounds yet with LE

 

 

Sound is very important, and not only for the sound can be used.

rolleyes.gif

Correct decals, particles...

Link to comment
Share on other sites

Sound is very important, and not only for the sound can be used.

rolleyes.gif

Correct decals, particles...

or telling a monster that if it walks on a texture of hot coal's then set it on fire and burn to death as well or lava or what ever you prefer

  • Upvote 1

OS: Windows 10 Pro

CPU:  i3-10100 CPU @ 3.60GHz
GPU: NVIDIA 2060 Super - 8 GB

RAM: 32 GB

Link to comment
Share on other sites

This would work awesome for traditional games and csg's, but issues will arise when you get creative. So lets say I create a portal clone. I create a new goo. How do I assign a new material type? Another issue is multi-material meshes. Say I import 1 house and it is a single mesh with multiple materials. How do I figure out the footsteps WITHOUT creating triggerzones to force the structure ts to change? Same thing with a mesh that uses a texture atlas.

Link to comment
Share on other sites

This would work awesome for traditional games and csg's, but issues will arise when you get creative. So lets say I create a portal clone. I create a new goo. How do I assign a new material type? Another issue is multi-material meshes. Say I import 1 house and it is a single mesh with multiple materials. How do I figure out the footsteps WITHOUT creating triggerzones to force the structure ts to change? Same thing with a mesh that uses a texture atlas.

 

work-around's like have a default setting, etc.

OS: Windows 10 Pro

CPU:  i3-10100 CPU @ 3.60GHz
GPU: NVIDIA 2060 Super - 8 GB

RAM: 32 GB

Link to comment
Share on other sites

Nice request, +1, but can't you just build a table of materials with corresponding sounds, then use Pick()->GetSurface()->GetMaterial(), compare against table and set the appropriate sound ? (haven't tested this was all in theory)

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Nice request, +1, but can't you just build a table of materials with corresponding sounds, then use Pick()->GetSurface()->GetMaterial(), compare against table and set the appropriate sound ? (haven't tested this was all in theory)

 

Indeed, its already possible via Asset::GetPath. Just name your materials with type prefix e.g. dirt_brown1.mat, conc_clean2.mat or wood_lines32.mat. When picking the ground underneath the player just get the material path and extract first four letters and match them up to internal/external sound list/material properties.

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

+1

Indeed, its already possible via Asset::GetPath. Just name your materials with type prefix e.g. dirt_brown1.mat, conc_clean2.mat or wood_lines32.mat. When picking the ground underneath the player just get the material path and extract first four letters and match them up to internal/external sound list/material properties.

 

No workarounds like old animation system.

A simple easy and direct workflow is always better and you get lot more productive making your game faster and not loosing time with workarounds.

Stop toying and make games

Link to comment
Share on other sites

I know, but people tend wait for these enhancements not realising its already possible. Most of game development is about programming so you would still have to do some coding one way or another. Having only basic type of material will not give you much flexibility. It needs to be a more thorough with physical material properties.

  • Upvote 2

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...