Add NPC supply chain workers

This commit is contained in:
CoalGov Deploy
2026-05-06 02:28:32 +00:00
parent be82f0b486
commit 3fb2b5c323
5 changed files with 214 additions and 6 deletions

View File

@@ -72,3 +72,5 @@ Craft a CoalGov Super Furnace with a furnace in the center and stone in the eigh
* /cgnpc funds <id> <amount> - add coal or Coal Cents to an NPC account.
* /cgnpc haggle <id> <buy|sell> <material> <amount> <offer> - negotiate with a trader.
* /cgnpc list - list NPC zones and CoalGov NPCs.
Worker roles are matched from the NPC name. By default, a worker named ''Farmer'' produces wheat, a worker named ''Baker'' consumes wheat to produce bread, and workers move surplus output to traders in the same NPC zone.

View File

@@ -0,0 +1,61 @@
====== NPC Supply Chains ======
CoalGov NPCs use Citizens and are managed with:
/cgnpc
===== Farm-To-Market Example =====
Select a polygon around the farm with ''/claim wand'', then create an NPC zone:
/cgnpc zone create farm
Create workers and a trader in that zone:
/cgnpc create worker Farmer farm
/cgnpc create worker Baker farm
/cgnpc create trader Marketman farm
The default supply chain is:
* Farmer produces WHEAT.
* Baker pulls WHEAT from same-zone NPC inventories.
* Baker consumes 3 WHEAT to produce 2 BREAD.
* Workers keep a reserve and move surplus output to same-zone traders.
* Players can haggle with traders for stocked goods.
Example player trade:
/cgnpc list
/cgnpc haggle <traderId> buy BREAD 8 8
===== Configuration =====
Worker roles are matched by NPC name under ''npc.worker.roles''. For example, an NPC named ''Farmer Joe'' uses the ''farmer'' role.
npc:
worker:
tick_interval_seconds: 20
roles:
farmer:
output_material: WHEAT
output_amount: 4
baker:
output_material: BREAD
output_amount: 2
inputs:
WHEAT: 3
supply_chain:
max_transfer_per_tick: 64
source_reserve: 16
worker_output_reserve: 16
traders_accept_outputs: true
trader_restock_target: 256
Admins can seed inventories with:
/cgnpc stock <id> <material> <amount>
and fund trader purchases with:
/cgnpc funds <id> <amount>