Game Development Community

Multiple Dust Types

by BigDaz · in Torque 3D Professional · 11/02/2012 (4:19 pm) · 2 replies

At the moment the dust emission from a material is either on or off. I'd like to have multiple types of dust in much the same way as it has the capacity for different footsteps sounds.

So I've added a line to materialDefinition.h
S32 mDustType;

and this to materialDefinition.cpp
mDustType = 0;

addField( "dustType", TypeS32, Offset( mDustType, Material ),
         "What type of dust particles do you want this material to emit?  This is, for example, used by "
         "vehicles or players to decide which dust to emit." );

It compiles alright but when I try and load the editor I just get the Windows error "Project.exe has stopped working." I'm not sure what to do now.

#1
11/02/2012 (8:15 pm)
Once I get less horribly busy(ideally in the next 2 weeks) I'm actually going to package up a Physical Material Definitions resource.
It bundles particle, explosion, decal and sound data into a separate datablock profile that is indexed to materials.
So you can define a 'wood' physical profile with it's given setup(no footstep decals, no footstep puffs, wood explosion effect and bullet decals, etc, etc)
And assign it to any materials you deign should act like wood, then make one for dirt with it's own settings.
It stays lightweight because the physical profiles are stored to a given material as a int index. It's also a lot more efficient, workflow wise than some other resources that added material-specific effects, because this lets you set up one profile that can very rapidly be applied to dozens and dozens of materials(editor integration to select available physical profiles will be included, and it works with the datablock editor for making new physical profiles as well).

I suppose that doesn't fix your immediate issue, but I figure I may as well give a heads up on that if this problem isn't time critical for you.
For the error itself, does anything happen if you run it in debug mode? You may be missing something and it's trying to access invalid pointers or something, causing a crash.
#2
11/03/2012 (4:21 am)
I've solved my issue, it wasn't related to what I'd coded at all.
But anyway your resource sounds just like the sort of thing I was aiming for, so I may wait for that.