Create an account

FuelAPI  

Upload: 26 Jul 2022, 12:56
Created by: KONIJIMA [X]
Uploaded by: Aqxaro
FuelAPI
Incompatible with CocoLiquidOverhaul

Stop using CocoLiquidOverhaul will not be maintained anymore, FuelAPI is a more vanilla friendly version of it.

Framework to add new Fuel Container items

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.

Frequently Asked Questions
Can I add this mid-game?

Yes

Does it work in multiplayer?

Yes

Features

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

Large Fuel Can

By default, this mod add a large fuel canister.
(The same red large gas can from CocoLiquidOverhaul)

Sandbox Settings

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,
},
FuelAPI.FuelTransferSpeed

Choose the speed at which fuel should transfer.
Value: 1 = Vanilla
Value: 2 = Fast
Value: 3 = Very Fast

FuelAPI.BarrelDefaultQuantity

Set total quantity of fuel that can be stored in a barrel by default.
Value: 400

FuelAPI.CanPickupFullBarrel

Choose if barrel with fuel inside can be picked up.
Value: 1 = Must be empty
Value: 2 = Can pickup

How to add your own custom Fuel Container [IsoObject]?

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.

How to add your own custom Fuel Container [InventoryItem]?

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,
    }
}
Videos

Nurse - that's a lot of gas.

Github:

https://github.com/Konijima/Fuel-API

Skateboard

Skateboard

13 Aug 2022
1
1 989
0

Are you looking for an alternative means of transportation that does not require gasoline? Well you're in the right place! try right now the skateboard, a light, noisy and awesome vehicle that every teenager in 1993 must have had!

Comments
The minimum comment length is 10 characters.