Jump to content
Sign in to follow this  
BilOlson

CfgGroups, combining custom and default units

Recommended Posts

I have created some units(SF) and can't figure out how to get my custom units grouped with default(SF) units. I DO not want to overwrite original Special Squad, I'm looking to create a brand new group (8 man SF Team) 4 Default SF Units and my 4 custom units together, I tried for two days unsuccessfully..as close as I got was group showed in editor and I could place them but my new guys werent there, but the "grouping" lines for them were....

Basically in a nutshell I want to mix default BIS units and my customs together into a group...

I am missing something and have searched but have found nothing concerning this... An Example maybe if you have one, can be brief and uncommented...

Thanks in Advance..

Share this post


Link to post
Share on other sites

Hi Bil,

maybe this snippet from my sandbox will help detect you missing semantics in your code:

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

{

 class Guerrila

 {

    //name = "Guerrila";

   class OPFOR_Africa_InfGroups

   {

       name = "OA: Infantry";

       class OPFOR_Africa_SmallGroupHeavy

       {

              name="Heavy squad";

              /* <--------------- Custom units ---------------> */

              class Unit0  {

                             name="1";side=2; vehicle="OPFOR_Africa_RPG_3";rank="Sergeant";position[]={0,0,0};

              };

              class Unit1 {

                             name="2";side=2;vehicle="OPFOR_Africa_PK_2";rank="Corporal";position[]={-12,-3,0};

              };

              class Unit2 {

                             name="3";side=2;vehicle="OPFOR_Africa_AKGL_1";rank="Corporal";position[]={-9,-3,0};

              };

              class Unit3 {

                             name="4";side=2;vehicle="OPFOR_Africa_RPG_1";rank="Corporal";position[]={-6,-3,0};

              };

              class Unit4 {

                             name="5";side=2;vehicle="OPFOR_Africa_RPG_2";rank="Corporal";position[]={-3,-3,0};

              };

              /* <--------------- Standard BIS unit ---------------> */

              class Unit5 {

                             name="6"; side=2; vehicle = "SoldierESaboteurMarksman"; rank="Corporal"; position[]={-12,-6,0};

              };

        };

    };

  };

};

Edit: Missing brackets

Share this post


Link to post
Share on other sites

I had tried that with no luck...Ill give it a whirl again today I think I had BIS soldiers first though, does that make a difference?

Thanks again Weed you rock as always

Share this post


Link to post
Share on other sites

Post your config please. smile_o.gif

Share this post


Link to post
Share on other sites

The problem that I can see is:

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

However you want to do a group of west units:

Quote[/b] ]side=1;

In addition you might wanna make the first units playable by default:

Quote[/b] ] class Unit0

{

side = 1;

vehicle = "WGL_CommanderW";

rank = "Lieutnant";

player="PLAY CDG";

position[] = {0, +6, 0};

};

PS: Your formation looks a bit strange a guess (the different positions). smile_o.gif

PSS: Check the WGL5\wgl_men_config\cfggroups.hpp

if you need inspiration.

Share this post


Link to post
Share on other sites

Thanks, knew it was something I was overlooking...Ill have to give it a thorough going over now...Ill let you know how it turns out..

RE: Formation is temporary haven't explored that yet...its next on the list...

Share this post


Link to post
Share on other sites

Bil defined a CfgGroup containing custom units before he defined the custom (CfgVehicles) units per se in the code. Since the file is read sequentially, this was the issue. The standard BIS didn't cause the trouble, because the units are already present before the addon-cpp is read.

Edit: spello

Share this post


Link to post
Share on other sites

You Da man once again Weed! That did cross my mind at one time, but I didn't act on it, guess I should've...

**Update: Tried it. Not the case I don't think weed, if you look at my .cpp for WP_Insurgents; I did it same way without a hitch...worked flawlessly...but then again they were ALL customs and not the mix of the two...It was placed in exact same spot... Now when I move it in my other addon I get a CfgGroups.scope error, maybe it's a syntax/punctuation error?

OMG these freakin brackets....I h8 em

***UPDATE 2: Thnx Q and Weedomatic between the two of you and about 1,232,674 adding/removal of brackets and about that many restarts of Arma, I got it to work, they all are in!!!!

@Weed - I don't think it matters where it(cfgGroups) is in the .cpp, its just a matter of having the brackets correctly, cause now I have it in exactly the same spot with appropriate brackets at the end of class and it works beautifully! I also belive it reads the whole cpp all the way through regardless I could be wrong, but I have another vehicle addon I'm working on that uses a Event_Init (Yeah, I know I need to use Extended_Event_Init but can't get that damn thing to work for the life of me atm), but the script it calls I put a hint all the way at the bottom before the Exit and the hint was showing up, so this leads me to beleive it still gets to the bottom of the cpp? Im not that knowledgeable about this stuff but I'm learning...

Once I clean this up with some of the attributes etc that don't need to be duplicated Ill post the Code in here for all to use I'm sure it'll prove useful to someone, at least looking into getting started in putting together addons and such...

Share this post


Link to post
Share on other sites

Not trying not nitpick, but I do believe it matters. Put the CfgGroups-block above CfgVehicles and you get the invisible-units-but-group-lines-visible effect.

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  

×