Jump to content

Extracting Berry Bush Animations


Recommended Posts

Hello all,

I'm trying to make a new kind of bush that's basically exactly the same as the berry bush ("berrybush" prefab) only with something other than berries on it.

I have the images, Spriter shows the animations work, but in the game itself there is a problem with picking the "berries" off the bush - both before and after picking it, it still shows the same amount of "berries" on it.
From looking at the code I saw that there is a setberries() function which determines the amount of berries shown.
To do that it shows/hides animations called "berries", "berriesmore" and "berriesmost":

local function setberries(inst, pct)
    if inst._setberriesonanimover then
        inst._setberriesonanimover = nil
        inst:RemoveEventCallback("animover", setberries)
    end

    local berries =
        (pct == nil and "") or
        (pct >= .9 and "berriesmost") or
        (pct >= .33 and "berriesmore") or
        "berries"

    for i, v in ipairs({ "berries", "berriesmore", "berriesmost" }) do
        if v == berries then
            inst.AnimState:Show(v)
        else
            inst.AnimState:Hide(v)
        end
    end
end

 

And it seems that the problem is that my animation data doesn't have these three animations.
I used Krane to extract the Spriter project from the game files, and the project contains all the animations except those three, it seems.
Opening the original bush's anim.bin file in a hex editor shows that these three terms are present in it (at the end of the file), but after extracting it, searching the contents of the extracted files for them yields nothing in any file.

I've tried adding these three animations to the project with what I think they should contain, but it made little difference, and what it did do made no sense to me.

Can someone please help me understand what's going on here, or at least how I can go about making my own somethingbush?

Thanks in advance.

Link to comment
Share on other sites

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
 Share

×
  • Create New...