aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_line_automation')
-rw-r--r--advtrains_line_automation/depends.txt2
-rw-r--r--advtrains_line_automation/init.lua17
-rw-r--r--advtrains_line_automation/readme.txt5
-rw-r--r--advtrains_line_automation/stoprail.lua39
-rw-r--r--advtrains_line_automation/textures/advtrains_dtrack_shared_stop.pngbin0 -> 3306 bytes
-rw-r--r--advtrains_line_automation/textures/advtrains_dtrack_stop_placer.pngbin0 -> 1238 bytes
6 files changed, 63 insertions, 0 deletions
diff --git a/advtrains_line_automation/depends.txt b/advtrains_line_automation/depends.txt
new file mode 100644
index 0000000..53500ee
--- /dev/null
+++ b/advtrains_line_automation/depends.txt
@@ -0,0 +1,2 @@
+advtrains_interlocking
+advtrains_train_track \ No newline at end of file
diff --git a/advtrains_line_automation/init.lua b/advtrains_line_automation/init.lua
new file mode 100644
index 0000000..5521ee9
--- /dev/null
+++ b/advtrains_line_automation/init.lua
@@ -0,0 +1,17 @@
+-- Advtrains line automation system
+
+advtrains.lines = {}
+
+
+local modpath = minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM
+
+dofile(modpath.."stoprail.lua")
+
+
+function advtrains.lines.load(data)
+
+end
+
+function advtrains.lines.save()
+ return {}
+end
diff --git a/advtrains_line_automation/readme.txt b/advtrains_line_automation/readme.txt
new file mode 100644
index 0000000..3280ce9
--- /dev/null
+++ b/advtrains_line_automation/readme.txt
@@ -0,0 +1,5 @@
+== advtrains_line_automation
+This mod provides an extension to the interlocking system which allows to automatically operate trains on train lines.
+
+This extension makes use of the table
+advtrains.lines \ No newline at end of file
diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua
new file mode 100644
index 0000000..a02e501
--- /dev/null
+++ b/advtrains_line_automation/stoprail.lua
@@ -0,0 +1,39 @@
+-- stoprail.lua
+-- adds "stop rail". Recognized by lzb. (part of behavior is implemented there)
+
+
+local adefunc = function(def, preset, suffix, rotation)
+ return {
+ after_place_node=function(pos)
+
+ end,
+ after_dig_node=function(pos)
+
+ end,
+ on_receive_fields = function(pos, formname, fields, player)
+
+ end,
+ advtrains = {
+ on_train_enter = function(pos, train_id)
+ end,
+ on_train_approach = function(pos,train_id, train, index)
+ atdebug("Train approaches stop:",pos,train_id,index)
+ --TODO conditions
+ advtrains.interlocking.lzb_add_oncoming_npr(train, index, 2)
+ end,
+ },
+ }
+end
+
+
+
+advtrains.register_tracks("default", {
+ nodename_prefix="advtrains_line_automation:dtrack_stop",
+ texture_prefix="advtrains_dtrack_stop",
+ models_prefix="advtrains_dtrack",
+ models_suffix=".b3d",
+ shared_texture="advtrains_dtrack_shared_stop.png",
+ description="Station/Stop Rail",
+ formats={},
+ get_additional_definiton = adefunc,
+}, advtrains.trackpresets.t_30deg_straightonly)
diff --git a/advtrains_line_automation/textures/advtrains_dtrack_shared_stop.png b/advtrains_line_automation/textures/advtrains_dtrack_shared_stop.png
new file mode 100644
index 0000000..b6629cf
--- /dev/null
+++ b/advtrains_line_automation/textures/advtrains_dtrack_shared_stop.png
Binary files differ
diff --git a/advtrains_line_automation/textures/advtrains_dtrack_stop_placer.png b/advtrains_line_automation/textures/advtrains_dtrack_stop_placer.png
new file mode 100644
index 0000000..0d1c769
--- /dev/null
+++ b/advtrains_line_automation/textures/advtrains_dtrack_stop_placer.png
Binary files differ