So far I have my huge posts and a lot of files The thing is that for my personal java project I didn't separate these feats between the ones You found and I found.
Here You go, the list grew by 12% ... the number of feats in this game is huge
Hmm about that:
My process is longer and a bit more manual at the moment. I'm changing companions aswell.tseblade wrote: ↑Sun Oct 07, 2018 5:17 am1. Select save file
2. Open the party.json
3. Select party member (for now it could just be the mc, since he is always the first object in the array: ROOT.m_EntityData[0] )
4. Get the current list of feats from the feat array: ROOT.m_EntityData[0].Descriptor.Progression.Features.m_Facts[]
5. Get the last $id from the file to a variable
6. Select feats to add to user (start with feats which are standalone and dont come with abilities or other references .ie Power Attack)(also remove from list already existing blueprint Ids)
7. Add feat code to the previous array as the last element
8. Change any $id in the new feat to +1 from the previous selection
1. I find the highest id in the file, let's say 7960
2. I find the guid representing a specific party member, let's say Regonar. (Notepad++ + JSTool -> Json Viewer, I use the prefab guid provided in the kingmaker editor on github, Regonar corresponds to b090918d7e9010a45b96465de7a104c3
3. I open up one of his feats, this time I found them at: (It's quite funny that our party members are our inventory items apparently )
ROOT.m_EntityData[0].Descriptor.m_Inventory.m_Items[259].m_Enchantments.m_Facts[0].m_CurrentContext.m_OwnerDescriptor.Progression.Features.m_Facts[*]
4. I read Regonar's UUID prefab -> ROOT.m_EntityData[0].Descriptor.m_Inventory.m_Items[259].m_Enchantments.m_Facts[0].m_CurrentContext.m_OwnerDescriptor.Progression.Features.m_Facts[32].m_Context.m_CasterReference.m_UniqueId
This does not seem to change in time, for me Regonar's spawned with the following UUID: 5dfa8214-7918-4653-a695-368d45e8caa6.
5.I save Regonar's UUID in an enum:
Code: Select all
public enum PartyMembers {
PROTAGONIST,VALERIE,AMIRI,LINZI,REGONAR
}
Map<PartyMembers, String> partyGUIDMap = new EnumMap<>(PartyMembers.class);
partyGUIDMap.put(PartyMembers.VALERIE, "5b972eef-5eab-4947-98c5-65d448dc542d")
partyGUIDMap.put(PartyMembers.AMIRI,"91345fb6-c3ed-40f9-9e90-cbc68f7a84cd")
partyGUIDMap.put(PartyMembers.LINZI,"9d563860-8cfb-4d25-9d78-dc7121c1b446")
partyGUIDMap.put(PartyMembers.PROTAGONIST,"f043e0f3-124e-49aa-82bb-3796247937f6")
partyGUIDMap.put(PartyMembers.REGONAR,"5dfa8214-7918-4653-a695-368d45e8caa6")
ROOT.m_EntityData[0].Descriptor.m_Inventory.m_Items[259].m_Enchantments.m_Facts[0].m_CurrentContext.m_OwnerDescriptor.Progression.Features.m_Facts[32].m_Context.m_OwnerDescriptor.$ref
For this save it seems to be "3594"
7. Knowing all of this I have the highest id, guid and owner descriptor reference, I iterate over all of the feats and increment id's, replacing all caster references with Regonar's UUID and all owner references with the one I found so that all the feats will show up in his character sheet.
... I try to do some magic to automatically link activatables/abilities to feats but that'd be another post
Basically I work on a couple of premade json files, from a high level perspective it seems simple but I still keep finding special cases for these objects
Code: Select all
int highestId = 7960
int ownerIdentifier = 3594 //varies from save to save :(
String ownerGUID = partyGUIDMap.get(PartyMembers.REGONAR)
def level = "lv3"
def featFile = "combat_feats_" + level + ".json"
def activatableFile = "activatable_abilities_" + level + ".json"
def abilityFile = "abilities_" + level + ".json"
//update feats
def ( updatedId, modifiedFeatText) = updateFeats(featFile, highestId, ownerIdentifier, ownerGUID)
highestId = updatedId
//update activatable abilities
highestId = updateActivatables(activatableFile, highestId, ownerIdentifier)
//update abilities
highestId = updateAbilities(abilityFile, highestId, ownerIdentifier)
//Link Abilities to feats
modifiedFeatText = linkAbilitiesToFeats(ADJUSTED_FILE_PREFIX + abilityFile, modifiedFeatText)
//Link Activatable Abilities to feats
modifiedFeatText = linkActivatableAbilitiesToFeats(ADJUSTED_FILE_PREFIX + activatableFile,modifiedFeatText)
def outputFile = ADJUSTED_FILE_PREFIX + featFile
saveFile(RESOURCE_DIR+FEAT_DIR, outputFile, modifiedFeatText)