Shunt signals (not exactly Ks), along with fixes in other components that those rely on
This commit is contained in:
parent
e37f4f9188
commit
c3c5431412
@ -293,7 +293,7 @@ advtrains.avt_save = function(remove_players_from_wagons)
|
||||
"trainparts", "recently_collided_with_env",
|
||||
"atc_brake_target", "atc_wait_finish", "atc_command", "atc_delay", "door_open",
|
||||
"text_outside", "text_inside", "line",
|
||||
"il_sections", "speed_restriction",
|
||||
"il_sections", "speed_restriction", "is_shunt",
|
||||
})
|
||||
--then save it
|
||||
tmp_trains[id]=v
|
||||
|
@ -18,6 +18,7 @@ return {
|
||||
},
|
||||
shunt = {
|
||||
free = false,
|
||||
proceed_as_main = true
|
||||
},
|
||||
dst = {
|
||||
free = true,
|
||||
|
@ -197,13 +197,14 @@ function advtrains.hud_train_format(train, flip)
|
||||
secondLine="ATC"..b..": "..tvels..ad..(train.atc_command or "")
|
||||
else
|
||||
secondLine = "Manual operation"
|
||||
end
|
||||
if train.ctrl.lzb then
|
||||
secondLine = "-!- Safety override -!-"
|
||||
end
|
||||
end
|
||||
local shtind = train.is_shunt and "S" or ">"
|
||||
|
||||
topLine=" ["..mletter[fct].."] {"..levers.."} "..doorstr[(train.door_open or 0) * fct].." "..(train.line and "L: "..train.line or "")
|
||||
firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", res-vel).."|"..string.rep("_", max-res).."> "..vel_kmh.." km/h"
|
||||
firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", res-vel).."|"..string.rep("_", max-res)..shtind.." "..vel_kmh.." km/h"
|
||||
if train.speed_restriction == 0 then
|
||||
firstLine = "OVERRUN RED SIGNAL! Examine situation and reverse train to move again."
|
||||
end
|
||||
|
@ -1036,9 +1036,15 @@ function advtrains.invert_train(train_id)
|
||||
end
|
||||
advtrains.update_trainpart_properties(train_id, true)
|
||||
|
||||
-- TODO: this should actually be SHUNT_MAX_SPEED, but signals and lzb is not present everywhere
|
||||
-- If interlocking present, check whether this train is in a section and then set as shunt move after reversion
|
||||
if advtrains.interlocking and train.il_sections and #train.il_sections > 0 then
|
||||
train.is_shunt = true
|
||||
train.speed_restriction = advtrains.SHUNT_SPEED_MAX
|
||||
else
|
||||
train.is_shunt = false
|
||||
train.speed_restriction = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- returns: train id, index of one of the trains that stand at this position.
|
||||
function advtrains.get_train_at_pos(pos)
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
advtrains.interlocking = {}
|
||||
|
||||
advtrains.SHUNT_SPEED_MAX = 6
|
||||
|
||||
function advtrains.interlocking.sigd_equal(sigd, cmp)
|
||||
return vector.equals(sigd.p, cmp.p) and sigd.s==cmp.s
|
||||
end
|
||||
|
@ -51,7 +51,7 @@ local ZONE_ROLL = 2
|
||||
local ZONE_HOLD = 5 -- added on top of ZONE_ROLL
|
||||
local ZONE_VSLOW = 3 -- When speed is <2, still allow accelerating
|
||||
|
||||
local SHUNT_SPEED_MAX = 4
|
||||
local SHUNT_SPEED_MAX = advtrains.SHUNT_SPEED_MAX
|
||||
|
||||
local function look_ahead(id, train)
|
||||
|
||||
|
@ -174,6 +174,8 @@ advtrains.te_register_on_create(function(id, train)
|
||||
else
|
||||
atwarn("ILDB corruption: TCB",origin," has invalid TS reference")
|
||||
end
|
||||
-- Make train a shunt move
|
||||
train.is_shunt = true
|
||||
elseif ts_id==nil then
|
||||
atwarn("Train",id,": Unable to determine whether to block a track section!")
|
||||
else
|
||||
|
@ -46,20 +46,55 @@ local suppasp = {
|
||||
}
|
||||
}
|
||||
|
||||
--Rangiersignal
|
||||
local setaspectf_ra = function(rot)
|
||||
return function(pos, node, asp)
|
||||
if asp.shunt.free then
|
||||
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:ra_shuntd_"..rot, param2 = node.param2})
|
||||
else
|
||||
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:ra_danger_"..rot, param2 = node.param2})
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta then
|
||||
meta:set_string("infotext", minetest.serialize(asp))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local suppasp_ra = {
|
||||
main = {
|
||||
free = true,
|
||||
},
|
||||
dst = {
|
||||
free = nil,
|
||||
speed = nil,
|
||||
},
|
||||
shunt = {
|
||||
free = nil,
|
||||
proceed_as_main = false,
|
||||
},
|
||||
info = {
|
||||
call_on = false,
|
||||
dead_end = false,
|
||||
w_speed = nil,
|
||||
}
|
||||
}
|
||||
|
||||
advtrains.trackplacer.register_tracktype("advtrains_signals_ks:hs")
|
||||
advtrains.trackplacer.register_tracktype("advtrains_signals_ks:ra")
|
||||
advtrains.trackplacer.register_tracktype("advtrains_signals_ks:mast")
|
||||
|
||||
for _, rtab in ipairs({
|
||||
{rot = "0", sbox = {-1/8, -1/2, -1/2, 1/8, 1, -1/4}, ici=true},
|
||||
{rot = "30", sbox = {-3/8, -1/2, -1/2, -1/8, 1, -1/4},},
|
||||
{rot = "45", sbox = {-1/2, -1/2, -1/2, -1/4, 1, -1/4},},
|
||||
{rot = "60", sbox = {-1/2, -1/2, -3/8, -1/4, 1, -1/8},},
|
||||
{rot = "0", sbox = {-1/8, -1/2, -1/2, 1/8, 1/2, -1/4}, ici=true},
|
||||
{rot = "30", sbox = {-3/8, -1/2, -1/2, -1/8, 1/2, -1/4},},
|
||||
{rot = "45", sbox = {-1/2, -1/2, -1/2, -1/4, 1/2, -1/4},},
|
||||
{rot = "60", sbox = {-1/2, -1/2, -3/8, -1/4, 1/2, -1/8},},
|
||||
}) do
|
||||
local rot = rtab.rot
|
||||
for typ, prts in pairs({
|
||||
danger = {asp = advtrains.interlocking.DANGER, n = "slow", ici=true},
|
||||
slow = {asp = { main = { free = true, speed = 6 }} , n = "free"},
|
||||
free = {asp = { main = { free = true, speed = -1 }} , n = "shunt"},
|
||||
slow = {asp = { main = { free = true, speed = 6 }, shunt = {proceed_as_main = true}} , n = "free"},
|
||||
free = {asp = { main = { free = true, speed = -1 }, shunt = {proceed_as_main = true}} , n = "shunt"},
|
||||
shunt = {asp = { main = {free = false}, shunt = {free = true} } , n = "danger"},
|
||||
}) do
|
||||
minetest.register_node("advtrains_signals_ks:hs_"..typ.."_"..rot, {
|
||||
@ -80,6 +115,7 @@ for _, rtab in ipairs({
|
||||
groups = {
|
||||
cracky = 2,
|
||||
advtrains_signal = 2,
|
||||
not_blocking_trains = 1,
|
||||
save_in_at_nodedb = 1,
|
||||
not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1,
|
||||
},
|
||||
@ -100,8 +136,50 @@ for _, rtab in ipairs({
|
||||
advtrains.trackplacer.add_worked("advtrains_signals_ks:hs", typ, "_"..rot, prts.n)
|
||||
end
|
||||
|
||||
-- set new sbox clip height
|
||||
rtab.sbox[5] = 1/2
|
||||
|
||||
--Rangiersignale:
|
||||
for typ, prts in pairs({
|
||||
danger = {asp = { main = {free = true}, shunt = {free = false} }, n = "shuntd", ici=true},
|
||||
shuntd = {asp = { main = {free = true}, shunt = {free = true} } , n = "danger"},
|
||||
}) do
|
||||
minetest.register_node("advtrains_signals_ks:ra_"..typ.."_"..rot, {
|
||||
description = "Ks Shunting Signal",
|
||||
drawtype = "mesh",
|
||||
mesh = "advtrains_signals_ks_sht_smr"..rot..".obj",
|
||||
tiles = {"advtrains_signals_ks_mast.png", "advtrains_signals_ks_head.png", "advtrains_signals_ks_head.png", "advtrains_signals_ks_ltm_"..typ..".png"},
|
||||
|
||||
paramtype="light",
|
||||
sunlight_propagates=true,
|
||||
light_source = 4,
|
||||
|
||||
paramtype2 = "facedir",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4}
|
||||
},
|
||||
groups = {
|
||||
cracky = 2,
|
||||
advtrains_signal = 2,
|
||||
not_blocking_trains = 1,
|
||||
save_in_at_nodedb = 1,
|
||||
not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1,
|
||||
},
|
||||
drop = "advtrains_signals_ks:ra_danger_0",
|
||||
inventory_image = "advtrains_signals_ks_ra_inv.png",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
advtrains = {
|
||||
set_aspect = setaspectf_ra(rot),
|
||||
supported_aspects = suppasp_ra,
|
||||
get_aspect = function(pos, node)
|
||||
return prts.asp
|
||||
end,
|
||||
},
|
||||
on_rightclick = advtrains.interlocking.signal_rc_handler,
|
||||
can_dig = advtrains.interlocking.signal_can_dig,
|
||||
})
|
||||
-- rotatable by trackworker
|
||||
advtrains.trackplacer.add_worked("advtrains_signals_ks:ra", typ, "_"..rot, prts.n)
|
||||
end
|
||||
|
||||
minetest.register_node("advtrains_signals_ks:mast_mast_"..rot, {
|
||||
description = "Ks Mast",
|
||||
@ -120,6 +198,7 @@ for _, rtab in ipairs({
|
||||
},
|
||||
groups = {
|
||||
cracky = 2,
|
||||
not_blocking_trains = 1,
|
||||
not_in_creative_inventory = (rtab.ici) and 0 or 1,
|
||||
},
|
||||
drop = "advtrains_signals_ks:mast_mast_0",
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2942
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr0.obj
Normal file
2942
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr0.obj
Normal file
File diff suppressed because it is too large
Load Diff
2940
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr30.obj
Normal file
2940
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2933
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr45.obj
Normal file
2933
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr45.obj
Normal file
File diff suppressed because it is too large
Load Diff
2950
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr60.obj
Normal file
2950
advtrains_signals_ks/models/advtrains_signals_ks_sht_smr60.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 239 B |
BIN
advtrains_signals_ks/textures/advtrains_signals_ks_ra_inv.png
Normal file
BIN
advtrains_signals_ks/textures/advtrains_signals_ks_ra_inv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 252 B |
42
assets/blender/ks/advtrains_signals_ks_main_smr0.mtl
Normal file
42
assets/blender/ks/advtrains_signals_ks_main_smr0.mtl
Normal file
@ -0,0 +1,42 @@
|
||||
# Blender MTL File: 'signal_ks_singlemesh_final.blend'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl Lampenrahmen
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.000000 0.285166
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Lights
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.290269 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Mast
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.000000 0.640000 0.218487
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Schirm
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.287072 0.215762 0.144660
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
42
assets/blender/ks/advtrains_signals_ks_main_smr30.mtl
Normal file
42
assets/blender/ks/advtrains_signals_ks_main_smr30.mtl
Normal file
@ -0,0 +1,42 @@
|
||||
# Blender MTL File: 'signal_ks_singlemesh_final.blend'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl Lampenrahmen
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.000000 0.285166
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Lights
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.290269 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Mast
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.000000 0.640000 0.218487
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Schirm
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.287072 0.215762 0.144660
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
42
assets/blender/ks/advtrains_signals_ks_main_smr45.mtl
Normal file
42
assets/blender/ks/advtrains_signals_ks_main_smr45.mtl
Normal file
@ -0,0 +1,42 @@
|
||||
# Blender MTL File: 'signal_ks_singlemesh_final.blend'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl Lampenrahmen
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.000000 0.285166
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Lights
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.290269 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Mast
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.000000 0.640000 0.218487
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Schirm
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.287072 0.215762 0.144660
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
42
assets/blender/ks/advtrains_signals_ks_main_smr60.mtl
Normal file
42
assets/blender/ks/advtrains_signals_ks_main_smr60.mtl
Normal file
@ -0,0 +1,42 @@
|
||||
# Blender MTL File: 'signal_ks_singlemesh_final.blend'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl Lampenrahmen
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.000000 0.285166
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Lights
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.290269 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Mast
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.000000 0.640000 0.218487
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Schirm
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.287072 0.215762 0.144660
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
BIN
assets/blender/ks/signal_ks_singlemesh_shuntsig.blend
Normal file
BIN
assets/blender/ks/signal_ks_singlemesh_shuntsig.blend
Normal file
Binary file not shown.
BIN
assets/blender/ks/signal_ks_singlemesh_shuntsig.blend1
Normal file
BIN
assets/blender/ks/signal_ks_singlemesh_shuntsig.blend1
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user