develop #33

Closed
milan wants to merge 5 commits from develop into master
529 changed files with 25852 additions and 12942 deletions

View file

@ -1,4 +1,4 @@
mt_version="5.3.0"
mt_version="5.4.0"
first_install=y
ufw_enable=y
ufw_ssh_port_for_accept=22
@ -24,3 +24,6 @@ mt_protector_hurt="8"
mt_protector_flip="true"
mt_protector_pvp="false"
mt_tubelib_machine_aging_value="600"
mt_creative_mode="false"
mt_enable_damage="true"
mt_enable_pvp="true"

View file

@ -6,7 +6,7 @@ cp -r mods /home/minetest/.minetest/mods
echo "gameid = minetest" > /home/minetest/.minetest/worlds/world/world.mt
echo "backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt
echo "creative_mode = false" >> /home/minetest/.minetest/worlds/world/world.mt
echo "creative_mode = $mt_creative_mode" >> /home/minetest/.minetest/worlds/world/world.mt
echo "enable_damage = true" >> /home/minetest/.minetest/worlds/world/world.mt
echo "player_backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt
echo "auth_backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt

View file

@ -3,6 +3,7 @@ rm -rf mods
mkdir mods
cd mods
git clone --depth 1 --branch master https://github.com/Extex101/christmas.git
git clone --depth 1 --branch master https://github.com/minetest-mods/3d_armor.git
git clone --depth 1 --branch master https://github.com/minetest-mods/unified_inventory.git
git clone --depth 1 --branch master https://github.com/minetest-mods/unifiedbricks.git
@ -58,6 +59,7 @@ git clone --depth 1 --branch master https://gitlab.com/VanessaE/basic_materials.
git clone --depth 1 --branch master https://gitlab.com/VanessaE/biome_lib.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/moretrees.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/homedecor_modpack.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/home_workshop_modpack.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/signs_lib.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/currency.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/plantlife_modpack.git
@ -106,7 +108,6 @@ git clone --depth 1 --branch master https://github.com/joe7575/techpack.git
git clone --depth 1 --branch master https://github.com/random-geek/morelights.git
git clone --depth 1 --branch master https://repo.or.cz/minetest_mtg_plus.git
git clone --depth 1 --branch master https://github.com/minetest-mods/spectator_mode.git
git clone --depth 1 --branch master https://github.com/Extex101/christmas.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/gloopblocks.git
git clone --depth 1 --branch master https://github.com/minetest-mods/mylandscaping.git
git clone --depth 1 --branch master https://gitlab.com/VanessaE/minislots.git

247
mods-list
View file

@ -1,32 +1,38 @@
load_mod_interact = false
load_mod_christmas = false
load_mod_advtrains_interlocking = false
load_mod_advtrains_line_automation = false
load_mod_advtrains_luaautomation = false
load_mod_advtrains_signals_ks = false
load_mod_workbench = true
load_mod_wool = true
load_mod_wine = true
load_mod_mobs_birds = true
load_mod_plasticbox = true
load_mod_minislots_golden7s_deluxe = true
load_mod_windmill = true
load_mod_vehicle_mash = true
load_mod_unifieddyes = true
load_mod_unified_inventory = true
load_mod_tubelib2 = true
load_mod_ts_workshop = true
load_mod_mail = true
load_mod_worldedit = true
load_mod_letters = true
load_mod_lightsplus = true
load_mod_homedecor_electrical = true
load_mod_trafficlight = true
load_mod_jukebox = true
load_mod_tubelib_addons1 = true
load_mod_hot_air_balloons = true
load_mod_mylandscaping = true
load_mod_streetsmod = true
load_mod_plasmascreen = true
load_mod_mobs_npc = true
load_mod_my_future_doors = true
load_mod_itemframes = true
load_mod_homedecor_office = true
load_mod_stargate = true
load_mod_charcoal = true
load_mod_homedecor_lighting = true
load_mod_angledwalls = true
load_mod_builtin_item = true
load_mod_throwing_arrows = true
load_mod_my_saloon_doors = true
load_mod_homedecor_exterior = true
load_mod_flowerpot = true
load_mod_3d_armor_stand = true
load_mod_junglegrass = true
load_mod_mobs_crocs = true
load_mod_homedecor_electrical = true
load_mod_homedecor_doors_and_gates = true
load_mod_homedecor_common = true
load_mod_homedecor_furniture_medieval = true
@ -35,67 +41,81 @@ load_mod_homedecor_bedroom = true
load_mod_homedecor_laundry = true
load_mod_blox = true
load_mod_homedecor_3d_extras = true
load_mod_computer = true
load_mod_mymillwork = true
load_mod_claycrafter = true
load_mod_3d_armor_stand = true
load_mod_flowerpot = true
load_mod_mobs_npc = true
load_mod_my_future_doors = true
load_mod_drinks = true
load_mod_angledstairs = true
load_mod_nature_classic = true
load_mod_homedecor_clocks = true
load_mod_signs_road = true
load_mod_homedecor_cobweb = true
load_mod_christmas = true
load_mod_along_shore = true
load_mod_artdeco = true
load_mod_carts = true
load_mod_mobs_butterfly = true
load_mod_mobs_animal = true
load_mod_mobs_monster = true
load_mod_lavalamp = true
load_mod_mtg_plus = true
load_mod_homedecor_gastronomy = true
load_mod_anvils = true
load_mod_moreblocks = true
load_mod_molehills = true
load_mod_homedecor_electronics = true
load_mod_homedecor_kitchen = true
load_mod_signs_api = true
load_mod_mytrouble = true
load_mod_signs = true
load_mod_ontime_clocks = true
load_mod_mtfoods = true
load_mod_sl_controller = true
load_mod_intllib = true
load_mod_font_metro = true
load_mod_trees_lib = true
load_mod_mydiamondblock = true
load_mod_minislots_engine = true
load_mod_display_api = true
load_mod_worldedit_gui = true
load_mod_bridger = true
load_mod_intllib = true
load_mod_moretrees = true
load_mod_smartshop = true
load_mod_death_compass = true
load_mod_wieldview = true
load_mod_colorcubes = true
load_mod_fake_fire = true
load_mod_compost = true
load_mod_ts_furniture = true
load_mod_myconnect4 = true
load_mod_carts = true
load_mod_unifiedbricks = true
load_mod_mycheckers = true
load_mod_3d_armor_sfinv = true
load_mod_morelights_vintage = true
load_mod_infrastructure = true
load_mod_lpanes = true
load_mod_homedecor_trash_cans = true
load_mod_3d_armor_ui = true
load_mod_gloopblocks = true
load_mod_mobs = true
load_mod_worldedit_shortcommands = true
load_mod_worldedit_brush = true
load_mod_bbq = true
load_mod_wieldview = true
load_mod_death_compass = true
load_mod_advtrains = true
load_mod_facade = true
load_mod_inbox = true
load_mod_cloud_items = true
load_mod_flowers_plus = true
load_mod_bows = true
load_mod_3dmushrooms = true
load_mod_minislots_engine = true
load_mod_ambience = true
load_mod_lib_mount = true
load_mod_flowers_plus = true
load_mod_protector = true
load_mod_homedecor_climate_control = true
load_mod_signs_lib = true
load_mod_artdeco = true
load_mod_worldedit_brush = true
load_mod_bbq = true
load_mod_minislots_golden7s = true
load_mod_mymasonhammer = true
load_mod_worldedit_gui = true
load_mod_bridger = true
load_mod_ts_doors = true
load_mod_vines = true
load_mod_currency = true
load_mod_advtrains_assets = true
load_mod_streetshotfix = true
load_mod_carpets = true
load_mod_windmill = true
load_mod_chat2 = true
load_mod_xban2 = true
load_mod_coloredwood = true
load_mod_homedecor_misc = true
load_mod_3d_armor_ip = true
load_mod_techpack_stairway = true
load_mod_shields = true
load_mod_morelights_extras = true
load_mod_homedecor_roofing = true
load_mod_mys_n_l = true
load_mod_smartfs = true
load_mod_steles = true
load_mod_abriflame = true
load_mod_mobs_bat = true
load_mod_playeranim = true
load_mod_homedecor_seating = true
load_mod_enchanting = true
load_mod_mycanadiancheckers = true
@ -103,61 +123,75 @@ load_mod_mychess = true
load_mod_asphaltstairs = true
load_mod_manholes = true
load_mod_building_blocks = true
load_mod_homedecor_lighting = true
load_mod_angledwalls = true
load_mod_advtrains_train_track = true
load_mod_rubiks = true
load_mod_trash_can = true
load_mod_cottages = true
load_mod_3d_armor = true
load_mod_doors = true
load_mod_dryplants = true
load_mod_stoneworks = true
load_mod_bees = true
load_mod_mymasonhammer = true
load_mod_minislots_golden7s = true
load_mod_3d_armor_sfinv = true
load_mod_morelights_vintage = true
load_mod_infrastructure = true
load_mod_bakedclay = true
load_mod_ilights = true
load_mod_boards = true
load_mod_crops = true
load_mod_ts_paper = true
load_mod_more_chests = true
load_mod_concretestairs = true
load_mod_mypitfall = true
load_mod_castle = true
load_mod_currency = true
load_mod_serialize_lib = true
load_mod_mobs_birds = true
load_mod_plasticbox = true
load_mod_ambience = true
load_mod_lib_mount = true
load_mod_bees = true
load_mod_homedecor_bathroom = true
load_mod_advtrains_itrainmap = true
load_mod_my_sliding_doors = true
load_mod_homedecor_windows_and_treatments = true
load_mod_bushes = true
load_mod_lavalamp = true
load_mod_mtg_plus = true
load_mod_homedecor_gastronomy = true
load_mod_shields = true
load_mod_techpack_stairway = true
load_mod_anvils = true
load_mod_moreblocks = true
load_mod_molehills = true
load_mod_ilights = true
load_mod_bakedclay = true
load_mod_basic_signs = true
load_mod_youngtrees = true
load_mod_bonemeal = true
load_mod_chat2 = true
load_mod_homedecor_foyer = true
load_mod_mobs_fish = true
load_mod_letters = true
load_mod_abriglass = true
load_mod_minislots_golden7s_deluxe = true
load_mod_minislots_work_files = true
load_mod_mylittle_bg = true
load_mod_vines = true
load_mod_ts_doors = true
load_mod_moretrees = true
load_mod_smartshop = true
load_mod_mobs_fish = true
load_mod_homedecor_foyer = true
load_mod_colorcubes = true
load_mod_fake_fire = true
load_mod_compost = true
load_mod_concretestairs = true
load_mod_signs_api = true
load_mod_mytrouble = true
load_mod_more_chests = true
load_mod_ts_paper = true
load_mod_crops = true
load_mod_boards = true
load_mod_trees_lib = true
load_mod_mydiamondblock = true
load_mod_signs_lib = true
load_mod_homedecor_climate_control = true
load_mod_protector = true
load_mod_font_metro = true
load_mod_homedecor_kitchen = true
load_mod_homedecor_electronics = true
load_mod_signs = true
load_mod_nature_classic = true
load_mod_worldedit_shortcommands = true
load_mod_mobs = true
load_mod_mobs_monster = true
load_mod_mobs_animal = true
load_mod_mobs_butterfly = true
load_mod_mobs_crocs = true
load_mod_mobs_jellyfish = true
load_mod_mobs_sharks = true
load_mod_mobs_turtles = true
load_mod_safer_lua = true
load_mod_morelights_extras = true
load_mod_homedecor_roofing = true
load_mod_mys_n_l = true
load_mod_smartfs = true
load_mod_morelights_modern = true
load_mod_homedecor_pictures_and_paintings = true
load_mod_moreores = true
load_mod_my_game_pieces = true
load_mod_mydraughts = true
load_mod_my_saloon_doors = true
load_mod_throwing_arrows = true
load_mod_basic_materials = true
load_mod_mygomoku = true
load_mod_worldedit_commands = true
@ -170,8 +204,6 @@ load_mod_homedecor_fences = true
load_mod_mypachisi = true
load_mod_homedecor_books = true
load_mod_mypirinola = true
load_mod_unified_inventory = true
load_mod_mypitfall = true
load_mod_mys_n_l_mini = true
load_mod_labels = true
load_mod_myuno = true
@ -182,7 +214,6 @@ load_mod_my_misc_doors = true
load_mod_my_cottage_doors = true
load_mod_woodsoils = true
load_mod_lcdlib = true
load_mod_ts_workshop = true
load_mod_my_default_doors = true
load_mod_ferns = true
load_mod_my_door_wood = true
@ -192,12 +223,7 @@ load_mod_emergencyphone = true
load_mod_my_hidden_doors = true
load_mod_homedecor_wardrobe = true
load_mod_my_old_doors = true
load_mod_homedecor_bathroom = true
load_mod_my_sliding_doors = true
load_mod_homedecor_windows_and_treatments = true
load_mod_bushes = true
load_mod_mylandscaping = true
load_mod_streetsmod = true
load_mod_mymillwork = true
load_mod_mypaths = true
load_mod_mob_horse = true
load_mod_streetsawards = true
@ -216,7 +242,6 @@ load_mod_font_api = true
load_mod_poisonivy = true
load_mod_xdecor = true
load_mod_trunks = true
load_mod_playeranim = true
load_mod_playerplus = true
load_mod_prefab_redo = true
load_mod_realchess = true
@ -239,33 +264,7 @@ load_mod_smartline = true
load_mod_techpack_warehouse = true
load_mod_tubelib = true
load_mod_throwing = true
load_mod_cottages = true
load_mod_trash_can = true
load_mod_myconnect4 = true
load_mod_ts_furniture = true
load_mod_tubelib2 = true
load_mod_mycheckers = true
load_mod_unifiedbricks = true
load_mod_unifieddyes = true
load_mod_vehicle_mash = true
load_mod_rubiks = true
load_mod_lightsplus = true
load_mod_abriflame = true
load_mod_lpanes = true
load_mod_abriglass = true
load_mod_advtrains_train_track = true
load_mod_advtrains_train_subway = true
load_mod_advtrains_train_japan = true
load_mod_advtrains_train_industrial = true
load_mod_advtrains_luaautomation = true
load_mod_advtrains_interlocking = true
load_mod_advtrains = true
load_mod_advtrains_train_steam = true
load_mod_advtrains_line_automation = true
load_mod_advtrains_itrainmap = true
load_mod_assets = true
load_mod_advtrains_signals_ks = true
load_mod_claycrafter = true
load_mod_serialize_lib = true
load_mod_mobs_sky = false
load_mod_hot_air_balloons = true
load_mod_home_workshop_machines = true
load_mod_home_workshop_common = true
load_mod_computers = true
load_mod_home_workshop_misc = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -0,0 +1,7 @@
# textdomain: 3d_armor_sfinv
### init.lua ###
3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv : Mod cargado pero no activado.
Armor=Armadura

View file

@ -153,6 +153,7 @@ minetest.register_node("3d_armor_stand:armor_stand", {
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"3d_armor_stand.png"},
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
@ -221,6 +222,7 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", {
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"3d_armor_stand_locked.png"},
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,

View file

@ -2,6 +2,7 @@
local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
local has_technic = minetest.get_modpath("technic") ~= nil
local ui = unified_inventory
if not minetest.global_exists("unified_inventory") then
minetest.log("warning", S("3d_armor_ui: Mod loaded but unused."))
@ -27,17 +28,24 @@ unified_inventory.register_button("armor", {
unified_inventory.register_page("armor", {
get_formspec = function(player, perplayer_formspec)
local fy = perplayer_formspec.formspec_y
local fy = perplayer_formspec.form_header_y + 0.5
local gridx = perplayer_formspec.std_inv_x
local gridy = 0.6
local name = player:get_player_name()
if armor.def[name].init_time == 0 then
return {formspec="label[0,0;"..F(S("Armor not initialized!")).."]"}
end
local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]"..
"label[0,0;"..F(S("Armor")).."]"..
"list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"..
"image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"..
"label[5.0,"..(fy + 0.0)..";"..F(S("Level"))..": "..armor.def[name].level.."]"..
"label[5.0,"..(fy + 0.5)..";"..F(S("Heal"))..": "..armor.def[name].heal.."]"..
local formspec = perplayer_formspec.standard_inv_bg..
perplayer_formspec.standard_inv..
ui.make_inv_img_grid(gridx, gridy, 2, 3)..
string.format("label[%f,%f;%s]",
perplayer_formspec.form_header_x, perplayer_formspec.form_header_y, F(S("Armor")))..
string.format("list[detached:%s_armor;armor;%f,%f;2,3;]",
name, gridx + ui.list_img_offset, gridy + ui.list_img_offset) ..
"image[3.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"..
"label[6.0,"..(fy + 0.0)..";"..F(S("Level"))..": "..armor.def[name].level.."]"..
"label[6.0,"..(fy + 0.5)..";"..F(S("Heal"))..": "..armor.def[name].heal.."]"..
"listring[current_player;main]"..
"listring[detached:"..name.."_armor;armor]"
if armor.config.fire_protect then
@ -45,7 +53,7 @@ unified_inventory.register_page("armor", {
F(S("Fire"))..": "..armor.def[name].fire.."]"
end
if has_technic then
formspec = formspec.."label[5.0,"..(fy + 1.5)..";"..
formspec = formspec.."label[6.0,"..(fy + 1.5)..";"..
F(S("Radiation"))..": "..armor.def[name].groups["radiation"].."]"
end
return {formspec=formspec}

View file

@ -2,3 +2,4 @@ name = 3d_armor_ui
depends = 3d_armor
optional_depends = unified_inventory
description = Adds 3d_armor page to the unified inventory.
min_minetest_version = 5.4.0

View file

@ -1,4 +0,0 @@
default
serialize_lib
mesecons?
digtron?

View file

@ -66,6 +66,7 @@ Subway Passenger Wagon=U-Bahn-Waggon
The wagon's inventory is not empty!=Das Inventar dieses Waggons ist nicht leer!
This track can not be changed!=Diese Schiene kann nicht geändert werden!
This track can not be rotated!=Diese Schiene kann nicht gedreht werden!
This track can not be removed!=Diese Schiene kann nicht entfernt werden!
Position is occupied by a train.=Ein Zug steht an dieser Position.
There's a Track Circuit Break here.=Hier ist eine Gleisabschnittsgrenze (TCB).
There's a Signal Influence Point here.=Hier ist ein Signal-Beeinflussungspunkt.

View file

@ -0,0 +1,7 @@
name=advtrains
title=Advanced Trains Core
description=Core system for realistic trains in Minetest
author=orwell96
depends=serialize_lib
optional_depends=mesecons,digtron

View file

@ -9,6 +9,12 @@ local function can_dig_func(pos)
end
return true
end
local function after_dig_func(pos)
if advtrains.interlocking then
return advtrains.interlocking.signal_after_dig(pos)
end
return true
end
local function aspect(b)
return {
@ -97,6 +103,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
supported_aspects = suppasp,
},
can_dig = can_dig_func,
after_dig_node = after_dig_func,
})
advtrains.trackplacer.add_worked("advtrains:retrosignal", r, rotation, nil)
@ -163,6 +170,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
end,
},
can_dig = can_dig_func,
after_dig_node = after_dig_func,
})
advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil)
end
@ -232,6 +240,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
end,
},
can_dig = can_dig_func,
after_dig_node = after_dig_func,
})
end
end

View file

@ -442,6 +442,15 @@ Depending on the number of connections:
- conn3 <> conn4
]]
-- Notify the user if digging the rail is not allowed
local function can_dig_callback(pos, player)
local ok, reason = advtrains.can_dig_or_modify_track(pos)
if not ok and player then
minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed!") .. " " .. reason)
end
return ok
end
function advtrains.register_tracks(tracktype, def, preset)
advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault)
if preset.regtp then
@ -478,7 +487,7 @@ function advtrains.register_tracks(tracktype, def, preset)
not_blocking_trains=1,
},
can_dig = advtrains.can_dig_or_modify_track,
can_dig = can_dig_callback,
after_dig_node=function(pos)
advtrains.ndb.update(pos)
end,
@ -613,7 +622,7 @@ function advtrains.can_dig_or_modify_track(pos)
return false, attrans("There's a Track Circuit Break here.")
end
-- signal ip?
if advtrains.interlocking.db.is_ip_at(pos) then
if advtrains.interlocking.db.is_ip_at(pos, true) then -- is_ip_at with purge parameter
return false, attrans("There's a Signal Influence Point here.")
end
end

View file

@ -562,9 +562,23 @@ function ildb.set_sigd_for_signal(pos, sigd)
end
-- checks if there's any influence point set to this position
function ildb.is_ip_at(pos)
-- if purge is true, checks whether the associated signal still exists
-- and deletes the ip if not.
function ildb.is_ip_at(pos, purge)
local pts = advtrains.roundfloorpts(pos)
if influence_points[pts] then
if purge then
-- is there still a signal assigned to it?
for connid, sigpos in pairs(influence_points[pts]) do
local asp = advtrains.interlocking.signal_get_aspect(sigpos)
if not asp then
atlog("Clearing orphaned signal influence point", pts, "/", connid)
ildb.clear_ip_signal(pts, connid)
end
end
-- if there's no side left after purging, return false
if not influence_points[pts] then return false end
end
return true
end
return false

View file

@ -51,6 +51,7 @@ minetest.register_node("advtrains_interlocking:ds_danger", {
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})
minetest.register_node("advtrains_interlocking:ds_free", {
description = "Demo signal at Free",
@ -72,6 +73,7 @@ minetest.register_node("advtrains_interlocking:ds_free", {
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})
minetest.register_node("advtrains_interlocking:ds_slow", {
description = "Demo signal at Slow",
@ -93,5 +95,6 @@ minetest.register_node("advtrains_interlocking:ds_slow", {
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})

View file

@ -1,2 +0,0 @@
advtrains
advtrains_train_track?

View file

@ -0,0 +1,7 @@
name=advtrains_interlocking
title=Advanced Trains Interlocking System
description=Interlocking system for Advanced Trains
author=orwell96
depends=advtrains
optional_depends=advtrains_train_track

30
mods/advtrains/advtrains_interlocking/tcb_ts_ui.lua Normal file → Executable file
View file

@ -120,13 +120,41 @@ minetest.register_node("advtrains_interlocking:tcb_node", {
-- Crafting
-- set some fallbacks
local tcb_core = "default:mese_crystal"
local tcb_secondary = "default:mese_crystal_fragment"
--alternative recipe items
--core
if minetest.get_modpath("basic_materials") then
tcb_core = "basic_materials:ic"
elseif minetest.get_modpath("technic") then
tcb_core = "technic:control_logic_unit"
end
--print("TCB Core: "..tcb_core)
--secondary
if minetest.get_modpath("mesecons") then
tcb_secondary = 'mesecons:wire_00000000_off'
end
--print("TCB Secondary: "..tcb_secondary)
minetest.register_craft({
output = 'advtrains_interlocking:tcb_node 4',
recipe = {
{'mesecons:wire_00000000_off', 'basic_materials:ic', 'mesecons:wire_00000000_off'},
{tcb_secondary,tcb_core,tcb_secondary},
{'advtrains:dtrack_placer','','advtrains:dtrack_placer'}
},
--actually use track in the tcb recipe
replacements = {
{"advtrains:dtrack_placer","advtrains:dtrack_placer"},
{"advtrains:dtrack_placer","advtrains:dtrack_placer"},
}
})
--nil the temp crafting variables
tcb_core= nil
tcb_secondary = nil
minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
local pname = player:get_player_name()

View file

@ -1 +0,0 @@
advtrains

View file

@ -0,0 +1,6 @@
name=advtrains_itrainmap
title=Advanced Trains Interactive Train Map (currently broken)
description=Map formspec showing tracks and trains
author=orwell96
depends=advtrains

View file

@ -1,2 +0,0 @@
advtrains_interlocking
advtrains_train_track?

View file

@ -0,0 +1,7 @@
name=advtrains_line_automation
title=Advanced Trains Line Automation
description=Tools for automatic train lines
author=orwell96
depends=advtrains_interlocking
optional_depends=advtrains_train_track

View file

@ -93,6 +93,9 @@ Removes any pending interrupts of this node.
Make this active component send a digiline message on the specified channel.
Not available in init code.
- `atc_send_to_train(<train_id>, <atc_command>)`
Sends the specified ATC command to the train specified by its train id. This happens regardless of where the train is in the world, and can be used to remote-control trains. Returns true on success. If the train ID does not exist, returns false and does nothing. See [atc_command.txt](../atc_command.txt) for the ATC command syntax.
#### Interlocking Route Management Functions
If `advtrains_interlocking` is enabled, the following aditional functions can be used:
@ -230,6 +233,9 @@ In addition to the above environment functions, the following functions are avai
- `atc_set_text_inside(text)`
Set text shown to train passengers. Pass nil to show no text. `text` must be a string.
- `atc_set_text_inside(text) / atc_set_text_outside(text)`
Getters for inside/outside text, return nil when no train is there.
- `get_line()`
Returns the "Line" property of the train (a string).
This can be used to distinguish between trains of different lines and route them appropriately.

View file

@ -151,6 +151,14 @@ function r.fire_event(pos, evtdata, appr_internal)
advtrains.trains[train_id].text_inside=text
return true
end,
atc_get_text_outside = function()
if not train_id then return false end
return advtrains.trains[train_id].text_outside
end,
atc_get_text_inside = function(text)
if not train_id then return false end
return advtrains.trains[train_id].text_inside
end,
atc_set_lzb_tsr = function(speed)
if not appr_internal then
error("atc_set_lzb_tsr() can only be used during 'approach' events!")

View file

@ -1,4 +0,0 @@
advtrains
advtrains_interlocking?
advtrains_line_automation?
mesecons_switch?

View file

@ -153,6 +153,17 @@ local static_env = {
local pos=atlatc.pcnaming.resolve_pos(parpos)
atlatc.interrupt.add(0, pos, {type="ext_int", ext_int=true, message=imesg})
end,
-- sends an atc command to train regardless of where it is in the world
atc_send_to_train = function(train_id, command)
assertt(command, "string")
local train = advtrains.trains[train_id]
if train then
advtrains.atc.train_set_command(train, command, true)
return true
else
return false
end
end,
}
-- If interlocking is present, enable route setting functions

View file

@ -0,0 +1,7 @@
name=advtrains_luaautomation
title=Advanced Trains LuaATC
description=Lua control interface to Advanced Trains
author=orwell96
depends=advtrains
optional_depends=advtrains_interlocking,advtrains_line_automation,mesecons_switch

View file

@ -1,2 +0,0 @@
advtrains
advtrains_interlocking

12
mods/advtrains/advtrains_signals_ks/init.lua Normal file → Executable file
View file

@ -115,6 +115,7 @@ for _, rtab in ipairs({
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})
-- rotatable by trackworker
advtrains.trackplacer.add_worked("advtrains_signals_ks:hs", typ, "_"..rot, prts.n)
@ -160,6 +161,7 @@ for _, rtab in ipairs({
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})
-- rotatable by trackworker
advtrains.trackplacer.add_worked("advtrains_signals_ks:ra", typ, "_"..rot, prts.n)
@ -210,6 +212,7 @@ for _, rtab in ipairs({
},
on_rightclick = advtrains.interlocking.signal_rc_handler,
can_dig = advtrains.interlocking.signal_can_dig,
after_dig_node = advtrains.interlocking.signal_after_dig,
})
-- rotatable by trackworker
advtrains.trackplacer.add_worked("advtrains_signals_ks:sign", typ, "_"..rot, prts.n)
@ -270,11 +273,18 @@ minetest.register_craft({
},
})
local sign_material = "default:sign_wall_steel" --fallback
if minetest.get_modpath("basic_materials") then
sign_material = "basic_materials:plastic_sheet"
end
--print("Sign Material: "..sign_material)
minetest.register_craft({
output = "advtrains_signals_ks:sign_8_0 2",
recipe = {
{'basic_materials:plastic_sheet', 'dye:black'},
{sign_material, 'dye:black'},
{'default:stick', ''},
{'default:stick', ''},
},
})
sign_material = nil

View file

@ -0,0 +1,6 @@
name=advtrains_signals_ks
title=Advtrains Interlocking Signal Set - German 'Ks' signals
description=Default signal set for the Advanced Trains Interlocking system
author=orwell96
depends=advtrains_interlocking

View file

@ -1,3 +0,0 @@
advtrains
advtrains_train_track
intllib?

View file

@ -1,149 +0,0 @@
local S = attrans
advtrains.register_wagon("engine_industrial", {
mesh="advtrains_engine_industrial.b3d",
textures = {"advtrains_engine_industrial.png"},
drives_on={default=true},
max_speed=20,
seats = {
{
name=S("Driver Stand (right)"),
attach_offset={x=5, y=-3, z=-8},
view_offset={x=5.2, y=-4, z=0},
driving_ctrl_access=true,
group = "dstand",
},
{
name=S("Driver Stand (left)"),
attach_offset={x=5, y=7, z=-8},
view_offset={x=-5.2, y=-4, z=0},
driving_ctrl_access=true,
group = "dstand",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
access_to = {},
driving_ctrl_access = true,
},
},
assign_to_seat_group = {"dstand"},
visual_size = {x=1, y=1},
wagon_span=2.6,
is_locomotive=true,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
horn_sound = "advtrains_industrial_horn",
}, S("Industrial Train Engine"), "advtrains_engine_industrial_inv.png")
--big--
advtrains.register_wagon("engine_industrial_big", {
mesh="advtrains_engine_industrial_big.b3d",
textures = {"advtrains_engine_industrial_big.png"},
drives_on={default=true},
max_speed=30,
seats = {
{
name=S("Driver Stand (right)"),
attach_offset={x=5, y=7, z=20},
view_offset={x=5.2, y=-4, z=11},
driving_ctrl_access=true,
group = "dstand",
},
{
name=S("Driver Stand (left)"),
attach_offset={x=5, y=-3, z=-8},
view_offset={x=-5.2, y=-4, z=0},
driving_ctrl_access=true,
group = "dstand",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
access_to = {},
driving_ctrl_access = true,
},
},
assign_to_seat_group = {"dstand"},
visual_size = {x=1, y=1},
wagon_span=4,
is_locomotive=true,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
horn_sound = "advtrains_industrial_horn",
}, S("Big Industrial Train Engine"), "advtrains_engine_industrial_inv.png")
advtrains.register_wagon("wagon_tank", {
mesh="advtrains_wagon_tank.b3d",
textures = {"advtrains_wagon_tank.png"},
seats = {},
drives_on={default=true},
max_speed=20,
visual_size = {x=1, y=1},
wagon_span=2.2,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
has_inventory = true,
get_inventory_formspec = advtrains.standard_inventory_formspec,
inventory_list_sizes = {
box=8*3,
},
}, S("Industrial tank wagon"), "advtrains_wagon_tank_inv.png")
advtrains.register_wagon("wagon_wood", {
mesh="advtrains_wagon_wood.b3d",
textures = {"advtrains_wagon_wood.png"},
seats = {},
drives_on={default=true},
max_speed=20,
visual_size = {x=1, y=1},
wagon_span=1.8,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
has_inventory = true,
get_inventory_formspec = advtrains.standard_inventory_formspec,
inventory_list_sizes = {
box=8*3,
},
}, S("Industrial wood wagon"), "advtrains_wagon_wood_inv.png")
-- Craftings
minetest.register_craft({
output = 'advtrains:engine_industrial',
recipe = {
{'default:steelblock', 'default:steelblock', 'default:steelblock'},
{'advtrains:driver_cab', 'default:steelblock', 'default:steelblock'},
{'advtrains:wheel', '', 'advtrains:wheel'},
},
})
--Engine Industrial Big
minetest.register_craft({
output = 'advtrains:engine_industrial_big',
recipe = {
{'default:glass', 'default:steelblock', 'default:steelblock'},
{'advtrains:driver_cab', 'default:steelblock', 'default:steelblock'},
{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
},
})
--Industrial tank wagon
minetest.register_craft({
output = 'advtrains:wagon_tank',
recipe = {
{'default:steelblock', 'default:steel_ingot', 'default:steelblock'},
{'advtrains:steelblock', '', 'default:steelblock'},
{'advtrains:wheel', 'default:steelblock', 'advtrains:wheel'},
},
})
--Industrial wood wagon
minetest.register_craft({
output = 'advtrains:wagon_wood',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'advtrains:steelblock', 'default:steelblock', 'default:steelblock'},
{'advtrains:wheel', '', 'advtrains:wheel'},
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

View file

@ -1,3 +0,0 @@
advtrains
advtrains_train_track
intllib?

View file

@ -1,162 +0,0 @@
local S = attrans
advtrains.register_wagon("engine_japan", {
mesh="advtrains_engine_japan.b3d",
textures = {"advtrains_engine_japan.png"},
drives_on={default=true},
max_speed=20,
seats = {
{
name=S("Driver stand"),
attach_offset={x=0, y=-2, z=13},
view_offset={x=0, y=0, z=0},
group="dstand",
},
{
name="1",
attach_offset={x=-4, y=-2, z=0},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="2",
attach_offset={x=4, y=-2, z=0},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="3",
attach_offset={x=-4, y=-2, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="4",
attach_offset={x=4, y=-2, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
access_to = {"pass"},
require_doors_open=true,
driving_ctrl_access=true,
},
pass={
name = "Passenger area",
access_to = {"dstand"},
require_doors_open=true,
},
},
assign_to_seat_group = {"dstand", "pass"},
doors={
open={
[-1]={frames={x=0, y=20}, time=1},
[1]={frames={x=40, y=60}, time=1}
},
close={
[-1]={frames={x=20, y=40}, time=1},
[1]={frames={x=60, y=80}, time=1}
}
},
door_entry={-1.7},
visual_size = {x=1, y=1},
wagon_span=2.5,
is_locomotive=true,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
horn_sound = "advtrains_japan_horn",
}, S("Japanese Train Engine"), "advtrains_engine_japan_inv.png")
advtrains.register_wagon("wagon_japan", {
mesh="advtrains_wagon_japan.b3d",
textures = {"advtrains_wagon_japan.png"},
drives_on={default=true},
max_speed=20,
seats = {
{
name="1",
attach_offset={x=-4, y=-2, z=8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="2",
attach_offset={x=4, y=-2, z=8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="1a",
attach_offset={x=-4, y=-2, z=0},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="2a",
attach_offset={x=4, y=-2, z=0},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="3",
attach_offset={x=-4, y=-2, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="4",
attach_offset={x=4, y=8, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
},
seat_groups = {
pass={
name = "Passenger area",
access_to = {},
require_doors_open=true,
},
},
assign_to_seat_group = {"pass"},
doors={
open={
[-1]={frames={x=0, y=20}, time=1},
[1]={frames={x=40, y=60}, time=1}
},
close={
[-1]={frames={x=20, y=40}, time=1},
[1]={frames={x=60, y=80}, time=1}
}
},
door_entry={-1.7, 1.7},
visual_size = {x=1, y=1},
wagon_span=2.3,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 4"},
}, S("Japanese Train Wagon"), "advtrains_wagon_japan_inv.png")
-- Crafting
minetest.register_craft({
output = 'advtrains:engine_japan',
recipe = {
{'default:steelblock', 'default:steelblock', ''},
{'xpanes:pane_flat', 'default:steelblock', 'xpanes:pane_flat'},
{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
},
})
minetest.register_craft({
output = 'advtrains:wagon_japan',
recipe = {
{'default:steelblock', 'default:steelblock', 'default:steelblock'},
{'xpanes:pane_flat', 'default:steelblock', 'xpanes:pane_flat'},
{'advtrains:wheel', '', 'advtrains:wheel'},
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

View file

@ -1,3 +0,0 @@
advtrains
advtrains_train_track
intllib?

View file

@ -1,253 +0,0 @@
local S = attrans
-- length of the steam engine loop sound
local SND_LOOP_LEN = 5
advtrains.register_wagon("newlocomotive", {
mesh="advtrains_engine_steam.b3d",
textures = {"advtrains_engine_steam.png"},
is_locomotive=true,
drives_on={default=true},
max_speed=10,
seats = {
{
name=S("Driver Stand (left)"),
attach_offset={x=-5, y=0, z=-10},
view_offset={x=0, y=6, z=0},
group = "dstand",
},
{
name=S("Driver Stand (right)"),
attach_offset={x=5, y=0, z=-10},
view_offset={x=0, y=6, z=0},
group = "dstand",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
driving_ctrl_access=true,
access_to = {},
},
},
assign_to_seat_group = {"dstand"},
visual_size = {x=1, y=1},
wagon_span=2.3,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
custom_on_velocity_change=function(self, velocity)
if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then
self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true)
self.old_anim_velocity=advtrains.abs_ceil(velocity)
end
end,
custom_on_activate = function(self, staticdata_table, dtime_s)
minetest.add_particlespawner({
amount = 10,
time = 0,
-- ^ If time is 0 has infinite lifespan and spawns the amount on a per-second base
minpos = {x=0, y=2, z=1.2},
maxpos = {x=0, y=2, z=1.2},
minvel = {x=-0.2, y=1.8, z=-0.2},
maxvel = {x=0.2, y=2, z=0.2},
minacc = {x=0, y=-0.1, z=0},
maxacc = {x=0, y=-0.3, z=0},
minexptime = 2,
maxexptime = 4,
minsize = 1,
maxsize = 5,
-- ^ The particle's properties are random values in between the bounds:
-- ^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
-- ^ minsize/maxsize, minexptime/maxexptime (expirationtime)
collisiondetection = true,
-- ^ collisiondetection: if true uses collision detection
vertical = false,
-- ^ vertical: if true faces player using y axis only
texture = "smoke_puff.png",
-- ^ Uses texture (string)
attached = self.object,
})
end,
drops={"default:steelblock 1"},
horn_sound = "advtrains_steam_whistle",
}, S("Steam Engine"), "advtrains_engine_steam_inv.png")
advtrains.register_wagon("detailed_steam_engine", {
mesh="advtrains_detailed_steam_engine.b3d",
textures = {"advtrains_detailed_steam_engine.png"},
is_locomotive=true,
drives_on={default=true},
max_speed=10,
seats = {
{
name=S("Driver Stand (left)"),
attach_offset={x=-5, y=10, z=-10},
view_offset={x=9, y=-2, z=-6},
group = "dstand",
},
{
name=S("Driver Stand (right)"),
attach_offset={x=5, y=10, z=-10},
view_offset={x=0, y=6, z=0},
group = "dstand",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
driving_ctrl_access=true,
access_to = {},
},
},
assign_to_seat_group = {"dstand"},
visual_size = {x=1, y=1},
wagon_span=2.05,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
custom_on_velocity_change=function(self, velocity)
if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then
self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true)
self.old_anim_velocity=advtrains.abs_ceil(velocity)
end
end,
custom_on_step=function(self, dtime)
if self:train().velocity > 0 then -- First make sure that the train isn't standing
if not self.sound_loop_tmr or self.sound_loop_tmr <= 0 then
-- start the sound if it was never started or has expired
self.sound_loop_handle = minetest.sound_play({name="advtrains_steam_loop", gain=2}, {object=self.object})
self.sound_loop_tmr = SND_LOOP_LEN
end
--decrease the sound timer
self.sound_loop_tmr = self.sound_loop_tmr - dtime
else
-- If the train is standing, the sound will be stopped in some time. We do not need to interfere with it.
self.sound_loop_tmr = nil
end
end,
custom_on_activate = function(self, staticdata_table, dtime_s)
minetest.add_particlespawner({
amount = 10,
time = 0,
-- ^ If time is 0 has infinite lifespan and spawns the amount on a per-second base
minpos = {x=0, y=2.3, z=1.45},
maxpos = {x=0, y=2.3, z=1.4},
minvel = {x=-0.2, y=1.8, z=-0.2},
maxvel = {x=0.2, y=2, z=0.2},
minacc = {x=0, y=-0.1, z=0},
maxacc = {x=0, y=-0.3, z=0},
minexptime = 2,
maxexptime = 4,
minsize = 1,
maxsize = 5,
-- ^ The particle's properties are random values in between the bounds:
-- ^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
-- ^ minsize/maxsize, minexptime/maxexptime (expirationtime)
collisiondetection = true,
-- ^ collisiondetection: if true uses collision detection
vertical = false,
-- ^ vertical: if true faces player using y axis only
texture = "smoke_puff.png",
-- ^ Uses texture (string)
attached = self.object,
})
end,
drops={"default:steelblock 1"},
horn_sound = "advtrains_steam_whistle",
}, S("Detailed Steam Engine"), "advtrains_detailed_engine_steam_inv.png")
advtrains.register_wagon("wagon_default", {
mesh="advtrains_passenger_wagon.b3d",
textures = {"advtrains_wagon.png"},
drives_on={default=true},
max_speed=10,
seats = {
{
name="1",
attach_offset={x=2, y=6, z=8},
view_offset={x=0, y=-4, z=0},
group="pass",
},
{
name="2",
attach_offset={x=-1, y=6, z=8},
view_offset={x=0, y=-4, z=0},
group="pass",
},
{
name="3",
attach_offset={x=-4, y=8, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="4",
attach_offset={x=4, y=8, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
},
seat_groups = {
pass={
name = "Passenger area",
access_to = {},
},
},
assign_to_seat_group = {"pass"},
visual_size = {x=1, y=1},
wagon_span=2.634,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 1"},
}, S("Passenger Wagon"), "advtrains_wagon_inv.png")
advtrains.register_wagon("wagon_box", {
mesh="advtrains_wagon_box.b3d",
textures = {"advtrains_wagon_box.png"},
drives_on={default=true},
max_speed=10,
seats = {},
visual_size = {x=1, y=1},
wagon_span=2,
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
drops={"default:steelblock 1"},
has_inventory = true,
get_inventory_formspec = advtrains.standard_inventory_formspec,
inventory_list_sizes = {
box=8*3,
},
}, S("Box Wagon"), "advtrains_wagon_box_inv.png")
minetest.register_craft({
output = 'advtrains:newlocomotive',
recipe = {
{'', '', 'advtrains:chimney'},
{'advtrains:driver_cab', 'dye:black', 'advtrains:boiler'},
{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
},
})
minetest.register_craft({
output = 'advtrains:detailed_steam_engine',
recipe = {
{'', '', 'advtrains:chimney'},
{'advtrains:driver_cab', 'dye:green', 'advtrains:boiler'},
{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
},
})
minetest.register_craft({
output = 'advtrains:wagon_default',
recipe = {
{'default:steelblock', 'default:steelblock', 'default:steelblock'},
{'default:glass', 'dye:dark_green', 'default:glass'},
{'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'},
},
})
minetest.register_craft({
output = 'advtrains:wagon_box',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'default:chest', 'group:wood'},
{'advtrains:wheel', '', 'advtrains:wheel'},
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

View file

@ -1,3 +0,0 @@
advtrains
advtrains_train_track
intllib?

View file

@ -1,152 +0,0 @@
local S = attrans
advtrains.register_wagon("subway_wagon", {
mesh="advtrains_subway_wagon.b3d",
textures = {"advtrains_subway_wagon.png"},
drives_on={default=true},
max_speed=15,
seats = {
{
name="Driver stand",
attach_offset={x=0, y=0, z=0},
view_offset={x=0, y=0, z=0},
group="dstand",
},
{
name="1",
attach_offset={x=-4, y=-2, z=8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="2",
attach_offset={x=4, y=-2, z=8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="3",
attach_offset={x=-4, y=-2, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
{
name="4",
attach_offset={x=4, y=-2, z=-8},
view_offset={x=0, y=0, z=0},
group="pass",
},
},
seat_groups = {
dstand={
name = "Driver Stand",
access_to = {"pass"},
require_doors_open=true,
driving_ctrl_access=true,
},
pass={
name = "Passenger area",
access_to = {"dstand"},
require_doors_open=true,
},
},
assign_to_seat_group = {"pass", "dstand"},
doors={
open={
[-1]={frames={x=0, y=20}, time=1},
[1]={frames={x=40, y=60}, time=1},
sound = "advtrains_subway_dopen",
},
close={
[-1]={frames={x=20, y=40}, time=1},
[1]={frames={x=60, y=80}, time=1},
sound = "advtrains_subway_dclose",
}
},
door_entry={-1, 1},
visual_size = {x=1, y=1},
wagon_span=2,
--collisionbox = {-1.0,-0.5,-1.8, 1.0,2.5,1.8},
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
is_locomotive=true,
drops={"default:steelblock 4"},
horn_sound = "advtrains_subway_horn",
custom_on_velocity_change = function(self, velocity, old_velocity, dtime)
if not velocity or not old_velocity then return end
if old_velocity == 0 and velocity > 0 then
minetest.sound_play("advtrains_subway_depart", {object = self.object})
end
if velocity < 2 and (old_velocity >= 2 or old_velocity == velocity) and not self.sound_arrive_handle then
self.sound_arrive_handle = minetest.sound_play("advtrains_subway_arrive", {object = self.object})
elseif (velocity > old_velocity) and self.sound_arrive_handle then
minetest.sound_stop(self.sound_arrive_handle)
self.sound_arrive_handle = nil
end
if velocity > 0 and (self.sound_loop_tmr or 0)<=0 then
self.sound_loop_handle = minetest.sound_play({name="advtrains_subway_loop", gain=0.3}, {object = self.object})
self.sound_loop_tmr=3
elseif velocity>0 then
self.sound_loop_tmr = self.sound_loop_tmr - dtime
elseif velocity==0 then
if self.sound_loop_handle then
minetest.sound_stop(self.sound_loop_handle)
self.sound_loop_handle = nil
end
self.sound_loop_tmr=0
end
end,
custom_on_step = function(self, dtime, data, train)
--set line number
local line = nil
if train.line and self.line_cache ~= train.line then
self.line_cache=train.line
local lint = train.line
if string.sub(train.line, 1, 1) == "S" then
lint = string.sub(train.line,2)
end
if string.len(lint) == 1 then
if lint=="X" then line="X" end
line = tonumber(lint)
elseif string.len(lint) == 2 then
if tonumber(lint) then
line = lint
end
end
if line then
local new_line_tex="advtrains_subway_wagon.png"
if type(line)=="number" or line == "X" then
new_line_tex = new_line_tex.."^advtrains_subway_wagon_line"..line..".png"
else
local num = tonumber(line)
local red = math.fmod(line*67+101, 255)
local green = math.fmod(line*97+109, 255)
local blue = math.fmod(line*73+127, 255)
new_line_tex = new_line_tex..string.format("^(advtrains_subway_wagon_line.png^[colorize:#%X%X%X%X%X%X)^(advtrains_subway_wagon_line%s_.png^advtrains_subway_wagon_line_%s.png", math.floor(red/16), math.fmod(red,16), math.floor(green/16), math.fmod(green,16), math.floor(blue/16), math.fmod(blue,16), string.sub(line, 1, 1), string.sub(line, 2, 2))
if red + green + blue > 512 then
new_line_tex = new_line_tex .. "^[colorize:#000)"
else
new_line_tex = new_line_tex .. ")"
end
end
self.object:set_properties({
textures={new_line_tex},
})
elseif self.line_cache~=nil and line==nil then
self.object:set_properties({
textures=self.textures,
})
self.line_cache=nil
end
end
end,
}, S("Subway Passenger Wagon"), "advtrains_subway_wagon_inv.png")
--wagons
minetest.register_craft({
output = 'advtrains:subway_wagon',
recipe = {
{'default:steelblock', 'default:steelblock', 'default:steelblock'},
{'default:steelblock', 'dye:yellow', 'default:steelblock'},
{'default:steelblock', 'default:steelblock', 'default:steelblock'},
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Some files were not shown because too many files have changed in this diff Show more