Jump to content
icebreakr

Enabling dust effects on your custom map

Recommended Posts

This is a short tutorial on how to enable dust effects for vehicles and infantry (soldiers) on your custom island.

 

1. You open config.cpp and right after the END of CfgPatches class you put this line in:

 
#include "cfgVehicles.hpp"
 
Save it.
 
2. Make new file cfgVehicles.hpp in the root folder of your custom map and insert the following text:
 
class CfgVehicles
{
	class All;
	class AllVehicles: All{};
	class Land: AllVehicles{};
	class LandVehicle: Land{};
	class car: LandVehicle
	{
		rightDustEffects[] = {{"yourisland_grass","RDustEffects"},{"yourisland_grass","RDirtEffectsBig"},{"yourisland_grass","RStonesEffectsBig"},{"yourisland_grass","RGrassEffectsDryBig"},{"yourisland_rock","RDustEffects"},{"yourisland_rock","RDirtEffectsBig"},{"yourisland_rock","RStonesEffectsBig"},{"yourisland_stones","RDustEffects"},{"yourisland_stones","RGrassEffectsBig"},{"yourisland_stones","RDirtEffectsBig"},{"yourisland_stones","RStonesEffectsBig"},{"yourisland_wood","RDustEffects"},{"yourisland_wood","RDirtEffectsBig"},{"yourisland_wood","RStonesEffectsBig"},{"yourisland_sand","RDustEffects"},{"yourisland_sand","RDirtEffectsBig"},{"yourisland_sand","RStonesEffectsBig"}};
		leftDustEffects[] = {{"yourisland_grass","LDustEffects"},{"yourisland_grass","LDirtEffectsBig"},{"yourisland_grass","LStonesEffectsBig"},{"yourisland_grass","LGrassEffectsDryBig"},{"yourisland_rock","LDustEffects"},{"yourisland_rock","LDirtEffectsBig"},{"yourisland_rock","LStonesEffectsBig"},{"yourisland_stones","LDustEffects"},{"yourisland_stones","LGrassEffectsBig"},{"yourisland_stones","LDirtEffectsBig"},{"yourisland_stones","LStonesEffectsBig"},{"yourisland_wood","LDustEffects"},{"yourisland_wood","LDirtEffectsBig"},{"yourisland_wood","LStonesEffectsBig"},{"yourisland_sand","LDustEffects"},{"yourisland_sand","LDirtEffectsBig"},{"yourisland_sand","LStonesEffectsBig"}};
	};
	class tank: LandVehicle
	{
		rightDustEffects[] = {{"yourisland_grass","RDustEffects"},{"yourisland_grass","RDirtEffectsBig"},{"yourisland_grass","RStonesEffectsBig"},{"yourisland_grass","RGrassEffectsDryBig"},{"yourisland_rock","RDustEffects"},{"yourisland_rock","RDirtEffectsBig"},{"yourisland_rock","RStonesEffectsBig"},{"yourisland_stones","RDustEffects"},{"yourisland_stones","RGrassEffectsBig"},{"yourisland_stones","RDirtEffectsBig"},{"yourisland_stones","RStonesEffectsBig"},{"yourisland_wood","RDustEffects"},{"yourisland_wood","RDirtEffectsBig"},{"yourisland_wood","RStonesEffectsBig"},{"yourisland_sand","RDustEffects"},{"yourisland_sand","RDirtEffectsBig"},{"yourisland_sand","RStonesEffectsBig"}};
		leftDustEffects[] = {{"yourisland_grass","LDustEffects"},{"yourisland_grass","LDirtEffectsBig"},{"yourisland_grass","LStonesEffectsBig"},{"yourisland_grass","LGrassEffectsDryBig"},{"yourisland_rock","LDustEffects"},{"yourisland_rock","LDirtEffectsBig"},{"yourisland_rock","LStonesEffectsBig"},{"yourisland_stones","LDustEffects"},{"yourisland_stones","LGrassEffectsBig"},{"yourisland_stones","LDirtEffectsBig"},{"yourisland_stones","LStonesEffectsBig"},{"yourisland_wood","LDustEffects"},{"yourisland_wood","LDirtEffectsBig"},{"yourisland_wood","LStonesEffectsBig"},{"yourisland_sand","LDustEffects"},{"yourisland_sand","LDirtEffectsBig"},{"yourisland_sand","LStonesEffectsBig"}};
	};
	class Air: AllVehicles
	{
		rightDustEffects[] = {{"yourisland_grass","RDustEffectsAir"},{"yourisland_grass","RGrassDryEffects"},{"yourisland_grass","RDirtEffects"},{"yourisland_stones","RDustEffectsAir"},{"yourisland_stones","RGrassEffects"},{"yourisland_stones","RDirtEffects"},{"yourisland_rock","RDirtEffects"},{"yourisland_rock","RDustEffectsAir"},{"yourisland_rock","RStonesEffects"},{"yourisland_wood","RDustEffectsAir"},{"yourisland_wood","RSandEffects"},{"yourisland_wood","RDirtEffects"},{"yourisland_wood","RStonesEffects"},{"yourisland_sand","RDustEffectsAir"},{"yourisland_sand","RSandEffects"},{"yourisland_sand","RDirtEffects"},{"yourisland_sand","RStonesEffects"}};
		leftDustEffects[] = {{"yourisland_grass","LDustEffectsAir"},{"yourisland_grass","LGrassDryEffects"},{"yourisland_grass","LDirtEffects"},{"yourisland_stones","LDustEffectsAir"},{"yourisland_stones","LGrassEffects"},{"yourisland_stones","LDirtEffects"},{"yourisland_rock","LDirtEffects"},{"yourisland_rock","LDustEffectsAir"},{"yourisland_rock","LStonesEffects"},{"yourisland_wood","LDustEffectsAir"},{"yourisland_wood","LSandEffects"},{"yourisland_wood","LDirtEffects"},{"yourisland_wood","LStonesEffects"},{"yourisland_sand","LDustEffectsAir"},{"yourisland_sand","LSandEffects"},{"yourisland_sand","LDirtEffects"},{"yourisland_sand","LStonesEffects"}};
	};
	class Man: Land
	{
		rightDustEffects[] = {{"yourisland_grass","RDustEffectsMan"},{"yourisland_stones","RDustEffectsMan"},{"yourisland_rock","RDustEffectsMan"},{"yourisland_sand","RDustEffectsMan"},{"yourisland_wood","RDustEffectsMan"}};
		leftDustEffects[] = {{"yourisland_grass","LDustEffectsMan"},{"yourisland_stones","LDustEffectsMan"},{"yourisland_rock","LDustEffectsMan"},{"yourisland_sand","LDustEffectsMan"},{"yourisland_wood","LDustEffectsMan"}};
	};
};
 

Save it!

Well, then replace the "yourisland_*" with classes from your cfgSurfaces section, for each type of terrain that you use, eg. grass, woods, rock, snow, sand etc.

 

If you have any questions, shoot!

  • Like 3

Share this post


Link to post
Share on other sites

In rightDustEffects is they meant to be LDustEffects? It's at the end of most of the rightDustEffects

{"yourisland_wood","RStonesEffectsBig"},{"yourisland_sand","LDustEffects"},{"yourisland_sand","LDirtEffectsBig"},{"yourisland_sand","LStonesEffectsBig"}};

Also under man rightDustEffects, wood and sand is listed twice

class Man: Land
{
rightDustEffects[] = {
{"yourisland_grass","RDustEffectsMan"},
{"yourisland_stones","RDustEffectsMan"},
{"yourisland_rock","RDustEffectsMan"},
{"yourisland_sand","RDustEffectsMan"},
{"yourisland_wood","RDustEffectsMan"},
{"yourisland_sand","RDustEffectsMan"},
{"yourisland_wood","RDustEffectsMan"}
};
leftDustEffects[] = {
{"yourisland_grass","LDustEffectsMan"},
{"yourisland_stones","LDustEffectsMan"},
{"yourisland_rock","LDustEffectsMan"},
{"yourisland_sand","LDustEffectsMan"},
{"yourisland_wood","LDustEffectsMan"}
};


Thanks for posting this B) , I'm writing the config up now!

Share this post


Link to post
Share on other sites

Nicely done Icebreakr mate, this was something that stumped me for a while.

Share this post


Link to post
Share on other sites

RoF: thanks, it seems I've taken a bad code... fixed it, try it out and tell me if it works now.

Share this post


Link to post
Share on other sites

You could also do this which is working for me. I just call the classes I need from altis. I think this way is a bit better...someone correct me If I'm wrong but the way it is above you will be overwriting a base class. The way this is set up you are just inheriting from it.

class CfgSurfaces
{
 class Default{};
 class Water{};
 class GdtConcrete;
 class GdtSoil;
 class GdtRock;
 class GdtDirt;
 class GdtDesert;
 class GdtGrassDry;
 class GdtStony;
	class jbad_jalalabad_asphaltSurface: GdtSoil
	{
		files = "jbad_jalalabad_asphalt_*";
		character = "Empty";
		soundEnviron = "gravel";
		soundHit = "hard_ground";
		rough = 0.12;
		maxSpeedCoef = 0.85;
		lucidity = 1.5;
		grassCover = 0.02;
		impact = "hitGroundHard";
		surfaceFriction = 0.6;
	};

Share this post


Link to post
Share on other sites

 

 

You could also do this which is working for me. I just call the classes I need from altis. I think this way is a bit better...someone correct me If I'm wrong but the way it is above you will be overwriting a base class. The way this is set up you are just inheriting from it.

 This is exactly how it works in VBS - A selection of surface definitions are in there and "always present" since they're part of the core definitions, so your own surfaces just declare themselves to be a "child" of the "stock" ground surface which is nearest to the one you're using. Then, any aspects of your surface which differ from the stock one can be specified below... If you specify a unique parameter for your surface, you get that value - anything you don't specify, you get the value used by the stock surface.

 

Makes it relatively quick and easy to define your own surfaces without having to declare every single parameter for every single surface... Like - if you have a custom concrete, but it will behave like stock concrete, same footstep sounds, impact sounds, dust factor etc, only the appearance is different, you can inherit from the stock concrete - specify your texture files as the only parameter and you're done - you'll get your concrete visual appearance, and stock concrete behaviour.... 

 

 

B

Share this post


Link to post
Share on other sites

I can't seem to get this to work. :( Is it because some are still set to Default? I was just trying to test it on the beach to start with, but I get nothing...

 

Also m1lkm8n has "surfaceFriction = 0.6;" in his config and I don't. What does that do?

class CfgSurfaces 
{
 class Default{};
 class Water{};
 class GdtConcrete;
 class GdtSoil;
 class GdtRock;
 class GdtDirt;
 class GdtDesert;
 class GdtGrassDry;
 class GdtStony;
	class rof_kintyre_dirt_Surface : Default
	{	
		 files = "rof_kintyre_dirt_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.9;
		 dust = 0.5;
		 soundEnviron = "dirt";
		 character = "Empty";
		 soundHit = "soft_ground";
		 lucidity = 1;
		 grassCover = 0.03;
	};
	class rof_kintyre_dry_grass_Surface : Default
	{	
		 files = "rof_kintyre_dry_grass_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.9;
		 dust = 0.75;
		 soundEnviron = "drygrass";
		 character = "rof_kintyre_dry_grass_Character";
		 soundHit = "soft_ground";
		 lucidity = 2;
		 grassCover = 0.1;
	};
	class rof_kintyre_forest_pine_Surface : Default
	{	
		 files = "rof_kintyre_forest_pine_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.8;
		 dust = 0.4;
		 soundEnviron = "drygrass";
		 character = "rof_kintyre_forest_pine_Character";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.04;
	};
	class rof_kintyre_grass_green_Surface : Default
	{	
		 files = "rof_kintyre_grass_green_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.9;
		 dust = 0.15;
		 soundEnviron = "grass";
		 character = "rof_kintyre_green_grass_Character";
		 soundHit = "soft_ground";
		 lucidity = 4;
		 grassCover = 0.05;
	};
	class rof_kintyre_soil_Surface : Default
	{	
		 files = "rof_kintyre_soil_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.9;
		 dust = 0.5;
		 soundEnviron = "dirt";
		 character = "Empty";
		 soundHit = "hard_ground";
		 lucidity = 1;
		 grassCover = 0.0;
	};
	class rof_kintyre_concrete_Surface : Default
	{	
		 files = "rof_kintyre_concrete_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.9;
		 dust = 0.5;
		 soundEnviron = "Concrete";
		 character = "Empty";
		 soundHit = "Concrete";
		 lucidity = 1;
		 grassCover = 0.0;
	};
	class rof_kintyre_wild_grass_Surface : Default
		{	
		 files = "rof_kintyre_wild_grass_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.8;
		 dust = 0.4;
		 soundEnviron = "grass";
		 character = "Empty";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.08;
	};

    class rof_kintyre_beach_Surface : GdtDesert
  	{	
		 files = "rof_kintyre_beach_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.6;
		 dust = 0.8;
		 soundEnviron = "sand";
		 character = "Empty";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.08;
	};

	class rof_kintyre_woodland_floor_Surface : Default
	{	
		 files = "rof_kintyre_woodland_floor_*";
		 rough = 0.07;
		 maxSpeedCoef = 0.7;
		 dust = 0.4;
		 soundEnviron = "forest";
		 character = "rof_kintyre_woodland_floor_Character";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.04;
	};
    class rof_kintyre_moorland_Surface : Default
  	{	
		 files = "rof_kintyre_moorland_*";
		 rough = 0.07;
		 maxSpeedCoef = 0.8;
		 dust = 0.4;
		 soundEnviron = "grass";
		 character = "rof_kintyre_moorland_Character";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.7;
	};
    class rof_kintyre_field_Surface : Default
  	{	
		 files = "rof_kintyre_field_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.8;
		 dust = 0.4;
		 soundEnviron = "drygrass";
		 character = "rof_kintyre_field_Character";
		 soundHit = "Foliage";
		 lucidity = 3.5;
		 grassCover = 0.5;
	};
	class rof_kintyre_stone_Surface : Default
    {	
		 files = "rof_kintyre_stone_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.8;
		 dust = 0.4;
		 soundEnviron = "rock";
		 character = "Empty";
		 soundHit = "hard_ground";
		 lucidity = 3.5;
		 grassCover = 0.08;
	};

	class rof_kintyre_tilled_Surface : Default
  	{	
		 files = "rof_kintyre_tilled_*";
		 rough = 0.05;
		 maxSpeedCoef = 0.6;
		 dust = 0.4;
		 soundEnviron = "dirt";
		 character = "Empty";
		 soundHit = "soft_ground";
		 lucidity = 3.5;
		 grassCover = 0.08;
	};

};

Share this post


Link to post
Share on other sites

Rof change the : Default

to whatever ground texture you wish to inherit from.

So for instance your first ground texture change the yourgroundtexturename : Default

to yourgroundtexturename : GdtSoil

Just like that. Do that to all you ground textures that are inheriting from the default class

As far as surface friction. That has to do with vehicles driving on the surface

Share this post


Link to post
Share on other sites

What friction do you recommend for:

a) deep snow

b) ice /frozen

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×