Jump to content
Sign in to follow this  
person915

Error with Config.cpp

Recommended Posts

BinPBO is telling me my config.cpp has an error. I followed the model off of Bushlurker's tutorial, but adapted it to suit my own project. Despite following the model, I can't help but feel that I copied something down wrong, messed up with spacing, wrote something wrong, or forgot to change the pathnames or something else entirely. Can anyone spot anything wrong? I'm not that experienced with these things so spotting the errors is hard for me, and I've been looking over it for a while now.

Here it is:

http://i.imgur.com/O5kDH4I.png (187 kB)

http://i.imgur.com/9mmexk4.png (171 kB)

http://i.imgur.com/4JAU6wQ.png (166 kB)

Sorry that it has to be "spliced together" but copy+pasting it into textboxes here seems to get rid of the indents and spaces, which very may well be the pitfall in this config! Thank you for any replies, configs really are quite a thing to deal with, especially erroneous ones!

Share this post


Link to post
Share on other sites

Ok first off try pastebin.com

You can put your code there and link here so we don't need to open pictures like that.

First thing I notice is cfgpatches

That needs to be the name of your pbo(the last folder everything is inside) which in your case looks like its "village"

Same with units right underneath that. That needs to say village as well.

I didn't look at the rest because it's too darn confusing looks at three seperate pictures of your configuration. Post it to pastebin then link us if you have any more problems.

Oh one last thing. Why would you have chernarus as a required addon if your using arma3?

Are you making a terrain for arma2 or 3. If 2 than that's fine. If not change it to stratis or altis otherwise you most likely will get an error there as well

Share this post


Link to post
Share on other sites

This is going to sound very stupid but, I forgot I posted this in the A3 section instead of A2....

It's been a rough few days, and then there's this. I'll post in the right section from now on, though no use in reposting this thread. Though to answer your question a bit further, I know that Chernarus has been/can be ported to A3, so I'd imagine that might be a reason you would need it, if you actually made a map for A3 (which I'm not) which fed off of its port. I'll try your suggestions then look at pastebin if it still fails.

Share this post


Link to post
Share on other sites

I tried to follow instructions to the best I could, but it still had errors:

vCQG2iK.png

Got it the best i can into 1 pic. I'll talk to some mods real soon

Edited by person915

Share this post


Link to post
Share on other sites

Pastebin.com

Use that please.

Also it would really help if you posted what errors you were getting. That would really help to narrow down the problem.

Oh now I see something. What is class config.bin. Remove that. The first thing should be


class CfgPatches {
class village {
units[] =...
[/Code]

Share this post


Link to post
Share on other sites

Try this? What do you mean?

Is that what the config needs to be? Here's the error I'm getting and have been getting from BinPBO:

http://i.imgur.com/i7sMBn9.png (881 kB)

When I click OK, another dialogue box comes up right after it that says the exact same thing, and that's the last error message I get until I run it again. Not particularly helpful dialogue, is it?

Share this post


Link to post
Share on other sites

By try this I mean to use the code I posted there but remember to remove that last }; right before class cfgworlds.

Also there's an error log that binpbo produces that you can open wherever your pbo it's output to that will go into more detail.

Share this post


Link to post
Share on other sites

I'll formulate more on this theory later when I get my hands on the log file, but I'm beginning to think that the config.cpp might not be the only problem, but something working WITH the config. For instance, I have 4 different surfaces defined in my various cfg's and .hpp's, but I'm only using 2, and those are the only 2 that have their colors on the mask_lco. Am I allowed to do that? Also, for clutter, I only have it set up for one of my surfaces, which is my grass surface which you'll see in the config. The two surfaces I'm using are grass and sand, but the sand is under the ocean so there is no clutter listed for it.

I don't want to get too far into hence I change something that is correct already especially before I get the logfile, since it might just point to a specific file itself. I'll go check. BBS

Here's the logfile:

http://pastebin.com/raw.php?i=Kjf1Utuy

Edited by person915

Share this post


Link to post
Share on other sites

Let's concentrate on one error at a time. Use the fixed code and then we'll take it from there.

Ps..what theory? It's not a theory it's the correct code.

Share this post


Link to post
Share on other sites

Ah ok. I think you may be missing a }; somewhere or have one in the wrong spot. I'll have to look when I get home. And you did remove the other one correct?

Share this post


Link to post
Share on other sites

as I thought the there was a }; in the wrong place.


class CfgWorlds
{
class CAWorld;
class Chernarus: CAWorld
{
class Grid;
class DefaultClutter;
};
[color="#FF0000"]};<--------------that needed to be removed [/color]

[/color]class Clutter
{
#include "cfgClutter.hpp"
};

class Names
{
#include "Village.hpp"
};[color="#FF0000"]
}; <-----------and placed here
[/color][/Code]

heres the new code

http://pastebin.com/SZRFrsQZ

Share this post


Link to post
Share on other sites

You're right, it's fixed, but here's another problem, and I'm not sure at all what this top line means (http://pastebin.com/ZQALEWH5). I know what it says, and what it's saying, but not how it applies to the actual error in the config, especially since pastebin's and the logfile's lines seem to be counted differently. I'm guessing the logfile counts lines based on line with an entry (so the completely clear lines in my .cpp don't get counted). But that's not really the issue right now, I suppose. I'm looking for anywhere that's supposed to have an = sign instead of a character, but so far no luck....

Share this post


Link to post
Share on other sites

Under class zoom2

There's a capitol E before format. Remove that E.

Share this post


Link to post
Share on other sites

Thanks! Getting closer, as the errors are moving farther and farther down the config. This next error is something I was afraid of earlier:

http://pastebin.com/gdjnmSR7

Should I be changing something inside the config, or inside the cfgSurfaces or the cfgClutter? I think I know what it means. I'll back the files up and play around with another set and check back here between messing with them. I think I might know what I have to do.

Share this post


Link to post
Share on other sites

It's hard to tell what you should be doing when you don't post the required configs.

But from looking at that it's saying you have a class already defined and your missing a }; somewhere.

Go through the config and see what you can find. Are you using a text editor like notepad++

I would recommend it so you can see your mistakes better.

Share this post


Link to post
Share on other sites
It's hard to tell what you should be doing when you don't post the required configs.

But from looking at that it's saying you have a class already defined and your missing a }; somewhere.

Go through the config and see what you can find. Are you using a text editor like notepad++

I would recommend it so you can see your mistakes better.

Downloaded notepad++

Okay, so far, you have helped me get my config in order (atleast for now it's telling me so!) so thanks so much. It still gives me the same error, but the logfile says something different, this time referring to my cfgClutter.hpp. This is the problem I was going to investigate before, so kudos to me for learning how to bugfix somewhat, but I still haven't learned how to solve it, hence why I'm asking someone like you who knows more about this than me. Here is the important part of the logfile for this error:

File p:\grmrl\village\cfgClutter.hpp, line 8: /CfgWorlds/Village/Clutter/vl_grass.model: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 9: /CfgWorlds/Village/Clutter/vl_grass.affectedByWind: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 10: /CfgWorlds/Village/Clutter/vl_grass.swLighting: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 11: /CfgWorlds/Village/Clutter/vl_grass.scaleMin: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 12: /CfgWorlds/Village/Clutter/vl_grass.scaleMax: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 14: /CfgWorlds/Village/Clutter/vl_grass.model: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 15: /CfgWorlds/Village/Clutter/vl_grass.affectedByWind: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 16: /CfgWorlds/Village/Clutter/vl_grass.swLighting: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 17: /CfgWorlds/Village/Clutter/vl_grass.scaleMin: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 18: /CfgWorlds/Village/Clutter/vl_grass.scaleMax: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 20: /CfgWorlds/Village/Clutter/vl_grass.model: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 21: /CfgWorlds/Village/Clutter/vl_grass.affectedByWind: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 22: /CfgWorlds/Village/Clutter/vl_grass.swLighting: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 23: /CfgWorlds/Village/Clutter/vl_grass.scaleMin: Member already defined.

File p:\grmrl\village\cfgClutter.hpp, line 24: /CfgWorlds/Village/Clutter/vl_grass.scaleMax: Member already defined.

Basically, what this is saying is that in my cfgClutter.hpp... oh, well I'll just show you:

http://pastebin.com/eunLG7tu

Now before you shake your head uttering "Why God, why?" just know that that isn't the original cfg file. I modified it trying to figure out how to fix it. The problem is you can see I'm trying to define my grass clutter (vl_grass) as default clutter, but I'm trying to use MULTIPLE P3D's. That's where the problem starts. All of those files, c_grassdrylong, c_weed2, etc should appear on the same surface together.

Now, if I kept repeating

class name

{

model

wind

lighting

scalemin

scalemax

};

class name

{

model

wind

lighting

scalemin

scalemax

};

and each time just replaced "model" with a different clutter type, it tells me that the class (vl_grass) has already been defined. If I use the class name once and put those stats (model, scale, wind etc) for each different clutter model and close each of them off with their own set of brackets, it doesn't like it either.

classname

{

model = x

wind

lighting

scalemin

scalemax

};

{

model = y

wind

lighting

scalemin

scalemax

};

{

model = z

wind

lighting

scalemin

scalemax

};

It DOESN'T like what I just typed above. Anyway, if that makes sense, that's how I got to the current state of my cfgClutter.hpp

Theoretically, I could solve the problem by removing my numerous clutters and leaving only one, then changing what's needed to accommodate only one clutter type, but that would be counter intuitive, because I wouldn't learn. I will not compromise when it comes to this, I will achieve what I mean to achieve as long as it's in reason, and this is. So I will learn how to fix it, and not make the same mistake again.

Basically, what I'm asking is the method of defining various models of clutter under one class. What's the format, why does it matter, and how does it work? Not asking to be arrogant, but asking because if I know how it works, I might be able to change it to my needs if I want to deviate. Thanks so much for what you've done so far and continue to do.

Share this post


Link to post
Share on other sites

That's not right. Clutter needs to be defined like this each clutter class with its own unique name and your tag.


class vl_grass: DefaultClutter
{
model = "ca\plants_2\clutter\c_grassBunch.p3d";
affectedByWind = 0.7;
swLighting = 1;
scaleMin = 0.85;
scaleMax = 1.1;
};

class vl_drygrass: DefaultClutter
{
model = "ca\plants_2\clutter\c_GrassDryLong.p3d";
affectedByWind = 0.7;
swLighting = 1;
scaleMin = 0.85;
scaleMax = 1.1;
};
[/Code]

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  

×