Modding:Common tasks

Revision as of 20:09, 21 May 2018 by Hawkfalcon (talk | contribs) (consistency)

Index

Axe.png
Article Stub

This article is a stub and is missing information. You can help Stardew Valley Wiki by expanding it!

This page explains how mod creators can perform common tasks in SMAPI mods. (Note: this page is for interacting with the game itself, for SMAPI-provided tasks see SMAPI reference)

Things to note

Many things in Stardew Valley are accessed through Game1. It is highly recommended to decompile the game source and look at how the game does things and then attempt to do it yourself. This is a general guide to point you to the right places in the code to look, it is not meant to give you the code. Modding:Creating a SMAPI mod //todo link to decompiling section

Items

//todo describe section

Create an Item

//todo

Remove an Item

//todo

Add an item to the player inventory

//todo

Locations

//todo describe section

TODO

//todo

Player

//todo describe section

Position

//todo

UI

//todo describe section

Add a new HUDMessage to show [insert image] banner.

Game1.addHUDMessage(new HUDMessage("MESSAGE", 3));

Optional parameters noIcon and timeLeft The 3 is because ...?

Menus

//todo describe section

Simple Menu

//todo

Harmony

//todo warning

Other

Add a small animation

location.temporarySprites.Add(new TemporaryAnimatedSprite(...))

See TemporaryAnimatedSprite for more details

Play a sound

location.playSound("SOUND");

(e.g. "junimoMeep1")