Home   Help Search Login Register  

Author Topic: Looking to make a unit replacement .pbo - Where to begin  (Read 2576 times)

0 Members and 1 Guest are viewing this topic.

Offline REED

  • Members
  • *
Hello.  I am looking to make a simple (or so I assume) unit replacement addon that will replace the stock arma units with units to my liking.  I would like this to be contained in a .pbo file.  I had a look at a similar one and i notice if I unpack the pbo I find .bin files but they do not look correct when viewing in notepad so I think they are compiled somehow but not sure where to begin.  Any help is greatly appreciated.  Thanks   :)


Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Looking to make a unit replacement .pbo - Where to begin
« Reply #1 on: 20 Jul 2008, 23:35:43 »
Hi there!

Replacement packs are basically config changes (as you've noticed, they just contain the config.bin). A config.bin is a binarized config.cpp, you can open it with various tools that can be found in the Ed.Depot for the moment: Kegetys' Tools contain a tool called "unRap" which should be able to de-binarize the config.bins, allowing you to read them (with for instance notepad).

I don't personally use replacement files, so I haven't got an example config.cpp here to show you, but essentially what they do is overwrite the stock ArmA unit configs : for instance, in stock ArmA, there is a class called "SoldierWAT" (Soldier, West, AT), defined in the basic ArmA/Addons/characters.pbo:config.bin. What the replacement config does is replace this class by creating an identical one (addon .pbo configs always overwrite stock configs if the class names are the same, since they're loaded later), except changing the model = "blah blah" to something else (in this case, the wanted addon). Of course, the paths need to match up to the ones inside the addon's pbo as well, or there will be all kinds of errors.

If you can read configs, opening up an existing replacement config and checking out how they're done should pretty much give you the solutions on how to do this. Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Looking to make a unit replacement .pbo - Where to begin
« Reply #2 on: 21 Jul 2008, 13:05:42 »
Heres a good example.
hamis had released a Skoda replacement addon
The addon is primarily only a CONFIG.CPP file which overwrites existing definitions.
Obviously in this example, Sigma-6's addon pack is the source of the new models.

CONFIG.CPP
Code: [Select]
#define _ARMA_

#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define true 1
#define false 0

// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536

 class CfgPatches
 {
  class Skoda_replacement
         {
           units[] = {};
           weapons[] = {};
           requiredVersion = 1.00;
           requiredAddons[]={"CAWheeled","CAwheeled3"};
        };
};

class CfgVehicles
{
class All{};
class AllVehicles: All{};
class Land: AllVehicles{};
class LandVehicle: Land{};
class Car: LandVehicle{};
class SkodaBase: Car{};

class Skoda: SkodaBase
 {
  model = "\monaco\monaco.p3d";
  picture="\Monaco\ico\Monaco_ca.paa";
  icon="\Monaco\map_ico\icomap_Monaco_ca.paa";
  displayName="1968 Dodge Monaco 500";
  displayNameShort = "$STR_DN_Monaco";
  soundEngine[]={"\Monaco\motor.wav",0.8,1.0};
   };


 class SkodaBlue: SkodaBase
 {
  model = "\cuda\cuda.p3d";
   picture="\cuda\ico\cuda_ca.paa";
   icon="\cuda\map_ico\icomap_cuda_ca.paa";
  displayName = "1970 Plymouth AAR Cuda";
  displayNameShort = "AAR Cuda";
  soundEngine[]={"\Monaco\motor.wav",0.8,1.0};
};

 class SkodaRed: SkodaBase
 {
model = "\SIG_chargerrt\chargerrt.p3d";
   picture="\SIG_chargerrt\ico\chargerrt_ca.paa";
  icon="\SIG_chargerrt\map_ico\icomap_chargerrt_ca.paa";
   displayName="1969 Dodge Charger R/T";
  displayNameShort = "Dodge Charger";
   soundEngine[]={"\Monaco\motor.wav",0.8,1.0};
   };


 class SkodaGreen: SkodaBase
 {
model = "\cd71hm\cd71hm.p3d";
   picture="\cd71hm\ico\cd71hm_ca.paa";
  icon="\cd71hm\map_ico\icomap_cd71hm_ca.paa";
   displayName = "1971 Plymouth Hemicuda";
   displayNameShort = "Hemi Cuda";
   soundEngine[]={"\Monaco\motor.wav",0.8,1.0};
   };
};

Vehicles like SkodaRed and SkodaBase are ALREADY defined in ArmA, this simply overwrites the definition.
Your files sit in a folder of the same name you want your PBO file to be called.
Once finished editing your cpp file, simply compact the folder into a PBO file using tools like cPBO or Eliteness.