StardewMods
StardewMods copied to clipboard
[Content Patcher] EditImage not properly working on Farmer Base sprites
Describe the bug Whenever the "EditImage" action gets applied to the farmer base sprite with a condition that is not a player configuration, it will render underneath the base sprite instead of replacing it. However, the Debug tool will display the sprite as though it had been replaced correctly.
The only times I found that it properly replaces the base sprite are when: A. There are no conditions tied to the action. B. When the only condition is a player configuration.
I have tried the following methods, and none have produced the correct results: A. Applying a condition (tested Season, Day, DayEvent, LocationUniqueName, and PlayerGender) directly to the "EditImage" action. B. Storing the "EditImage" action within a separate file and calling it via an "Include" action that has a condition. C. Creating a Dynamic Token and using that as the condition on the "EditImage" action. D. Using a Query as the condition on the "EditImage" action.
I also made another test mod to edit the furniture tilesheet and the pants sprite via "EditImage" with a season condition (just like how I tested the farmer base sprite), to see if other sprites had this same issue. It worked with no issues.
All testing was done on a fresh install of the game with only SMAPI, Content Patcher, and 1 test mod enabled at a time. Here are all my test mods within a zip file: All Test Mods.zip
To Reproduce Using My Test Mods:
- Add one of the 4 test mods I have provided with "Error Produced" in the folder name.
- Load into a world during the spring season.
- The blue sprite should now be underneath the player's sprite instead of replacing the player's sprite.
- Use the Debug tool to examine the farmer_base or farmer_girl_base sprite and see that the player should only be blue.
From a new mod:
- Create a new Content Patcher Mod.
- Add an "EditImage" action to the content.json file that swaps out the player's body with a new sprite (such as a solid color).
- Apply a "When" condition for "Season": "spring" to the action.
- Load a save file that is in spring and see if the farmer base file has been properly edited.
Log file SMAPI Log for "With No Conditions" Test Mod: https://smapi.io/log/26ebb87b57914b7d8905b5569215252e SMAPI Log for "With Season Condition" Test Mod: https://smapi.io/log/ebac1b25db0d4178b3042c668706f2de SMAPI Log for "Condition on Other Sprites" Test Mod: https://smapi.io/log/3946126bfd01469da3beefe6f427d4f9
Screenshots
The game working properly when using the test mod "Testing Farmer Sprite - No Errors A - With No Conditions":
The game not working properly when using the test mod "Testing Farmer Sprite - Error Produced A - With Season Condition":
The game working properly when using the test mod "Testing When Condition on Other Sprites":