Difference between revisions of "BinaryPathWML"
From The Battle for Wesnoth Wiki
(→the toplevel [binary_path] tag: Add support for map_file) |
|||
(8 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{WML Tags}} | ||
== the toplevel [binary_path] tag == | == the toplevel [binary_path] tag == | ||
− | This tag is used to recognize more than one directory as containing images, music, and sound. | + | This tag is used to recognize more than one directory as containing images, music, and sound. It only has one key: |
− | It only has one key: | + | * '''path''': a directory. When an image is not found it the normal ''images'' directory, it will be looked for in '''''path'''/images''. Similarly, |
− | * ''path'' a directory. When an image is not found it the normal | + | ** music will be looked for in '''''path'''/music'', and |
− | it will be looked for in '''''path | + | ** sound in '''''path'''/sound''. |
− | Similarly, music will be looked for in '''''path | + | ** {{DevFeature1.15|3}} For '''[scenario]map_file''' and '''[replace_map]map_file''', the file will be looked for in '''''path'''/maps''. |
− | Notice that ''path'' is still relative to the main Wesnoth directory. | + | |
+ | Notice that '''''path''''' is still relative to the main Wesnoth directory. | ||
+ | |||
+ | [binary_path] should only be used where necessary. For example a multiplayer era should have its [binary_path] inside an #ifdef MULTIPLAYER instead of outside it in order to avoid possible clashes with single-player content. | ||
+ | |||
+ | == Example == | ||
+ | |||
+ | To enable the game to find images, sounds and music in the add-on MyAddOn: | ||
+ | |||
+ | <syntaxhighlight lang=wml> | ||
+ | [binary_path] | ||
+ | path=data/add-ons/MyAddOn | ||
+ | [/binary_path] | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | When the game looks for an image '''''units/humans/footman.png''''', it'll now be able to find and use the file '''''MyAddOn/images/units/humans/footman.png'''''. | ||
== See Also == | == See Also == | ||
Line 12: | Line 28: | ||
* [[ReferenceWML]] | * [[ReferenceWML]] | ||
+ | |||
+ | [[Category: WML Reference]] |
Revision as of 18:22, 26 December 2019
the toplevel [binary_path] tag
This tag is used to recognize more than one directory as containing images, music, and sound. It only has one key:
- path: a directory. When an image is not found it the normal images directory, it will be looked for in path/images. Similarly,
- music will be looked for in path/music, and
- sound in path/sound.
- (Version 1.15.3 and later only) For [scenario]map_file and [replace_map]map_file, the file will be looked for in path/maps.
Notice that path is still relative to the main Wesnoth directory.
[binary_path] should only be used where necessary. For example a multiplayer era should have its [binary_path] inside an #ifdef MULTIPLAYER instead of outside it in order to avoid possible clashes with single-player content.
Example
To enable the game to find images, sounds and music in the add-on MyAddOn:
[binary_path]
path=data/add-ons/MyAddOn
[/binary_path]
When the game looks for an image units/humans/footman.png, it'll now be able to find and use the file MyAddOn/images/units/humans/footman.png.