Changes

Jump to navigation Jump to search
3,335 bytes added ,  02:36, 4 May 2017
wikify
Line 1: Line 1: −
<pre>
+
← [[Modding:Index|Index]]
---
  −
layout: default
  −
title: Events
  −
intro: >
  −
    This page explains how the game stores and parses event data. This is an advanced guide for mod
  −
    developers.
  −
permalink: /for-devs/events
  −
redirect_from:
  −
    - /guides/events
  −
---
     −
## Source
+
This page explains how the game stores and parses event data. This is an advanced guide for mod developers.
Events are stored in `Data\Events\*.xnb` (one file per location), which can be
+
 
[unpacked using XNB Extract](creating-an-xnb-mod#unpacking).
+
==Source==
 +
Events are stored in <tt>Data\Events\*.xnb</tt> (one file per location), which can be [[Modding:Creating an XNB mod#unpacking|unpacked using XNB Extract]].
    
Here's the raw data for saloon events (as of 1.1.1) for reference:
 
Here's the raw data for saloon events (as of 1.1.1) for reference:
   −
```yaml
+
<source lang="yaml">
 
xnbData:  
 
xnbData:  
 
     target: "w"
 
     target: "w"
Line 37: Line 28:  
     911526/f Alex 2500/t 1900 2200/n joshMessage: "gusviolin/-1000 -1000/farmer 5 5 1 Gus 10 6 2 Alex 9 5 3 Emily 9 17 2/skippable/showFrame 117/showFrame Alex 39/positionOffset farmer 12 8/positionOffset Alex -12 0/animate Gus false true 723 16 17/viewport 7 4 true/pause 23000/stopAnimation Gus/pause 1000/faceDirection Gus 3/speak Alex \"Thanks, Gus. That was great.\"/move Gus 0 1 1/move Gus 1 0 2/move Gus 0 1 2/doAction 11 9/move Gus 0 3 1/move Gus 12 0 3 true/speak Alex \"This is nice... I've never dined in here before.\"/pause 1000/emote Alex 40/speak Alex \"Um, anyway... I reserved this private room so we could talk...$l\"/warp Emily 11 11 true/playSound woodyStep/move Emily 0 -4 3/move Emily -4 0 0/move Emily 0 -1 0/speak Emily \"I've got a linguini with mushroom cream sauce for Mr. @.^I've got a kale and walnut salad for the lady.#$b#...and a grilled steak for Alex.^And a grilled steak for the gentleman.\"/playSound woodyHit/specificTemporarySprite joshDinner/speak Alex \"Thanks.\"/move Emily 4 0 2/move Emily 0 5 1/move Emily 11 0 1 true/speak Alex \"So, what I wanted to say was...$9\"/playMusic musicboxsong/speak Alex \"*gulp*$s\"/pause 600/speak Alex \"Well... when we first met, I was instantly drawn to you. It was confusing... I'd never felt that way about anyone.$l^When I first met you, I thought you were really cute.$l#$b#I kept telling myself 'You can't have these kinds of feelings for another guy'.$l^Normally, when I have a crush on someone, the feeling goes away pretty quick...$l\"/pause 800/speak Alex \"...But my heart was telling me something else.^...But with you, it kept growing.$l\"/pause 400/emote Alex 40/pause 600/question fork1 \"#I feel the same way.#I'm sorry... I don't feel that way about you.\"/pause 400/fork rejectJosh/speak Alex \"...$l#$b#I can't believe it took this long to say that to each other.$l\"/emote Alex 32/pause 800/animate Alex false false 400 40 41 41 40 41 41 40 41 41 40 41 41 40/pause 800/playSound eat/pause 800/playSound eat/pause 800/playSound eat/pause 800/playSound gulp/pause 400/speak Alex \"Mmm... this steak is outsanding. Can you smell that fragrant sauce?$10\"/eyes 1 -4000/animate Alex false false 400 40 41 41 40 41 41 40/pause 1000/specificTemporarySprite alexDiningDog/playSound dogWhining/pause 1000/globalFade/viewport -1000 -1000/pause 6000/end dialogue Alex \"...$l\"" #!String
 
     911526/f Alex 2500/t 1900 2200/n joshMessage: "gusviolin/-1000 -1000/farmer 5 5 1 Gus 10 6 2 Alex 9 5 3 Emily 9 17 2/skippable/showFrame 117/showFrame Alex 39/positionOffset farmer 12 8/positionOffset Alex -12 0/animate Gus false true 723 16 17/viewport 7 4 true/pause 23000/stopAnimation Gus/pause 1000/faceDirection Gus 3/speak Alex \"Thanks, Gus. That was great.\"/move Gus 0 1 1/move Gus 1 0 2/move Gus 0 1 2/doAction 11 9/move Gus 0 3 1/move Gus 12 0 3 true/speak Alex \"This is nice... I've never dined in here before.\"/pause 1000/emote Alex 40/speak Alex \"Um, anyway... I reserved this private room so we could talk...$l\"/warp Emily 11 11 true/playSound woodyStep/move Emily 0 -4 3/move Emily -4 0 0/move Emily 0 -1 0/speak Emily \"I've got a linguini with mushroom cream sauce for Mr. @.^I've got a kale and walnut salad for the lady.#$b#...and a grilled steak for Alex.^And a grilled steak for the gentleman.\"/playSound woodyHit/specificTemporarySprite joshDinner/speak Alex \"Thanks.\"/move Emily 4 0 2/move Emily 0 5 1/move Emily 11 0 1 true/speak Alex \"So, what I wanted to say was...$9\"/playMusic musicboxsong/speak Alex \"*gulp*$s\"/pause 600/speak Alex \"Well... when we first met, I was instantly drawn to you. It was confusing... I'd never felt that way about anyone.$l^When I first met you, I thought you were really cute.$l#$b#I kept telling myself 'You can't have these kinds of feelings for another guy'.$l^Normally, when I have a crush on someone, the feeling goes away pretty quick...$l\"/pause 800/speak Alex \"...But my heart was telling me something else.^...But with you, it kept growing.$l\"/pause 400/emote Alex 40/pause 600/question fork1 \"#I feel the same way.#I'm sorry... I don't feel that way about you.\"/pause 400/fork rejectJosh/speak Alex \"...$l#$b#I can't believe it took this long to say that to each other.$l\"/emote Alex 32/pause 800/animate Alex false false 400 40 41 41 40 41 41 40 41 41 40 41 41 40/pause 800/playSound eat/pause 800/playSound eat/pause 800/playSound eat/pause 800/playSound gulp/pause 400/speak Alex \"Mmm... this steak is outsanding. Can you smell that fragrant sauce?$10\"/eyes 1 -4000/animate Alex false false 400 40 41 41 40 41 41 40/pause 1000/specificTemporarySprite alexDiningDog/playSound dogWhining/pause 1000/globalFade/viewport -1000 -1000/pause 6000/end dialogue Alex \"...$l\"" #!String
 
     rejectJosh: "pause 100/playMusic none/shake Alex 2000/emote Alex 28/speak Alex \"...Oh...$s#$b#I...I'm sorry if I made you uncomfortable...$s\"/pause 2000/speak Alex \"I'm not hungry anymore...$s\"/viewport move 1 1 5000/globalFade/viewport -1000 -1000/pause 4000/end dialogue Alex \"...$l\"" #!String
 
     rejectJosh: "pause 100/playMusic none/shake Alex 2000/emote Alex 28/speak Alex \"...Oh...$s#$b#I...I'm sorry if I made you uncomfortable...$s\"/pause 2000/speak Alex \"I'm not hungry anymore...$s\"/viewport move 1 1 5000/globalFade/viewport -1000 -1000/pause 4000/end dialogue Alex \"...$l\"" #!String
```
+
</source>
   −
## Event preconditions
+
==Event preconditions==
Each event has a key which includes an event ID and any preconditions. Event preconditions include
+
Each event has a key which includes an event ID and any preconditions. Event preconditions include any number of the following arguments (separated by <tt>/</tt>):
any number of the following arguments (separated by `/`):
     −
char code¹ | syntax | precondition
+
{| class="wikitable"
---------- | ------ | ------------
+
|-
97 | `a <x> <y>` | Player is at that tile position.
+
! char code¹
98 | `b <number>` | Player has reached the mine bottom at least that many times.
+
! syntax
99 | `c <number>` | Player has at least that many free inventory slots.
+
! precondition
100 | `d <day of week>` | Today is **not** one of the specified days (may specify multiple days).
+
|-
101 | `e <event ID>` | Player has seen the specified event (may contain multiple event IDs).
+
| 97
102 | `f <name> <number>` | Player has that many friendship points with NPC (may contain multiple name/number pairs). Each heart is 250 points.
+
| <tt>a {{t|x}} {{t|y}}</tt>
103 | `g <gender>` | Player is **not** the specified gender ("male" or "female").
+
| Player is at that tile position.
104 | `h <pet>` | Player has the specified pet ("cat" or "dog").
+
|-
105 | `i <item ID>` | Player has specified item in their inventory.
+
| 98
106 | `j <number>` | Player has played **more** than that many days.
+
| <tt>b {{t|number}}</tt>
107 | `k <event ID>` | Player has **not** seen that event (may contain multiple event IDs).
+
| Player has reached the mine bottom at least that many times.
108 | `l <letter ID>` | Player has received that mail letter. This is often overloaded as a general flag, by specifying an invalid mail letter and marking it read when an arbitrary condition is met.
+
|-
109 | `m <number>` | Player has earned at least this much money.
+
| 99
110 | `n <letter ID>` | Same as #108.
+
| <tt>c {{t|number}}</tt>
111 | `o <name>` | Player is **not** married to that NPC.
+
| Player has at least that many free inventory slots.
112 | `p <name>` | Specified character is in the current game location.
+
|-
113 | `q <dialogue ID>` | Player has answered the specified dialogue question (may contain multiple dialogue IDs). Unclear whether this is the question ID or answer ID.
+
| 100
114 | `r <number>` | % chance (value between 0 and 1).
+
| <tt>d {{t|day of week}}</tt>
115 | `s <item ID> <number>` | Player has shipped at least this many of the specified item (may specify multiple item/number pairs).
+
| Today is ''not'' one of the specified days (may specify multiple days).
116 | `t <min time> <max time>` | Current time is between between the specified times.
+
|-
117 | `u <day of month>` | Current day of month is one of the specified values (may contain multiple days).
+
| 101
118 | `v <name>` | The specified NPC is visible.
+
| <tt>e {{t|event ID}}</tt>
119 | `w <weather>` | Current weather matches specified value ("rainy" or "sunny").
+
| Player has seen the specified event (may contain multiple event IDs).
120 | `x <event ID> <letter ID>` | Marks the specified ID as seen, adds the specified letter to tomorrow's mail, then returns false.
+
|-
121 | `y <year>` | If `<year>` is 1, must be in the first year. Otherwise, year must be at least this value.
+
| 102
122 | `z <season>` | Current season is **not** one of the specified values (may contain multiple seasons).
+
| <tt>f {{t|name}} {{t|number}}</tt>
 +
| Player has that many friendship points with NPC (may contain multiple name/number pairs). Each heart is 250 points.
 +
|-
 +
| 103
 +
| <tt>g {{t|gender}}</tt>
 +
| Player is ''not'' the specified gender ("male" or "female").
 +
|-
 +
| 104
 +
| <tt>h {{t|pet}}</tt>
 +
| Player has the specified pet ("cat" or "dog").
 +
|-
 +
| 105
 +
| <tt>i {{t|item ID}}</tt>
 +
| Player has specified item in their inventory.
 +
|-
 +
| 106
 +
| <tt>j {{t|number}}</tt>
 +
| Player has played ''more'' than that many days.
 +
|-
 +
| 107
 +
| <tt>k {{t|event ID}}</tt>
 +
| Player has ''not'' seen that event (may contain multiple event IDs).
 +
|-
 +
| 108
 +
| <tt>l {{t|letter ID}}</tt>
 +
| Player has received that mail letter. This is often overloaded as a general flag, by specifying an invalid mail letter and marking it read when an arbitrary condition is met.
 +
|-
 +
| 109
 +
| <tt>m {{t|number}}</tt>
 +
| Player has earned at least this much money.
 +
|-
 +
| 110
 +
| <tt>n {{t|letter ID}}</tt>
 +
| Same as #108.
 +
|-
 +
| 111
 +
| <tt>o {{t|name}}</tt>
 +
| Player is ''not'' married to that NPC.
 +
|-
 +
| 112
 +
| <tt>p {{t|name}}</tt>
 +
| Specified character is in the current game location.
 +
|-
 +
| 113
 +
| <tt>q {{t|dialogue ID}}</tt>
 +
| Player has answered the specified dialogue question (may contain multiple dialogue IDs). Unclear whether this is the question ID or answer ID.
 +
|-
 +
| 114
 +
| <tt>r {{t|number}}</tt>
 +
| % chance (value between 0 and 1).
 +
|-
 +
| 115
 +
| <tt>s {{t|item ID}} {{t|number}}</tt>
 +
| Player has shipped at least this many of the specified item (may specify multiple item/number pairs).
 +
|-
 +
| 116
 +
| <tt>t {{t|min time}} {{t|max time}}</tt>
 +
| Current time is between between the specified times.
 +
|-
 +
| 117
 +
| <tt>u {{t|day of month}}</tt>
 +
| Current day of month is one of the specified values (may contain multiple days).
 +
|-
 +
| 118
 +
| <tt>v {{t|name}}</tt>
 +
| The specified NPC is visible.
 +
|-
 +
| 119
 +
| <tt>w {{t|weather}}</tt>
 +
| Current weather matches specified value ("rainy" or "sunny").
 +
|-
 +
| 120
 +
| <tt>x {{t|event ID}} {{t|letter ID}}</tt>
 +
| Marks the specified ID as seen, adds the specified letter to tomorrow's mail, then returns false.
 +
|-
 +
| 121
 +
| <tt>y {{t|year}}</tt>
 +
| If {{t|year}} is 1, must be in the first year. Otherwise, year must be at least this value.
 +
|-
 +
| 122
 +
| <tt>z {{t|season}}</tt>
 +
| Current season is ''not'' one of the specified values (may contain multiple seasons).
 +
|}
   −
<small>¹ For convenience when looking at the decompiled code in `GameLocation::checkEventPrecondition`.</small>
+
<small>¹ For convenience when looking at the decompiled code in <tt>GameLocation::checkEventPrecondition</tt>.</small>
   −
For example, Clint's Saloon heart event preconditions are `97/f Clint 750/t 1900 2300/d Tue Wed Thu
+
For example, Clint's Saloon heart event preconditions are <code>97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun</code>, which means ''event #97, requires 3 hearts with Clint, between 7pm and 11pm on Monday''.
Fri Sat Sun`, which means _event #97, requires 3 hearts with Clint, between 7pm and 11pm on Monday_.
     −
## Event scripts
+
==Event scripts==
### Basic format
+
===Basic format===
Each event has a value which is the event script. This specifies what happens in the event —
+
Each event has a value which is the event script. This specifies what happens in the event — everything from lighting and music to NPC movement and dialogue. The script consists of multiple commands separated by <tt>/</tt> characters.
everything from lighting and music to NPC movement and dialogue. The script consists of multiple
  −
commands separated by `/` characters.
      
Every script must start with three commands in this exact order:
 
Every script must start with three commands in this exact order:
   −
index | syntax         | description
+
{| class="wikitable"
----- | -------------- | -----------
+
|-
0    | `<music ID>` | The background music to play. Some example values are `jaunty`, `ocean`, and `rain`.
+
! index
1     | `<x> <y>`    | The tile coordinates the camera should center on at the start of the event.
+
! syntax
2     | `<npc ID> <x> <y> <direction>` | Initialises an NPC's starting tile position and [direction](#directions). The NPC ID can be `farmer` or an NPC name like `Abigail`.
+
! description
 +
|-
 +
| 0
 +
| <tt>{{t|music ID}}</tt>
 +
| The background music to play. Some example values are <tt>jaunty</tt>, <tt>ocean</tt>, and <tt>rain</tt>.
 +
|-
 +
| 1
 +
| <tt>{{t|x}} {{t|y}}</tt>
 +
| The tile coordinates the camera should center on at the start of the event.
 +
|-
 +
| 2
 +
| <tt>{{t|npc ID}} {{t|x}} {{t|y}} {{t|direction}}</tt>
 +
| Initialises an NPC's starting tile position and [[#Directions|direction]]. The NPC ID can be <tt>farmer</tt> or an NPC name like <tt>Abigail</tt>.
 +
|}
    
Those three commands may be followed by any sequence of the following commands:
 
Those three commands may be followed by any sequence of the following commands:
   −
command | description
+
{| class="wikitable"
------- | -----------
+
|-
`addBigProp <x> <y> <object ID>` | Adds an object at the specified tile.
+
! command
`addCookingRecipe <recipe>` | Adds the specified cooking recipe to the player.
+
! description
`addCraftingRecipe <recipe>` | Adds the specified crafting recipe to the player.
+
|-
`addFloorProp <prop index> <x> <y> [solid width] [solid height] [display height]` | Add a non-solid prop from the current festival texture. Default solid width/height is 1. Default display height is solid height.
+
| <tt>addBigProp {{t|x}} {{t|y}} {{t|object ID}}</tt>
`addLantern <row in tex.> <x> <y> <light radius>` | Adds a glowing temporary sprite.
+
| Adds an object at the specified tile.
`addMailReceived <letter ID>` | Set a letter as received.
+
|-
`addObject <row in tex.> <x> <y>` | Adds a temporary sprite at the specified tile.
+
| <tt>addCookingRecipe {{t|recipe}}</tt>
`addProp <prop index> <x> <y> [solid width] [solid height] [display height]` | Add a solid prop from the current festival texture. Default solid width/height is 1. Default display height is solid height.
+
| Adds the specified cooking recipe to the player.
`addQuest <quest ID>` | Add the specified quest to the quest log.
+
|-
`addTemporaryActor <character> <sprite width> <sprite height> <tile x> <tile y> <facing> [breather] [Character|Animal|Monster] [animal name]` | Add a temporary actor. 'breather' is boolean. The category determines where the texture will be loaded from, default is Character. Animal name only applies to animal.
+
| <tt>addCraftingRecipe {{t|recipe}}</tt>
`addToTable <x> <y> <object ID>` | Places on object on the furniture at a position. If the location is FarmHouse, then it will always be placed on the initial table.
+
| Adds the specified crafting recipe to the player.
`addTool <Sword|Wand>` | Adds either a Battered Sword or Return Scepter (teleports you to your farm, unobtainable in vanilla) to the player's inventory.
+
|-
`advancedMove <npc> <loop> <x y>...` | TODO: Explain
+
| <tt>addFloorProp {{t|prop index}} {{t|x}} {{t|y}} {{o|solid width}} {{o|solid height}} {{o|display height}}</tt>
`ambientLight <r> <g> <b>` | Set the ambient light level.
+
| Add a non-solid prop from the current festival texture. Default solid width/height is 1. Default display height is solid height.
`animalNaming` | Show the animal naming menu if no other menu is open. Uses the current location as Coop. Appears to only work for 'hatched' animals.
+
|-
`animate <actor> <frame duration> <flip> <loop> <frames...>` | Animate a named actor, using the one or more `<frames>` from their spritesheet, for `<frame duration>` milliseconds per frame. `<flip>` indicates whether to flip the sprites along the Y axis; `<loop>` indicates whether to repeat the animation.
+
| <tt>addLantern {{t|row in texture}} {{t|x}} {{t|y}} {{t|light radius}}</tt>
`attachCharacterToTempSprite <actor>` | Attach an actor to the most recent temporary sprite.
+
| Adds a glowing temporary sprite.
`awardFestivalPrize [pan|sculpture|rod|sword|hero|joja|slimeegg]` | Awards the festival prize to the winner for the easter egg hunt and ice fishing contest. Otherwise, awards the specified item.
+
|-
`bloom <threshold> <blur> <bloom intensity> <base intensity> <bloom saturation> <base saturation> [whiteOnly]` | Sets the current bloom settings. If 'whiteOnly' is not empty, then BloomSettings.brightWhiteOnly is true.
+
| <tt>addMailReceived {{t|letter ID}}</tt>
`catQuestion` | Trigger question about adopting your pet.
+
| Set a letter as received.
`cave` | Trigger the question for the farm cave type. This will work again later, however changing from bats to mushrooms will not remove the mushroom spawning objects.
+
|-
`changeLocation <location>` | Change to another location and run the remaining event script there.
+
| <tt>addObject {{t|row in texture}} {{t|x}} {{t|y}}</tt>
`changeMapTile <layer> <x> <y> <tile index>` | Change the specified tile to a particular value.
+
| Adds a temporary sprite at the specified tile.
`changePortrait <npc> <portrait>` | Change the NPC's portrait to be from "Portraits/`<actor>`_<sprite&gt".
+
|-
`changeSprite <actor> <sprite>` | Change the actor's sprite to be from "Characters/`<actor>`_`<sprite>`".
+
| <tt>addProp {{t|prop index}} {{t|x}} {{t|y}} {{o|solid width}} {{o|solid height}} {{o|display height}}</tt>
`changeToTemporaryMap <map> [pan]` | Change the location to a temporary one loaded from the map file specified by `<map>`. The `pan` argument indicates the tile coordinates to pan to (defaults to `0, 0`).
+
| Add a solid prop from the current festival texture. Default solid width/height is 1. Default display height is solid height.
`changeYSourceRectOffset <npc> <offset>` | Change the NPC's vertical texture offset (?).
+
|-
`characterSelect` | Seemingly unused. Sets Game1.gameMode to 5 and Game1.menuChoice = 0.
+
| <tt>addQuest {{t|quest ID}}</tt>
`cutscene <cutscene>` | Activate a cutscene. See cutscene list. (TODO: Pull list from my event editor)
+
| Add the specified quest to the quest log.
`doAction <x> <y>` | TODO: Explain GameLocation.checkAction(new Location(x,y), viewport, player)
+
|-
`elliotbooktalk` | Elliot book talk.
+
| <tt>addTemporaryActor {{t|character}} {{t|sprite width}} {{t|sprite height}} {{t|tile x}} {{t|tile y}} {{t|facing}} {{o|breather}} {{o|Character|Animal|Monster}} {{o|animal name}}</tt>
`emote <actor> <emote ID>` | Make the given NPC name perform an emote, which is a little icon shown above the NPC's head. Emotes are stored in `Content\TileSheets\emotes.xnb` (see [list of emotes](https://www.reddit.com/r/StardewValley/comments/5s5m9g/help_annoyed_squiggle/ddd33qg/)).
+
| Add a temporary actor. 'breather' is boolean. The category determines where the texture will be loaded from, default is Character. Animal name only applies to animal.
`end ?` | TODO: Investigate Event.endBehaviors
+
|-
`extendSourceRect <actor> (reset | <horizontal> <vertical> [ignoreUpdates])` | For the reset version, resets the actors sprite. TODO: Explain Character.extendSourceRect
+
| <tt>addToTable {{t|x}} {{t|y}} {{t|object ID}}</tt>
`eyes <eyes> <blink>` | Change the player's eyes.
+
| Places on object on the furniture at a position. If the location is FarmHouse, then it will always be placed on the initial table.
`faceDirection <actor> <direction> [continue]` | Make a named NPC face a [direction](#directions). If no parameter is supplied for [continue], the game will pause.
+
|-
`fade [fadeOut]` | If 'fadeOut' is not specified, it will fade in. (?)
+
| <tt>addTool {{t|Sword|Wand}}</tt>
`farmerAnimation <anim>` | Sets the farmer's current animation.
+
| Adds either a Battered Sword or Return Scepter (teleports you to your farm, unobtainable in vanilla) to the player's inventory.
`farmerEat <object ID>` | Make the player eat an object
+
|-
`fork <event ID> [<req>]` | End the current command script and starts a different script with the given ID, but only if the `<req>` condition is met. The `<req>` condition can be a mail ID or dialogue answer ID; if not specified, it checks if the `specialEventVariable1` variable was set (e.g. by a `question` command). The new script should have the same format as a normal event script, but without the mandatory three start fields.
+
| <tt>advancedMove {{t|npc}} {{t|loop}} {{t|x y}}...</tt>
`friendship <npc> <amount>` | Add the given number of friendship points with the named NPC. (There are 250 points per heart.)
+
| TODO: Explain
`globalFade [speed]` | Fade to black at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished. The fade effect disappears when this command is done; to avoid that, use the `viewport` command to move the camera off-screen.
+
|-
`globalFadeToClear [speed]` | Fade to clear (unfade?) at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished.
+
| <tt>ambientLight {{t|r}} {{t|g}} &lt;b&gt;</tt>
`glow <r> <g> <b> <hold>` | Make the screen glow once. TODO: Explain hold (true/false).
+
| Set the ambient light level.
`grabObject <object ID>` | Causes the player to hold an object.
+
|-
`grandpaCandles` | Do grandpa candles
+
| <tt>animalNaming</tt>
`grandpaEvaluation` | Do grandpa evaluation
+
| Show the animal naming menu if no other menu is open. Uses the current location as Coop. Appears to only work for 'hatched' animals.
`grandpaEvaluation2` | Do grandpa evaluation (manually resummoned)
+
|-
`halt` | Make everyone stop.
+
| <tt>animate {{t|actor}} {{t|frame duration}} {{t|flip}} {{t|loop}} {{t|frames...}}</tt>
`hospitaldeath` |
+
| Animate a named actor, using the one or more {{t|frames}} from their spritesheet, for {{t|frame duration}} milliseconds per frame. {{t|flip}} indicates whether to flip the sprites along the Y axis; {{t|loop}} indicates whether to repeat the animation.
`itemAboveHead [pan|hero|sculpture|joja|slimeEgg|rod|sword|ore]` | Show an item above the player's head. If no item is specified, then they will 'hold' nothing?
+
|-
`jump <actor> [intensity]` | Make a the named NPC jump. The default `intensity` is 8.
+
| <tt>attachCharacterToTempSprite {{t|actor}}</tt>
`loadActors <layer>` | Load the actors from a layer in the map file.
+
| Attach an actor to the most recent temporary sprite.
`mail <letter ID>` | Queue a letter to be received tomorrow (see `Content\Data\mail.xnb` for available mail).
+
|-
`message "<text>"` | Show a dialogue box (no speaker). See [dialogue format](#dialogue-format) for `text` format.
+
| <tt>awardFestivalPrize</tt>
`minedeath` |
+
| Awards the festival prize to the winner for the easter egg hunt and ice fishing contest.
`move <actor> <x> <y> <facing> <continue>` | Make a named NPC move by the given tile offset from their current position (along one axis _only_), and face the given [direction](#directions) when they're done. To move along multiple axes, you must specify multiple `move` commands. TODO: explain `<continue>`
+
|-
`pause <duration>` | Pause the game for the given number of milliseconds.
+
| <tt>awardFestivalPrize {{t|item type}}</tt>
`pixelZoom <zoom>` | Sets the current pixel zoom.
+
| Awards the specified item to the player. Possible item types are "pan", "sculpture", "rod", "sword", "hero", "joja", and "slimeegg".
`playMusic <track>` | Play the specified music track ID. If the track is 'samBand', the track played will change depend on certain dialogue answers (76-79).
+
|-
`playSound <sound>` | Play a given sound ID from the game's sound bank.
+
| <tt>bloom {{t|threshold}} {{t|blur}} {{t|bloom intensity}} {{t|base intensity}} {{t|bloom saturation}} {{t|base saturation}} {{o|whiteOnly}}</tt>
`playerControl` | Give the player control back.
+
| Sets the current bloom settings. If 'whiteOnly' is not empty, then BloomSettings.brightWhiteOnly is true.
`positionOffset <actor> <x> <y>` | Offset the position of the named NPC by the given number of pixels. This happens instantly, with no walking animation.
+
|-
`proceedPosition <actor>` | TODO: Explain
+
| <tt>catQuestion</tt>
`question null "<question>#<answer1>#<answer2>"` | Show a dialogue box with some answers and an optional question. When the player chooses an answer, the event script continues with no other effect.
+
| Trigger question about adopting your pet.
`question fork<answer index> "<question>#<answer 0>#<answer 1>#..."` | Show a dialogue with some answers and an optional question. When the player chooses the answer matching the `fork<answer index>` (like `fork0` for the first answer), the `specialEventVariable1` variable is set. Usually followed by a `fork` command.
+
|-
`removeItem <object ID>` | Remove the first of an object from a player's inventory.
+
| <tt>cave</tt>
`removeObject <x> <y>` | Remove the prop at a position.
+
| Trigger the question for the farm cave type. This will work again later, however changing from bats to mushrooms will not remove the mushroom spawning objects.
`removeQuest <quest ID>` | Remove the specified quest from the quest log.
+
|-
`removeSprite <x> <y>` | Remove the temporary sprite at a position.
+
| <tt>changeLocation {{t|location}}</tt>
`removeTemporarySprites` | Remove all temporary sprites.
+
| Change to another location and run the remaining event script there.
`removeTile <x> <y> <layer>` | Remove a tile from the specified layer.
+
|-
`resetVariable` | Set the first event variable to false.
+
| <tt>changeMapTile {{t|layer}} {{t|x}} {{t|y}} {{t|tile index}}</tt>
`rustyKey` | Gives the player the rusty key. (Sewer key)
+
| Change the specified tile to a particular value.
`screenFlash <alpha>` | Game1.flashAlpha = alpha;
+
|-
`setRunning` | Set the player as running.
+
| <tt>changePortrait {{t|npc}} {{t|portrait}}</tt>
`shake <actor> <duration>` | Shake the named NPC for the given number of milliseconds.
+
| Change the NPC's portrait to be from "Portraits/{{t|actor}}_<sprite&gt".
`showFrame farmer flip` | Flip the farmer's current sprite along the Y axis. TODO: Behavior with farmer looks strange?
+
|-
`showFrame <actor> <frame ID>` | Set the named NPC's current frame in their `Content\Characters\*.xnb` spritesheet. TODO: Behavior with farmer looks strange?
+
| <tt>changeSprite {{t|actor}} {{t|sprite}}</tt>
`showRivalFrame <frame>` | Set the 'rival' actor's sprite to a specific frame.
+
| Change the actor's sprite to be from "Characters/{{t|actor}}_{{t|sprite}}".
`skippable` | Allow skipping this event.
+
|-
`speak <character> "<text>"` | Show dialogue text from a named NPC; see [dialogue format](#dialogue-format).
+
| <tt>changeToTemporaryMap {{t|map}} {{o|pan}}</tt>
`specificTemporarySprite <sprite> [other params]` | Shows the given temporary sprite. Parameters change depending on the sprite.
+
| Change the location to a temporary one loaded from the map file specified by {{t|map}}. The {{o|pan}} argument indicates the tile coordinates to pan to (defaults to <tt>0, 0</tt>).
`speed farmer <modifier>` | Add a speed modifier to the farmer. TODO: for the next action only?
+
|-
`speed <actor> <speed>` | Sets the named NPC's speed (default speed is 3). Not applicable to the farmer. TODO: for the next action only?
+
| <tt>changeYSourceRectOffset {{t|npc}} {{t|offset}}</tt>
`splitSpeak <actor> "<text>"` | Dialogue, but chosen based on previous answer. ('~' is the separator used.)
+
| Change the NPC's vertical texture offset (?).
`startJittering` | Make the player start jittering.
+
|-
`stopAdvancedMoves` | Stop movement from advancedMove.
+
| <tt>characterSelect</tt>
`stopAnimation farmer` | Stop the farmer's current animation.
+
| Seemingly unused. Sets Game1.gameMode to 5 and Game1.menuChoice = 0.
`stopAnimation <actor> <end frame>` | Stop the named NPC's current animation. Not applicable to the farmer.
+
|-
`stopGlowing` | Make the screen stop glowing.
+
| <tt>cutscene {{t|cutscene}}</tt>
`stopJittering` | Make the player stop jittering.
+
| Activate a cutscene. See cutscene list. (TODO: Pull list from my event editor)
`stopMusic` | Stop any currently playing music.
+
|-
`stopRunning` | Make the farmer stop running.
+
| <tt>doAction {{t|x}} {{t|y}}</tt>
`stopSwimming <actor>` | Make an actor stop swimming.
+
| TODO: Explain GameLocation.checkAction(new Location(x,y), viewport, player)
`swimming <actor>` | Make an actor start swimming.
+
|-
`switchEvent <event ID>` | Changes the current event (ie. event commands) to another event in the same location.
+
| <tt>elliotbooktalk</tt>
`taxvote` | Trigger voting for or against a 3% shipping tax. (No effect on game?)
+
| Elliot book talk.
`temporarySprite <x> <y> <row in texture> <animation length> <animation interval> <flipped> <loop count>` | Create a temporary sprite with the given parameters.
+
|-
`textAboveHead <actor> "<text>"` | Show a small text bubble over the named NPC's head with the given text; see [dialogue format](#dialogue-format).
+
| <tt>emote {{t|actor}} {{t|emote ID}}</tt>
`tutorialMenu` | Show the tutorial menu if no other menu is open.
+
| Make the given NPC name perform an emote, which is a little icon shown above the NPC's head. Emotes are stored in <tt>Content\TileSheets\emotes.xnb</tt> (see [https://www.reddit.com/r/StardewValley/comments/5s5m9g/help_annoyed_squiggle/ddd33qg/ list of emotes]).
`updateMinigame <event data>` | Send an event to the current minigame.
+
|-
`viewport move <x> <y> <duration>` | Pan the the camera for the given duration in milliseconds until it's centered on the given X, Y tile position.
+
| <tt>end ?</tt>
`viewport <x> <y> [true [unfreeze]|clamp [true|unfreeze]]` | Instantly reposition the camera to center on the given X, Y tile position. TODO: explain other parameters.
+
| TODO: Investigate Event.endBehaviors
`waitForKey <key> <message on finish>` | TODO: Explain
+
|-
`waitForOtherPlayers` | Wait for other players (vanilla MP).
+
| <tt>extendSourceRect {{t|actor}} reset
`warp <actor> <x> <y>` | Warp the named NPC to a position to the given X, Y tile coordinate. This can be used to warp characters off-screen.
+
| Resets the actors sprite.
`weddingSprite <frame>` | Sets the actor known as 'WeddingOutfits' to a particular frame.
+
|-
 +
| <tt>extendSourceRect {{t|actor}} {{t|horizontal}} {{t|vertical}} {{o|ignoreUpdates}}</tt>
 +
| TODO: Explain Character.extendSourceRect
 +
|-
 +
| <tt>eyes {{t|eyes}} {{t|blink}}</tt>
 +
| Change the player's eyes.
 +
|-
 +
| <tt>faceDirection {{t|actor}} {{t|direction}} {{o|continue}}</tt>
 +
| Make a named NPC face a [[#Directions|direction]]. If no parameter is supplied for [continue], the game will pause.
 +
|-
 +
| <tt>fade {{o|fadeOut}}</tt>
 +
| If 'fadeOut' is not specified, it will fade in. (?)
 +
|-
 +
| <tt>farmerAnimation {{t|anim}}</tt>
 +
| Sets the farmer's current animation.
 +
|-
 +
| <tt>farmerEat {{t|object ID}}</tt>
 +
| Make the player eat an object
 +
|-
 +
| <tt>fork {{t|event ID}} {{o|req}}</tt>
 +
| End the current command script and starts a different script with the given ID, but only if the {{o|req}} condition is met. The {{o|req}} condition can be a mail ID or dialogue answer ID; if not specified, it checks if the <tt>specialEventVariable1</tt> variable was set (e.g. by a <tt>question</tt> command). The new script should have the same format as a normal event script, but without the mandatory three start fields.
 +
|-
 +
| <tt>friendship {{t|npc}} {{t|amount}}</tt>
 +
| Add the given number of friendship points with the named NPC. (There are 250 points per heart.)
 +
|-
 +
| <tt>globalFade {{o|speed}}</tt>
 +
| Fade to black at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished. The fade effect disappears when this command is done; to avoid that, use the <tt>viewport</tt> command to move the camera off-screen.
 +
|-
 +
| <tt>globalFadeToClear {{o|speed}}</tt>
 +
| Fade to clear (unfade?) at a particular speed (default 0.007). If no speed is specified, the event will continue immediately; otherwise, it will continue after the fade is finished.
 +
|-
 +
| <tt>glow {{t|r}} {{t|g}} {{t|b}} {{t|hold}}</tt>
 +
| Make the screen glow once. TODO: Explain hold (true/false).
 +
|-
 +
| <tt>grabObject {{t|object ID}}</tt>
 +
| Causes the player to hold an object.
 +
|-
 +
| <tt>grandpaCandles</tt>
 +
| Do grandpa candles
 +
|-
 +
| <tt>grandpaEvaluation</tt>
 +
| Do grandpa evaluation
 +
|-
 +
| <tt>grandpaEvaluation2</tt>
 +
| Do grandpa evaluation (manually resummoned)
 +
|-
 +
| <tt>halt</tt>
 +
| Make everyone stop.
 +
|-
 +
| <tt>hospitaldeath</tt>
 +
|
 +
|-
 +
| <tt>itemAboveHead {{o|type}}</tt>
 +
| Show an item above the player's head. The {{o|type}} can be "pan", "hero", "sculpture", "joja", "slimeEgg", "rod", "sword", or "ore". If no item is specified, then they will 'hold' nothing?
 +
|-
 +
| <tt>jump {{t|actor}} {{o|intensity}}</tt>
 +
| Make a the named NPC jump. The default <tt>intensity</tt> is 8.
 +
|-
 +
| <tt>loadActors {{t|layer}}</tt>
 +
| Load the actors from a layer in the map file.
 +
|-
 +
| <tt>mail {{t|letter ID}}</tt>
 +
| Queue a letter to be received tomorrow (see <tt>Content\Data\mail.xnb</tt> for available mail).
 +
|-
 +
| <tt>message "{{t|text}}"</tt>
 +
| Show a dialogue box (no speaker). See [[#Dialogue format|dialogue format]] for the {{t|text}} format.
 +
|-
 +
| <tt>minedeath</tt>
 +
| TODO.
 +
|-
 +
| <tt>move {{t|actor}} {{t|x}} {{t|y}} {{t|facing}} {{t|continue}}</tt>
 +
| Make a named NPC move by the given tile offset from their current position (along one axis ''only''), and face the given [[#Directions|direction]] when they're done. To move along multiple axes, you must specify multiple <tt>move</tt> commands. TODO: explain {{t|tt}}{{t|continue}}</tt>
 +
|-
 +
| <tt>pause {{t|duration}}</tt>
 +
| Pause the game for the given number of milliseconds.
 +
|-
 +
| <tt>pixelZoom {{t|zoom}}</tt>
 +
| Sets the current pixel zoom.
 +
|-
 +
| <tt>playMusic {{t|track}}</tt>
 +
| Play the specified music track ID. If the track is 'samBand', the track played will change depend on certain dialogue answers (76-79).
 +
|-
 +
| <tt>playSound {{t|sound}}</tt>
 +
| Play a given sound ID from the game's sound bank.
 +
|-
 +
| <tt>playerControl</tt>
 +
| Give the player control back.
 +
|-
 +
| <tt>positionOffset {{t|actor}} {{t|x}} {{t|y}}</tt>
 +
| Offset the position of the named NPC by the given number of pixels. This happens instantly, with no walking animation.
 +
|-
 +
| <tt>proceedPosition {{t|actor}}</tt>
 +
| TODO: Explain
 +
|-
 +
| <tt>question null "{{t|question}}#{{t|answer1}}#{{t|answer2}}"</tt>
 +
| Show a dialogue box with some answers and an optional question. When the player chooses an answer, the event script continues with no other effect.
 +
|-
 +
| <tt>question fork{{t|answer index}} "{{t|question}}#{{t|answer 0}}#{{t|answer 1}}#..."</tt>
 +
| Show a dialogue with some answers and an optional question. When the player chooses the answer matching the <tt>fork{{t|answer index}}</tt> (like <tt>fork0</tt> for the first answer), the <tt>specialEventVariable1</tt> variable is set. Usually followed by a <tt>fork</tt> command.
 +
|-
 +
| <tt>removeItem {{t|object ID}}</tt>
 +
| Remove the first of an object from a player's inventory.
 +
|-
 +
| <tt>removeObject {{t|x}} {{t|y}}</tt>
 +
| Remove the prop at a position.
 +
|-
 +
| <tt>removeQuest {{t|quest ID}}</tt>
 +
| Remove the specified quest from the quest log.
 +
|-
 +
| <tt>removeSprite {{t|x}} {{t|y}}</tt>
 +
| Remove the temporary sprite at a position.
 +
|-
 +
| <tt>removeTemporarySprites</tt>
 +
| Remove all temporary sprites.
 +
|-
 +
| <tt>removeTile {{t|x}} {{t|y}} {{t|layer}}</tt>
 +
| Remove a tile from the specified layer.
 +
|-
 +
| <tt>resetVariable</tt>
 +
| Set the first event variable to false.
 +
|-
 +
| <tt>rustyKey</tt>
 +
| Gives the player the rusty key. (Sewer key)
 +
|-
 +
| <tt>screenFlash {{t|alpha}}</tt>
 +
| Game1.flashAlpha = alpha;
 +
|-
 +
| <tt>setRunning</tt>
 +
| Set the player as running.
 +
|-
 +
| <tt>shake {{t|actor}} {{t|duration}}</tt>
 +
| Shake the named NPC for the given number of milliseconds.
 +
|-
 +
| <tt>showFrame farmer flip</tt>
 +
| Flip the farmer's current sprite along the Y axis. TODO: Behavior with farmer looks strange?
 +
|-
 +
| <tt>showFrame {{t|actor}} {{t|frame ID}}</tt>
 +
| Set the named NPC's current frame in their <tt>Content\Characters\*.xnb</tt> spritesheet. TODO: Behavior with farmer looks strange?
 +
|-
 +
| <tt>showRivalFrame {{t|frame}}</tt>
 +
| Set the 'rival' actor's sprite to a specific frame.
 +
|-
 +
| <tt>skippable</tt>
 +
| Allow skipping this event.
 +
|-
 +
| <tt>speak {{t|character}} "{{t|text}}"</tt>
 +
| Show dialogue text from a named NPC; see [[#Dialogue format|dialogue format]].
 +
|-
 +
| <tt>specificTemporarySprite {{t|sprite}} {{o|other params}}</tt>
 +
| Shows the given temporary sprite. Parameters change depending on the sprite.
 +
|-
 +
| <tt>speed farmer {{t|modifier}}</tt>
 +
| Add a speed modifier to the farmer. TODO: for the next action only?
 +
|-
 +
| <tt>speed {{t|actor}} {{t|speed}}</tt>
 +
| Sets the named NPC's speed (default speed is 3). Not applicable to the farmer. TODO: for the next action only?
 +
|-
 +
| <tt>splitSpeak {{t|actor}} "{{t|text}}"</tt>
 +
| Dialogue, but chosen based on previous answer. ('~' is the separator used.)
 +
|-
 +
| <tt>startJittering</tt>
 +
| Make the player start jittering.
 +
|-
 +
| <tt>stopAdvancedMoves</tt>
 +
| Stop movement from advancedMove.
 +
|-
 +
| <tt>stopAnimation farmer</tt>
 +
| Stop the farmer's current animation.
 +
|-
 +
| <tt>stopAnimation {{t|actor}} {{t|end frame}}</tt>
 +
| Stop the named NPC's current animation. Not applicable to the farmer.
 +
|-
 +
| <tt>stopGlowing</tt>
 +
| Make the screen stop glowing.
 +
|-
 +
| <tt>stopJittering</tt>
 +
| Make the player stop jittering.
 +
|-
 +
| <tt>stopMusic</tt>
 +
| Stop any currently playing music.
 +
|-
 +
| <tt>stopRunning</tt>
 +
| Make the farmer stop running.
 +
|-
 +
| <tt>stopSwimming {{t|actor}}</tt>
 +
| Make an actor stop swimming.
 +
|-
 +
| <tt>swimming {{t|actor}}</tt>
 +
| Make an actor start swimming.
 +
|-
 +
| <tt>switchEvent {{t|event ID}}</tt>
 +
| Changes the current event (ie. event commands) to another event in the same location.
 +
|-
 +
| <tt>taxvote</tt>
 +
| Trigger voting for or against a 3% shipping tax. (No effect on game?)
 +
|-
 +
| <tt>temporarySprite {{t|x}} {{t|y}} {{t|row in texture}} {{t|animation length}} {{t|animation interval}} {{t|flipped}} {{t|loop count}}</tt>
 +
| Create a temporary sprite with the given parameters.
 +
|-
 +
| <tt>textAboveHead {{t|actor}} "{{t|text}}"</tt>
 +
| Show a small text bubble over the named NPC's head with the given text; see [[#Dialogue format|dialogue format]].
 +
|-
 +
| <tt>tutorialMenu</tt>
 +
| Show the tutorial menu if no other menu is open.
 +
|-
 +
| <tt>updateMinigame {{t|event data}}</tt>
 +
| Send an event to the current minigame.
 +
|-
 +
| <tt>viewport move {{t|x}} {{t|y}} {{t|duration}}</tt>
 +
| Pan the the camera for the given duration in milliseconds until it's centered on the given X, Y tile position.
 +
|-
 +
| <tt>viewport {{t|x}} {{t|y}} [true [unfreeze]&#124;clamp [true&#124;unfreeze]]</tt>
 +
| Instantly reposition the camera to center on the given X, Y tile position. TODO: explain other parameters.
 +
|-
 +
| <tt>waitForKey {{t|key}} {{t|message on finish}}</tt>
 +
| TODO: Explain
 +
|-
 +
| <tt>waitForOtherPlayers</tt>
 +
| Wait for other players (vanilla MP).
 +
|-
 +
| <tt>warp {{t|actor}} {{t|x}} {{t|y}}</tt>
 +
| Warp the named NPC to a position to the given X, Y tile coordinate. This can be used to warp characters off-screen.
 +
|-
 +
| <tt>weddingSprite {{t|frame}}</tt>
 +
| Sets the actor known as 'WeddingOutfits' to a particular frame.
 +
|}
   −
### Directions
+
===Directions===
 
When event commands refer to a facing direction, they'll use one of these values:
 
When event commands refer to a facing direction, they'll use one of these values:
   −
Value | Meaning
+
{| class="wikitable"
----- | -------
+
|-
0     | looking up
+
! Value
1     | looking right
+
! Meaning
2     | looking down
+
|-
3     | looking left
+
| 0
 +
| looking up
 +
|-
 +
| 1
 +
| looking right
 +
|-
 +
| 2
 +
| looking down
 +
|-
 +
| 3
 +
| looking left
 +
|}
   −
### Dialogue format
+
===Dialogue format===
Some event commands (like `speak`, `textAboveHead`, and `message`) take a dialogue message which
+
Some event commands (like <tt>speak</tt>, <tt>textAboveHead</tt>, and <tt>message</tt>) take a dialogue message which supports special tokens to control the dialogue box.
supports special tokens to control the dialogue box.
      
Special tokens:
 
Special tokens:
   −
character | description
+
{| class="wikitable"
--------- |-------------
+
|-
`#`      | Separates two commands in a dialogue string.
+
! character
`{`      | TODO. Stands for "breakSpecialCharacter".
+
! description
`^`      | Gender switch character. The text before it is shown for male farmers, the text after it for female farmers.<br />_Example: `Oh, good morning Mr. @!^Oh, good morning Ms. @!`_
+
|-
`*`      | TODO. Stands for "quickResponseDelineator".
+
| <tt>#</tt>
 +
| Separates two commands in a dialogue string.
 +
|-
 +
| <tt>{</tt>
 +
| TODO. Stands for "breakSpecialCharacter".
 +
|-
 +
| <tt>^</tt>
 +
| Gender switch character. The text before it is shown for male farmers, the text after it for female farmers.<br />''Example: <code>Oh, good morning Mr. @!^Oh, good morning Ms. @!</code>''
 +
|-
 +
| <tt>*</tt>
 +
| TODO. Stands for "quickResponseDelineator".
 +
|}
    
Dialogue commands:
 
Dialogue commands:
   −
group     | command | description
+
{| class="wikitable"
--------- | ------- |-------------
+
|-
portraits | `$h` | Switch the speaking character to their happy portrait.
+
! group
portraits | `$s` | Switch the speaking character to their sad portrait.
+
! command
portraits | `$u` | Switch the speaking character to their unique portrait.
+
! description
portraits | `$neutral` | Switch the speaking character to their neutral portrait.
+
|-
portraits | `$l` | Switch the speaking character to their love portrait.
+
| portraits
portraits | `$a` | Switch the speaking character to their angry portrait.
+
| <tt>$h</tt>
portraits | `$<id>` | Switch the speaking character to the portrait at the given index in their portraits file. NOTE: `$1` can't be used as the first dialogue command (see `$1` below).
+
| Switch the speaking character to their happy portrait.
dialogue | `$q <?> <?>#<text>` | TODO. Show a dialogue box containing the given question text.
+
|-
dialogue | `$r <?> <?> <response ID>#<answer text>` | TODO. Adds an `<answer text>` option to the question dialogue, which when selected triggers the response indicated by `<response ID>` from the speaker's `Content\Characters\Dialogue\*.xnb` file.
+
| portraits
dialogue | `$e` | End the current dialogue. Everything before `$e` is shown the first time you talk to an NPC; everything after is shown in subsequent conversations.
+
| <tt>$s</tt>
dialogue | `$b` | End the current textbox, so the next part of the dialogue is shown in a new box.
+
| Switch the speaking character to their sad portrait.
dialogue | `$k` | TODO. Stands for "dialogueKill".
+
|-
dialogue | `$c <probability>` | Choose the given text with a `probability` between 0 and 1.
+
| portraits
dialogue | `$d {bus|joja|cc}` | TODO. Stands for "dialogueDependingOnWorldState".
+
| <tt>$u</tt>
dialogue | `$y` | TODO. Stands for "dialogueQuickResponse"; works like $q, but within one and the same text line.
+
| Switch the speaking character to their unique portrait.
dialogue | `$p` | TODO. Stands for "dialoguePrerequisite".
+
|-
dialogue | `$1` | TODO. When used as the first dialogue command, stands for "dialogueSingle". Possibly a check for whether the player is dating (the speaking character?).
+
| portraits
dialogue | `%fork` | TODO. Seems to have to do with questions and forks, however is used sparingly in originals game code. Seems to be replaced with the actual question command.
+
| <tt>$neutral</tt>
content   | `@| Replaced with the player's name.<br />_Example: `Hi there @!`_
+
| Switch the speaking character to their neutral portrait.
content   | `%adj` | Replaced with a random adjective.
+
|-
content   | `%noun` | Replaced with a random noun.
+
| portraits
content   | `%place` | Replaced with a random place name.
+
| <tt>$l</tt>
content   | `%spouse` | Replaced with the name of the farmer's spouse.
+
| Switch the speaking character to their love portrait.
content   | `%name` | TODO. Stands for "randomNameSpecialCharacter". Seems to return a random name?  
+
|-
content   | `%firstnameletter` | TODO. Stands for "firstNameLettersSpecialCharacter".
+
| portraits
content   | `%time` | Replaced with the current time.
+
| <tt>$a</tt>
content   | `%band` | TODO.
+
| Switch the speaking character to their angry portrait.
content   | `%book` | TODO.
+
|-
content   | `%rival` | TODO.
+
| portraits
content   | `%pet` | Replaced with the name of the farmer's pet.
+
| <tt>${{t|id}}</tt>
content   | `%farm` | Replaced with the farm name.
+
| Switch the speaking character to the portrait at the given index in their portraits file. NOTE: <tt>$1</tt> can't be used as the first dialogue command (see <tt>$1</tt> below).
content   | `%favorite` | TODO. Returns favorite thing? Unused?
+
|-
content   | `%kid1` | Replaced with the name of the farmer's first child.
+
| dialogue
content   | `%kid2` | Replaced with the name of the farmer's second child.
+
| <tt>$q {{t|?}} {{t|?}}#{{t|text}}</tt>
 +
| TODO. Show a dialogue box containing the given question text.
 +
|-
 +
| dialogue
 +
| <tt>$r {{t|?}} {{t|?}} {{t|response ID}}#{{t|answer text}}</tt>
 +
| TODO. Adds an {{t|answer text}} option to the question dialogue, which when selected triggers the response indicated by {{t|response ID}} from the speaker's <tt>Content\Characters\Dialogue\*.xnb</tt> file.
 +
|-
 +
| dialogue
 +
| <tt>$e</tt>
 +
| End the current dialogue. Everything before <tt>$e</tt> is shown the first time you talk to an NPC; everything after is shown in subsequent conversations.
 +
|-
 +
| dialogue
 +
| <tt>$b</tt>
 +
| End the current textbox, so the next part of the dialogue is shown in a new box.
 +
|-
 +
| dialogue
 +
| <tt>$k</tt>
 +
| TODO. Stands for "dialogueKill".
 +
|-
 +
| dialogue
 +
| <tt>$c {{t|probability}}</tt>
 +
| Choose the given text with a {{t|probability}} between 0 and 1.
 +
|-
 +
| dialogue
 +
| <tt>$d {bus|joja|cc}</tt>
 +
| TODO. Stands for "dialogueDependingOnWorldState".
 +
|-
 +
| dialogue
 +
| <tt>$y</tt>
 +
| TODO. Stands for "dialogueQuickResponse"; works like $q, but within one and the same text line.
 +
|-
 +
| dialogue
 +
| <tt>$p</tt>
 +
| TODO. Stands for "dialoguePrerequisite".
 +
|-
 +
| dialogue
 +
| <tt>$1</tt>
 +
| TODO. When used as the first dialogue command, stands for "dialogueSingle". Possibly a check for whether the player is dating (the speaking character?).
 +
|-
 +
| dialogue
 +
| <tt>%fork</tt>
 +
| TODO. Seems to have to do with questions and forks, however is used sparingly in originals game code. Seems to be replaced with the actual question command.
 +
|-
 +
| content
 +
| <tt>@</tt>
 +
| Replaced with the player's name.<br />''Example: <code>Hi there @!</code>''
 +
|-
 +
| content
 +
| <tt>%adj</tt>
 +
| Replaced with a random adjective.
 +
|-
 +
| content
 +
| <tt>%noun</tt>
 +
| Replaced with a random noun.
 +
|-
 +
| content
 +
| <tt>%place</tt>
 +
| Replaced with a random place name.
 +
|-
 +
| content
 +
| <tt>%spouse</tt>
 +
| Replaced with the name of the farmer's spouse.
 +
|-
 +
| content
 +
| <tt>%name</tt>
 +
| TODO. Stands for "randomNameSpecialCharacter". Seems to return a random name?  
 +
|-
 +
| content
 +
| <tt>%firstnameletter</tt>
 +
| TODO. Stands for "firstNameLettersSpecialCharacter".
 +
|-
 +
| content
 +
| <tt>%time</tt>
 +
| Replaced with the current time.
 +
|-
 +
| content
 +
| <tt>%band</tt>
 +
| TODO.
 +
|-
 +
| content
 +
| <tt>%book</tt>
 +
| TODO.
 +
|-
 +
| content
 +
| <tt>%rival</tt>
 +
| TODO.
 +
|-
 +
| content
 +
| <tt>%pet</tt>
 +
| Replaced with the name of the farmer's pet.
 +
|-
 +
| content
 +
| <tt>%farm</tt>
 +
| Replaced with the farm name.
 +
|-
 +
| content
 +
| <tt>%favorite</tt>
 +
| TODO. Returns favorite thing? Unused?
 +
|-
 +
| content
 +
| <tt>%kid1</tt>
 +
| Replaced with the name of the farmer's first child.
 +
|-
 +
| content
 +
| <tt>%kid2</tt>
 +
| Replaced with the name of the farmer's second child.
 +
|}
   −
## See also
+
==See also==
* [JavaScript to parse an event precondition string](https://gist.github.com/Pathoschild/95efc5ba5a23dc2c4da219ca2ddde679)
+
* [https://gist.github.com/Pathoschild/95efc5ba5a23dc2c4da219ca2ddde679 JavaScript to parse an event precondition string]
</pre>
      
[[Category:Modding]]
 
[[Category:Modding]]
translators
8,447

edits

Navigation menu