Line 115: |
Line 115: |
| | | |
| (If you use xnbcli to [[Modding:Editing XNB files#Unpack game files|unpack the original game maps]], you'll need the <tt>.tbin</tt> plugin even if you plan to use <tt>.tmx</tt> since xnbcli still produces <tt>.tbin</tt> files.) | | (If you use xnbcli to [[Modding:Editing XNB files#Unpack game files|unpack the original game maps]], you'll need the <tt>.tbin</tt> plugin even if you plan to use <tt>.tmx</tt> since xnbcli still produces <tt>.tbin</tt> files.) |
| + | |
| + | ===Tilesets vs Tilesheets=== |
| + | |
| + | <tt>Tilesheets</tt> are the <tt>.png</tt> files used as source images. Tilesheets have no animation, properties, terrains, or anything else but pixels associated with them -- they're just images. <tt>Tilesets</tt> are Tiled's XML files that contain all the information about how the map uses the source image. They are confusingly named and often used interchangeably. |
| | | |
| ==Map edits== | | ==Map edits== |
Line 124: |
Line 128: |
| # Open the <tt>.tbin</tt> or <tt>.tmx</tt> file via Tiled. Note: make sure the file is in the same folder as the unpacked tilesheets! | | # Open the <tt>.tbin</tt> or <tt>.tmx</tt> file via Tiled. Note: make sure the file is in the same folder as the unpacked tilesheets! |
| # Make your changes. | | # Make your changes. |
− | # Save the file. Don't use <tt>Save as</tt>, as it can corrupt the map. | + | # Save the file. Don't use <tt>Save as</tt> to change folders, as your tilesheet paths will be wrong. |
| # Move the <tt>.tbin</tt> or <tt>.tmx</tt> file, and any custom tilesheets it needs, to your mod release folder. Place them in the <tt>assets</tt> folder. | | # Move the <tt>.tbin</tt> or <tt>.tmx</tt> file, and any custom tilesheets it needs, to your mod release folder. Place them in the <tt>assets</tt> folder. |
| # Load your map via SMAPI or Content Patcher (or another framework mod). | | # Load your map via SMAPI or Content Patcher (or another framework mod). |
Line 135: |
Line 139: |
| {{note box|'''Using Content Patcher to add custom locations is strongly recommended.'''<br />You can add new locations in C# yourself, but be aware of factors like object persistence and NPC pathfinding that are easy to get wrong. If you ''really'' want to do it yourself, use the [[Modding:Modder Guide/APIs/Events#Specialised.LoadStageChanged|specialized <tt>LoadStageChanged</tt> event]] to add the location to <tt>Game1.locations</tt> during the <tt>CreatedInitialLocations</tt> or <tt>SaveAddedLocations</tt> stage.}} | | {{note box|'''Using Content Patcher to add custom locations is strongly recommended.'''<br />You can add new locations in C# yourself, but be aware of factors like object persistence and NPC pathfinding that are easy to get wrong. If you ''really'' want to do it yourself, use the [[Modding:Modder Guide/APIs/Events#Specialised.LoadStageChanged|specialized <tt>LoadStageChanged</tt> event]] to add the location to <tt>Game1.locations</tt> during the <tt>CreatedInitialLocations</tt> or <tt>SaveAddedLocations</tt> stage.}} |
| | | |
− | ===Custom tilesheet=== | + | ===Adding tilesets=== |
− | You can add custom sprites, tiles, or images to a map. Be sure to [[#Tilesheet order|prefix custom tilesheet IDs with <code>z_</code>]] to avoid shifting the vanilla tilesheet indexes. | + | You can add new sprites, tiles, or images to a map, from both custom and vanilla sources. If you're editing a vanilla map, make sure to [[#Tilesheet order|prefix custom tileset names with <code>z_</code>]] to avoid shifting the vanilla tilesheet indexes. |
| + | |
| + | # Open the map that you created or are editing. |
| + | # Click <tt>Map</tt> then ''Add External Tileset...'' in the top menu, and open a <tt>.tsx</tt> file you have in the same folder. |
| + | # You should have a new copy of the tileset in your map, with any saved animations, properties, or terrains still intact. |
| + | |
| + | ====Re-using vanilla tilesets==== |
| + | If you want to use a tilesheet like <tt>spring_outdoorsTileSheet.png</tt> in your map, adding a new tileset from a <tt>.png</tt> file means you need to re-animate any animated tiles, re-add properties like diggable and terrain types. You can avoid this by first exporting them from an existing map, then using external tilesets, instead. |
| + | |
| + | # Open an existing map that already has the properties and animations you want. |
| + | # In the tileset pane, click the wrench to ''Edit Tileset''. It should open a new edit tab. |
| + | # In the new window that opens, click ''File'', then ''Export as...'' and save it as a .tsx file. |
| + | # Close the tileset editor. |
| + | |
| + | ====Replace existing tileset==== |
| + | |
| + | If you are already using a tilesheet image, you can replace its tileset. |
| + | # Open the map that you created or are editing. |
| + | # In the tileset pane on the right, click the tab for your existing version. |
| + | # Under that, click the ''Replace Tileset'' button. |
| + | # Choose the <tt>.tsx</tt> file you saved, and click Open. |
| + | |
| + | ====Adding a new custom tilesheet==== |
| + | If you made a your own tilesheet and are adding it to a map the first time, you can create a new tileset from image. |
| | | |
| # Create your spritesheet and place it in the same folder as your <tt>.tbin</tt> or <tt>.tmx</tt> map file. This should be a PNG image with images divided into 16x16 tiles (see [[Modding:Editing XNB files#Intro]] for examples). | | # Create your spritesheet and place it in the same folder as your <tt>.tbin</tt> or <tt>.tmx</tt> map file. This should be a PNG image with images divided into 16x16 tiles (see [[Modding:Editing XNB files#Intro]] for examples). |
Line 145: |
Line 172: |
| ## Make sure that ''Embed in map'' is checked. | | ## Make sure that ''Embed in map'' is checked. |
| ## Keep the defaults for the other settings and click ''OK''. | | ## Keep the defaults for the other settings and click ''OK''. |
− | # Add custom sprites to the map:
| + | |
− | ## In the ''Layers'' pane, click the layer you want to edit.
| + | |
− | ## In the ''Tilesets'' pane, click the tab for your custom spritesheet. | + | ===Painting tiles onto your map=== |
− | ## In the ''Tilesets'' pane, click one tile to select it. To choose multiple, click and drag the cursor.
| + | |
− | ## Move the cursor to the map, and you'll see an overlay with the tiles you selected.
| + | # In the ''Layers'' pane, click the layer you want to edit. |
− | ## Click the map to place those tiles on the selected layer.
| + | # At the top left of Tiled's toolbar, click the Stamp Brush. |
| + | # In the ''Tilesets'' pane, click the tab for the tileset you want to use. |
| + | # In the ''Tilesets'' pane, click one tile to select it. To choose multiple, click and drag the cursor. |
| + | # Move the cursor to the map, and you'll see an overlay with the tiles you selected. |
| + | # Click the map to place those tiles on the selected layer. |
| | | |
| ===Map properties=== | | ===Map properties=== |
Line 1,134: |
Line 1,165: |
| * Discord user foggywizard#7430 [https://imgur.com/a/l1Ql16D annotated some screenshot guides for using Tiled]. These include an annotated overview, how to find where the coordinates are, and how to rename a tilesheet. | | * Discord user foggywizard#7430 [https://imgur.com/a/l1Ql16D annotated some screenshot guides for using Tiled]. These include an annotated overview, how to find where the coordinates are, and how to rename a tilesheet. |
| | | |
| + | <!-- |
| [[Category:Modding]] | | [[Category:Modding]] |
| | | |
| [[ru:Модификации:Карты]] | | [[ru:Модификации:Карты]] |
| + | --> |