"Core" ‒ Total Conversion & Mod Support
Moderator: Forum Moderators
Re: "Core" ‒ Total Conversion & Mod Support
Currently, I cannot make a mod that will change the size of the in-game character dialog text. Would using another “core” allow me to override theme files in
data/gui
and alternate font files in fonts
?Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: "Core" ‒ Total Conversion & Mod Support
GUI2 reads the WML definitions differently. Thus you can not yet load them from a core.ancestral wrote:Currently, I cannot make a mod that will change the size of the in-game character dialog text. Would using another “core” allow me to override theme files indata/gui
and alternate font files infonts
?
The fonts might be possible, not sure.
Both things should be doable during the 1.13 cycle.
Please fill a bug report for the GUI2 issue.
I will investigate how the font status is.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Support for Total Conversions and mods
So it would be:fabi wrote:Sorry for answering that late.Pentarctagon wrote:What do I put in the "path" key in order to load everything in default plus something else?
You use the file-path to your toplevel file (mostly called "_main.cfg") in the same syntax like it is used for wml inclusions.
Then, in your file you use the inclusion syntax and include just the Wesnoth core's data/_main.cfg.
After that inclusion you include your own stuff.
Code: Select all
path="/path/to/add-on"
Basically yeah. All the cores currently included are in data/cores.cfg, and are specified between a set of [core] tags. Where would the equivalent of cores.cfg be located for an add-on? In the same directory as _main.cfg?fabi wrote:What exactly do you mean by "coremod"?Also, how does an add-on specify it's a coremod?
A core that provides everything to be compatible with Wesnoth's add-ons?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Support for Total Conversions and mods
That works.Pentarctagon wrote:So it would be:?Code: Select all
path="/path/to/add-on"
In this case we look for a _main.cfg at your add-ons toplevel.
If none found every file and subdir in that path is included, just like "{/path/to/add-on}" in any wml file would have done.
http://wiki.wesnoth.org/PreprocessorRef ... ive_.7B.7D
edit: But the same _main.cfg at your toplevel will be loaded twice because we also load the _main.cfg of every add-on.
edit: This means also that your core is loaded in the default core additionally.
Maybe better put everything into a folder which defines the core:
Code: Select all
path="/path/to/add-on/core/data/_main.cfg"
Code: Select all
path="/path/to/add-on/core/data"
The file must be called "cores.cfg" and it must be located at the toplevel directory of your addon.All the cores currently included are in data/cores.cfg, and are specified between a set of [core] tags. Where would the equivalent of cores.cfg be located for an add-on? In the same directory as _main.cfg?
Thus I suggest the following file structure for an add-on providing cores:
Code: Select all
server.pbl
cores.cfg
_main.cfg <-- for loading stuff no matter which core is selected. The engine still reads this entry point to every add-on.
cores/
cores/core1/
cores/core1/README.txt
cores/core1/data/
cores/core1/data/_main.cfg <-- This is the entry point to your first core. This path should go into path=
cores/core1/data/ai/
cores/core1/data/campaigns/
...
cores/core2/...
...
edit: In most cases the toplevel _main.cfg will just be empty.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: "Core" ‒ Total Conversion & Mod Support
So I tried this:
but any value for the path besides "/" results in it saying "File not found".
Code: Select all
[core]
id=music
name= _ "Music"
rank=20
icon="data/core/images/icons/circlet_winged.png"
image="data/core/images/icons/circlet_winged.png"
description= _ ""
path="/userdata/data/add-ons/Music/cores/core1/data/_main.cfg"
[/core]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: "Core" ‒ Total Conversion & Mod Support
Pent: I think maybe you should use "~" instead of "/userdata/data", otherwise afaik it will look for a folder called userdata (?)
fabi: Shouldn't the selected core somehow be factored into the filesystem code, like in the "get_wml_location" function or something? Or is it intended that all of the paths for anything in a coremod should be relative to userdata and add-on directories. If it were like that then I think you could write stuff that would work with multiple different cores no matter which was loaded, but maybe it's a bad idea for some reason...
fabi: Shouldn't the selected core somehow be factored into the filesystem code, like in the "get_wml_location" function or something? Or is it intended that all of the paths for anything in a coremod should be relative to userdata and add-on directories. If it were like that then I think you could write stuff that would work with multiple different cores no matter which was loaded, but maybe it's a bad idea for some reason...
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: "Core" ‒ Total Conversion & Mod Support
iceiceice: Yes, that was it. The correct path was:
Though now it gives the error:
Code: Select all
path="~add-ons/Music/cores/core1/data/_main.cfg"
which is rather unhelpful. The current setup has "Music/cores.cfg" with the [core] defined and an empty "Music/_main.cfg". Everything that used to be in the add-on that I'm trying to convert to a core was copy/pasted into "Music/cores/core1/data/<images, macros, etc>". The error also continues to occur even if the only thing in "Music/cores/core1/data/" is an empty _main.cfg.Wesnoth wrote:Error loading custom game configuration files. The game will try without loading add-ons.
Details:
Mandatory WML child missing yet untested for. Please report.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: "Core" ‒ Total Conversion & Mod Support
As far as I know, currently Wesnoth loads all add-ons present in userdata directory.
I hope that only one "core" will be loaded at a time. If I load custom core, all mainline stuff will not be loaded and interpreted.
How are you going to differ players with different "cores" in multiplayer?
I hope that only one "core" will be loaded at a time. If I load custom core, all mainline stuff will not be loaded and interpreted.
How are you going to differ players with different "cores" in multiplayer?
Re: "Core" ‒ Total Conversion & Mod Support
Pentarctagon wrote:Though now it gives the error:which is rather unhelpful. The current setup has "Music/cores.cfg" with the [core] defined and an empty "Music/_main.cfg". Everything that used to be in the add-on that I'm trying to convert to a core was copy/pasted into "Music/cores/core1/data/<images, macros, etc>".Wesnoth wrote:Error loading custom game configuration files. The game will try without loading add-ons.
Details:
Mandatory WML child missing yet untested for. Please report.
The message should be right.
I have introduced extra messages whenever the path= attribute does not point to a valid location.
And other errors.
So I guess you don't hit an entry point that gives enough wml to work with.
Maybe you did not adjust the include paths in your _main.cfg (and other) files?
Just copying the files won't be enough.
I suggest to use this include syntax:
Code: Select all
{./path}: The path is resolved relative to the location of the current file containing this inclusion.
just by adding or removing the leading dot.
Yes, sure. The game looks for a [game_config] tag first. The empty _main.cfg can't provide one.The error also continues to occur even if the only thing in "Music/cores/core1/data/" is an empty _main.cfg.
Thus the engine dies with the error message you see.
Wesnoth looks in every add-on's toplevel directory and reads the _main.cfg from there.Xudo wrote:As far as I know, currently Wesnoth loads all add-ons present in userdata directory.
I hope that only one "core" will be loaded at a time. If I load custom core, all mainline stuff will not be loaded and interpreted.
If this file includes your whole core then it is loaded every time.
Make sure your toplevel _main.cfg does not do that.
The only change I made to the add-on loading mechanism is a method to allow loading only active core compatible add-ons.
Every core comes with his unique id.How are you going to differ players with different "cores" in multiplayer?
But there is no implementation in place yet.
Suggestions welcomed
You ask about making the path= the wml toplevel address reachable by includingiceiceice wrote:fabi: Shouldn't the selected core somehow be factored into the filesystem code, like in the "get_wml_location" function or something? Or is it intended that all of the paths for anything in a coremod should be relative to userdata and add-on directories. If it were like that then I think you could write stuff that would work with multiple different cores no matter which was loaded, but maybe it's a bad idea for some reason...
{/}
?I have thought about that.
But how can the designer reach default content then?
The current solution just does not touch how we include files and it seems to be working.
I have always thought that nearly every core is using at least some of the default stuff,
at least data/ai and data/lua are candidates most mods won't replace that early.
The difference between a mod and a total conversion is the add-on compatibility,
not the amount of default content loaded.
Whenever your core provides every mainline macro, unit, terrain, image and sound file you can claim it compatible.
Technically.
Remember that default content usually is used but not included by add-ons again.
The only add-on type which should include (meaning by the
{[~]<path>}
syntax, not in sense of make use)default core content should be the core type.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: "Core" ‒ Total Conversion & Mod Support
Perhaps a more descriptive error message would be appropriate, rather than one that says to report it as a bug?fabi wrote:The message should be right.
I have introduced extra messages whenever the path= attribute does not point to a valid location.
And other errors.
So I guess you don't hit an entry point that gives enough wml to work with.
Maybe you did not adjust the include paths in your _main.cfg (and other) files?
Just copying the files won't be enough.
I suggest to use this include syntax:edit: Assumed you have the same file system structure as the default core this allows to easily switch between your and default core contentCode: Select all
{./path}: The path is resolved relative to the location of the current file containing this inclusion.
just by adding or removing the leading dot.
Yes, sure. The game looks for a [game_config] tag first. The empty _main.cfg can't provide one.The error also continues to occur even if the only thing in "Music/cores/core1/data/" is an empty _main.cfg.
Thus the engine dies with the error message you see.
Also, is there anything else that's required to be there other than [game_config]? Maybe I'm misinterpreting how this is supposed to be used. My intention was to use it as a way to add to mainline, such as making additional right-click menu_items appear in campaigns, rather than replace anything.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code