StardewMods icon indicating copy to clipboard operation
StardewMods copied to clipboard

[Content Patcher] EditImage not properly working on Farmer Base sprites

Open kenny2892 opened this issue 4 months ago • 1 comments

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:

  1. Add one of the 4 test mods I have provided with "Error Produced" in the folder name.
  2. Load into a world during the spring season.
  3. The blue sprite should now be underneath the player's sprite instead of replacing the player's sprite.
  4. 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:

  1. Create a new Content Patcher Mod.
  2. 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).
  3. Apply a "When" condition for "Season": "spring" to the action.
  4. 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": aba4770b1032698f99001c76a404a44c

The game not working properly when using the test mod "Testing Farmer Sprite - Error Produced A - With Season Condition": 7fd58d31c72e6dce69e4a5491bcad87a

The game working properly when using the test mod "Testing When Condition on Other Sprites": 0bfe37a5ae5da7e92b86a7e9f136da23

kenny2892 avatar Mar 22 '24 21:03 kenny2892