Modding:Event data

From Stardew Valley Wiki
Jump to: navigation, search

Index

This page explains how the game stores and parses event data. This is an advanced guide for mod developers.

Source

Events are stored in Content\Data\Events\*.xnb (one file per location), which can be unpacked using XNB Extract.

Here's the raw data for saloon events as of 1.3.27 for reference (excluding XNB headers):

content:  #!Dictionary<String,String>
    40/f Elliott 1000/p Gus/t 1500 2200: "playful/11 20/farmer 14 24 0 Elliott -30 -30 0 Clint 18 22 2 Marnie 9 22 3 Pam 7 18 1 Lewis 8 22 1 Pierre 4 22 2 Demetrius 3 23 1 Gus 14 18 2 Emily 16 18 3/skippable/move farmer 0 -3 3/faceDirection Pierre 1 true/move farmer -3 0 0/faceDirection Pierre 2 true/move farmer 0 -1 0/faceDirection Marnie 0 true/faceDirection Gus 3/speak Gus \"Hi. I'll take your order in a few moments.\"/faceDirection Gus 2/move Emily 2 0 1/faceDirection Marnie 3 true/pause 800/move Emily -2 0 0/pause 1000/faceDirection Clint 3 true/move Emily 2 0 1/warp Elliott 14 24/playSound doorClose/pause 500/move Elliott 0 -3 3/faceDirection farmer 2 true/move Elliott -2 0 0/move Elliott 0 -1 0/faceDirection farmer 1/faceDirection Elliott 3/speak Elliott \"Hello, @! What a pleasant surprise!#$b#I was just stopping in to relax after an eight hour writing session.$h\"/pause 400/faceDirection Elliott 1/speak Elliott \"Bartender! Two of your finest ales, please!^Bartender! Fetch me your finest ale. And bring some wine for the lady!\"/faceDirection Gus 3/faceDirection farmer 0/speak Gus \"...$u\"/move Gus 3 0 0/move Gus 0 -1 0/faceDirection Emily 2/playSound openBox/pause 400/playSound Milking/move Pam -6 0 0/move Gus 0 1 3/move Gus -5 0 2/faceDirection Elliott 0/pause 500/speak Gus \"There you go, sir.$u\"/pause 500/faceDirection Elliott 3/faceDirection farmer 1/speak Elliott \"$q 28376 null#Wait. I propose a toast! To...#$r 28376 25 event_toast4#To Pelican Town!#$r 28376 50 event_toast2#To our friendship!#$r 28376 -10 event_toast1#To my good health!#$r 28376 -50 event_toast3#To your doom!\"/faceDirection Elliott 2/faceDirection farmer 2/pause 900/showFrame Elliott 16/animate Elliott false false 120 16 17 18 19 19 18 18 19 19 18 18 19 19 18 18 19 19 18 18 17 16/pause 500/farmerEat 346/pause 900/pause 1100/stopAnimation farmer/faceDirection farmer 1/speak Elliott \"*Hic*... Strong stuff...$h\"/pause 800/animate Elliott false false 400 20 21 22 21 20 21 22 21 20 21 22 21 20 21 22 21 16/pause 1000/faceDirection farmer 1/pause 800/faceDirection farmer 2/animate farmer false true 100 102 103/pause 1000/globalFade/viewport -1000 -1000/pause 600/stopAnimation farmer/end warpOut" #!String
    96/f Gus 1000/f Pam 500/p Gus: "jaunty/10 21/farmer -100 -100 0 Gus 10 21 2 Pam -101 -101 0/skippable/pause 200/emote Gus 28/pause 500/playSound doorClose/warp farmer 14 24/pause 500/faceDirection Gus 1 true/move farmer 0 -3 3/speak Gus \"Oh, Hello there, buddy.^Hi, @.\"/pause 500/faceDirection Gus 2/move farmer -3 0 2/pause 800/faceDirection farmer 3/pause 400/emote farmer 8/pause 700/speak Gus \"*sigh*...I'm just looking over last month's earnings... and It's not looking very good, @.$s#$b#The worst thing... and I hate to say this because she's my friend... is Pam! She hasn't paid off her tab in weeks!$s#$b#...But I can't ask her to do it. I know she'll get defensive, and I don't want to hurt her feelings.$s\"/pause 600/faceDirection Gus 1/speak Gus \"@, you gotta help me!$s\"/stopMusic/pause 500/playSound doorClose/warp Pam 14 24/move Pam 0 -3 3/faceDirection Gus 1 true/faceDirection farmer 1/emote Gus 16/speak Pam \"Hiya!$h#$b#Gus... I'm awful thirsty, if you catch my drift.\"/emote Gus 28/speak Gus \"Er... Well, okay Pam.$s\"/emote Gus 28/pause 700/emote Pam 8/pause 400/speak Pam \"$q 207 null#@, what's going on here?#$r 207 -50 event_credit1#You need to pay your tab right now!#$r 208 15 event_credit2#The saloon isn't doing well, financially\"/pause 400/faceDirection Pam 1/emote Pam 12/speak Pam \"....$u#$b#*sigh* ...Well, I guess I'd better pay off that tab, then.$s\"/move Pam -2 0 0/move Pam 0 -1 3/move Pam -2 0 2/faceDirection Gus 0/faceDirection farmer 3/playSound money/pause 500/speak Gus \"Thanks, Pam!$h\"/pause 500/faceDirection Gus 1/speak Gus \"And thank you, @.$u\"/pause 500/faceDirection Gus 0/speak Gus \"Now, let's get you that drink, Pam.$h\"/friendship Gus 50/end dialogue Gus \"Thanks for your help, @. This cash is going to be a big help to the saloon.\"" #!String
    97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun: "none/4 18/farmer 14 24 0 Clint 4 19 2 Emily 10 11 0 Gus 15 18 1 Shane 7 18 1/skippable/move farmer 0 -3 3/emote Clint 28/pause 500/move Clint 0 -1 3/move Clint -3 0 0/pause 500/playSound openBox/pause 150/playSound shiny4/pause 400/playMusic desolate/move Clint 3 0 2/move Clint 0 1 2/move farmer -3 0 0/move farmer 0 -1 3/faceDirection Shane 2 true/move farmer -3 0 3/faceDirection Shane 1 true/move farmer -3 0 3/faceDirection Clint 1/speak Clint \"Hello, @... care to join me?\"/pause 400/faceDirection farmer 0/pause 800/faceDirection farmer 3/faceDirection Clint 2/speak Clint \"Let me just go ahead and tell you what's on my mind.$u#$b#I have terrible luck with women, @...*sigh*$s#$b#I'm a nice guy if you get to know me, I swear!$u\"/pause 500/faceDirection farmer 0/emote farmer 28/pause 500/faceDirection farmer 3/speak Clint \"The girls all seem to like you, @...^You're a girl, @...\"/speak Clint \"$q 211 null#Got any tips?^What advice can you give me?#$r 211 25 event_advice1#Impress women with your strength and charm#$r 211 25 event_advice1#Act crazy, to keep people guessing#$r 211 0 event_advice2#Just act natural... be yourself#$r 211 50 event_advice1#Treat women the same as men\"/speed Emily 4/move Emily -6 0 2/speed Emily 2/move Emily 0 4 2/doAction 4 16/playSound openBox/stopMusic/move Emily 0 3 1/move Emily 1 0 2/move Emily 0 1 3/pause 400/pause 700/speak Emily \"Hi Clint, what can I get for you tonight?$h\"/pause 600/faceDirection Clint 1/pause 200/speak Clint \"Yes!\"/pause 300/speak Clint \"Er.. I mean, I'll have the Big n' Cheesy. With extra sauce, please.$s#$b#...$u\"/faceDirection Clint 3/faceDirection Emily 2/pause 300/faceDirection Clint 2/speak Emily \"Hi @.\"/pause 300/faceDirection farmer 0/faceDirection Clint 1/speak Clint \"Er... *ahem* Th...Thanks, Emily. For... taking my order.#$b#Um, Emily? I was...*gulp*... I was wondering...$h\"/pause 300/faceDirection Emily 3/emote Emily 8/pause 400/speak Emily \"Yes, Clint?$u\"/pause 500/emote Clint 28/pause 1200/speak Clint \"... nevermind.$s\"/faceDirection Clint 0/playMusic sadpiano/pause 300/faceDirection Emily 2/pause 300/faceDirection Emily 3/pause 500/move Emily 0 -1 1/move Emily 1 0 1/faceDirection Shane 3/speak Emily \"Hi, Shane! Here's your beverage.$h\"/pause 300/faceDirection Shane 1/pause 400/addObject 8 17 346 1/playSound woodyStep/pause 400/faceDirection Shane 3/pause 300/faceDirection Clint 1/speak Shane \"Thanks, Emily!$h#$b#So... How's your shift coming along?\"/speak Emily \"It's fine! Thanks for asking, Shane!$h#$b#Do you have any new chicken stories for me?\"/pause 600/emote Clint 28/pause 500/faceDirection Clint 2/pause 800/speak Clint \"*sigh*$s#$b#I'm doomed...$s\"/end warpOut" #!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
    195099/f Shane 2500/f Sebastian 2500/f Sam 2500/f Harvey 2500/f Alex 2500/f Elliott 2500/o Abigail/o Penny/o Leah/o Emily/o Maru/o Haley/o Shane/o Harvey/o Sebastian/o Sam/o Elliott/o Alex/e 911526/e 528052/e 9581348/e 43/e 384882/e 233104/i 446/k 195013: "playful/-1000 -1000/farmer 27 19 1 Sam 36 20 1 Sebastian 37 19 2 Harvey 39 19 2 Shane 40 17 2 Elliott 41 19 2 Alex 42 20 3/animate Shane false true 200 20 20 20 20 20 20 20 20 20 20 21 22 23 24 24 24 24 23 22 21 20 20 20 20/pause 1000/message \"For some reason, you decide to place your hand in your pocket...\"/pause 500/message \"You touch the rabbit's foot, and feel a sense of relief...\"/move farmer 5 0 1 true/viewport 37 19 true/move false/pause 500/faceDirection Sam 3 true/faceDirection Elliott 3 true/faceDirection Harvey 3 true/faceDirection Alex 3 true/faceDirection Shane 3 true/faceDirection Sebastian 3 true/textAboveHead Sam \"Hey!\"/textAboveHead Alex \"What's up?\"/textAboveHead Shane \"Oh, hey\"/pause 2000/move farmer 3 0 1/emote farmer 32/pause 500/speak Harvey \"You showed up just in time for the first ever Pelican Town 8-ball tournament!\"/pause 500/speak Elliott \"Don't worry, I've never played before, either.$h\"/pause 500/speak Shane \"It's easy, you just gotta put some mustard on the cue ball...$h\"/pause 500/fade/viewport -1000 -1000/pause 1500/message \"You played a round of pool with the boys.\"/pause 1000/message \"Sebastian won, of course... but it was still a lot of fun!\"/pause 500/end" #!String
    195013/f Shane 2500/f Sebastian 2500/f Sam 2500/f Harvey 2500/f Alex 2500/f Elliott 2500/o Abigail/o Penny/o Leah/o Emily/o Maru/o Haley/o Shane/o Harvey/o Sebastian/o Sam/o Elliott/o Alex/e 911526/e 528052/e 9581348/e 43/e 384882/e 233104/k 195099: "playful/-1000 -1000/farmer 27 19 1 Sam 36 20 1 Sebastian 37 19 2 Harvey 39 19 2 Shane 40 17 2 Elliott 41 19 2 Alex 42 20 3/animate Shane false true 200 20 20 20 20 20 20 20 20 20 20 21 22 23 24 24 24 24 23 22 21 20 20 20 20/move farmer 5 0 1 true/viewport 37 19 true/move false/pause 500/startJittering/faceDirection farmer 2 true/animate farmer false true 100 94/jump farmer/pause 2000/stopAnimation farmer/showFrame farmer 0/stopJittering/playSound thudStep/faceDirection farmer 3 true/showFrame farmer 7 true/startJittering/faceDirection Sam 3 true/faceDirection Elliott 3 true/faceDirection Harvey 3 true/faceDirection Alex 3 true/faceDirection Shane 3 true/faceDirection Sebastian 3 true/textAboveHead Sam \"Not so fast!\"/textAboveHead Alex \"Hold it!\"/textAboveHead Shane \"Stop!\"/pause 3000/stopJittering/showFrame farmer 6 true/pause 500/faceDirection farmer 1/move farmer 3 0 1/playMusic none/emote farmer 28/pause 500/speak Sam \"Never thought you'd find all your 'boyfriends' in one room, huh @?$a\"/pause 500/speak Harvey \"You tricked all of us into thinking we loved you...$s^@... I thought you wanted to get married and start a family with me... What did I do wrong?$s\"/pause 500/speak Shane \"The last shred of hope I had left is completely destroyed... Thanks, @. Are you happy now?$s\"/pause 500/speak Alex \"@? I thought... I thought we were 'one of a kind'... But you were just using me?$s^What are you looking at *me* for? You think I'm gonna come to your rescue?$a\"/pause 500/speak Elliott \"For once, I'm at a loss for words... $a\"/pause 500/playMusic wedding/speak Sam \"Well, we're not going to put up with your abuse any longer!$a^We all know the truth, now! And we're not going to tolerate this!$a\"/textAboveHead Alex \"That's right!\"/pause 500/speak Sebastian \"Well? What do you have to say for yourself?$a\"/pause 1000/question fork1 \"#I'm sorry... what I did was wrong.#Guys, calm down! I can explain...#\"/fork choseToExplain/pause 500/textAboveHead Alex \"Sure...\"/pause 500/speak Shane \"Nice try, but that's not going to cut it...$a\"/pause 1000/playMusic none/speak Sam \"...so we've come to a decision... isn't that right, fellas?$u\"/pause 500/speak Harvey \"...yes.$s\"/speak Elliott \"Absolutely.$a\"/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/speak Sam \"We're all giving you the cold shoulder!$a\"/faceDirection farmer 2 true/animate farmer false true 100 94/jump farmer/playSound slimedead/pause 2000/fade/viewport -2000 -2000/dump guys 3/end warpOut" #!String
    choseToExplain: "pause 100/textAboveHead Shane \"I doubt it...\"/pause 500/resetVariable/question fork2 \"#You were all too pushy with me! You made it difficult to say 'no'!#Pierre pressured me! He wanted to sell more bouquets!#(Start crying)/pause 100/fork crying/textAboveHead Sam \"Liar!\"/textAboveHead Alex \"Yeah, right!\"/speak Elliott \"Don't blame others for your mistakes! You're just losing more respect with us...$a\"/pause 1000/faceDirection Sam 2/playMusic none/speak Sam \"...I think we've come to a decision... isn't that right, boys?$u\"/pause 500/speak Harvey \"...yes.$s\"/speak Sebastian \"Absolutely.$a\"/faceDirection Sam 3/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/speak Sam \"We're all giving you the cold shoulder!$a\"/faceDirection farmer 2 true/animate farmer false true 100 94/jump farmer/playSound slimedead/pause 2000/fade/viewport -2000 -2000/dump guys 4/end warpOut" #!String
    crying: "pause 100/faceDirection farmer 0/emote farmer 28/pause 1000/emote Harvey 12 true/emote Sebastian 12 true/emote Shane 12 true/emote Sam 12 true/emote Elliott 12 true/emote Alex 12 true/speak Harvey \"That's not going to work! You won't be preying on our sympathies this time!$a\"/speak Alex \"I'll assume this is just another act...$a^Typical...$a\"/pause 100/speak Sebastian \"You need to take responsibility for what you've done...$a\"/pause 1000/faceDirection Sam 2/playMusic none/speak Sam \"...I think we've come to a decision... isn't that right, boys?$u\"/pause 500/speak Harvey \"...yes.$s\"/speak Sebastian \"Absolutely.$a\"/faceDirection Sam 3/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/jump Sam/jump Sebastian/jump Elliott/jump Shane/jump Alex/jump Harvey/pause 1000/speak Sam \"We're all giving you the cold shoulder!$a\"/faceDirection farmer 2 true/animate farmer false true 100 94/jump farmer/playSound slimedead/pause 2000/fade/viewport -2000 -2000/dump guys 4/end warpOut" #!String

Event preconditions

Each event has a key which includes an event ID and any preconditions. Event preconditions include any number of the following arguments (separated by /). For example, Clint's Saloon heart event preconditions are 97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun, which (per the tables below) means event #97, requires 3 hearts with Clint, between 7pm and 11pm on Monday.

Notes:

  • 'NPC name' means their internal English name, not the translatable display name.
  • Most text is case-sensitive (e.g. Mon is not the same as mon).
  • The game's logic for these codes is in GameLocation::checkEventPrecondition.

Context

These check the current time, date, weather, etc. They're not player-specific.

syntax precondition
A <dialogue ID> The special dialogue event with the given ID is not in progress. This can be a custom event ID, but these are the in-game IDs: cc_Boulder, cc_Bridge, cc_Bus, cc_Greenhouse, cc_Minecart, dumped_Girls, dumped_Guys, Introduction, joja_Begin, pamHouseUpgrade, pamHouseUpgradeAnonymous, secondChance_Girls, secondChance_Guys, willyCrabs.
F Today is not a festival day.
d <day of week> Today is not one of the specified days (may specify multiple days). Valid values: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
r <number> A random probability check, where <number> is the probability between 0 and 1 (e.g. 0.2 for 20% chance).
v <name> The specified NPC is not invisible (regardless of whether they're on-screen).
w <weather> Current weather matches <weather>. Valid values: rainy, sunny.
y <year> If <year> is 1, must be in the first year. Otherwise, year must be at least this value.
z <season> Current season is not <season>.

Current player

These check the current player (the one playing this instance of the game).

syntax precondition
D <name> Current player is dating the given NPC name.
J Current player has finished the Joja Warehouse.
M <number> Current player has at least this much money.
S <secret note ID> Current player has seen the Secret Note with the given ID.
a <x> <y> Current player is on that tile position.
b <number> Current player has reached the bottom floor of the Mines at least that many times.
c <number> Current player has at least that many free inventory slots.
e <event ID> Current player has seen the specified event (may contain multiple event IDs).
f <name> <number> Current player has at least <number> friendship points with the <name> NPC. Can specify multiple name and number pairs, in which case the player must meet all of them.
g <gender> Current player is not the specified gender (male or female).
h <pet> Current player does not already have a pet, and their preference matches <pet> ("cat" or "dog").
i <item ID> Current player has specified item in their inventory.
j <number> Current player has played more than <number> days.
k <event ID> Current player has not seen that event (may contain multiple event IDs).
l <letter ID> Current player has not received that mail letter or non-mail flag.
m <number> Current player has earned at least this much money (regardless of how much they currently have).
n <letter ID> Current player has received that mail letter or non-mail flag.
o <name> Current player is not married to that NPC.
p <name> Specified NPC is in the current player's location.
q <dialogue ID> Current player has chosen the given answer in a dialogue. May contain multiple dialogue IDs, in which case they must all have been selected.
s <item ID> <number> Current player has shipped at least <number> of the specified item. Can specify multiple item and number pairs, in which case all of them must be met.
t <min time> <max time> Current time is between between the specified times.
u <day of month> Current day of month is one of the specified values (may contain multiple days).
x <event ID> <letter ID> For the current player: mark the specified ID as seen, add the specified letter to tomorrow's mail, then return false (so the event doesn't trigger).

Host player

These check the host player (the one running a multiplayer farm, not necessarily the current player). If single-player, this is always the current player.

syntax precondition
C Host player has not finished the community center, or has not seen the grand reopening yet.
H Current player is the host player.
Hl <letter ID> Host player has not received that mail letter or non-mail flag.
Hn <letter ID> Host player has received that mail letter or non-mail flag.
*l <letter ID> Host player and current player have not received that mail letter or non-mail flag.
*n <letter ID> Host player and current player have received that mail letter or non-mail flag.

Event scripts

Basic format

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 / characters.

Every script must start with three commands in this exact order:

index syntax description
0 <music ID> The background music to play. Some example values are jaunty, ocean, and rain.
1 <x> <y> The tile coordinates the camera should center on at the start of the event.
2 <npc ID> <x> <y> <direction> Initialises an NPC's starting tile position and direction. The NPC ID can be farmer or an NPC name like Abigail.

Those three commands may be followed by any sequence of the following commands:

command description
addBigProp <x> <y> <object ID> Adds an object at the specified tile.
addCookingRecipe <recipe> Adds the specified cooking recipe to the player.
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.
addLantern <row in texture> <x> <y> <light radius> Adds a glowing temporary sprite.
addMailReceived <letter ID> Set a letter as received.
addObject <row in texture> <x> <y> Adds a temporary sprite at the specified tile.
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.
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.
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.
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
ambientLight <r> <g> <b> Set the ambient light level.
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> <flip> <loop> <frame duration> <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.
attachCharacterToTempSprite <actor> Attach an actor to the most recent temporary sprite.
awardFestivalPrize Awards the festival prize to the winner for the easter egg hunt and ice fishing contest.
awardFestivalPrize <item type> Awards the specified item to the player. Possible item types are "pan", "sculpture", "rod", "sword", "hero", "joja", and "slimeegg".
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.
catQuestion Trigger question about adopting your pet.
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.
changeMapTile <layer> <x> <y> <tile index> Change the specified tile to a particular value.
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>".
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).
changeYSourceRectOffset <npc> <offset> Change the NPC's vertical texture offset (?).
characterSelect Seemingly unused. Sets Game1.gameMode to 5 and Game1.menuChoice = 0.
cutscene <cutscene> Activate a cutscene. See cutscene list. (TODO: Pull list from my event editor)
doAction <x> <y> TODO: Explain GameLocation.checkAction(new Location(x,y), viewport, player)
elliotbooktalk Elliot book talk.
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).
end ? TODO: Investigate Event.endBehaviors
extendSourceRect <actor> reset Resets the actors sprite.
<tt>extendSourceRect <actor> <horizontal> <vertical> [ignoreUpdates] TODO: Explain Character.extendSourceRect
eyes <eyes> <blink> Change the player's eyes.
faceDirection <actor> <direction> [continue] Make a named NPC face a direction. If no parameter is supplied for [continue], the game will pause.
fade [fadeOut] If 'fadeOut' is not specified, it will fade in. (?)
farmerAnimation <anim> Sets the farmer's current animation.
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.
friendship <npc> <amount> Add the given number of friendship points with the named NPC. (There are 250 points per heart.)
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.
glow <r> <g> <b> <hold> Make the screen glow once. TODO: Explain hold (true/false).
grabObject <object ID> Causes the player to hold an object.
grandpaCandles Do grandpa candles
grandpaEvaluation Do grandpa evaluation
grandpaEvaluation2 Do grandpa evaluation (manually resummoned)
halt Make everyone stop.
hospitaldeath
itemAboveHead [type] Show an item above the player's head. The [type] can be "pan", "hero", "sculpture", "joja", "slimeEgg", "rod", "sword", or "ore". If no item is specified, then they will 'hold' nothing?
jump <actor> [intensity] Make a the named NPC jump. The default intensity is 8.
loadActors <layer> Load the actors from a layer in the map file.
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 for the <text> format.
minedeath TODO.
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 when they're done. To move along multiple axes, you must specify multiple move commands. TODO: explain <tt><continue></tt>
pause <duration> Pause the game for the given number of milliseconds.
pixelZoom <zoom> Sets the current pixel zoom.
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.
playerControl Give the player control back.
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
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.
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.
removeObject <x> <y> Remove the prop at a position.
removeQuest <quest ID> Remove the specified quest from the quest log.
removeSprite <x> <y> Remove the temporary sprite at a position.
removeTemporarySprites Remove all temporary sprites.
removeTile <x> <y> <layer> Remove a tile from the specified layer.
resetVariable Set the first event variable to false.
rustyKey Gives the player the rusty key. (Sewer key)
screenFlash <alpha> Game1.flashAlpha = alpha;
setRunning Set the player as running.
shake <actor> <duration> Shake the named NPC for the given number of milliseconds.
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?
showRivalFrame <frame> Set the 'rival' actor's sprite to a specific frame.
skippable Allow skipping this event.
speak <character> "<text>" Show dialogue text from a named NPC; see dialogue format.
specificTemporarySprite <sprite> [other params] Shows the given temporary sprite. Parameters change depending on the sprite.
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?
splitSpeak <actor> "<text>" Dialogue, but chosen based on previous answer. ('~' is the separator used.)
startJittering Make the player start jittering.
stopAdvancedMoves Stop movement from advancedMove.
stopAnimation farmer Stop the farmer's current animation.
stopAnimation <actor> <end frame> Stop the named NPC's current animation. Not applicable to the farmer.
stopGlowing Make the screen stop glowing.
stopJittering Make the player stop jittering.
stopMusic Stop any currently playing music.
stopRunning Make the farmer stop running.
stopSwimming <actor> Make an actor stop swimming.
swimming <actor> Make an actor start swimming.
switchEvent <event ID> Changes the current event (ie. event commands) to another event in the same location.
taxvote Trigger voting for or against a 3% shipping tax. (No effect on game?)
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.
tutorialMenu Show the tutorial menu if no other menu is open.
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.
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.
waitForKey <key> <message on finish> TODO: Explain
waitForOtherPlayers Wait for other players (vanilla MP).
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.
weddingSprite <frame> Sets the actor known as 'WeddingOutfits' to a particular frame.

Directions

When event commands refer to a facing direction, they'll use one of these values:

Value Meaning
0 looking up
1 looking right
2 looking down
3 looking left

Dialogue format

See Modding:Dialogue#Format.

See also