Fuel Tweaks
This OXP introduces Quirium Fuel which you can scoop or buy on the F8 market commodities page - a more pure and more dangerous form of the fuel (requiring specialised equipment to scoop and specialised tanks for safe transport).
Contents
[hide]- 1 Overview
- 2 Commodities
- 3 Equipment
- 4 Options
- 5 Library Config
- 6 JavaScript Interfaces
- 7 Requirements
- 8 Download
- 9 License
- 10 Discussion
- 11 Version History
- 12 Other OXP's
- 13 Quick Facts
- 14 Gameplay and Balance indicator
Overview
This OXP seeks to add some interest and depth to the way fuel is handled. Firstly, a new commodity has been created, Quirium Fuel, which can be collected using fuel scoops and a Quirium Fuel Processing unit, then sold at stations for profit. Secondly, the way fuel is handled by stations can be controlled by various functions and properties. Fuel can be made available through fuel stations, or even completely unavailable except by scooping it.
Commodities
A new trade good has been added to the system: Quirium Fuel. This trade good gets its best price at mainly agricultural systems.
ITEM | DESCRIPTION | AVERAGE PRICE/ ₢ | UNITS |
---|---|---|---|
Quirium Fuel | Fuel scooped from a star's corona | 30.0 | TC |
Note that the base price of regular Fuel is around 2₢/ly.
The various fuel tanks imply that 1ly = 1TC (Internal Fuel Tank: 5ly takes 5TC; with the more complex Duplex Fuel Tank: 3ly takes 8TC).
Equipment
Three new equipment items have been added to the game.
Quirium Fuel Processors
Cost to install : 450.0 ₢ Techlevel : 4
This device replicates some of the fuel scooping system except, rather than putting the fuel into the main tank, processed fuel is stored in specialised fuel storage containers. The Fuel Processor is automatically activated during the fuel scoop process when the ship's main tank is full.
The Fuel Processor comes equipped with 1 fuel container, so simply by purchasing this item pilots will be able to scoop 1t of quirium fuel.
Quirium Fuel Storage Unit
Cost to install : 50.0 ₢ Techlevel : 3
Fuel storage units can store 1t of Quirium fuel. Until used they will not consume any cargo space. When fuel is scooped and processed the units will expand to hold the fuel. If Quirium Fuel is dumped, a fuel storage unit will be dumped with it. When it is scooped, the fuel storage unit will be scooped as well.
Quirium Fuel Transfer
Cost to install : 1380.0 ₢ Techlevel : 7
This prime-able device is a slightly unstable method of moving fuel from storage and into the main ship tank. Quirium fuel is highly volatile, and the connection between the fuel processor and all storage units is designed to be one-way during flight. The Fuel transfer device is a third party add-on which breaches some of the containment protocols of the storage units in order to extract fuel and dump it in the main engine fuel tank. There is a chance that cargo loss or equipment damage could result from the transfer process. There have been reports of complete ship destruction in extreme cases, but these reports are rare.
To transfer fuel during flight, prime the "Quirium Fuel Transfer" equipment, then press the "n" (activate) key twice to start transferring fuel. Press the "n" key a third time (or use the "b" (mode) key) to stop the process. For safety reasons, the process will stop automatically if you dock, begin a hyperspace jump or enter a wormhole.
A minimum 1t of Quirium fuel will be used regardless of how much is actually transferred to the main tank. Excess fuel is dumped to prevent any additional damage. For example, transferring 0.4LY of fuel will use 1t of Quirium. Transferring 6.4LY of fuel will also use 1t. Stopping the transfer process will dump the excess fuel from the container, meaning that each time you start the transfer you will use 1t of Quirium fuel.
Options
The "fuelTweaks_fuelEconomy.js" file contains a variety of functions and settings to control where fuel is sold, how much can be sold, and the presence of refuelling stations. While this file can be manually adjusted to taste, the preferred way is by using either the Library Config settings, or the JavaScript interfaces described below.
Fuel Stations
If fuel stations are enabled for a particular system, they will appear towards the edge of scanner range behind the main station. To get refuelled, simply fly into the station and come to a halt when directed. Fuel will then be transferred. When finished, exit the station and your account will be charged.
Fuel Rations
Some systems may have introduced a ration system, where a limited amount of fuel is available for purchase at the main station. Once you have purchased your ration, you will be unable to purchase any more fuel in that system until you jump out and come back.
Fuel Collector OXP
If Frame's Fuel Collector OXP is installed, the Fuel Collector will collect fuel into the Fuel Processor once the ship's tank is full.
Library Config
Many of the settings can be customised via Library Config.
Fuel Availability: Allegiance
This setting allows you to control which stations will have fuel, based on their allegiance. Select all the allegiances you want fuel to be available at by changing the "0" to a "1" in front of each allegiance type. Selecting no allegiances will effectively mean fuel will be available at any stations, regardless of allegiance (ie. this would be the same as the base game, where all stations that have an F3 screen will offer fuel for sale).
Fuel Availability: Economies
This settings allows you to control which systems will have fuel, based on their economy. Select all the economies you want fuel to be available at by changing the "0" to a "1" in front of each economy type.
Fuel Availability: Governments
This settings allows you to control which systems will have fuel, based on their government. Select all the governments you want fuel to be available at by changing the "0" to a "1" in front of each government type.
Fuel Stations: Economies
This settings allows you to control which systems will have fuel stations, based on their economy. Select all the economies you want fuel stations to be available at by changing the "0" to a "1" in front of each economy type.
Fuel Stations: Governments
This settings allows you to control which systems will have fuel stations, based on their government. Select all the governments you want fuel stations to be available at by changing the "0" to a "1" in front of each government type.
General Settings
Switches:
- Apply changes: True means changes made to the fuel availability settings will be saved with the game and will apply when the game is reloaded. False means the settings will only apply in the current game until it is reloaded.
- Normal fuel operation: True means all settings are ignored, and the default fuel system will be in place. False means all settings are applied, and by default, this will create refuelling stations near each main station. Use this to quickly turn the system on or off.
- Fuel rationing: True means there will be limits to the amount of fuel you can purchase. False means no rationing will be in effect.
- NPCs use stations: True means that NPCs will be able to use the stations.
Values:
- Max fuel ration: When rationing is in effect, set the maximum amount that can be purchased. Integer between 0 and 6.
- Default min TL: The minimum TL of a system where fuel can be purchased. 0 means everywhere.
- Refuel stn cost factor: The cost factor applied to fuel purchases from fuel stations. If 7LY of fuel would normally cost 15cr, a factor 0.15 would mean the actual cost would be (15 x 0.15) 2.25cr.
- Refuel stn min TL: The minimum TL of a system where fuel stations will be present. 0 means everywhere.
Examples
1. Using Refuelling Stations for fuel
In order to move all refuelling functions to refuelling stations, do the following:
a. Set "General Settings", "Switches", "Apply changes" to true.
b. Set "General Settings", "Switches", "Normal fuel operation" to false.
2. Only having Refuelling Stations in certain government types
To limit where refuelling stations will appear by the government type, do the following:
a. Open "Fuel Stations: Governments", "Flags", and change the flag from 1 to 0 on all government types where you do not want refuelling stations to appear.
3. Allowing normal refuelling at some government types
In order to allow some governments to have normal fuel operations (ie fuel can be purchased via the F3 Equip Ship screen), do the following:
a. Open "Fuel Availability: Governments", "Flags", and change the flag from 1 to 0 on all government types where you do not want normal fuel operations.
b. Open "Fuel Stations: Governments", "Flags", and ensure the opposite value is set for the government. That is, if you turned on fuel availability at Democracies, turn off fuel stations at Democracies.
4. Implementing fuel rationing
In order to allow fuel rationing, do the following:
a. Set "General Settings", "Switches", "Fuel rationing" to true.
b. Set "General Settings", "Values", "Max fuel ration" to the maximum number you want available. The default is 1 (ie only 1 LY of fuel can be purchased at the station per system visit).
Once fuel rationing is in place, any fuel availability settings will apply to rations. That is, if fuel is available in a system, it will be rationed.
JavaScript Interfaces
Note: Changes made to the fuel system via these JavaScript methods will persist across save games.
Fuel
$addFuelAvailability
worldScripts.FuelTweaks_FuelEconomy.$addFuelAvailability(ecos : array, govs : array, tl : int[, useRations : boolean])
Adds a economy/government/min techlevel fuel availability setting. "ecos" and "govs" are arrays containing integers between 0 and 7.
To ignore the economy or government, pass an empty array.
tl is an integer, being the minimum techlevel required, between -1 and 15 (-1 means no techlevel check is performed).
useRations is an optional flag indicating that fuel rations will be used at these systems, rather than the standard fuel.
$setMaxFuelRation
worldScripts.FuelTweaks_FuelEconomy.$setMaxFuelRation(maxVal : int)
Sets the maximum amount of fuel that can be purchased through a non-refuelling stations
$setFuelAllegiance
worldScripts.FuelTweaks_FuelEconomy.$setFuelAllegiance(alleg: array)
Sets an array of allegiance types to control what stations can sell fuel.
An empty array means all stations can sell fuel.
$addFuelSystemOverride
worldScripts.FuelTweaks_FuelEconomy.$addFuelSystemOverride(sysID : int, avail : boolean [, useRations : boolean [, maxRations : int]])
Adds a system specific override to the fuel system.
avail determines whether fuel will be available for sale.
useRations determines whether fuel rationing is in effect.
maxRations sets the maximum amount of fuel ration that can be sold.
Refuel Station
The following methods control the presence of refueling stations:
Note: Refuel stations will not be present if no fuel is available in the system.
Note: If a refueling station is present in a system, fuel will not be for sale in other stations.
$addRefuelStationAvailability
worldScripts.FuelTweaks_FuelEconomy.$addRefuelStationAvailability(ecos : array, govs : array, tl : int[, factor: float])
Adds a economy/government/min techlevel fuel availability setting. "ecos" and "govs" are arrays containing integers between 0 and 7.
To ignore the economy or government, pass an empty array.
tl is an integer, being the minimum techlevel required, between -1 and 15 (-1 means no techlevel check is performed)
factor is an optional decimal value that indicates the default fuel cost factor applied to these fuel stations.
Note: Fuel must be available in the system before a refuelling station can be added.
$setRefuelStationCostFactor
worldScripts.FuelTweaks_FuelEconomy.$setRefuelStationCostFactor(cf : decimal)
Sets the default cost factor applied to fuel sales at refuelling stations. default 0.15
$addRefuelStationSystemOverride
worldScripts.FuelTweaks_FuelEconomy.$addRefuelStationSystemOverride(sysID : int, avail : boolean, costFactor : decimal)
Adds an refuel station override item for the specified system ID.
avail = true means a refuel station will always be present, false means it will never be present
costFactor is the cost factor applied to fuel sales through the refuel station.
General Methods
$isFuelAvailable
worldScripts.FuelTweaks_FuelEconomy.$isFuelAvailable([sysID : int])
Returns true if the passed system ID (or the current system if no value passed) will have fuel fuel available (either at the station itself or via a refuelling station). Otherwise false.
$fuelRationsInUse
worldScripts.FuelTweaks_FuelEconomy.$fuelRationsInUse([sysID : int])
Returns true if fuel rationing is in use in the passed system ID.
$getMaxFuelRation
worldScripts.FuelTweaks_FuelEconomy.$getMaxFuelRation([sysID: int])
Returns the maximum fuel ration permitted in the passed system ID.
$isRefuelStationAvailable
worldScripts.FuelTweaks_FuelEconomy.$isRefuelStationAvailable([sysID : int])
Returns true if the passed system ID (or the current system if no value passed) will have refuelling stations present. Otherwise false.
Note: Fuel must be available in the system before a refuelling station can be added.
$reset
worldScripts.FuelTweaks_FuelEconomy.$reset();
Resets all fuel settings back to their default.
Requirements
The Market Script Interface OXP is a requirement for this pack.
If you have the Isis Interstellar OXP installed, you will need to make the following changes: 1. Change the "II_conditions.js" file to have the following code:
"use strict"; this.name = "II_conditions"; this.author = "Killer Wolf"; this.copyright = "(C) 2023 Killer Wolf."; this.license = "CC-NC-by-SA 3.0"; this.description = "Condition script for equipment."; this.allowAwardEquipment = function (equipment, ship, context) { return worldScripts["oolite-II"].II_allowAwardEquipment(equipment, ship, context); } this.updateEquipmentPrice = function (equipment, currentPrice) { return worldScripts["oolite-II"].II_updateEquipmentPrice(equipment, currentPrice); }
2. Change the "II_populator.js" file to have the following code:
"use strict"; // here we establish the position of the station. this needs to be the same every time the system is populated // you can use the system.pseudoRandomNumber property to add "randomness" to the location if you want // in this instance, we're just going to use the main station position, and put our station 5000m directly in front of it. //var stationPos = system.mainStation.position.add(system.mainStation.vectorForward.multiply(5000)); // next, we use the system.setPopulator to create the actual station using a callback // "create_my_station" is a text string that uniquely identifies this populator function this.name = "oolite-II"; this.author = "Killer Wolf"; this.copyright = "(C) 2023 Killer Wolf."; this.license = "CC-NC-by-SA 3.0"; this.systemWillPopulate = function() { if (galaxyNumber === 1 && system.ID === 195) { var stationPos = Vector3D(266700, 61250, 15235).fromCoordinateSystem("pwm"); system.setPopulator("II_station", { callback: function (pos) { system.addShips("KWii", 1, pos, 0); }, location: "COORDINATES", coordinates: stationPos, deterministic:true // < this is important }); } } this.II_allowAwardEquipment = function(equipment, ship, context) { if (context == "scripted") return true; // you should always do this at the top of this function. if ((equipment == "EQ_WEAPON_NEITH_LASER" || equipment == "EQ_WEAPON_KATHOS_LASER") && ship.isPlayer) { if (player.ship.dockedStation.dataKey == "KW_II") { return true; } return false; } return true; } this.II_updateEquipmentPrice = function(equipment, currentPrice) { var newprice = currentPrice; switch (equipment) { case "EQ_MISSILE": case "EQ_CARGO_BAY": case "EQ_FUEL": case "EQ_ECM": case "EQ_HARDENED_MISSILE": case "EQ_ENERGY_UNIT": if (player.ship.dockedStation.dataKey == "KW_II") { newprice = parseInt(newprice * 0.66); } break; case "EQ_DOCK_COMP": case "EQ_GAL_DRIVE": if (player.ship.dockedStation.dataKey == "KW_II") { newprice = parseInt(newprice * 0.75); } break; } return newprice; }
Download
Download FuelTweaks.oxz v1.15 (downloaded 671 times).
Download FuelTweaks.zip v1.15 (extract OXP folder to AddOns)
License
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
With thanks to Thargoid for his fly-through Fuel Station (from the Fuel Station OXP), and to gsagostinho for his amazing textures.
Discussion
This OXP is discussed at this forum link: https://bb.oolite.space/viewtopic.php?f=4&t=18947
Version History
1.15
- Switched logic for checking economy and government to be more logical. An empty array means everything is turned off, rather than ignored.
- Added Library Config options so player can easily change fuel settings for their game.
- A galactic jump will now not remove default settings, just any settings added via JS.
- Witchspace jumps will now stop any transfer of Quirium fuel from storage.
- Reduced the chance of damage when transferring fuel. Reduced the chance of a catastrophic failure.
- New fuel station model added, to replace old one.
- Added sound effects while fuel transfer in progress.
1.14.5
- Made compatible with Market Script Interface oxz.
1.14.4
- The current state of the Quirium Fuel Processor (ie. how full it is) is now shown on the F5F5 Manifest screen.
1.14.3
- A Quirium Fuel Storage Unit will now automatically be awarded whenever a quirium fuel cargo container is scooped.
1.14.2
- Bug fixes.
1.14.1
- Fixed invalid character in shipdata.plist file.
Other OXP's
- Fuel Collector allows slow scooping of fuel at a distance from the sun - and is compatible with this
- Solar Harvest OXP is similar but introduces two new types of commodity: "processed" Quirium Plasma & "raw" Coronal Plasma. An unfinished oxp.
- Duplex Fuel Tank allows two-way transfer of fuel between the ship's fuel tank and a reserve tank in the cargo hold.
Quick Facts
Version | Released | License | Features | Category | Author(s) | Feedback |
---|---|---|---|---|---|---|
1.15 | 2025-04-19 | CC BY-NC-SA 4.0 | Fuel changes | Mechanics OXPs | phkb | Oolite BB |
Gameplay and Balance indicator
Since scooping is slo-o-ow, you might like to try out File:Autopause.oxz: lets the game run and will then pause itself on red-alert (see Autopause (BB Thread) for more detail).
You can watch the refueling process in action in this Youtube video: Oolite 1.91 Refueling station