Jump to content
Sign in to follow this  
Clavicula_nox4817

How do I...

Recommended Posts

Define a new class?

For example. The class for the regular BLUFOR rifleman is SoldierWB, what would I have to do to make additional soldiers with my own set attributes? Can it be done in the config.cpp or would have to be done in a Cfgvehicles then annotated in the config.cpp then raped into config.bin?

I'm not trying to rename a class and point it to the external class as seen here:

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

class me_SquadLeaderW: SquadLeaderW

{

model = "\USASOC_Troopr\us_soldier_sqleader";

vehicleClass = "spec_Men";

I want to make a brand new class, none of the tutorials I have seem to have an answer for me.

Share this post


Link to post
Share on other sites

Moving to a more appropiate place.

You have to do it that way:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles

{

class old_class;

class new_class: old_class

{

... new definitions ...

};

};

Share this post


Link to post
Share on other sites

Creates a new one, inheriting all the information from the old one.

Doesnt modify the original class in any way.

Share this post


Link to post
Share on other sites

Alright, and then if I want to modify the attributes I can modify them in the entry in the config.cpp?

*edit*

Should have read closer, the answer was right there.

Share this post


Link to post
Share on other sites

I'm getting this error whenever I try to intialize ArmA, but can't find anything wrong in my config. Any ideas or suggestions would be helpful. I'm messing around with it, and it seems to be somewhere in the way I define the second class.

It also appears that only one new class can be defined with the above method in the .cpp as it pops up a "member already defined" error to me if I try to make the second entry off of the SquadLeaderW.

Quote[/b] ]File 35thbde_troops\config.cpp, line 36: '/CfgVehicles.'; '/"encountered instead of '='

This is my cfg:

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

{

class 35thbdeTroops

{

units[] = { "35th_SquadLeaderW","35th_pflieger","35th_SoldierWB","35th_SoldierAR","35th_Teamchief",

"35th_platoonsgt","35th_pltldr","35th_co","35th_todd","35th_debbie",

"35th_1sg", "35th_csm", "35th_wilson","35th_starcher","35th_kent"

};

weapons[] = {};

requiredVersion = 0.100000;

requiredAddons[] = {"CAData","CACharacters","CAWeapons"};

};

};

class CfgVehicleClasses

{

class 35th_Sig

{

displayName = "35th Signal Brigade";

};

};

class CfgVehicles

{

class SquadLeaderW;

class 35th_SquadLeaderW: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader1";

displayName = "Section Sergeant";

vehicleClass = "35th_sig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

/"extern"/ class SquadLeaderW;

class 35th_pflieger: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader";

displayName = "CSM Pflieger";

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

/"extern"/ class SoldierWB;

class 35th_SoldierWB: SoldierWB

{

model = "\35thbdeTroops\us_soldier_b";

vehicleClass = "35th_sig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

/"extern"/ class SoldierWAR

class 35th_SoldierAR; SoldierWAR

{

model = "\35thbdeTroops\us_soldier_ar";

vehicleClass = "35th_sig";

};

class SoldierWB;

class 35th_Teamchief: SoldierWB

{

model = "\35thbdeTroops\us_soldier_b";

displayName = "Team Chief";

vehicleClass = "35thsig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

class SquadLeaderW;

class 35th_platoonsgt: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader";

displayName = "Platoon Sergeant";

vehicleClass = "35th_sig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

class OfficerW;

class 35th_pltldr: OfficerW

{

model = "\35thbdeTroops\us_soldier_officer";

displayName = "Platoon Leader";

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class OfficerW;

class 35th_co: OfficerW

{

model = "\35thbdeTroops\us_soldier_officer";

displayName = "Company Commander";

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class OfficerW;

class 35th_todd: OfficerW

{

model = "\35thbdeTroops\us_soldier_officer";

displayName = "Lt Col Issacson";

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class OfficerW;

class 35th_debbie: OfficerW

{

model = "\35thbdeTroops\us_soldier_officer";

displayName = "Captain (Little Debbie) Deb";

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class SquadLeaderW;

class 35th_1sg: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader";

displayName = "First Sergeant"

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class SquadLeaderW

class 35th_csm: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader";

displayName = "Command Sergeant Major"

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class SquadLeaderW

class 35th_wilson: SquadLeaderW

{

model = "\35thbdeTroops\us_soldier_sqleader";

displayName = "First Sergeant Wilson"

vehicleClass = "35th_sig";

weapons[] = ("M4", "M9", "NVGoggles", "Throw", "Put");

magazines[] = ("30rnd_556x45_Stanag", "30rnd_556x45_Stanag", 30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag", "15rnd_9x19_M9", 15rnd_9x19_M9", "15rnd_9x19_M9", "15rnd_9x19_M9");

};

class SoldierWB

class 35th_starcher: SoldierWB

{

model = "\35thbdeTroops\us_soldier_b";

displayName = "Sgt Starker";

vehicleClass = "35th_sig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

class SoldierWB

class 35th_kent: SoldierWB

{

model = "\35thbdeTroops\us_soldier_b";

displayName = "Spc Kenct";

vehicleClass = "35th_sig";

weapons[] = {"M16A2", "NVGoggles","Throw", "Put"};

magazines[] = {"30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "30rnd_556x45_Stanag", "30rnd_556x45_Stanag"};

};

};

Share this post


Link to post
Share on other sites

Remove all /"extern"/. Also, make sure you have a ; at the end of every line. At last, you don't have to load a class again, if you did it already previously.

Share this post


Link to post
Share on other sites
Should have read closer, the answer was right there.

Give it time and the knowledge will come. I assume you're quite new to flashpoint or more accurately put Arma. I bet me and quite a few others will still be referring to Arma as flashpoint for about another ten years to come biggrin_o.gif

It takes ages to be able to speed read a config and see what's wrong with it. It took me over 2 years on and off before I started to pick it up.

Share this post


Link to post
Share on other sites
Remove all /"extern"/. Also, make sure you have a ; at the end of every line. At last, you don't have to load a class again, if you did it already previously.

Alright thanks again.

Quote[/b] ]Give it time and the knowledge will come. I assume you're quite new to flashpoint or more accurately put Arma. I bet me and quite a few others will still be referring to Arma as flashpoint for about another ten years to come

It takes ages to be able to speed read a config and see what's wrong with it. It took me over 2 years on and off before I started to pick it up.

Well,not new to the game, just new to making addons and using the scripting. I'v owned a copy of Flashpoint since before Red Hammer and it's easily my favorite game.

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  

×