Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Audio
(view source)
Revision as of 01:34, 19 October 2021
569 bytes added
,
01:34, 19 October 2021
Added GameLocation.playSound function
Line 115:
Line 115:
===Playing multiplayer sounds===
===Playing multiplayer sounds===
The methods in this section will let you play sounds across different clients in a multiplayer game.
The methods in this section will let you play sounds across different clients in a multiplayer game.
+
<br>
+
Sounds played with multiplayer methods will run in singleplayer as well as multiplayer.
+
+
<dt><tt>GameLocation.playSound</tt></dt>
+
<dd>
+
This method will play a sound for all players located in the same map, but not from a particular position:
+
<syntaxhighlight lang="c#">
+
// When a player places a new structure, a sound will be played
+
// for the players that are at the same location,
+
// ie. on the farm.
+
public virtual void performActionOnConstruction(GameLocation location)
+
{
+
this.load();
+
location.playSound("axchop");
+
// ...
+
</syntaxhighlight>
+
</dd>
<dt><tt>playSoundAt</tt></dt>
<dt><tt>playSoundAt</tt></dt>
7automaton
41
edits