Difference between revisions of "Modding:Common tasks"
Hawkfalcon (talk | contribs) (Start of sections) |
Hawkfalcon (talk | contribs) (Start sections, add a simple explanation) |
||
Line 3: | Line 3: | ||
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 [[Modding:SMAPI APIs|SMAPI reference]]) | 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 [[Modding:SMAPI APIs|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== | ==Items== | ||
Line 14: | Line 19: | ||
==Locations== | ==Locations== | ||
//todo describe section | //todo describe section | ||
− | ====== | + | ===TODO=== |
+ | //todo | ||
==Player== | ==Player== | ||
//todo describe section | //todo describe section | ||
Line 22: | Line 28: | ||
//todo describe section | //todo describe section | ||
===Banner Message=== | ===Banner Message=== | ||
− | / | + | Add a new HUDMessage to show [insert image] banner. |
+ | <source lang="c#"> | ||
+ | Game1.addHUDMessage(new HUDMessage("MESSAGE", 3)); | ||
+ | </source> | ||
+ | Optional parameters ''noIcon'' and ''timeLeft'' | ||
+ | The 3 is because ...? | ||
==Menus== | ==Menus== | ||
//todo describe section | //todo describe section | ||
Line 30: | Line 41: | ||
//todo warning | //todo warning | ||
==Other== | ==Other== | ||
− | ===Add | + | ===Add a small animation=== |
− | / | + | <source lang="c#"> |
+ | Game1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(...)) | ||
+ | </source> | ||
+ | See TemporaryAnimatedSprite for more details | ||
===Play a sound=== | ===Play a sound=== | ||
− | / | + | <source lang="c#"> |
+ | location.playSound("SOUND"); | ||
+ | </source> | ||
+ | (e.g. "junimoMeep1") | ||
+ | |||
[[Category:Modding]] | [[Category:Modding]] |
Revision as of 20:08, 21 May 2018
← Index
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
Banner Message
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
Game1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(...))
See TemporaryAnimatedSprite for more details
Play a sound
location.playSound("SOUND");
(e.g. "junimoMeep1")