Changes

Jump to navigation Jump to search
No change in size ,  04:43, 3 February 2021
move 'potential issues' to bottom
Line 832: Line 832:  
<small>¹ Tile properties are handled throughout the codebase using <tt>GameLocation::doesTileHaveProperty</tt>. Actions and touch actions are handled by <tt>GameLocation::performAction</tt> and <tt>GameLocation::performTouchAction</tt> respectively. Emote IDs are listed as <tt>Character</tt> constants.</small><br />
 
<small>¹ Tile properties are handled throughout the codebase using <tt>GameLocation::doesTileHaveProperty</tt>. Actions and touch actions are handled by <tt>GameLocation::performAction</tt> and <tt>GameLocation::performTouchAction</tt> respectively. Emote IDs are listed as <tt>Character</tt> constants.</small><br />
 
<small>² The <tt>T</tt> value (short for ''true'') is conventional, but any non-empty value will work too.</small>
 
<small>² The <tt>T</tt> value (short for ''true'') is conventional, but any non-empty value will work too.</small>
  −
==Potential issues==
  −
===Tilesheet order===
  −
When you replace a vanilla map, '''don't''' change the order or IDs of the original tilesheets. Prefix new tilesheet IDs with <code>z_</code> to avoid changing the original order.
  −
  −
; Why this causes problems
  −
: For example, let's say you replace a map which normally has these tilesheets in Tiled:
  −
: [[File:Tiled tileset order A.png|thumb|none|The original tilesheet order.]]
  −
  −
: When you add a new tilesheet, note that the order changes from ''[paths, untitled tile sheet]'' to ''[customSheet, paths, untitled tile sheet]'':
  −
: [[File:Tiled tileset order B.png|thumb|none|'''Wrong''' way to add a new tilesheet (changes the original order).]]
  −
  −
: If the game tries to access a tile from the first tilesheet, it will get it from <tt>customSheet</tt> instead of the expected <tt>Paths</tt> tilesheet. That can cause anything from visual glitches (e.g. showing the wrong tile images) to outright crashes (especially if the new tilesheet is smaller than the one it expected).
  −
  −
: To avoid that, always keep the original tilesheets in the same order and prefix new tilesheets with <code>z_</code> so they're added at the end:
  −
: [[File:Tiled tileset order C.png|thumb|none|Correct way to add a new tilesheet.]]
  −
  −
; How to fix a tilesheet ID
  −
: If you need to rename a tilesheet in Tiled:
  −
<gallery style="margin-left: 2em;">
  −
File:Tiled rename tileset A.png|In the tileset pane, click the tab for the tileset and then click the edit icon.
  −
File:Tiled rename tileset B.png|Click ''Tileset > Tileset Properties'' from the top menu to show the properties pane.
  −
File:Tiled rename tileset C.png|Change the name in the ''Name'' field.
  −
</gallery>
  −
  −
===Map-specific requirements===
  −
The game makes some assumptions about maps which may break for modded maps. These are the known issues:
  −
{| class="wikitable"
  −
|-
  −
! affected maps
  −
! issue
  −
|-
  −
| <tt>Maps/Farm</tt><br /><tt>Maps/Farm_Combat</tt><br /><tt>Maps/Farm_Fishing</tt><br /><tt>Maps/Farm_Foraging</tt><br /><tt>Maps/Farm_Mining</tt>
  −
| &#32;
  −
* The farm's <tt>Paths</tt> layer must have at least one tile with index 22 (grass spawn). This is used to initialise the grass code when the save is loaded, even if no grass is spawned.<ref>The grass sound is set in <tt>Grass::loadSprite</tt>, which is called from <tt>GameLocation::loadObjects</tt> if the <tt>Paths</tt> layer has tile index 22. (The game spawns a grass for each such tile, and later removes them.)</ref>
  −
|-
  −
| <tt>Maps/FarmHouse</tt>
  −
| &#32;
  −
* The two bed tiles where the player can walk must have two properties: <tt>Bed T</tt> (used to decide if the player is in bed) and <tt>TouchAction Sleep</tt>.
  −
* Deleting or changing the wallpapers and floors will cause a game crash.
  −
|-
  −
| <tt>Maps/SpouseRooms</tt>
  −
| &#32;
  −
* If you add or resize any tilesheet, you must also edit <tt>Maps/FarmHouse1_marriage</tt> and <tt>Maps/FarmHouse2_marriage</tt> to have the same changes (even if you don't make any other changes to the farmhouse). This is needed because the tilesheet references and sizes are stored as part of the map file.
  −
|}
  −
<small><references /></small>
  −
  −
==='Save as' in Tiled===
  −
When you use 'save as' in Tiled, never save into a different folder. That will change all the tilesheet references to point to the old folder, so it'll no longer work in-game. Instead, copy/move the map files to a different folder if needed.
  −
  −
===Locating tilesheets in Tiled===
  −
When a map tilesheet is missing, never use the locate option to use a tilesheet from a different folder. That will add a complex tilesheet path which won't work in-game. Instead copy the tilesheets into the same folder as the map, and reference them from there.
      
==Paths layer==
 
==Paths layer==
Line 956: Line 904:  
# In the [[Mutant Bug Lair]], debris spawn rate is reduced to 33% chance per day.
 
# In the [[Mutant Bug Lair]], debris spawn rate is reduced to 33% chance per day.
 
# Restriction can be overridden with <tt>forceLoadPathLayerLights</tt> map property.
 
# Restriction can be overridden with <tt>forceLoadPathLayerLights</tt> map property.
 +
 +
==Potential issues==
 +
===Tilesheet order===
 +
When you replace a vanilla map, '''don't''' change the order or IDs of the original tilesheets. Prefix new tilesheet IDs with <code>z_</code> to avoid changing the original order.
 +
 +
; Why this causes problems
 +
: For example, let's say you replace a map which normally has these tilesheets in Tiled:
 +
: [[File:Tiled tileset order A.png|thumb|none|The original tilesheet order.]]
 +
 +
: When you add a new tilesheet, note that the order changes from ''[paths, untitled tile sheet]'' to ''[customSheet, paths, untitled tile sheet]'':
 +
: [[File:Tiled tileset order B.png|thumb|none|'''Wrong''' way to add a new tilesheet (changes the original order).]]
 +
 +
: If the game tries to access a tile from the first tilesheet, it will get it from <tt>customSheet</tt> instead of the expected <tt>Paths</tt> tilesheet. That can cause anything from visual glitches (e.g. showing the wrong tile images) to outright crashes (especially if the new tilesheet is smaller than the one it expected).
 +
 +
: To avoid that, always keep the original tilesheets in the same order and prefix new tilesheets with <code>z_</code> so they're added at the end:
 +
: [[File:Tiled tileset order C.png|thumb|none|Correct way to add a new tilesheet.]]
 +
 +
; How to fix a tilesheet ID
 +
: If you need to rename a tilesheet in Tiled:
 +
<gallery style="margin-left: 2em;">
 +
File:Tiled rename tileset A.png|In the tileset pane, click the tab for the tileset and then click the edit icon.
 +
File:Tiled rename tileset B.png|Click ''Tileset > Tileset Properties'' from the top menu to show the properties pane.
 +
File:Tiled rename tileset C.png|Change the name in the ''Name'' field.
 +
</gallery>
 +
 +
===Map-specific requirements===
 +
The game makes some assumptions about maps which may break for modded maps. These are the known issues:
 +
{| class="wikitable"
 +
|-
 +
! affected maps
 +
! issue
 +
|-
 +
| <tt>Maps/Farm</tt><br /><tt>Maps/Farm_Combat</tt><br /><tt>Maps/Farm_Fishing</tt><br /><tt>Maps/Farm_Foraging</tt><br /><tt>Maps/Farm_Mining</tt>
 +
| &#32;
 +
* The farm's <tt>Paths</tt> layer must have at least one tile with index 22 (grass spawn). This is used to initialise the grass code when the save is loaded, even if no grass is spawned.<ref>The grass sound is set in <tt>Grass::loadSprite</tt>, which is called from <tt>GameLocation::loadObjects</tt> if the <tt>Paths</tt> layer has tile index 22. (The game spawns a grass for each such tile, and later removes them.)</ref>
 +
|-
 +
| <tt>Maps/FarmHouse</tt>
 +
| &#32;
 +
* The two bed tiles where the player can walk must have two properties: <tt>Bed T</tt> (used to decide if the player is in bed) and <tt>TouchAction Sleep</tt>.
 +
* Deleting or changing the wallpapers and floors will cause a game crash.
 +
|-
 +
| <tt>Maps/SpouseRooms</tt>
 +
| &#32;
 +
* If you add or resize any tilesheet, you must also edit <tt>Maps/FarmHouse1_marriage</tt> and <tt>Maps/FarmHouse2_marriage</tt> to have the same changes (even if you don't make any other changes to the farmhouse). This is needed because the tilesheet references and sizes are stored as part of the map file.
 +
|}
 +
<small><references /></small>
 +
 +
==='Save as' in Tiled===
 +
When you use 'save as' in Tiled, never save into a different folder. That will change all the tilesheet references to point to the old folder, so it'll no longer work in-game. Instead, copy/move the map files to a different folder if needed.
 +
 +
===Locating tilesheets in Tiled===
 +
When a map tilesheet is missing, never use the locate option to use a tilesheet from a different folder. That will add a complex tilesheet path which won't work in-game. Instead copy the tilesheets into the same folder as the map, and reference them from there.
    
[[Category:Modding]]
 
[[Category:Modding]]
translators
8,461

edits

Navigation menu