Jump to content
Sign in to follow this  
lappihuan

Create custom Formation

Recommended Posts

Hello Guys

I'm trying to create a custom Formation for my project, but configs are still confusing me some time.

I've got some hints from kju about the cfgFormation i need to alter.

http://forums.bistudio.com/showthrea...-cfgFormations

http://forums.bistudio.com/showthrea...-configuration

http://forums.bistudio.com/showthrea...uad-Formations

There is some usefull information in these Threas, but still i can't get my config working. (can't post yet, because I'm at work)

I don't even know if its possible, what I'm trying to do.

This is my Config.cpp:

class CfgPatches
{
class closeFormation
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.0;
	requiredAddons[] = {};
};
};

class cfgFormations {
class West {
	class close {
		class Fixed
		{
			FormationPositionInfo1[] = {-1,0,0,0};
			FormationPositionInfo2[] = {0,0,-1,"0.78539816339744830961f"};
			FormationPositionInfo3[] = {1,0,-1,"-0.78539816339744830961f"};
			FormationPositionInfo4[] = {2,0,-1,"3.14159265358979323846f"};
		};
		class Pattern
		{
			FormationPositionInfo1[] = {-1,0,-1,0};
			FormationPositionInfo2[] = {0,0,-1,"0.78539816339744830961f"};
			FormationPositionInfo3[] = {1,0,-1,"-0.78539816339744830961f"};
			FormationPositionInfo4[] = {2,0,-1,"3.14159265358979323846f"};
		};
	};
};
class East: West
{
	class close: close
	{
	};
}
class Guer: West
{
	class close: close
	{
	};
};
class Civ: West
{
	class close: close
	{
	};
};
};

So i would like to ask if anyone have some information on this topic, or even a working example?

And since im new to configs i would like to know, what the "updated Baseclass -> yx" in the RTP file means (does it show that the config i made is working and the class is updated with my changes?) i know that question is related to configs in general, but i did not find a explanation on this, sry if this is documented somewhere and i did not searched well enough.

best regards

Lappihuan

Edited by Lappihuan

Share this post


Link to post
Share on other sites

"updated Baseclass -> yx" means the inheritance was changed - by configA over configB.

This is very bad and should never be done.

Share this post


Link to post
Share on other sites

Thanks a lot, that clears up some errors i had while messing around with the config and i was not sure if its good or bad. :o

Now i see it's clearly bad.

Share this post


Link to post
Share on other sites

Hello Guys

I've managed to create a custom formation and test through all config parameters to find out what they exactly do.

First of all i post a working replacement config for formations:

class CfgPatches
{
class customFormation
{
		units[] = {};
		weapons[] = {};
		requiredVersion = 1.0;
	requiredAddons[] = {};
 };
};

class cfgFormations {
class West {
	class formColumnFixed{
                       class Fixed
                       {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,1,0,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,0,-1,"-0.78539816339744830961f"};
                       };
                       class Pattern
                       {
                               FormationPositionInfo1[]={-1,0,-1,"3.14159265358979323846f"};
                               FormationPositionInfo2[]={0,1,0,"2.35619449019234492884f"};
                               FormationPositionInfo3[]={1,-1,0,"-2.35619449019234492884f"};
                       };

               };
};
class East: West
{
	class formColumnFixed: formColumnFixed
	{
	};
}
class Guer: West
{
	class formColumnFixed: formColumnFixed
	{
	};
};
class Civ: West
{
	class formColumnFixed: formColumnFixed
	{
	};
};
};

Paste this in a config.cpp and pack it into a "customFormation.pbo".

Now when ingame you can call your custom formation with the formation menu -> column as you replaced the column formation. Enjoy :)

This config will create a formation like in that picture:

1xsf.jpg

A formation is mostly splitted in two "teams", "fixed" and "pattern".

In each "team" there is a "teamleader", this leader is everytime "FormationPositionInfo1".

If the first parameter is used as a index the position parameters will alwasy be relative to the previous index number. -1 is the "teamleader" but also other "FormationPositionInfo" can be set to -1, the position is now always relative to "FormationPositionInfo1" and not to the previous index.

The next two parameters are X and Y in meters from the relative postition.

The 4th parameter is a radiant in PI numbers and it defines the direction where the unit is heading when stoped.

To make this more clear, i made a picture:

a9g1.jpg

Most used values to copy:

0.78539816339744830961f
1.57079632679489661923f
2.35619449019234492884f
3.14159265358979323846f

And the negatives...

There is another parameter, but it is optional and i haven't played around with it, so i will expand this little tutorial if i find out what the 5th parameter does.

Here is the whole cfgFormations to copy, if you want to edit other formations:

class cfgFormations
       {
       class West
               {
               class formColumnFixed
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,0,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,0,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,0,-1,"3.14159265358979323846f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,0,-1,0};
                               FormationPositionInfo2[]={0,0,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,0,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,0,-1,"3.14159265358979323846f"};
                               };

                       };

               class Staggered
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,1,-1,"3.14159265358979323846f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,-1,-1,0};
                               FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,1,-1,"3.14159265358979323846f"};
                               };

                       };

               class Wedge
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-2,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo2[]={-1,1,-1,"0.78539816339744830961f"};
                               };

                       };

               class EchelonLeft
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,-1,-1,"-1.57079632679489661923f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,-1,-1,0};
                               FormationPositionInfo2[]={0,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,-1,-1,"-0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,-1,-1,"-1.57079632679489661923f"};
                               };

                       };

               class EcholonRight
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,1,-1,"1.57079632679489661923f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,1,-1,0};
                               FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo3[]={1,1,-1,"0.78539816339744830961f"};
                               FormationPositionInfo4[]={2,1,-1,"1.57079632679489661923f"};
                               };

                       };

               class Vee
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,"-0.78539816339744830961f"};
                               FormationPositionInfo2[]={0,1,0,"0.78539816339744830961f"};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-2,-1,1,"-0.78539816339744830961f"};
                               FormationPositionInfo2[]={-1,1,1,"0.78539816339744830961f"};
                               };

                       };

               class Line
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               FormationPositionInfo2[]={0,1,0,0};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-2,-1,0,0};
                               FormationPositionInfo2[]={-1,1,0,0};
                               };

                       };

               class Diamond
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,0.5,-0.5,"0.78539816339744830961f",0};
                               FormationPositionInfo2[]={0,-1,0,"-0.78539816339744830961f",0};
                               FormationPositionInfo3[]={1,0.5,-0.5,0,0};
                               };

                       };

               class File
                       {
                       class Fixed
                               {
                               FormationPositionInfo1[]={-1,0,0,0};
                               };

                       class Pattern
                               {
                               FormationPositionInfo1[]={-1,0,-0.5,"-0.78539816339744830961f",0};
                               FormationPositionInfo2[]={0,0,-0.5,"0.78539816339744830961f",0};
                               };

                       };

               };

       class East : West
               {
               class formColumnFixed : formColumnFixed {};
               class Staggered : Staggered {};
               class Wedge : Wedge {};
               class EchelonLeft : EchelonLeft {};
               class EcholonRight : EcholonRight {};
               class Vee : Vee {};
               class Line : Line {};
               class Diamond : Diamond {};
               class File : File {};
               };

       class Guer : West
               {
               class formColumnFixed : formColumnFixed {};
               class Staggered : Staggered {};
               class Wedge : Wedge {};
               class EchelonLeft : EchelonLeft {};
               class EcholonRight : EcholonRight {};
               class Vee : Vee {};
               class Line : Line {};
               class Diamond : Diamond {};
               class File : File {};
               };

       class Civ : West
               {
               class formColumnFixed : formColumnFixed {};
               class Staggered : Staggered {};
               class Wedge : Wedge {};
               class EchelonLeft : EchelonLeft {};
               class EcholonRight : EcholonRight {};
               class Vee : Vee {};
               class Line : Line {};
               class Diamond : Diamond {};
               class File : File {};
               };

       };

Ask if anything is unclear or if you find something new.

best regards

Lappihuan

Share this post


Link to post
Share on other sites

very nice research and explaining your finds!

Share this post


Link to post
Share on other sites

class formColumnFixed
{
   class Fixed
   {
       FormationPositionInfo1[]={-1,0,0,0};
       FormationPositionInfo2[]={0,1,0,"0.78539816339744830961f"};
       FormationPositionInfo3[]={1,1,0,"0.78539816339744830961f"};
       FormationPositionInfo4[]={2,-3,0,"-0.78539816339744830961f"};
       FormationPositionInfo5[]={3,-1,0,"-0.78539816339744830961f"};
   };
   class Pattern
   {
       FormationPositionInfo1[]={-5,0,-1,"1.57079632679489661923f"};
       FormationPositionInfo2[]={0,0,-1,"-1.57079632679489661923f"};
       FormationPositionInfo3[]={1,0,-1,"3.14159265358979323846f"};
   };
};

I thought it would be a good idea to keep this good info on formations all on the same page, so heres a few more bits of trivia.

The above code is my version of the column formation... I don't find column very useful so there are a few that can be easily changed.

the above config changes the column formation to a capital T formation.

So what I noticed was there are 2 basic sections... fixed which is the fixed part of the formation (no matter how many people are in the group,... and ARMA 3 can have more than 3000, this section will be the base of the formation and will always the same) and the Pattern section is a REPEATING section which allows for any number of units to be in a group and still in formation.

class Wedge
{
   class Fixed
   {
       FormationPositionInfo1[]={-1,0,0,0};
       FormationPositionInfo2[]={0,1,-1,"0.78539816339744830961f"};
   };

   class Pattern
   {
       FormationPositionInfo1[]={-2,-1,-1,"-0.78539816339744830961f"};
       FormationPositionInfo2[]={-1,1,-1,"0.78539816339744830961f"};
   };
};

so the fixed section sets up the first two units, and the pattern is then the repeating pattern that adds any number of units to the ends of the wedge. the first number (FormationPositionInfo1[]={-2,-1,-1,"-0.78539816339744830961f"};)(if positive) refers to the offset from the previous entry and (if negative) it refers to an entry a number of entries back. thats how wedge adds by alternating units left to right. If you look back at the column pattern above you can see the top of the T in the fixed section and then the stem of the T in the pattern. the -5 refers 5 units back... in this case Pattern:FormationPositionInfo1 follows Fixed:FormationPositionInfo1.

Thats it.. Hopefully we will see more cool formation mods now. Heres another simple fix... the Staggered column

class Staggered
{
   class Fixed
   {
       FormationPositionInfo1[] = {-1,0,0,0};
       FormationPositionInfo2[] = {0,1,-1,"0.78539816339744830961f"};
       FormationPositionInfo3[] = {1,-2,-1,"-0.78539816339744830961f"};
       FormationPositionInfo4[] = {2,2,-1,"1.57079632679489661923f"};
   };
   class Pattern
   {
       FormationPositionInfo1[] = {-1,-2,-1,"-1.57079632679489661923f"};
       FormationPositionInfo2[] = {0,2,-1,"2.35619449019234492884f"};
       FormationPositionInfo3[] = {1,-2,-1,"-2.35619449019234492884f"};
       FormationPositionInfo4[] = {2,2,-1,"3.14159265358979323846f"};
   };
};

coriginal Staggered Column looks like this:

   *
   *  *
   *  *
   *  *  ... well sort of. you get the idea

   *
*    *
*    *
*    *
*    * .. better spread 2x2mtrs instead of 1x1

It would be cool if you could define a custom formation in-game. I guess that would require FSMs to control it.

Edited by Kunsa
formatting

Share this post


Link to post
Share on other sites

Yes. Very good Information, sir!

Can definitly make use of it.

Share this post


Link to post
Share on other sites

Hey guys,
Is any of this stuff ingame?
Trying to get a formation like the coriginal Staggered Column.

 

Sorry begininer at scripting (but trying to learn)
 


 

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  

×