Linha 2: |
Linha 2: |
| {{../cabeçalho}} | | {{../cabeçalho}} |
| | | |
− | This page helps you test your mods and solve common issues. '''For issues ''using'' mods, see [[Modding:Player Guide/Troubleshooting]].'''
| + | Essa página te ajudará a testar seus mods e resolver problemas comuns. '''Já para problemas ao ''usar'' mods, veja [[Modding:Player Guide/Troubleshooting]].''' |
| | | |
| ==Teste o mod== | | ==Teste o mod== |
Linha 76: |
Linha 76: |
| | | |
| ===This implicitly converts...=== | | ===This implicitly converts...=== |
− | Sample warning: "''This implicitly converts '{0}' from Net{1} to {2}, but Net{1} has unintuitive implicit conversion rules. Consider comparing against the actual value instead to avoid bugs. See https://smapi.io/buildmsg/avoid-implicit-net-field-cast for details.''"
| + | Exemplo do alerta: "''This implicitly converts '{0}' from Net{1} to {2}, but Net{1} has unintuitive implicit conversion rules. Consider comparing against the actual value instead to avoid bugs. See https://smapi.io/buildmsg/avoid-implicit-net-field-cast for details.''" |
| | | |
− | Your code is referencing a [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], which can cause subtle bugs. This field has an equivalent non-net property, like <samp>monster.Health</samp> (<samp>int</samp>) instead of <samp>monster.health</samp> (<samp>NetBool</samp>). Change your code to use the suggested property instead.
| + | Seu código está referenciando um [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], na qual pode causar alguns bugs sutis. Esse campo tem uma propriedade não-net equivalente, Como <samp>monster.Health</samp> (<samp>int</samp>) Ao invés de <samp>monster.health</samp> (<samp>NetBool</samp>). Altere seu código para usar a propriedade sugerida ao invés disso. |
| | | |
| ===FieldName is a Net* field...=== | | ===FieldName is a Net* field...=== |
− | Sample warning: "'''{0}' is a Net{1} field; consider using the {2} property instead. See https://smapi.io/buildmsg/avoid-net-field for details.''"
| + | Exemplo do alerta: "'''{0}' is a Net{1} field; consider using the {2} property instead. See https://smapi.io/buildmsg/avoid-net-field for details.''" |
| | | |
− | Your code is referencing a [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], which can cause subtle bugs. You should access the underlying value instead:
| + | Seu código está referenciando um [[Modding:Modder Guide/Game Fundamentals#Net fields|net field]], na qual pode causar alguns bugs sutis. Você deveria acessar o valor base ao invés. |
| <ul> | | <ul> |
− | <li>For a reference type (''i.e.,'' one that can contain <samp>null</samp>), you can use the <samp>.Value</samp> property (or <samp>.FieldDict</samp> for a <samp>NetDictionary</samp>): | + | <li>Para um tipo de referencia (''ex.,'' aquele que pode conter <samp>null</samp>), você pode usar a propriedade <samp>.Value</samp> (ou <samp>.FieldDict</samp> para um <samp>NetDictionary</samp>): |
| <syntaxhighlight lang="c#"> | | <syntaxhighlight lang="c#"> |
| if (building.indoors.Value == null) | | if (building.indoors.Value == null) |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | Or convert the value before comparison:
| + | Ou converta o valor antes da comparação: |
| <syntaxhighlight lang="c#"> | | <syntaxhighlight lang="c#"> |
| GameLocation indoors = building.indoors.Value; | | GameLocation indoors = building.indoors.Value; |
Linha 96: |
Linha 96: |
| // ... | | // ... |
| </syntaxhighlight></li> | | </syntaxhighlight></li> |
− | <li>For a value type (''i.e.,'' one that can't contain <samp>null</samp>), check if the parent is null (if needed) and compare with <samp>.Value</samp>: | + | <li>Para um tipo value (''i.e.,'' aquele que não pode conter <samp>null</samp>), verifique se o pai é nulo (se necessário) e compare com <samp>.Value</samp>: |
| <syntaxhighlight lang="c#"> | | <syntaxhighlight lang="c#"> |
| if (item != null && item.category.Value == 0) | | if (item != null && item.category.Value == 0) |
Linha 103: |
Linha 103: |
| | | |
| ===The FieldName field is obsolete...=== | | ===The FieldName field is obsolete...=== |
− | Sample warning: "''The 'Character.friendships' field is obsolete and should be replaced with 'friendshipData'. See https://smapi.io/buildmsg/avoid-obsolete-field for details.''"
| + | Exemplo de alerta: "''The 'Character.friendships' field is obsolete and should be replaced with 'friendshipData'. See https://smapi.io/buildmsg/avoid-obsolete-field for details.''" |
| | | |
− | You're referencing a field which should no longer be used. Use the suggested field name instead to fix it.
| + | Você está referenciando um campo que não deverá mais ser usado. Use o nome do campo sugerido ao invés para conserta-lo. |
| | | |
− | ===An instance of analyzer ... cannot be created=== | + | ===An instance of analyzer ... cannot be created=== |
− | Update to the latest [https://visualstudio.microsoft.com/vs/community/ Visual Studio]; the NuGet package uses a recent feature that isn't available in older versions.
| + | Atualize para o último [https://visualstudio.microsoft.com/vs/community/ Visual Studio]; o pacote NuGet usa um recurso recente que não está disponível em versões antigas. |
| | | |
− | ==Outras problemas== | + | ==Outros problemas== |
| ===Não consigo definir .NET 5=== | | ===Não consigo definir .NET 5=== |
| Se a lista de frameworks tiver opções começando com... | | Se a lista de frameworks tiver opções começando com... |
Linha 122: |
Linha 122: |
| * Certifique-se de que o jogo e o SMAPI estão instalados e funcionando corretamente. | | * Certifique-se de que o jogo e o SMAPI estão instalados e funcionando corretamente. |
| * Verifique se há um erro tipo "''Failed to find game install path/Falha ao encontrar o caminho de instalação do jogo''". Se isso aparecer, Você precisa [https://smapi.io/package/custom-game-path especificar o diretório do jogo]. | | * Verifique se há um erro tipo "''Failed to find game install path/Falha ao encontrar o caminho de instalação do jogo''". Se isso aparecer, Você precisa [https://smapi.io/package/custom-game-path especificar o diretório do jogo]. |
− | * Certifique-se de ter criado um projeto .NET 5, '''Não''' .NET Framework. (Veja [[Modding:IDE reference#Set the target framework|Como definir o framework alvo]]; Se você ver as opções começando com .NET Framework, delete o projeto e crie um .NET 5 ao invés disso.) | + | * Certifique-se de ter criado um projeto .NET 5, e '''Não''' um .NET Framework. (Veja [[Modding:IDE reference#Set the target framework|Como definir o framework alvo]]; Se você ver as opções começando com .NET Framework, delete o projeto e crie um .NET 5 ao invés disso.) |
| * Tenha certeza de que selecionou .NET 5 (veja [[Modding:IDE reference#Set the target framework|como fazer]]). | | * Tenha certeza de que selecionou .NET 5 (veja [[Modding:IDE reference#Set the target framework|como fazer]]). |
| | | |
Linha 130: |
Linha 130: |
| # Se você não encontrou nada relevante, poste a ''Saída/Output'' na [https://hastebin.com hastebin], [[#Ask for help|peça por ajuda no discord]], e inclua o link da sua hastebin. | | # Se você não encontrou nada relevante, poste a ''Saída/Output'' na [https://hastebin.com hastebin], [[#Ask for help|peça por ajuda no discord]], e inclua o link da sua hastebin. |
| | | |
− | ==Ask for help== | + | ==Solicitar ajuda== |
− | See [[Modding:Help]] for how to get help!
| + | Veja a página [[Modificações:Ajuda]] para saber como solicitar ajuda! |
| | | |
| [[en:Modding:Modder Guide/Test and Troubleshoot]] | | [[en:Modding:Modder Guide/Test and Troubleshoot]] |
| [[es:Modding:Guía del Modder/Prueba y solución de problemas]] | | [[es:Modding:Guía del Modder/Prueba y solución de problemas]] |