Coding Help How do I make seasonal portraits?

Velocityissin

Farmhand
Im currently making a portraits and sprites mod for Penny, but I can't figure out how to load seasonal wariants in the .json file. I wasn't able to find tutorials or examples that I could make sense of. I tried using
"When":
{
"Season": "(Example Season)",
}
under the Action, Target and FromFile function. (I was basically guessing) But it didn't work, so that's probably not how you do it. (I just got a invalid .json message in Smapi.)
The code works if I try loading one of the replacement sprites, so rest of the baseline works as intended.
In case someone also knows how to create an outdoor/indoor token I would appreciate some tips in making that as well.
Thank you for your time/help. :cat2:
 

Velocityissin

Farmhand
Alright so I figured it out the When condition itself wasn't the problem, but i didn't know you had to put an Update before it.
{
"Action": "Load",
"Target": "Characters/Penny",
"FromFile": "assets/characters/Penny_Spring.png",
"Update": "OnLocationChange",
"When":
{
"HasFile:{{FromFile}}": true,
"Season": "spring",
},
},
Here is the fixed piece of code in case anyone has a simmilar problem. I also know there could be a simpler way to write it but I haven't figured out how to do it yet.
 

AndrewAlber

Newcomer
Alright so I figured it out the When condition itself wasn't the problem, but i didn't know you had to put an Update before it.
{
"Action": "Load",
"Target": "Characters/Penny",
"FromFile": "assets/characters/Penny_Spring.png",
"Update": "OnLocationChange",
"When":
{
"HasFile:{{FromFile}}": true,
"Season": "spring",
},
},
Here is the fixed piece of code in case anyone has a similar problem. I also know there could be a simpler way to write it but I haven't figured out how to do it yet.
Creating seasonal variants and tokens in Stardew Valley mods involves modifying assets and code. For those seeking more info on the best research paper writing services in 2022, you can refer to this insightful article: This service not only provides a list of the 5 best research paper writing services but also offers valuable details about each service, making it a valuable resource for students and researchers alike. Research paper writing services play a crucial role in helping students tackle complex academic projects.
Thanks for letting us know how you fixed it.

Edit: I tried it and it is working for me. Thank you again.
 
Last edited:
Top