Jump to content

Recommended Posts

Hi all,

I've been using the Large chest mod for some time and only just realised, that when such chest burns, it becomes invisible, because the used bank (pandoras_chest_large) doesn't have a "burnt" anim.

Can someone suggest a quick fix for this? I'd be fine with just using the in-game effects to add 'black highlight" to the chest, but I don't see where or how to define what should happen when chest burns down...

Edited by myxal
Add [Solved] tag

Yeah, that would work too I guess, but looking at the code, there's no particular part that says what to do when the chest is burnt, or what anim should be used - I guess this all done by common in-game code?

I'm getting the impression that it would be easier to take the assets for pandoras_chest, actually add a "burnt" texture and animation state, and use that for the mod.

 

All right, having looked at how the widgetsetup is overriden in cr4shmaster's Magic Pouch mod, I replaced the onburnt method, to use the regular chest animation, scaled up:

local onburnt_old
local function onburnt_new(inst)
    inst.AnimState:SetBank("chest")
    inst.AnimState:SetBuild("treasure_chest")
    inst.AnimState:SetScale(1.7,1.7)
    onburnt_old(inst)
end
local function fn()
...
    MakeSmallBurnable(inst, nil, nil, true)
    MakeMediumPropagator(inst)
    onburnt_old = inst.components.burnable.onburnt
    inst.components.burnable:SetOnBurntFn(onburnt_new)
...

 

Edited by myxal

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