Jump to content
tpw

CfgWorlds advice needed

Recommended Posts

I'm basically keen on getting maps to use the older style A3 tonemapping .

 

Something like this works pretty well for a map such as Dyala, which has no 1.60 compatible CfgWorld class of its own :

class CfgWorlds {
class DefaultLighting;
class DefaultWorld;
class CAWorld:DefaultWorld{
class HDRNewPars {
tonemapMethod = 2
};
};


class DYA: CAWorld{
delete Weather;
delete Lighting;
};
};  

When I try to do the same thing with an existing map such as Stratis, the whole thing falls over. I don't want a new Stratis that just inherits from CAWorld. I want a new Stratis that inherits from the existing Stratis, but just changes the tone mapping parameter, something like this:

class CfgWorlds {
class DefaultLighting;
class DefaultWorld;
class CAWorld:DefaultWorld{
};

class Stratis:Stratis{
class HDRNewPars {
tonemapMethod = 2
};
};
}; 

Except that this falls over with an undefined base class 'Stratis' error. 

 

If anyone can give me some pointers on how best to proceed, I'd be grateful.

Share this post


Link to post
Share on other sites

Don't call the class stratis. Call it something new. You will also probably need to redefine some of the other parameters like the displayed name.

Ex

Class stratis_oldStyleTone: stratis {

Share this post


Link to post
Share on other sites

Thanks for that flyinpenguin.

 

So you're saying there's no way to change an already existing map class?

 

How then do I get the map Stratis to use the new Stratis_oldStyleTone class? Forgive me if I sound a bit confused here, but I appreciate the help.

Share this post


Link to post
Share on other sites

class CfgWorlds {
class DefaultLighting;
class DefaultWorld;
class CAWorld:DefaultWorld{
};

class Stratis:Stratis{
class HDRNewPars {
tonemapMethod = 2
};
};
}; 

Except that this falls over with an undefined base class 'Stratis' error. 

 

If anyone can give me some pointers on how best to proceed, I'd be grateful.

 

You are calling to inherit from Stratis, but you haven't "loaded"/defined the external class first. -> undefined base class. You stopped "loading" at CAWorld. And yes, you should rename your new stratis to something else.

 

Also, class HDRNewPars within your new Stratis does not inherit from anything, so if you where to write it like that the entire HDRNewPars class that you inherit from original Stratis would be overwritten with just the content "tonemapMethod=2; and that's it. Idk what else is supposed to go in this class, but i'm sure there is more in that class then just tonemapmethod.

Share this post


Link to post
Share on other sites

Thanks for the answer, I appreciate it. In the hours since I posted this I glommed all I could on class inheritance and the best I've been able to manage is:

 

class CfgWorlds
{
class DefaultLighting;
class DefaultWorld;
class CAWorld:DefaultWorld
{
class HDRNewPars; 
};

class Stratis: CAWorld
{
class HDRNewPars:HDRNewPars 
{
tonemapMethod = 2;
};
}; 
};

This gives Stratis a pre1.60 tonemapped look derived from CAWorld and works as intended.

 

I can do the same thing and derive a class from Altis and then create a Stratis class from it which also works as intended.

 

I just can't derive a class from Stratis and then apply it back to Stratis because Stratis is then already defined.

class CfgWorlds
{
class DefaultLighting;
class DefaultWorld;
class CAWorld;
class Stratis;

class Stratis_TPW: Stratis
{
class HDRNewPars; 
};

class Stratis: Stratis_TW
{
class HDRNewPars:HDRNewPars
{
tonemapMethod = 2;
};
};
};

If anyone knows a way around this I'm all ears!

 

By the way this is more an exercise in config wrangling than anything particularly practical at this point. Old style tonemapping with new lighting doesn't necessarily work together too well.

Share this post


Link to post
Share on other sites

 

I just can't derive a class from Stratis and then apply it back to Stratis because Stratis is then already defined.

Yes that is correct and intended. Your parents can't also be your childs, same holds true for classes in Arma (and majority of class based scriptlanguages for that matter).

 

Why do you want to inherit from stratis, and then reverse-inherit again? What's your goal?

 

If you want a custom Stratis, just with old tonemapping you do

class CfgWorlds {
class DefaultLighting;
class DefaultWorld;
class CAWorld:DefaultWorld { class HDRNewPars; };
class Stratis:CAWorld {};


class Stratis_TPW: Stratis {
class HDRNewPars:HDRNewPars { tonemapMethod = 2; };
}; 
};

Share this post


Link to post
Share on other sites

note: terrain class must match wrp name or save games are broken

Share this post


Link to post
Share on other sites

Thanks for the input. This one's going on the back burner for  while!

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

×