OFPEC tags: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "y[ _]*\|[ _]*(arma[0-9]+)[ _]*\|[ _]+" to "y|$1|") |
Lou Montana (talk | contribs) m (Text replacement - "[[Arma 3 " to "[[Arma 3: ") |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{TOC|side}} | {{TOC|side}} | ||
A Tag, also referred as [[OFPEC]] tag, is a | 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 8: | Line 9: | ||
* [[Identifier#Recommendations|Global variables]] | * [[Identifier#Recommendations|Global variables]] | ||
* [[Arma 3 Functions Library#Tag|Function names]] | * [[Arma 3: Functions Library#Tag|Function names]] | ||
* 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}} → {{Name|arma3|short}}) pbo names tags should be lower case for Linux server compatibility. | ||
{{Feature | | {{Feature|informative|It is [[Code Best Practices#Variable format|good practice]] for mission framework makers to use tags for global variables as well.}} | ||
== | == Rules == | ||
{| class="wikitable valign-top float-right" | |||
! Valid | |||
! Invalid | |||
{| class="wikitable | |||
! Valid | |||
|- | |- | ||
| | |||
* | * '''ARM4'''_Variable | ||
* | * '''ABC'''_Variable | ||
* | * '''A2345678'''_Variable | ||
| | | | ||
* {{Color|red|1}}ST_Variable | * {{Color|red|1}}ST_Variable | ||
* {{Color|red|A}}_Variable | * {{Color|red|A}}_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 | * be 2 to 8 characters long | ||
* be uppercase | * be uppercase | ||
* start with a letter | * start with a letter | ||
* followed by an '''underscore''' | * followed by an '''underscore''' {{hl|_}} | ||
{{Feature|informative|Following the regex {{hl|^[A-Z][A-Z0-9]{1,7}_}}.}} | |||
{{Feature | | |||
== 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 == | ||
=== | === 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"; | ||
=== | === 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="\ | model="\mytag_rangers\MYTAG_Ranger"; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
this would use | this would use {{hl|{{Color|purple|mytag}}_rangers'''.pbo'''}} and {{hl|{{Color|purple|MYTAG}}_Ranger'''.p3d'''}} files | ||
=== | === 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 = "\ | picture = "\mytag_delta\MYTAG_m_kozlice2.paa"; | ||
// ... | |||
ammo = MYTAG_RemShell; | ammo = "MYTAG_RemShell"; | ||
// ... | |||
sound[] = { "\ | sound[] = { "\mytag_delta\MYTAG_shotgun.wav", db0, 1 }; | ||
reloadMagazineSound[] = { "\ | 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 = "\ | model = "\mytag_delta\MYTAG_Remington"; | ||
picture = "\ | 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 | 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}} | ||
{{GameCategory|tkoh|Editing}} |
Latest revision as of 11:38, 6 May 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.
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.
Rules
Valid | Invalid |
---|---|
|
|
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 _
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.