How do I import mainline campaign units to my campaign?
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.
-
- Posts: 8
- Joined: July 30th, 2023, 3:41 am
How do I import mainline campaign units to my campaign?
I'm interested in importing HttT and UtBS units into my campaign. How do I do just that without copying the whole folder?
- Celtic_Minstrel
- Developer
- Posts: 2241
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: How do I import mainline campaign units to my campaign?
Short answer: You don't.
Longer answer: If you want to use units from a mainline campaign, copy everything they need into your add-on's folder. That's the images (obviously), the unit definition files, custom races or movetypes if applicable, and any macros they use for abilities, animations, or the like.
Rationale: If you try to reference files in a mainline campaign from your add-on, there is no guarantee that your add-on will even load on another computer. Wesnoth supports running with the mainline campaigns not installed at all, so those files may or may not exist. (In practice, barring strange circumstances, they will always exist on Windows and Mac installs. Linux installs are more varied – sometimes they are included and sometimes not.)
Longer answer: If you want to use units from a mainline campaign, copy everything they need into your add-on's folder. That's the images (obviously), the unit definition files, custom races or movetypes if applicable, and any macros they use for abilities, animations, or the like.
Rationale: If you try to reference files in a mainline campaign from your add-on, there is no guarantee that your add-on will even load on another computer. Wesnoth supports running with the mainline campaigns not installed at all, so those files may or may not exist. (In practice, barring strange circumstances, they will always exist on Windows and Mac installs. Linux installs are more varied – sometimes they are included and sometimes not.)
- Pentarctagon
- Project Manager
- Posts: 5567
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How do I import mainline campaign units to my campaign?
As a bit more background: some Linux distros prefer to package each campaign separately (ie: scroll down through https://packages.debian.org/search?suit ... snoth-1.16). Normally they'll all get installed anyway, but it's not 100% guaranteed depending on how the user does the installation. Whether you care about supporting that edge case on Linux is up to you.
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: How do I import mainline campaign units to my campaign?
Check out DoT's
_main.cfg
: https://github.com/cooljeanius/dawn_of_thunder/blob/master/_main.cfgWesnoth-related GitHub repos:
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager
-
- Posts: 8
- Joined: July 30th, 2023, 3:41 am
Re: How do I import mainline campaign units to my campaign?
Short answer: You don't.
Longer answer: If you want to use units from a mainline campaign, copy everything they need into your add-on's folder. That's the images (obviously), the unit definition files, custom races or movetypes if applicable, and any macros they use for abilities, animations, or the like.
Rationale: If you try to reference files in a mainline campaign from your add-on, there is no guarantee that your add-on will even load on another computer. Wesnoth supports running with the mainline campaigns not installed at all, so those files may or may not exist. (In practice, barring strange circumstances, they will always exist on Windows and Mac installs. Linux installs are more varied – sometimes they are included and sometimes not.)
Wow! Thanks for the heads up.As a bit more background: some Linux distros prefer to package each campaign separately (ie: scroll down through https://packages.debian.org/search?suit ... snoth-1.16). Normally they'll all get installed anyway, but it's not 100% guaranteed depending on how the user does the installation. Whether you care about supporting that edge case on Linux is up to you.
So the answer is to copy if you want the best support. Understood.
Thanks for the code reference! This helps alot for a newbie in WML like me.Check out DoT's _main.cfg: https://github.com/cooljeanius/dawn_of_ ... /_main.cfg