Linking Macro files
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.
Linking Macro files
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:
The macro in question. I had an error in there but could not find any more and the error message remains.
I tried to search ReferenceWML and the forums but couldn't find any solution.
Thank you very much.
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}
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
Thank you very much.
Re: Linking Macro files
{~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.
Re: Linking Macro files
Hurrah! The error message changed!
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.
Makes sense.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.
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.