Addons & Mods Depot > Arma2 - O2 and Models/Modelling

Putting an object into ARMA2?

(1/5) > >>

Absolution:
My goal is to model buildings. I have a lot of experience working with 3D models and a basic knowledge of C++ type language. However, I have zero experience working with scripts and config files. After reviewing several tutorials I can create the model, texture it and binarize it.

What I can not do is write a config file that will allow my object to be used by the ARMA2 Editor.

For the sake of argument lets say I have a wall, a simple knee high wall. I am not even worried about collisions at the moment (Gnat's tutorial should be sufficient when I am ready). What does my config file need to look like in order for me to use that wall in ARMA2?

i0n0s:

--- Code: ---class CfgPatches {
class ION_RTE_Dta { //name of the addon
units[] = { //units which will get added
"ION_RTE_Flag",
"ION_RTE_Sign",
"ION_RTE_Pipe"
};
weapons[] = {};
requiredVersion = 1;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

lass CfgVehicleClasses {
class ION_RTE_Objects { //Creates a new group under which it will be visible in the editor
displayName = "ION_RTE_Objects";
};
};

class CfgVehicles {
class FlagCarrier; //loading old class for inheritance
class ION_RTE_Flag : FlagCarrier { //inherits Flag from FlagCarrier
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="ION_RTE_Objects"; //->CfgVehicleClasses
displayName ="ION_RTE_Flag"; //name of the object
destrType = DestructNo;
model = "\ION_RTE_Dta\ION_Flag.p3d"; //path to the binarized model
icon = "\ION_RTE_Dta\blank.paa"; //icon used in editor
};
};
--- End code ---
Inheritance should be clear since you're used to C++. Recommended to use since it prevents you from forgetting some entries.

It will get more complicated if you start with animations and so, but the above shows the basic of how to bring in a wall.

Absolution:
Thank you for that. It helped me understand a few things. Also let me clarify. I have a fundamental understanding of how C++ works but I wouldn't describe myself as "used" to it. I've recoded the text to comply with my object but it is not showing in the editor:


--- Code: ---class CfgPatches {
class Test_Wall { //name of the addon
units[] = { //units which will get added
"Test_Wall"
};
weapons[] = {};
requiredVersion = 1.03;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

class CfgVehicleClasses {
class Test_OBJ { //Creates a new group under which it will be visible in the editor
displayName = "Test Objects";
};
};

class CfgVehicles {
class Objects; //loading old class for inheritance
class Test_Wall : Objects { //inherits Flag from FlagCarrier
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="Test_Wall"; //->CfgVehicleClasses
displayName ="Test Wall"; //name of the object
destrType = DestructNo;
model = "\Wall\Test_Wall.p3d"; //path to the binarized model
};
};

--- End code ---

I changed the inheritance since it wasn't working and I tried something different. I also removed the icon line since I don't have an icon to use anyway. I assumed ARMA2 would put in the square with a "?" in it.

If my code seems to be okay maybe its my LODs? I have only one geometry LOD containing my components. I gave the model mass, closed it and confirmed convexity.

Perhaps the name of the CFG matters? I just named it the generic "model.cfg".

Thoughts?

DeanosBeano:
 
--- Quote ---Perhaps the name of the CFG matters? I just named it the generic "model.cfg".
--- End quote ---

first its config.cpp

 second i made a few changes.




--- Code: ---class CfgPatches {
class Test_Wall { //name of the addon
units[] = { //units which will get added
"Test_Wall"
};
weapons[] = {};
requiredVersion = 1.03;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

class CfgVehicleClasses {
class Test_OBJ { //Creates a new group under which it will be visible in the editor
displayName = "Test Objects";
};
};

class CfgVehicles {
class NonStrategic; //loading old class for inheritance
class Test_Wall : NonStrategic { //inherits Flag from FlagCarrier
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="Test_OBJ"; //->CfgVehicleClasses
displayName ="Test Wall"; //name of the object
destrType = "DestructNo";
model = "\Wall\Test_Wall.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 2;// size of icon when placed in editor
};
};
--- End code ---

just changed inheritance to a nonstrategic like Bis do for walls
 and you simply  made mistake of not declaring your vehicleclass as defined above in cfgvehicle class   .i.E  not vehicleclass = "testwall" but  Test_OBJ. gave it some armor value and mapsize for  icon when place in game  editor

 If you get some problems it maybe that you need to add some required addons such as cabuildings2 or cadata , sometimes when inheriting from BIS classes its wise to see what they would load as a required addon and match it.

 bit busy right now i think that should work ok but untested .  

 another tip  if you check the wiki you can also add properties in 02 in the Geo lod  , this is good for Class Map objects when using in vistor so they show outlined when pressing M in game others are applicable too.

 finally you can have along side a model.cfg

 this is to define skeletons etc or sections if your wall has some movingparts or will have a hole blown in it etc.

 i dont think you need one for a wall that is a simple solid object .

 but if you wanted you could add a basic template like so .

 
--- Code: ---class cfgSkeletons
{
 class default;
 class Test_wall : default
 {
  SkeletonBones[]=
  {
   
  };
 };
};
class CfgModels
{
 class Default;
 class Test_wall:default
 {
   skeletonName="Test_wall";
   sections[]=
   {
     "
    };
   class Animations
   {
   
  };
 };
};
--- End code ---

i0n0s:
'Objects' is not a valid class name. Check kjus All-In-One config for existing classnames.

You can use 'Wall' which exists.

Navigation

[0] Message Index

[#] Next page

Go to full version