Jump to content

How do I create a new Fuel Type?


Recommended Posts

This may be a noob question, but...

I want my moditem to accept some stuff as fuel, I know how to add fuel value to a prefab, but how do I give them a fuel type completely new and exclusive to the mod?

Thank you in advance!

Link to comment
Share on other sites

This is how you can do it:

local FUELTYPE = GLOBAL.FUELTYPE
FUELTYPE.YOUR_FUELTYPE = "YOUR_FUELTYPE" --replace YOUR_FUELTYPE with the name of your new fuel

AddPrefabPostInit("item", function(inst) --replace item with the item you want to have your new fueltype
	if not inst.components.fuel then
		inst:AddComponent("fuel")
	end
	inst.components.fuel.fueltype = FUELTYPE.YOUR_FUELTYPE
end)
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...