Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Maps
(view source)
Revision as of 20:17, 19 October 2017
371 bytes added
,
20:17, 19 October 2017
→Tile properties
:
+ remove tile property
Line 165:
Line 165:
public void Entry(IModHelper helper)
public void Entry(IModHelper helper)
{
{
−
// get
+
// get
property
string value = Game1.currentLocation.doesTileHaveProperty(tileX, tileY, "Diggable", "Back");
string value = Game1.currentLocation.doesTileHaveProperty(tileX, tileY, "Diggable", "Back");
−
// add or set
value
+
// add or set
property
Game1.currentLocation.setTileProperty(tileX, tileY, "Back", "Diggable", "T");
Game1.currentLocation.setTileProperty(tileX, tileY, "Back", "Diggable", "T");
+
+
// remove tile property
+
Layer layer = Game1.currentLocation.map.GetLayer("Back");
+
Tile tile = layer.PickTile(new xTile.Dimensions.Location(x, y) * Game1.tileSize, Game1.viewport.Size);
+
tile.Properties.Remove("Diggable");
+
//tile.TileIndexProperties.Remove("Diggable"); // NOTE: removing a tile index property will affect all tiles of this type
}
}
</source>
</source>
Pathoschild
translators
8,404
edits