Modificações:Dados de Eventos

Fonte: Stardew Valley Wiki
Revisão em 23h37min de 6 de janeiro de 2022 por Alexandra (discussão | contribs)
Saltar para a navegação Saltar para a pesquisa
Robin building.png
“Ainda tenho muito trabalho a fazer”
— Robin

Tradução incompleta

Este artigo ou seção não foi completamente traduzido para o português. Você está convidado a ajudar na sua construção editando-o
Última edição por Alexandra em 2022-01-06 23:37:55.

Índice

Esta página explica como o jogo armazena e analisa os dados do evento. Este é um guia avançado para desenvolvedores de mod.

Fonte

Os eventos são armazenados em 'Content \ Data \ Events \ *. Xnb' (um arquivo por local), que pode ser unpacked using XNB Extrair.

Aqui estão os dados brutos para eventos de salão a partir de Predefinição:Versão para referência (excluindo cabeçalhos XNB): Predefinição:Recolher

Pré-condições do evento

Cada evento possui uma chave que inclui um ID de evento e todas as condições prévias. As pré-condições do evento incluem qualquer número dos seguintes argumentos (separado por /). Por exemplo, as pré-condições do evento de corações do Clint no Saloon são 97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun, which (per the tables below) significa evento #97, requer 3 corações com Clint, entre 7pm e 11pm na segunda-feira.

Notas:

  • 'Nome do NPC' significa seu nome interno em inglês, não o nome de exibição traduzível.
  • 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.

Contexto

Estes verificam a hora atual, data, clima, etc. Eles não são específicos do jogador.

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_Begin, cc_Boulder, cc_Bridge, cc_Bus, cc_Complete, 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 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

Formato Básico

Todo evento tem um valor 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.

Todo script deve começar com três comandos nessa ordem exata:

index syntax description
0 <music ID> The background music or ambient background track to play. Can be changed later using playMusic <newmusic>, or stopped entirely using stopMusic. This can also be none (which stops any existing music and uses the default ambient background noise for the location), or continue (which keeps playing the current background song).
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 from the TileSheets\Craftables.png sprite sheet.
addConversationTopic <ID> Starts an active dialogue event with the given ID and a length of 4 days.
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 at the specified tile from the Maps\springobjects.png sprite sheet. A light radius of 0 just places the sprite.
addMailReceived <letter ID> Set a letter as received.
addObject <x> <y> <row in texture> [layer] Adds a temporary sprite at the specified tile from the Maps\springobjects.png sprite sheet.
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 to the player's inventory. The Battered Sword is unobtainable in vanilla and is incomplete and not implemented.
advancedMove <npc> <loop> <x y>... Set multiple movements for an NPC. You can set True to have NPC walk the path continuously. Example: /advancedMove Robin false 0 3 2 0 0 2 -2 0 0 -2 2 0/
ambientLight <r> <g> <b> Modifies the ambient light level, with RGB values from 0 to 255. Note that it works by removing colors from the existing light ambience, so ambientLight 1 80 80 would reduce green and blue and leave the light with a reddish hue.
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 one or more <frames> from their sprite sheet, for <frame duration> milliseconds per frame. <flip> indicates whether to flip the sprites along the Y axis; <loop> indicates whether to repeat the animation until stopAnimation is used.
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".
broadcastEvent TODO: Explain broadcastEvent.
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> Changes the NPC's vertical texture offset. Example: changeYSourceRectOffset Abigail 96 will offset her sprite sheet, showing her looking left instead of down. This persists for the rest of the event. This is only used in Emily's Clothing Therapy event to display the various outfits properly.
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> Acts as if the player had clicked the specified x/y coordinate and triggers any relevant action. It is commonly used to open doors from inside events, but it can be used for other purposes. If you use it on an NPC you will talk to them, and if the player is holding an item they will give that item as a gift. doAction activates objects in the main game world (their actual location outside of the event), so activating NPCs like this is very tricky, and their reaction varies depending on what the player is holding.
dump <group> Starts the special "cold shoulder" and "second chance" dialogue events for the given group (women if group is girls and men if it is anything else.) The cold shoulder event has an id of dumped_Girls or dumped_Guys and lasts 7 days; the second chance event has an id of secondChance_Girls or secondChance_Guys and lasts 14 days. During open beta testing of version 1.3 there was a second parameter which determined the amount of hearts lost, but support for that parameter was removed before release.
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 Ends the current event by fading out, then resumes the game world and places the player on the square where they entered the zone. All end parameters do this by default unless otherwise stated.
end bed Same as end, but warps the player to the x/y coordinate of their most recent bed. This does not warp them to the farmhouse, only to the x/y coordinate of the bed regardless of map.
end beginGame Used only during the introduction sequence in the bus stop event. It sets the game mode to playingGameMode, warps the player to the farmhouse (9, 9), ends the current event, and starts a new day.
end credits Not used in any normal events. Clears debris weather, changes the music to wedding music, sets game mode to creditsMode and ends the current event.
end dialogue <NPC> <"Text for next chat"> Same as end, and additionally clears the existing NPC dialogue for the day and replaces it with the line(s) specified at the end of the command. Example usage: end dialogue Abigail "It was fun talking to you today.$h"
end dialogueWarpOut <NPC> <"Text for next chat"> See end dialogue and end warpOut.
end invisible <NPC> Same as end, and additionally turns the specified NPC invisible (cannot be interacted with until the next day).
end invisibleWarpOut <NPC> See end invisible and end warpOut.
end newDay Ends both the event and the day (warping player to their bed, saving the game, selling everything in the shipping box, etc).
end position <x> <y> Same as end, and additionally warps the player to the map coordinates specified in x y.
end warpOut Same as end, and additionally finds the first warp out of the current location (second warp if male and in the bathhouse), and warps the player to its endpoint.
end wedding Used only in the hardcoded wedding event. Changes the character's clothes back to normal, sets Lewis' post-event chat to "That was a beautiful ceremony. Congratulations!$h", and warps the player to their farm.
extendSourceRect <actor> reset Resets the actors sprite.
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> Briefly sets the farmer's sprite to <anim> for a variable (depending on sprite) interval. Only used once in vanilla events. Using showFrame farmer <sprite> twice (to set a new frame and back) is more powerful as it lets you control the interval using pause n.
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, fading into and out of the <r> <g> <b> values over the course of a second. If <hold> is true it will fade to and hold that color until stopGlowing is used.
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. By default the event pauses while a move command is occurring, but if <continue> is set to true the movement is asynchronous and will run simultaneously with other event commands.
pause <duration> Pause the game for the given number of milliseconds.
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> Flashes the screen white for an instant. An alpha value from 0 to 1 adjusts the brightness, and values from 1 and out flashes pure white for x seconds.
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. Note that setting the farmer's sprite only changes parts of the sprite (some times arms, some times arms and legs and torso but not the head, etc). To rotate the whole sprite, use faceDirection farmer <0/1/2/3> first before modifying the sprite with showFrame.
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 in the direction (and with the velocity) defined by x/y for the given duration in milliseconds. Example: "viewport move 2 -1 5000" moves the camera 2 pixels right and 1 pixel up for 5 seconds.
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.

Some commands are broken or unusable:

command description
grabObject <object ID> Broken. Triggers a generic animation. The item ID is ignored and the item isn't added.
end busIntro Supposed to start the bus intro scene, presumably the one that was cut before release.

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