Skip to content

Stardew Valley framework theoretically for map features and everything else

License

Notifications You must be signed in to change notification settings

Mushymato/MiscMapActionsProperties

Repository files navigation

Misc Map Actions & Properties

Adds a few map related features, no strong design theme just whatever I happen to want.

This is a framework mod for other mods to use, it has exactly one player facing feature.

Config: Enable_doesTileHaveProperty_Optimization

This config option can only be set in config.json because it cannot be changed in-game. When true, enables a transpiler that improves GameLocation.doesTileHaveProperty performance. Change this to false if you encounter issues in game.

{
  "Enable_doesTileHaveProperty_Optimization": true
}

Documentation

General

These pages document the "entry points" to various features.

Specialized

These pages document custom assets needed by some features.

Usage Samples (with Content Patcher)

Much of this framework depend on sourcing data from various aspects of map and other custom assets, for convenience here are some examples using content patcher.

You can also consult [CP] MMAP Examples for examples involving specific features.

Click to Expand

EditMap

You may do this type of EditMap add prop to MapTiles in the tmx directly too.

Adding a tile action

{
  // 
  "Action": "EditMap",
  "Target": "Maps/<YOUR MAP HERE>",
  "MapTiles": [
    {
      // put your X/Y coord here
      "Position": { "X": 99, "Y": 99 },
      "Layer": "Buildings",
      "SetProperties": {
        "Action": "ACTIONNAME ARG1 ARG2"
      },
    }
  ]
},

Adding a touch action

{
  "Action": "EditMap",
  "Target": "Maps/<YOUR MAP HERE>",
  "MapTiles": [
    {
      // put your X/Y coord here
      "Position": { "X": 99, "Y": 99 },
      "Layer": "Back",
      "SetProperties": {
        "TouchAction": "ACTIONNAME ARG1 ARG2"
      },
    }
  ]
},

Adding map property

{
  "Action": "EditMap",
  "Target": "Maps/<YOUR MAP HERE>",
  "MapProperties": {
    "MAPPROPERTYNAME": "ARGUMENTS",
  }
},

EditData

EditData + Data/Buildings

{
  "Action": "EditData",
  "Target": "Data/Buildings",
  "Entries": {
    "{{ModId}}_YOUR_BUILDING": {
      // other building stuff
      "TileProperties": [
        {
          "Id": "{{ModId}}_ACTIONNAME",
          "Layer": "Buildings", // or Back
          "Name": "Action", // or TouchAction
          "Value": "ACTIONNAME ARG1 ARG2",
          // put your X/Y coord here, relative to the building's top left bound
          // setting width and height to greater than 1 will set property for multiple tiles
          "TileArea": {
            "X": 0,
            "Y": 0,
            "Width": 1,
            "Height": 1
          }
        }
      ],
    }
  },
}
{
  "Action": "EditData",
  "Target": "mushymato.MMAP/FurnitureProperties",
  "Entries": {
    "{{ModId}}_YOUR_FURNITURE": {
      "TileProperties": [
        {
          "Id": "{{ModId}}_ACTIONNAME",
          "Layer": "Buildings", // or Back
          "Name": "Action", // or TouchAction
          "Value": "ACTIONNAME ARG1 ARG2",
          // put your X/Y coord here, relative to the furniture's top left bound
          // setting width and height to greater than 1 will set property for multiple tiles
          "TileArea": {
            "X": 0,
            "Y": 0,
            "Width": 1,
            "Height": 1
          }
        }
      ],
    }
  },
}
{
  "Action": "EditData",
  "Target": "mushymato.MMAP/FloorPathProperties",
  "Entries": {
    "{{ModId}}_FloorTerrain": {
      // Layer
      "Back": {
        // property: value
        "mushymato.MMAP_Light": "1 White 4",
        "mushymato.MMAP_LightCond": "mushymato.MMAP_TIME_IS_LIGHTS_OFF"
      },
      "Buildings": {
        "Action": "Message Test"
      }
    }
  },
}

Updates

Because this is a framework mod, you as a mod user don't generally need to update it unless you are installing a new mod that depends on a feature only implemented in newer version of MMAP. Bugs do occur as I develop features, and generally it is not end of the world. Please report your issue with a log, then roll back to a previous version of mod while I fix things.

I have gotten reports of performance problems and worked on improving that from versions 1.9.3 to 1.9.5, if you experiance slowness do try to update first.

About

Stardew Valley framework theoretically for map features and everything else

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages