Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
justarandomgeek committed Jan 6, 2018
0 parents commit d1b9fcb
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.blend export-ignore
4 changes: 4 additions & 0 deletions data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for k,v in pairs(data.raw["utility-constants"]["default"].train_path_finding) do
data.raw["utility-constants"]["default"].train_path_finding[k] =
settings.startup["pathological-"..k].value
end
11 changes: 11 additions & 0 deletions info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "pathological",
"version": "0.16.0",
"factorio_version": "0.16",
"title": "Pathological",
"author": "justarandomgeek",
"homepage": "",
"contact": "justarandomgeek@gmail.com",
"description": "Allows adjustment of rail pathing weights",
"dependencies": ["base >= 0.16.0"]
}
12 changes: 12 additions & 0 deletions locale/en/en.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

[mod-setting-name]
pathological-train_stop_penalty=Train Stop Penalty
pathological-stopped_manually_controlled_train_penalty=Stopped Manually Controlled Train Penalty
pathological-stopped_manually_controlled_train_without_passenger_penalty=Stopped Manually Controlled Train Without Passenger Penalty
pathological-signal_reserved_by_circuit_network_penalty=Signal Reserved By Circuit Network Penalty
pathological-train_in_station_penalty=Train In Station Penalty
pathological-train_in_station_with_no_other_valid_stops_in_schedule=Train In Station With No Other Valid Stops In Schedule
pathological-train_arriving_to_station_penalty=Train Arriving To Station Penalty
pathological-train_arriving_to_signal_penalty=Train Arriving To Signal Penalty
pathological-train_waiting_at_signal_penalty=Train Waiting At Signal Penalty
pathological-train_waiting_at_signal_tick_multiplier_penalty=Train Waiting At Signal Tick Multiplier Penalty
13 changes: 13 additions & 0 deletions makerelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Run this script after committing an updated info.json to automatically tag the update and prepare a zip of it.

# Get mod name and version from info.json
# https://stedolan.github.io/jq/
modname=`cat info.json|jq -r .name`
modver=`cat info.json|jq -r .version`

# Create git tag for this version
git tag "$modver"

# Prepare zip for Factorio native use and mod portal
git archive --prefix "${modname}_$modver/" -o "${modname}_$modver.zip" HEAD
23 changes: 23 additions & 0 deletions settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local function create_settings(name,default,type)
data:extend{
{
type = type.."-setting",
name = "pathological-"..name,
setting_type = "startup",
default_value = default,
order="pathological-"..name
},
}
end

-- too bad i can't auto-populate this from data.raw...
create_settings("train_stop_penalty", 2000, "int")
create_settings("stopped_manually_controlled_train_penalty", 2000, "int")
create_settings("stopped_manually_controlled_train_without_passenger_penalty", 7000, "int")
create_settings("signal_reserved_by_circuit_network_penalty", 1000, "int")
create_settings("train_in_station_penalty", 500, "int")
create_settings("train_in_station_with_no_other_valid_stops_in_schedule", 1000, "int")
create_settings("train_arriving_to_station_penalty", 100, "int")
create_settings("train_arriving_to_signal_penalty", 100, "int")
create_settings("train_waiting_at_signal_penalty", 100, "int")
create_settings("train_waiting_at_signal_tick_multiplier_penalty", 0.1, "double")

0 comments on commit d1b9fcb

Please sign in to comment.