CreateCustomTemplates

From CivCraft Wiki
Jump to: navigation, search

Overview[edit | edit source]

If you're an admin running a CivCraft server, you may want to be able to create custom templates. Since custom templates are usually cosmetic, you can sell them as perks to users to help support server costs.

Exporting Templates With WorldEdit[edit | edit source]

All templates are exported by using the WorldEdit plugin's scripting abilities. Provided with the civcraft release under the templates folder is a file called "export.js" which contains a worldedit script that will export your selections into the .def file format. To use it, first set up worldedit's javascript engine by following the guide here: http://wiki.sk89q.com/wiki/WorldEdit/Scripting

Once the scripting engine is setup, place the export script inside the worldedit scripts directory, select the area you wish to export as a template, and type: /cs export <structure>_<direction>.def where <structure> is the name of the structure you're exporting and <direction> is the direction you're currently exporting.

Each template needs to be exported in the north, south, east, and west directions. Typically, a structure is oriented so that the front door faces the player when exported in that direction. For example, if you push F3 and it says you are facing EAST, the building's front doors should be on the WEST side.

Template Command Signs[edit | edit source]

Each building in CivCraft requires special locations to be marked in order for the buildings to function properly. For example, a bank must have each of the sell signs marked and placed inside the structure. Some command signs translate directly into signs the player can interact with, while other signs are used to mark special locations such as respawn points, turret locations, item frame locations, etc.

Each sign has the following information on it: First Line: /<command_name> Other Lines: Optional Key-value pair

To figure out what you should put on your command signs, the best way is to follow the example of existing templates by copying the signs from our source template world. http://civcraft.net/files/template_world.tar.gz

(Edited 11/1/14) If you would like a detailed version, Download this file: https://www.mediafire.com/?4p1zhh76z1prwbr

Download the world and locate the structure you wish to make a new template for. Make sure you get every command sign on the source template set somewhere inside your new custom template. Otherwise you'll experience errors. Certain signs such as respawn points and revive points can be added as many times as you like provided there are at least one.

Limitations[edit | edit source]

The biggest limitation of the template system is that entities are not saved. This means paintings and item frames are not saved inside the template. Additionally WorldEdit's rotate function doesn't always rotate all objects correctly and it is your job to make sure that all of the blocks are rotated correctly before exporting a new template.

There is no size limitation to how big you can make templates, although we typically tried to keep them as 1x1 chunks, 2x2 chunks and 4x4 chunk grids. Making a template too large will however take a lot of memory and perhaps lag your server. Keep in mind that the speed at which a template builds is a function of the town's hammerrate, the building's hammer cost, and the number of blocks inside that template. If you create a very large template like 16x16 chunks and have a building with very low hammer costs, CivCraft will be forced to build a lot more blocks faster in order to build the structure on time which may cause severe lag when building.

See Also[edit | edit source]

Tutorials CivilizationCraft Defensive Structures War Items and Structures Civ & Town Structures Quest Structures Wonders Units Command Reference