Jump to content

Recommended Posts

Hi! I'm making a character mod atm, and one of her main gimmicks is she can get certain foods unique to her that let her change her appearance and her stats to match other characters temporarily.

I made one basic food to test it with. Its supposed to try and change her appearance, damage resist, and damage dealt to try and match Wigfrid for a bit. However, it doesn't actually do any of that. It doesn't change looks nor does it change her stats at all. It also doesn't seem to crash the game either or give me any kind of error message.

local function OnEat(inst, food, feeder)
  if food.prefabname == "wathgrithr_blood" then
    inst.AnimState:OverrideSymbol("cheeks", "wathgrithr","cheeks")
    inst.AnimState:OverrideSymbol("face", "wathgrithr","face")
    inst.AnimState:OverrideSymbol("hair", "wathgrithr","hair")
    inst.AnimState:OverrideSymbol("hair_hat", "wathgrithr","hair_hat")
    inst.AnimState:OverrideSymbol("hairfront", "wathgrithr","hairfront")
    inst.AnimState:OverrideSymbol("hairpigtails", "wathgrithr","hairpigtails")
    inst.AnimState:OverrideSymbol("headbase", "wathgrithr","headbase")
    inst.AnimState:OverrideSymbol("headbase_hat", "wathgrithr","headbase_hat")
	inst.components.combat.damagemultiplier = 1.25
	inst.components.health:SetAbsorptionAmount(0.75)
  end
  --Other blood effects go here.
end

Is the main part of the code for it that's in the character's lua file.

In the master_postinit section, I also have this code.

inst.components.eater:SetOnEatFn(OnEat)

I'm wondering if anyone has any idea how to make this work? Should I try to redo the code inside of the food instead of the character? or is there some tiny mistake somewhere? I'm not sure.

Thank you for any help.

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...