hi! I'm interested in making a mod that adds the ski trip and epilogue costumes for party members. I've seen something similar being done with rise (the rise outfit selector mod), so I've tried researching how to do that for other characters.
I've tried digging through that mod to see how it works, but I can't understand how exactly the mod author added the costumes. as far as I know, you have to add the costumes to some kind of table using a hex editor?? I wonder how exactly you add things to that table and where I can find it in the game files.
the biggest problem is that I'm stuck on finding the models in the first place. I've dug through the unpacked game files and the amicitia wiki, but couldn't find any info on those outfits.
also, I saw some .flow scripts in that mod's files and I see that there are some functions that are responsible for adding costumes to your inventory, but I don't know which of them do that. is there some kind of list of flowscript functions available? I've tried to read a flowscript tutorial on the shrinefox modding docs site, but there wasn't anything about p4g's flowscript functions.
I have a lot more questions, but I'm a bit too confused to put them into words. I might be trying to bite off more than I can chew, but I really want to use these costumes while crawling through dungeons and couldn't find mod that does that, so I thought that I should do it myself. sorry if I'm not making sense, I'm new to modding and english is not my first language.
#adding costumes for party members in the tv world
75 messages · Page 1 of 1 (latest)
so that mod works specifically by adding the logic for costume selection for rise because she didn't originally have costumes at all. that's why there's a lot of extra code in the first place. @fair herald could speak more on that and how it might differ for party members but my understanding is that P4G has a hard cap for extra costumes that can be added. you may or may not be able to exceed that limit with code.
flowscript in general is not well documented but I'm not sure if it would be super relevant in this case. I believe it's primarily used in this mod to determine when you unlock different costumes but I could be wrong
ok, I see, thanks! I now have a couple of questions about the cap and whether I can add more on top of it or replace some costumes with the ones I want, but for now I'll try waiting for animatedswine's reply.
well replacement would be a lot easier
I can't get you the location of the files you're looking for off the top of my head so you'll have to look for them (search model/npc to start?) but P4G doesn't only have one model, it has multiple models each with one or only a few animations for overworld stuff
this would include the ski trip and epilogue costumes
oh, so I was looking for them in the wrong place after all. thank you so much! I've found the model IDs on amicitia. that's one question down. gonna unpack the files further and try looking at the models.
I tried opening yosuke's ski gear model (n166_0.amd) using amicitia and got this error. sorry that it's in russian, but the last bit says that it .net can't find a method. am I missing a dependency or is it some other kind of problem? I was trying to follow p4gmodelconverter's description. not planning on modifying models if it's not required for what I'm going to do, just trying to look at the models.
you might be missing dependencies then, not really sure seeing as I can't read the error 😆
run the persona prerequisite installer to be sure you have the correct dependencies
you typically would view the model using noesis (just as a preview) though
sorry, didn't notice that noesis can open .amd files. it's on the amicitia wiki, duh... thanks!
don't know what made me do what I was trying to do here, but at least I got to preview the model through noesis in the end.
on another note, running the ppi didn't do anything to resolve the error, but I'm not gonna bother since I'm not going to modify the models.
found the costume descriptions! though I think I might need to unpack the data_e.cpk too, since everything is in japanese here. there are a lot of blank costume messages from what I can see without opening up the english files, so I think there might be a lot of space for new costumes? just a theory I came up with, though. going to need confirmation on that later.
about the cap, again. is it a per character cap or is it a global cap? I think there might be enough slots for all of the costumes I want if the amount of blank costumes in datdresshelp.bmd is indicative of the cap.
solved the mystery of the item table location, too, so that's one question less to answer.
I've already modified the itemtbl.bin and datDressHelp.bmd files to contain costume names and descriptions. (0x07** are dedicated to costumes if I'm not mistaken, so I don't think I've hit the cap! still need confirmation from someone more knowledgeable, though.) how do I link the item table and the models? how to make the costumes appear in the game?
also, do I need to do anything with the models? since they are not in-battle models, they don't contain battle animations. .amd files contain animations too, right? the animations show up in noesis, so they must be in the file itself, I think.
i feel like @fair herald mentioned wanting to make a more modular mod for costumes similar p4g but idk if there's been progress
or maybe it was for something p3p related 
That was for p3p since it has no outfits/costumes in the first place. Maybe if I ever actually finished that for p3p I could port it over since there two games are generally very similar in terms of code and stuff
Anyway, as for the actual questions. It might actually be possible to put as many new outfits in as you want but I'm not certain, it's not something I've looked into enough to confirm.
The way it works is outfit items are defined in groups of 8 starting from item 1792. These groups define which outfit id it is. For example, bc001_c2.pac would be outfit 2 since it's c2. That's also an outfit for the protagonist since the first numbers are 001, it should be fairly easy to work out which ID is which character, just have a look at one of the models in the existing files.
The item id for that bc001_c2 would be 1809. You can work this out as
itemId = 1792+charId+(outfitId*8)
itemId = 1792+1+(2*8)
itemId = 1809
Using that formula you could work out what item id you need to use for any outfit. This should work whether the outfit actually exists already or is something completely new. For example, Yosuke has outfits going up to 0x17 (bc002_c17.pac) so you could add one at 0x18 (24 in decimal) which is currently unused. So, for this you'd want to change item id
itemId = 1792+2+(24*8)
itemId = 1986
So the item can be equipped by Yosuke, is classified as an outfit, has the right name and description, etc. Then you'd also want to make your model and put it in model/pack/bc002_c18.pac. In theory, if you then gave yourself item 1986 (probably just through the mod menu to start) and equipped it on Yosuke you'd get the right outfit in battle.
The one thing with that is I'm not sure if they cap out the id at some point in the code. If not and that equation that I said holds you could theoretically make nearly unlimited outfits by just using a large costume id item id. I think that you'll probably actually come to a problem with them showing up in the equip menu and stuff though. Iirc in p3p items are displayed in those menus based on their id rather than any information in itemtbl.bin. If it's the same in p4g then items with higher ids than expected (probably up to 2047) just won't show.
You can look at the wiki for a list of item ids to see what's used and what's free. All of the outfit stuff is labelled as Clothes and goes from 1792 to 2047 https://amicitia.miraheze.org/wiki/Persona_4_Golden/Items
something to also (apparently) possibly keep in mind when adding new items is whether those new ids will cause the game write to save data not meant for those items/items in general
in p5r i just auto unlocked all costumes and disabled any inventory writes from costume items
Yeah, if you went over the normal item ids you'd probably need code to chuck it in a separate file rather than having it in the save file. Presumably the save only has space for the normal 2560 items
If you can just try and keep within that normal range of outfit ids, I think there's a fair bit of free space there anyway. If it becomes a real problem we can look into expanding it properly later on
As for editing itemtbl.bin I've just uploaded a wip ImHex pattern for it to the repo. It's a little unfinished compared to the 010 editor one but it also fixes some things that were incorrect in that one. Technically you can follow the steps on the repo's readme to use this but as it is it doesn't depend on any other file so you can really just copy paste it into the pattern editor view in ImHex and click run
https://github.com/Persona-Modding/Atlus-ImHex-Patterns/blob/3f49923f3662b461a938fe1dbe95d536db65424b/p4g/itemtbl.bin.hexpat
ImHex is an open source hex editor that I think is cool and I'm trying to get more people to use. Download it from its website then just drag the itemtbl.bin file into it, go to the pattern editor window and paste that file I linked into it. Then you press that little run button down in the bottom right and should see stuff that you can edit. Hopefully you can work it out from there :)
https://imhex.werwolv.net/
(Ideally there will be proper documentation written up for all of this at some point, I haven't really done anything like that yet though...)
thank you so so much! I was already using ImHex, just without the template, since it wasn't on the repo when I was trying to figure things out before. I'm going to get back to work a bit later, and I guess I'll have to redo my edits to itemtbl.bin since I just blindly put the costume names in 'cuz I didn't know about the formula.
don't read
I'm still confused about the animations, though. will they just magically work, or will I have to port the animations from another costume? as I said, the ski gear and epilogue outfits don't have battle animations as far as I have seen through noesis. if I'm correct that I'll have to port the animations, then how can I do that? I see that I can export animations through noesis, but how do I import them? I see that there's a tutorial for that, but it's from 2021 and I don't know whether it'll work for 64 bit. I don't think so, since I don't see any mentions of .amd files in it.
UPD: I found the tutorial for converting animations for custom models, but there are a lot of dead links in it, but I'll try to follow it.
also, how do I pack .amd files into a .pac? on amicitia I see rmdeditor listed for these purposes, but all of the links to the tool that I could dig up are long dead, and amicitia just doesn't work for me. I opened up a .pac file through persona editor, and I can see that it contains a .se and a .amd file. what does the .se file do? is it the sound effects or something?
can I just take an already existing .pac, replace the .amd file inside of it with PE and rename the file to [ID]_c18?
don't read
also, another question popped up. I want to make my mod compatible with the rise one, but I've run into the problem of 0x7c5 (ID 1989), 0x7cd (ID1997) and 0x7d5 (ID 2005) already being taken up by it. which of the character corresponds to the ID 5? I guess that it's kanji, if we're following the story order. correct me if I'm wrong. besides, in the model/pack folder the models go up to bc008, and there are 8 characters in total including rise, whose models are in battle/assist, no? so who's the eighth character?
once I deal with character IDs, can I just skip c18-20 and name the files c21 and c22 for kanji, or whoever is ID 5, to avoid conflicts with rise, or does the next costume HAVE to be c18?
also also, how do I import someone else's save files into the game? I've tried various ones, including loaf's archive, but they just don't show up in the game for me. am I doing something wrong? I'm just putting the .bin and .binslot files in 1113000/remote. do they not work because of system.bin/binslot?
go in-game, save over every slot, then overwrite the files with your own saves
ahhh, ok, I see. thank you.
wait, ok no, scratch that. ID 5 is rise, just looked up on amicitia wiki, gah. no problems here, then.
already done with table editing and the .bmd file
Amicitia should work fine, if you right click the file in it there should be an option to replace. Just make a copy of an existing pac and then replace the files in it with yours. If for some reason it doesn't work then yeah, I guess do the same thing with persona editor
There's probably a way to make a completely new pak file but I think just replacing files in one would be much easier
Normally you wouldn't actually edit a pak manually like that. You'd use pak emulator so you'd just have the loose files in your mod and it'd merge them in. I don't think there's any way to do that with a completely new file though... That would be nice if there was, I don't think it's a very common problem though
thank you!
by the way, narukami's ski gear model seems to have the skis baked in. I just... remove them in blender? I think there might arise a problem with the skeleton since the skis might be included in it, but I can probably pull that from another model of yu's. I mean, it's more of a blender problem, so I think I should just deal with it myself than bombard you with questions like that 😅
tbh I would have no idea, I can't do any 3d modelling stuff 😄
Just removing them sounds like it'd be worth a try though. Maybe you can copy the skeleton from a different model of his or something if you need to 
yeah, I'll try doing just that. I can't do modeling either, so I'll fool around and find out. thanks for replying!
waaaaaaaait, it occured to me to ask just now. how did you get the ski and epilogue outifts to work with rise? they shouldn't have battle animations either, but they still work, don't they?
tbh I have no idea how any of the rise outfit models work. I didn't make them, pio did. I just got the game to load them.
I assume they just basically copy pasted the animation and stuff onto the model though.
oh, ok. I was just trying to do just that myself and failed miserably.
Rise is a special case either way. She's not just in a pac like the other ones. It's in a BED file which does some magic I don't understand
Maybe the model in that is the same idea though, not sure
Rip, well good luck... I wish I knew more about this stuff so I could actually help
There are definitely people who know things, maybe one of them will see and help if you're lucky
ok, thanks for everything! I'll try to figure this out myself in the meantime.
I FIGURED IT OUT!!!
I figured it out an hour ago, I just thought I messed up because I couldn't remove the model that I took the animations from and it looked really jank.
my boy... he's moving...
sorry, I got a bit emotional.
currently stuck on converting .fbx to .amd. I tried using gmodelconverter but something goes wrong in the process (I don't know exactly what, no error messages pop up) and I end up with a .gmo without any animations.
it's probably something with the output .mds I get from the .fbx but I can't check out the contents of the .mds to determine what's wrong, so there's that.
input (.fbx, all animations are present) / output (.gmo, animations absent)
hi again! I was finally successful in importing, at the moment, one of the models in the game. this screenshot is from a test which replaced yosuke's base outfit. how can I add in this model as a new outfit rather than a replacement?
as for itemtbl.bin and datdresshelp.bmd, I had already made them back in august, but I have no idea how to actually add the costumes to the game or where to even start with it. any help would be appreciated! thank you!
I tried rereading what we were discussing awhile back, added my modified itemtbl.bin and datdresshelp.bmd / .msg through femulator and the game threw up an error on boot
oh, also, here's the error log if it might help!
Would you be able to send the whole mod? I think it'd be easier to work out if I could just try myself
yeah, sure! thank you! sorry for the wait. time zones 😅
No worries, I was at work until recently so I wouldn't have even had time to check.
I'll have a better look in a bit but from the log it looks like you're playing the game in Japanese. I think that's causing the problems. I tried on English and it was fine but I got an error when switching to Japanese. I think it is something going wrong with persona essentials though, not necessarily something you did
I thought that the problem could be with me using japanese, didn't think it'd actually be the case. oh well. thanks!
I'll do some testing on my own w/ switching the game language back to english.
also, to get ahead of myself, how do I make the costumes get automatically added to the inventory after meeting certain requirements (meaning, after the ski trip and after clearing the epilogue)?
I think I might've run into a problem. the game either freezes when trying to leave the menu after changing the costume while inside a dungeon or is stuck during loading when changing the costume before entering a dungeon. I don't think it's a problem with the models themselves as they worked just fine when replacing other costumes w/ them.
OK. SO. some more testing has been conducted on my end. replacing the model only works for the default outfit for some reason. I tried replacing yosuke's yaso jersey w/ his ski outfit and it didn't work. replacing his default outfit worked perfectly.
and that's when trying to replace them both at the same time...? for some reason the game just doesn't see the model replacement when trying to import it as anything other than the default model.
what's even weirder is that I tried replacing kuma's default and drag costumes w/ his epilogue outfit and it worked in both cases...?
kuma's epilogue costume works even without replacing any other outfit with it. I have a working theory now. I need to test something real quick.
aaaand it didn't work. I tried replacing the model_data in my yosuke ski model w/ model_data that had animations from his c17 costume rather than his default but. it didn't work. kuma's outfit WORKS... and his model_data uses his animations from his c5 costume so I thought that this might've been the thing that caused yosuke's model to not work outside of replacing his default costume, but no. it wasn't.
upd on the crash: I'm 99,9% sure that the crash is caused by me using the english itemtbl.bin. I thought I used the japanese one, but I checked the file and it contains english text, soooo, yeah. the game probably freaked out that every single item is suddenly in english, when it expected them to be in japanese.
I've yet to actually test it out w/ a japanese itemtbl, but that's a bit lower priority, since I'm currently remaking all of the .gmos from scratch w/ dexxtrip's help. they also asked me to bring up an issue with the mod loader not merging ftd/ctd files byte by byte (issue 49 on github), since that causes incompatibility in mods that change the croco fur item table.