From Stardew Valley Wiki
Jump to: navigation, search

Samutz is a web developer and video game enthusiast.


Stuff that I might need again later or could be useful to someone else.

Re-sorting Navbox Lists Alphabetically

Copy and paste existing list to arraydefine function.

    |[[Model Ship]] • [[Futan Bear]] • [[Plush Bunny]] • [[China Cabinet]] • [[Gold Pillar]] • [[Ceramic Pillar]] • [[Industrial Pipe]]
    | • |sort=asc}}
{{#arrayprint:stuff| • |@@@@|[[@@@@]]}}

Preview then copy output and paste back in to navbox.

[[Ceramic Pillar]] • [[China Cabinet]] • [[Futan Bear]] • [[Gold Pillar]] • [[Industrial Pipe]] • [[Model Ship]] • [[Plush Bunny]]

Gifting Template for Item Pages

An explanation of how I updated most of the item pages...

The games stores data about the items in ObjectInformation.yaml (which is inside Content\Data\ObjectInformation.xnb) and Villager reactions to items and item categories in NPCGiftTastes.yaml (also in it's own .xnb file). I also found the code that the game runs when you gift an item to a villager to determine their reaction. I replicated this code in PHP to read the yaml files and import the data to a MySQL database.

You can see this at This page gets the item information and villager reactions that was previously imported and generates the wiki markup code. It also looks for a wiki page with the item name and looks for a Gift/Social section to replace. If none is found, it adds the new section at the bottom before any navboxes. However, you cannot see the Skip and Commit buttons that only I can see. Using those buttons I can review the changes to a page and then commit them to the wiki page automatically, or skip if I need to edit it manually or not at all. So I basically sat and hit Commit on most of the pages to apply the updates instead of editing the pages by hand.

I'm pretty confident in the results as I took several days to test and tweak it to make sure it worked. There are only a few pages that I'm unsure of, like the Stone page which has about 20 entries in the yaml files. Also there is code in the game that suggests that Penny is supposed to like artifacts, and my results initially reflected that too, but when I tested in the game by giving her artifacts, she did not like them.

In any case, at least now all of the giftable item pages have an easy to update template. This will probably also be my last major update as I've been getting burnt out on the game and am ready to move on to something else. I think I've also spent more time on the wiki the last 2 weeks than the actual game...

--Samutz (talk) 16:27, 13 April 2016 (EDT)