Changes
Jump to navigation
Jump to search
← 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,401
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Modding
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Admin noticeboard
Help Editing
Random page
Official Links
Official Site
Official Forums
Official Merchandise
Discord
Reddit
Tools
Upload file
Special pages
Printable version