Jump to content

Recommended Posts

Im making a char and after some work i got how to add upgrades like wx but i cant add them to nightmare fuel cause its not edible , how can i make it edible like in wx's case ?

hiroki_none.pngLooks better in game i swear >.<

Edited by Franke004

As you can see in gears.lua   

Quote

inst:AddComponent("edible")
inst.components.edible.foodtype = FOODTYPE.GEARS

just change the FOODTYPE.

 

to make a custom foodtype, you can do

    FOODTYPE.FUEL = "FUEL"

then add a function to component 'eater' with AddComponentPostInit

    function Eater:SetCanEatFuel()
        table.insert(self.preferseating, FOODTYPE.FUEL)
        table.insert(self.caneat, FOODTYPE.FUEL)
        self.inst:AddTag(FOODTYPE.FUEL.."_eater")
    end

and call this function after eater is added to your character prefab, just like wx78.lua do.

 

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