FuelAPI
Stop using CocoLiquidOverhaul will not be maintained anymore, FuelAPI is a more vanilla friendly version of it.
This is a complete re-write of CocoLiquidOverhaul with optimized functions "overwrite" letting mod creator add custom fuel container item to the game by adding only Tags to the items.
Yes
Yes
Any fuel container can:
- Sandbox Settings for customization
- Store gas into Barrels
- Take gas from fuel station
- Siphon gas from Vehicles / Trailers
- Add gas to vehicles / Trailers
- Add gas to generator
- Burn corpse
- Light Campfire
- Light BBQ
By default, this mod add a large fuel canister.
(The same red large gas can from CocoLiquidOverhaul)
Find FuelAPI settings into World sandbox settings tab.
For server owner, add those settings to your server_SandboxVars.lua file.
Default settings:
FuelAPI = {
FuelTransferSpeed = 2,
BarrelDefaultQuantity = "400",
CanPickupFullBarrel = 1,
},
Choose the speed at which fuel should transfer.
Value: 1 = Vanilla
Value: 2 = Fast
Value: 3 = Very Fast
Set total quantity of fuel that can be stored in a barrel by default.
Value: 400
Choose if barrel with fuel inside can be picked up.
Value: 1 = Must be empty
Value: 2 = Can pickup
In your own mod, you can create IsoObject that can store fuel
All you need to do to make a custom IsoObject store fuel is to set the CustomName to Barrel.
If you need to customize the name using Translation file for your barrels add a GroupName that suit your needs.
By default the fuel capacity default to 400 unit of fuel, you can set the amount in the tile properties as you need.
In your own mod, you can create custom fuel container items.
You can check the code for example but here are the simple explanation.
The empty container
is a normal type item. See Base.EmptyPetrolCan
Tags = CustomFuelContainer; Petrol_<ModuleName>_<FullGasContainerItemName>
The container filled with gasoline
is a drainable type item. See Base.PetrolCan
Tags = CustomFuelContainer; Empty_<ModuleName>_<EmptyGasContainerItemName>
Item Script Example
module FuelAPI {
imports {
Base,
}
// The Empty Container
item LargePetrolCan
{
DisplayCategory = VehicleMaintenance,
Weight = 2,
Type = Normal,
DisplayName = Empty Large Gas Can,
Icon = LargePetrolCan,
StaticModel = LargePetrolCan,
SurvivalGear = TRUE,
ReplaceInSecondHand = Bag_LargePetrolCan_LHand holdingbagleft,
ReplaceInPrimaryHand= Bag_LargePetrolCan_RHand holdingbagright,
WorldStaticModel = LargePetrolCan_Ground,
Tags = CustomFuelContainer; Petrol_FuelAPI_LargePetrolCanFull,
}
// The container filled with gasoline
item LargePetrolCanFull
{
DisplayCategory = VehicleMaintenance,
Weight = 18,
Type = Drainable,
UseWhileEquipped = FALSE,
UseDelta = 0.04,
DisplayName = Large Gas Can,
Icon = LargePetrolCan,
ReplaceOnDeplete = LargePetrolCan,
StaticModel = LargePetrolCan,
ReplaceInSecondHand = Bag_LargePetrolCan_LHand holdingbagleft,
ReplaceInPrimaryHand= Bag_LargePetrolCan_RHand holdingbagright,
WorldStaticModel = LargePetrolCan_Ground,
Tags = CustomFuelContainer; Empty_FuelAPI_LargePetrolCan,
}
}