Add 'init.lua'
This commit is contained in:
parent
91622bb30c
commit
e1342d4623
1 changed files with 40 additions and 0 deletions
40
init.lua
Normal file
40
init.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
advtrains.register_tracks("default", {
|
||||||
|
nodename_prefix="advtrains_interlocking:dtrack_digiline_mesestation",
|
||||||
|
texture_prefix="advtrains_dtrack_mesestation",
|
||||||
|
models_prefix="advtrains_dtrack",
|
||||||
|
models_suffix=".b3d",
|
||||||
|
shared_texture="advtrains_dtrack_shared_mesestation.png",
|
||||||
|
second_texture="default_gravel.png",
|
||||||
|
description="Station/Stop Rail (Mesecons)",
|
||||||
|
formats={},
|
||||||
|
get_additional_definiton=function(def,preset,suffix,rotation)
|
||||||
|
return {
|
||||||
|
advtrains = {
|
||||||
|
on_train_approach=function(pos,train_id,train,index)
|
||||||
|
advtrains.lzb_add_checkpoint(train,index,minetest.get_meta(pos):get_int("speed"),nil)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mesecons={
|
||||||
|
effector={
|
||||||
|
action_on=function(pos,node)
|
||||||
|
minetest.get_meta(pos):set_int("speed",0)
|
||||||
|
minetest.after(0,advtrains.ndb.update,pos,node)
|
||||||
|
end,
|
||||||
|
action_off=function(pos,node)
|
||||||
|
minetest.get_meta(pos):set_int("speed",100)
|
||||||
|
minetest.after(0,advtrains.ndb.update,pos,node)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},advtrains.trackpresets.t_30deg_straightonly)
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output="advtrains_interlocking:dtrack_digiline_mesestation_placer",
|
||||||
|
recipe={
|
||||||
|
{"advtrains:dtrack_placer","default:mese",""},
|
||||||
|
{"","",""},
|
||||||
|
{"","",""},
|
||||||
|
},
|
||||||
|
})
|
Loading…
Reference in a new issue