Linha 1: |
Linha 1: |
| {{Traduzir}} | | {{Traduzir}} |
− | ← [[Modding:Index|Index]] | + | ← [[Modificações:Índice|Índice]] |
| | | |
| Esta página explica como o jogo calcula o gosto dos presentes dos NPCs. Este é um guia avançado para desenvolvedores de mods. | | Esta página explica como o jogo calcula o gosto dos presentes dos NPCs. Este é um guia avançado para desenvolvedores de mods. |
Linha 6: |
Linha 6: |
| ==Data== | | ==Data== |
| ===Dados não tratados=== | | ===Dados não tratados=== |
− | Os gostos de presentes do NPC são armazenados em <tt>Content\Data\NPCGiftTastes.xnb</tt>, que pode ser [[Modding:Editing XNB files#unpacking|descompactado em um arquivo de texto.]]. Here's the raw data as of {{version|1.3.33}} for reference: | + | Os gostos de presentes do NPC são armazenados em <samp>Content\Data\NPCGiftTastes.xnb</samp>, que pode ser [[Modding:Editing XNB files#unpacking|descompactado em um arquivo de texto.]]. Here's the raw data as of {{version|1.3.33}} for reference: |
| | | |
| <syntaxhighlight lang="json"> | | <syntaxhighlight lang="json"> |
Linha 55: |
Linha 55: |
| | | |
| <ul> | | <ul> |
− | <li>''Universal tastes'' apply to all villagers. Their key is <tt>Universal_''Taste''</tt>, and their value is a space-delimited array of reference IDs (item ID if ≥0, category ID if <0). For example, consider this entry: | + | <li>''Universal tastes'' apply to all villagers. Their key is <samp>Universal_''Taste''</samp>, and their value is a space-delimited array of reference IDs (item ID if ≥0, category ID if <0). For example, consider this entry: |
| | | |
| <syntaxhighlight lang="json"> | | <syntaxhighlight lang="json"> |
Linha 63: |
Linha 63: |
| This data means villagers should have a universal like for category -2, item 72, etc.</li> | | This data means villagers should have a universal like for category -2, item 72, etc.</li> |
| | | |
− | <li>''Personal tastes'' apply to a specific villager. Their key is the villager's internal name (like <tt>Abigail</tt>), and their value alternates dialogue text with a list of reference IDs in this order: love, like, dislike, hate, and neutral. For example, consider Abigail's gift tastes: | + | <li>''Personal tastes'' apply to a specific villager. Their key is the villager's internal name (like <samp>Abigail</samp>), and their value alternates dialogue text with a list of reference IDs in this order: love, like, dislike, hate, and neutral. For example, consider Abigail's gift tastes: |
| | | |
| <syntaxhighlight lang="json"> | | <syntaxhighlight lang="json"> |
Linha 69: |
Linha 69: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | By splitting the string with <tt>/</tt> as the delimiter, we can extract this data: | + | By splitting the string with <samp>/</samp> as the delimiter, we can extract this data: |
| | | |
− | {| class="wikitable" | + | {|class="wikitable" |
| |- | | |- |
| ! index | | ! index |
Linha 112: |
Linha 112: |
| * between an item ID and category ID; | | * between an item ID and category ID; |
| * between a universal taste and personal taste; | | * between a universal taste and personal taste; |
− | * between conflicting values (''e.g.'', Jodi both loves and hates Daffodils (item ID 18) specifically); | + | * between conflicting values (''e.g.,'' Jodi both loves and hates Daffodils (item ID 18) specifically); |
− | * and any combination of the above (''e.g.'', between a universal item ID and personal category ID). | + | * and any combination of the above (''e.g.,'' between a universal item ID and personal category ID). |
| | | |
− | The game uses a rather complicated algorithm to determine how much an NPC likes an gift (see <tt>NPC::getGiftTasteForThisItem</tt>). Here's a cleaned up version of the algorithm in pseudocode: | + | The game uses a rather complicated algorithm to determine how much an NPC likes an gift (see <samp>NPC::getGiftTasteForThisItem</samp>). Here's a cleaned up version of the algorithm in pseudocode: |
| | | |
| <pre> | | <pre> |
Linha 173: |
Linha 173: |
| </pre> | | </pre> |
| | | |
− | [[Category:Modding]] | + | [[Category:Modificações]] |
| | | |
| [[en:Modding:Gift taste data]] | | [[en:Modding:Gift taste data]] |