Home   Help Search Login Register  

Author Topic: Putting an object into ARMA2?  (Read 9988 times)

0 Members and 1 Guest are viewing this topic.

Offline Absolution

  • Members
  • *
Putting an object into ARMA2?
« on: 05 Sep 2009, 18:09:18 »
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?

Offline i0n0s

  • Former Staff
  • ****
Re: Putting an object into ARMA2?
« Reply #1 on: 05 Sep 2009, 19:24:57 »
Code: [Select]
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
};
};
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.

Offline Absolution

  • Members
  • *
Re: Putting an object into ARMA2?
« Reply #2 on: 05 Sep 2009, 21:13:17 »
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: [Select]
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
};
};

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?
« Last Edit: 05 Sep 2009, 21:15:03 by Absolution »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Putting an object into ARMA2?
« Reply #3 on: 05 Sep 2009, 21:49:09 »
 
Quote
Perhaps the name of the CFG matters? I just named it the generic "model.cfg".

first its config.cpp

 second i made a few changes.



Code: [Select]
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
};
};

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: [Select]
class cfgSkeletons
{
 class default;
 class Test_wall : default
 {
  SkeletonBones[]=
  {
   
  };
 };
};
class CfgModels
{
 class Default;
 class Test_wall:default
 {
   skeletonName="Test_wall";
   sections[]=
   {
     "
    };
   class Animations
   {
   
  };
 };
};
« Last Edit: 05 Sep 2009, 21:57:49 by DeanosBeano »
I love ofp

Offline i0n0s

  • Former Staff
  • ****
Re: Putting an object into ARMA2?
« Reply #4 on: 05 Sep 2009, 21:54:36 »
'Objects' is not a valid class name. Check kjus All-In-One config for existing classnames.

You can use 'Wall' which exists.

Offline Absolution

  • Members
  • *
Re: Putting an object into ARMA2?
« Reply #5 on: 05 Sep 2009, 22:36:33 »
Thank you i0n0s and DeanosBeano! I now have a wall sitting in my game... I did something wrong with the textures and its an invisible wall... but its there so that was the hard part, lol.

Since I am here perhaps you can answer another question. Since I am modeling a building I obviously need doorways. Keeping it simple I was just going to put a door shaped hole in my wall. I currently have it modeled as 1 component (basically an upside-down U). My model fails the convexity check.

Am I limited to making walls with doors in 3 parts? Two walls on either side of the door and one overhead piece?

Offline i0n0s

  • Former Staff
  • ****
Re: Putting an object into ARMA2?
« Reply #6 on: 05 Sep 2009, 23:12:02 »
You need to do three parts since the angle in the edge of the door are greater than 179°, so the convexity will fail.

Offline Absolution

  • Members
  • *
Re: Putting an object into ARMA2?
« Reply #7 on: 05 Sep 2009, 23:40:54 »
Well I can get creative with that issue.

When I binarize my addon I get this error in a text file:

W:\c\Poseidon\El\FileServer\fileServer.cpp(2287) : Assertion failed '_workerThread.Size() == _nRequestsLoading'

anything I need to be worried about? I can see, shoot and touch my wall so I just assume no.

Offline i0n0s

  • Former Staff
  • ****
Re: Putting an object into ARMA2?
« Reply #8 on: 06 Sep 2009, 03:57:15 »
This error shouldn't occur. But since this is an internal error from binarize, I don't know how to go around this.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Putting an object into ARMA2?
« Reply #9 on: 06 Sep 2009, 06:44:26 »
Seen that error before. I usually just close all BIS's programs, and restart BinPBO again it seems to go away.

Offline Absolution

  • Members
  • *
Re: Putting an object into ARMA2?
« Reply #10 on: 07 Sep 2009, 00:03:32 »
I understand there is a child forum specifically designed to address my next question but I just assume not clutter up your forums with paralleling topics.

Textures!
Again using my plain old wall as an example I can apply a texture to it and everything works fine. However, when I put a window in that wall the texture no longer shows up. I've gone into face editing and applied my texture to all of the faces but nothing. No errors pop up in buldozer. In fact I can put my plain wall next to my windowed wall with everything else being the same and the plain wall shows the texture and the other does not.

While I am new to the texture game I am not completely ignorant to the theory. I assume I need to map my texture and teach it how to wrap itself around my windowed wall. Am I correct in this assumption?

Are there any handy tutorials on the subject... I can't find any that pertain to ARMA2.


*edit*
I'll add in that my windowed wall is all composed into a single component. Am I limited to texturing simple, continuous objects?
« Last Edit: 07 Sep 2009, 00:05:30 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Putting an object into ARMA2?
« Reply #11 on: 07 Sep 2009, 14:02:56 »
Going to need a bit more info Absolution
- Are your textures TGA files? Its prefered
- The TGA file is in the same directory as the P3D?
- How are you applying them?
..... press A key, drag a box, right click in box, select Load Texture, then press B to apply the texture to the object?

Offline Absolution

  • Members
  • *
Re: Putting an object into ARMA2?
« Reply #12 on: 07 Sep 2009, 17:29:31 »
In order to create my textures I have used GIMP to make a JPEG. I then use TextView 2 to convert that into a PAA (buldozer doesn't seem to like my TGAs). In the resolution LOD I use "select faces" and, obviously, pick the faces I am interested in. Next, I go to "face properties" and navigate to my texture (which is in the same folder as my p3d) and click apply.

As with most of my efforts, it is my first time doing it and texturing is no exception. Since my last post I have learned about UV mapping and watched a tutorial. I haven't had a chance to try it out but it seems sound to me. So that explains my problem.

However, two questions remain about textures:
Why can I get away with incorrectly texturing a simple cube and not a more complex geometry? The texture repeats itself properly on each face. No warping or otherwise goofy looking results.

Why don't my TGA's work? In GIMP I draw my texture and export it to TGA. I get my TGA file just fine but Buldozer says "Can not load texture yaddayaddayadda". It's in the same folder as my p3d and I apply it (albeit with my incorrect process) to that simple cube (which tests show "should" work regardless). No dice.


---
Again, to all of you who have taken the time to help me I thank you. I know how it is trying to explain basic things to a novice and you do yourselves credit. Hopefully I can start asking for more advanced help that will be worth your skill level.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Putting an object into ARMA2?
« Reply #13 on: 07 Sep 2009, 18:20:28 »

 
 This is not my subject at all ,i hate textures .
 But in case its a while before a knowledgeable chap comes along i will try answer in my laymans terms.
 TGA must be 32 bit  from Gimp or infranview or Photoshop etc .
 I have never personally converted a JPG to PAA , i heard a rumour it was possible but never tried.
 .
 when you open bulldozer it will be automatically converted to PAA




 
I love ofp

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Putting an object into ARMA2?
« Reply #14 on: 07 Sep 2009, 22:29:40 »
aye, 24bit TGA with 8 bit alpha gives you 32 bit TGA files.

Buldozer probably complains unless your texture dimensions are in 2^.

128 X 256, 256 X 256, 256 X 512, 512 X 512 ... etc etc etc.


Planck
I know a little about a lot, and a lot about a little.