LarryG on 5/1/2010 at 00:43
I am introducing a new material type (paper -- keepers have lots of papers!) and have been trying to figure out
Material and
Material2 in
ENVSOUNDS.SPC and in
HITS.SPC.
It appears that
Material and
Material2 refer to two materials in material-to-material collisions.
ENVSOUNDS.SPC effectively lists all supported material types under both
Material and
Material2. So I added Paper to both.
Code:
/////////////////
//Material tags//
/////////////////
tag Material Carpet Ceramic Earth Flesh Glass GlassBits Gravel Ice Liquid Metal MetGrate MetLadder Rope Snow Stone Tile Vegetation Wood WoodBits WoodLadder ZombiePart Paper
tag Material2 Carpet Ceramic Earth Flesh Glass GlassBits Gravel Ice Liquid Metal MetGrate MetLadder Rope Snow Stone Tile Vegetation Wood WoodBits WoodLadder ZombiePart Paper
HITS.SPC provides the material-to-material sounds. At first I thought that
Material hitting
Material2 would be defined differently from
Material2 hitting
Material, but despite having a precedence syntax it does not appear to work that way. Take a look at gravel:
Code:
//HIT Gravel <--> ALL
schema hgravel
archetype HIT_MATERIAL
no_repeat
hgravel hgravel2
env_tag (Event Collision) (Material Carpet Ceramic Earth Glass Gravel) (Material2 Gravel)
env_tag (Event Collision) (Material Gravel) (Material2 Ice Metal MetGrate Stone Tile Wood)
Does the engine not care about the order of the materials, only that it is something with something else? If so why is gravel 1st on one line and last on the other? Does it matter?
LarryG on 5/1/2010 at 05:59
Oh, I guess I forgot to ask the important question: why doesn't this work?
Code:
//HIT Paper <--> ALL
schema hpaper
archetype HIT_MATERIAL
no_repeat
hpaperl hpaper2 hpaper3 hpaper4
env_tag (Event Collision) (Material Carpet Ceramic Earth Flesh Glass GlassBits Gravel Ice Liquid Metal MetGrate) (Material2 Paper)
env_tag (Event Collision) (Material Paper) (Material2 MetLadder Rope Snow Stone Tile Vegetation Wood WoodBits WoodLadder ZombiePart)
I reloaded schemas, and the new schema, hpaper, plays from the command console. But when I drop a piece of paper on a wood floor it does not use the hpaper schema, despite the paper having class tag material paper. What else do I need to do?
john9818a on 5/1/2010 at 09:12
Your paper object should have Material Tags, not Class Tags. :)
LarryG on 5/1/2010 at 11:33
:o
Bless you! That was driving me nuts!! Now I can fine tune the sounds.
gamophyte on 22/7/2026 at 16:09
In case someone sees this, I wanted to note the Material and Material2 is Non-directional, it's just the sound it will make when touching. HOWEVER, the order in which the material appears per line does matter. It goes by alphabetical order. Maybe this has been said somewhere here on TTLG, but I've never seen it. I wanted to post this since this is a popular thread on the topic.
This is why you see LGS have to split some lines. I started to see this pattern and always confused me because I started thinking there was some direction to the interaction, but there is not.
As a test I setup a simple beeping sound.
This works:
Code:
//HIT Metal <--> Beep!
schema hmtbeep
archetype HIT_MATERIAL
beep
env_tag (Event Collision) (Material Beep) (Material2 Metal)
This does not work:
Code:
//HIT Metal <--> Beep!
schema hmtbeep
archetype HIT_MATERIAL
beep
env_tag (Event Collision) (Material Metal) (Material2 Beep)
So LGS had to make a new line to ensure this alpha order. Example:
Code:
//HIT Gravel <--> ALL
schema hgravel
archetype HIT_MATERIAL
no_repeat
hgravel hgravel2
env_tag (Event Collision) (Material Carpet Ceramic Earth Glass Gravel) (Material2 Gravel)
env_tag (Event Collision) (Material Gravel) (Material2 Ice Metal MetGrate Stone Tile Wood)
Another note that supports the fact Material and Material2 is Non-directional, but also that object vs texture doesn't matter, is that when doing my beep test, it didn't matter if the beep schema was the little object hitting a metal texture, or a little metal object hitting a 'beep' texture.
john9818a on 27/7/2026 at 11:40
This is good to know. :thumb: