DaveyBoy 0 Posted November 29, 2017 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
loopdk 92 Posted November 29, 2017 Just convert jpg to paa and 512x512 Share this post Link to post Share on other sites
loopdk 92 Posted November 29, 2017 Billbords can tage jpg,png,paa Share this post Link to post Share on other sites
DaveyBoy 0 Posted November 29, 2017 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
loopdk 92 Posted November 29, 2017 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
DaveyBoy 0 Posted November 30, 2017 well it would be simpler if i knew how to do it Share this post Link to post Share on other sites
biggerdave 56 Posted December 3, 2017 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[]={}; }; }; 2 Share this post Link to post Share on other sites
greywolf-sniper 442624 0 Posted June 28, 2020 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
Jackal326 1181 Posted July 2, 2020 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
greywolf-sniper 442624 0 Posted July 5, 2020 I actually managed to make a flag texture that is 512x256. It also works with 1024x512 images. Share this post Link to post Share on other sites
Jackal326 1181 Posted July 5, 2020 So long as the dimensions are ^2 it should work fine. Share this post Link to post Share on other sites