Addoninfo.txt: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Rewrite and reorganize basically everything)
Line 1: Line 1:
addoninfo[[.txt]].
The [[.txt|plain-text file]] {{Code|addoninfo.txt}} contains the ''[[KeyValues|KeyValues 1]]'' structure {{Code|AddonInfo}} specifying an [[VPK|addon]]’s metadata: its author, content flags, description, title, and version.
This file and its functionality were introduced with the ''{{L4D|4}}'' [[Left 4 Dead engine branch|engine branch]].


{{ModernTip|Its good practice to prepare a basic <code>addoninfo.txt</code> for your addons as otherwise it leads to bugs; addons with no metadata can't appear in the addons menu.}}
Both the ''{{Source|4|nt=1}}'' and the deprecated external application {{Code|[[addoninstaller.exe]]}} will parse this file, though with significant differences.
''{{Source|4}}'' will parse this file from all addons listed in {{Code|addonlist.txt}} when loading search paths from {{Code|[[gameinfo.txt]]}} at startup and with subsequent calls to ''[[ConCommand]]'' {{Command|update_addon_paths}}.
''{{Source|4}}'' will retrieve metadata for all Steam Workshop addons from the Steam Workshop, overriding content in {{Code|addoninfo.txt}}.
{{Code|addoninstaller.exe}} only parses {{Code|addoninfo.txt}} when staging addons during user-initialized installation.


== Games ==
{{ModernWarning|You should {{Em|always}} ship your addons with {{Code|addoninfo.txt}}, {{Em|even if you distribute through the Steam Workshop}}. Otherwise, your users will encounter the following undesirable behavior:
=== {{l4d|4}} ===
* your addon will load before all other correct addons specified in {{Code|addonlist.txt}}; and
An <code>addoninfo.txt</code> provides metadata for an addon, which is used by both the addons menu and the server browser.  
* your addon will never appearing in the {{Code|[[CBaseModFrame]]}} {{Code|Addons}} (the [[VGUI]] window for the addon manager), disallowing them from enabling or disabling it.}}


{{ModernWarning|Addons don't reload until you relaunch the game.}}
{{ModernWarning|Avoid having your audience rely on {{Code|addoninstaller.exe}} to install addons. As of at least client version 2.2.2.6 of ''{{L4D2|4}}'', Valve has introduced a regression in its addon manager that effectively disables the {{Code|addoninstaller.exe}} association prompt. Many users will be unaware of {{Code|addoninstaller.exe}} or its appropriate usage unless they view [https://help.steampowered.com/en/faqs/view/7743-70E3-E1B4-8BB0 this page] on ''{{L4D|4}}'' addons.}}


=== {{l4d2|4}} ===
== Specification ==
An <code>addoninfo.txt</code> provides metadata for an addon, which is used by both the addons menu and the server browser.


{{ModernImportant|Addons subscribed to the Steam Workshop takes metadata from the subscribed page, overriding the <code>addoninfo.txt</code> file.}}
In the following specification, these terms will have the following meanings:
* {{Em|shall}} indicates a mandatory requirement; and
* {{Em|should}} indicates a recommendation.


== File format ==
The ''{{Source|4|nt=1}}'' will expect a specific ''KeyValues 1'' structure in {{Code|addoninfo.txt}}, specified below:
=== Keys ===
* You {{Em|shall}} save {{Code|addoninfo.txt}} with an [[wp:UTF-8|UTF-8]]-compatible encoding.
Any text that looks like <del>this</del> means that its either obsolete, or deprecated.
* You {{Em|shall}} have at least one ''KeyValues'' block.
* You {{Em|should}} define the name of the first ''KeyValues'' block as {{Kbd|AddonInfo}}.
* You {{Em|should}} populate the first ''KeyValues'' block with at least one key-value entry from table [[#kv-addoninfo-keys|“Valid {{Code|AddonInfo}} Keys”]]:
:* You {{Em|should}} provide a title, author, and version.
:* You {{Em|should}} provide at least one content tag.


=== Metadata ===
{| class="standard-table mw-collapsible" style="width: 100%" id="kv-addoninfo-keys"
These [[KeyValues]] specify an addon’s metadata.
|+ style="text-align: left" | Valid {{Code|AddonInfo}} Keys
These metadata are used exclusively by the [[GameUI]].
|-
Keys are sorted in the order that they are read by the game.
Unimplemented keys are struck through.
Assume both {{L4D|4}} and {{L4D2|4}} recognize a key unless specified otherwise.
Assume values prefixed by {{code|#}} are [[VGUI]] [[localization]] keys.
 
{| class=wikitable style="width:95%; margin: auto auto;"
! style="text-align: left"  | Key
! style="text-align: left"  | Key
! style="text-align: left"  | Type
! style="text-align: left"  | [https://en.cppreference.com/w/cpp/language/types Type]
! style="text-align: right" | Length
! style="text-align: right" | Length
! style="text-align: left"  | Default Value
! style="text-align: left"  | Default Value
Line 34: Line 37:
|-
|-
| addontitle
| addontitle
| {{code|wchar_t}}
| [https://en.cppreference.com/w/cpp/keyword/wchar_t {{Code|wchar_t}}]
| style="text-align: right" | 127
| style="text-align: right" | 127
| {{code|#L4D360UI_Addon_None_Specified}}
| {{Code|#L4D360UI_Addon_None_Specified}}
| The addon’s title.
| The addon’s title.
|-
|-
| addonauthor
| addonauthor
| {{code|wchar_t}}
| {{Code|wchar_t}}
| style="text-align: right" | 119
| style="text-align: right" | 119
| {{code|#L4D360UI_Addon_None_Specified}}
| {{Code|#L4D360UI_Addon_None_Specified}}
| The addon’s author.
| The addon’s author.
|-
|-
| addonDescription
| addonDescription
| {{code|wchar_t}}
| {{Code|wchar_t}}
| style="text-align: right" | 1023
| style="text-align: right" | 1023
| {{code|#L4D360UI_Addon_None_Specified}}
| {{Code|#L4D360UI_Addon_None_Specified}}
| The addon’s description. {{L4D2|4}} will truncate those of Steam Workshop addons to 499 characters [{{em|citation needed}}&#x200A;].
| The addon’s description. ''{{L4D2|4}}'' will truncate those of Steam Workshop addons to 499 characters [{{Em|citation needed}}&#x200A;].
|-
|-
| addonversion
| addonversion
| {{code|wchar_t}}<br />{{code|float}} ({{code|addoninstaller.exe}})
| {{Code|wchar_t}}<br />[https://en.cppreference.com/w/cpp/keyword/float {{Code|float}}] ({{Code|addoninstaller.exe}})
| style="text-align: right" | 31
| style="text-align: right" | 31
| {{code|0.0}}<br />{{code|1.0}} ({{code|addoninstaller.exe}})
| {{Code|0.0}}<br />{{Code|1.0}} ({{Code|addoninstaller.exe}})
| The addon’s version {{L4D2|only}}. Conventionally a decimal number in the format {{code|{{var|major}}.{{var|minor}}}}, but you may write any string.
| The addon’s version. Conventionally a decimal number in the format {{Code|{{Var|major}}.{{Var|minor}}}}, but you may write any string.
|-
| addonContent_Campaign
| [https://en.cppreference.com/w/cpp/keyword/int {{Code|int}}]
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom campaigns. If the value is {{Code|0}}, then the addon does not contain the specified content; otherwise, the addon contains the specified content.
|-
| addonContent_Map
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom campaigns or custom maps.
|-
| addonContent_Skin
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom skins.
|-
| addonContent_weapon
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom weapon skins.
|-
|-
| {{s|addonSteamAppID}}
| addonContent_BossInfected
| {{code|int}}
| {{Code|int}}
| style="text-align: right" | N/A
| style="text-align: right" | N/A
| {{code|500}}
| {{Code|0}}
| The AppID of the addon’s target game. Only {{code|addoninstaller.exe}} uses this. {{tip|Specify 500 for {{L4D|4}} or 550 for {{L4D2|4}}.}}
| If the addon contains custom boss infected skins.
|-
|-
| {{s|addonURL0}}
| addonContent_CommonInfected
| N/A
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom common infected skins.
|-
| addonContent_Survivor
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom survivor skins.
|-
| addonContent_Sound
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom sounds.
|-
| addonContent_Music
| {{Code|int}}
| style="text-align: right" | N/A
| {{Code|0}}
| If the addon contains custom music.
|-
| addonContent_Script
| {{Code|int}}
| style="text-align: right" | N/A
| style="text-align: right" | N/A
| N/A
| {{Code|0}}
| The addon’s homepage. May have had a similar purpose to key {{code|Website}} in [[Mission Files]].
| If the addon contains custom scripts.
|-
|-
| {{s|addonTagLine}}
| addonContent_prop
| N/A
| {{Code|int}}
| style="text-align: right" | N/A
| style="text-align: right" | N/A
| N/A
| {{Code|0}}
| The addon’s subtitle or tagline. May have had a similar purpose to key {{code|poster/posterTagline}} in [[Mission Files]].
| If the addon contains custom props.
|}
|}


=== Content Tagging ===
=== Non-existent or deprecated keys ===
Add-ons can be given certain tags, which is displayed next to an add-on's name, and helps quickly describes an addon. In {{l4d2}} however, tags are only visible when an addon is selected, but its possible to filter addons by tag.


{{bug|The [[Collision_mesh|Collision Mesh]] for the entire duration of the game's runtime is decided by which will be loaded first.<br>
{{em|Avoid writing these keys.}}
If you load a map with a custom prop and custom collision model, the custom one will be used on all maps until the game is restarted. If you load the original first, the original will be used on every map, including yours that would have a custom collision.<br>
All games ignore these keys.
''This was tested on the propane tank model.''}}
Valve provided these keys in the respective {{Code|addoninfo.txt}} copies packaged with the example campaigns [[#“DEADLINE”|“DEADLINE”]] and [[#“DEADLINE 2”|“DEADLINE 2”]].


 
{| class="standard-table" style="width: 100%"
The add-on menu has limits to tags, but its different in each game:
! style="text-align: left" | Key  
* {{l4d}} - Appends <code>'..'</code> to the addon's tags. Needs 4+ tags in {{l4d}}'s default menu UI before this happens.
! style="text-align: left" | Description
* {{l4d2}} - Cuts off the tag's names. The limit before it happens is 30 characters for the default menu UI.
|-
 
| addonSteamAppID
{| class=wikitable style="width:95%; margin: auto auto;"
| The AppID of the addon’s target game. Only {{Code|addoninstaller.exe}} uses this.
! Key !! {{game name|l4d|name=Left 4 Dead}}'s effects !! {{game name|l4d2|name=Left 4 Dead 2}}'s effects
|-
|-
| addonContent_Campaign || Adds the ''<code>Campaign</code>'' tag. || Loads all assets within the addon only for the maps in the campaign's mission file; adds the ''<code>Campaigns</code>'' tag.
| addonTagline
| The addon’s subtitle or tagline. May have had a similar purpose to key {{Code|poster/posterTagline}} in [[Mission Files|mission files]].
|-
|-
| addonContent_Map || If <code>addonContent_Campaign</code> isn't used, adds the ''<code>Maps</code>'' tag. || If <code>addonContent_Campaign</code> isn't used, adds the ''<code>Campaigns</code>'' tag.
| addonAuthorSteamID
| The addon author’s [[SteamID]]. Supposedly used to construct a URL to the author’s Steam profile page.
|-
|-
| addonContent_Survivor || Adds the ''<code>Survivor Models</code>'' tag. || Adds the ''<code>Survivors</code>'' tag.
| addonSteamGroupName
| The addon’s Steam group. Supposedly used to construct a URL to the addon’s Steam group page.
|-
|-
| addonContent_Skin || Adds the ''<code>Skins</code>'' tag. || Adds the ''<code>Skins</code>'' tag.
| addonURL0
| The addon’s homepage. May have had a similar purpose to key {{Code|Website}} in [[Mission Files|mission files]].
|-
|-
| addonContent_BossInfected || Adds the ''<code>Boss Models</code>'' tag. || Adds the ''<code>Infected</code>'' tag.
| addonContent_Survival<br />addonContent_Versus<br />addonContent_Scavenge
| If the addon provides custom campaigns supporting the Survival, Versus, or Scavenge game modes. This functionality is provided by [[Mission Files|mission files]].
|-
|-
| addonContent_CommonInfected || Adds the ''<code>Common Models</code>'' tag. || Adds the ''<code>Infected</code>'' tag.
| addonContent_Prefab
| If the addon provides custom ''{{Hammer|4}}'' {{lc:[[Prefabs]]}}.
|-
|-
| addonContent_Music || Adds the ''<code>Music</code>'' tag. || Adds the ''<code>Sounds</code>'' tag.
| addonContent_Spray
| If the addon provides custom logos.
|-
|-
| addonContent_Sound || Adds the ''<code>Sounds</code>'' tag. || Adds the ''<code>Sounds</code>'' tag.
| addonContent_BackgroundMovie
| If the addon provides custom background movies.
|-
|-
| addonContent_Prop || Adds the ''<code>Prop Models</code>'' tag. || Adds the ''<code>Items</code>'' tag.
| Content_Weapon
| If the addon provides custom weapons (e.g., “…a new weapon, i.e. guns, explosives, booby traps, hot tar, etc.”).
|-
|-
| addonContent_Weapon || Adds the ''<code>Weapon Models</code>'' tag. || Adds the ''<code>Weapons</code>'' tag.
| Content_WeaponModel
| If the addon provides custom weapon model.
|-
|-
| addonContent_Script || Adds the ''<code>Scripts</code>'' tag. || Adds the ''<code>Scripts</code>'' tag.
| addonDescription_{{Var|locale}}
| The addon’s description localized for locale {{Var|locale}}, where {{Var|locale}} is an [[wp:List of ISO 639-1 codes|ISO 639-1 code]] in ALL CAPS.
|}
|}


=== Doesn't exist ===
== Content tag handling ==
These keys are found in the example <code>addoninfo.txt</code> from the Deadline example campaign, but does nothing when used.
 
An addon’s {{Code|AddonInfo}} [[#kv-addoninfo-keys|content keys]] provide an abstraction over ''{{Source|4}}''’s implementation-specific content tags.
''{{Source|4}}'' will convert all keys into an internal representation (typically, a bitfield).
A content key {{Em|may}} correspond to its internal tag; some keys provide redundant meaning useful only to authors and distributors.
''{{Source|4}}'' will use these content tags to describe and filter addons in the {{Code|[[CBaseModFrame]]}} {{Code|Addons}}.


{| class=wikitable style="width:95%; margin: auto auto;"
{{bug|A prop’s {{lc:[[Collision mesh|Collision mesh]]}} throughout the current session will be decided by whichever addon or pack-file loads first.
! Key !! Description
The game will always load the effective first collision mesh until the current session ends.
''This was tested on the propane tank model.'' {{todo|Move this to an appropriate page}}}}
 
=== In ''{{L4D|4}}'' and ''{{AS|4}}'' ===
 
''{{L4D|4}}'' maintains a one-to-one correspondance between content keys and content tags. The handler closely resembles that found in the ''{{AS|4}}'' SDK.
 
''{{Source|4}}'' will generate the content label by concatenating the VGUI localization strings corresponding to the given content tag followed into an array of 60 wide characters.
The right-most comma will always be replaced with a {{Code|NULL}} terminator.
The effective length of the label is 59 characters since the last character will always be a {{Code|NULL}} terminator.
 
=== In ''{{L4D2|4}}'' ===
 
''{{L4D2|4}}'' stores the content keys for each addon as an {{Code|[https://en.cppreference.com/w/cpp/types/integer int16_t]}} representing the following bitfield (assume little-endian):
<div style="overflow:auto">
{|class="standard-table mw-collapsible" style="overflow: auto"
|+ style="text-align: left" | ''{{L4D2|4}} content tag bitfield''
|-
|-
| <del>addonTagline</del> || A "wrap-up short description". How this was going to be implemented is unknown.
! style="text-align: right" scope="row" | Bit
| 15
| 14
| 13
| 12
| 11
| 10
| 9
| 8
| 7
| 6
| 5
| 4
| 3
| 2
| 1
| 0
|-
|-
| <del>addonAuthorSteamID</del> || Supposed to setup a link that goes to the author's page.
! style="text-align: right" scope="row" | Tag
| N/A
| N/A
| N/A
| N/A
| {{Code|CONTENT_ITEM}}
| {{Code|CONTENT_UI}}
| {{Code|CONTENT_SCRIPT}}
| {{Code|CONTENT_SOUND}}
| {{Code|CONTENT_SURVIVOR}}
| {{Code|CONTENT_INFECTED}}
| {{Code|CONTENT_MUTATION}}
| {{Code|CONTENT_WEAPON}}
| {{Code|CONTENT_SKIN}}
| {{Code|CONTENT_MISCELLANEOUS}}
| {{Code|CONTENT_CAMPAIGN}}
| {{Code|CONTENT_RESERVED}}
|-
|-
| <del>addonSteamGroupName</del> ||Supposed to setup a link that goes to a Steam Group's page.
! style="text-align: right" scope="row" | [[#kv-addoninfo-keys|Key]]
|-
| N/A
| <del>addonContent_Survival</del>, <del>addonContent_Versus</del>, <del>addonContent_Scavenge</del> {{only|{{l4d2}}}} || Likely meant for maps.
| N/A
|-
| N/A
| <del>addonContent_Prefab</del> || Prefabs refer to Hammer VMF prefabs. This doesn't alter the menu tags in anyway.
| N/A
|-
| {{Code|addonContent_prop}}
| <del>addonContent_Spray</del> || This doesn't alter the menu tags in anyway.
| N/A
|-
| {{Code|addonContent_Script}}
| <del>addonContent_BackgroundMovie</del> || 'BackgroundMovie' likely refers to the menu video.
| {{Code|addonContent_Sound}}<br />{{Code|addonContent_Music}}
|-
| {{Code|addonContent_Survivor}}
| <del>Content_Weapon</del> || Supposedly for when the addon "provides a new weapon, i.e. guns, explosives, booby traps, hot tar, etc.". No such modding support exists.
| {{Code|addonContent_BossInfected}}<br />{{Code|addonContent_CommonInfected}}
|-
| N/A
| <del>Content_WeaponModel</del> || 'WeaponModel' points to mods that changes the looks of weapons.
| {{Code|addonContent_Weapon}}
|-
| {{Code|addonContent_Skin}}
| <del>addonDescription_XX</del> || Extra localization key variants for addon descriptions. The last two characters are the first two characters of the language (e.g. <code>addonDescription_FR</code> for French).
| N/A
{{Expand|
| {{Code|addonContent_Campaign}}<br />{{Code|addonContent_Map}}
* <code>_DA</code> - Danish
| N/A
* <code>_NL</code> - Dutch
* <code>_FI</code> - Finnish
* <code>_FR</code> - French
* <code>_DE</code> - German
* <code>_IT</code> - Italian
* <code>_JA</code> - Japanese
* <code>_KO</code> - Korean
* <code>_NO</code> - Norwegian
* <code>_PL</code> - Portuguese
* <code>_RU</code> - Russian
* <code>_ZH</code> - Chinese
* <code>_ES</code> - Spanish
* <code>_SV</code> - Sweden}}
|}
|}
</div>
The content tags {{Code|CONTENT_MISCELLANEOUS}}, {{Code|CONTENT_MUTATION}}, and {{Code|CONTENT_UI}} can be set {{Em|only through the Steam Workshop}}.
''{{Source|4}}'' will generate the content label by concatenating the VGUI localization strings corresponding to the given content tag followed into an array of 60 wide characters.
The right-most comma will always be replaced with a {{Code|NULL}} terminator.
The effective length of the label is 59 characters since the last character will always be a {{Code|NULL}} terminator.


== Examples ==
== Examples ==
Below are the extensively-documented <code>addoninfo.txt</code> from the sample "Dead Line" campaign, which is the source of all keys mentioned in this page.


Downloads to the sample campaigns are below:
The following are samples—both modern and historic—of {{Code|addoninfo.txt}}.
* {{l4d}} [http://media.steampowered.com/apps/513/deadline.html Dead Line]
Avoid using the [[#“DEADLINE”|“DEADLINE”]] or [[#“DEADLINE 2”|“DEADLINE 2”]] samples as templates: you will be shipping redundant keys.
* {{l4d2}} [http://media.steampowered.com/apps/513/deadline2.html Dead Line 2]
 
=== Minimal compliant {{Code|AddonInfo}} ===
<pre style="white-space: pre; overflow; auto; tab-size: 4; height: 25vh">
AddonInfo {
addontitle "こんにちは、世界!" // Title is interpreted as a UTF8 string;
// prefer codepoints in the Basic
// Multilingual Plane.
addonauthor ValveDeveloperWiki
addonversion something // This can be anything and not just a float
addonDescription "This is a sample.
 
Note that the KeyValues parser will, in a quoted string, a) parse all
whitespace literally and b) // ignore all C-style comments. You could
probably use this to validate a KeyValues parser too.
"
addonContent_Campaign 1
addonContent_Survivor -1
addonContent_Sound 3.14159265
}
 
</pre>
 
=== “DEADLINE” ===
 
Download Valve’s “DEADLINE” campaign from [http://media.steampowered.com/apps/513/deadline.html here].
The following snippet matches the original exactly as of April 30, 2023.
 
<pre style="white-space: pre; overflow: auto; height: 25vh">
// The addoninfo.txt file is a metadata file that is required by all Left 4 Dead Add-ons.
 


{| style="margin: auto auto;"
|- style="vertical-align:top;"
|{{ExpandBox|<pre>
"AddonInfo"
"AddonInfo"
{
{
"addonSteamAppID"                  "500"
        addontitle "Dead Line"                                     // Add-on title that shows up in Add-ons list. ~20 chars max
"addonTitle"                      "Dead Line"
        addonversion         1.3                                            // Add-on version.
"addonVersion"                    "1.0"
        addontagline "Catch the last subway... out of hell."         // Add-on tagline or wrap-up- a short description. ~100 chars max
"addonTagline"                    "Catch the last subway... out of hell."
addonauthor "Valve"                                         // Name/alias of the author
"addonAuthor"                      "Valve"
addonauthorSteamID "http://steamcommunity.com/groups/Valve"        // Steam Profile URL of author or group
"addonAuthorSteamID"              "MikeDurand"
"addonSteamGroupName"              "deadlineaddon"
"addonURL0"                        "http://media.steampowered.com/apps/513/deadline.html"


"addonContent_Campaign"            "1"
addonContent_Campaign 1                                 //This addon provides muliple connected maps with a finale
"addonContent_Survival"            "0"
"addonContent_Scavenge"            "0"
"addonContent_Versus"              "0"
"addonContent_Map"                "0"


"addonContent_Survivor"            "0"
addonURL0 "http://media.steampowered.com/apps/513/deadline.html" //An html home page for the add-on that includes a download link.
"addonContent_Skin"                "0"


"addonContent_BossInfected"        "0"
// short description that appears in the Add-on list screen...
"addonContent_CommonInfected"      "0"
addonDescription "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead Authoring tools SDK, which is available under the 'Tools' tab in Steam."
"addonContent_Music"              "0"
"addonContent_Sound"              "0"
// Authors can add localized descriptions here. (Not yet supported)
"addonContent_Prop"                "0"
addonDescription_FR "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead qui sont disponibles sous l'onglet "Outils" sur Steam."
"addonContent_Prefab"              "0"
"addonContent_Spray"              "0"
"addonContent_Script"              "0"
"addonContent_BackgroundMovie"     "0"


"Content_Weapon"                  "0"
}</pre>
"Content_WeaponModel"              "0"


"addonDescription"                "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead 2 Authoring tools SDK, which is available under the 'Tools' tab in Steam."
=== “DEADLINE 2” ===
"addonDescription_DA"              "Overlevende skal undslippe et S-tog i denne korte tutorial eksempel kampagne. Få kildefiler og værktøjer til at skabe dine egne kampagner ved at downloade Left 4 Dead 2 Authoring værktøjer SDK, som er tilgængelig under 'Funktioner' fanen i Steam."
"addonDescription_NL"              "Overlevenden moet ontsnappen op een metro in deze korte handleiding voorbeeld campagne. Krijg bronbestanden en tools voor het maken van uw eigen campagnes door het downloaden van de Left 4 Dead 2 Authoring gereedschappen SDK, die beschikbaar is op het tabblad 'Extra' in Steam."
"addonDescription_FI"              "Survivors on pelastautua metro tässä lyhyessä harjoitusesimerkit kampanja. Hanki lähdetiedostot ja työkalut luoda omia kampanjoita lataamalla Left 4 Dead 2 Authoring Tools SDK, joka on käytettävissä Työkalut-välilehti Steam."
"addonDescription_FR"              "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead 2 qui sont disponibles sous l'onglet 'Outils' sur Steam."
"addonDescription_DE"              "Survivors muss auf einer U-Bahn in diesem kurzen Tutorial beispielsweise Kampagne entkommen. Holen Sie sich die Quelldateien und Werkzeuge für die Erstellung eigener Kampagnen, indem Sie die Left 4 Dead 2 Authoring Tools SDK, welches unter der Registerkarte 'Tools' in Steam."
"addonDescription_IT"              "I sopravvissuti devono sfuggire su un treno della metropolitana in questa breve campagna esempio tutorial. Ottenere file di origine e di strumenti per la creazione di campagne scaricando il Left 4 Dead 2 Authoring Tools SDK, che è disponibile sotto la scheda 'Strumenti' nel vapore."
"addonDescription_JA"              "生存者はこの短いチュートリアルの例のキャンペーンの地下鉄電車の中でエスケープする必要があります。スチームで[ツール]タブの下で利用可能ですレフト4デッドオーサリングツールのSDKをダウンロードすることにより、独自のキャンペーンを作成するためのソースファイルやツールを入手してください。"
"addonDescription_KO"              "생존자들은이 짧은 튜토리얼 예제 캠페인 지하철에서 탈출해야합니다. 증기의 '도구'탭에 따라 사용할 수 있습니다 레프트 4 데드 저작 도구 SDK를 다운로드하여 자신의 캠페인을 만들기위한 소스 파일과 도구를 얻을."
"addonDescription_NO"              "Overlevende må rømme på et tog i denne korte opplæringen eksempel kampanjen. Få kildefilene og verktøy for å lage dine egne kampanjer ved å laste ned Left 4 Dead 2 Authoring verktøy SDK, som er tilgjengelig under 'Verktøy'-fanen i Steam."
"addonDescription_PL"              "Ocaleni muszą uciekać na pociąg metra w tej krótkiej kampanii przykład samouczka. Pobierz pliki źródłowe i narzędzia do tworzenia własnych kampanii pobierając Left 4 Dead 2 Authoring narzędzi SDK, który jest dostępny w zakładce 'Narzędzia' w Steam."
"addonDescription_PT"              "Sobreviventes deve escapar em um trem do metrô nesta campanha exemplo curto tutorial. Obter arquivos de origem e ferramentas para criar suas próprias campanhas baixando o Left 4 Dead 2 Authoring ferramentas SDK, que está disponível na aba 'Ferramentas' no Steam."
"addonDescription_RU"              "Выжившие должны бежать на поезд метро, ​​в этой короткой кампании пример урока. Получить исходные файлы и инструменты для создания собственных кампаний, загрузив Left 4 Dead 2 Authoring инструментов SDK, который доступен на вкладке 'Инструменты' в Steam."
"addonDescription_ZH"              "在这个简短的示范性的战役中,生还者必须逃出地铁列车。通过下载求生之路2的专属工具(Left 4 Dead 2 Authoring tools SDK)----此SDK可以在steam平台的库中的工具一栏找到----来获取起源引擎的文件和工具以创建属于您自己的战役。"
"addonDescription_ES"              "Los sobrevivientes deben escapar en un tren subterráneo en esta corta campaña de ejemplo del tutorial. Obtenga los archivos de origen y las herramientas para crear sus propias campañas por descargar el Left 4 Dead 2 Authoring herramientas SDK, que está disponible en la pestaña 'Herramientas' en Steam."
"addonDescription_SV"              "Överlevande måste fly på ett tunnelbanetåg i denna korta handledning exempel kampanjen. Få källfiler och verktyg för att skapa dina egna kampanjer genom att ladda ner Left 4 Dead 2 Authoring Tools SDK, som är tillgänglig under 'Verktyg' fliken i Steam."
}
</pre>|Dead Line {{l4d}}}}
|{{ExpandBox|<pre>
"AddonInfo"
{
"addonSteamAppID"                  "550"
"addonTitle"                      "Dead Line 2"
"addonVersion"                    "1.0"
"addonTagline"                    "Catch the last subway... out of hell... Again!"
"addonAuthor"                      "Valve"
"addonAuthorSteamID"              "YasserMalaika"
"addonSteamGroupName"              "deadlineaddon"
"addonURL0"                        "http://media.steampowered.com/apps/513/deadline2.html"


"addonContent_Campaign"            "1"
Download Valve’s “DEADLINE 2” campaign from [http://media.steampowered.com/apps/513/deadline2.html here].
"addonContent_Survival"            "0"
The following snippet matches the original exactly as of April 30, 2023.
"addonContent_Scavenge"            "0"
"addonContent_Versus"              "0"
"addonContent_Map"                "0"


"addonContent_Survivor"            "0"
<pre style="white-space: pre; overflow: auto; height: 25vh">
"addonContent_Skin"                "0"
// The addoninfo.txt file is a metadata file that is required by all Source Engine Add-ons.


"addonContent_BossInfected"        "0"
"AddonInfo"
"addonContent_CommonInfected"     "0"
{
"addonContent_Music"              "0"
    addonSteamAppID        550                                                    // 500 is the app ID for Left 4 Dead, 550 for Left 4 Dead 2
"addonContent_Sound"              "0"
     addontitle              "Dead Line 2"                                           // Add-on title that shows up in Add-ons list. ~20 chars max
"addonContent_Prop"                "0"
    addonversion     1.0                                                     // Add-on version.
"addonContent_Prefab"              "0"
    addontagline            "Catch the last subway... out of hell... Again!"     // Add-on tagline or wrap-up- a short description. ~100 chars max
"addonContent_Spray"              "0"
    addonauthor            "Valve"                                                 // Name/alias of the author
"addonContent_Script"              "0"
    addonSteamGroupName    "deadline2add-on"                                       // (Optional) Steam group related to the add-on. We use this to construct a URL to the group page.
"addonContent_BackgroundMovie"    "0"
    addonauthorSteamID      "YasserMalaika"                                         // (Optional) Steam ID of author. We use this to construct a URL to the author's page.
    addonContent_Campaign  1                                                     //This addon provides muliple connected maps with a finale
    addonURL0              "http://media.steampowered.com/apps/513/deadline2.html" //An html home page for the add-on that includes a download link.


"Content_Weapon"                  "0"
    // short description that appears in the Add-on list screen...
"Content_WeaponModel"              "0"
    addonDescription        "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead 2 Authoring tools SDK, which is available under the 'Tools' tab in Steam."


"addonDescription"                "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead 2 Authoring tools SDK, which is available under the 'Tools' tab in Steam."
    // Authors can add localized descriptions here. (Not yet supported)
"addonDescription_DA"              "Overlevende skal undslippe et S-tog i denne korte tutorial eksempel kampagne. Få kildefiler og værktøjer til at skabe dine egne kampagner ved at downloade Left 4 Dead 2 Authoring værktøjer SDK, som er tilgængelig under 'Funktioner' fanen i Steam."
    addonDescription_FR     "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead 2 qui sont disponibles sous l'onglet "Outils" sur Steam."
"addonDescription_NL"              "Overlevenden moet ontsnappen op een metro in deze korte handleiding voorbeeld campagne. Krijg bronbestanden en tools voor het maken van uw eigen campagnes door het downloaden van de Left 4 Dead 2 Authoring gereedschappen SDK, die beschikbaar is op het tabblad 'Extra' in Steam."
"addonDescription_FI"              "Survivors on pelastautua metro tässä lyhyessä harjoitusesimerkit kampanja. Hanki lähdetiedostot ja työkalut luoda omia kampanjoita lataamalla Left 4 Dead 2 Authoring Tools SDK, joka on käytettävissä Työkalut-välilehti Steam."
}</pre>
"addonDescription_FR"              "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead 2 qui sont disponibles sous l'onglet 'Outils' sur Steam."
"addonDescription_DE"              "Survivors muss auf einer U-Bahn in diesem kurzen Tutorial beispielsweise Kampagne entkommen. Holen Sie sich die Quelldateien und Werkzeuge für die Erstellung eigener Kampagnen, indem Sie die Left 4 Dead 2 Authoring Tools SDK, welches unter der Registerkarte 'Tools' in Steam."
"addonDescription_IT"              "I sopravvissuti devono sfuggire su un treno della metropolitana in questa breve campagna esempio tutorial. Ottenere file di origine e di strumenti per la creazione di campagne scaricando il Left 4 Dead 2 Authoring Tools SDK, che è disponibile sotto la scheda 'Strumenti' nel vapore."
"addonDescription_JA"              "生存者はこの短いチュートリアルの例のキャンペーンの地下鉄電車の中でエスケープする必要があります。スチームで[ツール]タブの下で利用可能ですレフト4デッド2オーサリングツールのSDKをダウンロードすることにより、独自のキャンペーンを作成するためのソースファイルやツールを入手してください。"
"addonDescription_KO"              "생존자들은이 짧은 튜토리얼 예제 캠페인 지하철에서 탈출해야합니다. 증기의 '도구'탭에 따라 사용할 수 있습니다 레프트 4 데드 2 제작 도구 SDK를 다운로드하여 자신의 캠페인을 만들기위한 소스 파일과 도구를 얻을."
"addonDescription_NO"              "Overlevende må rømme på et tog i denne korte opplæringen eksempel kampanjen. Få kildefilene og verktøy for å lage dine egne kampanjer ved å laste ned Left 4 Dead 2 Authoring verktøy SDK, som er tilgjengelig under 'Verktøy'-fanen i Steam."
"addonDescription_PL"              "Ocaleni muszą uciekać na pociąg metra w tej krótkiej kampanii przykład samouczka. Pobierz pliki źródłowe i narzędzia do tworzenia własnych kampanii pobierając Left 4 Dead 2 Authoring narzędzi SDK, który jest dostępny w zakładce 'Narzędzia' w Steam."
"addonDescription_PT"              "Sobreviventes deve escapar em um trem do metrô nesta campanha exemplo curto tutorial. Obter arquivos de origem e ferramentas para criar suas próprias campanhas baixando o Left 4 Dead 2 Authoring ferramentas SDK, que está disponível na aba 'Ferramentas' no Steam."
"addonDescription_RU"              "Выжившие должны бежать на поезд метро, ​​в этой короткой кампании пример урока. Получить исходные файлы и инструменты для создания собственных кампаний, загрузив Left 4 Dead 2 Authoring инструментов SDK, который доступен на вкладке 'Инструменты' в Steam."
"addonDescription_ZH"              "在这个简短的示范性的战役中,生还者必须逃出地铁列车。通过下载求生之路2的专属工具(Left 4 Dead 2 Authoring tools SDK)----此SDK可以在steam平台的库中的工具一栏找到----来获取起源引擎的文件和工具以创建属于您自己的战役。"
"addonDescription_ES"              "Los sobrevivientes deben escapar en un tren subterráneo en esta corta campaña de ejemplo del tutorial. Obtenga los archivos de origen y las herramientas para crear sus propias campañas por descargar el Left 4 Dead 2 Authoring herramientas SDK, que está disponible en la pestaña 'Herramientas' en Steam."
"addonDescription_SV"              "Överlevande måste fly på ett tunnelbanetåg i denna korta handledning exempel kampanjen. Få källfiler och verktyg för att skapa dina egna kampanjer genom att ladda ner Left 4 Dead 2 Authoring Tools SDK, som är tillgänglig under 'Verktyg' fliken i Steam."
}
</pre>|Dead Line 2 {{l4d2}}}}
|}
== Files ==
{{stub|section=1}}


== See also ==
== See also ==
* [[L4D Campaign Add-on Tutorial]]
* [[L4D Campaign Add-on Tutorial]]
* [[L4D 2 Campaign Add-on Tutorial]]
* [[L4D 2 Campaign Add-on Tutorial]]
Line 279: Line 351:


[[Category:Source]]
[[Category:Source]]
[[Category:Left 4 Dead]]
[[Category:Left 4 Dead]]
[[Category:Left 4 Dead 2]]
[[Category:Left 4 Dead 2]]
 
[[Category:Plain text files]]
[[Category:Plain text files]]<!--Confirm-->

Revision as of 14:15, 29 April 2023

The plain-text file addoninfo.txt contains the KeyValues 1 structure AddonInfo specifying an addon’s metadata: its author, content flags, description, title, and version. This file and its functionality were introduced with the Left 4 Dead Left 4 Dead engine branch.

Both the Source Source Engine and the deprecated external application addoninstaller.exe will parse this file, though with significant differences. Source Source will parse this file from all addons listed in addonlist.txt when loading search paths from gameinfo.txt at startup and with subsequent calls to ConCommand update_addon_paths. Source Source will retrieve metadata for all Steam Workshop addons from the Steam Workshop, overriding content in addoninfo.txt. addoninstaller.exe only parses addoninfo.txt when staging addons during user-initialized installation.

Template:ModernWarning

Template:ModernWarning

Specification

In the following specification, these terms will have the following meanings:

  • shall indicates a mandatory requirement; and
  • should indicates a recommendation.

The Source Source Engine will expect a specific KeyValues 1 structure in addoninfo.txt, specified below:

  • You shall save addoninfo.txt with an UTF-8-compatible encoding.
  • You shall have at least one KeyValues block.
  • You should define the name of the first KeyValues block as AddonInfo.
  • You should populate the first KeyValues block with at least one key-value entry from table “Valid AddonInfo Keys”:
  • You should provide a title, author, and version.
  • You should provide at least one content tag.
Valid AddonInfo Keys
Key Type Length Default Value Description
addontitle wchar_t 127
  1. L4D360UI_Addon_None_Specified
The addon’s title.
addonauthor wchar_t 119
  1. L4D360UI_Addon_None_Specified
The addon’s author.
addonDescription wchar_t 1023
  1. L4D360UI_Addon_None_Specified
The addon’s description. Left 4 Dead 2 Left 4 Dead 2 will truncate those of Steam Workshop addons to 499 characters [citation needed ].
addonversion wchar_t
float (addoninstaller.exe)
31 0.0
1.0 (addoninstaller.exe)
The addon’s version. Conventionally a decimal number in the format major.minor, but you may write any string.
addonContent_Campaign int N/A 0 If the addon contains custom campaigns. If the value is 0, then the addon does not contain the specified content; otherwise, the addon contains the specified content.
addonContent_Map int N/A 0 If the addon contains custom campaigns or custom maps.
addonContent_Skin int N/A 0 If the addon contains custom skins.
addonContent_weapon int N/A 0 If the addon contains custom weapon skins.
addonContent_BossInfected int N/A 0 If the addon contains custom boss infected skins.
addonContent_CommonInfected int N/A 0 If the addon contains custom common infected skins.
addonContent_Survivor int N/A 0 If the addon contains custom survivor skins.
addonContent_Sound int N/A 0 If the addon contains custom sounds.
addonContent_Music int N/A 0 If the addon contains custom music.
addonContent_Script int N/A 0 If the addon contains custom scripts.
addonContent_prop int N/A 0 If the addon contains custom props.

Non-existent or deprecated keys

Avoid writing these keys. All games ignore these keys. Valve provided these keys in the respective addoninfo.txt copies packaged with the example campaigns “DEADLINE” and “DEADLINE 2”.

Key Description
addonSteamAppID The AppID of the addon’s target game. Only addoninstaller.exe uses this.
addonTagline The addon’s subtitle or tagline. May have had a similar purpose to key poster/posterTagline in mission files.
addonAuthorSteamID The addon author’s SteamID. Supposedly used to construct a URL to the author’s Steam profile page.
addonSteamGroupName The addon’s Steam group. Supposedly used to construct a URL to the addon’s Steam group page.
addonURL0 The addon’s homepage. May have had a similar purpose to key Website in mission files.
addonContent_Survival
addonContent_Versus
addonContent_Scavenge
If the addon provides custom campaigns supporting the Survival, Versus, or Scavenge game modes. This functionality is provided by mission files.
addonContent_Prefab If the addon provides custom Hammer Hammer prefabs.
addonContent_Spray If the addon provides custom logos.
addonContent_BackgroundMovie If the addon provides custom background movies.
Content_Weapon If the addon provides custom weapons (e.g., “…a new weapon, i.e. guns, explosives, booby traps, hot tar, etc.”).
Content_WeaponModel If the addon provides custom weapon model.
addonDescription_locale The addon’s description localized for locale locale, where locale is an ISO 639-1 code in ALL CAPS.

Content tag handling

An addon’s AddonInfo content keys provide an abstraction over Source Source’s implementation-specific content tags. Source Source will convert all keys into an internal representation (typically, a bitfield). A content key may correspond to its internal tag; some keys provide redundant meaning useful only to authors and distributors. Source Source will use these content tags to describe and filter addons in the CBaseModFrame Addons.

Icon-Bug.pngBug:A prop’s collision mesh throughout the current session will be decided by whichever addon or pack-file loads first.

The game will always load the effective first collision mesh until the current session ends.

This was tested on the propane tank model.
Todo: Move this to an appropriate page
  [todo tested in ?]

In Left 4 Dead Left 4 Dead and Alien Swarm Alien Swarm

Left 4 Dead Left 4 Dead maintains a one-to-one correspondance between content keys and content tags. The handler closely resembles that found in the Alien Swarm Alien Swarm SDK.

Source Source will generate the content label by concatenating the VGUI localization strings corresponding to the given content tag followed into an array of 60 wide characters. The right-most comma will always be replaced with a NULL terminator. The effective length of the label is 59 characters since the last character will always be a NULL terminator.

In Left 4 Dead 2 Left 4 Dead 2

Left 4 Dead 2 Left 4 Dead 2 stores the content keys for each addon as an int16_t representing the following bitfield (assume little-endian):

Left 4 Dead 2 Left 4 Dead 2 content tag bitfield
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Tag N/A N/A N/A N/A CONTENT_ITEM CONTENT_UI CONTENT_SCRIPT CONTENT_SOUND CONTENT_SURVIVOR CONTENT_INFECTED CONTENT_MUTATION CONTENT_WEAPON CONTENT_SKIN CONTENT_MISCELLANEOUS CONTENT_CAMPAIGN CONTENT_RESERVED
Key N/A N/A N/A N/A addonContent_prop N/A addonContent_Script addonContent_Sound
addonContent_Music
addonContent_Survivor addonContent_BossInfected
addonContent_CommonInfected
N/A addonContent_Weapon addonContent_Skin N/A addonContent_Campaign
addonContent_Map
N/A

The content tags CONTENT_MISCELLANEOUS, CONTENT_MUTATION, and CONTENT_UI can be set only through the Steam Workshop.

Source Source will generate the content label by concatenating the VGUI localization strings corresponding to the given content tag followed into an array of 60 wide characters. The right-most comma will always be replaced with a NULL terminator. The effective length of the label is 59 characters since the last character will always be a NULL terminator.

Examples

The following are samples—both modern and historic—of addoninfo.txt. Avoid using the “DEADLINE” or “DEADLINE 2” samples as templates: you will be shipping redundant keys.

Minimal compliant AddonInfo

AddonInfo {
	addontitle			"こんにちは、世界!"	// Title is interpreted as a UTF8 string;
												// prefer codepoints in the Basic
												// Multilingual Plane.
	addonauthor			ValveDeveloperWiki
	addonversion		something				// This can be anything and not just a float
	addonDescription	"This is a sample.

Note that the KeyValues parser will, in a quoted string, a) parse all
whitespace literally and b) // ignore all C-style comments. You could
probably use this to validate a KeyValues parser too.
"
	addonContent_Campaign	1
	addonContent_Survivor	-1
	addonContent_Sound		3.14159265
}

“DEADLINE”

Download Valve’s “DEADLINE” campaign from here. The following snippet matches the original exactly as of April 30, 2023.

// The addoninfo.txt file is a metadata file that is required by all Left 4 Dead Add-ons. 


"AddonInfo"
{
        addontitle		"Dead Line"                                     // Add-on title that shows up in Add-ons list. ~20 chars max
        addonversion	        1.3                                             // Add-on version.
        addontagline		"Catch the last subway... out of hell."	        // Add-on tagline or wrap-up- a short description. ~100 chars max
	addonauthor 		"Valve"                                         // Name/alias of the author
	addonauthorSteamID 	"http://steamcommunity.com/groups/Valve"        // Steam Profile URL of author or group

	addonContent_Campaign		1 	                                //This addon provides muliple connected maps with a finale

	addonURL0 "http://media.steampowered.com/apps/513/deadline.html"	//An html home page for the add-on that includes a download link.

	// short description that appears in the Add-on list screen...
	addonDescription "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead Authoring tools SDK, which is available under the 'Tools' tab in Steam."
	
	// Authors can add localized descriptions here. (Not yet supported)
	addonDescription_FR "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead qui sont disponibles sous l'onglet "Outils" sur Steam."	

}

“DEADLINE 2”

Download Valve’s “DEADLINE 2” campaign from here. The following snippet matches the original exactly as of April 30, 2023.

// The addoninfo.txt file is a metadata file that is required by all Source Engine Add-ons.

"AddonInfo"
{
     addonSteamAppID         550                                                     // 500 is the app ID for Left 4 Dead, 550 for Left 4 Dead 2
     addontitle              "Dead Line 2"                                           // Add-on title that shows up in Add-ons list. ~20 chars max
     addonversion	     1.0                                                     // Add-on version.
     addontagline            "Catch the last subway... out of hell... Again!"	     // Add-on tagline or wrap-up- a short description. ~100 chars max
     addonauthor             "Valve"                                                 // Name/alias of the author
     addonSteamGroupName     "deadline2add-on"                                       // (Optional) Steam group related to the add-on. We use this to construct a URL to the group page.
     addonauthorSteamID      "YasserMalaika"                                         // (Optional) Steam ID of author. We use this to construct a URL to the author's page.
     addonContent_Campaign   1 	                                                     //This addon provides muliple connected maps with a finale
     addonURL0               "http://media.steampowered.com/apps/513/deadline2.html" //An html home page for the add-on that includes a download link.

     // short description that appears in the Add-on list screen...
     addonDescription        "Survivors must escape on a subway train in this short tutorial example campaign. Get source files and tools for creating your own campaigns by downloading the Left 4 Dead 2 Authoring tools SDK, which is available under the 'Tools' tab in Steam."

     // Authors can add localized descriptions here. (Not yet supported)
     addonDescription_FR     "Les survivants doivent s'échapper en métro dans cette carte du tutoriel. Obtenez les fichiers et les outils pour créer vos propres cartes en chargeant les outils de création SDK Left 4 Dead 2 qui sont disponibles sous l'onglet "Outils" sur Steam."	
 
}

See also