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.
 
Top