OFPEC tags: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[[Cc]ategory:ArmA:[ _]?([^|]+)\]\]" to "{{GameCategory|arma1|$1}}")
m (Some wiki formatting)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
A Tag, also referred as [[OFPEC]] tag, is a three to five characters identifier that is individual to each designer, and allows for proper distinction between different authors' content.
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.
{{Feature|informative|Before 2022 and {{armaR}} era, a tag was three to five characters long.}}


If 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.
If 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.
Line 11: Line 12:
* New classes (in config.cpp files)
* New classes (in config.cpp files)
* P3D names
* P3D names
* Addon PBO names - this is less true in {{arma3}} since mod management is made through Steam.
* Addon PBO names - this is less true in {{arma3}} since mod management is made through Steam.<br>'''Note''': for [[Real Virtuality]] games ({{Name|ofp|short}} &rarr; {{Name|arma3|short}}) pbo names tags should be lower case for Linux server compatibility.


{{Informative | It is [[Code Best Practices#Variable format|good practice]] for mission makers to use tags for global variables, but at present it is not compulsory.}}
{{Feature|informative|It is [[Code Best Practices#Variable format|good practice]] for mission framework makers to use tags for global variables as well.}}




== History ==
== Rules ==


Tags were originally introduced by [[OFPEC]] in 2002 as a way of avoiding conflicts between different addons.
{| class="wikitable valign-top float-right"
The system was so effective that it was officially adopted by BI as a requirement for their [[Addons at Ease]] initiative.
! Valid
Today, every respectable addon maker has their own individual tag.
! Invalid
 
OFPEC 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.
 
{{Informative |
* See the [http://www.ofpec.com/tags/ OFPEC Tags page] - [http://www.ofpec.com/forum/index.php?action{{=}}register an account] is required in order to register a tag.
* A Biki Backup exists at [[OFPEC tag list]].
}}
 
 
== Tag Rules ==
{| class="wikitable" style="float: right; margin-left: 1em"
! Valid !! Invalid
|-
|-
| style="vertical-align: top" |
|
* ARMA_Variable
* '''ARM4'''_Variable
* ABC_Variable
* '''ABC'''_Variable
* A5555_Variable
* '''A2345678'''_Variable
|
|
* {{Color|red|1}}ST_Variable
* {{Color|red|1}}ST_Variable
* {{Color|red|A}}_Variable
* {{Color|red|A}}_Variable
* A2345{{Color|red|67}}_Variable
* A2345678{{Color|red|90}}_Variable
* A{{Color|red|b}}C_Variable
* A{{Color|red|b}}C_Variable
* AB{{Color|red|CV}}ariable
* AB{{Color|red|CV}}ariable
|}
|}
Tags must:
Tags must:
* be composed of letters and eventually numbers
* be composed of letters and eventually numbers
* be 3 to 5 characters long
* be 2 to 8 characters long
* be uppercase
* be uppercase
* start with a letter
* start with a letter
* followed by an '''underscore''' <tt>_</tt>
* followed by an '''underscore''' {{hl|_}}
 
{{Feature|informative|Following the regex {{hl|^[A-Z][A-Z0-9]{1,7}_}}.}}


{{Informative | Following the regex {{Inline code|^[A-Z][A-Z0-9]{2,4}$<nowiki/>}}.}}
 
== History ==
 
Tags were originally introduced by [[OFPEC]] in 2002 as a way to avoid conflicts between different addons.
The system was so effective that it was officially adopted by {{Name|bi|short}} as a requirement for their [[Addons at Ease]] initiative.<br>
Today, every respectable addon maker has their own individual tag.
 
OFPEC 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.
 
{{Feature|informative|
* See the {{Link|http://www.ofpec.com/tags/|OFPEC Tags page}} - {{Link|http://www.ofpec.com/forum/?action{{=}}register|an account}} is required in order to register a tag.
* A BIKI backup exists at [[OFPEC Tags List]].
}}




== Examples ==
== Examples ==


=== Example 1 ===
=== Scripting ===


  {{cc|considering {{Color|purple|MYTAG}} is the current tag}}
  {{cc|considering {{Color|purple|MYTAG}} is the current tag}}
Line 66: Line 70:
  [[publicVariable]] "{{Color|purple|MYTAG}}_DocumentsGrabbed";
  [[publicVariable]] "{{Color|purple|MYTAG}}_DocumentsGrabbed";


=== Example 2 ===
=== Unit Config ===


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
class MYTAG_Ranger: B_Soldier_F
class MYTAG_Ranger : B_Soldier_F
{
{
displayName = "MYTAG Ranger";
displayName = "MYTAG Ranger";
model="\MYTAG_Rangers\MYTAG_Ranger";
model="\mytag_rangers\MYTAG_Ranger";
}
}
</syntaxhighlight>
</syntaxhighlight>


this would use <tt>{{Color|purple|MYTAG}}_Rangers'''.pbo'''</tt> and <tt>{{Color|purple|MYTAG}}_Ranger'''.p3d'''</tt> files
this would use {{hl|{{Color|purple|mytag}}_rangers'''.pbo'''}} and {{hl|{{Color|purple|MYTAG}}_Ranger'''.p3d'''}} files


=== Example 3 ===
=== Weapon Config ===


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
Line 99: Line 103:
class Default {};
class Default {};
class MGun : Default {};
class MGun : Default {};
class Riffle: MGun {};
class Riffle : MGun {};
class KozliceShell : Riffle {};
class KozliceShell : Riffle {};
class MYTAG_RemShell : KozliceShell
class MYTAG_RemShell : KozliceShell
{
{
picture = "\MYTAG_Delta\MYTAG_m_kozlice2.paa";
picture = "\mytag_delta\MYTAG_m_kozlice2.paa";
###
// ...
ammo = MYTAG_RemShell;
ammo = "MYTAG_RemShell";
###
// ...
sound[] = { "\MYTAG_Delta\MYTAG_shotgun.wav", db0, 1 };
sound[] = { "\mytag_delta\MYTAG_shotgun.wav", db0, 1 };
reloadMagazineSound[] = { "\MYTAG_Delta\MYTAG_shotgunreload.wav", db-80, 1 };
reloadMagazineSound[] = { "\mytag_delta\MYTAG_shotgunreload.wav", db-80, 1 };
};
};
class Kozlice {};
class Kozlice {};
class MYTAG_Remington : Kozlice
class MYTAG_Remington : Kozlice
{
{
displayName = "MYTAG_Remington";
displayName = "MYTAG_Remington";
model = "\MYTAG_Delta\MYTAG_Remington";
model = "\mytag_delta\MYTAG_Remington";
picture = "\MYTAG_Delta\MYTAG_w_kozlice.paa";
picture = "\mytag_delta\MYTAG_w_kozlice.paa";
muzzles[] = {MYTAG_RemingtonShellMuzzle};
muzzles[] = { 'MYTAG_RemingtonShellMuzzle' };
class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell
class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell
{
{
magazines[] = { MYTAG_RemShell };
magazines[] = { "MYTAG_RemShell" };
}
}
};
};
Line 127: Line 132:
{
{
class ProxyWeapon {};
class ProxyWeapon {};
class ProxyMYTAG_Remington: ProxyWeapon {};
class ProxyMYTAG_Remington : ProxyWeapon {};
};
};
</syntaxhighlight>
</syntaxhighlight>


This would be stored in <tt>{{Color|purple|MYTAG}}_Delta'''.pbo'''</tt> and use the <tt>{{Color|purple|MYTAG}}_Remington'''.p3d'''</tt> file.
This would be stored in {{hl|{{Color|purple|mytag}}_delta'''.pbo'''}} and use the {{hl|{{Color|purple|MYTAG}}_Remington'''.p3d'''}} file.




{{GameCategory|ofp| Editing}}
{{GameCategory|ofp|Editing}}
{{GameCategory|arma1| Editing}}
{{GameCategory|arma1|Editing}}
{{GameCategory|arma2|Editing}}
{{GameCategory|arma2|Editing}}
{{GameCategory|arma3|Editing}}
{{GameCategory|arma3|Editing}}
[[Category:Take On Helicopters: Editing]]
{{GameCategory|tkoh|Editing}}

Latest revision as of 20:19, 3 February 2024

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.

Before 2022 and Arma Reforger era, a tag was three to five characters long.

If 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.


Tags are used in the following mod/addon contents:

  • Global variables
  • Function names
  • New classes (in config.cpp files)
  • P3D names
  • Addon PBO names - this is less true in Arma 3 since mod management is made through Steam.
    Note: for Real Virtuality games (OFP → Arma 3) pbo names tags should be lower case for Linux server compatibility.
It is good practice for mission framework makers to use tags for global variables as well.


Rules

Valid Invalid
  • ARM4_Variable
  • ABC_Variable
  • A2345678_Variable
  • 1ST_Variable
  • A_Variable
  • A234567890_Variable
  • AbC_Variable
  • ABCVariable

Tags must:

  • be composed of letters and eventually numbers
  • be 2 to 8 characters long
  • be uppercase
  • start with a letter
  • followed by an underscore _
Following the regex ^[A-Z][A-Z0-9]{1,7}_.


History

Tags were originally introduced by OFPEC in 2002 as a way to avoid conflicts between different addons. The system was so effective that it was officially adopted by BI as a requirement for their Addons at Ease initiative.
Today, every respectable addon maker has their own individual tag.

OFPEC 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.


Examples

Scripting

// considering MYTAG is the current tag
player setVariable ["MYTAG_hasDocuments", false];

waitUntil { sleep 1; player getVariable ["MYTAG_hasDocuments", false] };
MYTAG_DocumentsGrabbed = true;
publicVariable "MYTAG_DocumentsGrabbed";

Unit Config

class MYTAG_Ranger : B_Soldier_F
{
	displayName = "MYTAG Ranger";
	model="\mytag_rangers\MYTAG_Ranger";
}

this would use mytag_rangers.pbo and MYTAG_Ranger.p3d files

Weapon Config

class CfgAmmo
{
	class Default {};
	class BulletSingle : Default {};
	class BulletBurst : BulletSingle {};
	class KozliceShell : BulletBurst {};
	class MYTAG_RemShell : KozliceShell
	{
		hit = 6;
		indirectHit = 6;
		indirectHitRange = 0.2;
	};
};

class CfgWeapons
{
	class Default {};
	class MGun : Default {};
	class Riffle : MGun {};
	class KozliceShell : Riffle {};
	class MYTAG_RemShell : KozliceShell
	{
		picture = "\mytag_delta\MYTAG_m_kozlice2.paa";
		// ...
		ammo = "MYTAG_RemShell";
		// ...
		sound[] = { "\mytag_delta\MYTAG_shotgun.wav", db0, 1 };
		reloadMagazineSound[] = { "\mytag_delta\MYTAG_shotgunreload.wav", db-80, 1 };
	};

	class Kozlice {};
	class MYTAG_Remington : Kozlice
	{
		displayName = "MYTAG_Remington";
		model = "\mytag_delta\MYTAG_Remington";
		picture = "\mytag_delta\MYTAG_w_kozlice.paa";
		muzzles[] = { 'MYTAG_RemingtonShellMuzzle' };
		class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell
		{
			magazines[] = { "MYTAG_RemShell" };
		}
	};
};

class CfgNonAIVehicles
{
	class ProxyWeapon {};
	class ProxyMYTAG_Remington : ProxyWeapon {};
};

This would be stored in mytag_delta.pbo and use the MYTAG_Remington.p3d file.