Jump to content
DaveyBoy

How to create custom flags, billboards addons?

Recommended Posts

Hi All,

 

I am looking for guidance on creating a cpp to support custom flag and billboard images that I have created for the prupose to include them in an addon.

 

Any useful guides our information you could help me with?

 

thanks :)

Share this post


Link to post
Share on other sites

i know that part Loopdk :). I am looking how to write a CPP to create an in game addon of preset billboards an flags and not to pull an image to a particular mission.

Share this post


Link to post
Share on other sites

ARrhh my bad.

 

ISent that a lot of work for somthing you can do pretty simpel?

Share this post


Link to post
Share on other sites

Flags don't need any configing. Just whack the .paas in a pbo and you're good to go. You can use "setflagtexture" to apply the new flag texture to any of the existing flagpoles.

 

If, for whatever reason, you want to create an actual flagpole you can place in the editor, this is the basic code:

    class MyNewFlag: FlagCarrier
    {
        author="My Name";
        class SimpleObject
        {
            eden=0;
            animate[]=
            {
                
                {
                    "flag",
                    0
                }
            };
            hide[]={};
            verticalOffset=3.977;
            verticalOffsetWorld=0;
            init="''";
        };
        editorPreview="\A3\EditorPreviews_F\Data\CfgVehicles\Flag_NATO_F.jpg";
        scope=2;
        scopeCurator=2;
        displayName="My New Flagpole";
        hiddenSelectionsTextures[]=
        {
            "\A3\Structures_F\Mil\Flags\Data\Mast_mil_CO.paa"
        };
        hiddenSelectionsMaterials[]=
        {
            "\A3\Structures_F\Mil\Flags\Data\Mast_mil.rvmat"
        };
        class EventHandlers
        {
            init="(_this select 0) setFlagTexture '\MyAddon\Whateverfolder\MyFlagTexture_CO.paa'";
        };
    };

 

For a billboard, you just need a new hiddenselection, you can either apply this to the billboard object in the editor using the "setobjecttexture" command (again, simply including a new texture in a pbo doesn't need any configing), or, if you need to make a new class (ie, for an object to be placed on a custom terrain):

class MyNewBillboard: Land_Billboard_F

{
        author="My Name";
        displayName="My New Billboard";
        hiddenSelectionsTextures[]=
        {
            "MyAddon\Whateverfolder\MyBillboardTexture_CO.paa"
        };

};

 

Just a final caveat, if you're not too familiar with the pbo format, you'll need to include a very basic config if you want to binarize your addon, so, something like this:

class CfgPatches
{
    class MyAddon //This should match the name of your PBO, for convience's sake, but it's not that important
    {
        units[]=    {};
        weapons[]={};
        requiredVersion=0.1;
        requiredAddons[]={};
    };
};

  • Like 2

Share this post


Link to post
Share on other sites
On 11/29/2017 at 10:42 AM, loopdk said:

Just convert jpg to paa and 512x512

If just want the flag to be a logo, how do I prevent it from stretching to the size of the flag?

Share this post


Link to post
Share on other sites
On 6/28/2020 at 9:34 PM, greywolf-sniper 442624 said:

If just want the flag to be a logo, how do I prevent it from stretching to the size of the flag?

You can counter it by compressing the logo by the same proportion as the image gets stretched by e.g. if the flag is 4x3 compress the image's width by a quarter (1/4) to make it 3x3.

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

×