OFPEC tags: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "Category:Arma 2: Editing" to "{{GameCategory|arma2|Editing}}") |
Lou Montana (talk | contribs) m (Remove note template usage) |
||
Line 25: | Line 25: | ||
{{Informative | | {{Informative | | ||
* See the [http://www.ofpec.com/tags/ OFPEC Tags page] | * 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]]. | * A Biki Backup exists at [[OFPEC tag list]]. | ||
}} | }} | ||
Line 53: | Line 52: | ||
* followed by an '''underscore''' <tt>_</tt> | * followed by an '''underscore''' <tt>_</tt> | ||
{{ | {{Informative | Following the regex {{Inline code|^[A-Z][A-Z0-9]{2,4}$<nowiki/>}}.}} | ||
Line 70: | Line 69: | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
class | class MYTAG_Ranger: B_Soldier_F | ||
{ | { | ||
displayName = " | displayName = "MYTAG Ranger"; | ||
model="\ | model="\MYTAG_Rangers\MYTAG_Ranger"; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
this would use <tt> | this would use <tt>{{Color|purple|MYTAG}}_Rangers'''.pbo'''</tt> and <tt>{{Color|purple|MYTAG}}_Ranger'''.p3d'''</tt> files | ||
=== Example 3 === | === Example 3 === | ||
Line 88: | Line 87: | ||
class BulletBurst : BulletSingle {}; | class BulletBurst : BulletSingle {}; | ||
class KozliceShell : BulletBurst {}; | class KozliceShell : BulletBurst {}; | ||
class | class MYTAG_RemShell : KozliceShell | ||
{ | { | ||
hit = 6; | hit = 6; | ||
Line 102: | Line 101: | ||
class Riffle: MGun {}; | class Riffle: MGun {}; | ||
class KozliceShell : Riffle {}; | class KozliceShell : Riffle {}; | ||
class | class MYTAG_RemShell : KozliceShell | ||
{ | { | ||
picture = "\ | picture = "\MYTAG_Delta\MYTAG_m_kozlice2.paa"; | ||
### | ### | ||
ammo = | 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 | class MYTAG_Remington : Kozlice | ||
{ | { | ||
displayName = " | displayName = "MYTAG_Remington"; | ||
model = "\ | model = "\MYTAG_Delta\MYTAG_Remington"; | ||
picture = "\ | picture = "\MYTAG_Delta\MYTAG_w_kozlice.paa"; | ||
muzzles[] = { | muzzles[] = {MYTAG_RemingtonShellMuzzle}; | ||
class | class MYTAG_RemingtonShellMuzzle : MYTAG_RemShell | ||
{ | { | ||
magazines[] = { | magazines[] = { MYTAG_RemShell }; | ||
} | } | ||
}; | }; | ||
Line 128: | Line 127: | ||
{ | { | ||
class ProxyWeapon {}; | class ProxyWeapon {}; | ||
class | class ProxyMYTAG_Remington: ProxyWeapon {}; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
This would be stored in <tt> | This would be stored in <tt>{{Color|purple|MYTAG}}_Delta'''.pbo'''</tt> and use the <tt>{{Color|purple|MYTAG}}_Remington'''.p3d'''</tt> file. | ||
Revision as of 19:37, 26 December 2020
Template:SideTOC 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.
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.
History
Tags were originally introduced by OFPEC in 2002 as a way of avoiding 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.
Tag Rules
Valid | Invalid |
---|---|
|
|
Tags must:
- be composed of letters and eventually numbers
- be 3 to 5 characters long
- be uppercase
- start with a letter
- followed by an underscore _
Examples
Example 1
// 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";
Example 2
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
Example 3
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.