Jump to content
Sign in to follow this  
Mongoose_84

"#including" addons for use in another addon

Recommended Posts

i have figured out by now, how to create a .pbo from a .bin using "EliteNess 2.03".

now i want to create new soldier-classes by just changing a few variables from existing ones:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class newSoldier: SoldierWB

{

blah...

blah...

};

but how can i access the existing classes stored in characters.pbo (like SoldierWB)?

is there some preprocessor-command like #include or what do i have to do? help.gif

edit: or is it even necessary to copy all the classes that inherit to following classes out of the characters/config.bin and into my own .bin-file from the first of all classes to the soldier-class i want to use?!

Share this post


Link to post
Share on other sites

you just need to define parent class like

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class SoldierWB;

and that's it.

Share this post


Link to post
Share on other sites

/*extern*/ class SoldierWB;

class SoldierWSaboteur: SoldierWB {};

class ASSaboteurFAC: SoldierWSaboteur

worked fine for my FAC-Unit

Share this post


Link to post
Share on other sites

You don't need /* extern */ necessarily though, it's just comment that my ArmAUnbin added to mark external references more clearly and it just was forgotten in final release. ArmA doesn't use it in any way.

Share this post


Link to post
Share on other sites

nope... still don't get it to work...

i created a .bin file:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgVehicles

{

class SoldierWB;

class WGMBlue1 : SoldierWB

{

model = "\ca\characters\civil_1_tshirt";

displayName = "Gang Member";

weapons[] = {"Makarov","Throw","Put"};

magazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

respawnWeapons[] = {"Makarov"};

respawnMagazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

class Wounds

{

tex[] = {};

mat[] = {"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat","ca\characters\*...*.rvmat"};

};

};

};

i created a .pbo from it. its in the addons-folder.

in the editor i can neither just place the unit nor can i add it via script ("bad vehicle type", it's just not there i think)...

what am i doing wrong?

edit: i've never made an addon before btw and the code above is really all that is in the .bin-file. so maybe the problem is more general and something important is missing?

Share this post


Link to post
Share on other sites
i created a .pbo from it. its in the addons-folder.

in the editor i can neither just place the unit nor can i add it via script ("bad vehicle type", it's just not there i think)...

what am i doing wrong?

edit: i've never made an addon before btw and the code above is really all that is in the .bin-file. so maybe the problem is more general and something important is missing?

Try this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches

{

class WGM

{

units[] = {"WGMBlue1"};

weapons[] = {};

};

};

class CfgVehicleClasses

{

class WGMGang

{

displayName = "WGMGang";

};

};

class CfgVehicles

{

class SoldierWB : Soldier{};

class WGMBlue1 : SoldierWB

{

model = "\ca\characters\civil_1_tshirt";

vehicleClass = "WGMGang";

displayName = "Gang Member";

weapons[] = {"Makarov","Throw","Put"};

magazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

respawnWeapons[] = {"Makarov"};

respawnMagazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

};

};

I'm fairly sure that will work. I also cleaned it up a little for you and got yourself your own vehicle class.

I dont know what respawnWeapons and respawnMagazines do so I left it in there

Edit: Sorry, I just re-read your post and you may already have your own vehicleclass and stuff, you still may find my code usefull. I should go to bed now confused_o.gif

Share this post


Link to post
Share on other sites

thx Peanut

i just copied your code into another .bin and tried it once more, but it still says "bad vehicle type ...", when i try to add the unit with a script (in the editor it still doesn't appear either) - don't have much time to do anything else right now. perhaps i shouldn't use the "EliteNess"-tool to create .pbo's, but something else (allthough to me it seems to work just fine...)?

hopefully, someone has a solution by the time i get back sad_o.gif

Share this post


Link to post
Share on other sites

Remember to requireaddon the addon which defines the class you are inheriting also.

Share this post


Link to post
Share on other sites

This basic config works fine:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class MYSoldierWB

               {

               units[] = {"MYSoldierWB"};

               weapons[] = {""};

               requiredVersion = 0.1;

               requiredAddons[] = {};

               };

       };

class cfgVehicles

       {

       class SoldierWB;

       class MYSoldierWB : SoldierWB

               {

               displayName = "My SowlierWB";

               };

       };

Try adding your changes to this, one at a time.

Edit:

I just tried this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class WGM

               {

               units[] = {"WGMBlue1"};

               weapons[] = {""};

               requiredVersion = 0.1;

               requiredAddons[] = {};

               };

       };

class cfgVehicles

       {

       class SoldierWB;

       class WGMBlue1 : SoldierWB

               {

               model = "\characters\civil_1_tshirt";

               displayName = "Gang Member";

               weapons[] = {"Makarov","Throw","Put"};

               magazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

               respawnWeapons[] = {"Makarov"};

               respawnMagazines[] = {"8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"};

               class Wounds

                       {

                       tex[] = {};

                       mat[] = {"\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat","\characters\*...*.rvmat"};

                       };

               };

       };

BTW The path names for the wounds were wrong, it should be "\characters\data\". But that still causes a CTD when you try and play the character in the editor. Haven't got time to try adding each change one at a time. But it looks like this is causinng the CTD:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">model = "\characters\civil_1_tshirt";

I don't think the p3d's are stored in the characters.pbo. I'm a bit pushed for time so I can't tell you what it should be off hand.

I have a question along the same lines. I was trying to override the M119's weapon and ammo. First I tried this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class MYM119

               {

               units[] = {"MYM119"};

               weapons[] = {"MYM119"};

               requiredVersion = 0.1;

               requiredAddons[] = {};

               };

       };

class CfgAmmo

       {

       class Sh_105_HE;

       class MySh_105_HE : Sh_105_HE

               {

               timeToLive = 120;

               };

       };

class CfgMagazines

       {

       class 30Rnd_105mmHE_M119;

       class My30Rnd_105mmHE_M119 : 30Rnd_105mmHE_M119

               {

               displayName = "MySh_105_HE";

               ammo = "MySh_105_HE";

               initSpeed = 2200;

               };

       };

class cfgWeapons

       {

       class M119;        

       class MYM119 : M119

               {

               displayName = "MYM119";

               magazines[] = {"My30Rnd_105mmHE_M119"};

               };

       };

class cfgVehicles

       {

       class M119;

       class MYM119 : M119

               {

               displayName = "My M119";

               class Turrets : Turrets

                       {

                       class MainTurret : MainTurret

                               {

                               weapons[] = {MYM119};

                               magazines[] = {"My30Rnd_105mmHE_M119"};

                               };

                       };

               };

       };

But I keep getting a "Class MainTurrent" not defined error message. So I tried this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class MYM119 {

               units[] = {"MYM119"};

               weapons[] = {"MYM119"};

               requiredVersion = 0.1;

               requiredAddons[] = {};

               };

       };

class CfgAmmo

       {

       class Sh_105_HE;

       class MySh_105_HE : Sh_105_HE

               {

               timeToLive = 120;

               };

       };

class CfgMagazines

       {

       class 30Rnd_105mmHE_M119;

       class My30Rnd_105mmHE_M119 : 30Rnd_105mmHE_M119

               {

               displayName = "MySh_105_HE";

               ammo = "MySh_105_HE";

               initSpeed = 2200;

               };

       };

class cfgWeapons

       {

       class M119;        

       class MYM119 : M119

               {

               displayName = "MYM119";

               magazines[] = {"My30Rnd_105mmHE_M119"};

               };

       };

class cfgVehicles

       {

       class Land;

       class LandVehicle : Land {class NewTurret;};

       class StaticWeapon : LandVehicle

               {

               class Turrets

                       {

                       class MainTurret : NewTurret {};

                       };

               };

       class M119 : StaticWeapon {};

       class MYM119 : M119

               {

               displayName = "My M119";

               class Turrets : Turrets

                       {

                       class MainTurret : MainTurret

                               {

                               weapons[] = {MYM119};

                               magazines[] = {"My30Rnd_105mmHE_M119"};

                               };

                       };

               };

       };

This worked, but I prefer the first version. Is there something I'm doing wrong?

Share this post


Link to post
Share on other sites

thanks for your posts.

maybe someone could tell me what steps are required (and what tools) to turn a text file (.bin or .cpp or whatever) into a .pbo that is actually loaded at the start of the game, because i get the impression that no matter what code i use, it has absolutely no effect on the game.

i use EliteNess 2.03 and all i do is to create a .bin text file in a seperate folder, write down my code in it and eventually right click on the folder within the program and select "createPBO". then it says "no errors" and the addon file appears in the addon-folder. so... it always seemed to me, that everything works the way it's supposed to, but when i start the game, theres not a hint, that the addon even exists.

(allthough i did manage to unpbo and repbo one of the official addons and it worked correctly... so why aren't any new addons working??? banghead.gif )

edit: at least, i've found out by now, that i need to "raPify" .bin files, before i make pbos out of them... and for testing, i added the changes i wanted to make with an addon in the chracters/config.bin itself - worked fine. this is getting really frustrating, as i have no idea, why any new addon i create (even with the code you guys posted and that is supposed to work) doesn't seem to have the slightest impact on the game

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">model = "\characters\civil_1_tshirt";

Dont forget that ArmA pbos have prefixes now.

The line should read:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">model = "Ca\characters\civil_1_tshirt";

The name of the PBO is actually irrelevant if I got it right and only the prefix determines the path for the config. Since the prefix of the characters.pbo is "ca\characters", that's what should be used for paths inside configs to refer to models and textures inside that PBO.

Same for the wound textures:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mat[] = {"Ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat","Ca\characters\*...*.rvmat"};

Also don't forget to set the required addons to what you're using in your config:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">requiredAddons[] = {"CACharacters"};

Not quite sure if that's all that's needed for the required addons, but it seems to work for me.

Share this post


Link to post
Share on other sites
Quote[/b] ]Dont forget that ArmA pbos have prefixes now.

Ahh...That was news to me. Thanks.

Share this post


Link to post
Share on other sites

i just realised that my .bin-files have had all kinds of names - except for config.bin biggrin_o.gif

everything works fine now! still want to thank everyone, who tried to help!

Share this post


Link to post
Share on other sites
I have a question along the same lines. I was trying to override the M119's weapon and ammo. First I tried this:

...

I don't know why, but something like this seems to work for me when deriving vehicle turrets:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class cfgVehicles

{

class StaticWeapon;

class M119 : StaticWeapon {

Turrets;

MainTurret;

};

class MYM119 : M119

{

displayName = "My M119";

class Turrets : Turrets

{

class MainTurret : MainTurret

{

weapons[] = {MYM119};

magazines[] = {"My30Rnd_105mmHE_M119"};

};

};

};

};

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  

×