Scripting Tags
Based on an old version from archive.org since OFPEC is down --Ceeeb 07:36, 3 February 2007 (CET)
OFP Tags were introduced in 2002 as a way of avoiding and preventing conflicts between different addon, script and mission makers. Today, almost every addon maker has their own, individual tag. BI have encouraged their use by adding tag compliance as a requirement for their Addons At Ease initiative.
OFP Tags are used in the following:
- Global variables
- Global function names
- New classes (in config.cpp files)
- P3D names
- Addon PBO names
A 'tag' is simply a three to five letter identifier that is individual to each designer. Here at OFPEC we have created a listing of all these tags, so that people can see who 'owns' particular tags and we don't have multiple designers using the same tag.
Register your own tag here. You must be a member of OFPEC to submit a tag (this takes about 30 seconds, go here to register).
Tag Rules
OFP Tags must:
- Be 3 to 5 letters long.
- Contain only alphanumeric upper case characters. The first letter must be alphabetical.
- Not be the same as pre-existing tags.
Four and five letter tags must be followed by an underscore, three letter tags can be be followed by an underscore, ie. SNY_MyVariable, SNYMyFunction or OFPEC_MyAddon.pbo. When you don't use an underscore after a three letter tag, you are not allowed to use any underscore in the following identifier, ie. SNYMyVariable or SNY_My_Variable, but not SNYMy_Variable.
Examples (by SelectThis)
Example #1
class STTRanger: SoldierWB { displayName="STT Ranger"; model="\STTRangers\STTRanger"; }
this would use STTRangers.PBO and STTRanger.P3D files
now another example for a more complicated cpp.
Example #2
class CfgAmmo { class Default {}; class BulletSingle : Default {}; class BulletBurst: BulletSingle {}; class KozliceShell : BulletBurst {}; class STTRemShell: KozliceShell { hit=6;indirectHit=6;indirectHitRange=0.2; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class Riffle: MGun {}; class KozliceShell: Riffle {}; class STTRemShell:KozliceShell { picture="\STTDelta\STTm_kozlice2.paa"; ### ammo = STTRemShell; ### sound[]={\STTDelta\STTshotgun.wav,db0,1}; reloadMagazineSound[]={\STTDelta\STTshotgunreload.wav,db-80,1}; }; class Kozlice {}; class STTRemington: Kozlice { displayName = "STTRemington"; model="\STTDelta\STTRemington"; picture="\STTDelta\STTw_kozlice.paa"; muzzles[] = {STTRemingtonShellMuzzle}; class STTRemingtonShellMuzzle : STTRemShell { magazines[] = {STTRemShell}; } }; }; class CfgNonAIVehicles { class ProxyWeapon {}; class ProxySTTRemington: ProxyWeapon {}; };
This is stored in STTDelta.PBO and uses the STTRemington.P3D
I've cut out the lines that don't need a tag to make it easier to read.
As you can see I have used the STT tag all the way through the class names. I even use the Tag for the paa/pac and wav files that I have inside the addon folder (this just makes it easier to see what files I have altered- not necessary to avoid conflicts)
SelectThis