Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

Platonymous

Uploaded by

Platonymous

Virus scan

Safe to use

About this mod

Toolkit for adding/editing/replacing maps and creating buildables.
(Formerly named TMXLoader).

Requirements
Permissions and credits
Translations
  • Portuguese
Changelogs
Donations

TMXL Map Toolkit

by Platonymous

Formerly named TMXLoader. Renamed TMXL Map Toolkit as the pure .tmx-file-loading part of this mod is now part of SMAPI (3.2+)

New in 1.8.4

Image Layers for Buildables
To use Image layers their name has to end with "UNIQUEID" like "MyLayer-UNIQUEID", though not on indoor-maps.
Coloring for Buildables
To allow coloring, the Image Layer needs to have two properties: "Color" holding a default rgba value like "255 255 255 255" for white and a "ColorId" proptery which can be anything. All layers that share a "ColorId" property will be colored the same way.

New in 1.8.0:
Buildables:
Buildables can be build or removed by pressing F2 (can be changed in the config file)
To remove the last Buildable placed on the map press BACKSPACE while having the menu open.
Regular buildable Map edits:
"buildables": [
{
"id":"Platonymous.Buildable",
"name": "Buildable",
"file": "assets/Buildable.tmx",
"iconFile": "assets/icon.png",
"removeEmpty":false,
"price":10000,
"set:": "Others"
},
  ]

Buildings:
"buildables": [
{
"id":"Platonymous.SomeBuilding",
"name": "Some Building",
"file": "assets/SomeBuilding.tmx",
"indoorsFile":"assets/SomeBuildingInterior.tmx",
"exitTile":[1,3],
"iconFile": "assets/SomeIcon.png",
"removeEmpty":false,
"buildItems":[
{
"index":388,
"stack":100
},
{
"name":"Parsnip",
"stack":1
}
],
"price":10000
}
  ]

exitTile is the point where a player would warp to when exiting a building. to warp to that point use the Action or TouchAction ExitBuildable on the map or (with 1.8.8+) use BUILDINGLOCATION EXITXY in the Warp property, like "Warp" : "9 24 BUILDLOCATION EXITXY".
On the Buildable (exterior) every INDOORS or UNIQUEID used in properties will be replaced by the generated values. to warp to the interior use for exp:
Warp 14 3 INDOORS

New in 1.4.2:
Setting festival spots for NPCs that don't have one. 
Format festival spots:
"festivalSpots":
[
{
"name": "Sandy",
"map": "Town-Fair", 
"position": [19, 35],
"direction": 1
}
]


New in 1.4.0:
Added a simpler way to add spouse rooms using the Spouse Room Template that you find under optional files
if you create a mod with the template, do not include the towninterior.png file when releasing it.

Important change in Version 1.3.0:
TMXL now uses SMAPI ContentPacks, which means all packs go directly into the mod folder and the ContentPack for the two Examples has to be downloaded seperately (Optional Files).

Includes two examples both ports of UlithiumDragons Mods (Cut Content & Jungle Temple).

Additional Layers and new TileActions will also work in maps not imported with TMXL.



Json Structure of ContenPacks content.js:
Spoiler:  
Show

{
  "addMaps": // New Maps
  [  
    {
      "name": "JungleTempleExterior", // Name of the new Location 
      "file": "JungleTempleExterior.tmx", // Filename inside the ContentPacks folder
    },
    ...
  ],
  "mergeMaps": // Replace parts of Maps
  [  
    {
      "name": "Woods", // Map to merge into
  "file": "Woods.tmx", 
  "sourceArea": [0,0,12,12], // Area on your Map that you want to place (x, y, width, height)
  "position": [0,0], // Position were the new Content should be placed on the map (x, y)
      "addWarps":  // add Warps ("entryX entryY TargetLocation exitX exitY")
      [
        "7 -1 JungleTempleExterior 14 34",
      ....
      ],
     "removeWarps":  // removes existing Warps ("entryX entryY TargetLocation exitX exitY")
      [ 
        "7 -1 JungleTempleExterior 14 34",
      ....
      ]
    },
   ...
  ],
"replaceMaps": // Fully replace Maps
  [  
   {
      "name": "Woods", // Map to replace
  "file": "Woods.tmx", 
    },
   ...
  ],
  "onlyWarps": // Only change Warps
   [

    {
      "name": "BusStop", 
      "addWarps": [
        "12 8 CityBus 2 6"
      ]
    }
  ],
"scripts":["script.lua"]
}
Additional Features:
Spoiler:  
Show


Drawing more than just the standart layers:
Add the property Draw/DrawAbove or DrawBefore to the layer you want to see drawn in the game, the value needs to be the layer that is it drawn after/before, for exp. Back if you want another Back-Layer.

Added TileActions (1.0.1), used either in the Action or TouchAction Property.
And since 1.1.0 you can also use the map property "EntryAction" which will be triggered whenever the player enters the map.

Say
YourText
Same as Message used to work but without the " "

Say Dwarvish YourText
Same as Say but shows the text in dwarvish if the player doesn't have the translation guide.



SwitchLayers Layer1:Layer2
Switches two layers, even layers that aren't actually drawn.

SwitchLayers
Layer1:Layer2:14:17
Switches only the specified Tile between layers x:y

SwichLayers Layer1:Layer2:1-5:5-7
Switches the specified Area between layers x1-x2:y1-y2

SwitchLayers Actions can be combined by just writting them one after the other exp: 
SwitchLayers Buildings:BuildingsOpen:4:6-9 Buildings:BuildingsOpen:9:5 Front:FrontOpen:4:6-9 AlwaysFront:AlwaysFrontOpen:4:6-9

Lock 1 380
Invokes a TileAction if the Active object is of the specified index Lock amount index
Requires further properties on the same tile:

Success Action triggered when using the right object in at least the right amount
Failure Action triggerd when using the wrong object or not enough
Default Action triggered when holding no object

(New in 1.1.0)
Lua YourFolderName YourFunction
Invokes a function from any of your lua scripts

Lua functions must take three paramters: location, tileposition & layerid

Lua Examples
Spoiler:  
Show

pc = false
function startPC(location, tilepos, layer)
if pc then
Game1.playSound("coin")
TMX.getTile(location,"Front",36, 12).TileIndex = 991
pc = false
else
Game1.playSound("stardrop")
TMX.getTile(location,"Front",36, 12).TileIndex = 1153
pc = true
end
end


Additionally every Action (and TouchAction) can be set conditional by adding the following properties to the same Tile:
Condition A condition either in the format of an event condition (Event preconditions) or if prefixed by PC a playerconditon (but not mixed yet)
FallbackAction triggered if the condition isn't met (optional)

Player conditions currently supported: catPerson , isMale , exhausted , hasGreenhouse , hasRustyKey , hasSkullKey , hasUnlockedSkullDoor , hasDarkTalisman , hasMagicInk , running , usingTool , usingSlingshot , bathingClothes , stardewHero , hasClubCard , canUnderstandDwarves

Conditions and PlayerConditions can be prefixed with NOT the invert them.


Actions are still very limited but will be expanded on. If you're in need of a specific TileAction you can suggest it to me on the SMAPI Discort (@Routine)

SMAPI Mods can add their own Tileactions using PyTK:
using PyTK.Types;
TileAction Say = new TileAction("Say", sayAction).register();



Known Bugs:

Draw/DrawBefore/DrawAbove doesn't always work with the Front layer.


Changed save serializer Warning
SMAPI warns that this mod "may corrupt your save files, or make them unusable if you uninstall" it.
This is because TMXL accesses properties that COULD be used to change the serializer in that way, but doesn't actually change it.
So despite what the warning says, your save files will not be corrupted or become unusable when using or uninstalling this mod.


If you have any questions you can usually find me on the Stardew Valley Discord under the username Routine#8715

If you like my mods and want to support me, you can do so via Paypal or on Patreon.