Updated for version 4.0.
The name of the module you use as the meta of the module definition is 'AddFiles' or 'AddFilesModule' if
_force_searchis set to true in the module definition.
<AddFiles directory force_all use_clbk>
<extension path force load reload unload/>
Allows you to categorize your added files. Useful when you add a few units and want to keep track of the dependencies of the unit. Used in custom levels' add.xml.
Has the same parameters as and accepts files.
Note: custom levels' add.xml use
typeparameter in their
<add>. This is only used by the editor. You can categorize them with comments.
Any file that exists in the game can be added through AddFiles. It doesn't mean all will load but most do.
The files either don't need load at all (like textures). Or, are loaded automatically by BeardLib when they are used
- cooked_physics (Added automatically for new units)
- effect (supposed to load by itself, if it doesn't work you can still try load=true)
- any scriptdata
For this example you would have your custom texture like this: mods/MyMod/assets/guis/textures/my_texture.texture
If you are using this module in a BLT mod.
Example of using
Introduced in 3.38.
Shortcuts are mainly for units and are used to add units using special metas that "guess" your files based on a path you provide. There are also some for textures. This let's you reduce the amount of copy pasting you have to do in AddFiles.
- Most paths are supposed to be the same (except of course the extension). But, things like textures are path + _df and path + _nm.
- df stands for diffuse and nm stands for normal.
- cc is the texture used for skins.
- thq stands for (presumably) third-person high quality and are essentially the high quality third models. Mostly the templates already have the things in the material config setup so you don't have to touch it. That also has a cc variant (Weird I know).
auto_cpoption above is actually turned on here by default. This means you don't have to include cooked_physics. If your unit does use cooked physics (meaning the cooked physics file isn't 0kb) you should set this value to false. In some cases, the unit doesn't need a cooked physics at all so there you should turn that off too.
Remember that these replace the meta name. So you'll write it like
This will add a unit, model, and an object that are all located in
path(path is a file path) If we were to use unit_tex it would add material_config too and textures which would be in path + _df, path + _nm
The parameters these nodes accept are:
auto_cp(custom_cp only working in unit_x of course).
Possibly in the future this list may expand. It's also possible that a feature will be added to add shortcuts.
Introduced in 4.0.
A step up to shortcuts; now you can forget about adding entries every time.
Warning: it's currently being tested and some things may not work as intended.
To use this in the most simple way, you just need to add
auto_generate="true"to the AddFiles config.
This will auto generate an xml which by default will be named
gen_add.xml. The file will be generated once and that's it.
If you want to have it generate every reload, go to the your mod's settings in the BeardLib Mods Manager and enable "Develop Mode". This will tell BeardLib that the mod is being developed and it should auto generate it every reload.
Need more options? Remove that auto_generate value and convert it to:
Now for the structure and how to do some things.
<unit/> <!--Ignores type unit-->
<unit path/> <!--Ignores path + unit -->
<table path/> <!--Ignores path -->
<table pattern/> <!--Ignores all files matching the pattern -->
<unit .../> <!--Set any unit-->
<unit path .../> <!--Set unit with path-->
<table path .../> <!--Set any file equal to that path-->
<table .../> <!--Set any file-->
<table pattern .../> <!--Set any file matching the pattern-->
Uses the same parameters as
<AddFiles>. It will inherit the top AddFiles's values.
Let's you ignore files using: paths, types and patterns.
This will ignore all paths that equal to "path/to/file"
This will ignore a unit with the path "path/to/file"
This will ignore all files that match this pattern. If you want to specify a type you'd write it like this:
Remember! This uses lua patterns so you must be aware of the magic characters. The following characters must be escaped if you want to use them normally:
+, -, . and %. Escape them by placing a
%before them. Generally, these shouldn't be used in file/folder names.
Uses similar syntax to ignore. So read that first.
Not everything can be automated. And so, sometimes we need to set values for some files.
<unit path="path/to/unit" load="true"/>
<table path="path/to/unit" unload="true" load="true"/>
<table pattern="_barrel" load="true"/>
Or a unit with patterns:
<unit pattern="_barrel" auto_cp="true"/>