Linking Macro files

The place to post your WML questions and answers.

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.
Post Reply
kobe
Posts: 24
Joined: July 23rd, 2009, 1:17 pm
Location: Germany

Linking Macro files

Post by kobe »

Hello,

while working on an scenario of mine I used a macro for the first time. When loading the scenario for multiplayer, I get an error that the "Macro/file IS_SPAWN_FREE is missing". How do I properly link the macro file? It is in utils.

The _main.cfg has the following line to link it:

Code: Select all


{~add-ons/A_Addon_Test/scenarios}
{~add-ons/A_Addon_Test/utils}

The macro in question. I had an error in there but could not find any more and the error message remains.

Code: Select all

#textdomain wesnoth-A_Addon_Test

# checks if no units hostile to side are in a radius around x,y

#define IS_SPAWN_FREE LOC RADIUS SIDE
	[not]
		[have_unit]
			[filter_location]
				location_id={LOC}
				radius={RADIUS}
			[/filter_location]
			[filter_side]
				[enemy_of]
					side={SIDE}
				[/enemy_of]
			[/filter_side]
		[/have_unit]
	[/not]
#enddef
I tried to search ReferenceWML and the forums but couldn't find any solution.

Thank you very much. :)
User avatar
Ravana
Forum Moderator
Posts: 3066
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Linking Macro files

Post by Ravana »

{~add-ons... is not linking, it is telling wesnoth to take data from there and put into current line. The instructions are carried out in the order written, so if {~add-ons/A_Addon_Test/scenarios} depends on {~add-ons/A_Addon_Test/utils} then {~add-ons/A_Addon_Test/utils} needs to be in earlier line.
kobe
Posts: 24
Joined: July 23rd, 2009, 1:17 pm
Location: Germany

Re: Linking Macro files

Post by kobe »

Hurrah! The error message changed! :D
Ravana wrote: May 7th, 2024, 9:34 pm {~add-ons... is not linking, it is telling wesnoth to take data from there and put into current line. The instructions are carried out in the order written, so if {~add-ons/A_Addon_Test/scenarios} depends on {~add-ons/A_Addon_Test/utils} then {~add-ons/A_Addon_Test/utils} needs to be in earlier line.
Makes sense.

Didn't know it was order dependent...
I thought it just tells wesnoth where everything is and only after that it "compiles" the files.

Sorry for my poor english and thank you very much for the fast answer. :D
Post Reply