Jump to content
IgorBgz90

Material Type

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.

Share this post


Link to post
Please add in the next update

 

Bold request :)

 

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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

+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

Share this post


Link to post

+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

Share this post


Link to post

+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...

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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)

Share this post


Link to post

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.

Share this post


Link to post

+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.

Share this post


Link to post

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.

Share this post


Link to post

It would have to be tested with terrain. Not sure if you can get the mix of textures that the terrain allows. That's probably the biggest use case for foot step sounds honestly.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...