Jump to content

Recommended Posts

This is going to be an odd one here, but I'm going to ask my question anyway since it's hung me up for quite some time while working on it. So I've been working on a custom character recently, one with a perk of giving "buffs" to her followers with speed, damage, attack period, increased loyalty per hunger, max loyalty, and immediate health spread out to a variety of different companions once it accepts your food within the OnGetItemFromPlayer function.

Now I've completed (and posted) her for DST simply by doing the "copy the ___.lua file to your mod and change what you need to" strategy, and while that did work, I'm still not satisfied with the end result. Since I've decided to re-make this mod for DS, ROG, & SW, I want make it compatible with the base game and all DLC first, then copy the code for the perk to fix the mod's instability in DST afterword.

Now I do know about how to initialize the prefabs and begin the AddPrefabPostInit and have read in a similar post for assistance. However, I'm met with either the pigman (for example) not becoming a companion (thus eating the meat and leaving), the game crashing upon feeding the pigman, or at worst the mod crashing to where the game cannot enable the mod.

So what I'm asking is what do you need to do within the AddPrefabPostInit to make the pigman (again, for example) go through a custom OnGetItemFromPlayer function, applying the buffs in the process.

If there is no way, and or if there is a simpler way, I'd love to hear that too.

Any help would be appreciated, thanks!

Link to comment
https://forums.kleientertainment.com/forums/topic/67928-changing-trader-functions/
Share on other sites

Ok, I've figured out the problem I was having was. Within the AddPrefabPostInit I was mainly trying to re-invent the onaccept function within the trader.lua file when instead I should've acted as though I was re-inventing the OnGetItemFromPlayer function within the pigman.lua file (for the sake of my example). So I guess call this topic solved.

Edited by LordBritish

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...