Jump to content
Sign in to follow this  
konyo

Creating a config for a static object?

Recommended Posts

Hi all. Ive decided to play around with a little model i made for myself, but i cant create a config for it? Its a 2 post Hydraulic car lift.

This is the config ive written for it so far :

class CfgPatches {
class Carlift {
	units[] = {};
	weapons[] = {};
	requiredAddons[] = {};
};
};

class CfgFactionClasses
{
  class Empty
 {
  displayName = "Empty";
  priority = 0;
  side = 1;
 };
};

class CfgVehicles {	
class Carlift : Static {
	scope = public;
	model = "\carlift\carlift.p3d";
	displayName = "2 Post Hydraulic Lift";
	faction = "Empty";
	vehicleClass = "Objects";
};
};

However when i start the game, i get a error message saying :

File carlift\config.cpp, line 19: /cfgVehicles. Carlift: Undefined base class 'Static'

I take it i haven’t written it right? So could someone please tell me how to correct this so i can have it as a static object?

Thankyou.

Share this post


Link to post
Share on other sites

class CfgVehicles {	
class Static;
class Carlift : Static {
	scope = public;
	model = "\carlift\carlift.p3d";
	displayName = "2 Post Hydraulic Lift";
	faction = "Empty";
	vehicleClass = "Objects";
};
};

You have to "preload" the class from which you inherit your new object.

Share this post


Link to post
Share on other sites
Myke;1705471']
class CfgVehicles {	
class Static;
class Carlift : Static {
	scope = public;
	model = "\carlift\carlift.p3d";
	displayName = "2 Post Hydraulic Lift";
	faction = "Empty";
	vehicleClass = "Objects";
};
};

You have to "preload" the class from which you inherit your new object.

Ok thankyou. I dont get the error message now :D But however i cant find it in game under Empty > Objects? Have i written it wrong? I normally write all my configs like that. So i cant see how its wrong? :confused:

Share this post


Link to post
Share on other sites

Is this the entire config? No #defines at the beginning? If so, you need to change this:

scope = public;

to this:

scope = 2;

Or you add this to the top of your config:

#define private 0
#define protected 1
#define public 2

Share this post


Link to post
Share on other sites
Myke;1705504']Is this the entire config? No #defines at the beginning? If so' date=' you need to change this:

scope = public;

to this:

scope = 2;

Or you add this to the top of your config:

#define private 0
#define protected 1
#define public 2

[/quote']

Yup what i posted was the entire config file. Ill try those quick, and edit it with the news.

EDIT : Scope 2 worked :) whooo! thankyou! but its created another class called Objects too, so there is 2 Objects classes, and its well to big in game lol, so now i just need to re-size & texture :)

Thanks again!

Edited by konyo

Share this post


Link to post
Share on other sites
Its created another class called Objects too, so there is 2 Objects classes?

Sorry for double post. How would i make my addon stop creating another class name called 'Object?' How can i make it go in the stock 'Objects' class with all the other objects?

Cheers

konyo

Share this post


Link to post
Share on other sites
Sorry for double post. How would i make my addon stop creating another class name called 'Object?' How can i make it go in the stock 'Objects' class with all the other objects?

Cheers

konyo

Try:

vehicleClass = "Misc";

Share this post


Link to post
Share on other sites
Try:

vehicleClass = "Misc";

Yay thankyou, it worked :)

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  

×