Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Pathfinder: Kingmaker Modding Thread

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
you still got errors?

john it wasnt a question.. i was just curious why he still has error marks if he solved it :D
 
Last edited:

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
what did you learn pink. walk me through
lets combine what you got so far with whitenons new sleek menu look
 
Last edited:

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
Read some entry lvl c#/java crash course imo, or do a bunch of Unity tutorial

Rob code isnt even that accessible iirc
 

Pink Eye

Monk
Patron
Joined
Oct 10, 2019
Messages
6,195
Location
Space Refrigerator
I'm very into cock and ball torture
what did you learn pink. walk me through
lets combine what you got so far with whitenons new sleek menu look
Brah. I've been obsessively reading this shit since yesterday. I haven't slept at all, and can't think straight. Discord trannies turned out to be zero help.
 

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
ill look into it but i was hoping you would yield some results i can continue..
 

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
ccle328l1iq21.jpg
 

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
wish i could...
i'd probably make a small fortune out of donations
 

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
@SCS

It's a fucking big endeavor

I kinda tried to implement some of its concept but mostly failed..

IIRC, the AI is so complex to tweak or modify at the time I totally gave up on it

As for tweaking each encounters/mobs, it's definetely doable but it's an herculean task
 

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
Working on the UI is somewhat helpful to understand basic programming, sure

But it has 'nothing' to do with PFKM modding.

If your end goal is to make a mod, UI is the last of your worries.

Not a lot of transferable knowledge here, and it isnt specially rewarding either on completion
 

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
I was hoping pink and him would combine forces but alas it was not meant to be.

Bag of tricks has menu.cs, which draws all of it. menutext.cs holds every string so its easily localized. menutools.cs has functions he implemented for ease of use.
check menutools to see how he formats text with colors, bigger font, etc.

You dont need to do everything bag of tricks does though. if you are done with basic menu making. Make a neat menu for gold mod that has collapsable menus. 3 categories for 1-time commands (give gold-xp-bp), item spawning and adding feats.

try to see if you can add a toggle for every character in party which will be used when choosing who gets the feat chosen.

john he can use this imgui knowledge on any unity game or unity project. As you say, its to grow him into programming logic
 

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
Yeah sure, but they'd achieve the same (or better) by forgoing the UI.

Programming ain't easy, so motivation is key.

It's probably better to do 10 small barebone project, with simple and specific usecases than one trying to englobe 10 skillset
 

John Keel

Savant
Joined
Aug 10, 2017
Messages
694
Random stuff I recovered:

Code:
class JakuHelpers
    {
        public static void AddToVendorTable(BlueprintItemWeapon blueprintItemWeapon, String sharedVendorTable, int count)
        {
            BlueprintItemWeapon Weapon = blueprintItemWeapon;
            int quantityToAdd = count;
            var LootItemPackFixed = Helpers.Create<Kingmaker.Blueprints.Loot.LootItemsPackFixed>();
            var lootItem = new Kingmaker.Blueprints.Loot.LootItem();
            Traverse.Create(lootItem).Field("m_Item").SetValue(Weapon);
            Traverse.Create(lootItem).Field("m_Type").SetValue(Kingmaker.Blueprints.Loot.LootItemType.Item);
            Traverse.Create(LootItemPackFixed).Field("m_Item").SetValue(lootItem);
            Traverse.Create(LootItemPackFixed).Field("m_Count").SetValue(quantityToAdd);

            var libraryLoot = ResourcesLibrary.TryGetBlueprint<BlueprintSharedVendorTable>(sharedVendorTable);
            libraryLoot.AddComponent(LootItemPackFixed);

        }

        public static void AddWandToVendorTable(String guidWand, String sharedVendorTable, int count)
        {
            BlueprintItemEquipmentUsable item = ResourcesLibrary.TryGetBlueprint<BlueprintItemEquipmentUsable>(guidWand);
            int quantityToAdd = count;
            var LootItemPackFixed = Helpers.Create<Kingmaker.Blueprints.Loot.LootItemsPackFixed>();
            var lootItem = new Kingmaker.Blueprints.Loot.LootItem();
            Traverse.Create(lootItem).Field("m_Item").SetValue(item);
            Traverse.Create(lootItem).Field("m_Type").SetValue(Kingmaker.Blueprints.Loot.LootItemType.Item);
            Traverse.Create(LootItemPackFixed).Field("m_Item").SetValue(lootItem);
            Traverse.Create(LootItemPackFixed).Field("m_Count").SetValue(quantityToAdd);

            var libraryLoot = ResourcesLibrary.TryGetBlueprint<BlueprintSharedVendorTable>(sharedVendorTable);
            libraryLoot.AddComponent(LootItemPackFixed);

        }

        public static BlueprintItemWeapon CopyAndAddRename(String ogGUID, String newName, String newDisplayName, String newGUID)
        {
            var v = Main.library.CopyAndAdd<BlueprintItemWeapon>(ogGUID, newName, newGUID);
            Helpers.SetLocalizedStringField(v, "m_DisplayNameText", newDisplayName);
            return v;
        }

        public static void AddEnchantToWeapon(String guidTargetWpn, String guidWeaponEnchant)
        {
            var wpn = ResourcesLibrary.TryGetBlueprint<BlueprintItemWeapon>(guidTargetWpn);
            var enchant = ResourcesLibrary.TryGetBlueprint<BlueprintWeaponEnchantment>(guidWeaponEnchant);
            wpn.Enchantments.Add(enchant);
        }


        public static void AddUseInDungeonToUnit(BlueprintUnit unit)
        {
            var targcompo = Helpers.Create<Kingmaker.UnitLogic.FactLogic.AddTags>(t =>
            {
                t.UseInDungeon = true;
            });
            unit.AddComponent(targcompo);
        }

        public static void AddCreatureToArmy(String guidCrea, int iArmy, int iCr)
        {
            var bpDungeonRoot = ResourcesLibrary.TryGetBlueprint<Kingmaker.Dungeon.Blueprints.BlueprintDungeonRoot>("d5ac7a99563987948b653b03b341167b");
            BlueprintUnit unit = ResourcesLibrary.TryGetBlueprint<BlueprintUnit>(guidCrea);

            AddUseInDungeonToUnit(unit);

            bpDungeonRoot.Armies[iArmy].UnitsByCR[iCr].Units = bpDungeonRoot.Armies[iArmy].UnitsByCR[iCr].Units.AddToArray(unit);

        }

        public static void disableTrashloot()
        {
            //test loot cleanup trash
            var libtrash = ResourcesLibrary.TryGetBlueprint<TrashLootSettings>("77fe4de4c707e51439971ee480e94efc");


            for (int count = 0; count < 5; count++)
            {
                libtrash.Table[count].Types[0].Weight = 20;
                libtrash.Table[count].Types[3].Weight = 55;
                libtrash.Table[count].Types[4].Weight = 0;
                libtrash.Table[count].Types[5].Weight = 0;
                libtrash.Table[count].Types[6].Weight = 0;
                libtrash.Table[count].Types[7].Weight = 0;
                libtrash.Table[count].Types[8].Weight = 0;
            }


        }

        public static SharedStringAsset CreateSharedStringAsset(string uniqueString, string localizedname){

            var sharedString = ScriptableObject.CreateInstance<SharedStringAsset>();
            sharedString.String = Helpers.CreateString(uniqueString, localizedname);           
            return sharedString;         
           
        }

        public static void CreateBardInstrument(String objectName, String newGUID, String spellToAdd, String itemName, String flavorText, int charges = 1)
        {
            BlueprintItemEquipmentUsable customBardInstrument = Main.library.CopyAndAdd<BlueprintItemEquipmentUsable>("c426180be627cf84284bc9abcada55af", objectName, newGUID);
            BlueprintAbility customSpell = Main.library.TryGet<BlueprintAbility>(spellToAdd);
            customBardInstrument.Ability = customSpell;
            customBardInstrument.Charges = charges;
            Sprite customBardInstrumentIcon = LoadIcons.Image2Sprite.Create(@"Mods\zQOLEndless\itemicons\" + objectName+".png");
            customBardInstrument.SetItemIcon(customBardInstrumentIcon);


            Helpers.SetLocalizedStringField(customBardInstrument, "m_DisplayNameText", itemName);
            Helpers.SetLocalizedStringField(customBardInstrument, "m_FlavorText", flavorText);
        }

        public static void DungeonAddItemToItemList(String objectGUID, int iItemCategory)
        {
            var bpdungeonroot = ResourcesLibrary.TryGetBlueprint<Kingmaker.Dungeon.Blueprints.BlueprintDungeonRoot>("d5ac7a99563987948b653b03b341167b");
            bpdungeonroot.Items[iItemCategory].Items = bpdungeonroot.Items[iItemCategory].Items.AddToArray(ResourcesLibrary.TryGetBlueprint<BlueprintItemEquipment>(objectGUID));
        }

        public static void DungeonAddScrollToItemList(String objectGUID)
        {
            var lib = ResourcesLibrary.TryGetBlueprint<TrashLootSettings>("77fe4de4c707e51439971ee480e94efc");
            lib.Types[4].Items.Add(ResourcesLibrary.TryGetBlueprint<BlueprintItemEquipmentUsable>(objectGUID));

        }
    }
 

Efe

Erudite
Joined
Dec 27, 2015
Messages
2,604
Didnt get to check your code yet but i think we might get somewhere with it
https://www.mediafire.com/file/vn0h4eosapf2qkb/MagicSmith.v001.7z/file
ItemsCollection inventory = Game.Instance.Player.Inventory;
List<ItemEntity> itemlist = new List<ItemEntity>();
foreach (ItemEntity it in inventory) {
modEntry.Logger.Log(it.Name);
itemlist.Add(it.Blueprint.CreateEntity());

}
foreach (ItemEntity it in itemlist) {
Game.Instance.Player.Inventory.Add(it.Blueprint.CreateEntity());
}
itemlist.Clear();
so with this i get a list of items player has and create an extra copy with createentity
to get something new i should duplicate blueprint, modify it and then create it. right?

on a side note: i think i spent an hour looking at what craft magic items did and made 0 progress... then just winged it with goldmod from when intellisense showed methods and variables under Game.Instance.Player
 
Last edited:

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom