{"name":"Scripting Tags","title":"Scripting Tags","type":"topic","url":"https://community.bistudio.com/wiki/Scripting_Tags","revid":369661,"updated":"2024-10-02T11:00:41Z","aliases":["OFPEC tags"],"markdown":"A Tag, also referred as an OFPEC tag, is a usually two to eight characters identifier that is individual to each designer, and allows for proper distinction between different authors' content.\n\n> [!NOTE]\n> Before 2022 and Arma Reforger era, a tag was three to five characters long.\n\nIf an addon does not have a tag it could cause a conflict with another addon: this can cause your mission, game (or even your whole computer depending on the game) to crash.\n\nTags are used in the following **mod/addon** contents:\n\n- Global variables\n- Function names\n- New classes (in config.cpp files)\n- P3D names\n- Addon PBO names - this is less true in Arma 3 since mod management is made through Steam.\n  **Note**: for Real Virtuality games (OFP → Arma 3) pbo names tags should be lower case for Linux server compatibility.\n\n> [!NOTE]\n> It is good practice for mission framework makers to use tags for global variables as well.\n\n### Rules\n\n| Valid | Invalid |\n|---|---|\n| - **ARM4**_Variable<br>- **ABC**_Variable<br>- **A2345678**_Variable | - 1ST_Variable<br>- A_Variable<br>- A234567890_Variable<br>- AbC_Variable<br>- ABCVariable |\n\nTags must:\n\n- be composed of letters and eventually numbers\n- be 2 to 8 characters long\n- be uppercase\n- start with a letter\n- followed by an **underscore** `_`\n\n> [!NOTE]\n> Following the regex `^[A-Z][A-Z0-9]{1,7}_`.\n\n### History\n\nTags were originally introduced by OFPEC in 2002 as a way to avoid conflicts between different addons.\nThe system was so effective that it was officially adopted by BI as a requirement for their Addons at Ease initiative.\nToday, every respectable addon maker has their own individual tag.\n\nOFPEC have created a list of all these tags so that people can see who registered which tag in order to avoid a tag usage conflict.\n\n> [!NOTE]\n> - See the [OFPEC Tags page](http://www.ofpec.com/tags/) - [an account](http://www.ofpec.com/forum/?action=register) is required in order to register a tag.\n> - A BIKI backup exists at OFPEC Tags List.\n\n### Examples\n\n#### Scripting\n\n```\n// considering MYTAG is the current tag\nplayer setVariable [\"MYTAG_hasDocuments\", false];\n\nwaitUntil { sleep 1; player getVariable [\"MYTAG_hasDocuments\", false] };\nMYTAG_DocumentsGrabbed = true;\npublicVariable \"MYTAG_DocumentsGrabbed\";\n```\n\n#### Unit Config\n\n```cpp\nclass MYTAG_Ranger : B_Soldier_F\n{\n    displayName = \"MYTAG Ranger\";\n    model=\"\\mytag_rangers\\MYTAG_Ranger\";\n}\n```\n\nthis would use `mytag_rangers.pbo` and `MYTAG_Ranger.p3d` files\n\n#### Weapon Config\n\n```cpp\nclass CfgAmmo\n{\n    class Default {};\n    class BulletSingle : Default {};\n    class BulletBurst : BulletSingle {};\n    class KozliceShell : BulletBurst {};\n    class MYTAG_RemShell : KozliceShell\n    {\n        hit = 6;\n        indirectHit = 6;\n        indirectHitRange = 0.2;\n    };\n};\n\nclass CfgWeapons\n{\n    class Default {};\n    class MGun : Default {};\n    class Riffle : MGun {};\n    class KozliceShell : Riffle {};\n    class MYTAG_RemShell : KozliceShell\n    {\n        picture = \"\\mytag_delta\\MYTAG_m_kozlice2.paa\";\n        // ...\n        ammo = \"MYTAG_RemShell\";\n        // ...\n        sound[] = { \"\\mytag_delta\\MYTAG_shotgun.wav\", db0, 1 };\n        reloadMagazineSound[] = { \"\\mytag_delta\\MYTAG_shotgunreload.wav\", db-80, 1 };\n    };\n\n    class Kozlice {};\n    class MYTAG_Remington : Kozlice\n    {\n        displayName = \"MYTAG_Remington\";\n        model = \"\\mytag_delta\\MYTAG_Remington\";\n        picture = \"\\mytag_delta\\MYTAG_w_kozlice.paa\";\n        muzzles[] = { 'MYTAG_RemingtonShellMuzzle' };\n        class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell\n        {\n            magazines[] = { \"MYTAG_RemShell\" };\n        }\n    };\n};\n\nclass CfgNonAIVehicles\n{\n    class ProxyWeapon {};\n    class ProxyMYTAG_Remington : ProxyWeapon {};\n};\n```\n\nThis would be stored in `mytag_delta.pbo` and use the `MYTAG_Remington.p3d` file.","sections":[{"heading":null,"level":1,"markdown":"A Tag, also referred as an OFPEC tag, is a usually two to eight characters identifier that is individual to each designer, and allows for proper distinction between different authors' content.\n\n> [!NOTE]\n> Before 2022 and Arma Reforger era, a tag was three to five characters long.\n\nIf an addon does not have a tag it could cause a conflict with another addon: this can cause your mission, game (or even your whole computer depending on the game) to crash.\n\nTags are used in the following **mod/addon** contents:\n\n- Global variables\n- Function names\n- New classes (in config.cpp files)\n- P3D names\n- Addon PBO names - this is less true in Arma 3 since mod management is made through Steam.\n  **Note**: for Real Virtuality games (OFP → Arma 3) pbo names tags should be lower case for Linux server compatibility.\n\n> [!NOTE]\n> It is good practice for mission framework makers to use tags for global variables as well."},{"heading":"Rules","level":3,"markdown":"| Valid | Invalid |\n|---|---|\n| - **ARM4**_Variable<br>- **ABC**_Variable<br>- **A2345678**_Variable | - 1ST_Variable<br>- A_Variable<br>- A234567890_Variable<br>- AbC_Variable<br>- ABCVariable |\n\nTags must:\n\n- be composed of letters and eventually numbers\n- be 2 to 8 characters long\n- be uppercase\n- start with a letter\n- followed by an **underscore** `_`\n\n> [!NOTE]\n> Following the regex `^[A-Z][A-Z0-9]{1,7}_`."},{"heading":"History","level":3,"markdown":"Tags were originally introduced by OFPEC in 2002 as a way to avoid conflicts between different addons.\nThe system was so effective that it was officially adopted by BI as a requirement for their Addons at Ease initiative.\nToday, every respectable addon maker has their own individual tag.\n\nOFPEC have created a list of all these tags so that people can see who registered which tag in order to avoid a tag usage conflict.\n\n> [!NOTE]\n> - See the [OFPEC Tags page](http://www.ofpec.com/tags/) - [an account](http://www.ofpec.com/forum/?action=register) is required in order to register a tag.\n> - A BIKI backup exists at OFPEC Tags List."},{"heading":"Examples","level":3,"markdown":""},{"heading":"Scripting","level":4,"markdown":"```\n// considering MYTAG is the current tag\nplayer setVariable [\"MYTAG_hasDocuments\", false];\n\nwaitUntil { sleep 1; player getVariable [\"MYTAG_hasDocuments\", false] };\nMYTAG_DocumentsGrabbed = true;\npublicVariable \"MYTAG_DocumentsGrabbed\";\n```"},{"heading":"Unit Config","level":4,"markdown":"```cpp\nclass MYTAG_Ranger : B_Soldier_F\n{\n    displayName = \"MYTAG Ranger\";\n    model=\"\\mytag_rangers\\MYTAG_Ranger\";\n}\n```\n\nthis would use `mytag_rangers.pbo` and `MYTAG_Ranger.p3d` files"},{"heading":"Weapon Config","level":4,"markdown":"```cpp\nclass CfgAmmo\n{\n    class Default {};\n    class BulletSingle : Default {};\n    class BulletBurst : BulletSingle {};\n    class KozliceShell : BulletBurst {};\n    class MYTAG_RemShell : KozliceShell\n    {\n        hit = 6;\n        indirectHit = 6;\n        indirectHitRange = 0.2;\n    };\n};\n\nclass CfgWeapons\n{\n    class Default {};\n    class MGun : Default {};\n    class Riffle : MGun {};\n    class KozliceShell : Riffle {};\n    class MYTAG_RemShell : KozliceShell\n    {\n        picture = \"\\mytag_delta\\MYTAG_m_kozlice2.paa\";\n        // ...\n        ammo = \"MYTAG_RemShell\";\n        // ...\n        sound[] = { \"\\mytag_delta\\MYTAG_shotgun.wav\", db0, 1 };\n        reloadMagazineSound[] = { \"\\mytag_delta\\MYTAG_shotgunreload.wav\", db-80, 1 };\n    };\n\n    class Kozlice {};\n    class MYTAG_Remington : Kozlice\n    {\n        displayName = \"MYTAG_Remington\";\n        model = \"\\mytag_delta\\MYTAG_Remington\";\n        picture = \"\\mytag_delta\\MYTAG_w_kozlice.paa\";\n        muzzles[] = { 'MYTAG_RemingtonShellMuzzle' };\n        class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell\n        {\n            magazines[] = { \"MYTAG_RemShell\" };\n        }\n    };\n};\n\nclass CfgNonAIVehicles\n{\n    class ProxyWeapon {};\n    class ProxyMYTAG_Remington : ProxyWeapon {};\n};\n```\n\nThis would be stored in `mytag_delta.pbo` and use the `MYTAG_Remington.p3d` file."}],"categories":["ArmA: Armed Assault: Editing","Arma 2: Editing","Arma 3: Editing","Operation Flashpoint: Editing","Take On Helicopters: Editing"],"groups":["Scripting"]}