Sign in to follow this  
inhumanrobot

Removing Abigail's Flower from Wendy's inventory

Recommended Posts

inhumanrobot    1185

Hey! I am working on an Abigail mod, and I want Abigail's Flower to be removed from Wendy's inventory (and have that be enabled or disabled in the config menu), but I'm having trouble achieving this. I will include the zip! All the code for Wendy is in the modmain.lua.

Here's the relevant part from the file (the recipe part definitely works, it's the actual inventory item that refuses to leave):

Spoiler

if GetModConfigData("abigailflower") then
    GLOBAL.AllRecipes.abigail_flower.level = GLOBAL.TECH.LOST

    if GLOBAL.TheNet:GetIsServer() then
        local function removeabby(inst)
            inst:DoTaskInTime(0, function(inst) inst:Remove() end)
        end

        AddPrefabPostInit("abigail_flower", removeabby)
        
    end
end
if not GLOBAL.TheNet:GetIsServer() then return end
    end

 

Abbyv5.5.zip

Share this post


Link to post
Share on other sites
ZupaleX    270

Wendy probably have some event callback which gives her back the item when she loses it. Or something along these lines. I did not check but that's my guess.

Share this post


Link to post
Share on other sites
12 hours ago, ZupaleX said:

Wendy probably have some event callback which gives her back the item when she loses it. Or something along these lines. I did not check but that's my guess.

If this is true you may be attempting to remove her flower too early, I would perform a function inside your prefab file that removes the flower after the character has loaded in.

Share this post


Link to post
Share on other sites
3 minutes ago, ZupaleX said:

If this is a callback on loosing the item that would not work. You would need to remove that callback instead.

Oh, I guess I didn't think of the function calling if abigails flower is removed rather if she launched the game without it, but it's just a guess since I don't have the game files readily available. :p

Share this post


Link to post
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
Sign in to follow this