Activate dependencies

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Activate dependencies

Post by LordAwsomeness » October 20th, 2019, 8:13 pm

So I am trying to use macros and stuff from a separate add-on but the game keeps saying I am missing the macros. I have placed the
{~add-ons/LA_MP_Pack/utils/paths.cfg}
in the main.cfg of the new add-on I am trying to make under the #ifdef MULTIPLAYER yet it still does not recognize that I have the macros installed. What is the right way to fix this?
I want the dependencies to be reliant on each other but still separate because I want to create different scenarios and gamemodes that are not tied in together as separate downloads that are independent of each other. but the resource pack is to be the core of any of the rest of the scenarios if that makes sense.
I also plan to use units from another add-on so how would I make sure there aren't any issues with that as well?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Activate dependencies

Post by Ravana » October 20th, 2019, 8:44 pm

Separate addons have separate preprocessing context. If you want to use macros defined in addon A from addon B then addon B must {include} something from addon A which defines those macros.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Activate dependencies

Post by LordAwsomeness » October 20th, 2019, 8:47 pm

what would that look like? How would I do that? I defined the file that is needed that I use as the mother file for all of my macros and utils. It has all of the paths for each other file in Addon B that addon A needs
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Activate dependencies

Post by Ravana » October 20th, 2019, 8:57 pm

Then include the file before you need content of those macros.
Example https://github.com/doofus-01/wesnoth-Tr ... in.cfg#L17

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Activate dependencies

Post by LordAwsomeness » October 20th, 2019, 9:33 pm

Ravana wrote:
October 20th, 2019, 8:57 pm
Then include the file before you need content of those macros.
Example https://github.com/doofus-01/wesnoth-Tr ... in.cfg#L17
hmm I did something similar. Idk what the difference is but I am still not getting it to work. here is a copy of my code:

Code: Select all

[binary_path]
path=data/add-ons/LA_MP_Pack
[/binary_path]
#ifdef MULTIPLAYER

{~add-ons/LA_RPG_Maps/scenarios/LA_RPG_RTG.cfg}

#ifhave ~add-ons/LA_MP_Pack/LA_RPG_Era.cfg
{~add-ons/LA_MP_Pack/utils/paths.cfg}
{~add-ons/LA_MP_Pack/LA_RPG_Era.cfg}
{LA_MP_PATHS}
#endif

#endif
the scenario works fine until I try and use a macro from the other add-on
Last edited by LordAwsomeness on October 20th, 2019, 9:38 pm, edited 1 time in total.
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Activate dependencies

Post by Ravana » October 20th, 2019, 9:36 pm

Include the file before you need content of those macros.

Currently {~add-ons/LA_RPG_Maps/scenarios/LA_RPG_RTG.cfg} is before {~add-ons/LA_MP_Pack/utils/paths.cfg}.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Activate dependencies

Post by LordAwsomeness » October 20th, 2019, 9:39 pm

yep that worked :doh:
thank you so much!

How would I do the same for units from a different add-on?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Activate dependencies

Post by Ravana » October 20th, 2019, 9:43 pm

In MP units are global, so nothing to do. Never worked with campaigns.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Activate dependencies

Post by LordAwsomeness » October 20th, 2019, 9:53 pm

Ravana wrote:
October 20th, 2019, 9:43 pm
In MP units are global, so nothing to do. Never worked with campaigns.
okay so as long as they are installed they should work without any major issues?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Celtic_Minstrel
Developer
Posts: 1529
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Activate dependencies

Post by Celtic_Minstrel » October 21st, 2019, 12:26 am

If you wanted to include units from a different campaign you'd probably need to include that campaign's units directory in your campaign's `[units]` tag.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
josteph
Developer
Posts: 738
Joined: August 19th, 2017, 6:58 pm

Re: Activate dependencies

Post by josteph » October 21st, 2019, 4:43 am

Don't forget the unit's sprites, portraits, and attack icons.

User avatar
Celtic_Minstrel
Developer
Posts: 1529
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Activate dependencies

Post by Celtic_Minstrel » October 22nd, 2019, 12:34 am

Yeah, for that you'd need to add a [binary_path] tag referencing the campaign as well.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Activate dependencies

Post by LordAwsomeness » October 27th, 2019, 3:09 am

Celtic_Minstrel wrote:
October 21st, 2019, 12:26 am
If you wanted to include units from a different campaign you'd probably need to include that campaign's units directory in your campaign's `[units]` tag.
awesome!! Thank you so much for your help!
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

Post Reply