The _Main.cfg What exactly is happening?
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
The _Main.cfg What exactly is happening?
Hello. I have determined after my long struggle with the unit database that fundamentally i have been loading my units incorrectly in the main.cfg file. So i was wondering if any dev's would be willing to point out my mistake. (it must be obvious because it is so huge an error that stops every single unit from loading in the unit database)
Here is my main.cfg file. My main questions are:
- If i put the [+units] only outside the #ifdef MULTIPLAYER is that good
- Do i need my /eras folder to be outside the #ifdef MULTIPLAYER
- My era file loads my factons (with the code in the spoiler below) is that sufficient or should i load the factions in the main.cfg file
- Will the stuff inside the [+unit] effectively load all my units?
- Do i even need the [textdomain] if i have no translations?
I appreciate any comments and i hope to fix this! Thank you!
Here is my main.cfg file. My main questions are:
- If i put the [+units] only outside the #ifdef MULTIPLAYER is that good
- Do i need my /eras folder to be outside the #ifdef MULTIPLAYER
- My era file loads my factons (with the code in the spoiler below) is that sufficient or should i load the factions in the main.cfg file
Spoiler:
- Do i even need the [textdomain] if i have no translations?
Code: Select all
#textdomain wesnoth-ROTL
[textdomain]
name="wesnoth-ROTL"
path="data/add-ons/Reign_of_the_Lords/translations"
[/textdomain]
[binary_path]
path=data/add-ons/Reign_of_the_Lords/
[/binary_path]
{~add-ons/Reign_of_the_Lords/utils/macros/}
{~add-ons/Reign_of_the_Lords/utils/}
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
#ifdef MULTIPLAYER
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
{~add-ons/Reign_of_the_Lords/eras/}
[modification]
id=ROLAdvancement_Modification
name=_"Reign of the Lords Advancement Modification"
require_modification=yes
{MODIFICATION_STRING}
description=_"This Modification allows the base wesnoth units to advance into the new added units from the Reign of The Lords era. This modification is recommended when playing the Reign of the Lords era, but also works for any other era with mainline units. This modification does not effect singleplayer in any way."
{ROL_ADVANCEMENT_EVENTS}
[/modification]
#endif
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- Pentarctagon
- Project Manager
- Posts: 5578
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: The _Main.cfg What exactly is happening?
Moved to WML Workshop.
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: The _Main.cfg What exactly is happening?
why do you want to put anything outside of your
#ifdef MULTIPLAYER .... #endif
block in the first place?Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- Lord-Knightmare
- Discord Moderator
- Posts: 2366
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: The _Main.cfg What exactly is happening?
Code: Select all
#textdomain wesnoth-ROTL
[textdomain]
name="wesnoth-ROTL"
path="data/add-ons/Reign_of_the_Lords/translations"
[/textdomain]
#ifdef MULTIPLAYER
[binary_path]
path=data/add-ons/Reign_of_the_Lords/
[/binary_path]
{~add-ons/Reign_of_the_Lords/utils/macros/}
{~add-ons/Reign_of_the_Lords/utils/}
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
{~add-ons/Reign_of_the_Lords/eras/}
[modification]
id=ROLAdvancement_Modification
name=_"Reign of the Lords Advancement Modification"
require_modification=yes
{MODIFICATION_STRING}
description=_"This Modification allows the base wesnoth units to advance into the new added units from the Reign of The Lords era. This modification is recommended when playing the Reign of the Lords era, but also works for any other era with mainline units. This modification does not effect singleplayer in any way."
{ROL_ADVANCEMENT_EVENTS}
[/modification]
#endif
Including the unit directories outside the
#ifdef
and #endif
will cause it "pollute" mainline. Many players won't like it. So, just don't do that...Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: The _Main.cfg What exactly is happening?
Thank you Lord-Knightmare! I will do that.
The only problem i have is that i want to also be able to use my units in campaigns if the add-on 5 Lords Default Advancement is installed.
What could i add to the other add-on's _main.cfg file (the 5 Lords Default Advancement add-on) in order to load the units in singleplayer - from it.
Should that be done by adding in the 5 Lords Default Advancement _main.cfg file this:
The only problem i have is that i want to also be able to use my units in campaigns if the add-on 5 Lords Default Advancement is installed.
What could i add to the other add-on's _main.cfg file (the 5 Lords Default Advancement add-on) in order to load the units in singleplayer - from it.
Should that be done by adding in the 5 Lords Default Advancement _main.cfg file this:
Code: Select all
[binary_path]
path=data/add-ons/Reign_of_the_Lords/
[/binary_path]
{~add-ons/Reign_of_the_Lords/utils/macros/}
{~add-ons/Reign_of_the_Lords/utils/}
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- Pentarctagon
- Project Manager
- Posts: 5578
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: The _Main.cfg What exactly is happening?
Would #ifhave work?
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: The _Main.cfg What exactly is happening?
Yes i know about
Thank you!
#ifhave
however gfgtdf and lord-knightmare suggested that i put all the things inside the #ifdef MULTIPLAYER
and so i was wondering what effects it will have if it is outside?Thank you!
Last edited by The_Gnat on May 20th, 2017, 1:24 am, edited 1 time in total.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- Lord-Knightmare
- Discord Moderator
- Posts: 2366
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: The _Main.cfg What exactly is happening?
The only problem i have is that i want to also be able to use my units in campaigns if the add-on 5 Lords Default Advancement is installed.
You remind of myself when I joined in 2010. I actually did this on the first version of GLE. Do you know what happened? Zookeeper removed it from the add-on server. Twice. He had good reason too. My add-on was causing OOS errors to any one who had it installed. That's why I mentioned to avoid doing that.
However, if you want... You can do this to your
_main.cfg
.
Code: Select all
#textdomain wesnoth-ROTL
[textdomain]
name="wesnoth-ROTL"
path="data/add-ons/Reign_of_the_Lords/translations"
[/textdomain]
#ifdef MULTIPLAYER
[binary_path]
path=data/add-ons/Reign_of_the_Lords/
[/binary_path]
{~add-ons/Reign_of_the_Lords/utils/macros/}
{~add-ons/Reign_of_the_Lords/utils/}
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
{~add-ons/Reign_of_the_Lords/eras/}
[modification]
id=ROLAdvancement_Modification
name=_"Reign of the Lords Advancement Modification"
require_modification=yes
{MODIFICATION_STRING}
description=_"This Modification allows the base wesnoth units to advance into the new added units from the Reign of The Lords era. This modification is recommended when playing the Reign of the Lords era, but also works for any other era with mainline units. This modification does not effect singleplayer in any way."
{ROL_ADVANCEMENT_EVENTS}
[/modification]
#endif
#ifdef ROTLAM_UNITS_CAMPAIGN
[binary_path]
path=data/add-ons/Reign_of_the_Lords/
[/binary_path]
{~add-ons/Reign_of_the_Lords/utils/macros/}
{~add-ons/Reign_of_the_Lords/utils/}
[+units]
{~add-ons/Reign_of_the_Lords/units/base_units/}
{~add-ons/Reign_of_the_Lords/units/}
{~add-ons/Reign_of_the_Lords/units/outlaws/}
{~add-ons/Reign_of_the_Lords/units/undead/}
{~add-ons/Reign_of_the_Lords/units/orcs/}
{~add-ons/Reign_of_the_Lords/units/loyalists/}
{~add-ons/Reign_of_the_Lords/units/magi/}
{~add-ons/Reign_of_the_Lords/units/dwarves/}
{~add-ons/Reign_of_the_Lords/units/trolls/}
{~add-ons/Reign_of_the_Lords/units/elementals/}
{~add-ons/Reign_of_the_Lords/units/elves/}
{~add-ons/Reign_of_the_Lords/units/fake/}
{~add-ons/Reign_of_the_Lords/units/other/}
[/units]
#endif
ROTLAM_UNITS_CAMPAIGN
inside their campaign's primary #define
will be able to access your add-on's units.Here's an example to clarify:
Code: Select all
[campaign]
id=FORWARD_THEY_CRIED
name= _ "Forward They Cried"
abbrev="FTC"
icon="units/human-loyalists/lieutenant.png~RC(magenta>red)"
image="portraits/humans/transparent/lieutenant.png~SCALE(300,300)"
define=FORWARD_THEY_CRIED
description= _ "You are the leader of an advanced detachment that has been tasked with capturing a bridgehead while the main army prepares to attack. It should be a simple enough assignment."+ _ "
(Novice Level, 1 scenario.)"
first_scenario="Forward"
[/campaign]
#ifdef FORWARD_THEY_CRIED
{ROTLAM_UNITS_CAMPAIGN}
{~add-ons/Forward_They_Cried/scenarios/}
#endif
_main.cfg
for every campaign. If you wanna be dirty.. you can include them outside the
#ifdef MULTIPLAYER
, and get your desired result....but your add-on's gonna get removed... #BeenThereDoneThatCreator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: The _Main.cfg What exactly is happening?
Thank you! I will add that code to my _main.cfg file so that campaigns can use my units. But i will also put a #ifhave condition so that if players want they can override campaigns and force units to load by downloading the 5 Lords Default Unit Advancement add-on.
(As a mater of fact zookeeper must not be so active now-adays, my add-on (now with over 2000 downloads) has been dirtily loading all the units for every campaign for almost a year)
(As a mater of fact zookeeper must not be so active now-adays, my add-on (now with over 2000 downloads) has been dirtily loading all the units for every campaign for almost a year)
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.