Adding your own progressive wg portraits - dayziebloom/Pounds-of-Mistria GitHub Wiki
Portrait Guide & Tips
This guide only covers Aseprite for now, which can either be bought on Steam or there is a github to build the program yourself as it is open source.
Using Aseprite
Here is a VERY useful guide for creating weight sprites
Though instead of starting from scratch, you'll need to copy the games' portraits into your main layer, and instead of 'seasons' for each new layer, those will be your weight stages for the season you copied into the main layer.
TOMLs
Portraits are stored in an images folder within your mod. For example, the directory for my Adeline Spring portraits would be The Honorable Adeline's Adipose/images/Adeline/Portraits/Spring/image.png
Each portrait MUST HAVE A META.TOML FILE OF THE SAME NAME.
There is nothing unique between every meta file for modded portraits besides any you'd like to have more than 2 frames.
By default all your image_name.meta.toml file needs to be is this:
[meta_properties]
asset_kind = "Animation"
[asset_properties]
frame_size = [296, 180]
frame_len = 2
duration = 0.5
atlas = "Npc"
And that's it.
I'd recommend PowerRename which is part of the free Microsoft PowerToys app on the Microsoft Store. All you have to do is keep copies of every meta file from one of your weight stages in a separate folder, right-click with all of them selected, use PowerRename, and target 'weight_name_1' while replacing with 'weight_name_2'.
For example I could have all the meta files for spr_portrait_adeline_slim_spring_(expression) in this side folder, and PowerRename can target slim in those file names and replace them with pudgy, making them all spr_portrait_adeline_pudgy_spring_(expression). And then I'd just have to copy all those pudgy meta files back into my mod's image folder in the same spot as the pudgy spring pngs.
GML Guide & Tips
Credit to AnnaNomaly for the original Dynamic NPC Portraits (DNP) mod, all that the edited version adds so far is a 'weight' condition alongside the pre-existing conditions that check for location, time and weather.
For the original mod, you can find it here And you can find its documentation here
So here is an example of the rules function from Adeline's Adipose:
function adelines_adipose_rules() {
return [
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_chubby_spring",
conditions: {
weight: 175,
season: "spring"
},
}
];
}
DNP asks for the array of rules structs that your own mod passes back to it.
npc is the lowercase name of the npc you want to target
sprite_name is the prefix of the weight stage for your sprite, without any expression tag. So in this example, this will replace every instance of 'spr_portrait_adeline_spring_(expression)' with 'spr_portrait_adeline_chubby_spring_(expression)'.
conditions determine when your custom portrait will be called in, with weight being how much Adeline must weigh before her 'chubby' sprites are shown. season is also required for wg mods as just a weight condition alone only lets you use 1 set of sprites for all scenarios. Otherwise, beach portraits require the season condition being "summer" but ALSO need a location condition of "beach".
Conditions are always checked for from top to bottom, so you must put the highest weight your mod covers FIRST. Beach, Bathhouse, and Wedding portraits must also be listed before the seasonal sprites. To give an example of why this is, here's a few custom rules lined up:
function adelines_adipose_rules() {
return [
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_pudgy_summer",
conditions: {
weight: 140,
season: "summer"
},
},
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_pudgy_beach",
conditions: {
weight: 140,
season: "summer"
location: "beach"
},
},
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_fat_summer",
conditions: {
weight: 300,
season: "summer"
},
},
];
}
In this scenario, imagine Adeline's weight is set to 350. The game goes to check her rules, starting from the top. 350 is greater than the 140 required for her pudgy sprite, so it applies and stops checking other rules immediately. The fat sprites rule is never checked for.
In another scenario, say Adeline doesn't meet the requirement for the 'fat' sprites, but is big enough for the 'pudgy' sprites, say 160, AND she's at the beach. The game starts at the top of the rules, sees that she's big enough for pudgy sprites, and stops checking the rest of the rules. So, even though we had a set of portraits for the beach, they never got checked because we set the regular summer sprites first.
Thus, an appropriate order for these rules would be:
function adelines_adipose_rules() {
return [
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_fat_summer",
conditions: {
weight: 300,
season: "summer"
},
},
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_pudgy_beach",
conditions: {
weight: 140,
season: "summer"
location: "beach"
},
},
{
npc: "adeline",
sprite_name: "spr_portrait_adeline_pudgy_summer",
conditions: {
weight: 140,
season: "summer"
},
},
];
}