Guide on exporting buildings from the game
This text describes a feature added to Millénaire in version 1.7.6 that enables the player to export buildings created in-game as PNG building files in the format described in the main building-making guide.
As per version 2.4.6, the import/export system has changed quite a bit. Before this, it only used the Village wand to do all the tasks. Now you need the Village wand to import buildings and the Wand of Negation to export buildings.
If you are interested in importing or exporting your building in a Millenaire version older than 2.4.6, then you should check the old guide, located at Guide on exporting buildings from the game (old).
Please take note, that the in-game messages might be a bit confusing, at least, all the way up to version 2.7.4. This is because the messages of the import functions have some textual errors in them. This will be explained later on.
Creating a plan
With the addition of the Wand of Negation, exporting has become quite simple and intuitive. After you've created your building, you need to place a (free standing) sign at the north-west corner of your building. North-west in this case, would be like how it is in real life, where the sun is rising in the east. (This is unlike how it was in the old system, where you had to obey the Minecraft north.)
On the first line of the sign, enter the name of the building plan. This will be the filename of your building plan and doesn't need to be the real in game name, but is more of a system name if you will.
The second line seems to have no function for exporting.
On the third line, you can specify the lowest level of your building. This is optional though. The default is -1 meaning that is saves only one block beneath the sign, so if you want to include a basement or other kind of underground structure then make sure the block where the sign is placed is exactly one block above where you want to save.
With Millénaire version 2.7.8, the fourth line now also serves a function for exporting. If you write the word 'snow' on it, then any snow present in/on the building will be preserved.
That's all you need to do on the first sign.
Now place two more signs, one on the southern edge of your building and one on the eastern edge of your building, again according to the real-life north, east, south and west. Make sure that they are within a straight line to the original sign and should probably be on the same height as well. These signs do not need any text on them. The only condition is that they are within 256 blocks of your main sign. This limit is hard-coded and does mean that your buildings can never be bigger than 256 x 256 blocks.
Now, head back to the first sign and use the Wand of Negation on it.
If all went well, it will give you a message "Exported building as <name>_A<number>.png". The corresponding plan is now located in millenaire-custom/exports. If this was the first upgrade level of that building, then Millenaire has also created a similarly named text file for you in the same directory. In there, you can set stuff like the building's native name and English name and such.
Handling of upgrades
If a building plan of the name indicated already exists in the exports directory, Millénaire will generate a building upgrade instead, by exporting only differences found between the building in-game and the plans previously exported.
Limits of the tool
Note: This section is copied over from the old guide and hasn't been tested if it's still true.
It is not possible to set "active" block types using the exporter (like the main chest, the standing position, spawn points...). Those must be added manually to the PNG file. Also, extra settings in the text file (like NPC types residing in the building) have to be added by hand.
"Blocks" that have to be set manually with correstponding name in blocklist.txt (possibly incomplete):
- Main chest: Every Millenaire specific chest within the building. Exported chests won't work (mainchest)
- Signs: The signs in a townhall. Exported signs won't work (signwall<orientation>)
- Sleeping Position: Building without a sleeping Position don't seem to be populated upon village creation. Behaviour when built unknown (sleepingPos)
"Blocks" that seem to be optional to be set (maybe someone can add the missing info/check the unsure info?)
- Selling Position: The position you have to reach to call a trader (sellingPos)
- Defence Position: Probably the position where the village defenders gather? (defendingPos)
- Shelter Position: Probably the position where women and chidren gather during raid? (shelterPos)
- Path start position: Probably the position where a connecting path would start? (pathStartPos)
- Crafting position: Unknown (craftingPos)
- Leasure position: Unknown (leasurePos)
To add these to your building.png plan, simply check blocklist.txt for the color value of the given name, and add a pixel with that color at the desired position wihtin your .png plan.
Importing a plan
In a similar way to the exportation of plans, you can import a plan from millenaire-custom/exports (simply copy a building plan from one of the existing cultures to be able to import it). With the current system, you can use the same sign you've used before. For importing, you will need to use Village wand instead of the Wand of Negation.
Simply place down a sign on the ground where you want the north-west corner of your building to be. The text that you can place on the sign is as follows.
On the first line, put the building's name. If you are unsure on what the name is, simply use the name of the text file of the building you're going to import and strip off the "_A.txt" part.
On the second line, you can specify the upgrade level you want of the building. If you do not give any, then it will use the initial construction, or level 0.
On the third line, the importer only checks for "x2". If it isn't there, then it ignores anything that is on that line. What x2 does, is double the height of the building, doubling every layer it encounters in the building plan. Be careful though, the x2 tag does not seem to be supported by the export function, so leaving it in place and using the Wand of Negation might throw you an error message.
When you're done, use the Village wand on the sign and your building should appear out of thin air.
If it doesn't, you will most like get an error message. These will be explained in the section below.
A list of possible error messages you may encounter while using the import/export system and how to fix them. If you get a message in game while using the Wand of Negation, go to the Exporting section below. If you get an in game message while using the Village wand, go to the Importing section below. If nothing seems to happen while you use any of the wands to import or export, and you don't get a message in game, but do notice a message in the millenaire.log file, then try the Logfile section.
You must give the building plan's name on the first line.
You haven't specified a name for the building on the first line of your sign. Simply add a (valid) name and you should be ok.
Could not find the closure sign to the east. It must be in a straight line from the starting one within 256 blocks. Could not find the closure sign to the south. It must be in a straight line from the starting one within 256 blocks.
You forgot to put an empty sign at either the east and/or the south end of the building. If you think you did, keep in mind that Millenaire currently seem to obey the real life rules on what's north etc. East will be where the sun rises in game.
Another possible cause can be that the closure signs are not in a straight line or on the same height as the main sign, or even too far away. To verify this, open up the coordinates with (shift-)F3 and write them down for the main sign as well as the closing signs.
For the eastern closure sign, the only coordinate that should be different from the main sign, is the x-coordinate, which should be higher. The rest should stay the same. For the southern closure sign, the only coordinate that should be different from the main sign, is the z-coordinate, which should be higher at the closure sign. The rest should stay the same. Also, they must be within 256 blocks of the main sign.
The detected length is #1 but there is an existing building plan in the export folder of length #2. The detected width is #1 but there is an existing building plan in the export folder of width #2.
When you get this message, the game has detected a different version of a building with the same name as you are using. However, the size, which is determined by the closure signs, is different.
To export a building with the same name is not a problem on itself. Millenaire treats that building a higher upgrade level of the building that it has on file. However, to not have the building being built into adjacent buildings, the area it needs in its biggest form needs to be known first. This is purely so that Millenaire reserves enough space for possible future upgrades. To make sure that your custom building obeys this, Millenaire checks the dimensions to the dimensions of the initial construction, level 0.
To fix this error, you have two possible options. The first is to match the size of the level 0 version of the building. Simply use the second number, #2 in the message, as the size you need.
Another possible solution might be to import the initial version of the building and adjust its sizes to accommodate the new sizes and then export it. Chances are though, for this to work, that you will need to erase all (level 0?) data of the building. This is all at your own risk. Make backups first, try it, and adjust this wiki to make this info correct or erase this part if it breaks everything that is dear to you.
Invalid starting level on line three of the sign.
The starting level you've specified on the third line of the sign is not a valid number. This generally happens when you have something else than an integer number on the third line. For example, the x2 option of the import can cause this. Simply use a valid integer and this error should disappear.
Be aware though, Millenaire only seems to check for a valid integer. This can be any whole number between -2,147,483,648 and 2,147,483,647. However, using big numbers can bring dangers with it, like saving the void to the building plan and such. Results may be unpredictable when exporting or importing with high numbers, so try to keep it sane.
No starting level specified, defaulting to -1.
This isn't an error message. Millenaire purely informs you that it found the third line on the sign to be empty. Therefor it uses the default -1 level to export your building.
Unknown (Edited misspell) block type: ...
For some reason Millenaire encountered a block in your building that is unknown to it. Try searching your building for blocks that aren't part of vanilla Minecraft or Millenaire and see if removing those fixes this problem.
Exported building as ...
Congratulations! This message means you've successfully exported your building.
You must give the building plan's name on the second line.
The error message itself is incorrect and should read "You must give the building plan's name on the first line.". Millenaire will give you this message when you have not specified a building name at all or not on the correct line of the import sign. The (system)name of the building needs to be on the first line of your import sign. When you have it there, this error message will also disappear.
Note: The reason it is saying second line (at least up to version 2.7.4) instead of first, has to do with the old system. Prior to 2.4.6, you had to put the word import on the first line and the building name on the second line.
The building requested is not present in millenaire-custom/exports
The building name that you've put on the first line of the main sign does not match any of the names in the exports folder. To double check that you did it right, go into the exports folder and look up the name of the text file of the building you want to import. Strip off the _A.txt part at the end and what's left over is the name that you need to use. Put this name on the first line of your import sign.
For those who are used to the old system, do not use import on the first line and the building name on the second line. This is no longer needed since version 2.4.6.
Building up to level ...
This message isn't an error, and it will only display if you have specified a custom upgrade level on the second line of the import sign. What it means is that Millenaire has found the building you wanted to import and is going to try to build it at the upgrade level you specified.
Invalid upgrade level on line three of the sign.
This error will appear when you have not put a valid integer value on line two of the import sign. The message will say line three, but this is still from the older system, it actually means line two. Nonetheless, if you've written anything on line two of the sign, it must be a valid whole number between -2,147,483,648 and 2,147,483,647. Later on, it will check if the number is actually an existing upgrade level, so in the end this number needs to be a whole number of at least 0.
No upgrade level specified, building only the initial stage.
Just an informational message that you did not specify an upgrade level. Therefor, Millenaire will import the level 0 version of the building.
Requested upgrade level is higher than available.
The upgrade level you've specified on line two of the import sign is higher than any upgrade level that Millenaire can find. Keep in mind that the initial construction or version of the building is actually level 0 and not 1. The first upgrade is level 1, the second 2, etc. To find out what the highest possible number is for the building you are importing, go to your exports folder and look up the files of the building that end with png. The last part of that file name generally says something like _A#.png, where # is a number. The highest number you'll see, is the highest possible number you can use on the second line of the import sign.
Doubled vertical height
You've enabled the double vertical height option by putting "x2" on the third line of the import sign. This message simply informs you of this and that it will build the building twice as high.
Building level: ...
Congratulations, you've successfully imported your building, or at least, as far as the import function concerns. This message is purely informational, and will display for each upgrade level that Millenaire is importing.
The following error(s) are not displayed in game, but only in the Millenaire log file, located in the Millenaire directory. An example version of each error is displayed inside the 'spoiler' box, with the title having the keywords of the error.
Error when importing a building - No file found for building ....
2.7.4 30-05-2012 13:16:21 !====================================! 2.7.4 30-05-2012 13:16:21 Error when importing a building: 2.7.4 30-05-2012 13:16:21 MLN$MillenaireException: No file found for building testbuildingA at MLBuildingPlan$BuildingPlanSet.loadPictPlans(MLBuildingPlan.java:823) at MLBuildingPlan.importBuilding(MLBuildingPlan.java:1513) at MLGood$ItemSummoningWand.a(MLGood.java:514) at aan.a(SourceFile:88) at aes.a(PlayerControllerSP.java:223) at net.minecraft.client.Minecraft.c(Minecraft.java:1352) at net.minecraft.client.Minecraft.k(Minecraft.java:1794) at net.minecraft.client.Minecraft.x(Minecraft.java:819) at net.minecraft.client.Minecraft.run(Minecraft.java:747) at java.lang.Thread.run(Unknown Source) 2.7.4 30-05-2012 13:16:21 ====================================
This error occurs when Millenaire does find the .txt-file for the specific building, but no actual building plans. The building plans are the .png image files. To fix it, either restore the building plan image files from a backup or consider your previous work on that building lost and simply erase the text file of the building.