"Macro/file . . . is missing"
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.
"Macro/file . . . is missing"
Me again. I expect I've messed up something very basic, but I'm flummoxed.
I am trying to create a very simple era. I slavishly copied and then cut down from another era I have, which itself is a slavish copy-and-edit of "A New Land Era." (That one works.)
Each time I try to load, I get the following error:
BfW version is 1.12.5.
_main.cfg was prepared using Microsoft's WordPad (which I've safely and consistently used with all of my other BfW editing).
Puzzled.
I am trying to create a very simple era. I slavishly copied and then cut down from another era I have, which itself is a slavish copy-and-edit of "A New Land Era." (That one works.)
Each time I try to load, I get the following error:
Here's the entire _main.cfg (It isn't so very long.)Macro/file '\f0\fnil\charset0' is missing
at ~add-ons\\Sif_Era\\_main.cfg:1
Code: Select all
#textdomain wesnoth-Sif_Era
[textdomain]
name="wesnoth-Sif_Era"
path="data/add-ons/Sif_Era/translations"
[/textdomain]
#ifdef MULTIPLAYER
[binary_path]
path=data/add-ons/Sif_Era/
[/binary_path]
{~add-ons/Sif_Era/era}
{~add-ons/Sif_Era/factions}
{~add-ons/Sif_Era/images}
{~add-ons/Sif_Era/macros}
{~add-ons/Sif_Era/units}
[+units]
{~add-ons/Sif_Era/units}
{~add-ons/Sif_Era/units/drach}
{~add-ons/Sif_Era/units/fee}
{~add-ons/Sif_Era/units/fisch}
{~add-ons/Sif_Era/units/klein}
{~add-ons/Sif_Era/units/machine}
{~add-ons/Sif_Era/units/mensch}
{~add-ons/Sif_Era/units/tier}
[/units]
#endif
#ifdef EDITOR
# I believe this section is necessary for single player campaigns.
[binary_path]
path=data/add-ons/Sif_Era/
[/binary_path]
{~add-ons/Sif_Era/era/}
{~add-ons/Sif_Era/factions/}
{~add-ons/Sif_Era/images/}
{~add-ons/Sif_Era/macros/}
{~add-ons/Sif_Era/units/}
[+units]
{~add-ons/Sif_Era/units/}
{~add-ons/Sif_Era/units/drach}
{~add-ons/Sif_Era/units/fee}
{~add-ons/Sif_Era/units/fisch}
{~add-ons/Sif_Era/units/klein}
{~add-ons/Sif_Era/units/machine}
{~add-ons/Sif_Era/units/mensch}
{~add-ons/Sif_Era/units/tier}
[/units]
#endif
#credits: Ruffian icon and portraits from core.
_main.cfg was prepared using Microsoft's WordPad (which I've safely and consistently used with all of my other BfW editing).
Puzzled.
Re: "Macro/file . . . is missing"
Hi stegyre, this is a odd error! It doesnt seem to reference anything from your era I have created many eras and never had this problem...
Are you sure the problem is with your era? Try removing your addon and then running wesnoth and see if you still get the error!
Hopefully you are able to find a solution! !
EDIT: Also instead of doing two sections #ifdef MULTIPLAYER and #ifdef EDITOR just put everything without any #ifdef that way it always loads and you dont have to write it twice
Are you sure the problem is with your era? Try removing your addon and then running wesnoth and see if you still get the error!
Hopefully you are able to find a solution! !
EDIT: Also instead of doing two sections #ifdef MULTIPLAYER and #ifdef EDITOR just put everything without any #ifdef that way it always loads and you dont have to write it twice
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: "Macro/file . . . is missing"
Thanks for the tip. For the record, I appreciate all feedback.
I think my WordPad file may have been corrupted. By copying my working _main.cfg (from SANLEra) and then copy-pasting everything from my original _main.cfg (Sif_Era) into that one and making it the new Sif_Era _main.cfg, I eliminated that era (and moved on to other errors, which I am working through).
EDIT: Okay! I have an exceedingly-rudimentary but working Era, now. Time to start messing around and create a whole new set of errors.
For the record, I think the error I was getting is some sort of corruption in the WordPad file. (MS WordPad, Windows 10.) I lack the ability to verify that, but the work-around – copying a WordPad file from a working era and then pasting my text into it – seems to work, after having implemented it three different times on three different files. (Maybe that info will be useful to someone else; maybe not.)
I think my WordPad file may have been corrupted. By copying my working _main.cfg (from SANLEra) and then copy-pasting everything from my original _main.cfg (Sif_Era) into that one and making it the new Sif_Era _main.cfg, I eliminated that era (and moved on to other errors, which I am working through).
EDIT: Okay! I have an exceedingly-rudimentary but working Era, now. Time to start messing around and create a whole new set of errors.
For the record, I think the error I was getting is some sort of corruption in the WordPad file. (MS WordPad, Windows 10.) I lack the ability to verify that, but the work-around – copying a WordPad file from a working era and then pasting my text into it – seems to work, after having implemented it three different times on three different files. (Maybe that info will be useful to someone else; maybe not.)
Re: "Macro/file . . . is missing"
I'm glad you were able to solve your problem!! Also for editing i usually use notepad, and haven't had any problems.stegyre wrote:Thanks for the tip. For the record, I appreciate all feedback.
I think my WordPad file may have been corrupted. By copying my working _main.cfg (from SANLEra) and then copy-pasting everything from my original _main.cfg (Sif_Era) into that one and making it the new Sif_Era _main.cfg, I eliminated that era (and moved on to other errors, which I am working through).
EDIT: Okay! I have an exceedingly-rudimentary but working Era, now. Time to start messing around and create a whole new set of errors.
For the record, I think the error I was getting is some sort of corruption in the WordPad file. (MS WordPad, Windows 10.) I lack the ability to verify that, but the work-around – copying a WordPad file from a working era and then pasting my text into it – seems to work, after having implemented it three different times on three different files. (Maybe that info will be useful to someone else; maybe not.)
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: "Macro/file . . . is missing"
My issue with Notepad is that it does not display line breaks and indentations. I'd open a file in Notepad and find it impossible to read. I was delighted to find WordPad fixed this.
Re: "Macro/file . . . is missing"
Yeah i have the exact same problem, it really makes it impossible to read But what i do is open the file in wordpad and just hit the save button. After it is saved using wordpad when i open it in notepad it is formatted correctly. Alternatively for some files where that doesn't work i just select all of the text in wordpad and paste it into notepad.stegyre wrote:My issue with Notepad is that it does not display line breaks and indentations. I'd open a file in Notepad and find it impossible to read. I was delighted to find WordPad fixed this.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: "Macro/file . . . is missing"
For windows I suggest using notepad++.
Re: "Macro/file . . . is missing"
New problem: I'm creating a series of AMLA choices, and I cannot get the images to display. Everything else about the advancements appears to be working properly. This is purely a cosmetic issue, but it highlights my lack of understanding. The icons I am using have been copied over from core into my own ~images/icons folder. (I like to have my content "on board" as much as possible.) When the table comes up for advancing a unit, however, the game shows the "Image not found" icon for the first option and the unit's own icon for the second. (The icons are supposed to be the boots_elven.png and steel_armor.png.)
Here's the relevant code. (I've put them into macros.) Let me know if you need to see more:
For what it's worth, I've tried all variations of with and without the tilde (~) and with or without quotation marks (e.g., image="icons/boots_elven.png"), as I seem to see examples of both in other's work.
Here's the relevant code. (I've put them into macros.) Let me know if you need to see more:
Code: Select all
#define FASTER
id=faster
always_display=true
image=~icons/boots_elven.png
description= _ "Gain an additional move point."
***
#enddef
#define ARMORED
id=armored
always_display=true
image=~icons/steel_armor.png
description= _ "Equip plate mail, increasing all resistances but reducing movement."
***
#enddef
Re: "Macro/file . . . is missing"
I also suggest Notepad++. You can use WordPad or similar, but you always have to make sure that you're really saving as a plaintext document or else you run into the above issues.
Re: "Macro/file . . . is missing"
Doesn't sound possible; even if you don't have a [binary_path] (the kind every add-on with custom images/sounds/music needs) to help the game find your version of the image, then image="icons/boots_elven.png" is still the correct path to the core version of that image and thus you should see that in-game. Remember that you can't just load an existing save and have all kinds of changes to your WML automatically take effect in them; for example if you have a unit with those AMLAs, then existing units in existing saves still have the old version of the AMLA options within them and your updated code will only be seen in newly created units.stegyre wrote:For what it's worth, I've tried all variations of with and without the tilde (~) and with or without quotation marks (e.g., image="icons/boots_elven.png"), as I seem to see examples of both in other's work.
Also, distrust any code where you've seen ~ used in an image path like ~icons/steel_armor.png because that just simply doesn't make any sense.
Re: "Macro/file . . . is missing"
Hmm... Thats oddstegyre wrote:For what it's worth, I've tried all variations of with and without the tilde (~) and with or without quotation marks (e.g., image="icons/boots_elven.png"), as I seem to see examples of both in other's work.
image=icons/boots_elven.png
always works for me. Maybe your images aren't being loaded correctly? For example i have a add-on that uses:Code: Select all
[advancement]
id=WoseAd1
max_times=4
description= _ "A stronger Wose"
image=attacks/crush-wose.png
[effect]
apply_to=attack
range=melee
increase_damage=1
[/effect]
[effect]
apply_to=max_experience
increase=5
[/effect]
[effect]
apply_to=hitpoints
increase_total=5
heal_full=yes
[/effect]
[/advancement]
Like zookeeper says i dont see why your images arent loading!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: "Macro/file . . . is missing"
Still working on this. Thanks for the comments.
Assuming that my images aren't loading, how would I check this?
I do have the [binary_path] coding in my _main.cfg, and it (otherwise) appears to work properly (i.e., the other things I've included, such as Sif_Era.cfg, are loading properly - as nearly as I can tell). For reference, here's my relevant code:zookeeper wrote:Doesn't sound possible; even if you don't have a [binary_path] (the kind every add-on with custom images/sounds/music needs) to help the game find your version of the image, then image="icons/boots_elven.png" is still the correct path to the core version of that image and thus you should see that in-game.
Code: Select all
[binary_path]
path=data/add-ons/Sif_Era/
[/binary_path]
{~add-ons/Sif_Era/Sif_Era.cfg}
{~add-ons/Sif_Era/era}
{~add-ons/Sif_Era/factions}
{~add-ons/Sif_Era/images}
{~add-ons/Sif_Era/macros}
{~add-ons/Sif_Era/units}
Between each change, I exit all the way out of Wesnoth and restart. In fact, as WordPad won't let me save changes while the game is running, I'm forced to do so. Also, each time I start a new MP scenario.Remember that you can't just load an existing save and have all kinds of changes to your WML automatically take effect in them; for example if you have a unit with those AMLAs, then existing units in existing saves still have the old version of the AMLA options within them and your updated code will only be seen in newly created units.
Spoiler:
This gives me pause, because the tilde is used in the code I've quoted above, where it seems to work as I thought it was supposed to. That is, the tilde means "take everything from the current (or default) directory[ies] and add this additional path." So image=~icons/icon_name.png would mean, "find the 'icons' folder in the 'images' directory where you already look by default for any image; you will find icon_name.png there." What is it I am misunderstanding?Also, distrust any code where you've seen ~ used in an image path like ~icons/steel_armor.png because that just simply doesn't make any sense.
Assuming that my images aren't loading, how would I check this?
Re: "Macro/file . . . is missing"
The best way to solve problems like this is to systematically narrow them down. First isolate the problem.stegyre wrote: This gives me pause, because the tilde is used in the code I've quoted above, where it seems to work as I thought it was supposed to. That is, the tilde means "take everything from the current (or default) directory[ies] and add this additional path." So image=~icons/icon_name.png would mean, "find the 'icons' folder in the 'images' directory where you already look by default for any image; you will find icon_name.png there." What is it I am misunderstanding?
Assuming that my images aren't loading, how would I check this?
Change a unit and see if his image is loading-> if it isn't you know you problem is images loading. -> if it is loading then try changing his image to be the icon you want in your game. -> if that works then you know it must be your AMLA that isn;t working
Continue doing this until you know exactly what the problem iss!!
Otherwise, since It is very hard to tell what your problem is without seeing your add-on, if you want you can upload it and attach it as a archive (i recommend using 7zip). Then i can have a look and see what exactly is not working.
Hopefully this helps!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: "Macro/file . . . is missing"
The tilde simply doesn't do anything. If it seems to work for you, then that's simply because the game silently ignores it (I'd be surprised if it did, though).stegyre wrote:This gives me pause, because the tilde is used in the code I've quoted above, where it seems to work as I thought it was supposed to. That is, the tilde means "take everything from the current (or default) directory[ies] and add this additional path." So image=~icons/icon_name.png would mean, "find the 'icons' folder in the 'images' directory where you already look by default for any image; you will find icon_name.png there." What is it I am misunderstanding?Also, distrust any code where you've seen ~ used in an image path like ~icons/steel_armor.png because that just simply doesn't make any sense.
What image=icons/icon_name.png means is "try to find images/icons/icon_name.png in any and all directories which have been [binary_path]ed (+the core image directories)". That's how all image/sound/music file references work.
Re: "Macro/file . . . is missing"
Sooooooo, want to hear a funny story? Turns out, when they say, "Unit IDs must be unique," they really, really mean it. Turns out the problem was all of my own making, in a way that no one (without access to my own BfW files) would be able figure out.
On the plus side, I have learned from the responses. First prize goes to Zookeeper: the tilde, indeed, should not be used. Once I had corrected the real problem (spoilered for length), the tilde kept the game from finding the images. Tilde removed, problem fixed.
Watch this space! I'm sure my next mistake is just around the corner.
Thanks for the help, guys. Turns out even an answer like, "No, we really cannot see anything wrong with this code," helps.
On the plus side, I have learned from the responses. First prize goes to Zookeeper: the tilde, indeed, should not be used. Once I had corrected the real problem (spoilered for length), the tilde kept the game from finding the images. Tilde removed, problem fixed.
Spoiler:
Thanks for the help, guys. Turns out even an answer like, "No, we really cannot see anything wrong with this code," helps.