Skip to content

Commit

Permalink
Change Biofluid network trip requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakkowww committed Jul 12, 2024
1 parent 25d0331 commit b8952fc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Version: 2.1.42
Date: ?
Changes:
- Fixed crash when copy-pasting caravan schedules.
- Modified requirements for a trip in the Biofluid network: provider has to have 10000 fluid present and requester has to have 10000 missing.
- Added map settings to control the amounts in the previous point.
- Modified the in-game wiki text accordingly.
Bugfixes:
- Fixed ralesia turd 3 having overlapping fluid inputs (https://github.com/pyanodon/pybugreports/issues/530)
---------------------------------------------------------------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion locale/en/biofluid.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ no-biofluid-network=Out of biofluid network

[gui]
priority=Priority
temperature-filter=Temperature filter
temperature-filter=Temperature filter

[mod-setting-name]
pal_min_fluid_reserve=Biofluid provider minimum fluid reserve
pal_min_fluid_request=Biofluid requester minimum fluid request

[mod-setting-description]
pal_min_fluid_reserve=Minimum fluid amount required to be present in a provider to initiate a biofluid transfer trip
pal_min_fluid_request=Minimum fluid amount required to be missing from a requester to initiate a biofluid transfer trip
2 changes: 1 addition & 1 deletion locale/en/tips.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ocula=You’ve developed a weird, creepy, overpriced eyeball creature. [item=ocu
vatbrain=Sometimes science pushes too far. [entity=vat-brain] grants a large productivity bonus to nearby [entity=lab] at a high cost.\n\n[entity=vat-brain] works similarly to the [entity=beacon], however it must be fed constantly with cartridges such as [item=brain-cartridge-01]. A single cartridge will last for 20 seconds.\nThe effect of multiple vatbrains can stack together, granting a greater productivity bonus. Whenever the cartridge expires, you will lose the productivity bonus.\n\nEach cartridge grants a different amount of productivity to nearby labs:\n- [item=brain-cartridge-01] →25%\n- [item=brain-cartridge-02] →50%\n- [item=brain-cartridge-03] →75%\n- [item=brain-cartridge-04] →100%
symbiosis=The [item=ulric-infusion] allows you to combine the best aspects from multiple species. Inject or digest this serum to temporarily gain heightened physical abilities. This procedure will transform your character into a ulric-human hybrid for 10 minutes.\n\nIncreased attributes include:\n- Running speed +40%\n- Reach distance ×3\n- Health and regeneration ×5\n- Inventory slots +40\n- Train immunity\n- Instant mining speed\n- Powerful melee attack\n\nThe ulric transformation lasts for only 10 minutes however the [item=ulric-infusion-equipment] can autoinject fresh serum from your inventory. Place the [item=ulric-infusion-equipment] inside an armor’s equipment grid and provide power to continuously benefit from the transformation.
turd=Welcome to the technological upgrade and research device. This page contains permanent upgrades to specific machines.\nResearch the primary technology from the technology tree and the T.U.R.D. upgrade options will become available from this menu. Available upgrades include permanent module bonuses, new recipes, and recipe upgrades.\n[item=speed-module-3] Speed bonuses scale with the farm building tier. [item=productivity-module-3] Productivity bonuses apply to all recipes in a machine.
biofluid=You’ve successfully bio-engineered [entity=gobachov], [entity=huzu], and [entity=chorkok]. These three creatures are biological alternatives to the [entity=py-logistic-robot-01]. Instead of transporting items, they will instead help in your fluid logistics. They are able to transfer fluids between [entity=provider-tank] and [entity=requester-tank].\n\nA [entity=bioport] is required to store, feed, and muck out your worker creatures. Unlike the standard [entity=py-roboport-mk01] the Biopyanoport has no logistic radius. Instead, make a direct connection using [entity=vessel] and [entity=vessel-to-ground].\n\n[entity=bioport] requires a constant caloric supply in order to keep the creatures healthy and active. Each tier of worker’s food allows for a different amount of deliveries. Food is always consumed at the beginning of the delivery. [item=effectivity-module-3] can be used. Additionally, the [entity=bioport] will only spawn biofluid creatures at a maximum rate of 1 creature every 2.38 seconds. A biofluid creature will typically return to whichever bioport it came from, but there is a 10% chance for it to spread to another bioport in the same network.\n\nThe [entity=requester-tank] has several useful filter settings. First, configure the requested fluid type and amount. Secondly, configure the requester’s priority when compared to other requesters. Note that if two requesters have the same priority, the requester with the highest request size minus the currently contained fluid will be chosen first. Finally there is an optional temperature filter. A request will not be completed if the requester is more than 66.6% full. All requester settings are blueprintable and copypastable.\n\n[item=guano] is a useful waste product created in the [entity=bioport]. When consuming food, each creature generates a small amount of waste shown as the productivity bar. Once the waste bar is full, the bar is reset and 3 [item=guano] are generated in the output slot. Remove the waste products using an inserter or your [entity=bioport] will back-up and stop functioning.\n\nEach biofluid creature has different stats depending on its tier:\n[entity=gobachov] - Tier: MK 01, Speed: 19.4 km/h, Max delivery size: 10000, Waste per trip: 0.6\n[entity=huzu] - Tier: MK 02, Speed: 25.9 km/h, Max delivery size: 15000, Waste per trip: 0.8\n[entity=chorkok] - Tier: MK 03, Speed: 64.8 km/h, Max delivery size: 20000, Waste per trip: 1.3
biofluid=You’ve successfully bio-engineered [entity=gobachov], [entity=huzu], and [entity=chorkok]. These three creatures are biological alternatives to the [entity=py-logistic-robot-01]. Instead of transporting items, they will instead help in your fluid logistics. They are able to transfer fluids between [entity=provider-tank] and [entity=requester-tank].\n\nA [entity=bioport] is required to store, feed, and muck out your worker creatures. Unlike the standard [entity=py-roboport-mk01] the Biopyanoport has no logistic radius. Instead, make a direct connection using [entity=vessel] and [entity=vessel-to-ground].\n\n[entity=bioport] requires a constant caloric supply in order to keep the creatures healthy and active. Each tier of worker’s food allows for a different amount of deliveries. Food is always consumed at the beginning of the delivery. [item=effectivity-module-3] can be used. Additionally, the [entity=bioport] will only spawn biofluid creatures at a maximum rate of 1 creature every 2.38 seconds. A biofluid creature will typically return to whichever bioport it came from, but there is a 10% chance for it to spread to another bioport in the same network.\n\nThe [entity=requester-tank] has several useful filter settings. First, configure the requested fluid type and amount. Secondly, configure the requester’s priority when compared to other requesters. Note that if two requesters have the same priority, the requester with the highest request size minus the currently contained fluid will be chosen first. Finally there is an optional temperature filter. The minimum amount of fluid required to be present in a provider for it to be eligible for transfer can be configured in the map settings (by default it is 10000 units), the same goes for the amount of minimum missing fluid in requesters. All requester settings are blueprintable and copypastable.\n\n[item=guano] is a useful waste product created in the [entity=bioport]. When consuming food, each creature generates a small amount of waste shown as the productivity bar. Once the waste bar is full, the bar is reset and 3 [item=guano] are generated in the output slot. Remove the waste products using an inserter or your [entity=bioport] will back-up and stop functioning.\n\nEach biofluid creature has different stats depending on its tier:\n[entity=gobachov] - Tier: MK 01, Speed: 19.4 km/h, Max delivery size: 10000, Waste per trip: 0.6\n[entity=huzu] - Tier: MK 02, Speed: 25.9 km/h, Max delivery size: 15000, Waste per trip: 0.8\n[entity=chorkok] - Tier: MK 03, Speed: 64.8 km/h, Max delivery size: 20000, Waste per trip: 1.3

[turd]
randomize=Indecisive? Let fate decide a random option.
Expand Down
7 changes: 5 additions & 2 deletions scripts/biofluid/biofluid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ local function build_providers_by_contents(network_data, relavant_fluids)
local providers_by_contents = {}
network_data.providers_by_contents = providers_by_contents
local providers = network_data.providers
local min_fluid_reserve = settings.global['pal_min_fluid_reserve'].value

for k, provider in pairs(providers) do
if not provider.valid then
Expand All @@ -194,7 +195,7 @@ local function build_providers_by_contents(network_data, relavant_fluids)
if not relavant_fluids[name] then goto continue end
local already_allocated = network_data.allocated_fluids_from_providers[provider.unit_number] or 0
local can_give = contents.amount - already_allocated
if can_give < 500 then goto continue end
if can_give < min_fluid_reserve then goto continue end

local list = providers_by_contents[name] or {}
providers_by_contents[name] = list
Expand Down Expand Up @@ -572,6 +573,8 @@ end
function Biofluid.get_unfulfilled_requests()
local relavant_fluids = {}
local result = {}
local min_fluid_request = settings.global['pal_min_fluid_request'].value

for unit_number, requester_data in pairs(global.biofluid_requesters) do
local requester = requester_data.entity
if not requester or not requester.valid then
Expand All @@ -598,7 +601,7 @@ function Biofluid.get_unfulfilled_requests()
already_stored = already_stored + contents.amount
end
local request_size = goal - already_stored
if request_size < goal / 3 then goto continue end
if request_size < min_fluid_request then goto continue end
result[#result+1] = {
name = fluid_name,
amount = request_size,
Expand Down
18 changes: 18 additions & 0 deletions settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
data:extend{
{
type = 'double-setting',
name = 'pal_min_fluid_reserve',
setting_type = 'runtime-global',
minimum_value = 1,
maximum_value = 20000,
default_value = 10000
},
{
type = 'double-setting',
name = 'pal_min_fluid_request',
setting_type = 'runtime-global',
minimum_value = 1,
maximum_value = 20000,
default_value = 10000
}
}

0 comments on commit b8952fc

Please sign in to comment.