Add 3-way turnouts and y-turnouts (both diverging)
This commit is contained in:
parent
7879a0a215
commit
1d224d6b4c
@ -98,6 +98,61 @@ advtrains.ap.t_30deg_flat={
|
||||
},
|
||||
rotation={"", "_30", "_45", "_60"},
|
||||
}
|
||||
advtrains.ap.t_yturnout={
|
||||
regstep=1,
|
||||
variant={
|
||||
l={
|
||||
conns = conns3(0,7,9),
|
||||
desc = "Y-turnout (left)",
|
||||
switchalt = "r",
|
||||
switchmc = "off",
|
||||
switchst = "l",
|
||||
},
|
||||
r={
|
||||
conns = conns3(0,9,7),
|
||||
desc = "Y-turnout (right)",
|
||||
switchalt = "l",
|
||||
switchmc = "on",
|
||||
switchst = "r",
|
||||
}
|
||||
},
|
||||
regtp=true,
|
||||
tpdefault="l",
|
||||
rotation={"", "_30", "_45", "_60"},
|
||||
}
|
||||
advtrains.ap.t_s3way={
|
||||
regstep=1,
|
||||
variant={
|
||||
l={
|
||||
--conns = conns6(0,7,0,8,0,9),
|
||||
conns = conns3(0,7,8),
|
||||
desc = "3-way turnout (left)",
|
||||
switchalt = "s",
|
||||
--switchalt2 = ,
|
||||
--switchmc = "off",
|
||||
switchst="l",
|
||||
},
|
||||
s={
|
||||
--conns = conns6(0,8,0,7,0,9),
|
||||
conns = conns3(0,8,7),
|
||||
desc = "3-way turnout (straight)",
|
||||
switchalt ="r",
|
||||
--switchmc = "on",
|
||||
switchst = "s",
|
||||
},
|
||||
r={
|
||||
--conns = conns6(0,9,0,8,0,7),
|
||||
conns = conns3(0,9,8),
|
||||
desc = "3-way turnout (right)",
|
||||
switchalt = "l",
|
||||
switchst="r"
|
||||
--switchmc = "off",
|
||||
}
|
||||
},
|
||||
regtp=true,
|
||||
tpdefault="l",
|
||||
rotation={"", "_30", "_45", "_60"},
|
||||
}
|
||||
advtrains.ap.t_30deg_slope={
|
||||
regstep=1,
|
||||
variant={
|
||||
@ -450,10 +505,11 @@ function advtrains.register_tracks(tracktype, def, preset)
|
||||
|
||||
if var.switchalt and var.switchst then
|
||||
local switchfunc=function(pos, node, newstate)
|
||||
newstate = newstate or var.switchalt -- support for 3 (or more) state switches
|
||||
-- this code is only called from the internal setstate function, which
|
||||
-- ensures that it is safe to switch the turnout
|
||||
if newstate~=var.switchst then
|
||||
advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..var.switchalt..rotation, param2=node.param2})
|
||||
advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..newstate..rotation, param2=node.param2})
|
||||
advtrains.invalidate_all_paths(pos)
|
||||
end
|
||||
end
|
||||
|
@ -21,6 +21,43 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
-- y-turnout
|
||||
advtrains.register_tracks("default", {
|
||||
nodename_prefix="advtrains:dtrack_sy",
|
||||
texture_prefix="advtrains_dtrack_sy",
|
||||
models_prefix="advtrains_dtrack_sy",
|
||||
models_suffix=".obj",
|
||||
shared_texture="advtrains_dtrack_shared.png",
|
||||
description=attrans("Y-turnout"),
|
||||
formats = {},
|
||||
}, advtrains.ap.t_yturnout)
|
||||
minetest.register_craft({
|
||||
output = 'advtrains:dtrack_sy_placer 2',
|
||||
recipe = {
|
||||
{'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'},
|
||||
{'', 'advtrains:dtrack_placer', ''},
|
||||
{'', 'advtrains:dtrack_placer', ''},
|
||||
},
|
||||
})
|
||||
--3-way turnout
|
||||
advtrains.register_tracks("default", {
|
||||
nodename_prefix="advtrains:dtrack_s3",
|
||||
texture_prefix="advtrains_dtrack_s3",
|
||||
models_prefix="advtrains_dtrack_s3",
|
||||
models_suffix=".obj",
|
||||
shared_texture="advtrains_dtrack_shared.png",
|
||||
description=attrans("3-way turnout"),
|
||||
formats = {},
|
||||
}, advtrains.ap.t_s3way)
|
||||
minetest.register_craft({
|
||||
output = 'advtrains:dtrack_s3_placer 1',
|
||||
recipe = {
|
||||
{'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'},
|
||||
{'', 'advtrains:dtrack_placer', ''},
|
||||
{'', '', ''},
|
||||
},
|
||||
})
|
||||
|
||||
-- Diamond Crossings
|
||||
-- perpendicular
|
||||
advtrains.register_tracks("default", {
|
||||
|
2335
advtrains_train_track/models/advtrains_dtrack_s3_l.obj
Normal file
2335
advtrains_train_track/models/advtrains_dtrack_s3_l.obj
Normal file
File diff suppressed because it is too large
Load Diff
1882
advtrains_train_track/models/advtrains_dtrack_s3_l_30.obj
Normal file
1882
advtrains_train_track/models/advtrains_dtrack_s3_l_30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2710
advtrains_train_track/models/advtrains_dtrack_s3_l_45.obj
Normal file
2710
advtrains_train_track/models/advtrains_dtrack_s3_l_45.obj
Normal file
File diff suppressed because it is too large
Load Diff
1888
advtrains_train_track/models/advtrains_dtrack_s3_l_60.obj
Normal file
1888
advtrains_train_track/models/advtrains_dtrack_s3_l_60.obj
Normal file
File diff suppressed because it is too large
Load Diff
2335
advtrains_train_track/models/advtrains_dtrack_s3_r.obj
Normal file
2335
advtrains_train_track/models/advtrains_dtrack_s3_r.obj
Normal file
File diff suppressed because it is too large
Load Diff
1889
advtrains_train_track/models/advtrains_dtrack_s3_r_30.obj
Normal file
1889
advtrains_train_track/models/advtrains_dtrack_s3_r_30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2710
advtrains_train_track/models/advtrains_dtrack_s3_r_45.obj
Normal file
2710
advtrains_train_track/models/advtrains_dtrack_s3_r_45.obj
Normal file
File diff suppressed because it is too large
Load Diff
1882
advtrains_train_track/models/advtrains_dtrack_s3_r_60.obj
Normal file
1882
advtrains_train_track/models/advtrains_dtrack_s3_r_60.obj
Normal file
File diff suppressed because it is too large
Load Diff
2339
advtrains_train_track/models/advtrains_dtrack_s3_s.obj
Normal file
2339
advtrains_train_track/models/advtrains_dtrack_s3_s.obj
Normal file
File diff suppressed because it is too large
Load Diff
1888
advtrains_train_track/models/advtrains_dtrack_s3_s_30.obj
Normal file
1888
advtrains_train_track/models/advtrains_dtrack_s3_s_30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2707
advtrains_train_track/models/advtrains_dtrack_s3_s_45.obj
Normal file
2707
advtrains_train_track/models/advtrains_dtrack_s3_s_45.obj
Normal file
File diff suppressed because it is too large
Load Diff
1888
advtrains_train_track/models/advtrains_dtrack_s3_s_60.obj
Normal file
1888
advtrains_train_track/models/advtrains_dtrack_s3_s_60.obj
Normal file
File diff suppressed because it is too large
Load Diff
1936
advtrains_train_track/models/advtrains_dtrack_sy_l.obj
Normal file
1936
advtrains_train_track/models/advtrains_dtrack_sy_l.obj
Normal file
File diff suppressed because it is too large
Load Diff
1414
advtrains_train_track/models/advtrains_dtrack_sy_l_30.obj
Normal file
1414
advtrains_train_track/models/advtrains_dtrack_sy_l_30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2033
advtrains_train_track/models/advtrains_dtrack_sy_l_45.obj
Normal file
2033
advtrains_train_track/models/advtrains_dtrack_sy_l_45.obj
Normal file
File diff suppressed because it is too large
Load Diff
1390
advtrains_train_track/models/advtrains_dtrack_sy_l_60.obj
Normal file
1390
advtrains_train_track/models/advtrains_dtrack_sy_l_60.obj
Normal file
File diff suppressed because it is too large
Load Diff
1929
advtrains_train_track/models/advtrains_dtrack_sy_r.obj
Normal file
1929
advtrains_train_track/models/advtrains_dtrack_sy_r.obj
Normal file
File diff suppressed because it is too large
Load Diff
1402
advtrains_train_track/models/advtrains_dtrack_sy_r_30.obj
Normal file
1402
advtrains_train_track/models/advtrains_dtrack_sy_r_30.obj
Normal file
File diff suppressed because it is too large
Load Diff
2037
advtrains_train_track/models/advtrains_dtrack_sy_r_45.obj
Normal file
2037
advtrains_train_track/models/advtrains_dtrack_sy_r_45.obj
Normal file
File diff suppressed because it is too large
Load Diff
1402
advtrains_train_track/models/advtrains_dtrack_sy_r_60.obj
Normal file
1402
advtrains_train_track/models/advtrains_dtrack_sy_r_60.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
advtrains_train_track/textures/advtrains_dtrack_s3_placer.png
Normal file
BIN
advtrains_train_track/textures/advtrains_dtrack_s3_placer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 619 B |
BIN
advtrains_train_track/textures/advtrains_dtrack_sy_placer.png
Normal file
BIN
advtrains_train_track/textures/advtrains_dtrack_sy_placer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 625 B |
Loading…
x
Reference in New Issue
Block a user