Jump to content
Sign in to follow this  
mcnools

"Undefined Base Class: Default" But it's defined? :S

Recommended Posts

I'm trying to add more surface-types to a test-map I'm using, but now when I added another surface-type I get this error on startup:

"Undefined Base Class 'Default'".

Weird thing is that it worked fine on the first surface-type I added. This is how my cfgSurfaces.hpp looks like:

class CfgSurfaces

{

class Default {};

class FTDirtSurface : Default

{

access = 2;

files = "ft_polopoust_*";

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "FTDesertClutter";

soundHit = "soft_ground";

};

class FTSandSurface : Default

{

access = 2;

files = "ft_polopoust_*";

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "Empty";

soundHit = "soft_ground";

};

};

class FTForestSurface : Default

{

access = 2;

files = "ft_forest_*";

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "FTForestClutter;

soundHit = "soft_ground";

};

};

class CfgSurfaceCharacters

{

class FTDesertClutter

{

probability[] = {0.16,0.12,0.015,0.015};

names[] = {"FT_BrushHard","FT_BrushSoft","FT_Weed1","FT_WeedThistle"};

};

class FTForestClutter

{

probability[] = {0.16,0.12,0.015,0.015};

names[] = {"FT_BrushHard","FT_BrushSoft","FT_Weed1","FT_WeedThistle"};

};

};

Why does it tell me that "Default" is undefined when it didn't have a problem with the first two surface-types? This config business is way over my head sometimes. Logic isn't really my strong side.

Share this post


Link to post
Share on other sites
class Default {};

is wrong, it should be:

class Default;

Share this post


Link to post
Share on other sites

You have too many };

class Default is indeed defined in CfgSurfaces, but you close CfgSurfaces, and then define another class based on Default; class FTForestSurface : Default

I'd suggest to use proper indentation and a highlighting text editor so that you are much more aware of these things, and code blocks (instead of that ... spoiler stuff) when copy pasting to the forum (or preferably post to a pastebin with cpp highlighting, http://www.pastie.org).

Edited by Sickboy

Share this post


Link to post
Share on other sites
class FTSandSurface : Default

{

access = 2;

files = "ft_polopoust_*";

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "Empty";

soundHit = "soft_ground";

};

}; <<<<<<<< one too many

As above you have one to many and so your last define is not part of the structure

Share this post


Link to post
Share on other sites

EDIT: Ah, thanks Thromp! I'll try that

EDIT AGAIN: That did the trick! thanks :)

Edited by McNools

Share this post


Link to post
Share on other sites

also beaware you are defining ft_polopoust as two different surfaces see below.dont think this will achieve what you want , you should define only one surface and then define what properties you would like it to have but only once.

class FTDirtSurface : Default

{

access = 2;

files = "ft_polopoust_*"; <<<<<<<<<<<<<<<<<

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "FTDesertClutter";

soundHit = "soft_ground";

};

class FTSandSurface : Default

{

access = 2;

files = "ft_polopoust_*";<<<<<<<<<<<<<<<<<<<<<<<

rough = 0.01;

dust = 0.9;

soundEnviron = "dirt";

character = "Empty";

soundHit = "soft_ground";

};

Share this post


Link to post
Share on other sites

Actually it's on porpose, the first one is dirt with a bit of bushes etc. as clutter, and the second one is the same, but without the clutter, for areas around buildings etc. :) might give it a whole other surface later on though, depends on how it will match to the satmap etc.

(unless it could cause other problems if I use the same texture-files for them?)

Thanks again for your help aswell! I'll get the hang of this myself one day.

Edited by McNools

Share this post


Link to post
Share on other sites

to do that wou will need to change one of the rvmat names , the process is as follows

engine sees the rvmat ft_polopoust.rvmat (which is binarised to the wrp )

then it looks config and sees the define for ft_ polopoust ander applies the clutter defined.

If at the moment you do have ft_polopoust and it has some areas clutter and some not then i am assuming its been averaged or ,its all clutter ( last define is taken) ?

best way is to change the rvmat applied to your dirt areas in the layers config where you want dirt and simply call it ft_DirtPolopoust

class Layers

{

class FTDirtSurface

{

texture = "tut\tut_samplemap\data\ft_polopoust_mco.png";

material= "tut\tut_samplemap\data\ft_polopoust.rvmat";

};

class FTSandSurface

{

texture = "tut\tut_samplemap\data\ft_DirtPolopoust_mco.png";

material= "tut\tut_samplemap\data\ft_DirtPolopoust.rvmat";

};

};

class Legend

{

picture="tut\tut_samplemap\source\mapLegend.png";

class Colors

{

FTDirtSurface[]={{255,255,255}};

};

FTSandSurface[]={{255,255,0}};

};

};

and then change the :

class FTSandSurface : Default

{

access = 2;

files = "ft_DirtPolopoust_*";

obviously the naming above really isnt suitablke for good workflow , sand and dirt should really be swapped but you get the drift (pun) hopefully

another tip when making a mask_mco , you can define the colour of the land and objects iincluding roads , make roads white with no borders , make houses red with no borders and make trees green with borders ,

you can define other place and objects at will but ensure there are only 4 colours in one square segment (dont forget to count back ground ccolour), when happy export terrain as picture (not.pbl but image ) this will now be an exact mask_lco please select the first tab that looks like flames in visitor to show custom colour land .

for more advance techniques you can alter the colour of the height of the land and also make 10 meter squares in 02 and define there colour when adding them in visitor ( for example tools >artificial objects > add/browse/ >select a sqaure you have made ft_grass_10m > define custom colour > make border and fill 0,255,255 ) to place over poppie grassed areas so your mask is pretty exact .

Edited by Thromp

Share this post


Link to post
Share on other sites

Thanks for the advice mate! It'll come in handy :)

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
Sign in to follow this  

×