diff options
author | orwell96 <orwell@bleipb.de> | 2018-11-29 17:52:56 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-11-29 17:52:56 +0100 |
commit | ec68eaa22975305af3e184bc3c946a253b5504eb (patch) | |
tree | baf865eec03c343eacba73282d4fdbf377d26568 /advtrains_line_automation/stoprail.lua | |
parent | 01ffee4d58316c74c90a36b491770ee358fd3f98 (diff) |
Added on_train_approach callback, non-permanent external LZB brakepoints and basis for "stop rails"
Stop rails ATM use the aforementioned things to add a pointwise "2" speed restriction. Seems to work.
Diffstat (limited to 'advtrains_line_automation/stoprail.lua')
-rw-r--r-- | advtrains_line_automation/stoprail.lua | 39 |
1 files changed, 39 insertions, 0 deletions
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) |