Tutorial: Using a Donation Dropbox in a Special Order

From Stardew Modding Wiki
Jump to navigation Jump to search


If you'd like to learn more about how to use dropboxes for a special order, you've come to the right place! We will cover using a vanilla (base game) dropbox, as well as how to create and use a custom dropbox, using the example from the tutorial on Adding a Special Order.

NOTE: if you wanted the special order to be for a machine or other big craftable, you'll definitely need a dropbox for the special order. You cannot "deliver" a big craftable to an NPC.

Assumptions we're working with

This tutorial assumes you are familiar with the basics of how to create a special order (tutorial here) and are only here to learn about dropboxes specifically, either vanilla or custom.

Original completed example reference

For reference, this is the completed example from the tutorial on Adding a Special Order. It is set up as a delivery order to Abigail, and we will change it to use a donation dropbox.

{
        "LogName": "Abigail Crunchy Treats",
        "Action": "EditData",
        "Target": "Data/SpecialOrders",
        "Entries": {
          "ExampleMod_Abigail_CrunchyTreats": {
            "Name": "Crunchy Treats",
            "Requester": "Abigail",
            "Duration": "Week",
            "Repeatable": "True",
            "RequiredTags": "!season_spring, !season_summer",
            "OrderType": "",
            "SpecialRule": "",
            "ItemToRemoveOnEnd": null,
            "MailToRemoveOnEnd": null,
            "RandomizedElements": null,
            "Text": "I'm craving some crunchy treats! Could someone bring me 10 quartz and 10 amethyst?",
            "Objectives": [
                {
                  "Type": "Deliver",
                  "Text": "Deliver 10 Quartz to Abigail",
                  "RequiredCount": "10",
                  "Data": {
                    "AcceptedContextTags": "item_quartz",
                    "Message": "Quartz really sparkles, doesn't it? Thanks @!$h",
                    "TargetName": "Abigail"
                  }
                },
                {
                  "Type": "Deliver",
                  "Text": "Deliver 10 Amethyst to Abigail",
                  "RequiredCount": "10",
                  "Data": {
                    "AcceptedContextTags": "item_amethyst",
                    "Message": "It definitely tastes of purple!$h",
                    "TargetName": "Abigail"
                  }
                }
              ],
              "Rewards": [
                {
                  "Type": "Money",
                  "Data": {
                    "Amount": "4026"
                  }
                },
                {
                  "Type": "Friendship",
                  "Data": {}
                }
              ]
          }
        }
  }

Use a vanilla (base game) dropbox

First, we will cover using a vanilla dropbox. In this case, the existing one in Pierre's shop.

We will need to change the Objectives section to note that this is a Donation Type, not Delivery Type, remove the lines for Message and TargetName, add the lines for the dropbox information, and update the Objectives Text to reflect this is a donation order. We will also need to update the RequiredTags section to specify that this order should not load if there is already an order using Pierre's dropbox.

You can get the information on vanilla dropboxes from the wiki page on Special Orders and searching for DropBox or unpacking the game files, looking at the Special Orders file and then searching for DropBox.

For ease of readability, below is a snippet of only the updated RequiredTags section and the Objectives section with its changes:

{
    "Entries": {
        "ExampleMod_Abigail_CrunchyTreats": {
            "RequiredTags": "!season_spring, !season_summer, !dropbox_PierreBox",
            "Objectives": [
                {
                    "Type": "Donate",
                    "Text": "Drop off 10 Quartz in the empty box in Pierre's shop",
                    "RequiredCount": "10",
                    "Data": {
                        "AcceptedContextTags": "item_quartz",
                        "DropBox": "PierreBox",
                        "DropBoxGameLocation": "SeedShop",
                        "DropBoxIndicatorLocation": "18.5 27"
                    }
                },
                {
                    "Type": "Donate",
                    "Text": "Drop off 10 Amethyst in the empty box in Pierre's shop",
                    "RequiredCount": "10",
                    "Data": {
                        "AcceptedContextTags": "item_amethyst",
                        "DropBox": "PierreBox",
                        "DropBoxGameLocation": "SeedShop",
                        "DropBoxIndicatorLocation": "18.5 27"
                    }
                }
            ]
        }
    }
}

Similar to how we specified the seasons using a negation, we specified that if Pierre's dropbox is already being used for a mod, this order should not load by using !dropbox_PierreBox.

Use a custom dropbox

If you want to use a custom dropbox (for instance, one doesn't exist in that building), additional steps are required. First, you'll need to find a suitable spot on the map, and get the coordinates using Debug Mode. Next you'll need to give it a name, and add a patch in the content.json file to load the custom dropbox. Finally, add the dropbox information to the special order.

Find a spot for the custom dropbox

To find a suitable spot, I loaded my game and went into Pierre's shop. I picked a corner that seemed like a suitable place to leave something (realism and immersion were not a primary concern), so I toggled Debug Mode to find the coordinates and map name, and went with (20, 30). For the dropbox name, I went with PierreCorner. The vanilla dropboxes did not contain a space in the name, so I followed that convention.

Add patch in content.json to add custom dropbox

The patch in the content.json file to add the custom dropbox should look like this:

{
    "LogName": "Pierre's Shop DropBox",
    "Action": "EditMap",
    "Target": "Maps/SeedShop", // Get the map name from using Debug Mode
    "MapTiles": [
      {
        "Position": { "X": 20, "Y": 30}, // Get the coordinates from using Debug Mode
        "Layer": "Buildings",
        "SetProperties": {
          "Action": "DropBox PierreCorner"
        }
      }
    ]
  }

The location has to have something on the Buildings layer to apply the Action. I specifically picked a corner that had something on it, in this case, a plant. Additionally, from the map modding wiki page:

The Action property makes something happen when the player interacts (e.g., clicks) with the tile.

The table listing the Action properties in the map modding wiki page also specifies the correct layer is Buildings.

Update the special order in content.json with custom dropbox details

For ease of readability, below is a snippet of only the updated Objectives section with the custom dropbox details:

{
    "Entries": {
        "ExampleMod_Abigail_CrunchyTreats": {
            "RequiredTags": "!season_spring, !season_summer",
            "Objectives": [
                {
                    "Type": "Donate",
                    "Text": "Drop off 10 Quartz near the plant in Pierre's shop",
                    "RequiredCount": "10",
                    "Data": {
                        "AcceptedContextTags": "item_quartz",
                        "DropBox": "PierreCorner",
                        "DropBoxGameLocation": "SeedShop",
                        "DropBoxIndicatorLocation": "19 30"
                    }
                },
                {
                    "Type": "Donate",
                    "Text": "Drop off 10 Amethyst near the plant in Pierre's shop",
                    "RequiredCount": "10",
                    "Data": {
                        "AcceptedContextTags": "item_amethyst",
                        "DropBox": "PierreCorner",
                        "DropBoxGameLocation": "SeedShop",
                        "DropBoxIndicatorLocation": "19 30"
                    }
                }
            ]
        }
    }
}

Test the special order

If you made it this far, congratulations, you have made a donation special order! Don't forget to test your order, to make sure the dropbox works correctly.

See also