Jump to content

Recommended Posts

Greetings! I am in dire need of assistance.

I have been trying to make a fueled prefab that accepts specific fuel items. For instance, Logs or Living Logs alone. Problem is I cannot figure out how to do this.

The only thing I can think of is using the "inst.components.fueled.fueltype" under "inst:AddComponent("fueled")". I would need to modify the Log and Living Log prefabs and add a custom fueltype to them and that would be a bad idea in general.

I hope I can find an alternative solution here.

Edited by DownloadALot
3 hours ago, DownloadALot said:

The only thing I can think of is using the "inst.components.fueled.fueltype" under "inst:AddComponent("fueled")".

Set it to the same fueltype as the log and living logs. Now, those, and cut grass, and twigs, etc. can burn.

Include this in your prefab with specific requirements to override its CanAcceptFuelItem function:

	_CanAcceptFuelItem = inst.components.fueled.CanAcceptFuelItem
	inst.components.fueled.CanAcceptFuelItem = function(self, item)
		return _CanAcceptFuelItem(self, item) and (item.prefab == "log" or item.prefab == "livinglog")
	end

Only the log and livinglog prefabs will return true. Other fuel with the same fueltype will return false.

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