From 2d0b51b8970abb16c166708988e46fe4df668d47 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 4 Jan 2017 19:10:03 +0100 Subject: Restructure mod directory --- Makefile | 5 - advtrains.zip | Bin 1488724 -> 0 bytes advtrains/Makefile | 5 + advtrains/advtrains.zip | Bin 0 -> 1488724 bytes advtrains/advtrains/api_doc.txt | 114 +++ advtrains/advtrains/atc.lua | 294 +++++++ advtrains/advtrains/atc_command.txt | 68 ++ advtrains/advtrains/couple.lua | 156 ++++ advtrains/advtrains/crafting.lua | 71 ++ advtrains/advtrains/damage.lua | 26 + advtrains/advtrains/debugitems.lua | 36 + advtrains/advtrains/depends.txt | 2 + advtrains/advtrains/description.txt | 8 + advtrains/advtrains/helpers.lua | 248 ++++++ advtrains/advtrains/init.lua | 40 + advtrains/advtrains/misc_nodes.lua | 67 ++ .../models/advtrains_dtrack_bumper_st.b3d | Bin 0 -> 32927 bytes .../models/advtrains_dtrack_bumper_st_30.b3d | Bin 0 -> 48546 bytes .../models/advtrains_dtrack_bumper_st_45.b3d | Bin 0 -> 32926 bytes .../models/advtrains_dtrack_bumper_st_60.b3d | Bin 0 -> 48546 bytes advtrains/advtrains/models/advtrains_dtrack_cr.b3d | Bin 0 -> 27540 bytes .../advtrains/models/advtrains_dtrack_cr_30.b3d | Bin 0 -> 27543 bytes .../advtrains/models/advtrains_dtrack_cr_45.b3d | Bin 0 -> 23037 bytes .../advtrains/models/advtrains_dtrack_cr_60.b3d | Bin 0 -> 23037 bytes .../models/advtrains_dtrack_detector_st.b3d | Bin 0 -> 17157 bytes .../models/advtrains_dtrack_detector_st_30.b3d | Bin 0 -> 32779 bytes .../models/advtrains_dtrack_detector_st_45.b3d | Bin 0 -> 17163 bytes .../models/advtrains_dtrack_detector_st_60.b3d | Bin 0 -> 32779 bytes advtrains/advtrains/models/advtrains_dtrack_st.b3d | Bin 0 -> 15828 bytes .../advtrains/models/advtrains_dtrack_st_30.b3d | Bin 0 -> 31447 bytes .../advtrains/models/advtrains_dtrack_st_45.b3d | Bin 0 -> 15831 bytes .../advtrains/models/advtrains_dtrack_st_60.b3d | Bin 0 -> 31447 bytes .../advtrains/models/advtrains_dtrack_swlcr.b3d | Bin 0 -> 36743 bytes .../advtrains/models/advtrains_dtrack_swlcr_30.b3d | Bin 0 -> 45922 bytes .../advtrains/models/advtrains_dtrack_swlcr_45.b3d | Bin 0 -> 32112 bytes .../advtrains/models/advtrains_dtrack_swlcr_60.b3d | Bin 0 -> 44864 bytes .../advtrains/models/advtrains_dtrack_swlst.b3d | Bin 0 -> 36743 bytes .../advtrains/models/advtrains_dtrack_swlst_30.b3d | Bin 0 -> 45922 bytes .../advtrains/models/advtrains_dtrack_swlst_45.b3d | Bin 0 -> 32112 bytes .../advtrains/models/advtrains_dtrack_swlst_60.b3d | Bin 0 -> 44864 bytes .../advtrains/models/advtrains_dtrack_swrcr.b3d | Bin 0 -> 36743 bytes .../advtrains/models/advtrains_dtrack_swrcr_30.b3d | Bin 0 -> 44864 bytes .../advtrains/models/advtrains_dtrack_swrcr_45.b3d | Bin 0 -> 32112 bytes .../advtrains/models/advtrains_dtrack_swrcr_60.b3d | Bin 0 -> 45922 bytes .../advtrains/models/advtrains_dtrack_swrst.b3d | Bin 0 -> 36743 bytes .../advtrains/models/advtrains_dtrack_swrst_30.b3d | Bin 0 -> 44864 bytes .../advtrains/models/advtrains_dtrack_swrst_45.b3d | Bin 0 -> 32112 bytes .../advtrains/models/advtrains_dtrack_swrst_60.b3d | Bin 0 -> 45922 bytes .../advtrains/models/advtrains_dtrack_vst1.b3d | Bin 0 -> 21495 bytes .../advtrains/models/advtrains_dtrack_vst1_45.b3d | Bin 0 -> 20739 bytes .../advtrains/models/advtrains_dtrack_vst2.b3d | Bin 0 -> 25143 bytes .../advtrains/models/advtrains_dtrack_vst2_45.b3d | Bin 0 -> 20919 bytes .../advtrains/models/advtrains_dtrack_vst31.b3d | Bin 0 -> 19051 bytes .../advtrains/models/advtrains_dtrack_vst32.b3d | Bin 0 -> 21635 bytes .../advtrains/models/advtrains_dtrack_vst33.b3d | Bin 0 -> 28795 bytes .../advtrains/models/advtrains_modernwagon.b3d | Bin 0 -> 172028 bytes .../advtrains/models/advtrains_retrosignal_off.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_off_30.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_off_45.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_off_60.b3d | Bin 0 -> 13093 bytes .../advtrains/models/advtrains_retrosignal_on.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_on_30.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_on_45.b3d | Bin 0 -> 13093 bytes .../models/advtrains_retrosignal_on_60.b3d | Bin 0 -> 13093 bytes advtrains/advtrains/models/advtrains_signal.b3d | Bin 0 -> 61544 bytes advtrains/advtrains/models/advtrains_signal_30.b3d | Bin 0 -> 61544 bytes advtrains/advtrains/models/advtrains_signal_45.b3d | Bin 0 -> 61544 bytes advtrains/advtrains/models/advtrains_signal_60.b3d | Bin 0 -> 61544 bytes advtrains/advtrains/models/advtrains_track_cr.b3d | Bin 0 -> 8023 bytes advtrains/advtrains/models/advtrains_track_st.b3d | Bin 0 -> 15831 bytes .../advtrains/models/advtrains_track_st_45.b3d | Bin 0 -> 8935 bytes advtrains/advtrains/models/trackplane.b3d | Bin 0 -> 262 bytes advtrains/advtrains/pseudoload.lua | 182 +++++ advtrains/advtrains/readme.txt | 23 + advtrains/advtrains/signals.lua | 76 ++ advtrains/advtrains/textures/advtrains_couple.png | Bin 0 -> 265 bytes .../advtrains/textures/advtrains_discouple.png | Bin 0 -> 307 bytes .../textures/advtrains_dtrack_atc_placer.png | Bin 0 -> 1259 bytes .../textures/advtrains_dtrack_bumper_placer.png | Bin 0 -> 2213 bytes .../textures/advtrains_dtrack_detector_placer.png | Bin 0 -> 1253 bytes .../advtrains/textures/advtrains_dtrack_placer.png | Bin 0 -> 1097 bytes .../advtrains/textures/advtrains_dtrack_rail.png | Bin 0 -> 2814 bytes .../textures/advtrains_dtrack_rail_atc.png | Bin 0 -> 2837 bytes .../textures/advtrains_dtrack_rail_detector_on.png | Bin 0 -> 2818 bytes .../textures/advtrains_dtrack_slopeplacer.png | Bin 0 -> 2415 bytes .../advtrains/textures/advtrains_platform.png | Bin 0 -> 193 bytes .../advtrains/textures/advtrains_retrosignal.png | Bin 0 -> 8496 bytes .../textures/advtrains_retrosignal_inv.png | Bin 0 -> 2242 bytes .../advtrains/textures/advtrains_signal_inv.png | Bin 0 -> 856 bytes .../advtrains/textures/advtrains_signal_off.png | Bin 0 -> 5882 bytes .../advtrains/textures/advtrains_signal_on.png | Bin 0 -> 5884 bytes .../advtrains/textures/advtrains_track_cr.png | Bin 0 -> 33370 bytes .../advtrains/textures/advtrains_track_cr_45.png | Bin 0 -> 33938 bytes .../advtrains/textures/advtrains_track_placer.png | Bin 0 -> 32349 bytes .../advtrains/textures/advtrains_track_st.png | Bin 0 -> 20405 bytes .../advtrains/textures/advtrains_track_st_45.png | Bin 0 -> 39977 bytes .../advtrains/textures/advtrains_track_swlcr.png | Bin 0 -> 33378 bytes .../textures/advtrains_track_swlcr_45.png | Bin 0 -> 45772 bytes .../advtrains/textures/advtrains_track_swlst.png | Bin 0 -> 32321 bytes .../textures/advtrains_track_swlst_45.png | Bin 0 -> 46408 bytes .../advtrains/textures/advtrains_track_swrcr.png | Bin 0 -> 33670 bytes .../textures/advtrains_track_swrcr_45.png | Bin 0 -> 46865 bytes .../advtrains/textures/advtrains_track_swrst.png | Bin 0 -> 32654 bytes .../textures/advtrains_track_swrst_45.png | Bin 0 -> 47636 bytes .../advtrains/textures/advtrains_trackworker.png | Bin 0 -> 328 bytes advtrains/advtrains/textures/drwho_screwdriver.png | Bin 0 -> 328 bytes advtrains/advtrains/trackplacer.lua | 297 +++++++ advtrains/advtrains/tracks.lua | 721 +++++++++++++++++ advtrains/advtrains/trainhud.lua | 109 +++ advtrains/advtrains/trainlogic.lua | 875 +++++++++++++++++++++ advtrains/advtrains/wagons.lua | 573 ++++++++++++++ advtrains/advtrains_train_industrial/depends.txt | 1 + advtrains/advtrains_train_industrial/init.lua | 67 ++ .../models/advtrains_engine_industrial.b3d | Bin 0 -> 143659 bytes .../models/advtrains_wagon_tank.b3d | Bin 0 -> 223975 bytes .../models/advtrains_wagon_wood.b3d | Bin 0 -> 193975 bytes .../textures/advtrains_engine_industrial.png | Bin 0 -> 59019 bytes .../textures/advtrains_engine_industrial_inv.png | Bin 0 -> 381 bytes .../textures/advtrains_wagon_tank.png | Bin 0 -> 8975 bytes .../textures/advtrains_wagon_tank_inv.png | Bin 0 -> 408 bytes .../textures/advtrains_wagon_wood.png | Bin 0 -> 5974 bytes .../textures/advtrains_wagon_wood_inv.png | Bin 0 -> 316 bytes advtrains/advtrains_train_japan/depends.txt | 1 + advtrains/advtrains_train_japan/init.lua | 38 + .../models/advtrains_engine_japan.b3d | Bin 0 -> 165287 bytes .../models/advtrains_wagon_japan.b3d | Bin 0 -> 171991 bytes .../textures/advtrains_engine_japan.png | Bin 0 -> 12664 bytes .../textures/advtrains_engine_japan_inv.png | Bin 0 -> 434 bytes .../textures/advtrains_wagon_japan.png | Bin 0 -> 11175 bytes .../textures/advtrains_wagon_japan_inv.png | Bin 0 -> 400 bytes advtrains/advtrains_train_steam/depends.txt | 1 + advtrains/advtrains_train_steam/init.lua | 121 +++ .../models/advtrains_engine_steam.b3d | Bin 0 -> 298687 bytes .../models/advtrains_wagon.b3d | Bin 0 -> 107352 bytes .../textures/advtrains_newlocomotive.png | Bin 0 -> 31800 bytes .../textures/advtrains_newlocomotive_inv.png | Bin 0 -> 469 bytes .../textures/advtrains_wagon.png | Bin 0 -> 35724 bytes .../textures/advtrains_wagon_box.png | Bin 0 -> 22503 bytes .../textures/advtrains_wagon_box_inv.png | Bin 0 -> 347 bytes .../textures/advtrains_wagon_inv.png | Bin 0 -> 709 bytes advtrains/advtrains_train_subway/depends.txt | 1 + advtrains/advtrains_train_subway/init.lua | 30 + .../models/advtrains_subway_train.b3d | Bin 0 -> 95856 bytes .../textures/advtrains_subway_train.png | Bin 0 -> 12002 bytes .../textures/advtrains_subway_train_inv.png | Bin 0 -> 900 bytes advtrains/api_doc.txt | 114 --- advtrains/atc.lua | 294 ------- advtrains/atc_command.txt | 68 -- advtrains/couple.lua | 156 ---- advtrains/crafting.lua | 71 -- advtrains/damage.lua | 26 - advtrains/debugitems.lua | 36 - advtrains/depends.txt | 2 - advtrains/description.txt | 8 - advtrains/helpers.lua | 248 ------ advtrains/init.lua | 40 - advtrains/license.txt | 142 ++++ advtrains/license_media.txt | 63 ++ advtrains/manual.pdf | Bin 0 -> 1037362 bytes advtrains/misc_nodes.lua | 67 -- advtrains/models/advtrains_dtrack_bumper_st.b3d | Bin 32927 -> 0 bytes advtrains/models/advtrains_dtrack_bumper_st_30.b3d | Bin 48546 -> 0 bytes advtrains/models/advtrains_dtrack_bumper_st_45.b3d | Bin 32926 -> 0 bytes advtrains/models/advtrains_dtrack_bumper_st_60.b3d | Bin 48546 -> 0 bytes advtrains/models/advtrains_dtrack_cr.b3d | Bin 27540 -> 0 bytes advtrains/models/advtrains_dtrack_cr_30.b3d | Bin 27543 -> 0 bytes advtrains/models/advtrains_dtrack_cr_45.b3d | Bin 23037 -> 0 bytes advtrains/models/advtrains_dtrack_cr_60.b3d | Bin 23037 -> 0 bytes advtrains/models/advtrains_dtrack_detector_st.b3d | Bin 17157 -> 0 bytes .../models/advtrains_dtrack_detector_st_30.b3d | Bin 32779 -> 0 bytes .../models/advtrains_dtrack_detector_st_45.b3d | Bin 17163 -> 0 bytes .../models/advtrains_dtrack_detector_st_60.b3d | Bin 32779 -> 0 bytes advtrains/models/advtrains_dtrack_st.b3d | Bin 15828 -> 0 bytes advtrains/models/advtrains_dtrack_st_30.b3d | Bin 31447 -> 0 bytes advtrains/models/advtrains_dtrack_st_45.b3d | Bin 15831 -> 0 bytes advtrains/models/advtrains_dtrack_st_60.b3d | Bin 31447 -> 0 bytes advtrains/models/advtrains_dtrack_swlcr.b3d | Bin 36743 -> 0 bytes advtrains/models/advtrains_dtrack_swlcr_30.b3d | Bin 45922 -> 0 bytes advtrains/models/advtrains_dtrack_swlcr_45.b3d | Bin 32112 -> 0 bytes advtrains/models/advtrains_dtrack_swlcr_60.b3d | Bin 44864 -> 0 bytes advtrains/models/advtrains_dtrack_swlst.b3d | Bin 36743 -> 0 bytes advtrains/models/advtrains_dtrack_swlst_30.b3d | Bin 45922 -> 0 bytes advtrains/models/advtrains_dtrack_swlst_45.b3d | Bin 32112 -> 0 bytes advtrains/models/advtrains_dtrack_swlst_60.b3d | Bin 44864 -> 0 bytes advtrains/models/advtrains_dtrack_swrcr.b3d | Bin 36743 -> 0 bytes advtrains/models/advtrains_dtrack_swrcr_30.b3d | Bin 44864 -> 0 bytes advtrains/models/advtrains_dtrack_swrcr_45.b3d | Bin 32112 -> 0 bytes advtrains/models/advtrains_dtrack_swrcr_60.b3d | Bin 45922 -> 0 bytes advtrains/models/advtrains_dtrack_swrst.b3d | Bin 36743 -> 0 bytes advtrains/models/advtrains_dtrack_swrst_30.b3d | Bin 44864 -> 0 bytes advtrains/models/advtrains_dtrack_swrst_45.b3d | Bin 32112 -> 0 bytes advtrains/models/advtrains_dtrack_swrst_60.b3d | Bin 45922 -> 0 bytes advtrains/models/advtrains_dtrack_vst1.b3d | Bin 21495 -> 0 bytes advtrains/models/advtrains_dtrack_vst1_45.b3d | Bin 20739 -> 0 bytes advtrains/models/advtrains_dtrack_vst2.b3d | Bin 25143 -> 0 bytes advtrains/models/advtrains_dtrack_vst2_45.b3d | Bin 20919 -> 0 bytes advtrains/models/advtrains_dtrack_vst31.b3d | Bin 19051 -> 0 bytes advtrains/models/advtrains_dtrack_vst32.b3d | Bin 21635 -> 0 bytes advtrains/models/advtrains_dtrack_vst33.b3d | Bin 28795 -> 0 bytes advtrains/models/advtrains_modernwagon.b3d | Bin 172028 -> 0 bytes advtrains/models/advtrains_retrosignal_off.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_off_30.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_off_45.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_off_60.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_on.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_on_30.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_on_45.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_retrosignal_on_60.b3d | Bin 13093 -> 0 bytes advtrains/models/advtrains_signal.b3d | Bin 61544 -> 0 bytes advtrains/models/advtrains_signal_30.b3d | Bin 61544 -> 0 bytes advtrains/models/advtrains_signal_45.b3d | Bin 61544 -> 0 bytes advtrains/models/advtrains_signal_60.b3d | Bin 61544 -> 0 bytes advtrains/models/advtrains_track_cr.b3d | Bin 8023 -> 0 bytes advtrains/models/advtrains_track_st.b3d | Bin 15831 -> 0 bytes advtrains/models/advtrains_track_st_45.b3d | Bin 8935 -> 0 bytes .../models/blender/engine-with-animation.blend | Bin 599504 -> 0 bytes advtrains/models/blender/gleis/detectorpart.png | Bin 857 -> 0 bytes .../models/blender/gleis/infos/Grafik_weiche.png | Bin 361700 -> 0 bytes advtrains/models/blender/gleis/infos/breite | 1 - advtrains/models/blender/gleis/licence.txt~ | 0 advtrains/models/blender/gleis/rail_my.blend | Bin 654772 -> 0 bytes advtrains/models/blender/gleis/rail_my.blend1 | Bin 674164 -> 0 bytes advtrains/models/blender/gleis/rail_my_rt.blend | Bin 847060 -> 0 bytes advtrains/models/blender/gleis/rail_my_rt.blend1 | Bin 767780 -> 0 bytes .../models/blender/gleis/rail_my_rt_final.blend | Bin 1015668 -> 0 bytes .../models/blender/gleis/rail_my_rt_final.blend1 | Bin 1106004 -> 0 bytes .../models/blender/gleis/rail_my_rt_switches.blend | Bin 2184236 -> 0 bytes .../blender/gleis/rail_my_rt_switches.blend1 | Bin 1945588 -> 0 bytes .../blender/gleis/rail_my_rt_switches2.blend | Bin 2139340 -> 0 bytes .../blender/gleis/rail_my_rt_switches2.blend1 | Bin 2172972 -> 0 bytes advtrains/models/blender/gleis/rail_together.blend | Bin 1016920 -> 0 bytes advtrains/models/blender/gleis/rail_together.png | Bin 233544 -> 0 bytes advtrains/models/blender/gleis/rail_together2.png | Bin 312891 -> 0 bytes advtrains/models/blender/gleis/rail_together3.png | Bin 309398 -> 0 bytes .../models/blender/gleis/rail_verticals.blend | Bin 550748 -> 0 bytes .../models/blender/gleis/rail_verticals.blend1 | Bin 574100 -> 0 bytes .../models/blender/gleis/rail_verticals3.blend | Bin 591800 -> 0 bytes .../models/blender/gleis/rail_verticals3.blend1 | Bin 554196 -> 0 bytes .../models/blender/gleis/rail_verticals45.blend | Bin 547788 -> 0 bytes .../models/blender/gleis/rail_verticals45.blend1 | Bin 547300 -> 0 bytes .../models/blender/gleis/rail_verticals45.blend11 | Bin 547300 -> 0 bytes advtrains/models/blender/gleis/texturen/rail.png | Bin 2616 -> 0 bytes advtrains/models/blender/gleis/texturen/uv.png | Bin 2343 -> 0 bytes .../models/blender/industrial/industry_loc.blend | Bin 652640 -> 0 bytes .../models/blender/industrial/industry_loc.blend1 | Bin 652640 -> 0 bytes .../models/blender/industrial/industry_loc.blend11 | Bin 659096 -> 0 bytes .../blender/industrial/industry_oil_ wagong.blend | Bin 693488 -> 0 bytes .../blender/industrial/industry_oil_ wagong.blend1 | Bin 693488 -> 0 bytes .../blender/industrial/industry_tree_wagong.blend | Bin 640056 -> 0 bytes .../blender/industrial/industry_tree_wagong.blend1 | Bin 640056 -> 0 bytes .../blender/industrial/industry_tree_wagong.png | Bin 316 -> 0 bytes advtrains/models/blender/locomotive.blend | Bin 459600 -> 0 bytes advtrains/models/blender/magnet_track.blend | Bin 516836 -> 0 bytes .../models/blender/mbb/advtrains_wagon_japan.xcf | Bin 814467 -> 0 bytes .../blender/mbb/modern_japanlocomotive.blend | Bin 715116 -> 0 bytes .../blender/mbb/modern_japanlocomotive.blend1 | Bin 715116 -> 0 bytes .../models/blender/mbb/modern_japanlocomotive.png | Bin 204978 -> 0 bytes .../models/blender/mbb/modern_japanlocomotive.xcf | Bin 957175 -> 0 bytes .../models/blender/mbb/modern_locomotive.blend | Bin 732124 -> 0 bytes advtrains/models/blender/mbb/modern_wagong.blend | Bin 471140 -> 0 bytes advtrains/models/blender/mbb/modern_wagong.blend1 | Bin 518316 -> 0 bytes .../models/blender/mbb/modern_wagong_uv.blend | Bin 571364 -> 0 bytes .../models/blender/mbb/modern_wagong_uv.blend1 | Bin 575708 -> 0 bytes advtrains/models/blender/mbb/modern_wagong_uv.png | Bin 189564 -> 0 bytes advtrains/models/blender/mbb/prellbock.blend | Bin 745176 -> 0 bytes advtrains/models/blender/mbb/prellbock.blend1 | Bin 485416 -> 0 bytes advtrains/models/blender/mbb/prellbock.uv.png | Bin 4034 -> 0 bytes .../models/blender/mbb/regio-lokomotive.blend | Bin 704160 -> 0 bytes advtrains/models/blender/mbb/regio-waron.blend | Bin 545620 -> 0 bytes advtrains/models/blender/mbb/retrosignal.blend | Bin 488920 -> 0 bytes advtrains/models/blender/mbb/retrosignal.blend1 | Bin 507800 -> 0 bytes advtrains/models/blender/mbb/signal(2)_hoch.blend | Bin 472092 -> 0 bytes advtrains/models/blender/mbb/signal(2)_unten.blend | Bin 472092 -> 0 bytes advtrains/models/blender/mbb/signal.blend | Bin 570336 -> 0 bytes advtrains/models/blender/mbb/signal.blend1 | Bin 570336 -> 0 bytes advtrains/models/blender/mbb/signal.png | Bin 244314 -> 0 bytes advtrains/models/blender/mbb/signal.xcf | Bin 881142 -> 0 bytes advtrains/models/blender/mbb/signal2.png | Bin 39924 -> 0 bytes advtrains/models/blender/mbb/tr-logo.png | Bin 197 -> 0 bytes advtrains/models/blender/mbb/weichenhebel1.blend | Bin 493028 -> 0 bytes advtrains/models/blender/mbb/weichenhebel2.blend | Bin 492996 -> 0 bytes advtrains/models/blender/newlocomotive.blend | Bin 603376 -> 0 bytes advtrains/models/blender/newlocomotive.blend1 | Bin 603376 -> 0 bytes advtrains/models/blender/newlocomotive_uvs.png | Bin 175030 -> 0 bytes advtrains/models/blender/newwagon.blend | Bin 542188 -> 0 bytes advtrains/models/blender/newwagon.blend1 | Bin 550292 -> 0 bytes advtrains/models/blender/newwagon.png | Bin 108762 -> 0 bytes advtrains/models/blender/subway-train.blend | Bin 536268 -> 0 bytes advtrains/models/blender/subway-train.blend1 | Bin 538188 -> 0 bytes advtrains/models/blender/subway-train.png | Bin 96773 -> 0 bytes advtrains/models/blender/subway-train.xcf | Bin 92558 -> 0 bytes advtrains/models/blender/trackplane.blend | Bin 462200 -> 0 bytes advtrains/models/blender/trackvertical1.blend | Bin 453656 -> 0 bytes advtrains/models/blender/trackvertical1.blend1 | Bin 453344 -> 0 bytes advtrains/models/blender/trackvertical1.png | Bin 59146 -> 0 bytes advtrains/models/blender/trackvertical2.blend | Bin 459216 -> 0 bytes advtrains/models/blender/trackvertical2.png | Bin 66755 -> 0 bytes advtrains/models/oldmodels/locomotive.b3d | Bin 181112 -> 0 bytes advtrains/models/oldmodels/trackvertical1.b3d | Bin 629 -> 0 bytes advtrains/models/oldmodels/trackvertical2.b3d | Bin 869 -> 0 bytes advtrains/models/trackplane.b3d | Bin 262 -> 0 bytes advtrains/modpack.txt | 0 advtrains/pseudoload.lua | 182 ----- advtrains/readme.txt | 23 - advtrains/screenshot.png | Bin 0 -> 445014 bytes advtrains/signals.lua | 76 -- advtrains/textures/advtrains_couple.png | Bin 265 -> 0 bytes advtrains/textures/advtrains_discouple.png | Bin 307 -> 0 bytes advtrains/textures/advtrains_dtrack_atc_placer.png | Bin 1259 -> 0 bytes .../textures/advtrains_dtrack_bumper_placer.png | Bin 2213 -> 0 bytes .../textures/advtrains_dtrack_detector_placer.png | Bin 1253 -> 0 bytes advtrains/textures/advtrains_dtrack_placer.png | Bin 1097 -> 0 bytes advtrains/textures/advtrains_dtrack_rail.png | Bin 2814 -> 0 bytes advtrains/textures/advtrains_dtrack_rail_atc.png | Bin 2837 -> 0 bytes .../textures/advtrains_dtrack_rail_detector_on.png | Bin 2818 -> 0 bytes .../textures/advtrains_dtrack_slopeplacer.png | Bin 2415 -> 0 bytes advtrains/textures/advtrains_newlocomotive.xcf | Bin 7462378 -> 0 bytes advtrains/textures/advtrains_platform.png | Bin 193 -> 0 bytes advtrains/textures/advtrains_retrosignal.png | Bin 8496 -> 0 bytes advtrains/textures/advtrains_retrosignal_inv.png | Bin 2242 -> 0 bytes advtrains/textures/advtrains_signal_inv.png | Bin 856 -> 0 bytes advtrains/textures/advtrains_signal_off.png | Bin 5882 -> 0 bytes advtrains/textures/advtrains_signal_on.png | Bin 5884 -> 0 bytes advtrains/textures/advtrains_track_cr.png | Bin 33370 -> 0 bytes advtrains/textures/advtrains_track_cr_45.png | Bin 33938 -> 0 bytes advtrains/textures/advtrains_track_placer.png | Bin 32349 -> 0 bytes advtrains/textures/advtrains_track_st.png | Bin 20405 -> 0 bytes advtrains/textures/advtrains_track_st_45.png | Bin 39977 -> 0 bytes advtrains/textures/advtrains_track_swlcr.png | Bin 33378 -> 0 bytes advtrains/textures/advtrains_track_swlcr_45.png | Bin 45772 -> 0 bytes advtrains/textures/advtrains_track_swlst.png | Bin 32321 -> 0 bytes advtrains/textures/advtrains_track_swlst_45.png | Bin 46408 -> 0 bytes advtrains/textures/advtrains_track_swrcr.png | Bin 33670 -> 0 bytes advtrains/textures/advtrains_track_swrcr_45.png | Bin 46865 -> 0 bytes advtrains/textures/advtrains_track_swrst.png | Bin 32654 -> 0 bytes advtrains/textures/advtrains_track_swrst_45.png | Bin 47636 -> 0 bytes advtrains/textures/advtrains_trackworker.png | Bin 328 -> 0 bytes advtrains/textures/drwho_screwdriver.png | Bin 328 -> 0 bytes advtrains/textures/larger rails.xcf | Bin 1239132 -> 0 bytes advtrains/trackplacer.lua | 297 ------- advtrains/tracks.lua | 721 ----------------- advtrains/trainhud.lua | 109 --- advtrains/trainlogic.lua | 875 --------------------- advtrains/wagons.lua | 573 -------------- advtrains_train_industrial/depends.txt | 1 - advtrains_train_industrial/init.lua | 67 -- .../models/advtrains_engine_industrial.b3d | Bin 143659 -> 0 bytes .../models/advtrains_wagon_tank.b3d | Bin 223975 -> 0 bytes .../models/advtrains_wagon_wood.b3d | Bin 193975 -> 0 bytes .../textures/advtrains_engine_industrial.png | Bin 59019 -> 0 bytes .../textures/advtrains_engine_industrial_inv.png | Bin 381 -> 0 bytes .../textures/advtrains_wagon_tank.png | Bin 8975 -> 0 bytes .../textures/advtrains_wagon_tank_inv.png | Bin 408 -> 0 bytes .../textures/advtrains_wagon_wood.png | Bin 5974 -> 0 bytes .../textures/advtrains_wagon_wood_inv.png | Bin 316 -> 0 bytes advtrains_train_japan/depends.txt | 1 - advtrains_train_japan/init.lua | 38 - .../models/advtrains_engine_japan.b3d | Bin 165287 -> 0 bytes .../models/advtrains_wagon_japan.b3d | Bin 171991 -> 0 bytes .../textures/advtrains_engine_japan.png | Bin 12664 -> 0 bytes .../textures/advtrains_engine_japan_inv.png | Bin 434 -> 0 bytes .../textures/advtrains_wagon_japan.png | Bin 11175 -> 0 bytes .../textures/advtrains_wagon_japan_inv.png | Bin 400 -> 0 bytes advtrains_train_steam/depends.txt | 1 - advtrains_train_steam/init.lua | 121 --- .../models/advtrains_engine_steam.b3d | Bin 298687 -> 0 bytes advtrains_train_steam/models/advtrains_wagon.b3d | Bin 107352 -> 0 bytes .../textures/advtrains_newlocomotive.png | Bin 31800 -> 0 bytes .../textures/advtrains_newlocomotive_inv.png | Bin 469 -> 0 bytes advtrains_train_steam/textures/advtrains_wagon.png | Bin 35724 -> 0 bytes .../textures/advtrains_wagon_box.png | Bin 22503 -> 0 bytes .../textures/advtrains_wagon_box_inv.png | Bin 347 -> 0 bytes .../textures/advtrains_wagon_inv.png | Bin 709 -> 0 bytes advtrains_train_subway/depends.txt | 1 - advtrains_train_subway/init.lua | 30 - .../models/advtrains_subway_train.b3d | Bin 95856 -> 0 bytes .../textures/advtrains_subway_train.png | Bin 12002 -> 0 bytes .../textures/advtrains_subway_train_inv.png | Bin 900 -> 0 bytes assets/advtrains_newlocomotive.xcf | Bin 0 -> 7462378 bytes assets/blender/engine-with-animation.blend | Bin 0 -> 599504 bytes assets/blender/gleis/detectorpart.png | Bin 0 -> 857 bytes assets/blender/gleis/infos/Grafik_weiche.png | Bin 0 -> 361700 bytes assets/blender/gleis/infos/breite | 1 + assets/blender/gleis/licence.txt~ | 0 assets/blender/gleis/rail_my.blend | Bin 0 -> 654772 bytes assets/blender/gleis/rail_my.blend1 | Bin 0 -> 674164 bytes assets/blender/gleis/rail_my_rt.blend | Bin 0 -> 847060 bytes assets/blender/gleis/rail_my_rt.blend1 | Bin 0 -> 767780 bytes assets/blender/gleis/rail_my_rt_final.blend | Bin 0 -> 1015668 bytes assets/blender/gleis/rail_my_rt_final.blend1 | Bin 0 -> 1106004 bytes assets/blender/gleis/rail_my_rt_switches.blend | Bin 0 -> 2184236 bytes assets/blender/gleis/rail_my_rt_switches.blend1 | Bin 0 -> 1945588 bytes assets/blender/gleis/rail_my_rt_switches2.blend | Bin 0 -> 2139340 bytes assets/blender/gleis/rail_my_rt_switches2.blend1 | Bin 0 -> 2172972 bytes assets/blender/gleis/rail_together.blend | Bin 0 -> 1016920 bytes assets/blender/gleis/rail_together.png | Bin 0 -> 233544 bytes assets/blender/gleis/rail_together2.png | Bin 0 -> 312891 bytes assets/blender/gleis/rail_together3.png | Bin 0 -> 309398 bytes assets/blender/gleis/rail_verticals.blend | Bin 0 -> 550748 bytes assets/blender/gleis/rail_verticals.blend1 | Bin 0 -> 574100 bytes assets/blender/gleis/rail_verticals3.blend | Bin 0 -> 591800 bytes assets/blender/gleis/rail_verticals3.blend1 | Bin 0 -> 554196 bytes assets/blender/gleis/rail_verticals45.blend | Bin 0 -> 547788 bytes assets/blender/gleis/rail_verticals45.blend1 | Bin 0 -> 547300 bytes assets/blender/gleis/rail_verticals45.blend11 | Bin 0 -> 547300 bytes assets/blender/gleis/texturen/rail.png | Bin 0 -> 2616 bytes assets/blender/gleis/texturen/uv.png | Bin 0 -> 2343 bytes assets/blender/industrial/industry_loc.blend | Bin 0 -> 652640 bytes assets/blender/industrial/industry_loc.blend1 | Bin 0 -> 652640 bytes assets/blender/industrial/industry_loc.blend11 | Bin 0 -> 659096 bytes .../blender/industrial/industry_oil_ wagong.blend | Bin 0 -> 693488 bytes .../blender/industrial/industry_oil_ wagong.blend1 | Bin 0 -> 693488 bytes .../blender/industrial/industry_tree_wagong.blend | Bin 0 -> 640056 bytes .../blender/industrial/industry_tree_wagong.blend1 | Bin 0 -> 640056 bytes assets/blender/industrial/industry_tree_wagong.png | Bin 0 -> 316 bytes assets/blender/locomotive.blend | Bin 0 -> 459600 bytes assets/blender/magnet_track.blend | Bin 0 -> 516836 bytes assets/blender/mbb/advtrains_wagon_japan.xcf | Bin 0 -> 814467 bytes assets/blender/mbb/modern_japanlocomotive.blend | Bin 0 -> 715116 bytes assets/blender/mbb/modern_japanlocomotive.blend1 | Bin 0 -> 715116 bytes assets/blender/mbb/modern_japanlocomotive.png | Bin 0 -> 204978 bytes assets/blender/mbb/modern_japanlocomotive.xcf | Bin 0 -> 957175 bytes assets/blender/mbb/modern_locomotive.blend | Bin 0 -> 732124 bytes assets/blender/mbb/modern_wagong.blend | Bin 0 -> 471140 bytes assets/blender/mbb/modern_wagong.blend1 | Bin 0 -> 518316 bytes assets/blender/mbb/modern_wagong_uv.blend | Bin 0 -> 571364 bytes assets/blender/mbb/modern_wagong_uv.blend1 | Bin 0 -> 575708 bytes assets/blender/mbb/modern_wagong_uv.png | Bin 0 -> 189564 bytes assets/blender/mbb/prellbock.blend | Bin 0 -> 745176 bytes assets/blender/mbb/prellbock.blend1 | Bin 0 -> 485416 bytes assets/blender/mbb/prellbock.uv.png | Bin 0 -> 4034 bytes assets/blender/mbb/regio-lokomotive.blend | Bin 0 -> 704160 bytes assets/blender/mbb/regio-waron.blend | Bin 0 -> 545620 bytes assets/blender/mbb/retrosignal.blend | Bin 0 -> 488920 bytes assets/blender/mbb/retrosignal.blend1 | Bin 0 -> 507800 bytes assets/blender/mbb/signal(2)_hoch.blend | Bin 0 -> 472092 bytes assets/blender/mbb/signal(2)_unten.blend | Bin 0 -> 472092 bytes assets/blender/mbb/signal.blend | Bin 0 -> 570336 bytes assets/blender/mbb/signal.blend1 | Bin 0 -> 570336 bytes assets/blender/mbb/signal.png | Bin 0 -> 244314 bytes assets/blender/mbb/signal.xcf | Bin 0 -> 881142 bytes assets/blender/mbb/signal2.png | Bin 0 -> 39924 bytes assets/blender/mbb/tr-logo.png | Bin 0 -> 197 bytes assets/blender/mbb/weichenhebel1.blend | Bin 0 -> 493028 bytes assets/blender/mbb/weichenhebel2.blend | Bin 0 -> 492996 bytes assets/blender/newlocomotive.blend | Bin 0 -> 603376 bytes assets/blender/newlocomotive.blend1 | Bin 0 -> 603376 bytes assets/blender/newlocomotive_uvs.png | Bin 0 -> 175030 bytes assets/blender/newwagon.blend | Bin 0 -> 542188 bytes assets/blender/newwagon.blend1 | Bin 0 -> 550292 bytes assets/blender/newwagon.png | Bin 0 -> 108762 bytes assets/blender/subway-train.blend | Bin 0 -> 536268 bytes assets/blender/subway-train.blend1 | Bin 0 -> 538188 bytes assets/blender/subway-train.png | Bin 0 -> 96773 bytes assets/blender/subway-train.xcf | Bin 0 -> 92558 bytes assets/blender/trackplane.blend | Bin 0 -> 462200 bytes assets/blender/trackvertical1.blend | Bin 0 -> 453656 bytes assets/blender/trackvertical1.blend1 | Bin 0 -> 453344 bytes assets/blender/trackvertical1.png | Bin 0 -> 59146 bytes assets/blender/trackvertical2.blend | Bin 0 -> 459216 bytes assets/blender/trackvertical2.png | Bin 0 -> 66755 bytes assets/init.lua | 0 assets/larger rails.xcf | Bin 0 -> 1239132 bytes assets/oldmodels/locomotive.b3d | Bin 0 -> 181112 bytes assets/oldmodels/trackvertical1.b3d | Bin 0 -> 629 bytes assets/oldmodels/trackvertical2.b3d | Bin 0 -> 869 bytes license.txt | 142 ---- license_media.txt | 63 -- manual.pdf | Bin 1037362 -> 0 bytes screenshot.png | Bin 445014 -> 0 bytes 470 files changed, 4457 insertions(+), 4457 deletions(-) delete mode 100644 Makefile delete mode 100644 advtrains.zip create mode 100644 advtrains/Makefile create mode 100644 advtrains/advtrains.zip create mode 100644 advtrains/advtrains/api_doc.txt create mode 100644 advtrains/advtrains/atc.lua create mode 100644 advtrains/advtrains/atc_command.txt create mode 100644 advtrains/advtrains/couple.lua create mode 100644 advtrains/advtrains/crafting.lua create mode 100644 advtrains/advtrains/damage.lua create mode 100644 advtrains/advtrains/debugitems.lua create mode 100644 advtrains/advtrains/depends.txt create mode 100644 advtrains/advtrains/description.txt create mode 100644 advtrains/advtrains/helpers.lua create mode 100644 advtrains/advtrains/init.lua create mode 100644 advtrains/advtrains/misc_nodes.lua create mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_detector_st.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_detector_st_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_detector_st_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_detector_st_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_st.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst1.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst1_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst2.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst2_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst31.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst32.b3d create mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst33.b3d create mode 100644 advtrains/advtrains/models/advtrains_modernwagon.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_signal.b3d create mode 100644 advtrains/advtrains/models/advtrains_signal_30.b3d create mode 100644 advtrains/advtrains/models/advtrains_signal_45.b3d create mode 100644 advtrains/advtrains/models/advtrains_signal_60.b3d create mode 100644 advtrains/advtrains/models/advtrains_track_cr.b3d create mode 100644 advtrains/advtrains/models/advtrains_track_st.b3d create mode 100644 advtrains/advtrains/models/advtrains_track_st_45.b3d create mode 100644 advtrains/advtrains/models/trackplane.b3d create mode 100644 advtrains/advtrains/pseudoload.lua create mode 100644 advtrains/advtrains/readme.txt create mode 100644 advtrains/advtrains/signals.lua create mode 100644 advtrains/advtrains/textures/advtrains_couple.png create mode 100644 advtrains/advtrains/textures/advtrains_discouple.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_placer.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_rail.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_rail_atc.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_rail_detector_on.png create mode 100644 advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png create mode 100644 advtrains/advtrains/textures/advtrains_platform.png create mode 100644 advtrains/advtrains/textures/advtrains_retrosignal.png create mode 100644 advtrains/advtrains/textures/advtrains_retrosignal_inv.png create mode 100644 advtrains/advtrains/textures/advtrains_signal_inv.png create mode 100644 advtrains/advtrains/textures/advtrains_signal_off.png create mode 100644 advtrains/advtrains/textures/advtrains_signal_on.png create mode 100644 advtrains/advtrains/textures/advtrains_track_cr.png create mode 100644 advtrains/advtrains/textures/advtrains_track_cr_45.png create mode 100644 advtrains/advtrains/textures/advtrains_track_placer.png create mode 100644 advtrains/advtrains/textures/advtrains_track_st.png create mode 100644 advtrains/advtrains/textures/advtrains_track_st_45.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swlcr.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swlcr_45.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swlst.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swlst_45.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swrcr.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swrcr_45.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swrst.png create mode 100644 advtrains/advtrains/textures/advtrains_track_swrst_45.png create mode 100644 advtrains/advtrains/textures/advtrains_trackworker.png create mode 100644 advtrains/advtrains/textures/drwho_screwdriver.png create mode 100644 advtrains/advtrains/trackplacer.lua create mode 100644 advtrains/advtrains/tracks.lua create mode 100644 advtrains/advtrains/trainhud.lua create mode 100644 advtrains/advtrains/trainlogic.lua create mode 100644 advtrains/advtrains/wagons.lua create mode 100644 advtrains/advtrains_train_industrial/depends.txt create mode 100644 advtrains/advtrains_train_industrial/init.lua create mode 100644 advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d create mode 100644 advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d create mode 100644 advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png create mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png create mode 100644 advtrains/advtrains_train_japan/depends.txt create mode 100644 advtrains/advtrains_train_japan/init.lua create mode 100644 advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d create mode 100644 advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d create mode 100644 advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png create mode 100644 advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png create mode 100644 advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png create mode 100644 advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png create mode 100644 advtrains/advtrains_train_steam/depends.txt create mode 100644 advtrains/advtrains_train_steam/init.lua create mode 100644 advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d create mode 100644 advtrains/advtrains_train_steam/models/advtrains_wagon.b3d create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_wagon.png create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png create mode 100644 advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png create mode 100644 advtrains/advtrains_train_subway/depends.txt create mode 100644 advtrains/advtrains_train_subway/init.lua create mode 100644 advtrains/advtrains_train_subway/models/advtrains_subway_train.b3d create mode 100644 advtrains/advtrains_train_subway/textures/advtrains_subway_train.png create mode 100644 advtrains/advtrains_train_subway/textures/advtrains_subway_train_inv.png delete mode 100644 advtrains/api_doc.txt delete mode 100644 advtrains/atc.lua delete mode 100644 advtrains/atc_command.txt delete mode 100644 advtrains/couple.lua delete mode 100644 advtrains/crafting.lua delete mode 100644 advtrains/damage.lua delete mode 100644 advtrains/debugitems.lua delete mode 100644 advtrains/depends.txt delete mode 100644 advtrains/description.txt delete mode 100644 advtrains/helpers.lua delete mode 100644 advtrains/init.lua create mode 100644 advtrains/license.txt create mode 100644 advtrains/license_media.txt create mode 100644 advtrains/manual.pdf delete mode 100644 advtrains/misc_nodes.lua delete mode 100644 advtrains/models/advtrains_dtrack_bumper_st.b3d delete mode 100644 advtrains/models/advtrains_dtrack_bumper_st_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_bumper_st_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_bumper_st_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_cr.b3d delete mode 100644 advtrains/models/advtrains_dtrack_cr_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_cr_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_cr_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_detector_st.b3d delete mode 100644 advtrains/models/advtrains_dtrack_detector_st_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_detector_st_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_detector_st_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_st.b3d delete mode 100644 advtrains/models/advtrains_dtrack_st_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_st_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_st_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlcr.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlcr_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlcr_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlcr_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlst.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlst_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlst_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swlst_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrcr.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrcr_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrcr_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrcr_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrst.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrst_30.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrst_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_swrst_60.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst1.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst1_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst2.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst2_45.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst31.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst32.b3d delete mode 100644 advtrains/models/advtrains_dtrack_vst33.b3d delete mode 100644 advtrains/models/advtrains_modernwagon.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_off.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_off_30.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_off_45.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_off_60.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_on.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_on_30.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_on_45.b3d delete mode 100644 advtrains/models/advtrains_retrosignal_on_60.b3d delete mode 100644 advtrains/models/advtrains_signal.b3d delete mode 100644 advtrains/models/advtrains_signal_30.b3d delete mode 100644 advtrains/models/advtrains_signal_45.b3d delete mode 100644 advtrains/models/advtrains_signal_60.b3d delete mode 100644 advtrains/models/advtrains_track_cr.b3d delete mode 100644 advtrains/models/advtrains_track_st.b3d delete mode 100644 advtrains/models/advtrains_track_st_45.b3d delete mode 100644 advtrains/models/blender/engine-with-animation.blend delete mode 100644 advtrains/models/blender/gleis/detectorpart.png delete mode 100644 advtrains/models/blender/gleis/infos/Grafik_weiche.png delete mode 100644 advtrains/models/blender/gleis/infos/breite delete mode 100644 advtrains/models/blender/gleis/licence.txt~ delete mode 100644 advtrains/models/blender/gleis/rail_my.blend delete mode 100644 advtrains/models/blender/gleis/rail_my.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_my_rt.blend delete mode 100644 advtrains/models/blender/gleis/rail_my_rt.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_final.blend delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_final.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_switches.blend delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_switches.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_switches2.blend delete mode 100644 advtrains/models/blender/gleis/rail_my_rt_switches2.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_together.blend delete mode 100644 advtrains/models/blender/gleis/rail_together.png delete mode 100644 advtrains/models/blender/gleis/rail_together2.png delete mode 100644 advtrains/models/blender/gleis/rail_together3.png delete mode 100644 advtrains/models/blender/gleis/rail_verticals.blend delete mode 100644 advtrains/models/blender/gleis/rail_verticals.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_verticals3.blend delete mode 100644 advtrains/models/blender/gleis/rail_verticals3.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_verticals45.blend delete mode 100644 advtrains/models/blender/gleis/rail_verticals45.blend1 delete mode 100644 advtrains/models/blender/gleis/rail_verticals45.blend11 delete mode 100644 advtrains/models/blender/gleis/texturen/rail.png delete mode 100644 advtrains/models/blender/gleis/texturen/uv.png delete mode 100644 advtrains/models/blender/industrial/industry_loc.blend delete mode 100644 advtrains/models/blender/industrial/industry_loc.blend1 delete mode 100644 advtrains/models/blender/industrial/industry_loc.blend11 delete mode 100644 advtrains/models/blender/industrial/industry_oil_ wagong.blend delete mode 100644 advtrains/models/blender/industrial/industry_oil_ wagong.blend1 delete mode 100644 advtrains/models/blender/industrial/industry_tree_wagong.blend delete mode 100644 advtrains/models/blender/industrial/industry_tree_wagong.blend1 delete mode 100644 advtrains/models/blender/industrial/industry_tree_wagong.png delete mode 100644 advtrains/models/blender/locomotive.blend delete mode 100644 advtrains/models/blender/magnet_track.blend delete mode 100644 advtrains/models/blender/mbb/advtrains_wagon_japan.xcf delete mode 100644 advtrains/models/blender/mbb/modern_japanlocomotive.blend delete mode 100644 advtrains/models/blender/mbb/modern_japanlocomotive.blend1 delete mode 100644 advtrains/models/blender/mbb/modern_japanlocomotive.png delete mode 100644 advtrains/models/blender/mbb/modern_japanlocomotive.xcf delete mode 100644 advtrains/models/blender/mbb/modern_locomotive.blend delete mode 100644 advtrains/models/blender/mbb/modern_wagong.blend delete mode 100644 advtrains/models/blender/mbb/modern_wagong.blend1 delete mode 100644 advtrains/models/blender/mbb/modern_wagong_uv.blend delete mode 100644 advtrains/models/blender/mbb/modern_wagong_uv.blend1 delete mode 100644 advtrains/models/blender/mbb/modern_wagong_uv.png delete mode 100644 advtrains/models/blender/mbb/prellbock.blend delete mode 100644 advtrains/models/blender/mbb/prellbock.blend1 delete mode 100644 advtrains/models/blender/mbb/prellbock.uv.png delete mode 100644 advtrains/models/blender/mbb/regio-lokomotive.blend delete mode 100644 advtrains/models/blender/mbb/regio-waron.blend delete mode 100644 advtrains/models/blender/mbb/retrosignal.blend delete mode 100644 advtrains/models/blender/mbb/retrosignal.blend1 delete mode 100644 advtrains/models/blender/mbb/signal(2)_hoch.blend delete mode 100644 advtrains/models/blender/mbb/signal(2)_unten.blend delete mode 100644 advtrains/models/blender/mbb/signal.blend delete mode 100644 advtrains/models/blender/mbb/signal.blend1 delete mode 100644 advtrains/models/blender/mbb/signal.png delete mode 100644 advtrains/models/blender/mbb/signal.xcf delete mode 100644 advtrains/models/blender/mbb/signal2.png delete mode 100644 advtrains/models/blender/mbb/tr-logo.png delete mode 100644 advtrains/models/blender/mbb/weichenhebel1.blend delete mode 100644 advtrains/models/blender/mbb/weichenhebel2.blend delete mode 100644 advtrains/models/blender/newlocomotive.blend delete mode 100644 advtrains/models/blender/newlocomotive.blend1 delete mode 100644 advtrains/models/blender/newlocomotive_uvs.png delete mode 100644 advtrains/models/blender/newwagon.blend delete mode 100644 advtrains/models/blender/newwagon.blend1 delete mode 100644 advtrains/models/blender/newwagon.png delete mode 100644 advtrains/models/blender/subway-train.blend delete mode 100644 advtrains/models/blender/subway-train.blend1 delete mode 100644 advtrains/models/blender/subway-train.png delete mode 100644 advtrains/models/blender/subway-train.xcf delete mode 100644 advtrains/models/blender/trackplane.blend delete mode 100644 advtrains/models/blender/trackvertical1.blend delete mode 100644 advtrains/models/blender/trackvertical1.blend1 delete mode 100644 advtrains/models/blender/trackvertical1.png delete mode 100644 advtrains/models/blender/trackvertical2.blend delete mode 100644 advtrains/models/blender/trackvertical2.png delete mode 100644 advtrains/models/oldmodels/locomotive.b3d delete mode 100644 advtrains/models/oldmodels/trackvertical1.b3d delete mode 100644 advtrains/models/oldmodels/trackvertical2.b3d delete mode 100644 advtrains/models/trackplane.b3d create mode 100644 advtrains/modpack.txt delete mode 100644 advtrains/pseudoload.lua delete mode 100644 advtrains/readme.txt create mode 100644 advtrains/screenshot.png delete mode 100644 advtrains/signals.lua delete mode 100644 advtrains/textures/advtrains_couple.png delete mode 100644 advtrains/textures/advtrains_discouple.png delete mode 100644 advtrains/textures/advtrains_dtrack_atc_placer.png delete mode 100644 advtrains/textures/advtrains_dtrack_bumper_placer.png delete mode 100644 advtrains/textures/advtrains_dtrack_detector_placer.png delete mode 100644 advtrains/textures/advtrains_dtrack_placer.png delete mode 100644 advtrains/textures/advtrains_dtrack_rail.png delete mode 100644 advtrains/textures/advtrains_dtrack_rail_atc.png delete mode 100644 advtrains/textures/advtrains_dtrack_rail_detector_on.png delete mode 100644 advtrains/textures/advtrains_dtrack_slopeplacer.png delete mode 100644 advtrains/textures/advtrains_newlocomotive.xcf delete mode 100644 advtrains/textures/advtrains_platform.png delete mode 100644 advtrains/textures/advtrains_retrosignal.png delete mode 100644 advtrains/textures/advtrains_retrosignal_inv.png delete mode 100644 advtrains/textures/advtrains_signal_inv.png delete mode 100644 advtrains/textures/advtrains_signal_off.png delete mode 100644 advtrains/textures/advtrains_signal_on.png delete mode 100644 advtrains/textures/advtrains_track_cr.png delete mode 100644 advtrains/textures/advtrains_track_cr_45.png delete mode 100644 advtrains/textures/advtrains_track_placer.png delete mode 100644 advtrains/textures/advtrains_track_st.png delete mode 100644 advtrains/textures/advtrains_track_st_45.png delete mode 100644 advtrains/textures/advtrains_track_swlcr.png delete mode 100644 advtrains/textures/advtrains_track_swlcr_45.png delete mode 100644 advtrains/textures/advtrains_track_swlst.png delete mode 100644 advtrains/textures/advtrains_track_swlst_45.png delete mode 100644 advtrains/textures/advtrains_track_swrcr.png delete mode 100644 advtrains/textures/advtrains_track_swrcr_45.png delete mode 100644 advtrains/textures/advtrains_track_swrst.png delete mode 100644 advtrains/textures/advtrains_track_swrst_45.png delete mode 100644 advtrains/textures/advtrains_trackworker.png delete mode 100644 advtrains/textures/drwho_screwdriver.png delete mode 100644 advtrains/textures/larger rails.xcf delete mode 100644 advtrains/trackplacer.lua delete mode 100644 advtrains/tracks.lua delete mode 100644 advtrains/trainhud.lua delete mode 100644 advtrains/trainlogic.lua delete mode 100644 advtrains/wagons.lua delete mode 100644 advtrains_train_industrial/depends.txt delete mode 100644 advtrains_train_industrial/init.lua delete mode 100644 advtrains_train_industrial/models/advtrains_engine_industrial.b3d delete mode 100644 advtrains_train_industrial/models/advtrains_wagon_tank.b3d delete mode 100644 advtrains_train_industrial/models/advtrains_wagon_wood.b3d delete mode 100644 advtrains_train_industrial/textures/advtrains_engine_industrial.png delete mode 100644 advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png delete mode 100644 advtrains_train_industrial/textures/advtrains_wagon_tank.png delete mode 100644 advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png delete mode 100644 advtrains_train_industrial/textures/advtrains_wagon_wood.png delete mode 100644 advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png delete mode 100644 advtrains_train_japan/depends.txt delete mode 100644 advtrains_train_japan/init.lua delete mode 100644 advtrains_train_japan/models/advtrains_engine_japan.b3d delete mode 100644 advtrains_train_japan/models/advtrains_wagon_japan.b3d delete mode 100644 advtrains_train_japan/textures/advtrains_engine_japan.png delete mode 100644 advtrains_train_japan/textures/advtrains_engine_japan_inv.png delete mode 100644 advtrains_train_japan/textures/advtrains_wagon_japan.png delete mode 100644 advtrains_train_japan/textures/advtrains_wagon_japan_inv.png delete mode 100644 advtrains_train_steam/depends.txt delete mode 100644 advtrains_train_steam/init.lua delete mode 100644 advtrains_train_steam/models/advtrains_engine_steam.b3d delete mode 100644 advtrains_train_steam/models/advtrains_wagon.b3d delete mode 100644 advtrains_train_steam/textures/advtrains_newlocomotive.png delete mode 100644 advtrains_train_steam/textures/advtrains_newlocomotive_inv.png delete mode 100644 advtrains_train_steam/textures/advtrains_wagon.png delete mode 100644 advtrains_train_steam/textures/advtrains_wagon_box.png delete mode 100644 advtrains_train_steam/textures/advtrains_wagon_box_inv.png delete mode 100644 advtrains_train_steam/textures/advtrains_wagon_inv.png delete mode 100644 advtrains_train_subway/depends.txt delete mode 100644 advtrains_train_subway/init.lua delete mode 100644 advtrains_train_subway/models/advtrains_subway_train.b3d delete mode 100644 advtrains_train_subway/textures/advtrains_subway_train.png delete mode 100644 advtrains_train_subway/textures/advtrains_subway_train_inv.png create mode 100644 assets/advtrains_newlocomotive.xcf create mode 100644 assets/blender/engine-with-animation.blend create mode 100644 assets/blender/gleis/detectorpart.png create mode 100644 assets/blender/gleis/infos/Grafik_weiche.png create mode 100644 assets/blender/gleis/infos/breite create mode 100644 assets/blender/gleis/licence.txt~ create mode 100644 assets/blender/gleis/rail_my.blend create mode 100644 assets/blender/gleis/rail_my.blend1 create mode 100644 assets/blender/gleis/rail_my_rt.blend create mode 100644 assets/blender/gleis/rail_my_rt.blend1 create mode 100644 assets/blender/gleis/rail_my_rt_final.blend create mode 100644 assets/blender/gleis/rail_my_rt_final.blend1 create mode 100644 assets/blender/gleis/rail_my_rt_switches.blend create mode 100644 assets/blender/gleis/rail_my_rt_switches.blend1 create mode 100644 assets/blender/gleis/rail_my_rt_switches2.blend create mode 100644 assets/blender/gleis/rail_my_rt_switches2.blend1 create mode 100644 assets/blender/gleis/rail_together.blend create mode 100644 assets/blender/gleis/rail_together.png create mode 100644 assets/blender/gleis/rail_together2.png create mode 100644 assets/blender/gleis/rail_together3.png create mode 100644 assets/blender/gleis/rail_verticals.blend create mode 100644 assets/blender/gleis/rail_verticals.blend1 create mode 100644 assets/blender/gleis/rail_verticals3.blend create mode 100644 assets/blender/gleis/rail_verticals3.blend1 create mode 100644 assets/blender/gleis/rail_verticals45.blend create mode 100644 assets/blender/gleis/rail_verticals45.blend1 create mode 100644 assets/blender/gleis/rail_verticals45.blend11 create mode 100644 assets/blender/gleis/texturen/rail.png create mode 100644 assets/blender/gleis/texturen/uv.png create mode 100644 assets/blender/industrial/industry_loc.blend create mode 100644 assets/blender/industrial/industry_loc.blend1 create mode 100644 assets/blender/industrial/industry_loc.blend11 create mode 100644 assets/blender/industrial/industry_oil_ wagong.blend create mode 100644 assets/blender/industrial/industry_oil_ wagong.blend1 create mode 100644 assets/blender/industrial/industry_tree_wagong.blend create mode 100644 assets/blender/industrial/industry_tree_wagong.blend1 create mode 100644 assets/blender/industrial/industry_tree_wagong.png create mode 100644 assets/blender/locomotive.blend create mode 100644 assets/blender/magnet_track.blend create mode 100644 assets/blender/mbb/advtrains_wagon_japan.xcf create mode 100644 assets/blender/mbb/modern_japanlocomotive.blend create mode 100644 assets/blender/mbb/modern_japanlocomotive.blend1 create mode 100644 assets/blender/mbb/modern_japanlocomotive.png create mode 100644 assets/blender/mbb/modern_japanlocomotive.xcf create mode 100644 assets/blender/mbb/modern_locomotive.blend create mode 100644 assets/blender/mbb/modern_wagong.blend create mode 100644 assets/blender/mbb/modern_wagong.blend1 create mode 100644 assets/blender/mbb/modern_wagong_uv.blend create mode 100644 assets/blender/mbb/modern_wagong_uv.blend1 create mode 100644 assets/blender/mbb/modern_wagong_uv.png create mode 100644 assets/blender/mbb/prellbock.blend create mode 100644 assets/blender/mbb/prellbock.blend1 create mode 100644 assets/blender/mbb/prellbock.uv.png create mode 100644 assets/blender/mbb/regio-lokomotive.blend create mode 100644 assets/blender/mbb/regio-waron.blend create mode 100644 assets/blender/mbb/retrosignal.blend create mode 100644 assets/blender/mbb/retrosignal.blend1 create mode 100644 assets/blender/mbb/signal(2)_hoch.blend create mode 100644 assets/blender/mbb/signal(2)_unten.blend create mode 100644 assets/blender/mbb/signal.blend create mode 100644 assets/blender/mbb/signal.blend1 create mode 100644 assets/blender/mbb/signal.png create mode 100644 assets/blender/mbb/signal.xcf create mode 100644 assets/blender/mbb/signal2.png create mode 100644 assets/blender/mbb/tr-logo.png create mode 100644 assets/blender/mbb/weichenhebel1.blend create mode 100644 assets/blender/mbb/weichenhebel2.blend create mode 100644 assets/blender/newlocomotive.blend create mode 100644 assets/blender/newlocomotive.blend1 create mode 100644 assets/blender/newlocomotive_uvs.png create mode 100644 assets/blender/newwagon.blend create mode 100644 assets/blender/newwagon.blend1 create mode 100644 assets/blender/newwagon.png create mode 100644 assets/blender/subway-train.blend create mode 100644 assets/blender/subway-train.blend1 create mode 100644 assets/blender/subway-train.png create mode 100644 assets/blender/subway-train.xcf create mode 100644 assets/blender/trackplane.blend create mode 100644 assets/blender/trackvertical1.blend create mode 100644 assets/blender/trackvertical1.blend1 create mode 100644 assets/blender/trackvertical1.png create mode 100644 assets/blender/trackvertical2.blend create mode 100644 assets/blender/trackvertical2.png create mode 100644 assets/init.lua create mode 100644 assets/larger rails.xcf create mode 100644 assets/oldmodels/locomotive.b3d create mode 100644 assets/oldmodels/trackvertical1.b3d create mode 100644 assets/oldmodels/trackvertical2.b3d delete mode 100644 license.txt delete mode 100644 license_media.txt delete mode 100644 manual.pdf delete mode 100644 screenshot.png diff --git a/Makefile b/Makefile deleted file mode 100644 index 7300426..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -tarball: clean -# tar czf advtrains.tar.gz textures/*.png models/*.b3d *.lua *.txt - which zip && zip advtrains.zip textures/*.png models/*.b3d *.lua *.txt -clean: - rm -f advtrains.zip advtrains.tar.gz diff --git a/advtrains.zip b/advtrains.zip deleted file mode 100644 index a3dab82..0000000 Binary files a/advtrains.zip and /dev/null differ diff --git a/advtrains/Makefile b/advtrains/Makefile new file mode 100644 index 0000000..7300426 --- /dev/null +++ b/advtrains/Makefile @@ -0,0 +1,5 @@ +tarball: clean +# tar czf advtrains.tar.gz textures/*.png models/*.b3d *.lua *.txt + which zip && zip advtrains.zip textures/*.png models/*.b3d *.lua *.txt +clean: + rm -f advtrains.zip advtrains.tar.gz diff --git a/advtrains/advtrains.zip b/advtrains/advtrains.zip new file mode 100644 index 0000000..a3dab82 Binary files /dev/null and b/advtrains/advtrains.zip differ diff --git a/advtrains/advtrains/api_doc.txt b/advtrains/advtrains/api_doc.txt new file mode 100644 index 0000000..6b1aa2e --- /dev/null +++ b/advtrains/advtrains/api_doc.txt @@ -0,0 +1,114 @@ +Advanced Trains [advtrains] API documentation +-------- +To use the API, mods must depend on 'advtrains'. +All boolean values in definition tables default to 'false' and can be omitted. +### Wagons +Wagons are registered using the function + +advtrains.register_wagon(name, prototype, description, inventory_image) +- 'name' is the internal name of the wagon. It is registered inside the 'advtrains:' namespace. + Example: A wagon with name="engine_tgv" will be registered as "advtrains:engine_tgv". +- 'prototype' is the lua entity prototype. The regular definition keys for luaentites apply. Additional required and optional properties see below. DO NOT define 'on_step', 'on_activate', 'on_punch', 'on_rightclick' and 'get_staticdata' since these will be overridden. Use 'custom_*' instead. +- 'description' is the description of the inventory item that is used to place the wagon. +- 'inventory_image' is the inventory image of said item. + +# Wagon prototype properties +{ + ... all regular luaentity properties (mesh, textures, collisionbox a.s.o)... + drives_on = {default=true}, + ^- used to define the tracktypes (see below) that wagon can drive on. The tracktype identifiers are given as keys, similar to privileges) + max_speed = 10, + ^- optional, default 10: defines the maximum speed this wagon can drive. The maximum speed of a train is determined by the wagon with the lowest max_speed value. + seats = { + { + name="Left front window", + ^- display name of this seat + attach_offset={x=0, y=10, z=0}, + ^- this value is passed to 'set_attach' + view_offset={x=0, y=6, z=0}, + ^- player:set_eye_offset is called with this parameter. + driving_ctrl_access=false, + ^- If the seat is a driver stand, and players sitting here should get access to the train's driving control. + + }, + }, + ^- contains zero or more seat definitions. A seat is a place where a player can be attached when getting on a wagon. + wagon_span=2, + ^- How far this wagon extends from its base position. Is the half of the wagon length. + ^- Used to determine in which distance the other wagons have to be positioned. Will require tweaking. + drops = {"default:steelblock 3"} + ^- List of itemstrings what to drop when the wagon is destroyed + + has_inventory = false + ^- If this wagon has an inventory. The inventory is saved with the wagon. + ^- the following settings are ignored if not. + inventory_list_sizes = { + box=8*6, + }, + ^- List of assignments of type list_name=size. + ^- For every entry, an inventory list is created with the specified size. + get_inventory_formspec = function(self, player_name) + return "" + end, + ^- Function that should return the formspec to be displayed when requests to open the wagon's inventory + ^- Use "list[detached:advtrains_wgn_"..self.unique_id..";;,;,;]" to display a wagon's inventory list. + + custom_on_step = function(self, dtime) end + ^- optional: Execute custom code on every step + custom_on_activate = function(self, dtime_s) end + ^- optional: Execute custom code on activate. Staticdata does not need to be saved and restored since all properties written in 'self' are preserved over unloads. + update_animation = function(self, velocity) end + ^- optional: Function that is called whenever the train's velocity changes or every 2 seconds. Used to call 'self.object:update_animation()' if needed. + +} + +# Notes on wagons + +- Every wagon has the field 'unique_id' which assigns each wagon a random id. +- All properties written in the lua entity (self) are saved and restored automatically. Minetest's internal staticdata is only used to save the unique_id of the wagon, which serves as a key in an externally saved table. +- Assuming Z Axis as the axis parallel to the tracks and Y Axis as the one pointing into the sky, wagon models should be dimensioned in a way that: + - their origin is centered in X and Z direction + - their origin lies 0.5 units above the bottom of the model + - the overall extent in X and Y direction is <=3 units +- wagon_span is then the distance between the model origin and the Z axis extent. + +### Tracks +Most modders will be satisfied with the built-in tracks. If cog railways, maglev trains and mine trains are added, it is necessary to understand the definition of tracks. Although the tracks API is there, explaining it would require more effort than me creating the wanted definitions myself. Contact me if you need to register your own rails using my registration functions. + +However, it is still possible to register single rails by understanding the node properties of rails. +minetest.register_node(nodename, { + ... usual node definition ... + groups = { + advtrains_track_=1 + ^- this group tells that the node is a track + not_blocking_trains=1, + ^- this group tells that the node should not block trains although it's walkable. + }, + connect1 = 0, + connect2 = 8, + ^- These values tell the direction (horizontal) the rail ends are pointing to. 0 means +Z, then rotation values increase clockwise. For a translation of directions to positions see helpers.lua. + rely1=0, + rely2=0, + ^- the Y height of the rail end 1/2. A value of >=1 means that the rail end points to the next y layer at rely-1 + railheight=0, + ^- the height value of this rail that is saved in the path. usually the median of rely1 and rely2. + + can_dig=function(pos) + return not advtrains.is_train_at_pos(pos) + end, + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.reset_trackdb_position(pos) + end, + after_place_node=function(pos) + advtrains.reset_trackdb_position(pos) + end, + ^- the code in these 3 default minetest API functions is required for advtrains to work, however you can add your own code + + advtrains = { + on_train_enter=function(pos, train_id) end + ^- called when a train enters the rail + on_train_leave=function(pos, train_id) end + ^- called when a train leaves the rail + } +}) \ No newline at end of file diff --git a/advtrains/advtrains/atc.lua b/advtrains/advtrains/atc.lua new file mode 100644 index 0000000..f070b20 --- /dev/null +++ b/advtrains/advtrains/atc.lua @@ -0,0 +1,294 @@ +--atc.lua +--registers and controls the ATC system + +local atc={} +-- ATC persistence table +atc.controllers = {} +--contents: {command="...", arrowconn=0-15 where arrow points} + +advtrains.fpath_atc=minetest.get_worldpath().."/advtrains_atc" +local file, err = io.open(advtrains.fpath_atc, "r") +if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed loading advtrains atc save file "..er) +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + atc.controllers=tbl.controllers + end + file:close() +end +function atc.save() + --leave space for more save data. + local datastr = minetest.serialize({controllers = atc.controllers}) + if not datastr then + minetest.log("error", "[advtrains] Failed to serialize trackdb data!") + return + end + local file, err = io.open(advtrains.fpath_atc, "w") + if err then + return err + end + file:write(datastr) + file:close() +end + +--call from advtrains.detector subprogram + +function atc.trigger_controller_train_enter(pos, train_id) + atc.send_command(pos) +end + +--general + +function atc.send_command(pos) + local pts=minetest.pos_to_string(pos) + if atc.controllers[pts] then + print("Called send_command at "..pts) + local train_id = advtrains.detector.on_node[pts] + if train_id then + if advtrains.trains[train_id] then + print("send_command inside if: "..sid(train_id)) + atc.train_reset_command(train_id) + local arrowconn=atc.controllers[pts].arrowconn + local train=advtrains.trains[train_id] + for index, ppos in pairs(train.path) do + if vector.equals(advtrains.round_vector_floor_y(ppos), pos) then + advtrains.trains[train_id].atc_arrow = + vector.equals( + advtrains.dirCoordSet(pos, arrowconn), + advtrains.round_vector_floor_y(train.path[index+train.movedir]) + ) + advtrains.trains[train_id].atc_command=atc.controllers[pts].command + print("Sending ATC Command: "..atc.controllers[pts].command) + end + end + end + end + end + return false +end + +function atc.train_reset_command(train_id) + advtrains.trains[train_id].atc_command=nil + advtrains.trains[train_id].atc_delay=0 + advtrains.trains[train_id].atc_brake_target=nil + advtrains.trains[train_id].atc_wait_finish=nil + advtrains.trains[train_id].atc_arrow=nil +end + +--nodes +local idxtrans={static=1, mesecon=2, digiline=3} +local apn_func=function(pos) + advtrains.reset_trackdb_position(pos) + local meta=minetest.get_meta(pos) + if meta then + meta:set_string("infotext", "ATC controller, unconfigured.") + meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) + end +end + +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_atc", + texture_prefix="advtrains_dtrack_atc", + models_prefix="advtrains_dtrack_detector", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail_atc.png", + description="ATC controller", + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_place_node=apn_func, + on_place_rail=apn_func, + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.reset_trackdb_position(pos) + local pts=minetest.pos_to_string(pos) + atc.controllers[pts]=nil + end, + on_receive_fields = function(pos, formname, fields, player) + if minetest.is_protected(pos, player:get_player_name()) then + minetest.chat_send_player(player:get_player_name(), "This position is protected!") + return + end + local meta=minetest.get_meta(pos) + if meta then + if not fields.save then + --maybe only the dropdown changed + if fields.mode then + meta:set_string("mode", idxtrans[fields.mode]) + meta:set_string("infotext", "ATC controller, mode "..fields.mode.."\n"..( fields.mode=="digiline" and "Channel: "..meta:get_string("channel") or "Command: "..meta:get_string("command") ) ) + meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) + end + return + end + meta:set_string("mode", idxtrans[fields.mode]) + meta:set_string("command", fields.command) + meta:set_string("command_on", fields.command_on) + meta:set_string("channel", fields.channel) + meta:set_string("infotext", "ATC controller, mode "..fields.mode.."\n"..( fields.mode=="digiline" and "Channel: "..meta:get_string("channel") or "Command: "..meta:get_string("command") ) ) + meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) + + local pts=minetest.pos_to_string(pos) + local _, conn1=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) + atc.controllers[pts]={command=fields.command, arrowconn=conn1} + atc.send_command(pos) + end + end, + } + end +}, advtrains.trackpresets.t_30deg_straightonly) + + +function atc.get_atc_controller_formspec(pos, meta) + local mode=tonumber(meta:get_string("mode")) or 1 + local command=meta:get_string("command") + local command_on=meta:get_string("command_on") + local channel=meta:get_string("channel") + local formspec="size[8,6]".. + "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]" + if mode<3 then + formspec=formspec.."field[0.5,1.5;7,1;command;Command;"..minetest.formspec_escape(command).."]" + if tonumber(mode)==2 then + formspec=formspec.."field[0.5,3;7,1;command_on;Command (on);"..minetest.formspec_escape(command_on).."]" + end + else + formspec=formspec.."field[0.5,1.5;7,1;channel;Digiline channel;"..minetest.formspec_escape(channel).."]" + end + return formspec.."button_exit[0.5,4.5;7,1;save;Save]" +end + +--from trainlogic.lua train step +local matchptn={ + ["SM"]=function(id, train) + train.tarvelocity=train.max_speed + return 2 + end, + ["S([0-9]+)"]=function(id, train, match) + train.tarvelocity=tonumber(match) + return #match+1 + end, + ["B([0-9]+)"]=function(id, train, match) + if train.velocity>tonumber(match) then + train.atc_brake_target=tonumber(match) + if train.tarvelocity>train.atc_brake_target then + train.tarvelocity=train.atc_brake_target + end + end + return #match+1 + end, + ["W"]=function(id, train) + train.atc_wait_finish=true + return 1 + end, + ["D([0-9]+)"]=function(id, train, match) + train.atc_delay=tonumber(match) + return #match+1 + end, + ["R"]=function(id, train) + if train.velocity<=0 then + train.movedir=train.movedir*-1 + train.atc_arrow = not train.atc_arrow + else + print("ATC Reverse command warning: didn't reverse train!") + end + return 1 + end, +} + +function atc.execute_atc_command(id, train) + --strip whitespaces + local command=string.match(train.atc_command, "^%s*(.*)$") + + + if string.match(command, "^%s*$") then + train.atc_command=nil + return + end + --conditional statement? + local is_cond, cond_applies + local cond, rest=string.match(command, "^I([%+%-])(.+)$") + if cond then + is_cond=true + if cond=="+" then + cond_applies=train.atc_arrow + end + if cond=="-" then + cond_applies=not train.atc_arrow + end + else + cond, compare, rest=string.match(command, "^I([<>]=?)([0-9]+)(.+)$") + if cond and compare then + is_cond=true + if cond=="<" then + cond_applies=train.velocity" then + cond_applies=train.velocity>tonumber(compare) + end + if cond=="<=" then + cond_applies=train.velocity<=tonumber(compare) + end + if cond==">=" then + cond_applies=train.velocity>=tonumber(compare) + end + end + end + if is_cond then + print("Evaluating if statement: "..command) + print("Cond: "..(cond or "nil")) + print("Applies: "..(cond_applies and "true" or "false")) + print("Rest: "..rest) + --find end of conditional statement + local nest, pos, elsepos=0, 1 + while nest>=0 do + if pos>#rest then + print("ATC command syntax error: I statement not closed: "..command) + atc.train_reset_command(id) + return + end + local char=string.sub(rest, pos, pos) + if char=="I" then + nest=nest+1 + end + if char==";" then + nest=nest-1 + end + if nest==0 and char=="E" then + elsepos=pos+0 + end + pos=pos+1 + end + if not elsepos then elsepos=pos-1 end + if cond_applies then + command=string.sub(rest, 1, elsepos-1)..string.sub(rest, pos) + else + command=string.sub(rest, elsepos+1, pos-2)..string.sub(rest, pos) + end + print("Result: "..command) + train.atc_command=command + atc.execute_atc_command(id, train) + return + else + for pattern, func in pairs(matchptn) do + local match=string.match(command, "^"..pattern) + if match then + local patlen=func(id, train, match) + + print("Executing: "..string.sub(command, 1, patlen)) + + train.atc_command=string.sub(command, patlen+1) + if train.atc_delay<=0 and not train.atc_wait_finish then + --continue (recursive, cmds shouldn't get too long, and it's a end-recursion.) + atc.execute_atc_command(id, train) + end + return + end + end + end + print("ATC command parse error: "..command) + atc.train_reset_command(id) +end + +--move table to desired place +advtrains.atc=atc diff --git a/advtrains/advtrains/atc_command.txt b/advtrains/advtrains/atc_command.txt new file mode 100644 index 0000000..fa846e3 --- /dev/null +++ b/advtrains/advtrains/atc_command.txt @@ -0,0 +1,68 @@ +ATC Command Syntax + +A train runs the current ATC command once it receives it, including delayed instructions. If the train receives a new command, the current command is discarded. +Spaces can be inserted into commands as needed and are ignored. + +# simple commands: + +S<[0-9]+ speed or 'M'> +Set target speed of train to . Accelerates if slower, rolls if faster. 'M' means maximum speed. +Execution of command continues immediately. + +B<[0-9]+ speed> +Brake until speed is reached. If faster, apply brakes, if slower, do nothing. +Execution of command continues immediately. + +Examples: +SM : accelerate to maximum speed +S0 : roll to stand +B0 : brake to stand +S0B3 or B3S0: brake to 3, then roll to stand. + +W +Wait until S and/or B commands reached the desired speed before continuing execution. + +D<[0-9]+ time> +Delay: Wait for time seconds before continuing execution. + +R +Reverse: change movement direction of train. ONLY WORKS WHEN TRAIN STANDS, else no-op. +Use B0WR to definitely change direction. + +Examples: +B0 W R D10 SM +Subway train stopping in dead end station and returning in opposite direction + +# conditional statements: + +I; +Execute code only if condition applies +IE; +Execute code1 only if condition applies, else execute code2 + +Conditions: ++ / - +Tests the train's movement direction against the arrow on the ATC rail: M+ is true when train drives in direction of arrow. + +[/<=/>=][speed] +Test if train's speed is greater or smaller than the given value + +Examples: +I- B0 W R ; S8 +If the train drives in the 'wrong' direction, stop and reverse; independently accelerate to speed 8 afterwards. + +I<8 S8 ; +If the train is slower than 8, accelerate to 8. + +# ATC controller operation modes +static: Only give 1 static command. +mesecon: Give 2 different commands depending on if the controller is mesecon-powered or not +digiline: Don't give any commands by itself. When a train passes, a digiline message in the form of "[+/-][speed]" is sent on the set channel (where +/- means the same as with conditions). Any digiline message sent to the controller will be interpreted as ATC command and sent to the train. + +# Persistence +ATC controllers that are configured as 'static' or 'mesecon' are persistent over mapblock unloads and will even command the train when the mapblock is unloaded. This is not possible with digilines since these do not work in unloaded mapchunks. + +# LUA ATC controller (in development) +The LUA ATC Controller will operate by using LUA code. All operations shown above will have a function equivalent. Additionally all LUA ATC controllers share an environment and setting signal and switch status will be possible to allow for complicated railway systems/fully automated subways a.s.o. +Also planned: +- digicompute add-on to allow computer access to the ATC environment (railway maps... ... ... ... ...) diff --git a/advtrains/advtrains/couple.lua b/advtrains/advtrains/couple.lua new file mode 100644 index 0000000..974f450 --- /dev/null +++ b/advtrains/advtrains/couple.lua @@ -0,0 +1,156 @@ +--couple.lua +--defines couple entities. + +--advtrains:discouple +--set into existing trains to split them when punched. +--they are attached to the wagons. +--[[fields +wagon + +wagons keep their couple entity minetest-internal id inside the field discouple_id. if it refers to nowhere, they will spawn a new one if player is near +]] + + +minetest.register_entity("advtrains:discouple", { + visual="sprite", + textures = {"advtrains_discouple.png"}, + collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, + visual_size = {x=1, y=1}, + initial_sprite_basepos = {x=0, y=0}, + + is_discouple=true, + on_activate=function(self, staticdata) + if staticdata=="DISCOUPLE" then + --couple entities have no right to exist further... + self.object:remove() + return + end + self.object:set_armor_groups({immortal=1}) + end, + get_staticdata=function() return "DISCOUPLE" end, + on_punch=function(self, player) + --only if player owns at least one wagon next to this + local own=player:get_player_name() + if self.wagon.owner and self.wagon.owner==own then + local train=advtrains.trains[self.wagon.train_id] + local nextwgn_id=train.trainparts[self.wagon.pos_in_trainparts-1] + for aoi, le in pairs(minetest.luaentities) do + if le and le.is_wagon then + if le.unique_id==nextwgn_id then + if le.owner and le.owner~=own then + minetest.chat_send_player(own, "You need to own at least one neighboring wagon to destroy this couple.") + return + end + end + end + end + advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua + self.object:remove() + else + minetest.chat_send_player(own, "You need to own at least one neighboring wagon to destroy this couple.") + end + end, + on_step=function(self, dtime) + local t=os.clock() + if not self.wagon then + self.object:remove() + return + end + --getyaw seems to be a reliable method to check if an object is loaded...if it returns nil, it is not. + if not self.wagon.object:getyaw() then + self.object:remove() + return + end + local velocityvec=self.wagon.object:getvelocity() + self.updatepct_timer=(self.updatepct_timer or 0)-dtime + if not self.old_velocity_vector or not vector.equals(velocityvec, self.old_velocity_vector) or self.updatepct_timer<=0 then--only send update packet if something changed + local flipsign=self.wagon.wagon_flipped and -1 or 1 + self.object:setpos(vector.add(self.wagon.object:getpos(), {y=0, x=-math.sin(self.wagon.object:getyaw())*self.wagon.wagon_span*flipsign, z=math.cos(self.wagon.object:getyaw())*self.wagon.wagon_span*flipsign})) + self.object:setvelocity(velocityvec) + self.updatepct_timer=2 + end + printbm("discouple_step", t) + end, +}) + +--advtrains:couple +--when two trains overlap with their end-positions, this entity will be spawned and both trains set its id into appropiate fields for them to know when to free them again. The entity will destroy automatically when it recognizes that any of the trains left the common position. +--[[fields +train_id_1 +train_id_2 +train1_is_backpos +train2_is_backpos +]] + + +minetest.register_entity("advtrains:couple", { + visual="sprite", + textures = {"advtrains_couple.png"}, + collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, + visual_size = {x=1, y=1}, + initial_sprite_basepos = {x=0, y=0}, + + is_couple=true, + on_activate=function(self, staticdata) + if staticdata=="COUPLE" then + --couple entities have no right to exist further... + self.object:remove() + return + end + end, + get_staticdata=function(self) return "COUPLE" end, + on_rightclick=function(self) + if not self.train_id_1 or not self.train_id_2 then return end + + local id1, id2=self.train_id_1, self.train_id_2 + + if self.train1_is_backpos and not self.train2_is_backpos then + advtrains.do_connect_trains(id1, id2) + --case 2 (second train is front) + elseif self.train2_is_backpos and not self.train1_is_backpos then + advtrains.do_connect_trains(id2, id1) + --case 3 + elseif self.train1_is_backpos and self.train2_is_backpos then + advtrains.invert_train(id2) + advtrains.do_connect_trains(id1, id2) + --case 4 + elseif not self.train1_is_backpos and not self.train2_is_backpos then + advtrains.invert_train(id1) + advtrains.do_connect_trains(id1, id2) + end + self.object:remove() + end, + on_step=function(self, dtime) + local t=os.clock() + if not self.train_id_1 or not self.train_id_2 then print("wtf no train ids?")return end + local train1=advtrains.trains[self.train_id_1] + local train2=advtrains.trains[self.train_id_2] + if not train1 or not train2 or not train1.path or not train2.path or not train1.index or not train2.index then + self.object:remove() + return + end + + local tp1 + if not self.train1_is_backpos then + tp1=advtrains.get_real_index_position(train1.path, train1.index) + else + tp1=advtrains.get_real_index_position(train1.path, advtrains.get_train_end_index(train1)) + end + local tp2 + if not self.train2_is_backpos then + tp2=advtrains.get_real_index_position(train2.path, train2.index) + else + tp2=advtrains.get_real_index_position(train2.path, advtrains.get_train_end_index(train2)) + end + if not tp1 or not tp2 or not (vector.distance(tp1,tp2)<1.5) then + self.object:remove() + return + else + local pos_median=advtrains.pos_median(tp1, tp2) + if not vector.equals(pos_median, self.object:getpos()) then + self.object:setpos(pos_median) + end + end + printbm("couple step", t) + end, +}) diff --git a/advtrains/advtrains/crafting.lua b/advtrains/advtrains/crafting.lua new file mode 100644 index 0000000..5ba12ce --- /dev/null +++ b/advtrains/advtrains/crafting.lua @@ -0,0 +1,71 @@ +--advtrains by orwell96, see readme.txt and license.txt +--crafting.lua +--registers crafting recipes + +--tracks +minetest.register_craft({ + output = 'advtrains:dtrack_placer 50', + recipe = { + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + }, +}) +minetest.register_craft({ + type = "shapeless", + output = 'advtrains:dtrack_slopeplacer 2', + recipe = { + "advtrains:dtrack_placer", + "advtrains:dtrack_placer", + "default:gravel", + }, +}) + +minetest.register_craft({ + output = 'advtrains:dtrack_bumper_placer 2', + recipe = { + {'default:wood', 'dye:red'}, + {'default:steel_ingot', 'default:steel_ingot'}, + {'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, + }, +}) +minetest.register_craft({ + type="shapeless", + output = 'advtrains:dtrack_detector_off_placer', + recipe = { + "advtrains:dtrack_placer", + "mesecons:wire_00000000_off" + }, +}) +--signals +minetest.register_craft({ + output = 'advtrains:retrosignal_off 2', + recipe = { + {'dye:red', 'default:steel_ingot', 'default:steel_ingot'}, + {'', '', 'default:steel_ingot'}, + {'', '', 'default:steel_ingot'}, + }, +}) +minetest.register_craft({ + output = 'advtrains:signal_off 2', + recipe = { + {'', 'dye:red', 'default:steel_ingot'}, + {'', 'dye:dark_green', 'default:steel_ingot'}, + {'', '', 'default:steel_ingot'}, + }, +}) + +--trackworker +minetest.register_craft({ + output = 'advtrains:trackworker', + recipe = { + {'default:diamond'}, + {'screwdriver:screwdriver'}, + {'default:steel_ingot'}, + }, +}) + + + +--misc_nodes +--crafts for platforms see misc_nodes.lua diff --git a/advtrains/advtrains/damage.lua b/advtrains/advtrains/damage.lua new file mode 100644 index 0000000..b39fe67 --- /dev/null +++ b/advtrains/advtrains/damage.lua @@ -0,0 +1,26 @@ +--damage.lua +--a globalstep that damages players overrolled by trains. + +advtrains.player_to_train_mapping={} + +local tmr=0 +minetest.register_globalstep(function(dtime) + tmr=tmr-dtime + if tmr<=0 then + + for _, player in pairs(minetest.get_connected_players()) do + local pos=player:getpos() + for _, object in pairs(minetest.get_objects_inside_radius(pos, 1)) do + local le=object:get_luaentity() + if le and le.is_wagon and le.initialized and le:train() then + if (not advtrains.player_to_train_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_train_mapping[player:get_player_name()]) and math.abs(le:train().velocity)>2 then + --player:punch(object, 1000, {damage={fleshy=3*math.abs(le:train().velocity)}}) + player:set_hp(player:get_hp()-math.abs(le:train().velocity)-3) + end + end + end + end + + tmr=0.5 + end +end) diff --git a/advtrains/advtrains/debugitems.lua b/advtrains/advtrains/debugitems.lua new file mode 100644 index 0000000..b3164ff --- /dev/null +++ b/advtrains/advtrains/debugitems.lua @@ -0,0 +1,36 @@ +minetest.register_tool("advtrains:tunnelborer", +{ + description = "tunnelborer", + groups = {cracky=1}, -- key=name, value=rating; rating=1..3. + inventory_image = "drwho_screwdriver.png", + wield_image = "drwho_screwdriver.png", + stack_max = 1, + range = 7.0, + + on_place = function(itemstack, placer, pointed_thing) + + end, + --[[ + ^ Shall place item and return the leftover itemstack + ^ default: minetest.item_place ]] + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type=="node" then + for x=-1,1 do + for y=-1,1 do + for z=-1,1 do + minetest.remove_node(vector.add(pointed_thing.under, {x=x, y=y, z=z})) + end + end + end + end + end, +--[[ +^ default: nil +^ Function must return either nil if no item shall be removed from +inventory, or an itemstack to replace the original itemstack. +e.g. itemstack:take_item(); return itemstack +^ Otherwise, the function is free to do what it wants. +^ The default functions handle regular use cases. +]] +} +) diff --git a/advtrains/advtrains/depends.txt b/advtrains/advtrains/depends.txt new file mode 100644 index 0000000..20aa884 --- /dev/null +++ b/advtrains/advtrains/depends.txt @@ -0,0 +1,2 @@ +default +mesecons? \ No newline at end of file diff --git a/advtrains/advtrains/description.txt b/advtrains/advtrains/description.txt new file mode 100644 index 0000000..ecc5d58 --- /dev/null +++ b/advtrains/advtrains/description.txt @@ -0,0 +1,8 @@ +Advanced Trains v1.3.0, by orwell and contributors. Also see readme. +Good-looking, realistic trains for minetest. + +For crafting recipes, see manual.pdf + +Website: http://advtrains.bleipb.de/ +Manual: https://github.com/orwell96/advtrains/blob/master/manual.pdf +Forum : https://forum.minetest.net/viewtopic.php?f=11&t=14726 \ No newline at end of file diff --git a/advtrains/advtrains/helpers.lua b/advtrains/advtrains/helpers.lua new file mode 100644 index 0000000..1a02621 --- /dev/null +++ b/advtrains/advtrains/helpers.lua @@ -0,0 +1,248 @@ +--advtrains by orwell96, see readme.txt +local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end + +advtrains.dir_trans_tbl={ + [0]={x=0, z=1}, + [1]={x=1, z=2}, + [2]={x=1, z=1}, + [3]={x=2, z=1}, + [4]={x=1, z=0}, + [5]={x=2, z=-1}, + [6]={x=1, z=-1}, + [7]={x=1, z=-2}, + [8]={x=0, z=-1}, + [9]={x=-1, z=-2}, + [10]={x=-1, z=-1}, + [11]={x=-2, z=-1}, + [12]={x=-1, z=0}, + [13]={x=-2, z=1}, + [14]={x=-1, z=1}, + [15]={x=-1, z=2}, +} + +function advtrains.dirCoordSet(coord, dir) + local x,z + if advtrains.dir_trans_tbl[dir] then + x,z=advtrains.dir_trans_tbl[dir].x, advtrains.dir_trans_tbl[dir].z + else + error("advtrains: in helpers.lua/dirCoordSet() given dir="..(dir or "nil")) + end + return {x=coord.x+x, y=coord.y, z=coord.z+z} +end +function advtrains.dirToCoord(dir) + return advtrains.dirCoordSet({x=0, y=0, z=0}, dir) +end + +function advtrains.maxN(list, expectstart) + local n=expectstart or 0 + while list[n] do + n=n+1 + end + return n-1 +end + +function advtrains.minN(list, expectstart) + local n=expectstart or 0 + while list[n] do + n=n-1 + end + return n+1 +end + +--vertical_transmit: +--[[ +rely1, rely2 tell to which height the connections are pointed to. 1 means it will go up the next node + +]] + +function advtrains.conway(midreal, prev, drives_on)--in order prev,mid,return + local mid=advtrains.round_vector_floor_y(midreal) + + if not advtrains.get_rail_info_at(advtrains.round_vector_floor_y(prev), drives_on) then + return nil + end + + local midnode_ok, middir1, middir2, midrely1, midrely2=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(mid), drives_on) + if not midnode_ok then + return nil + end + + local next, chkdir, chkrely, y_offset + y_offset=0 + --print("[advtrains] in order mid1,mid2",middir1,middir2) + --try if it is dir1 + local cor1=advtrains.dirCoordSet(mid, middir2)--<<<< + if math.floor(cor1.x+0.5)==math.floor(prev.x+0.5) and math.floor(cor1.z+0.5)==math.floor(prev.z+0.5) then--this was previous + next=advtrains.dirCoordSet(mid, middir1) + if midrely1>=1 then + next.y=next.y+1 + --print("[advtrains]found midrely1 to be >=1: next is now "..(next and minetest.pos_to_string(next) or "nil")) + y_offset=1 + end + chkdir=middir1 + chkrely=midrely1 + --print("[advtrains]dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") + end + --dir2??? + local cor2=advtrains.dirCoordSet(mid, middir1)--<<<< + if math.floor(cor2.x+0.5)==math.floor(prev.x+0.5) and math.floor(cor2.z+0.5)==math.floor(prev.z+0.5) then + next=advtrains.dirCoordSet(mid, middir2)--dir2 wird überprüft, alles gut. + if midrely2>=1 then + next.y=next.y+1 + --print("[advtrains]found midrely2 to be >=1: next is now "..(next and minetest.pos_to_string(next) or "nil")) + y_offset=1 + end + chkdir=middir2 + chkrely=midrely2 + --print("[advtrains] dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") + end + --print("[advtrains]dir applied next pos: "..(next and minetest.pos_to_string(next) or "nil").."(chkdir is "..(chkdir or "nil")..", y-offset "..y_offset..")") + --is there a next + if not next then + --print("[advtrains]in conway: no next rail(nil), returning!") + return nil + end + + local nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) + + --is it a rail? + if(not nextnode_ok) then + --print("[advtrains]in conway: next "..minetest.pos_to_string(next).." not a rail, trying one node below!") + next.y=next.y-1 + y_offset=y_offset-1 + + nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) + if(not nextnode_ok) then + --print("[advtrains]in conway: one below "..minetest.pos_to_string(next).." is not a rail either, returning!") + return nil + end + end + + --is this next rail connecting to the mid? + if not ( (((nextdir1+8)%16)==chkdir and nextrely1==chkrely-y_offset) or (((nextdir2+8)%16)==chkdir and nextrely2==chkrely-y_offset) ) then + --print("[advtrains]in conway: next "..minetest.pos_to_string(next).." not connecting, trying one node below!") + next.y=next.y-1 + y_offset=y_offset-1 + + nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) + if(not nextnode_ok) then + --print("[advtrains]in conway: (at connecting if check again) one below "..minetest.pos_to_string(next).." is not a rail either, returning!") + return nil + end + if not ( (((nextdir1+8)%16)==chkdir and nextrely1==chkrely) or (((nextdir2+8)%16)==chkdir and nextrely2==chkrely) ) then + --print("[advtrains]in conway: one below "..minetest.pos_to_string(next).." rail not connecting, returning!") + --print("[advtrains] in order mid1,2,next1,2,chkdir "..middir1.." "..middir2.." "..nextdir1.." "..nextdir2.." "..chkdir) + return nil + end + end + + --print("[advtrains]conway found rail.") + return vector.add(advtrains.round_vector_floor_y(next), {x=0, y=nextrailheight, z=0}), chkdir +end +--TODO use this +function advtrains.oppd(dir) + return ((dir+8)%16) +end + +function advtrains.round_vector_floor_y(vec) + return {x=math.floor(vec.x+0.5), y=math.floor(vec.y), z=math.floor(vec.z+0.5)} +end + +function advtrains.yawToDirection(yaw, conn1, conn2) + if not conn1 or not conn2 then + error("given nil to yawToDirection: conn1="..(conn1 or "nil").." conn2="..(conn1 or "nil")) + end + local yaw1=math.pi*(conn1/4) + local yaw2=math.pi*(conn2/4) + if advtrains.minAngleDiffRad(yaw, yaw1) if weird behavior + return conn2 + else + return conn1 + end +end + +function advtrains.minAngleDiffRad(r1, r2) + local try1=r2-r1 + local try2=(r2+2*math.pi)-r1 + local try3=r2-(r1+2*math.pi) + if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try1) then + return try1 + end + if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try2) then + return try2 + end + if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try3) then + return try3 + end +end +function advtrains.dumppath(path) + if not path then print("dumppath: no path(nil)") return end + local min=advtrains.minN(path) + local max=advtrains.maxN(path) + for i=min, max do print("["..i.."] "..(path[i] and minetest.pos_to_string(path[i]) or "nil")) end +end + +function advtrains.merge_tables(a, ...) + local new={} + for _,t in ipairs({a,...}) do + for k,v in pairs(t) do new[k]=v end + end + return new +end +function advtrains.yaw_from_3_positions(prev, curr, next) + local pts=minetest.pos_to_string + --print("p3 "..pts(prev)..pts(curr)..pts(next)) + local prev2curr=math.atan2((curr.x-prev.x), (prev.z-curr.z)) + local curr2next=math.atan2((next.x-curr.x), (curr.z-next.z)) + --print("y3 "..(prev2curr*360/(2*math.pi)).." "..(curr2next*360/(2*math.pi))) + return prev2curr+(advtrains.minAngleDiffRad(prev2curr, curr2next)/2) +end +function advtrains.get_wagon_yaw(front, first, second, back, pct) + local pts=minetest.pos_to_string + --print("p "..pts(front)..pts(first)..pts(second)..pts(back)) + local y2=advtrains.yaw_from_3_positions(second, first, front) + local y1=advtrains.yaw_from_3_positions(back, second, first) + --print("y "..(y1*360/(2*math.pi)).." "..(y2*360/(2*math.pi))) + return y1+advtrains.minAngleDiffRad(y1, y2)*pct +end +function advtrains.get_real_index_position(path, index) + if not path or not index then return end + + local first_pos=path[math.floor(index)] + local second_pos=path[math.floor(index)+1] + + if not first_pos or not second_pos then return nil end + + local factor=index-math.floor(index) + local actual_pos={x=first_pos.x-(first_pos.x-second_pos.x)*factor, y=first_pos.y-(first_pos.y-second_pos.y)*factor, z=first_pos.z-(first_pos.z-second_pos.z)*factor,} + return actual_pos +end +function advtrains.pos_median(pos1, pos2) + return {x=pos1.x-(pos1.x-pos2.x)*0.5, y=pos1.y-(pos1.y-pos2.y)*0.5, z=pos1.z-(pos1.z-pos2.z)*0.5} +end +function advtrains.abs_ceil(i) + return math.ceil(math.abs(i))*math.sign(i) +end + +function advtrains.serialize_inventory(inv) + local ser={} + local liszts=inv:get_lists() + for lisztname, liszt in pairs(liszts) do + ser[lisztname]={} + for idx, item in ipairs(liszt) do + local istring=item:to_string() + if istring~="" then + ser[lisztname][idx]=istring + end + end + end + return minetest.serialize(ser) +end +function advtrains.deserialize_inventory(sers, inv) + local ser=minetest.deserialize(sers) + if ser then + inv:set_lists(ser) + return true + end + return false +end diff --git a/advtrains/advtrains/init.lua b/advtrains/advtrains/init.lua new file mode 100644 index 0000000..33aa962 --- /dev/null +++ b/advtrains/advtrains/init.lua @@ -0,0 +1,40 @@ +--advtrains + +advtrains={} + +advtrains.modpath = minetest.get_modpath("advtrains") + +print=function(t, ...) minetest.log("action", table.concat({t, ...}, " ")) minetest.chat_send_all(table.concat({t, ...}, " ")) end +sid=function(id) return string.sub(id, -4) end + +dofile(advtrains.modpath.."/helpers.lua"); +dofile(advtrains.modpath.."/debugitems.lua"); + +advtrains.meseconrules = +{{x=0, y=0, z=-1}, + {x=1, y=0, z=0}, + {x=-1, y=0, z=0}, + {x=0, y=0, z=1}, + {x=1, y=1, z=0}, + {x=1, y=-1, z=0}, + {x=-1, y=1, z=0}, + {x=-1, y=-1, z=0}, + {x=0, y=1, z=1}, + {x=0, y=-1, z=1}, + {x=0, y=1, z=-1}, + {x=0, y=-1, z=-1}, + {x=0, y=-2, z=0}} +dofile(advtrains.modpath.."/trainlogic.lua") +dofile(advtrains.modpath.."/trainhud.lua") +dofile(advtrains.modpath.."/trackplacer.lua") +dofile(advtrains.modpath.."/tracks.lua") +dofile(advtrains.modpath.."/atc.lua") +dofile(advtrains.modpath.."/wagons.lua") + +dofile(advtrains.modpath.."/pseudoload.lua") +dofile(advtrains.modpath.."/couple.lua") +dofile(advtrains.modpath.."/damage.lua") + +dofile(advtrains.modpath.."/signals.lua") +dofile(advtrains.modpath.."/misc_nodes.lua") +dofile(advtrains.modpath.."/crafting.lua") diff --git a/advtrains/advtrains/misc_nodes.lua b/advtrains/advtrains/misc_nodes.lua new file mode 100644 index 0000000..93829f0 --- /dev/null +++ b/advtrains/advtrains/misc_nodes.lua @@ -0,0 +1,67 @@ +--all nodes that do not fit in any other category + +function advtrains.register_platform(preset) + local ndef=minetest.registered_nodes[preset] + if not ndef then + minetest.log("warning", "[advtrains] register_platform couldn't find preset node "..preset) + return + end + local btex=ndef.tiles + if type(btex)=="table" then + btex=btex[1] + end + local desc=ndef.description or "" + local nodename=string.match(preset, ":(.+)$") + minetest.register_node("advtrains:platform_low_"..nodename, { + description = desc.." Platform (low)", + tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, + groups = {cracky = 1, not_blocking_trains = 1, platform=1}, + sounds = default.node_sound_stone_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.1, -0.1, 0.5, 0 , 0.5}, + {-0.5, -0.5, 0 , 0.5, -0.1, 0.5} + }, + }, + paramtype2="facedir", + paramtype = "light", + sunlight_propagates = true, + }) + minetest.register_node("advtrains:platform_high_"..nodename, { + description = desc.." Platform (high)", + tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, + groups = {cracky = 1, not_blocking_trains = 1, platform=2}, + sounds = default.node_sound_stone_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, 0.3, -0.1, 0.5, 0.5, 0.5}, + {-0.5, -0.5, 0 , 0.5, 0.3, 0.5} + }, + }, + paramtype2="facedir", + paramtype = "light", + sunlight_propagates = true, + }) + minetest.register_craft({ + type="shapeless", + output = "advtrains:platform_high_"..nodename.." 4", + recipe = { + "dye:yellow", preset, preset + }, + }) + minetest.register_craft({ + type="shapeless", + output = "advtrains:platform_low_"..nodename.." 4", + recipe = { + "dye:yellow", preset + }, + }) +end + + +advtrains.register_platform("default:stonebrick") +advtrains.register_platform("default:sandstonebrick") diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d new file mode 100644 index 0000000..a6d9745 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d new file mode 100644 index 0000000..5f5b3f4 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d new file mode 100644 index 0000000..f13ae75 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d new file mode 100644 index 0000000..59a2285 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr.b3d new file mode 100644 index 0000000..159717e Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_cr.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d new file mode 100644 index 0000000..09cdb1f Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d new file mode 100644 index 0000000..176da81 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d new file mode 100644 index 0000000..00313c8 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_detector_st.b3d b/advtrains/advtrains/models/advtrains_dtrack_detector_st.b3d new file mode 100644 index 0000000..6762bc3 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_detector_st.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_detector_st_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_detector_st_30.b3d new file mode 100644 index 0000000..f2d5991 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_detector_st_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_detector_st_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_detector_st_45.b3d new file mode 100644 index 0000000..9ecb4a6 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_detector_st_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_detector_st_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_detector_st_60.b3d new file mode 100644 index 0000000..bd102cb Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_detector_st_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st.b3d b/advtrains/advtrains/models/advtrains_dtrack_st.b3d new file mode 100644 index 0000000..f3e2753 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_st.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d new file mode 100644 index 0000000..7a35c8d Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d new file mode 100644 index 0000000..b2a1702 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d new file mode 100644 index 0000000..0a59f77 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d new file mode 100644 index 0000000..1adc23f Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d new file mode 100644 index 0000000..7d8373b Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d new file mode 100644 index 0000000..9679b9e Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d new file mode 100644 index 0000000..3efc924 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d new file mode 100644 index 0000000..93841a4 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d new file mode 100644 index 0000000..e9a90c7 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d new file mode 100644 index 0000000..49c707c Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d new file mode 100644 index 0000000..c9a6ffe Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d new file mode 100644 index 0000000..ee29b62 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d new file mode 100644 index 0000000..ba065e1 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d new file mode 100644 index 0000000..7f9dc43 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d new file mode 100644 index 0000000..b8ffa61 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d new file mode 100644 index 0000000..0b3e7ad Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d new file mode 100644 index 0000000..4aea19b Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d new file mode 100644 index 0000000..4182fe5 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d new file mode 100644 index 0000000..6d2c891 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst1.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst1.b3d new file mode 100644 index 0000000..c9d7427 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst1.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst1_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst1_45.b3d new file mode 100644 index 0000000..14d438c Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst1_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst2.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst2.b3d new file mode 100644 index 0000000..c128650 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst2.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst2_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst2_45.b3d new file mode 100644 index 0000000..263276d Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst2_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst31.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst31.b3d new file mode 100644 index 0000000..df0f383 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst31.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst32.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst32.b3d new file mode 100644 index 0000000..01d2978 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst32.b3d differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst33.b3d b/advtrains/advtrains/models/advtrains_dtrack_vst33.b3d new file mode 100644 index 0000000..7fe418d Binary files /dev/null and b/advtrains/advtrains/models/advtrains_dtrack_vst33.b3d differ diff --git a/advtrains/advtrains/models/advtrains_modernwagon.b3d b/advtrains/advtrains/models/advtrains_modernwagon.b3d new file mode 100644 index 0000000..aacddca Binary files /dev/null and b/advtrains/advtrains/models/advtrains_modernwagon.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off.b3d new file mode 100644 index 0000000..3d231dd Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_off.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d new file mode 100644 index 0000000..da258e1 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d new file mode 100644 index 0000000..338224a Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d new file mode 100644 index 0000000..c560ca1 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on.b3d new file mode 100644 index 0000000..3d19439 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_on.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d new file mode 100644 index 0000000..98f8a92 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d new file mode 100644 index 0000000..414e121 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d new file mode 100644 index 0000000..a51529a Binary files /dev/null and b/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_signal.b3d b/advtrains/advtrains/models/advtrains_signal.b3d new file mode 100644 index 0000000..7f69560 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_signal.b3d differ diff --git a/advtrains/advtrains/models/advtrains_signal_30.b3d b/advtrains/advtrains/models/advtrains_signal_30.b3d new file mode 100644 index 0000000..0b949a7 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_signal_30.b3d differ diff --git a/advtrains/advtrains/models/advtrains_signal_45.b3d b/advtrains/advtrains/models/advtrains_signal_45.b3d new file mode 100644 index 0000000..ccaebf4 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_signal_45.b3d differ diff --git a/advtrains/advtrains/models/advtrains_signal_60.b3d b/advtrains/advtrains/models/advtrains_signal_60.b3d new file mode 100644 index 0000000..cf41e6d Binary files /dev/null and b/advtrains/advtrains/models/advtrains_signal_60.b3d differ diff --git a/advtrains/advtrains/models/advtrains_track_cr.b3d b/advtrains/advtrains/models/advtrains_track_cr.b3d new file mode 100644 index 0000000..b0f5e4b Binary files /dev/null and b/advtrains/advtrains/models/advtrains_track_cr.b3d differ diff --git a/advtrains/advtrains/models/advtrains_track_st.b3d b/advtrains/advtrains/models/advtrains_track_st.b3d new file mode 100644 index 0000000..10b5d90 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_track_st.b3d differ diff --git a/advtrains/advtrains/models/advtrains_track_st_45.b3d b/advtrains/advtrains/models/advtrains_track_st_45.b3d new file mode 100644 index 0000000..32505a1 Binary files /dev/null and b/advtrains/advtrains/models/advtrains_track_st_45.b3d differ diff --git a/advtrains/advtrains/models/trackplane.b3d b/advtrains/advtrains/models/trackplane.b3d new file mode 100644 index 0000000..b4728c3 Binary files /dev/null and b/advtrains/advtrains/models/trackplane.b3d differ diff --git a/advtrains/advtrains/pseudoload.lua b/advtrains/advtrains/pseudoload.lua new file mode 100644 index 0000000..677cd14 --- /dev/null +++ b/advtrains/advtrains/pseudoload.lua @@ -0,0 +1,182 @@ +local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end + +--pseudoload.lua +--responsible for keeping up a database of all rail nodes existant in the world, regardless of whether the mapchunk is loaded. + +advtrains.trackdb={} +--trackdb[tt][y][x][z]={conn1, conn2, rely1, rely2, railheight} +--serialization format: +--(2byte x)(2byte y)(2byte z)(4bits conn1, 4bits conn2)[(plain rely1)|(plain rely2)|(plain railheight)]\n +--[] may be missing if 0,0,0 + +--load initially + +--[[ TODO temporary outcomment + +--delayed since all traintypes need to be registered +minetest.after(0, function() + +for tt, _ in pairs(advtrains.all_traintypes) do + local pl_fpath=minetest.get_worldpath().."/advtrains_trackdb_"..tt + advtrains.trackdb[tt]={} + local file, err = io.open(pl_fpath, "r") + if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed loading advtrains trackdb save file "..er) + else + --custom format to save memory + while true do + local xbytes=file:read(2) + if not xbytes or #xbytes<2 then + break --eof reached + end + print(xbytes) + local ybytes=file:read(2) + local zbytes=file:read(2) + local x=(string.byte(xbytes[1])-128)*256+(string.byte(xbytes[2])) + local y=(string.byte(ybytes[1])-128)*256+(string.byte(ybytes[2])) + local z=(string.byte(zbytes[1])-128)*256+(string.byte(zbytes[2])) + + local conn1=string.byte(file:read(1)) + local conn1=string.byte(file:read(1)) + + if not advtrains.trackdb[tt][y] then advtrains.trackdb[tt][y]={} end + if not advtrains.trackdb[tt][y][x] then advtrains.trackdb[tt][y][x]={} end + + local rest=file.read("*l") + if rest~="" then + local rely1, rely2, railheight=string.match(rest, "([^|]+)|([^|]+)|([^|]+)") + if rely1 and rely2 and railheight then + advtrains.trackdb[tt][y][x][z]={ + conn1=conn1, conn2=conn2, + rely1=rely1, rely2=rely2, + railheight=railheight + } + else + advtrains.trackdb[tt][y][x][z]={ + conn1=conn1, conn2=conn2 + } + end + else + advtrains.trackdb[tt][y][x][z]={ + conn1=conn1, conn2=conn2 + } + end + end + file:close() + end +end + +--end minetest.after +end) + +function advtrains.save_trackdb() + for tt, _ in pairs(advtrains.all_traintypes) do + local pl_fpath=minetest.get_worldpath().."/advtrains_trackdb_"..tt + local file, err = io.open(pl_fpath, "w") + if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed saving advtrains trackdb save file "..er) + else + --custom format to save memory + for y,tyl in pairs(advtrains.trackdb[tt]) do + for x,txl in pairs(tyl) do + for z,rail in pairs(txl) do + print("write "..x.." "..y.." "..z.." "..minetest.serialize(rail)) + file:write(string.char(math.floor(x/256)+128)..string.char((x%256))) + file:write(string.char(math.floor(y/256)+128)..string.char((y%256))) + file:write(string.char(math.floor(z/256)+128)..string.char((z%256))) + file:write(string.char(rail.conn1)) + file:write(string.char(rail.conn2)) + if (rail.rely1 and rail.rely1~=0) or (rail.rely2 and rail.rely2~=0) or (rail.railheight and rail.railheight~=0) then + file:write(rail.rely1.."|"..rail.rely2.."|"..rail.railheight) + end + file:write("\n") + end + end + end + file:close() + end + end +end +]]--end temp outcomment +advtrains.trackdb={} +advtrains.fpath_tdb=minetest.get_worldpath().."/advtrains_trackdb2" +local file, err = io.open(advtrains.fpath_tdb, "r") +if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed loading advtrains save file "..er) +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.trackdb=tbl + end + file:close() +end +function advtrains.save_trackdb() + local datastr = minetest.serialize(advtrains.trackdb) + if not datastr then + minetest.log("error", "[advtrains] Failed to serialize trackdb data!") + return + end + local file, err = io.open(advtrains.fpath_tdb, "w") + if err then + return err + end + file:write(datastr) + file:close() +end + +--get_node with pseudoload. +--returns: +--true, conn1, conn2, rely1, rely2, railheight in case everything's right. +--false if it's not a rail or the train does not drive on this rail, but it is loaded or +--nil if the node is neither loaded nor in trackdb +--the distraction between false and nil will be needed only in special cases.(train initpos) +function advtrains.get_rail_info_at(pos, drives_on) + local node=minetest.get_node_or_nil(pos) + if not node then + --try raildb + local rdp=vector.round(pos) + local dbe=(advtrains.trackdb[traintype] and advtrains.trackdb[traintype][rdp.y] and advtrains.trackdb[traintype][rdp.y][rdp.x] and advtrains.trackdb[traintype][rdp.y][rdp.x][rdp.z]) + if dbe then + for tt,_ in pairs(drives_on) do + if not dbe.tracktype or tt==dbe.tracktype then + return true, dbe.conn1, dbe.conn2, dbe.rely1 or 0, dbe.rely2 or 0, dbe.railheight or 0 + end + end + else + return nil + end + end + local nodename=node.name + if(not advtrains.is_track_and_drives_on(nodename, drives_on)) then + return false + end + local conn1, conn2, rely1, rely2, railheight, tracktype=advtrains.get_track_connections(node.name, node.param2) + + --already in trackdb? + local rdp=vector.round(pos) + if not (advtrains.trackdb and advtrains.trackdb[rdp.y] and advtrains.trackdb[rdp.y][rdp.x] and advtrains.trackdb[rdp.y][rdp.x][rdp.z]) then--TODO is this necessary? + if not advtrains.trackdb then advtrains.trackdb={} end + if not advtrains.trackdb[rdp.y] then advtrains.trackdb[rdp.y]={} end + if not advtrains.trackdb[rdp.y][rdp.x] then advtrains.trackdb[rdp.y][rdp.x]={} end + advtrains.trackdb[rdp.y][rdp.x][rdp.z]={ + conn1=conn1, conn2=conn2, + rely1=rely1, rely2=rely2, + railheight=railheight, tracktype=tracktype + } + end + + return true, conn1, conn2, rely1, rely2, railheight +end +function advtrains.reset_trackdb_position(pos) + local rdp=vector.round(pos) + if not advtrains.trackdb then advtrains.trackdb={} end + if not advtrains.trackdb[rdp.y] then advtrains.trackdb[rdp.y]={} end + if not advtrains.trackdb[rdp.y][rdp.x] then advtrains.trackdb[rdp.y][rdp.x]={} end + advtrains.trackdb[rdp.y][rdp.x][rdp.z]=nil + advtrains.get_rail_info_at(pos, advtrains.all_tracktypes)--to restore it. +end + + diff --git a/advtrains/advtrains/readme.txt b/advtrains/advtrains/readme.txt new file mode 100644 index 0000000..ad093bd --- /dev/null +++ b/advtrains/advtrains/readme.txt @@ -0,0 +1,23 @@ + +## ADVTRAINS ## realistic trains in Minetest! +by orwell96 and contributors(see below) + +For up-to-date information, visit https://forum.minetest.net/viewtopic.php?f=9&t=14726 + + +Manual: +If manual.pdf is not present (which is the case when you downloaded the zip file), see https://github.com/orwell96/advtrains/blob/master/manual.pdf + +License of code: LGPL 2.1 +License of media: CC-BY-NC-SA 3.0 + +Contributions: + +Gravel Texture : from Minetest Game +Initial rail model/texture : DS-minetest +Models for signals/bumpers : mbb +Steam engine / wagon texture: mbb +Industrial engine/wagons : mbb +Inventory images : mbb +Small code contributions : NaruTrey / gpcf +Mod Description : hajo \ No newline at end of file diff --git a/advtrains/advtrains/signals.lua b/advtrains/advtrains/signals.lua new file mode 100644 index 0000000..8be65e0 --- /dev/null +++ b/advtrains/advtrains/signals.lua @@ -0,0 +1,76 @@ +--advtrains by orwell96 +--signals.lua +for r,f in pairs({on="off", off="on"}) do + + advtrains.trackplacer.register_tracktype("advtrains:retrosignal", "") + advtrains.trackplacer.register_tracktype("advtrains:signal", "") + + for rotid, rotation in ipairs({"", "_30", "_45", "_60"}) do + local crea=1 + if rotid==1 and r=="off" then crea=0 end + + minetest.register_node("advtrains:retrosignal_"..r..rotation, { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4}, + }, + mesh = "advtrains_retrosignal_"..r..rotation..".b3d", + tiles = {"advtrains_retrosignal.png"}, + inventory_image="advtrains_retrosignal_inv.png", + drop="advtrains:retrosignal_off", + description="Lampless Signal ("..r..rotation..")", + on_rightclick=switchfunc, + sunlight_propagates=true, + groups = { + choppy=3, + not_blocking_trains=1, + not_in_creative_inventory=crea, + }, + mesecons = {effector = { + ["action_"..f] = function (pos, node) + minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f..rotation, param2 = node.param2}) + end + }}, + on_rightclick=function(pos, node, clicker) + minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f..rotation, param2 = node.param2}) + end, + }) + advtrains.trackplacer.add_worked("advtrains:retrosignal", r, rotation, nil) + minetest.register_node("advtrains:signal_"..r..rotation, { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4}, + }, + mesh = "advtrains_signal"..rotation..".b3d", + tiles = {"advtrains_signal_"..r..".png"}, + inventory_image="advtrains_signal_inv.png", + drop="advtrains:signal_off", + description="Signal ("..r..rotation..")", + on_rightclick=switchfunc, + groups = { + choppy=3, + not_blocking_trains=1, + not_in_creative_inventory=crea, + }, + light_source = 1, + sunlight_propagates=true, + mesecons = {effector = { + ["action_"..f] = function (pos, node) + minetest.swap_node(pos, {name = "advtrains:signal_"..f..rotation, param2 = node.param2}) + end + }}, + on_rightclick=function(pos, node, clicker) + minetest.swap_node(pos, {name = "advtrains:signal_"..f..rotation, param2 = node.param2}) + end, + }) + advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil) + end +end diff --git a/advtrains/advtrains/textures/advtrains_couple.png b/advtrains/advtrains/textures/advtrains_couple.png new file mode 100644 index 0000000..9e997e4 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_couple.png differ diff --git a/advtrains/advtrains/textures/advtrains_discouple.png b/advtrains/advtrains/textures/advtrains_discouple.png new file mode 100644 index 0000000..b27c4fb Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_discouple.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png new file mode 100644 index 0000000..31c2b30 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png new file mode 100644 index 0000000..27191fe Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png new file mode 100644 index 0000000..e6c6ad6 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_placer.png new file mode 100644 index 0000000..7bef8a9 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_placer.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_rail.png b/advtrains/advtrains/textures/advtrains_dtrack_rail.png new file mode 100644 index 0000000..1cf7f83 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_rail.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_rail_atc.png b/advtrains/advtrains/textures/advtrains_dtrack_rail_atc.png new file mode 100644 index 0000000..d171985 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_rail_atc.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_rail_detector_on.png b/advtrains/advtrains/textures/advtrains_dtrack_rail_detector_on.png new file mode 100644 index 0000000..4f09b35 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_rail_detector_on.png differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png b/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png new file mode 100644 index 0000000..1d456b0 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png differ diff --git a/advtrains/advtrains/textures/advtrains_platform.png b/advtrains/advtrains/textures/advtrains_platform.png new file mode 100644 index 0000000..5ba9663 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_platform.png differ diff --git a/advtrains/advtrains/textures/advtrains_retrosignal.png b/advtrains/advtrains/textures/advtrains_retrosignal.png new file mode 100644 index 0000000..141198d Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_retrosignal.png differ diff --git a/advtrains/advtrains/textures/advtrains_retrosignal_inv.png b/advtrains/advtrains/textures/advtrains_retrosignal_inv.png new file mode 100644 index 0000000..1036594 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_retrosignal_inv.png differ diff --git a/advtrains/advtrains/textures/advtrains_signal_inv.png b/advtrains/advtrains/textures/advtrains_signal_inv.png new file mode 100644 index 0000000..ed64ed9 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_signal_inv.png differ diff --git a/advtrains/advtrains/textures/advtrains_signal_off.png b/advtrains/advtrains/textures/advtrains_signal_off.png new file mode 100644 index 0000000..8046e52 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_signal_off.png differ diff --git a/advtrains/advtrains/textures/advtrains_signal_on.png b/advtrains/advtrains/textures/advtrains_signal_on.png new file mode 100644 index 0000000..5228bb3 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_signal_on.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_cr.png b/advtrains/advtrains/textures/advtrains_track_cr.png new file mode 100644 index 0000000..40f0cc5 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_cr.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_cr_45.png b/advtrains/advtrains/textures/advtrains_track_cr_45.png new file mode 100644 index 0000000..54966b3 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_cr_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_placer.png b/advtrains/advtrains/textures/advtrains_track_placer.png new file mode 100644 index 0000000..03e17ed Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_placer.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_st.png b/advtrains/advtrains/textures/advtrains_track_st.png new file mode 100644 index 0000000..5ad7e4f Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_st.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_st_45.png b/advtrains/advtrains/textures/advtrains_track_st_45.png new file mode 100644 index 0000000..63b4c96 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_st_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlcr.png b/advtrains/advtrains/textures/advtrains_track_swlcr.png new file mode 100644 index 0000000..d9b5c0b Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swlcr.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlcr_45.png b/advtrains/advtrains/textures/advtrains_track_swlcr_45.png new file mode 100644 index 0000000..f098fc9 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swlcr_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlst.png b/advtrains/advtrains/textures/advtrains_track_swlst.png new file mode 100644 index 0000000..314bd2d Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swlst.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlst_45.png b/advtrains/advtrains/textures/advtrains_track_swlst_45.png new file mode 100644 index 0000000..765d0ec Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swlst_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrcr.png b/advtrains/advtrains/textures/advtrains_track_swrcr.png new file mode 100644 index 0000000..f74e1bc Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swrcr.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrcr_45.png b/advtrains/advtrains/textures/advtrains_track_swrcr_45.png new file mode 100644 index 0000000..fa432aa Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swrcr_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrst.png b/advtrains/advtrains/textures/advtrains_track_swrst.png new file mode 100644 index 0000000..06ea29e Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swrst.png differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrst_45.png b/advtrains/advtrains/textures/advtrains_track_swrst_45.png new file mode 100644 index 0000000..be477b7 Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_track_swrst_45.png differ diff --git a/advtrains/advtrains/textures/advtrains_trackworker.png b/advtrains/advtrains/textures/advtrains_trackworker.png new file mode 100644 index 0000000..b50bcae Binary files /dev/null and b/advtrains/advtrains/textures/advtrains_trackworker.png differ diff --git a/advtrains/advtrains/textures/drwho_screwdriver.png b/advtrains/advtrains/textures/drwho_screwdriver.png new file mode 100644 index 0000000..b50bcae Binary files /dev/null and b/advtrains/advtrains/textures/drwho_screwdriver.png differ diff --git a/advtrains/advtrains/trackplacer.lua b/advtrains/advtrains/trackplacer.lua new file mode 100644 index 0000000..b24103a --- /dev/null +++ b/advtrains/advtrains/trackplacer.lua @@ -0,0 +1,297 @@ +--trackplacer.lua +--holds code for the track-placing system. the default 'track' item will be a craftitem that places rails as needed. this will neither place or change switches nor place vertical rails. + +--all new trackplacer code +local tp={ + tracks={} +} + +function tp.register_tracktype(nnprefix, n_suffix) + tp.tracks[nnprefix]={ + default=n_suffix, + single_conn={}, + double_conn={}, + --keys:conn1_conn2 (example:1_4) + --values:{name=x, param2=x} + twcycle={}, + twrotate={},--indexed by suffix, list, tells order of rotations + modify={} + } +end +function tp.add_double_conn(nnprefix, suffix, rotation, conns) + local nodename=nnprefix.."_"..suffix..rotation + for i=0,3 do + tp.tracks[nnprefix].double_conn[((conns.conn1+4*i)%16).."_"..((conns.conn2+4*i)%16)]={name=nodename, param2=i} + tp.tracks[nnprefix].double_conn[((conns.conn2+4*i)%16).."_"..((conns.conn1+4*i)%16)]={name=nodename, param2=i} + end + tp.tracks[nnprefix].modify[nodename]=true +end +function tp.add_single_conn(nnprefix, suffix, rotation, conns) + local nodename=nnprefix.."_"..suffix..rotation + for i=0,3 do + tp.tracks[nnprefix].single_conn[((conns.conn1+4*i)%16)]={name=nodename, param2=i} + tp.tracks[nnprefix].single_conn[((conns.conn2+4*i)%16)]={name=nodename, param2=i} + end + tp.tracks[nnprefix].modify[nodename]=true +end + +function tp.add_worked(nnprefix, suffix, rotation, cycle_follows) + tp.tracks[nnprefix].twcycle[suffix]=cycle_follows + if not tp.tracks[nnprefix].twrotate[suffix] then tp.tracks[nnprefix].twrotate[suffix]={} end + table.insert(tp.tracks[nnprefix].twrotate[suffix], rotation) +end + + +--[[ + rewrite algorithm. + selection criteria: these will never be changed or even selected: + - tracks being already connected on both sides + - tracks that are already connected on one side but are not bendable to the desired position + the following situations can occur: + 1. there are two more than two rails around + 1.1 there is one or more subset(s) that can be directly connected + -> choose the first possibility + 2.2 not + -> choose the first one and orient straight + 2. there's exactly 1 rail around + -> choose and orient straight + 3. there's no rail around + -> set straight +]] +function tp.find_already_connected(pos)--TODO vertical calculations(check node below) + local function istrackandbc(pos, conn) + local cnode=minetest.get_node(advtrains.dirCoordSet(pos, conn)) + local bconn=(conn+8)%16 + if advtrains.is_track_and_drives_on(cnode.name, advtrains.all_tracktypes) then + local cconn1, cconn2=advtrains.get_track_connections(cnode.name, cnode.param2) + return cconn1==bconn or cconn2==bconn + end + return false + end + local dnode=minetest.get_node(pos) + local dconn1, dconn2=advtrains.get_track_connections(dnode.name, dnode.param2) + local t={[true]="true", [false]="false"} + if istrackandbc(pos, dconn1) and istrackandbc(pos, dconn2) then return dconn1, dconn2 + elseif istrackandbc(pos, dconn1) then return dconn1 + elseif istrackandbc(pos, dconn2) then return dconn2 + end + return nil +end +function tp.rail_and_can_be_bent(originpos, conn, nnpref) + local pos=advtrains.dirCoordSet(originpos, conn) + local newdir=(conn+8)%16 + local node=minetest.get_node(pos) + local tr=tp.tracks[nnpref] + if not advtrains.is_track_and_drives_on(node.name, advtrains.all_tracktypes) then + return false + end + --rail at other end? + local adj1, adj2=tp.find_already_connected(pos) + if adj1 and adj2 then + return false--dont destroy existing track + elseif adj1 and not adj2 then + if tr.double_conn[adj1.."_"..newdir] then + return true--if exists, connect new rail and old end + end + return false + else + if tr.single_conn[newdir] then--just rotate old rail to right orientation + return true + end + return false + end +end +function tp.bend_rail(originpos, conn, nnpref) + local pos=advtrains.dirCoordSet(originpos, conn) + local newdir=(conn+8)%16 + local node=minetest.get_node(pos) + local tr=tp.tracks[nnpref] + --is rail already connected? no need to bend. + local conn1, conn2=advtrains.get_track_connections(node.name, node.param2) + if newdir==conn1 or newdir==conn2 then + return + end + --rail at other end? + local adj1, adj2=tp.find_already_connected(pos) + if adj1 and adj2 then + return false--dont destroy existing track + elseif adj1 and not adj2 then + if tr.double_conn[adj1.."_"..newdir] then + minetest.set_node(pos, tr.double_conn[adj1.."_"..newdir]) + return true--if exists, connect new rail and old end + end + return false + else + if tr.single_conn[newdir] then--just rotate old rail to right orientation + minetest.set_node(pos, tr.single_conn[newdir]) + return true + end + return false + end +end +function tp.placetrack(pos, nnpref, placer, itemstack, pointed_thing) + --1. find all rails that are likely to be connected + local tr=tp.tracks[nnpref] + local p_rails={} + for i=0,15 do + if tp.rail_and_can_be_bent(pos, i, nnpref) then + p_rails[#p_rails+1]=i + end + end + if #p_rails==0 then + minetest.set_node(pos, {name=nnpref.."_"..tr.default}) + if minetest.registered_nodes[nnpref.."_"..tr.default] and minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node then + minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node(pos, placer, itemstack, pointed_thing) + end + elseif #p_rails==1 then + tp.bend_rail(pos, p_rails[1], nnpref) + minetest.set_node(pos, tr.single_conn[p_rails[1]]) + local nname=tr.single_conn[p_rails[1]].name + if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then + minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) + end + else + --iterate subsets + for k1, conn1 in ipairs(p_rails) do + for k2, conn2 in ipairs(p_rails) do + if k1~=k2 then + if (tr.double_conn[conn1.."_"..conn2]) then + tp.bend_rail(pos, conn1, nnpref) + tp.bend_rail(pos, conn2, nnpref) + minetest.set_node(pos, tr.double_conn[conn1.."_"..conn2]) + local nname=tr.double_conn[conn1.."_"..conn2].name + if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then + minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) + end + return + end + end + end + end + --not found + tp.bend_rail(pos, p_rails[1], nnpref) + minetest.set_node(pos, tr.single_conn[p_rails[1]]) + local nname=tr.single_conn[p_rails[1]].name + if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then + minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) + end + end +end + + +function tp.register_track_placer(nnprefix, imgprefix, dispname) + minetest.register_craftitem(nnprefix.."_placer",{ + description = dispname, + inventory_image = imgprefix.."_placer.png", + wield_image = imgprefix.."_placer.png", + groups={}, + on_place = function(itemstack, placer, pointed_thing) + local name = placer:get_player_name() + if not name then + return itemstack + end + if pointed_thing.type=="node" then + local pos=pointed_thing.above + local upos=pointed_thing.under + if minetest.is_protected(pos,name) and minetest.is_protected(upos,name) then + return itemstack + end + if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to + and minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable then + tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + end + end + return itemstack + end, + }) +end + + + +minetest.register_craftitem("advtrains:trackworker",{ + description = "Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc.", + groups = {cracky=1}, -- key=name, value=rating; rating=1..3. + inventory_image = "advtrains_trackworker.png", + wield_image = "advtrains_trackworker.png", + stack_max = 1, + on_place = function(itemstack, placer, pointed_thing) + local name = placer:get_player_name() + if not name then + return + end + if pointed_thing.type=="node" then + local pos=pointed_thing.under + if minetest.is_protected(pos, name) then + return + end + local node=minetest.get_node(pos) + + --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end + if advtrains.is_train_at_pos(pos) then return end + + local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") + --print(node.name.."\npattern recognizes:"..nodeprefix.." / "..railtype.." / "..rotation) + if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then + nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") + rotation = "" + if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then + minetest.chat_send_player(placer:get_player_name(), "This node can't be rotated using the trackworker!") + return + end + end + local modext=tp.tracks[nnprefix].twrotate[suffix] + + if rotation==modext[#modext] then --increase param2 + minetest.swap_node(pos, {name=nnprefix.."_"..suffix..modext[1], param2=(node.param2+1)%4}) + return + else + local modpos + for k,v in pairs(modext) do if v==rotation then modpos=k end end + if not modpos then + minetest.chat_send_player(placer:get_player_name(), "This node can't be rotated using the trackworker!") + return + end + minetest.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) + end + advtrains.invalidate_all_paths() + end + end, + on_use=function(itemstack, user, pointed_thing) + local name = user:get_player_name() + if not name then + return + end + if pointed_thing.type=="node" then + local pos=pointed_thing.under + local node=minetest.get_node(pos) + if minetest.is_protected(pos, name) then + return + end + + --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end + if advtrains.is_train_at_pos(pos) then return end + local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") + --print(node.name.."\npattern recognizes:"..nodeprefix.." / "..railtype.." / "..rotation) + if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then + nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") + rotation = "" + if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then + minetest.chat_send_player(user:get_player_name(), "This node can't be changed using the trackworker!") + return + end + end + local nextsuffix=tp.tracks[nnprefix].twcycle[suffix] + minetest.swap_node(pos, {name=nnprefix.."_"..nextsuffix..rotation, param2=node.param2}) + --invalidate trains + advtrains.invalidate_all_paths() + else + print(name, dump(tp.tracks)) + end + end, +}) + +--putting into right place +advtrains.trackplacer=tp diff --git a/advtrains/advtrains/tracks.lua b/advtrains/advtrains/tracks.lua new file mode 100644 index 0000000..beb0bbc --- /dev/null +++ b/advtrains/advtrains/tracks.lua @@ -0,0 +1,721 @@ +--advtrains by orwell96, see readme.txt + +--dev-time settings: +--EDIT HERE +--If the old non-model rails on straight tracks should be replaced by the new... +--false: no +--true: yes +advtrains.register_replacement_lbms=false + +--[[TracksDefinition +nodename_prefix +texture_prefix +description +common={} +straight={} +straight45={} +curve={} +curve45={} +lswitchst={} +lswitchst45={} +rswitchst={} +rswitchst45={} +lswitchcr={} +lswitchcr45={} +rswitchcr={} +rswitchcr45={} +vert1={ + --you'll probably want to override mesh here +} +vert2={ + --you'll probably want to override mesh here +} +]]-- +advtrains.all_tracktypes={} + +--definition preparation +local function conns(c1, c2, r1, r2, rh, rots) return {conn1=c1, conn2=c2, rely1=r1, rely2=r2, railheight=rh} end + +local ap={} +ap.t_30deg={ + regstep=1, + variant={ + st=conns(0,8), + cr=conns(0,7), + swlst=conns(0,8), + swlcr=conns(0,7), + swrst=conns(0,8), + swrcr=conns(0,9), + vst1=conns(8,0,0,0.5,0.25), + vst2=conns(8,0,0.5,1,0.75), + vst31=conns(8,0,0,0.33,0.16), + vst32=conns(8,0,0.33,0.66,0.5), + vst33=conns(8,0,0.66,1,0.83), + }, + description={ + st="straight", + cr="curve", + swlst="left switch (straight)", + swlcr="left switch (curve)", + swrst="right switch (straight)", + swrcr="right switch (curve)", + vst1="steep uphill 1/2", + vst2="steep uphill 2/2", + vst31="uphill 1/3", + vst32="uphill 2/3", + vst33="uphill 3/3", + }, + switch={ + swlst="swlcr", + swlcr="swlst", + swrst="swrcr", + swrcr="swrst", + }, + switchmc={ + swlst="on", + swlcr="off", + swrst="on", + swrcr="off", + }, + regtp=true, + trackplacer={ + st=true, + cr=true, + }, + tpsingle={ + st=true, + }, + tpdefault="st", + trackworker={ + ["swrcr"]="st", + ["swrst"]="st", + ["st"]="cr", + ["cr"]="swlst", + ["swlcr"]="swrcr", + ["swlst"]="swrst", + }, + regsp=true, + slopenodes={ + vst1=true, vst2=true, + vst31=true, vst32=true, vst33=true, + }, + slopeplacer={ + [2]={"vst1", "vst2"}, + [3]={"vst31", "vst32", "vst33"}, + max=3,--highest entry + }, + slopeplacer_45={ + [2]={"vst1_45", "vst2_45"}, + max=2, + }, + rotation={"", "_30", "_45", "_60"}, + increativeinv={}, +} +ap.t_30deg_straightonly={ + regstep=1, + variant={ + st=conns(0,8), + }, + description={ + st="straight", + }, + switch={ + }, + switchmc={ + }, + regtp=true, + trackplacer={ + }, + tpsingle={ + }, + tpdefault="st", + trackworker={ + ["st"]="st", + }, + slopenodes={}, + rotation={"", "_30", "_45", "_60"}, + increativeinv={st}, +} +ap.t_30deg_straightonly_noplacer={ + regstep=1, + variant={ + st=conns(0,8), + }, + description={ + st="straight", + }, + switch={ + }, + switchmc={ + }, + regtp=false, + trackplacer={ + }, + tpsingle={ + }, + tpdefault="st", + trackworker={ + ["st"]="st", + }, + slopenodes={}, + rotation={"", "_30", "_45", "_60"}, + increativeinv={st}, +} +ap.t_45deg={ + regstep=2, + variant={ + st=conns(0,8), + cr=conns(0,6), + swlst=conns(0,8), + swlcr=conns(0,6), + swrst=conns(0,8), + swrcr=conns(0,10), + vst1=conns(8,0,0,0.5,0.25), + vst2=conns(8,0,0.5,1,0.75), + }, + description={ + st="straight", + cr="curve", + swlst="left switch (straight)", + swlcr="left switch (curve)", + swrst="right switch (straight)", + swrcr="right switch (curve)", + vst1="vertical lower node", + vst2="vertical upper node", + }, + switch={ + swlst="swlcr", + swlcr="swlst", + swrst="swrcr", + swrcr="swrst", + }, + switchmc={ + swlst="on", + swlcr="off", + swrst="on", + swrcr="off", + }, + regtp=true, + trackplacer={ + st=true, + cr=true, + }, + tpsingle={ + st=true, + }, + tpdefault="st", + trackworker={ + ["swrcr"]="st", + ["swrst"]="st", + ["st"]="cr", + ["cr"]="swlst", + ["swlcr"]="swrcr", + ["swlst"]="swrst", + }, + slopenodes={}, + rotation={"", "_45"}, + increativeinv={vst1=true, vst2=true} +} +advtrains.trackpresets = ap + +--definition format: ([] optional) +--[[{ + nodename_prefix + texture_prefix + [shared_texture] + models_prefix + models_suffix (with dot) + [shared_model] + formats={ + st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 + (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) + } + common={} change something on common rail appearance +}]] +function advtrains.register_tracks(tracktype, def, preset) + local function make_switchfunc(suffix_target, mesecon_state) + local switchfunc=function(pos, node) + if advtrains.is_train_at_pos(pos) then return end + minetest.set_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) + advtrains.invalidate_all_paths() + advtrains.reset_trackdb_position(pos) + end + return switchfunc, {effector = { + ["action_"..mesecon_state] = switchfunc, + rules=advtrains.meseconrules + }} + end + local function make_overdef(suffix, rotation, conns, switchfunc, mesecontbl, in_creative_inv, drop_slope) + local img_suffix=suffix..rotation + return { + mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix), + tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png")}, + --inventory_image = def.texture_prefix.."_"..img_suffix..".png", + --wield_image = def.texture_prefix.."_"..img_suffix..".png", + description=def.description.."("..preset.description[suffix]..rotation..")", + connect1=conns.conn1, + connect2=conns.conn2, + rely1=conns.rely1 or 0, + rely2=conns.rely2 or 0, + railheight=conns.railheight or 0, + on_rightclick=switchfunc, + groups = { + attached_node=1, + ["advtrains_track_"..tracktype]=1, + dig_immediate=2, + not_in_creative_inventory=(not in_creative_inv and 1 or nil), + not_blocking_trains=1, + }, + mesecons=mesecontbl, + drop = increativeinv and def.nodename_prefix.."_"..suffix..rotation or (drop_slope and def.nodename_prefix.."_slopeplacer" or def.nodename_prefix.."_placer"), + } + end + local function cycle_conns(conns, rotid) + local add=(rotid-1)*preset.regstep + return { + conn1=(conns.conn1+add)%16, + conn2=(conns.conn2+add)%16, + rely1=conns.rely1 or 0, + rely2=conns.rely2 or 0, + railheight=conns.railheight or 0, + } + end + local common_def=advtrains.merge_tables({ + description = def.description, + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, + }, + rely1=0, + rely2=0, + railheight=0, + drop=def.nodename_prefix.."_placer", + can_dig=function(pos) + return not advtrains.is_train_at_pos(pos) + end, + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.reset_trackdb_position(pos) + end, + after_place_node=function(pos) + advtrains.reset_trackdb_position(pos) + end, + on_place_rail=function(pos) + advtrains.reset_trackdb_position(pos) + end, + }, def.common or {}) + --make trackplacer base def + advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault) + if preset.regtp then + advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description) + end + if preset.regsp then + advtrains.slope.register_placer(def, preset) + end + for suffix, conns in pairs(preset.variant) do + for rotid, rotation in ipairs(preset.rotation) do + if not def.formats[suffix] or def.formats[suffix][rotid] then + local switchfunc, mesecontbl + if preset.switch[suffix] then + switchfunc, mesecontbl=make_switchfunc(preset.switch[suffix]..rotation, preset.switchmc[suffix]) + end + local adef={} + if def.get_additional_definiton then + adef=def.get_additional_definiton(def, preset, suffix, rotation) + end + + minetest.register_node(def.nodename_prefix.."_"..suffix..rotation, advtrains.merge_tables( + common_def, + make_overdef( + suffix, rotation, + cycle_conns(conns, rotid), + switchfunc, mesecontbl, preset.increativeinv[suffix], preset.slopenodes[suffix] + ), + adef + ) + ) + --trackplacer + if preset.regtp then + if preset.trackplacer[suffix] then + advtrains.trackplacer.add_double_conn(def.nodename_prefix, suffix, rotation, cycle_conns(conns, rotid)) + end + if preset.tpsingle[suffix] then + advtrains.trackplacer.add_single_conn(def.nodename_prefix, suffix, rotation, cycle_conns(conns, rotid)) + end + end + advtrains.trackplacer.add_worked(def.nodename_prefix, suffix, rotation, preset.trackworker[suffix]) + end + end + end + advtrains.all_tracktypes[tracktype]=true +end + + +function advtrains.is_track_and_drives_on(nodename, drives_on_p) + if not minetest.registered_nodes[nodename] then + return false + end + local nodedef=minetest.registered_nodes[nodename] + for k,v in pairs(drives_on_p) do + if nodedef.groups["advtrains_track_"..k] then + return true + end + end + return false +end + +function advtrains.get_track_connections(name, param2) + local nodedef=minetest.registered_nodes[name] + if not nodedef then print("[advtrains] get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return 0, 8, 0, 0, 0 end + local noderot=param2 + if not param2 then noderot=0 end + if noderot > 3 then print("[advtrains] get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end + + return (nodedef.connect1 + 4 * noderot)%16, (nodedef.connect2 + 4 * noderot)%16, nodedef.rely1 or 0, nodedef.rely2 or 0, nodedef.railheight or 0 +end + +--detector code +--holds a table with nodes on which trains are on. + +advtrains.detector = {} +advtrains.detector.on_node = {} +advtrains.detector.on_node_restore = {} +--set if paths were invalidated before. tells trainlogic.lua to call advtrains.detector.finalize_restore() +advtrains.detector.clean_step_before = false + +--when train enters a node, call this +--The entry already being contained in advtrains.detector.on_node_restore will not trigger an on_train_enter event on the node. (when path is reset, this is saved). +function advtrains.detector.enter_node(pos, train_id) + local pts = minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) + --print("enterNode "..pts.." "..sid(train_id)) + if advtrains.detector.on_node[pts] then + if advtrains.trains[advtrains.detector.on_node[pts]] then + --print(""..pts.." already occupied") + return false + else + advtrains.detector.leave_node(pos, advtrains.detector.on_node[pts]) + end + end + advtrains.detector.on_node[pts]=train_id + if advtrains.detector.on_node_restore[pts] then + advtrains.detector.on_node_restore[pts]=nil + else + advtrains.detector.call_enter_callback(advtrains.round_vector_floor_y(pos), train_id) + end + return true +end +function advtrains.detector.leave_node(pos, train_id) + local pts = minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) + --print("leaveNode "..pts.." "..sid(train_id)) + if not advtrains.detector.on_node[pts] then + --print(""..pts.." leave: nothing here") + return false + end + if advtrains.detector.on_node[pts]==train_id then + advtrains.detector.call_leave_callback(advtrains.round_vector_floor_y(pos), train_id) + advtrains.detector.on_node[pts]=nil + else + if advtrains.trains[advtrains.detector.on_node[pts]] then + --print(""..pts.." occupied by another train") + return false + else + advtrains.detector.leave_node(pos, advtrains.detector.on_node[pts]) + return false + end + end + return true +end +--called immediately before invalidating paths +function advtrains.detector.setup_restore() + --print("setup_restore") + advtrains.detector.on_node_restore = advtrains.detector.on_node + advtrains.detector.on_node = {} +end +--called one step after invalidating paths, when all trains have restored their path and called enter_node for their contents. +function advtrains.detector.finalize_restore() + --print("finalize_restore") + for pts, train_id in pairs(advtrains.detector.on_node_restore) do + --print("called leave callback "..pts.." "..train_id) + advtrains.detector.call_leave_callback(minetest.string_to_pos(pts), train_id) + end + advtrains.detector.on_node_restore = {} +end +function advtrains.detector.call_enter_callback(pos, train_id) + --print("instructed to call enter calback") + + local node = minetest.get_node(pos) --this spares the check if node is nil, it has a name in any case + local mregnode=minetest.registered_nodes[node.name] + if mregnode and mregnode.advtrains and mregnode.advtrains.on_train_enter then + mregnode.advtrains.on_train_enter(pos, train_id) + end + + --atc code wants to be notified too + advtrains.atc.trigger_controller_train_enter(pos, train_id) +end +function advtrains.detector.call_leave_callback(pos, train_id) + --print("instructed to call leave calback") + + local node = minetest.get_node(pos) --this spares the check if node is nil, it has a name in any case + local mregnode=minetest.registered_nodes[node.name] + if mregnode and mregnode.advtrains and mregnode.advtrains.on_train_leave then + mregnode.advtrains.on_train_leave(pos, train_id) + end +end + +-- slope placer. Defined in register_tracks. +--crafted with rail and gravel +local sl={} +function sl.register_placer(def, preset) + minetest.register_craftitem(def.nodename_prefix.."_slopeplacer",{ + description = def.description.." Slope", + inventory_image = def.texture_prefix.."_slopeplacer.png", + wield_image = def.texture_prefix.."_slopeplacer.png", + groups={}, + on_place = sl.create_slopeplacer_on_place(def, preset) + }) +end +--(itemstack, placer, pointed_thing) +function sl.create_slopeplacer_on_place(def, preset) + return function(istack, player, pt) + if not pt.type=="node" then + minetest.chat_send_player(player:get_player_name(), "Can't place: not pointing at node") + return istack + end + local pos=pt.above + if not pos then + minetest.chat_send_player(player:get_player_name(), "Can't place: not pointing at node") + return istack + end + local node=minetest.get_node(pos) + if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to then + minetest.chat_send_player(player:get_player_name(), "Can't place: space occupied!") + return istack + end + if minetest.is_protected(pos, player:get_player_name()) then + minetest.chat_send_player(player:get_player_name(), "Can't place: protected position!") + return istack + end + --determine player orientation (only horizontal component) + --get_look_horizontal may not be available + local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2) + + --rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5. + dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} + --translate to direction to look up inside the preset table + local param2, rot45=({ + [-1]={ + [-1]=2, + [0]=3, + [1]=3, + }, + [0]={ + [-1]=2, + [1]=0, + }, + [1]={ + [-1]=1, + [0]=1, + [1]=0, + }, + })[dirvec.x][dirvec.z], dirvec.x~=0 and dirvec.z~=0 + local lookup=preset.slopeplacer + if rot45 then lookup=preset.slopeplacer_45 end + + --go unitvector forward and look how far the next node is + local step=1 + while step<=lookup.max do + local node=minetest.get_node(vector.add(pos, dirvec)) + --next node solid? + if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or minetest.is_protected(pos, player:get_player_name()) then + --do slopes of this distance exist? + if lookup[step] then + if minetest.setting_getbool("creative_mode") or istack:get_count()>=step then + --start placing + local placenodes=lookup[step] + while step>0 do + minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2}) + if not minetest.setting_getbool("creative_mode") then + istack:take_item() + end + step=step-1 + pos=vector.subtract(pos, dirvec) + end + else + minetest.chat_send_player(player:get_player_name(), "Can't place: Not enough slope items left ("..step.." required)") + end + else + minetest.chat_send_player(player:get_player_name(), "Can't place: There's no slope of length "..step) + end + return istack + end + step=step+1 + pos=vector.add(pos, dirvec) + end + minetest.chat_send_player(player:get_player_name(), "Can't place: no supporting node at upper end.") + return itemstack + end +end + +advtrains.slope=sl + +--END code, BEGIN definition +--definition format: ([] optional) +--[[{ + nodename_prefix + texture_prefix + [shared_texture] + models_prefix + models_suffix (with dot) + [shared_model] + formats={ + st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 + (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) + } + common={} change something on common rail appearance +}]] + +advtrains.register_tracks("regular", { + nodename_prefix="advtrains:track", + texture_prefix="advtrains_track", + shared_model="trackplane.b3d", + description="Deprecated Track", + formats={vst1={}, vst2={}}, +}, ap.t_45deg) + + +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail.png", + description="Track", + formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, +}, ap.t_30deg) + +--bumpers +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_bumper", + texture_prefix="advtrains_dtrack_bumper", + models_prefix="advtrains_dtrack_bumper", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail.png", + description="Bumper", + formats={}, +}, ap.t_30deg_straightonly) +--legacy bumpers +for _,rot in ipairs({"", "_30", "_45", "_60"}) do + minetest.register_alias("advtrains:dtrack_bumper"..rot, "advtrains:dtrack_bumper_st"..rot) +end + +if mesecon then + advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_detector_off", + texture_prefix="advtrains_dtrack_detector", + models_prefix="advtrains_dtrack_detector", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail.png", + description="Detector Rail", + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + mesecons = { + receptor = { + state = mesecon.state.off, + rules = advtrains.meseconrules + } + }, + advtrains = { + on_train_enter=function(pos, train_id) + minetest.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=minetest.get_node(pos).param2}) + mesecon.receptor_on(pos, advtrains.meseconrules) + end + } + } + end + }, ap.t_30deg_straightonly) + advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_detector_on", + texture_prefix="advtrains_dtrack_detector", + models_prefix="advtrains_dtrack_detector", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail_detector_on.png", + description="Detector(on)(you hacker you)", + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + mesecons = { + receptor = { + state = mesecon.state.on, + rules = advtrains.meseconrules + } + }, + advtrains = { + on_train_leave=function(pos, train_id) + minetest.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=minetest.get_node(pos).param2}) + mesecon.receptor_off(pos, advtrains.meseconrules) + end + } + } + end + }, ap.t_30deg_straightonly_noplacer) +end +--TODO legacy +--I know lbms are better for this purpose +for name,rep in pairs({swl_st="swlst", swr_st="swrst", swl_cr="swlcr", swr_cr="swrcr", }) do + minetest.register_abm({ + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_"..name}, + interval = 1.0, -- Operation interval in seconds + chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep, param2=node.param2}) end, + }) + minetest.register_abm({ + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_"..name.."_45"}, + interval = 1.0, -- Operation interval in seconds + chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep.."_45", param2=node.param2}) end, + }) +end + +if advtrains.register_replacement_lbms then +minetest.register_lbm({ + name = "advtrains:ramp_replacement_1", +-- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_vert1"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst1", param2=(node.param2+2)%4}) end, +}) +minetest.register_lbm({ + name = "advtrains:ramp_replacement_1", +-- -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_vert2"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst2", param2=(node.param2+2)%4}) end, +}) + minetest.register_abm({ + name = "advtrains:st_rep_1", + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_st"}, + interval=1, + chance=1, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st", param2=node.param2}) end, + }) + minetest.register_lbm({ + name = "advtrains:st_rep_1", + -- -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_st_45"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st_45", param2=node.param2}) end, + }) +end + + + + + + + + diff --git a/advtrains/advtrains/trainhud.lua b/advtrains/advtrains/trainhud.lua new file mode 100644 index 0000000..e69f04a --- /dev/null +++ b/advtrains/advtrains/trainhud.lua @@ -0,0 +1,109 @@ +--trainhud.lua: holds all the code for train controlling + +advtrains.hud = {} + +minetest.register_on_leaveplayer(function(player) +advtrains.hud[player:get_player_name()] = nil +end) + +local mletter={[1]="F", [-1]="R", [0]="N"} + +function advtrains.on_control_change(pc, train, flip) + if pc.sneak then + if pc.up then + train.tarvelocity = train.max_speed or 10 + end + if pc.down then + train.tarvelocity = 0 + end + if pc.left then + train.tarvelocity = 4 + end + if pc.right then + train.tarvelocity = 8 + end + if pc.jump then + train.brake = true + --0: released, 1: brake and pressed, 2: released and brake, 3: pressed and brake + if not train.brake_hold_state or train.brake_hold_state==0 then + train.brake_hold_state = 1 + elseif train.brake_hold_state==2 then + train.brake_hold_state = 3 + end + elseif train.brake_hold_state==1 then + train.brake_hold_state = 2 + elseif train.brake_hold_state==3 then + train.brake = false + train.brake_hold_state = 0 + end + --shift+use:see wagons.lua + else + if pc.up then + train.tarvelocity = train.tarvelocity + 1 + end + if pc.down then + if train.velocity>0 then + train.tarvelocity = math.max(train.tarvelocity - 1, 0) + else + train.movedir = -train.movedir + end + end + if train.brake_hold_state~=2 then + train.brake = false + end + if pc.jump then + train.brake = true + end + if pc.aux1 then + --horn + end + end +end +function advtrains.update_driver_hud(pname, train, flip) + advtrains.set_trainhud(pname, advtrains.hud_train_format(train, flip)) +end +function advtrains.clear_driver_hud(pname) + advtrains.set_trainhud(pname, "") +end + +function advtrains.set_trainhud(name, text) + local hud = advtrains.hud[name] + local player=minetest.get_player_by_name(name) + if not player then + return + end + if not hud then + hud = {} + advtrains.hud[name] = hud + hud.id = player:hud_add({ + hud_elem_type = "text", + name = "ADVTRAINS", + number = 0xFFFFFF, + position = {x=0.5, y=0.7}, + offset = {x=0, y=0}, + text = text, + scale = {x=200, y=60}, + alignment = {x=0, y=0}, + }) + hud.oldText=text + return + elseif hud.oldText ~= text then + player:hud_change(hud.id, "text", text) + hud.oldText=text + end +end +function advtrains.hud_train_format(train, flip) + local fct=flip and -1 or 1 + if not train then return "" end + + local max=train.max_speed or 10 + local vel=advtrains.abs_ceil(train.velocity) + local tvel=advtrains.abs_ceil(train.tarvelocity) + local topLine, firstLine, secondLine + + topLine="Train".." ["..mletter[fct*train.movedir].."] "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") + firstLine="Speed: |"..string.rep("+", vel)..string.rep("_", max-vel)..">" + secondLine="Target: |"..string.rep("+", tvel)..string.rep("_", max-tvel)..">" + + return topLine.."\n"..firstLine.."\n"..secondLine +end diff --git a/advtrains/advtrains/trainlogic.lua b/advtrains/advtrains/trainlogic.lua new file mode 100644 index 0000000..eb45500 --- /dev/null +++ b/advtrains/advtrains/trainlogic.lua @@ -0,0 +1,875 @@ +--trainlogic.lua +--controls train entities stuff about connecting/disconnecting/colliding trains and other things + + +local benchmark=false +local bm={} +local bmlt=0 +local bmsteps=0 +local bmstepint=200 +printbm=function(action, ta) + if not benchmark then return end + local t=(os.clock()-ta)*1000 + if not bm[action] then + bm[action]=t + else + bm[action]=bm[action]+t + end + bmlt=bmlt+t +end +function endstep() + if not benchmark then return end + bmsteps=bmsteps-1 + if bmsteps<=0 then + bmsteps=bmstepint + for key, value in pairs(bm) do + minetest.chat_send_all(key.." "..(value/bmstepint).." ms avg.") + end + minetest.chat_send_all("Total time consumed by all advtrains actions per step: "..(bmlt/bmstepint).." ms avg.") + bm={} + bmlt=0 + end +end + +advtrains.train_accel_force=2--per second and divided by number of wagons +advtrains.train_brake_force=3--per second, not divided by number of wagons +advtrains.train_roll_force=0.5--per second, not divided by number of wagons, acceleration when rolling without brake +advtrains.train_emerg_force=10--for emergency brakes(when going off track) + +advtrains.audit_interval=30 + + +advtrains.trains={} +advtrains.wagon_save={} + +--load initially +advtrains.fpath=minetest.get_worldpath().."/advtrains" +local file, err = io.open(advtrains.fpath, "r") +if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed loading advtrains save file "..er) +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.trains=tbl + end + file:close() +end +advtrains.fpath_ws=minetest.get_worldpath().."/advtrains_wagon_save" +local file, err = io.open(advtrains.fpath_ws, "r") +if not file then + local er=err or "Unknown Error" + print("[advtrains]Failed loading advtrains save file "..er) +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.wagon_save=tbl + end + file:close() +end + + +advtrains.save = function() + --print("[advtrains]saving") + advtrains.invalidate_all_paths() + local datastr = minetest.serialize(advtrains.trains) + if not datastr then + minetest.log("error", "[advtrains] Failed to serialize train data!") + return + end + local file, err = io.open(advtrains.fpath, "w") + if err then + return err + end + file:write(datastr) + file:close() + + -- update wagon saves + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized then + wagon:get_staticdata() + end + end + --cross out userdata + for w_id, data in pairs(advtrains.wagon_save) do + data.name=nil + data.object=nil + if data.driver then + data.driver_name=data.driver:get_player_name() + data.driver=nil + else + data.driver_name=nil + end + if data.discouple then + data.discouple.object:remove() + data.discouple=nil + end + end + --print(dump(advtrains.wagon_save)) + datastr = minetest.serialize(advtrains.wagon_save) + if not datastr then + minetest.log("error", "[advtrains] Failed to serialize train data!") + return + end + file, err = io.open(advtrains.fpath_ws, "w") + if err then + return err + end + file:write(datastr) + file:close() + + advtrains.save_trackdb() + advtrains.atc.save() +end +minetest.register_on_shutdown(advtrains.save) + +advtrains.save_and_audit_timer=advtrains.audit_interval +minetest.register_globalstep(function(dtime) + advtrains.save_and_audit_timer=advtrains.save_and_audit_timer-dtime + if advtrains.save_and_audit_timer<=0 then + local t=os.clock() + + --save + advtrains.save() + advtrains.save_and_audit_timer=advtrains.audit_interval + printbm("saving", t) + end + --regular train step + local t=os.clock() + for k,v in pairs(advtrains.trains) do + advtrains.train_step(k, v, dtime) + end + + --see tracks.lua + if advtrains.detector.clean_step_before then + advtrains.detector.finalize_restore() + end + + printbm("trainsteps", t) + endstep() +end) + +function advtrains.train_step(id, train, dtime) + --Legacy: set drives_on and max_speed + if not train.drives_on or not train.max_speed then + advtrains.update_trainpart_properties(id) + end + --TODO check for all vars to be present + if not train.velocity then + train.velocity=0 + end + if not train.movedir or (train.movedir~=1 and train.movedir~=-1) then + train.movedir=1 + end + --very unimportant thing: check if couple is here + if train.couple_eid_front and (not minetest.luaentities[train.couple_eid_front] or not minetest.luaentities[train.couple_eid_front].is_couple) then train.couple_eid_front=nil end + if train.couple_eid_back and (not minetest.luaentities[train.couple_eid_back] or not minetest.luaentities[train.couple_eid_back].is_couple) then train.couple_eid_back=nil end + + --skip certain things (esp. collision) when not moving + local train_moves=(train.velocity~=0) + + --if not train.last_pos then advtrains.trains[id]=nil return end + + if not advtrains.pathpredict(id, train) then + print("pathpredict failed(returned false)") + train.velocity=0 + train.tarvelocity=0 + return + end + + local path=advtrains.get_or_create_path(id, train) + if not path then + train.velocity=0 + train.tarvelocity=0 + print("train has no path for whatever reason") + return + end + + local train_end_index=advtrains.get_train_end_index(train) + --apply off-track handling: + local front_off_track=train.max_index_on_track and train.index>train.max_index_on_track + local back_off_track=train.min_index_on_track and train_end_index1 then train.tarvelocity=1 end + elseif front_off_track then--allow movement only backward + if train.movedir==1 and train.tarvelocity>0 then train.tarvelocity=0 end + if train.movedir==-1 and train.tarvelocity>1 then train.tarvelocity=1 end + elseif back_off_track then--allow movement only forward + if train.movedir==-1 and train.tarvelocity>0 then train.tarvelocity=0 end + if train.movedir==1 and train.tarvelocity>1 then train.tarvelocity=1 end + end + + --update advtrains.detector + if not train.detector_old_index then + train.detector_old_index = math.floor(train_end_index) + train.detector_old_end_index = math.floor(train_end_index) + end + local ifo, ifn, ibo, ibn = train.detector_old_index, math.floor(train.index), train.detector_old_end_index, math.floor(train_end_index) + if ifn>ifo then + for i=ifo, ifn do + if path[i] then + advtrains.detector.enter_node(path[i], id) + end + end + elseif ifnibo then + for i=ibo, ibn do + if path[i] then + advtrains.detector.leave_node(path[i], id) + end + end + end + train.detector_old_index = math.floor(train.index) + train.detector_old_end_index = math.floor(train_end_index) + + --remove? + if #train.trainparts==0 then + print("[advtrains][train "..sid(id).."] has empty trainparts, removing.") + advtrains.detector.leave_node(path[train.detector_old_index], id) + advtrains.trains[id]=nil + return + end + + if train_moves then + --check for collisions by finding objects + + --heh, new collision again. + --this time, based on NODES and the advtrains.detector.on_node table. + local collpos + local coll_grace=1 + if train.movedir==1 then + collpos=advtrains.get_real_index_position(path, train.index-coll_grace) + else + collpos=advtrains.get_real_index_position(path, train_end_index+coll_grace) + end + if collpos then + local rcollpos=advtrains.round_vector_floor_y(collpos) + for x=-1,1 do + for z=-1,1 do + local testpos=vector.add(rcollpos, {x=x, y=0, z=z}) + local testpts=minetest.pos_to_string(testpos) + if advtrains.detector.on_node[testpts] and advtrains.detector.on_node[testpts]~=id then + --collides + advtrains.spawn_couple_on_collide(id, testpos, advtrains.detector.on_node[testpts], train.movedir==-1) + + train.recently_collided_with_env=true + train.velocity=0.5*train.velocity + train.movedir=train.movedir*-1 + train.tarvelocity=0 + + end + end + end + end + end + --check for any trainpart entities if they have been unloaded. do this only if train is near a player, to not spawn entities into unloaded areas + --todo function will be taken by update_trainpart_properties + train.check_trainpartload=(train.check_trainpartload or 0)-dtime + local node_range=(math.max((minetest.setting_get("active_block_range") or 0),1)*16) + if train.check_trainpartload<=0 then + local ori_pos=advtrains.get_real_index_position(path, train.index) --not much to calculate + --print("[advtrains][train "..id.."] at "..minetest.pos_to_string(vector.round(ori_pos))) + + local should_check=false + for _,p in ipairs(minetest.get_connected_players()) do + should_check=should_check or ((vector.distance(ori_pos, p:getpos())=train.velocity then + train.atc_brake_target=nil + end + if train.atc_wait_finish then + if not train.atc_brake_target and train.velocity==train.tarvelocity then + train.atc_wait_finish=nil + end + end + if train.atc_command then + if train.atc_delay<=0 and not train.atc_wait_finish then + advtrains.atc.execute_atc_command(id, train) + else + train.atc_delay=train.atc_delay-dtime + end + end + + --make brake adjust the tarvelocity if necessary + if train.brake and (math.ceil(train.velocity)-1)0 then--accelerating, force will be brought on only by locomotives. + --print("accelerating with default force") + applydiff=(math.min((advtrains.train_accel_force*train.locomotives_in_train*dtime)/mass, math.abs(diff))) + else--decelerating + if front_off_track or back_off_track or train.recently_collided_with_env then --every wagon has a brake, so not divided by mass. + --print("braking with emergency force") + applydiff= -(math.min((advtrains.train_emerg_force*dtime), math.abs(diff))) + elseif train.brake or (train.atc_brake_target and train.atc_brake_target0 then + if train.movedir>0 then + pregen_front=2+math.ceil(train.velocity*0.15) --assumes server step of 0.1 seconds, +50% tolerance + else + pregen_back=2+math.ceil(train.velocity*0.15) + end + end + + + local maxn=advtrains.maxN(train.path) + while (maxn-train.index) < pregen_front do--pregenerate + --print("[advtrains]maxn conway for ",maxn,minetest.pos_to_string(path[maxn]),maxn-1,minetest.pos_to_string(path[maxn-1])) + local conway=advtrains.conway(train.path[maxn], train.path[maxn-1], train.drives_on) + if conway then + train.path[maxn+1]=conway + train.max_index_on_track=maxn + else + --do as if nothing has happened and preceed with path + --but do not update max_index_on_track + --print("over-generating path max to index "..maxn+1) + train.path[maxn+1]=vector.add(train.path[maxn], vector.subtract(train.path[maxn], train.path[maxn-1])) + end + train.path_dist[maxn]=vector.distance(train.path[maxn+1], train.path[maxn]) + maxn=advtrains.maxN(train.path) + end + + local minn=advtrains.minN(train.path) + while (train.index-minn) < (train.trainlen or 0) + pregen_back do --post_generate. has to be at least trainlen. (we let go of the exact calculation here since this would be unuseful here) + --print("[advtrains]minn conway for ",minn,minetest.pos_to_string(path[minn]),minn+1,minetest.pos_to_string(path[minn+1])) + local conway=advtrains.conway(train.path[minn], train.path[minn+1], train.drives_on) + if conway then + train.path[minn-1]=conway + train.min_index_on_track=minn + else + --do as if nothing has happened and preceed with path + --but do not update min_index_on_track + --print("over-generating path min to index "..minn-1) + train.path[minn-1]=vector.add(train.path[minn], vector.subtract(train.path[minn], train.path[minn+1])) + end + train.path_dist[minn-1]=vector.distance(train.path[minn], train.path[minn-1]) + minn=advtrains.minN(train.path) + end + if not train.min_index_on_track then train.min_index_on_track=0 end + if not train.max_index_on_track then train.max_index_on_track=0 end + + --make pos/yaw available for possible recover calls + if train.max_index_on_tracktrain.index then --whoops, train went even more far. same behavior + train.savedpos_off_track_index_offset=train.index-train.min_index_on_track + train.last_pos=train.path[train.min_index_on_track+1] + train.last_pos_prev=train.path[train.min_index_on_track] + --print("train is off-track (back), last positions kept at "..minetest.pos_to_string(train.last_pos).." / "..minetest.pos_to_string(train.last_pos_prev)) + else --regular case + train.savedpos_off_track_index_offset=nil + train.last_pos=train.path[math.floor(train.index+0.5)] + train.last_pos_prev=train.path[math.floor(train.index-0.5)] + end + return train.path +end +function advtrains.get_train_end_index(train) + return advtrains.get_real_path_index(train, train.trainlen or 2)--this function can be found inside wagons.lua since it's more related to wagons. we just set trainlen as pos_in_train +end + +function advtrains.get_or_create_path(id, train) + if not train.path then return advtrains.pathpredict(id, train) end + return train.path +end + +function advtrains.add_wagon_to_train(wagon, train_id, index) + local train=advtrains.trains[train_id] + if index then + table.insert(train.trainparts, index, wagon.unique_id) + else + table.insert(train.trainparts, wagon.unique_id) + end + --this is not the usual case!!! + --we may set initialized because the wagon has no chance to step() + wagon.initialized=true + --TODO is this art or can we throw it away? + advtrains.update_trainpart_properties(train_id) +end +function advtrains.update_trainpart_properties(train_id, invert_flipstate) + local train=advtrains.trains[train_id] + train.drives_on=advtrains.all_tracktypes + train.max_speed=100 + local rel_pos=0 + local count_l=0 + for i, w_id in ipairs(train.trainparts) do + local wagon=nil + for _,iwagon in pairs(minetest.luaentities) do + if iwagon.is_wagon and iwagon.initialized and iwagon.unique_id==w_id then + if wagon then + --duplicate + iwagon.object:remove() + else + wagon=iwagon + end + end + end + if not wagon then + if advtrains.wagon_save[w_id] then + --spawn a new and initialize it with the properties from wagon_save + wagon=minetest.env:add_entity(train.last_pos, advtrains.wagon_save[w_id].entity_name):get_luaentity() + wagon:init_from_wagon_save(w_id) + end + end + if wagon then + rel_pos=rel_pos+wagon.wagon_span + wagon.train_id=train_id + wagon.pos_in_train=rel_pos + wagon.pos_in_trainparts=i + wagon.old_velocity_vector=nil + if wagon.is_locomotive then + count_l=count_l+1 + end + if invert_flipstate then + wagon.wagon_flipped = not wagon.wagon_flipped + end + rel_pos=rel_pos+wagon.wagon_span + any_loaded=true + + if wagon.drives_on then + for k,_ in pairs(train.drives_on) do + if not wagon.drives_on[k] then + train.drives_on[k]=nil + end + end + end + train.max_speed=math.min(train.max_speed, wagon.max_speed) + else + print(w_id.." not loaded and no save available") + --what the hell... + table.remove(train.trainparts, pit) + end + end + train.trainlen=rel_pos + train.locomotives_in_train=count_l +end + +function advtrains.split_train_at_wagon(wagon) + --get train + local train=advtrains.trains[wagon.train_id] + local real_pos_in_train=advtrains.get_real_path_index(train, wagon.pos_in_train) + local pos_for_new_train=advtrains.get_or_create_path(wagon.train_id, train)[math.floor(real_pos_in_train+wagon.wagon_span)] + local pos_for_new_train_prev=advtrains.get_or_create_path(wagon.train_id, train)[math.floor(real_pos_in_train-1+wagon.wagon_span)] + + --before doing anything, check if both are rails. else do not allow + if not pos_for_new_train then + print("split_train: pos_for_new_train not set") + return false + end + local node_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) + if not node_ok then + print("split_train: pos_for_new_train "..minetest.pos_to_string(advtrains.round_vector_floor_y(pos_for_new_train_prev)).." not loaded or is not a rail") + return false + end + + if not train.last_pos_prev then + print("split_train: pos_for_new_train_prev not set") + return false + end + + local prevnode_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) + if not prevnode_ok then + print("split_train: pos_for_new_train_prev "..minetest.pos_to_string(advtrains.round_vector_floor_y(pos_for_new_train_prev)).." not loaded or is not a rail") + return false + end + + --create subtrain + local newtrain_id=advtrains.create_new_train_at(pos_for_new_train, pos_for_new_train_prev) + local newtrain=advtrains.trains[newtrain_id] + --insert all wagons to new train + for k,v in ipairs(train.trainparts) do + if k>=wagon.pos_in_trainparts then + table.insert(newtrain.trainparts, v) + train.trainparts[k]=nil + end + end + --update train parts + advtrains.update_trainpart_properties(wagon.train_id)--atm it still is the desierd id. + advtrains.update_trainpart_properties(newtrain_id) + train.tarvelocity=0 + newtrain.velocity=train.velocity + newtrain.tarvelocity=0 +end + +--there are 4 cases: +--1/2. F<->R F<->R regular, put second train behind first +--->frontpos of first train will match backpos of second +--3. F<->R R<->F flip one of these trains, take the other as new train +--->backpos's will match +--4. R<->F F<->R flip one of these trains and take it as new parent +--->frontpos's will match + +--true when trains are facing each other. needed on colliding. +-- check done by iterating paths and checking their direction +--returns nil when not on the same track at all OR when required path items are not generated. this distinction may not always be needed. +function advtrains.trains_facing(train1, train2) + local sr_pos=train1.path[math.floor(train1.index)] + local sr_pos_p=train1.path[math.floor(train1.index)-1] + + for i=advtrains.minN(train2.path), advtrains.maxN(train2.path) do + if vector.equals(sr_pos, train2.path[i]) then + if train2.path[i+1] and vector.equals(sr_pos_p, train2.path[i+1]) then return true end + if train2.path[i-1] and vector.equals(sr_pos_p, train2.path[i-1]) then return false end + return nil + end + end + return nil +end + +function advtrains.spawn_couple_on_collide(id1, pos, id2, t1_is_backpos) + print("COLLISION: "..sid(id1).." and "..sid(id2).." at "..minetest.pos_to_string(pos)..", t1_is_backpos="..(t1_is_backpos and "true" or "false")) + --TODO: + local train1=advtrains.trains[id1] + local train2=advtrains.trains[id2] + + local found + for i=advtrains.minN(train1.path), advtrains.maxN(train1.path) do + if vector.equals(train1.path[i], pos) then + found=true + end + end + if not found then + print("Err: pos not in path") + return + end + + local frontpos2=train2.path[math.floor(train2.detector_old_index)] + local backpos2=train2.path[math.floor(train2.detector_old_end_index)] + local t2_is_backpos + print("End positions: "..minetest.pos_to_string(frontpos2)..minetest.pos_to_string(backpos2)) + + if vector.equals(frontpos2, pos) then + t2_is_backpos=false + elseif vector.equals(backpos2, pos) then + t2_is_backpos=true + else + print("Err: not a endpos") + return --the collision position is not the end position. + end + print("t2_is_backpos="..(t2_is_backpos and "true" or "false")) + + local t1_has_couple + if t1_is_backpos then + t1_has_couple=train1.couple_eid_back + else + t1_has_couple=train1.couple_eid_front + end + local t2_has_couple + if t2_is_backpos then + t2_has_couple=train2.couple_eid_back + else + t2_has_couple=train2.couple_eid_front + end + + if t1_has_couple then + if minetest.object_refs[t1_has_couple] then minetest.object_refs[t1_has_couple]:remove() end + end + if t2_has_couple then + if minetest.object_refs[t2_has_couple] then minetest.object_refs[t2_has_couple]:remove() end + end + local obj=minetest.add_entity(pos, "advtrains:couple") + if not obj then print("failed creating object") return end + local le=obj:get_luaentity() + le.train_id_1=id1 + le.train_id_2=id2 + le.train1_is_backpos=t1_is_backpos + le.train2_is_backpos=t2_is_backpos + --find in object_refs + for aoi, compare in pairs(minetest.object_refs) do + if compare==obj then + if t1_is_backpos then + train1.couple_eid_back=aoi + else + train1.couple_eid_front=aoi + end + if t2_is_backpos then + train2.couple_eid_back=aoi + else + train2.couple_eid_front=aoi + end + end + end + print("Couple entity:"..dump(le)) + + --also TODO: integrate check_trainpartload into update_trainpart_properties. +end +--order of trains may be irrelevant in some cases. check opposite cases. TODO does this work? +--pos1 and pos2 are just needed to form a median. + + +function advtrains.do_connect_trains(first_id, second_id) + local first_wagoncnt=#advtrains.trains[first_id].trainparts + local second_wagoncnt=#advtrains.trains[second_id].trainparts + + for _,v in ipairs(advtrains.trains[second_id].trainparts) do + table.insert(advtrains.trains[first_id].trainparts, v) + end + --kick it like physics (with mass being #wagons) + local new_velocity=((advtrains.trains[first_id].velocity*first_wagoncnt)+(advtrains.trains[second_id].velocity*second_wagoncnt))/(first_wagoncnt+second_wagoncnt) + advtrains.trains[second_id]=nil + advtrains.update_trainpart_properties(first_id) + advtrains.trains[first_id].velocity=new_velocity + advtrains.trains[first_id].tarvelocity=0 +end + +function advtrains.invert_train(train_id) + local train=advtrains.trains[train_id] + + local old_path=advtrains.get_or_create_path(train_id, train) + train.path={} + train.index= - advtrains.get_train_end_index(train) + train.velocity=-train.velocity + train.tarvelocity=-train.tarvelocity + for k,v in pairs(old_path) do + train.path[-k]=v + end + local old_trainparts=train.trainparts + train.trainparts={} + for k,v in ipairs(old_trainparts) do + table.insert(train.trainparts, 1, v)--notice insertion at first place + end + advtrains.update_trainpart_properties(train_id, true) +end + +function advtrains.is_train_at_pos(pos) + --print("istrainat: pos "..minetest.pos_to_string(pos)) + local checked_trains={} + local objrefs=minetest.get_objects_inside_radius(pos, 2) + for _,v in pairs(objrefs) do + local le=v:get_luaentity() + if le and le.is_wagon and le.initialized and le.train_id and not checked_trains[le.train_id] then + --print("istrainat: checking "..le.train_id) + checked_trains[le.train_id]=true + local path=advtrains.get_or_create_path(le.train_id, le:train()) + if path then + --print("has path") + for i=math.floor(advtrains.get_train_end_index(le:train())+0.5),math.floor(le:train().index+0.5) do + if path[i] then + --print("has pathitem "..i.." "..minetest.pos_to_string(path[i])) + if vector.equals(advtrains.round_vector_floor_y(path[i]), pos) then + return true + end + end + end + end + end + end + return false +end +function advtrains.invalidate_all_paths() + --print("invalidating all paths") + for k,v in pairs(advtrains.trains) do + if v.index then + v.restore_add_index=v.index-math.floor(v.index+0.5) + end + v.path=nil + v.path_dist=nil + v.index=nil + v.min_index_on_track=nil + v.max_index_on_track=nil + + advtrains.detector.setup_restore() + v.detector_old_index=nil + v.detector_old_end_index=nil + end +end + +--not blocking trains group +function advtrains.train_collides(node) + if node and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].walkable then + if not minetest.registered_nodes[node.name].groups.not_blocking_trains then + return true + end + end + return false +end + +local nonblocknodes={ + "default:fence_wood", + "default:fence_acacia_wood", + "default:fence_aspen_wood", + "default:fence_pine_wood", + "default:fence_junglewood", + "default:torch", + + "default:sign_wall", + "signs:sign_wall", + "signs:sign_wall_blue", + "signs:sign_wall_brown", + "signs:sign_wall_orange", + "signs:sign_wall_green", + "signs:sign_yard", + "signs:sign_wall_white_black", + "signs:sign_wall_red", + "signs:sign_wall_white_red", + "signs:sign_wall_yellow", + "signs:sign_post", + "signs:sign_hanging", + + +} +minetest.after(0, function() + for _,name in ipairs(nonblocknodes) do + if minetest.registered_nodes[name] then + minetest.registered_nodes[name].groups.not_blocking_trains=1 + end + end +end) diff --git a/advtrains/advtrains/wagons.lua b/advtrains/advtrains/wagons.lua new file mode 100644 index 0000000..495f914 --- /dev/null +++ b/advtrains/advtrains/wagons.lua @@ -0,0 +1,573 @@ +--atan2 counts angles clockwise, minetest does counterclockwise +--local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end +local print=function() end + +local wagon={ + collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, + --physical = true, + visual = "mesh", + mesh = "wagon.b3d", + visual_size = {x=3, y=3}, + textures = {"black.png"}, + is_wagon=true, + wagon_span=1,--how many index units of space does this wagon consume + has_inventory=false, +} + + + +function wagon:on_rightclick(clicker) + if not self:ensure_init() then return end + if not clicker or not clicker:is_player() then + return + end + if clicker:get_player_control().aux1 then + --advtrains.dumppath(self:train().path) + --minetest.chat_send_all("at index "..(self:train().index or "nil")) + --advtrains.invert_train(self.train_id) + minetest.chat_send_all(dump(self:train())) + return + end + local no=self:get_seatno(clicker:get_player_name()) + if no then + self:get_off(no) + else + self:show_get_on_form(clicker:get_player_name()) + end +end + +function wagon:train() + return advtrains.trains[self.train_id] +end + +--[[about 'initalized': + when initialized is false, the entity hasn't got any data yet and should wait for these to be set before doing anything + when loading an existing object (with staticdata), it will be set + when instanciating a new object via add_entity, it is not set at the time on_activate is called. + then, wagon:initialize() will be called + + wagon will save only uid in staticdata, no serialized table +]] +function wagon:on_activate(sd_uid, dtime_s) + print("[advtrains][wagon "..((sd_uid and sd_uid~="" and sd_uid) or "no-id").."] activated") + self.object:set_armor_groups({immortal=1}) + if sd_uid and sd_uid~="" then + --legacy + --expect this to be a serialized table and handle + if minetest.deserialize(sd_uid) then + self:init_from_wagon_save(minetest.deserialize(sd_uid).unique_id) + else + self:init_from_wagon_save(sd_uid) + end + end + self.entity_name=self.name + + --duplicates? + for ao_id,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.unique_id==self.unique_id and wagon~=self then--i am a duplicate! + print("[advtrains][wagon "..((sd_uid and sd_uid~="" and sd_uid) or "no-id").."] duplicate found(ao_id:"..ao_id.."), removing") + self.object:remove() + minetest.after(0.5, function() advtrains.update_trainpart_properties(self.train_id) end) + return + end + end + + if self.custom_on_activate then + self:custom_on_activate(dtime_s) + end +end + +function wagon:get_staticdata() + if not self:ensure_init() then return end + print("[advtrains][wagon "..((self.unique_id and self.unique_id~="" and self.unique_id) or "no-id").."]: saving to wagon_save") + --serialize inventory, if it has one + if self.has_inventory then + local inv=minetest.get_inventory({type="detached", name="advtrains_wgn_"..self.unique_id}) + self.ser_inv=advtrains.serialize_inventory(inv) + end + --save to table before being unloaded + advtrains.wagon_save[self.unique_id]=advtrains.merge_tables(self) + advtrains.wagon_save[self.unique_id].entity_name=self.name + advtrains.wagon_save[self.unique_id].name=nil + advtrains.wagon_save[self.unique_id].object=nil + return self.unique_id +end +--returns: uid of wagon +function wagon:init_new_instance(train_id, properties) + self.unique_id=os.time()..os.clock() + self.train_id=train_id + for k,v in pairs(properties) do + if k~="name" and k~="object" then + self[k]=v + end + end + self:init_shared() + self.initialized=true + print("init_new_instance "..self.unique_id.." ("..self.train_id..")") + return self.unique_id +end +function wagon:init_from_wagon_save(uid) + if not advtrains.wagon_save[uid] then + self.object:remove() + return + end + self.unique_id=uid + for k,v in pairs(advtrains.wagon_save[uid]) do + if k~="name" and k~="object" then + self[k]=v + end + end + if not self.train_id or not self:train() then + self.object:remove() + return + end + self:init_shared() + self.initialized=true + minetest.after(1, function() self:reattach_all() end) + print("init_from_wagon_save "..self.unique_id.." ("..self.train_id..")") + advtrains.update_trainpart_properties(self.train_id) +end +function wagon:init_shared() + if self.has_inventory then + local uid_noptr=self.unique_id.."" + --to be used later + local inv=minetest.create_detached_inventory("advtrains_wgn_"..self.unique_id, { + allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) + return count + end, + allow_put = function(inv, listname, index, stack, player) + return stack:get_count() + end, + allow_take = function(inv, listname, index, stack, player) + return stack:get_count() + end + }) + if self.ser_inv then + advtrains.deserialize_inventory(self.ser_inv, inv) + end + if self.inventory_list_sizes then + for lst, siz in pairs(self.inventory_list_sizes) do + inv:set_size(lst, siz) + end + end + end +end +function wagon:ensure_init() + if self.initialized then return true end + self.object:setvelocity({x=0,y=0,z=0}) + return false +end + +-- Remove the wagon +function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) + if not self:ensure_init() then return end + if not puncher or not puncher:is_player() then + return + end + if self.owner and puncher:get_player_name()~=self.owner then + minetest.chat_send_player(puncher:get_player_name(), "This wagon is owned by "..self.owner..", you can't destroy it.") + return + end + + if minetest.setting_getbool("creative_mode") then + if not self:destroy() then return end + + local inv = puncher:get_inventory() + if not inv:contains_item("main", self.name) then + inv:add_item("main", self.name) + end + else + local pc=puncher:get_player_control() + if not pc.sneak then + minetest.chat_send_player(puncher:get_player_name(), "Warning: If you destroy this wagon, you only get some steel back! If you are sure, shift-leftclick the wagon.") + return + end + + if not self:destroy() then return end + + local inv = puncher:get_inventory() + for _,item in ipairs(self.drops or {self.name}) do + inv:add_item("main", item) + end + end +end +function wagon:destroy() + --some rules: + -- you get only some items back + -- single left-click shows warning + -- shift leftclick destroys + -- not when a driver is inside + + for _,_ in pairs(self.seatp) do + return + end + + if self.custom_may_destroy then + if not self.custom_may_destroy(self, puncher, time_from_last_punch, tool_capabilities, direction) then + return + end + end + if self.custom_on_destroy then + self.custom_on_destroy(self, puncher, time_from_last_punch, tool_capabilities, direction) + end + + print("[advtrains][wagon "..((self.unique_id and self.unique_id~="" and self.unique_id) or "no-id").."]: destroying") + + self.object:remove() + + table.remove(self:train().trainparts, self.pos_in_trainparts) + advtrains.update_trainpart_properties(self.train_id) + advtrains.wagon_save[self.unique_id]=nil + if self.discouple then self.discouple.object:remove() end--will have no effect on unloaded objects + return true +end + + +function wagon:on_step(dtime) + if not self:ensure_init() then return end + + local t=os.clock() + local pos = self.object:getpos() + + if not pos then + print("["..self.unique_id.."][fatal] missing position (object:getpos() returned nil)") + return + end + + self.entity_name=self.name + + --is my train still here + if not self.train_id or not self:train() then + print("[advtrains][wagon "..self.unique_id.."] missing train_id, destroying") + self.object:remove() + return + elseif not self.initialized then + self.initialized=true + end + if not self.seatp then + self.seatp={} + end + + --custom on_step function + if self.custom_on_step then + self:custom_on_step(self, dtime) + end + + --driver control + for seatno, seat in ipairs(self.seats) do + if seat.driving_ctrl_access then + local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) + local get_off_pressed=false + if driver and driver:get_player_control_bits()~=self.old_player_control_bits then + local pc=driver:get_player_control() + + advtrains.on_control_change(pc, self:train(), self.wagon_flipped) + if pc.aux1 and pc.sneak then + get_off_pressed=true + end + + self.old_player_control_bits=driver:get_player_control_bits() + end + if driver then + if get_off_pressed then + self:get_off(seatno) + else + advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped) + end + end + end + end + + local gp=self:train() + + --DisCouple + if self.pos_in_trainparts and self.pos_in_trainparts>1 then + if gp.velocity==0 then + if not self.discouple or not self.discouple.object:getyaw() then + local object=minetest.add_entity(pos, "advtrains:discouple") + if object then + local le=object:get_luaentity() + le.wagon=self + --box is hidden when attached, so unuseful. + --object:set_attach(self.object, "", {x=0, y=0, z=self.wagon_span*10}, {x=0, y=0, z=0}) + self.discouple=le + else + print("Couldn't spawn DisCouple") + end + end + else + if self.discouple and self.discouple.object:getyaw() then + self.discouple.object:remove() + end + end + end + --for path to be available. if not, skip step + if not advtrains.get_or_create_path(self.train_id, gp) then + self.object:setvelocity({x=0, y=0, z=0}) + return + end + if not self.pos_in_train then + --why ever. but better continue next step... + advtrains.update_trainpart_properties(self.train_id) + return + end + + local index=advtrains.get_real_path_index(self:train(), self.pos_in_train) + --print("trainindex "..gp.index.." wagonindex "..index) + + --position recalculation + local first_pos=gp.path[math.floor(index)] + local second_pos=gp.path[math.floor(index)+1] + if not first_pos or not second_pos then + --print("[advtrains] object "..self.unique_id.." path end reached!") + self.object:setvelocity({x=0,y=0,z=0}) + return + end + + --checking for environment collisions(a 3x3 cube around the center) + if not gp.recently_collided_with_env then + local collides=false + for x=-1,1 do + for y=0,2 do + for z=-1,1 do + local node=minetest.get_node_or_nil(vector.add(first_pos, {x=x, y=y, z=z})) + if (advtrains.train_collides(node)) then + collides=true + end + end + end + end + if collides then + gp.recently_collided_with_env=true + gp.velocity=-0.5*gp.velocity + gp.tarvelocity=0 + end + end + + --FIX: use index of the wagon, not of the train. + local velocity=(gp.velocity*gp.movedir)/(gp.path_dist[math.floor(index)] or 1) + local acceleration=(gp.last_accel or 0)/(gp.path_dist[math.floor(index)] or 1) + local factor=index-math.floor(index) + local actual_pos={x=first_pos.x-(first_pos.x-second_pos.x)*factor, y=first_pos.y-(first_pos.y-second_pos.y)*factor, z=first_pos.z-(first_pos.z-second_pos.z)*factor,} + local velocityvec={x=(first_pos.x-second_pos.x)*velocity*-1, z=(first_pos.z-second_pos.z)*velocity*-1, y=(first_pos.y-second_pos.y)*velocity*-1} + local accelerationvec={x=(first_pos.x-second_pos.x)*acceleration*-1, z=(first_pos.z-second_pos.z)*acceleration*-1, y=(first_pos.y-second_pos.y)*acceleration*-1} + + --some additional positions to determine orientation + local aposfwd=gp.path[math.floor(index+2)] + local aposbwd=gp.path[math.floor(index-1)] + + local yaw + if aposfwd and aposbwd then + yaw=advtrains.get_wagon_yaw(aposfwd, second_pos, first_pos, aposbwd, factor)+math.pi--TODO remove when cleaning up + else + yaw=math.atan2((first_pos.x-second_pos.x), (second_pos.z-first_pos.z)) + end + if self.wagon_flipped then + yaw=yaw+math.pi + end + + self.updatepct_timer=(self.updatepct_timer or 0)-dtime + if not self.old_velocity_vector + or not vector.equals(velocityvec, self.old_velocity_vector) + or not self.old_acceleration_vector + or not vector.equals(accelerationvec, self.old_acceleration_vector) + or self.old_yaw~=yaw + or self.updatepct_timer<=0 then--only send update packet if something changed + self.object:setpos(actual_pos) + self.object:setvelocity(velocityvec) + self.object:setacceleration(accelerationvec) + self.object:setyaw(yaw) + self.updatepct_timer=2 + if self.update_animation then + self:update_animation(gp.velocity) + end + end + + + self.old_velocity_vector=velocityvec + self.old_acceleration_vector=accelerationvec + self.old_yaw=yaw + printbm("wagon step", t) +end + +function advtrains.get_real_path_index(train, pit) + local pos_in_train_left=pit + local index=train.index + if pos_in_train_left>(index-math.floor(index))*(train.path_dist[math.floor(index)] or 1) then + pos_in_train_left=pos_in_train_left - (index-math.floor(index))*(train.path_dist[math.floor(index)] or 1) + index=math.floor(index) + while pos_in_train_left>(train.path_dist[index-1] or 1) do + pos_in_train_left=pos_in_train_left - (train.path_dist[index-1] or 1) + index=index-1 + end + index=index-(pos_in_train_left/(train.path_dist[index-1] or 1)) + else + index=index-(pos_in_train_left/(train.path_dist[math.floor(index-1)] or 1)) + end + return index +end + +function wagon:get_on(clicker, seatno) + if not self.seatp then + self.seatp={} + end + if not self.seats[seatno] then return end + if self.seatp[seatno] and self.seatp[seatno]~=clicker:get_player_name() then + self:get_off(seatno) + end + self.seatp[seatno] = clicker:get_player_name() + advtrains.player_to_train_mapping[clicker:get_player_name()]=self.train_id + clicker:set_attach(self.object, "", self.seats[seatno].attach_offset, {x=0,y=0,z=0}) + clicker:set_eye_offset(self.seats[seatno].view_offset, self.seats[seatno].view_offset) +end +function wagon:get_off_plr(pname) + local no=self:get_seatno(pname) + if no then + self:get_off(no) + end +end +function wagon:get_seatno(pname) + for no, cont in pairs(self.seatp) do + if cont==pname then + return no + end + end + return nil +end +function wagon:get_off(seatno) + if not self.seatp[seatno] then return end + local pname = self.seatp[seatno] + local clicker = minetest.get_player_by_name(pname) + advtrains.player_to_train_mapping[pname]=nil + advtrains.clear_driver_hud(pname) + if clicker then + clicker:set_detach() + clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) + local objpos=advtrains.round_vector_floor_y(self.object:getpos()) + local yaw=self.object:getyaw() + local isx=(yaw < math.pi/4) or (yaw > 3*math.pi/4 and yaw < 5*math.pi/4) or (yaw > 7*math.pi/4) + --abuse helper function + for _,r in ipairs({-1, 1}) do + local p=vector.add({x=isx and r or 0, y=0, z=not isx and r or 0}, objpos) + if minetest.get_item_group(minetest.get_node(p).name, "platform")>0 then + minetest.after(0.2, function() clicker:setpos({x=p.x, y=p.y+1, z=p.z}) end) + end + end + end + self.seatp[seatno]=nil +end +function wagon:show_get_on_form(pname) + if not self.initialized then return end + if #self.seats==0 then + if self.has_inventory and self.get_inventory_formspec then + minetest.show_formspec(pname, "advtrains_inv_"..self.unique_id, self:get_inventory_formspec(pname)) + end + return + end + local form, comma="size[5,8]label[0.5,0.5;Select seat:]textlist[0.5,1;4,6;seat;", "" + for seatno, seattbl in ipairs(self.seats) do + local addtext, colorcode="", "" + if self.seatp and self.seatp[seatno] then + colorcode="#FF0000" + addtext=" ("..self.seatp[seatno]..")" + end + form=form..comma..colorcode..seattbl.name..addtext + comma="," + end + form=form..";0,false]" + if self.has_inventory and self.get_inventory_formspec then + form=form.."button_exit[1,7;3,1;inv;Show Inventory]" + end + minetest.show_formspec(pname, "advtrains_geton_"..self.unique_id, form) +end +minetest.register_on_player_receive_fields(function(player, formname, fields) + local uid=string.match(formname, "^advtrains_geton_(.+)$") + if uid then + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then + if fields.inv then + if wagon.has_inventory and wagon.get_inventory_formspec then + minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..uid, wagon:get_inventory_formspec(player:get_player_name())) + end + elseif fields.seat then + local val=minetest.explode_textlist_event(fields.seat) + if val and val.type~="INV" and not wagon.seatp[player:get_player_name()] then + --get on + wagon:get_on(player, val.index) + --will work with the new close_formspec functionality. close exactly this formspec. + minetest.show_formspec(player:get_player_name(), formname, "") + end + end + end + end + end +end) +function wagon:reattach_all() + if not self.seatp then self.seatp={} end + for seatno, pname in pairs(self.seatp) do + local p=minetest.get_player_by_name(pname) + if p then + self:get_on(p ,seatno) + end + end +end +minetest.register_on_joinplayer(function(player) + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized then + wagon:reattach_all() + end + end +end) + +function advtrains.register_wagon(sysname, prototype, desc, inv_img) + setmetatable(prototype, {__index=wagon}) + minetest.register_entity(":advtrains:"..sysname,prototype) + + minetest.register_craftitem(":advtrains:"..sysname, { + description = desc, + inventory_image = inv_img, + wield_image = inv_img, + stack_max = 1, + + on_place = function(itemstack, placer, pointed_thing) + if not pointed_thing.type == "node" then + return + end + + local node=minetest.env:get_node_or_nil(pointed_thing.under) + if not node then print("[advtrains]Ignore at placer position") return itemstack end + local nodename=node.name + if(not advtrains.is_track_and_drives_on(nodename, prototype.drives_on)) then + print("[advtrains]no track here, not placing.") + return itemstack + end + local conn1=advtrains.get_track_connections(node.name, node.param2) + local id=advtrains.create_new_train_at(pointed_thing.under, advtrains.dirCoordSet(pointed_thing.under, conn1)) + + local ob=minetest.env:add_entity(pointed_thing.under, "advtrains:"..sysname) + if not ob then + print("[advtrains]couldn't add_entity, aborting") + end + local le=ob:get_luaentity() + + le.owner=placer:get_player_name() + le.infotext=desc..", owned by "..placer:get_player_name() + + local wagon_uid=le:init_new_instance(id, {}) + + advtrains.add_wagon_to_train(le, id) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + + end, + }) +end + +--[[ + wagons can define update_animation(self, velocity) if they have a speed-dependent animation + this function will be called when the velocity vector changes or every 2 seconds. +]] + + diff --git a/advtrains/advtrains_train_industrial/depends.txt b/advtrains/advtrains_train_industrial/depends.txt new file mode 100644 index 0000000..6f00bf6 --- /dev/null +++ b/advtrains/advtrains_train_industrial/depends.txt @@ -0,0 +1 @@ +advtrains \ No newline at end of file diff --git a/advtrains/advtrains_train_industrial/init.lua b/advtrains/advtrains_train_industrial/init.lua new file mode 100644 index 0000000..379832c --- /dev/null +++ b/advtrains/advtrains_train_industrial/init.lua @@ -0,0 +1,67 @@ +advtrains.register_wagon("engine_industrial", { + mesh="advtrains_engine_industrial.b3d", + textures = {"advtrains_engine_industrial.png"}, + drives_on={default=true}, + max_speed=20, + seats = { + { + name="Driver Stand (left)", + attach_offset={x=-5, y=10, z=-10}, + view_offset={x=0, y=10, z=0}, + driving_ctrl_access=true, + }, + { + name="Driver Stand (right)", + attach_offset={x=5, y=10, z=-10}, + view_offset={x=0, y=10, z=0}, + driving_ctrl_access=true, + }, + }, + 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"}, +}, "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 = function(self) + return "size[8,11]".. + "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. + "list[current_player;main;0,7;8,4;]".. + "listring[]" + end, + inventory_list_sizes = { + box=8*6, + }, +}, "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 = function(self) + return "size[8,11]".. + "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. + "list[current_player;main;0,7;8,4;]".. + "listring[]" + end, + inventory_list_sizes = { + box=8*6, + }, +}, "Industrial wood wagon", "advtrains_wagon_wood_inv.png") diff --git a/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d b/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d new file mode 100644 index 0000000..f1ea485 Binary files /dev/null and b/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d differ diff --git a/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d b/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d new file mode 100644 index 0000000..af2604b Binary files /dev/null and b/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d differ diff --git a/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d b/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d new file mode 100644 index 0000000..0e7fb4b Binary files /dev/null and b/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png b/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png new file mode 100644 index 0000000..38a872f Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png b/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png new file mode 100644 index 0000000..be4e80f Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png new file mode 100644 index 0000000..79b1316 Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png new file mode 100644 index 0000000..03401be Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png new file mode 100644 index 0000000..acc6f72 Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png new file mode 100644 index 0000000..87109dd Binary files /dev/null and b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png differ diff --git a/advtrains/advtrains_train_japan/depends.txt b/advtrains/advtrains_train_japan/depends.txt new file mode 100644 index 0000000..6f00bf6 --- /dev/null +++ b/advtrains/advtrains_train_japan/depends.txt @@ -0,0 +1 @@ +advtrains \ No newline at end of file diff --git a/advtrains/advtrains_train_japan/init.lua b/advtrains/advtrains_train_japan/init.lua new file mode 100644 index 0000000..47f50cf --- /dev/null +++ b/advtrains/advtrains_train_japan/init.lua @@ -0,0 +1,38 @@ +advtrains.register_wagon("engine_japan", { + mesh="advtrains_engine_japan.b3d", + textures = {"advtrains_engine_japan.png"}, + drives_on={default=true}, + max_speed=20, + seats = { + { + name="Default Seat (driver stand)", + attach_offset={x=0, y=10, z=0}, + view_offset={x=0, y=6, z=0}, + driving_ctrl_access=true, + }, + }, + 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"}, +}, "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="Default Seat", + attach_offset={x=0, y=10, z=0}, + view_offset={x=0, y=6, z=0}, + }, + }, + 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"}, +}, "Japanese Train Wagon", "advtrains_wagon_japan_inv.png") + diff --git a/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d b/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d new file mode 100644 index 0000000..f82c33e Binary files /dev/null and b/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d differ diff --git a/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d b/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d new file mode 100644 index 0000000..7970438 Binary files /dev/null and b/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png b/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png new file mode 100644 index 0000000..b286b38 Binary files /dev/null and b/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png b/advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png new file mode 100644 index 0000000..6af0636 Binary files /dev/null and b/advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png b/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png new file mode 100644 index 0000000..bee565e Binary files /dev/null and b/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png b/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png new file mode 100644 index 0000000..3e6357c Binary files /dev/null and b/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png differ diff --git a/advtrains/advtrains_train_steam/depends.txt b/advtrains/advtrains_train_steam/depends.txt new file mode 100644 index 0000000..6f00bf6 --- /dev/null +++ b/advtrains/advtrains_train_steam/depends.txt @@ -0,0 +1 @@ +advtrains \ No newline at end of file diff --git a/advtrains/advtrains_train_steam/init.lua b/advtrains/advtrains_train_steam/init.lua new file mode 100644 index 0000000..ca52516 --- /dev/null +++ b/advtrains/advtrains_train_steam/init.lua @@ -0,0 +1,121 @@ +advtrains.register_wagon("newlocomotive", { + mesh="advtrains_engine_steam.b3d", + textures = {"advtrains_newlocomotive.png"}, + is_locomotive=true, + drives_on={default=true}, + max_speed=10, + seats = { + { + name="Driver Stand (left)", + attach_offset={x=-5, y=10, z=-10}, + view_offset={x=0, y=6, z=0}, + driving_ctrl_access=true, + }, + { + name="Driver Stand (right)", + attach_offset={x=5, y=10, z=-10}, + view_offset={x=0, y=6, z=0}, + driving_ctrl_access=true, + }, + }, + visual_size = {x=1, y=1}, + wagon_span=1.85, + collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, + --update_animation=function(self, velocity) + --if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then + -- self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) + --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 4"}, +}, "Steam Engine", "advtrains_newlocomotive_inv.png") +advtrains.register_wagon("wagon_default", { + mesh="advtrains_wagon.b3d", + textures = {"advtrains_wagon.png"}, + drives_on={default=true}, + max_speed=10, + seats = { + { + name="Default Seat", + attach_offset={x=0, y=10, z=0}, + view_offset={x=0, y=6, z=0}, + }, + }, + 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"}, +}, "Passenger Wagon", "advtrains_wagon_inv.png") +advtrains.register_wagon("wagon_box", { + mesh="advtrains_wagon.b3d", + textures = {"advtrains_wagon_box.png"}, + drives_on={default=true}, + max_speed=10, + seats = {}, + 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 = function(self) + return "size[8,11]".. + "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. + "list[current_player;main;0,7;8,4;]".. + "listring[]" + end, + inventory_list_sizes = { + box=8*6, + }, +}, "Box Wagon", "advtrains_wagon_box_inv.png") + +minetest.register_craft({ + output = 'advtrains:newlocomotive', + recipe = { + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + {'default:steelblock', 'dye:black', 'default:steelblock'}, + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + }, +}) +minetest.register_craft({ + output = 'advtrains:wagon_default', + recipe = { + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + {'default:steelblock', 'dye:dark_green', 'default:steelblock'}, + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + }, +}) +minetest.register_craft({ + output = 'advtrains:wagon_box', + recipe = { + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + {'default:steelblock', 'default:chest', 'default:steelblock'}, + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + }, +}) diff --git a/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d b/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d new file mode 100644 index 0000000..36bdd15 Binary files /dev/null and b/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d differ diff --git a/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d b/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d new file mode 100644 index 0000000..5c8214c Binary files /dev/null and b/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png new file mode 100644 index 0000000..e461bc7 Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png new file mode 100644 index 0000000..8d3fafb Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon.png new file mode 100644 index 0000000..c37c979 Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_wagon.png differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png new file mode 100644 index 0000000..8bfbe06 Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png new file mode 100644 index 0000000..480f245 Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png new file mode 100644 index 0000000..0b72ac3 Binary files /dev/null and b/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png differ diff --git a/advtrains/advtrains_train_subway/depends.txt b/advtrains/advtrains_train_subway/depends.txt new file mode 100644 index 0000000..6f00bf6 --- /dev/null +++ b/advtrains/advtrains_train_subway/depends.txt @@ -0,0 +1 @@ +advtrains \ No newline at end of file diff --git a/advtrains/advtrains_train_subway/init.lua b/advtrains/advtrains_train_subway/init.lua new file mode 100644 index 0000000..b5bdb18 --- /dev/null +++ b/advtrains/advtrains_train_subway/init.lua @@ -0,0 +1,30 @@ + +advtrains.register_wagon("subway_wagon", { + mesh="advtrains_subway_train.b3d", + textures = {"advtrains_subway_train.png"}, + drives_on={default=true}, + max_speed=15, + seats = { + { + name="Default Seat (driver stand)", + attach_offset={x=0, y=10, z=0}, + view_offset={x=0, y=6, z=0}, + driving_ctrl_access=true, + }, + }, + visual_size = {x=1, y=1}, + wagon_span=1.8, + collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, + is_locomotive=true, + drops={"default:steelblock 4"}, +}, "Subway Passenger Wagon", "advtrains_subway_train_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'}, + }, +}) diff --git a/advtrains/advtrains_train_subway/models/advtrains_subway_train.b3d b/advtrains/advtrains_train_subway/models/advtrains_subway_train.b3d new file mode 100644 index 0000000..a824d33 Binary files /dev/null and b/advtrains/advtrains_train_subway/models/advtrains_subway_train.b3d differ diff --git a/advtrains/advtrains_train_subway/textures/advtrains_subway_train.png b/advtrains/advtrains_train_subway/textures/advtrains_subway_train.png new file mode 100644 index 0000000..1d569f3 Binary files /dev/null and b/advtrains/advtrains_train_subway/textures/advtrains_subway_train.png differ diff --git a/advtrains/advtrains_train_subway/textures/advtrains_subway_train_inv.png b/advtrains/advtrains_train_subway/textures/advtrains_subway_train_inv.png new file mode 100644 index 0000000..1d0e809 Binary files /dev/null and b/advtrains/advtrains_train_subway/textures/advtrains_subway_train_inv.png differ diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt deleted file mode 100644 index 6b1aa2e..0000000 --- a/advtrains/api_doc.txt +++ /dev/null @@ -1,114 +0,0 @@ -Advanced Trains [advtrains] API documentation --------- -To use the API, mods must depend on 'advtrains'. -All boolean values in definition tables default to 'false' and can be omitted. -### Wagons -Wagons are registered using the function - -advtrains.register_wagon(name, prototype, description, inventory_image) -- 'name' is the internal name of the wagon. It is registered inside the 'advtrains:' namespace. - Example: A wagon with name="engine_tgv" will be registered as "advtrains:engine_tgv". -- 'prototype' is the lua entity prototype. The regular definition keys for luaentites apply. Additional required and optional properties see below. DO NOT define 'on_step', 'on_activate', 'on_punch', 'on_rightclick' and 'get_staticdata' since these will be overridden. Use 'custom_*' instead. -- 'description' is the description of the inventory item that is used to place the wagon. -- 'inventory_image' is the inventory image of said item. - -# Wagon prototype properties -{ - ... all regular luaentity properties (mesh, textures, collisionbox a.s.o)... - drives_on = {default=true}, - ^- used to define the tracktypes (see below) that wagon can drive on. The tracktype identifiers are given as keys, similar to privileges) - max_speed = 10, - ^- optional, default 10: defines the maximum speed this wagon can drive. The maximum speed of a train is determined by the wagon with the lowest max_speed value. - seats = { - { - name="Left front window", - ^- display name of this seat - attach_offset={x=0, y=10, z=0}, - ^- this value is passed to 'set_attach' - view_offset={x=0, y=6, z=0}, - ^- player:set_eye_offset is called with this parameter. - driving_ctrl_access=false, - ^- If the seat is a driver stand, and players sitting here should get access to the train's driving control. - - }, - }, - ^- contains zero or more seat definitions. A seat is a place where a player can be attached when getting on a wagon. - wagon_span=2, - ^- How far this wagon extends from its base position. Is the half of the wagon length. - ^- Used to determine in which distance the other wagons have to be positioned. Will require tweaking. - drops = {"default:steelblock 3"} - ^- List of itemstrings what to drop when the wagon is destroyed - - has_inventory = false - ^- If this wagon has an inventory. The inventory is saved with the wagon. - ^- the following settings are ignored if not. - inventory_list_sizes = { - box=8*6, - }, - ^- List of assignments of type list_name=size. - ^- For every entry, an inventory list is created with the specified size. - get_inventory_formspec = function(self, player_name) - return "" - end, - ^- Function that should return the formspec to be displayed when requests to open the wagon's inventory - ^- Use "list[detached:advtrains_wgn_"..self.unique_id..";;,;,;]" to display a wagon's inventory list. - - custom_on_step = function(self, dtime) end - ^- optional: Execute custom code on every step - custom_on_activate = function(self, dtime_s) end - ^- optional: Execute custom code on activate. Staticdata does not need to be saved and restored since all properties written in 'self' are preserved over unloads. - update_animation = function(self, velocity) end - ^- optional: Function that is called whenever the train's velocity changes or every 2 seconds. Used to call 'self.object:update_animation()' if needed. - -} - -# Notes on wagons - -- Every wagon has the field 'unique_id' which assigns each wagon a random id. -- All properties written in the lua entity (self) are saved and restored automatically. Minetest's internal staticdata is only used to save the unique_id of the wagon, which serves as a key in an externally saved table. -- Assuming Z Axis as the axis parallel to the tracks and Y Axis as the one pointing into the sky, wagon models should be dimensioned in a way that: - - their origin is centered in X and Z direction - - their origin lies 0.5 units above the bottom of the model - - the overall extent in X and Y direction is <=3 units -- wagon_span is then the distance between the model origin and the Z axis extent. - -### Tracks -Most modders will be satisfied with the built-in tracks. If cog railways, maglev trains and mine trains are added, it is necessary to understand the definition of tracks. Although the tracks API is there, explaining it would require more effort than me creating the wanted definitions myself. Contact me if you need to register your own rails using my registration functions. - -However, it is still possible to register single rails by understanding the node properties of rails. -minetest.register_node(nodename, { - ... usual node definition ... - groups = { - advtrains_track_=1 - ^- this group tells that the node is a track - not_blocking_trains=1, - ^- this group tells that the node should not block trains although it's walkable. - }, - connect1 = 0, - connect2 = 8, - ^- These values tell the direction (horizontal) the rail ends are pointing to. 0 means +Z, then rotation values increase clockwise. For a translation of directions to positions see helpers.lua. - rely1=0, - rely2=0, - ^- the Y height of the rail end 1/2. A value of >=1 means that the rail end points to the next y layer at rely-1 - railheight=0, - ^- the height value of this rail that is saved in the path. usually the median of rely1 and rely2. - - can_dig=function(pos) - return not advtrains.is_train_at_pos(pos) - end, - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.reset_trackdb_position(pos) - end, - after_place_node=function(pos) - advtrains.reset_trackdb_position(pos) - end, - ^- the code in these 3 default minetest API functions is required for advtrains to work, however you can add your own code - - advtrains = { - on_train_enter=function(pos, train_id) end - ^- called when a train enters the rail - on_train_leave=function(pos, train_id) end - ^- called when a train leaves the rail - } -}) \ No newline at end of file diff --git a/advtrains/atc.lua b/advtrains/atc.lua deleted file mode 100644 index f070b20..0000000 --- a/advtrains/atc.lua +++ /dev/null @@ -1,294 +0,0 @@ ---atc.lua ---registers and controls the ATC system - -local atc={} --- ATC persistence table -atc.controllers = {} ---contents: {command="...", arrowconn=0-15 where arrow points} - -advtrains.fpath_atc=minetest.get_worldpath().."/advtrains_atc" -local file, err = io.open(advtrains.fpath_atc, "r") -if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed loading advtrains atc save file "..er) -else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - atc.controllers=tbl.controllers - end - file:close() -end -function atc.save() - --leave space for more save data. - local datastr = minetest.serialize({controllers = atc.controllers}) - if not datastr then - minetest.log("error", "[advtrains] Failed to serialize trackdb data!") - return - end - local file, err = io.open(advtrains.fpath_atc, "w") - if err then - return err - end - file:write(datastr) - file:close() -end - ---call from advtrains.detector subprogram - -function atc.trigger_controller_train_enter(pos, train_id) - atc.send_command(pos) -end - ---general - -function atc.send_command(pos) - local pts=minetest.pos_to_string(pos) - if atc.controllers[pts] then - print("Called send_command at "..pts) - local train_id = advtrains.detector.on_node[pts] - if train_id then - if advtrains.trains[train_id] then - print("send_command inside if: "..sid(train_id)) - atc.train_reset_command(train_id) - local arrowconn=atc.controllers[pts].arrowconn - local train=advtrains.trains[train_id] - for index, ppos in pairs(train.path) do - if vector.equals(advtrains.round_vector_floor_y(ppos), pos) then - advtrains.trains[train_id].atc_arrow = - vector.equals( - advtrains.dirCoordSet(pos, arrowconn), - advtrains.round_vector_floor_y(train.path[index+train.movedir]) - ) - advtrains.trains[train_id].atc_command=atc.controllers[pts].command - print("Sending ATC Command: "..atc.controllers[pts].command) - end - end - end - end - end - return false -end - -function atc.train_reset_command(train_id) - advtrains.trains[train_id].atc_command=nil - advtrains.trains[train_id].atc_delay=0 - advtrains.trains[train_id].atc_brake_target=nil - advtrains.trains[train_id].atc_wait_finish=nil - advtrains.trains[train_id].atc_arrow=nil -end - ---nodes -local idxtrans={static=1, mesecon=2, digiline=3} -local apn_func=function(pos) - advtrains.reset_trackdb_position(pos) - local meta=minetest.get_meta(pos) - if meta then - meta:set_string("infotext", "ATC controller, unconfigured.") - meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) - end -end - -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_atc", - texture_prefix="advtrains_dtrack_atc", - models_prefix="advtrains_dtrack_detector", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail_atc.png", - description="ATC controller", - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_place_node=apn_func, - on_place_rail=apn_func, - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.reset_trackdb_position(pos) - local pts=minetest.pos_to_string(pos) - atc.controllers[pts]=nil - end, - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - minetest.chat_send_player(player:get_player_name(), "This position is protected!") - return - end - local meta=minetest.get_meta(pos) - if meta then - if not fields.save then - --maybe only the dropdown changed - if fields.mode then - meta:set_string("mode", idxtrans[fields.mode]) - meta:set_string("infotext", "ATC controller, mode "..fields.mode.."\n"..( fields.mode=="digiline" and "Channel: "..meta:get_string("channel") or "Command: "..meta:get_string("command") ) ) - meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) - end - return - end - meta:set_string("mode", idxtrans[fields.mode]) - meta:set_string("command", fields.command) - meta:set_string("command_on", fields.command_on) - meta:set_string("channel", fields.channel) - meta:set_string("infotext", "ATC controller, mode "..fields.mode.."\n"..( fields.mode=="digiline" and "Channel: "..meta:get_string("channel") or "Command: "..meta:get_string("command") ) ) - meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) - - local pts=minetest.pos_to_string(pos) - local _, conn1=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) - atc.controllers[pts]={command=fields.command, arrowconn=conn1} - atc.send_command(pos) - end - end, - } - end -}, advtrains.trackpresets.t_30deg_straightonly) - - -function atc.get_atc_controller_formspec(pos, meta) - local mode=tonumber(meta:get_string("mode")) or 1 - local command=meta:get_string("command") - local command_on=meta:get_string("command_on") - local channel=meta:get_string("channel") - local formspec="size[8,6]".. - "dropdown[0,0;3;mode;static,mesecon,digiline;"..mode.."]" - if mode<3 then - formspec=formspec.."field[0.5,1.5;7,1;command;Command;"..minetest.formspec_escape(command).."]" - if tonumber(mode)==2 then - formspec=formspec.."field[0.5,3;7,1;command_on;Command (on);"..minetest.formspec_escape(command_on).."]" - end - else - formspec=formspec.."field[0.5,1.5;7,1;channel;Digiline channel;"..minetest.formspec_escape(channel).."]" - end - return formspec.."button_exit[0.5,4.5;7,1;save;Save]" -end - ---from trainlogic.lua train step -local matchptn={ - ["SM"]=function(id, train) - train.tarvelocity=train.max_speed - return 2 - end, - ["S([0-9]+)"]=function(id, train, match) - train.tarvelocity=tonumber(match) - return #match+1 - end, - ["B([0-9]+)"]=function(id, train, match) - if train.velocity>tonumber(match) then - train.atc_brake_target=tonumber(match) - if train.tarvelocity>train.atc_brake_target then - train.tarvelocity=train.atc_brake_target - end - end - return #match+1 - end, - ["W"]=function(id, train) - train.atc_wait_finish=true - return 1 - end, - ["D([0-9]+)"]=function(id, train, match) - train.atc_delay=tonumber(match) - return #match+1 - end, - ["R"]=function(id, train) - if train.velocity<=0 then - train.movedir=train.movedir*-1 - train.atc_arrow = not train.atc_arrow - else - print("ATC Reverse command warning: didn't reverse train!") - end - return 1 - end, -} - -function atc.execute_atc_command(id, train) - --strip whitespaces - local command=string.match(train.atc_command, "^%s*(.*)$") - - - if string.match(command, "^%s*$") then - train.atc_command=nil - return - end - --conditional statement? - local is_cond, cond_applies - local cond, rest=string.match(command, "^I([%+%-])(.+)$") - if cond then - is_cond=true - if cond=="+" then - cond_applies=train.atc_arrow - end - if cond=="-" then - cond_applies=not train.atc_arrow - end - else - cond, compare, rest=string.match(command, "^I([<>]=?)([0-9]+)(.+)$") - if cond and compare then - is_cond=true - if cond=="<" then - cond_applies=train.velocity" then - cond_applies=train.velocity>tonumber(compare) - end - if cond=="<=" then - cond_applies=train.velocity<=tonumber(compare) - end - if cond==">=" then - cond_applies=train.velocity>=tonumber(compare) - end - end - end - if is_cond then - print("Evaluating if statement: "..command) - print("Cond: "..(cond or "nil")) - print("Applies: "..(cond_applies and "true" or "false")) - print("Rest: "..rest) - --find end of conditional statement - local nest, pos, elsepos=0, 1 - while nest>=0 do - if pos>#rest then - print("ATC command syntax error: I statement not closed: "..command) - atc.train_reset_command(id) - return - end - local char=string.sub(rest, pos, pos) - if char=="I" then - nest=nest+1 - end - if char==";" then - nest=nest-1 - end - if nest==0 and char=="E" then - elsepos=pos+0 - end - pos=pos+1 - end - if not elsepos then elsepos=pos-1 end - if cond_applies then - command=string.sub(rest, 1, elsepos-1)..string.sub(rest, pos) - else - command=string.sub(rest, elsepos+1, pos-2)..string.sub(rest, pos) - end - print("Result: "..command) - train.atc_command=command - atc.execute_atc_command(id, train) - return - else - for pattern, func in pairs(matchptn) do - local match=string.match(command, "^"..pattern) - if match then - local patlen=func(id, train, match) - - print("Executing: "..string.sub(command, 1, patlen)) - - train.atc_command=string.sub(command, patlen+1) - if train.atc_delay<=0 and not train.atc_wait_finish then - --continue (recursive, cmds shouldn't get too long, and it's a end-recursion.) - atc.execute_atc_command(id, train) - end - return - end - end - end - print("ATC command parse error: "..command) - atc.train_reset_command(id) -end - ---move table to desired place -advtrains.atc=atc diff --git a/advtrains/atc_command.txt b/advtrains/atc_command.txt deleted file mode 100644 index fa846e3..0000000 --- a/advtrains/atc_command.txt +++ /dev/null @@ -1,68 +0,0 @@ -ATC Command Syntax - -A train runs the current ATC command once it receives it, including delayed instructions. If the train receives a new command, the current command is discarded. -Spaces can be inserted into commands as needed and are ignored. - -# simple commands: - -S<[0-9]+ speed or 'M'> -Set target speed of train to . Accelerates if slower, rolls if faster. 'M' means maximum speed. -Execution of command continues immediately. - -B<[0-9]+ speed> -Brake until speed is reached. If faster, apply brakes, if slower, do nothing. -Execution of command continues immediately. - -Examples: -SM : accelerate to maximum speed -S0 : roll to stand -B0 : brake to stand -S0B3 or B3S0: brake to 3, then roll to stand. - -W -Wait until S and/or B commands reached the desired speed before continuing execution. - -D<[0-9]+ time> -Delay: Wait for time seconds before continuing execution. - -R -Reverse: change movement direction of train. ONLY WORKS WHEN TRAIN STANDS, else no-op. -Use B0WR to definitely change direction. - -Examples: -B0 W R D10 SM -Subway train stopping in dead end station and returning in opposite direction - -# conditional statements: - -I; -Execute code only if condition applies -IE; -Execute code1 only if condition applies, else execute code2 - -Conditions: -+ / - -Tests the train's movement direction against the arrow on the ATC rail: M+ is true when train drives in direction of arrow. - -[/<=/>=][speed] -Test if train's speed is greater or smaller than the given value - -Examples: -I- B0 W R ; S8 -If the train drives in the 'wrong' direction, stop and reverse; independently accelerate to speed 8 afterwards. - -I<8 S8 ; -If the train is slower than 8, accelerate to 8. - -# ATC controller operation modes -static: Only give 1 static command. -mesecon: Give 2 different commands depending on if the controller is mesecon-powered or not -digiline: Don't give any commands by itself. When a train passes, a digiline message in the form of "[+/-][speed]" is sent on the set channel (where +/- means the same as with conditions). Any digiline message sent to the controller will be interpreted as ATC command and sent to the train. - -# Persistence -ATC controllers that are configured as 'static' or 'mesecon' are persistent over mapblock unloads and will even command the train when the mapblock is unloaded. This is not possible with digilines since these do not work in unloaded mapchunks. - -# LUA ATC controller (in development) -The LUA ATC Controller will operate by using LUA code. All operations shown above will have a function equivalent. Additionally all LUA ATC controllers share an environment and setting signal and switch status will be possible to allow for complicated railway systems/fully automated subways a.s.o. -Also planned: -- digicompute add-on to allow computer access to the ATC environment (railway maps... ... ... ... ...) diff --git a/advtrains/couple.lua b/advtrains/couple.lua deleted file mode 100644 index 974f450..0000000 --- a/advtrains/couple.lua +++ /dev/null @@ -1,156 +0,0 @@ ---couple.lua ---defines couple entities. - ---advtrains:discouple ---set into existing trains to split them when punched. ---they are attached to the wagons. ---[[fields -wagon - -wagons keep their couple entity minetest-internal id inside the field discouple_id. if it refers to nowhere, they will spawn a new one if player is near -]] - - -minetest.register_entity("advtrains:discouple", { - visual="sprite", - textures = {"advtrains_discouple.png"}, - collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, - visual_size = {x=1, y=1}, - initial_sprite_basepos = {x=0, y=0}, - - is_discouple=true, - on_activate=function(self, staticdata) - if staticdata=="DISCOUPLE" then - --couple entities have no right to exist further... - self.object:remove() - return - end - self.object:set_armor_groups({immortal=1}) - end, - get_staticdata=function() return "DISCOUPLE" end, - on_punch=function(self, player) - --only if player owns at least one wagon next to this - local own=player:get_player_name() - if self.wagon.owner and self.wagon.owner==own then - local train=advtrains.trains[self.wagon.train_id] - local nextwgn_id=train.trainparts[self.wagon.pos_in_trainparts-1] - for aoi, le in pairs(minetest.luaentities) do - if le and le.is_wagon then - if le.unique_id==nextwgn_id then - if le.owner and le.owner~=own then - minetest.chat_send_player(own, "You need to own at least one neighboring wagon to destroy this couple.") - return - end - end - end - end - advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua - self.object:remove() - else - minetest.chat_send_player(own, "You need to own at least one neighboring wagon to destroy this couple.") - end - end, - on_step=function(self, dtime) - local t=os.clock() - if not self.wagon then - self.object:remove() - return - end - --getyaw seems to be a reliable method to check if an object is loaded...if it returns nil, it is not. - if not self.wagon.object:getyaw() then - self.object:remove() - return - end - local velocityvec=self.wagon.object:getvelocity() - self.updatepct_timer=(self.updatepct_timer or 0)-dtime - if not self.old_velocity_vector or not vector.equals(velocityvec, self.old_velocity_vector) or self.updatepct_timer<=0 then--only send update packet if something changed - local flipsign=self.wagon.wagon_flipped and -1 or 1 - self.object:setpos(vector.add(self.wagon.object:getpos(), {y=0, x=-math.sin(self.wagon.object:getyaw())*self.wagon.wagon_span*flipsign, z=math.cos(self.wagon.object:getyaw())*self.wagon.wagon_span*flipsign})) - self.object:setvelocity(velocityvec) - self.updatepct_timer=2 - end - printbm("discouple_step", t) - end, -}) - ---advtrains:couple ---when two trains overlap with their end-positions, this entity will be spawned and both trains set its id into appropiate fields for them to know when to free them again. The entity will destroy automatically when it recognizes that any of the trains left the common position. ---[[fields -train_id_1 -train_id_2 -train1_is_backpos -train2_is_backpos -]] - - -minetest.register_entity("advtrains:couple", { - visual="sprite", - textures = {"advtrains_couple.png"}, - collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, - visual_size = {x=1, y=1}, - initial_sprite_basepos = {x=0, y=0}, - - is_couple=true, - on_activate=function(self, staticdata) - if staticdata=="COUPLE" then - --couple entities have no right to exist further... - self.object:remove() - return - end - end, - get_staticdata=function(self) return "COUPLE" end, - on_rightclick=function(self) - if not self.train_id_1 or not self.train_id_2 then return end - - local id1, id2=self.train_id_1, self.train_id_2 - - if self.train1_is_backpos and not self.train2_is_backpos then - advtrains.do_connect_trains(id1, id2) - --case 2 (second train is front) - elseif self.train2_is_backpos and not self.train1_is_backpos then - advtrains.do_connect_trains(id2, id1) - --case 3 - elseif self.train1_is_backpos and self.train2_is_backpos then - advtrains.invert_train(id2) - advtrains.do_connect_trains(id1, id2) - --case 4 - elseif not self.train1_is_backpos and not self.train2_is_backpos then - advtrains.invert_train(id1) - advtrains.do_connect_trains(id1, id2) - end - self.object:remove() - end, - on_step=function(self, dtime) - local t=os.clock() - if not self.train_id_1 or not self.train_id_2 then print("wtf no train ids?")return end - local train1=advtrains.trains[self.train_id_1] - local train2=advtrains.trains[self.train_id_2] - if not train1 or not train2 or not train1.path or not train2.path or not train1.index or not train2.index then - self.object:remove() - return - end - - local tp1 - if not self.train1_is_backpos then - tp1=advtrains.get_real_index_position(train1.path, train1.index) - else - tp1=advtrains.get_real_index_position(train1.path, advtrains.get_train_end_index(train1)) - end - local tp2 - if not self.train2_is_backpos then - tp2=advtrains.get_real_index_position(train2.path, train2.index) - else - tp2=advtrains.get_real_index_position(train2.path, advtrains.get_train_end_index(train2)) - end - if not tp1 or not tp2 or not (vector.distance(tp1,tp2)<1.5) then - self.object:remove() - return - else - local pos_median=advtrains.pos_median(tp1, tp2) - if not vector.equals(pos_median, self.object:getpos()) then - self.object:setpos(pos_median) - end - end - printbm("couple step", t) - end, -}) diff --git a/advtrains/crafting.lua b/advtrains/crafting.lua deleted file mode 100644 index 5ba12ce..0000000 --- a/advtrains/crafting.lua +++ /dev/null @@ -1,71 +0,0 @@ ---advtrains by orwell96, see readme.txt and license.txt ---crafting.lua ---registers crafting recipes - ---tracks -minetest.register_craft({ - output = 'advtrains:dtrack_placer 50', - recipe = { - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - }, -}) -minetest.register_craft({ - type = "shapeless", - output = 'advtrains:dtrack_slopeplacer 2', - recipe = { - "advtrains:dtrack_placer", - "advtrains:dtrack_placer", - "default:gravel", - }, -}) - -minetest.register_craft({ - output = 'advtrains:dtrack_bumper_placer 2', - recipe = { - {'default:wood', 'dye:red'}, - {'default:steel_ingot', 'default:steel_ingot'}, - {'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, - }, -}) -minetest.register_craft({ - type="shapeless", - output = 'advtrains:dtrack_detector_off_placer', - recipe = { - "advtrains:dtrack_placer", - "mesecons:wire_00000000_off" - }, -}) ---signals -minetest.register_craft({ - output = 'advtrains:retrosignal_off 2', - recipe = { - {'dye:red', 'default:steel_ingot', 'default:steel_ingot'}, - {'', '', 'default:steel_ingot'}, - {'', '', 'default:steel_ingot'}, - }, -}) -minetest.register_craft({ - output = 'advtrains:signal_off 2', - recipe = { - {'', 'dye:red', 'default:steel_ingot'}, - {'', 'dye:dark_green', 'default:steel_ingot'}, - {'', '', 'default:steel_ingot'}, - }, -}) - ---trackworker -minetest.register_craft({ - output = 'advtrains:trackworker', - recipe = { - {'default:diamond'}, - {'screwdriver:screwdriver'}, - {'default:steel_ingot'}, - }, -}) - - - ---misc_nodes ---crafts for platforms see misc_nodes.lua diff --git a/advtrains/damage.lua b/advtrains/damage.lua deleted file mode 100644 index b39fe67..0000000 --- a/advtrains/damage.lua +++ /dev/null @@ -1,26 +0,0 @@ ---damage.lua ---a globalstep that damages players overrolled by trains. - -advtrains.player_to_train_mapping={} - -local tmr=0 -minetest.register_globalstep(function(dtime) - tmr=tmr-dtime - if tmr<=0 then - - for _, player in pairs(minetest.get_connected_players()) do - local pos=player:getpos() - for _, object in pairs(minetest.get_objects_inside_radius(pos, 1)) do - local le=object:get_luaentity() - if le and le.is_wagon and le.initialized and le:train() then - if (not advtrains.player_to_train_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_train_mapping[player:get_player_name()]) and math.abs(le:train().velocity)>2 then - --player:punch(object, 1000, {damage={fleshy=3*math.abs(le:train().velocity)}}) - player:set_hp(player:get_hp()-math.abs(le:train().velocity)-3) - end - end - end - end - - tmr=0.5 - end -end) diff --git a/advtrains/debugitems.lua b/advtrains/debugitems.lua deleted file mode 100644 index b3164ff..0000000 --- a/advtrains/debugitems.lua +++ /dev/null @@ -1,36 +0,0 @@ -minetest.register_tool("advtrains:tunnelborer", -{ - description = "tunnelborer", - groups = {cracky=1}, -- key=name, value=rating; rating=1..3. - inventory_image = "drwho_screwdriver.png", - wield_image = "drwho_screwdriver.png", - stack_max = 1, - range = 7.0, - - on_place = function(itemstack, placer, pointed_thing) - - end, - --[[ - ^ Shall place item and return the leftover itemstack - ^ default: minetest.item_place ]] - on_use = function(itemstack, user, pointed_thing) - if pointed_thing.type=="node" then - for x=-1,1 do - for y=-1,1 do - for z=-1,1 do - minetest.remove_node(vector.add(pointed_thing.under, {x=x, y=y, z=z})) - end - end - end - end - end, ---[[ -^ default: nil -^ Function must return either nil if no item shall be removed from -inventory, or an itemstack to replace the original itemstack. -e.g. itemstack:take_item(); return itemstack -^ Otherwise, the function is free to do what it wants. -^ The default functions handle regular use cases. -]] -} -) diff --git a/advtrains/depends.txt b/advtrains/depends.txt deleted file mode 100644 index 20aa884..0000000 --- a/advtrains/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -mesecons? \ No newline at end of file diff --git a/advtrains/description.txt b/advtrains/description.txt deleted file mode 100644 index ecc5d58..0000000 --- a/advtrains/description.txt +++ /dev/null @@ -1,8 +0,0 @@ -Advanced Trains v1.3.0, by orwell and contributors. Also see readme. -Good-looking, realistic trains for minetest. - -For crafting recipes, see manual.pdf - -Website: http://advtrains.bleipb.de/ -Manual: https://github.com/orwell96/advtrains/blob/master/manual.pdf -Forum : https://forum.minetest.net/viewtopic.php?f=11&t=14726 \ No newline at end of file diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua deleted file mode 100644 index 1a02621..0000000 --- a/advtrains/helpers.lua +++ /dev/null @@ -1,248 +0,0 @@ ---advtrains by orwell96, see readme.txt -local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end - -advtrains.dir_trans_tbl={ - [0]={x=0, z=1}, - [1]={x=1, z=2}, - [2]={x=1, z=1}, - [3]={x=2, z=1}, - [4]={x=1, z=0}, - [5]={x=2, z=-1}, - [6]={x=1, z=-1}, - [7]={x=1, z=-2}, - [8]={x=0, z=-1}, - [9]={x=-1, z=-2}, - [10]={x=-1, z=-1}, - [11]={x=-2, z=-1}, - [12]={x=-1, z=0}, - [13]={x=-2, z=1}, - [14]={x=-1, z=1}, - [15]={x=-1, z=2}, -} - -function advtrains.dirCoordSet(coord, dir) - local x,z - if advtrains.dir_trans_tbl[dir] then - x,z=advtrains.dir_trans_tbl[dir].x, advtrains.dir_trans_tbl[dir].z - else - error("advtrains: in helpers.lua/dirCoordSet() given dir="..(dir or "nil")) - end - return {x=coord.x+x, y=coord.y, z=coord.z+z} -end -function advtrains.dirToCoord(dir) - return advtrains.dirCoordSet({x=0, y=0, z=0}, dir) -end - -function advtrains.maxN(list, expectstart) - local n=expectstart or 0 - while list[n] do - n=n+1 - end - return n-1 -end - -function advtrains.minN(list, expectstart) - local n=expectstart or 0 - while list[n] do - n=n-1 - end - return n+1 -end - ---vertical_transmit: ---[[ -rely1, rely2 tell to which height the connections are pointed to. 1 means it will go up the next node - -]] - -function advtrains.conway(midreal, prev, drives_on)--in order prev,mid,return - local mid=advtrains.round_vector_floor_y(midreal) - - if not advtrains.get_rail_info_at(advtrains.round_vector_floor_y(prev), drives_on) then - return nil - end - - local midnode_ok, middir1, middir2, midrely1, midrely2=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(mid), drives_on) - if not midnode_ok then - return nil - end - - local next, chkdir, chkrely, y_offset - y_offset=0 - --print("[advtrains] in order mid1,mid2",middir1,middir2) - --try if it is dir1 - local cor1=advtrains.dirCoordSet(mid, middir2)--<<<< - if math.floor(cor1.x+0.5)==math.floor(prev.x+0.5) and math.floor(cor1.z+0.5)==math.floor(prev.z+0.5) then--this was previous - next=advtrains.dirCoordSet(mid, middir1) - if midrely1>=1 then - next.y=next.y+1 - --print("[advtrains]found midrely1 to be >=1: next is now "..(next and minetest.pos_to_string(next) or "nil")) - y_offset=1 - end - chkdir=middir1 - chkrely=midrely1 - --print("[advtrains]dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") - end - --dir2??? - local cor2=advtrains.dirCoordSet(mid, middir1)--<<<< - if math.floor(cor2.x+0.5)==math.floor(prev.x+0.5) and math.floor(cor2.z+0.5)==math.floor(prev.z+0.5) then - next=advtrains.dirCoordSet(mid, middir2)--dir2 wird überprüft, alles gut. - if midrely2>=1 then - next.y=next.y+1 - --print("[advtrains]found midrely2 to be >=1: next is now "..(next and minetest.pos_to_string(next) or "nil")) - y_offset=1 - end - chkdir=middir2 - chkrely=midrely2 - --print("[advtrains] dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") - end - --print("[advtrains]dir applied next pos: "..(next and minetest.pos_to_string(next) or "nil").."(chkdir is "..(chkdir or "nil")..", y-offset "..y_offset..")") - --is there a next - if not next then - --print("[advtrains]in conway: no next rail(nil), returning!") - return nil - end - - local nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) - - --is it a rail? - if(not nextnode_ok) then - --print("[advtrains]in conway: next "..minetest.pos_to_string(next).." not a rail, trying one node below!") - next.y=next.y-1 - y_offset=y_offset-1 - - nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) - if(not nextnode_ok) then - --print("[advtrains]in conway: one below "..minetest.pos_to_string(next).." is not a rail either, returning!") - return nil - end - end - - --is this next rail connecting to the mid? - if not ( (((nextdir1+8)%16)==chkdir and nextrely1==chkrely-y_offset) or (((nextdir2+8)%16)==chkdir and nextrely2==chkrely-y_offset) ) then - --print("[advtrains]in conway: next "..minetest.pos_to_string(next).." not connecting, trying one node below!") - next.y=next.y-1 - y_offset=y_offset-1 - - nextnode_ok, nextdir1, nextdir2, nextrely1, nextrely2, nextrailheight=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(next), drives_on) - if(not nextnode_ok) then - --print("[advtrains]in conway: (at connecting if check again) one below "..minetest.pos_to_string(next).." is not a rail either, returning!") - return nil - end - if not ( (((nextdir1+8)%16)==chkdir and nextrely1==chkrely) or (((nextdir2+8)%16)==chkdir and nextrely2==chkrely) ) then - --print("[advtrains]in conway: one below "..minetest.pos_to_string(next).." rail not connecting, returning!") - --print("[advtrains] in order mid1,2,next1,2,chkdir "..middir1.." "..middir2.." "..nextdir1.." "..nextdir2.." "..chkdir) - return nil - end - end - - --print("[advtrains]conway found rail.") - return vector.add(advtrains.round_vector_floor_y(next), {x=0, y=nextrailheight, z=0}), chkdir -end ---TODO use this -function advtrains.oppd(dir) - return ((dir+8)%16) -end - -function advtrains.round_vector_floor_y(vec) - return {x=math.floor(vec.x+0.5), y=math.floor(vec.y), z=math.floor(vec.z+0.5)} -end - -function advtrains.yawToDirection(yaw, conn1, conn2) - if not conn1 or not conn2 then - error("given nil to yawToDirection: conn1="..(conn1 or "nil").." conn2="..(conn1 or "nil")) - end - local yaw1=math.pi*(conn1/4) - local yaw2=math.pi*(conn2/4) - if advtrains.minAngleDiffRad(yaw, yaw1) if weird behavior - return conn2 - else - return conn1 - end -end - -function advtrains.minAngleDiffRad(r1, r2) - local try1=r2-r1 - local try2=(r2+2*math.pi)-r1 - local try3=r2-(r1+2*math.pi) - if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try1) then - return try1 - end - if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try2) then - return try2 - end - if math.min(math.abs(try1), math.abs(try2), math.abs(try3))==math.abs(try3) then - return try3 - end -end -function advtrains.dumppath(path) - if not path then print("dumppath: no path(nil)") return end - local min=advtrains.minN(path) - local max=advtrains.maxN(path) - for i=min, max do print("["..i.."] "..(path[i] and minetest.pos_to_string(path[i]) or "nil")) end -end - -function advtrains.merge_tables(a, ...) - local new={} - for _,t in ipairs({a,...}) do - for k,v in pairs(t) do new[k]=v end - end - return new -end -function advtrains.yaw_from_3_positions(prev, curr, next) - local pts=minetest.pos_to_string - --print("p3 "..pts(prev)..pts(curr)..pts(next)) - local prev2curr=math.atan2((curr.x-prev.x), (prev.z-curr.z)) - local curr2next=math.atan2((next.x-curr.x), (curr.z-next.z)) - --print("y3 "..(prev2curr*360/(2*math.pi)).." "..(curr2next*360/(2*math.pi))) - return prev2curr+(advtrains.minAngleDiffRad(prev2curr, curr2next)/2) -end -function advtrains.get_wagon_yaw(front, first, second, back, pct) - local pts=minetest.pos_to_string - --print("p "..pts(front)..pts(first)..pts(second)..pts(back)) - local y2=advtrains.yaw_from_3_positions(second, first, front) - local y1=advtrains.yaw_from_3_positions(back, second, first) - --print("y "..(y1*360/(2*math.pi)).." "..(y2*360/(2*math.pi))) - return y1+advtrains.minAngleDiffRad(y1, y2)*pct -end -function advtrains.get_real_index_position(path, index) - if not path or not index then return end - - local first_pos=path[math.floor(index)] - local second_pos=path[math.floor(index)+1] - - if not first_pos or not second_pos then return nil end - - local factor=index-math.floor(index) - local actual_pos={x=first_pos.x-(first_pos.x-second_pos.x)*factor, y=first_pos.y-(first_pos.y-second_pos.y)*factor, z=first_pos.z-(first_pos.z-second_pos.z)*factor,} - return actual_pos -end -function advtrains.pos_median(pos1, pos2) - return {x=pos1.x-(pos1.x-pos2.x)*0.5, y=pos1.y-(pos1.y-pos2.y)*0.5, z=pos1.z-(pos1.z-pos2.z)*0.5} -end -function advtrains.abs_ceil(i) - return math.ceil(math.abs(i))*math.sign(i) -end - -function advtrains.serialize_inventory(inv) - local ser={} - local liszts=inv:get_lists() - for lisztname, liszt in pairs(liszts) do - ser[lisztname]={} - for idx, item in ipairs(liszt) do - local istring=item:to_string() - if istring~="" then - ser[lisztname][idx]=istring - end - end - end - return minetest.serialize(ser) -end -function advtrains.deserialize_inventory(sers, inv) - local ser=minetest.deserialize(sers) - if ser then - inv:set_lists(ser) - return true - end - return false -end diff --git a/advtrains/init.lua b/advtrains/init.lua deleted file mode 100644 index 33aa962..0000000 --- a/advtrains/init.lua +++ /dev/null @@ -1,40 +0,0 @@ ---advtrains - -advtrains={} - -advtrains.modpath = minetest.get_modpath("advtrains") - -print=function(t, ...) minetest.log("action", table.concat({t, ...}, " ")) minetest.chat_send_all(table.concat({t, ...}, " ")) end -sid=function(id) return string.sub(id, -4) end - -dofile(advtrains.modpath.."/helpers.lua"); -dofile(advtrains.modpath.."/debugitems.lua"); - -advtrains.meseconrules = -{{x=0, y=0, z=-1}, - {x=1, y=0, z=0}, - {x=-1, y=0, z=0}, - {x=0, y=0, z=1}, - {x=1, y=1, z=0}, - {x=1, y=-1, z=0}, - {x=-1, y=1, z=0}, - {x=-1, y=-1, z=0}, - {x=0, y=1, z=1}, - {x=0, y=-1, z=1}, - {x=0, y=1, z=-1}, - {x=0, y=-1, z=-1}, - {x=0, y=-2, z=0}} -dofile(advtrains.modpath.."/trainlogic.lua") -dofile(advtrains.modpath.."/trainhud.lua") -dofile(advtrains.modpath.."/trackplacer.lua") -dofile(advtrains.modpath.."/tracks.lua") -dofile(advtrains.modpath.."/atc.lua") -dofile(advtrains.modpath.."/wagons.lua") - -dofile(advtrains.modpath.."/pseudoload.lua") -dofile(advtrains.modpath.."/couple.lua") -dofile(advtrains.modpath.."/damage.lua") - -dofile(advtrains.modpath.."/signals.lua") -dofile(advtrains.modpath.."/misc_nodes.lua") -dofile(advtrains.modpath.."/crafting.lua") diff --git a/advtrains/license.txt b/advtrains/license.txt new file mode 100644 index 0000000..68a4b60 --- /dev/null +++ b/advtrains/license.txt @@ -0,0 +1,142 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS diff --git a/advtrains/license_media.txt b/advtrains/license_media.txt new file mode 100644 index 0000000..c0da560 --- /dev/null +++ b/advtrains/license_media.txt @@ -0,0 +1,63 @@ +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. + "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. + "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. + "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike. + "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. + "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. + "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. + "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. + "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; + to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; + to Distribute and Publicly Perform the Work including as incorporated in Collections; and, + to Distribute and Publicly Perform Adaptations. + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e). + +4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested. + You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License. + You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works. + If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. + + For the avoidance of doubt: + Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; + Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and, + Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c). + Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. + diff --git a/advtrains/manual.pdf b/advtrains/manual.pdf new file mode 100644 index 0000000..e8c6380 Binary files /dev/null and b/advtrains/manual.pdf differ diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua deleted file mode 100644 index 93829f0..0000000 --- a/advtrains/misc_nodes.lua +++ /dev/null @@ -1,67 +0,0 @@ ---all nodes that do not fit in any other category - -function advtrains.register_platform(preset) - local ndef=minetest.registered_nodes[preset] - if not ndef then - minetest.log("warning", "[advtrains] register_platform couldn't find preset node "..preset) - return - end - local btex=ndef.tiles - if type(btex)=="table" then - btex=btex[1] - end - local desc=ndef.description or "" - local nodename=string.match(preset, ":(.+)$") - minetest.register_node("advtrains:platform_low_"..nodename, { - description = desc.." Platform (low)", - tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, - groups = {cracky = 1, not_blocking_trains = 1, platform=1}, - sounds = default.node_sound_stone_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.1, -0.1, 0.5, 0 , 0.5}, - {-0.5, -0.5, 0 , 0.5, -0.1, 0.5} - }, - }, - paramtype2="facedir", - paramtype = "light", - sunlight_propagates = true, - }) - minetest.register_node("advtrains:platform_high_"..nodename, { - description = desc.." Platform (high)", - tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, - groups = {cracky = 1, not_blocking_trains = 1, platform=2}, - sounds = default.node_sound_stone_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, 0.3, -0.1, 0.5, 0.5, 0.5}, - {-0.5, -0.5, 0 , 0.5, 0.3, 0.5} - }, - }, - paramtype2="facedir", - paramtype = "light", - sunlight_propagates = true, - }) - minetest.register_craft({ - type="shapeless", - output = "advtrains:platform_high_"..nodename.." 4", - recipe = { - "dye:yellow", preset, preset - }, - }) - minetest.register_craft({ - type="shapeless", - output = "advtrains:platform_low_"..nodename.." 4", - recipe = { - "dye:yellow", preset - }, - }) -end - - -advtrains.register_platform("default:stonebrick") -advtrains.register_platform("default:sandstonebrick") diff --git a/advtrains/models/advtrains_dtrack_bumper_st.b3d b/advtrains/models/advtrains_dtrack_bumper_st.b3d deleted file mode 100644 index a6d9745..0000000 Binary files a/advtrains/models/advtrains_dtrack_bumper_st.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_30.b3d b/advtrains/models/advtrains_dtrack_bumper_st_30.b3d deleted file mode 100644 index 5f5b3f4..0000000 Binary files a/advtrains/models/advtrains_dtrack_bumper_st_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_45.b3d b/advtrains/models/advtrains_dtrack_bumper_st_45.b3d deleted file mode 100644 index f13ae75..0000000 Binary files a/advtrains/models/advtrains_dtrack_bumper_st_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_60.b3d b/advtrains/models/advtrains_dtrack_bumper_st_60.b3d deleted file mode 100644 index 59a2285..0000000 Binary files a/advtrains/models/advtrains_dtrack_bumper_st_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_cr.b3d b/advtrains/models/advtrains_dtrack_cr.b3d deleted file mode 100644 index 159717e..0000000 Binary files a/advtrains/models/advtrains_dtrack_cr.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_cr_30.b3d b/advtrains/models/advtrains_dtrack_cr_30.b3d deleted file mode 100644 index 09cdb1f..0000000 Binary files a/advtrains/models/advtrains_dtrack_cr_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_cr_45.b3d b/advtrains/models/advtrains_dtrack_cr_45.b3d deleted file mode 100644 index 176da81..0000000 Binary files a/advtrains/models/advtrains_dtrack_cr_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_cr_60.b3d b/advtrains/models/advtrains_dtrack_cr_60.b3d deleted file mode 100644 index 00313c8..0000000 Binary files a/advtrains/models/advtrains_dtrack_cr_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_detector_st.b3d b/advtrains/models/advtrains_dtrack_detector_st.b3d deleted file mode 100644 index 6762bc3..0000000 Binary files a/advtrains/models/advtrains_dtrack_detector_st.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_detector_st_30.b3d b/advtrains/models/advtrains_dtrack_detector_st_30.b3d deleted file mode 100644 index f2d5991..0000000 Binary files a/advtrains/models/advtrains_dtrack_detector_st_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_detector_st_45.b3d b/advtrains/models/advtrains_dtrack_detector_st_45.b3d deleted file mode 100644 index 9ecb4a6..0000000 Binary files a/advtrains/models/advtrains_dtrack_detector_st_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_detector_st_60.b3d b/advtrains/models/advtrains_dtrack_detector_st_60.b3d deleted file mode 100644 index bd102cb..0000000 Binary files a/advtrains/models/advtrains_dtrack_detector_st_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_st.b3d b/advtrains/models/advtrains_dtrack_st.b3d deleted file mode 100644 index f3e2753..0000000 Binary files a/advtrains/models/advtrains_dtrack_st.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_st_30.b3d b/advtrains/models/advtrains_dtrack_st_30.b3d deleted file mode 100644 index 7a35c8d..0000000 Binary files a/advtrains/models/advtrains_dtrack_st_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_st_45.b3d b/advtrains/models/advtrains_dtrack_st_45.b3d deleted file mode 100644 index b2a1702..0000000 Binary files a/advtrains/models/advtrains_dtrack_st_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_st_60.b3d b/advtrains/models/advtrains_dtrack_st_60.b3d deleted file mode 100644 index 0a59f77..0000000 Binary files a/advtrains/models/advtrains_dtrack_st_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlcr.b3d b/advtrains/models/advtrains_dtrack_swlcr.b3d deleted file mode 100644 index 1adc23f..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlcr.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_30.b3d b/advtrains/models/advtrains_dtrack_swlcr_30.b3d deleted file mode 100644 index 7d8373b..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlcr_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_45.b3d b/advtrains/models/advtrains_dtrack_swlcr_45.b3d deleted file mode 100644 index 9679b9e..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlcr_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_60.b3d b/advtrains/models/advtrains_dtrack_swlcr_60.b3d deleted file mode 100644 index 3efc924..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlcr_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlst.b3d b/advtrains/models/advtrains_dtrack_swlst.b3d deleted file mode 100644 index 93841a4..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlst.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlst_30.b3d b/advtrains/models/advtrains_dtrack_swlst_30.b3d deleted file mode 100644 index e9a90c7..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlst_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlst_45.b3d b/advtrains/models/advtrains_dtrack_swlst_45.b3d deleted file mode 100644 index 49c707c..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlst_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swlst_60.b3d b/advtrains/models/advtrains_dtrack_swlst_60.b3d deleted file mode 100644 index c9a6ffe..0000000 Binary files a/advtrains/models/advtrains_dtrack_swlst_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrcr.b3d b/advtrains/models/advtrains_dtrack_swrcr.b3d deleted file mode 100644 index ee29b62..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrcr.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_30.b3d b/advtrains/models/advtrains_dtrack_swrcr_30.b3d deleted file mode 100644 index ba065e1..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrcr_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_45.b3d b/advtrains/models/advtrains_dtrack_swrcr_45.b3d deleted file mode 100644 index 7f9dc43..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrcr_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_60.b3d b/advtrains/models/advtrains_dtrack_swrcr_60.b3d deleted file mode 100644 index b8ffa61..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrcr_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrst.b3d b/advtrains/models/advtrains_dtrack_swrst.b3d deleted file mode 100644 index 0b3e7ad..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrst.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrst_30.b3d b/advtrains/models/advtrains_dtrack_swrst_30.b3d deleted file mode 100644 index 4aea19b..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrst_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrst_45.b3d b/advtrains/models/advtrains_dtrack_swrst_45.b3d deleted file mode 100644 index 4182fe5..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrst_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_swrst_60.b3d b/advtrains/models/advtrains_dtrack_swrst_60.b3d deleted file mode 100644 index 6d2c891..0000000 Binary files a/advtrains/models/advtrains_dtrack_swrst_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst1.b3d b/advtrains/models/advtrains_dtrack_vst1.b3d deleted file mode 100644 index c9d7427..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst1.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst1_45.b3d b/advtrains/models/advtrains_dtrack_vst1_45.b3d deleted file mode 100644 index 14d438c..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst1_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst2.b3d b/advtrains/models/advtrains_dtrack_vst2.b3d deleted file mode 100644 index c128650..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst2.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst2_45.b3d b/advtrains/models/advtrains_dtrack_vst2_45.b3d deleted file mode 100644 index 263276d..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst2_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst31.b3d b/advtrains/models/advtrains_dtrack_vst31.b3d deleted file mode 100644 index df0f383..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst31.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst32.b3d b/advtrains/models/advtrains_dtrack_vst32.b3d deleted file mode 100644 index 01d2978..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst32.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_dtrack_vst33.b3d b/advtrains/models/advtrains_dtrack_vst33.b3d deleted file mode 100644 index 7fe418d..0000000 Binary files a/advtrains/models/advtrains_dtrack_vst33.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_modernwagon.b3d b/advtrains/models/advtrains_modernwagon.b3d deleted file mode 100644 index aacddca..0000000 Binary files a/advtrains/models/advtrains_modernwagon.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_off.b3d b/advtrains/models/advtrains_retrosignal_off.b3d deleted file mode 100644 index 3d231dd..0000000 Binary files a/advtrains/models/advtrains_retrosignal_off.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_off_30.b3d b/advtrains/models/advtrains_retrosignal_off_30.b3d deleted file mode 100644 index da258e1..0000000 Binary files a/advtrains/models/advtrains_retrosignal_off_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_off_45.b3d b/advtrains/models/advtrains_retrosignal_off_45.b3d deleted file mode 100644 index 338224a..0000000 Binary files a/advtrains/models/advtrains_retrosignal_off_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_off_60.b3d b/advtrains/models/advtrains_retrosignal_off_60.b3d deleted file mode 100644 index c560ca1..0000000 Binary files a/advtrains/models/advtrains_retrosignal_off_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_on.b3d b/advtrains/models/advtrains_retrosignal_on.b3d deleted file mode 100644 index 3d19439..0000000 Binary files a/advtrains/models/advtrains_retrosignal_on.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_on_30.b3d b/advtrains/models/advtrains_retrosignal_on_30.b3d deleted file mode 100644 index 98f8a92..0000000 Binary files a/advtrains/models/advtrains_retrosignal_on_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_on_45.b3d b/advtrains/models/advtrains_retrosignal_on_45.b3d deleted file mode 100644 index 414e121..0000000 Binary files a/advtrains/models/advtrains_retrosignal_on_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_retrosignal_on_60.b3d b/advtrains/models/advtrains_retrosignal_on_60.b3d deleted file mode 100644 index a51529a..0000000 Binary files a/advtrains/models/advtrains_retrosignal_on_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_signal.b3d b/advtrains/models/advtrains_signal.b3d deleted file mode 100644 index 7f69560..0000000 Binary files a/advtrains/models/advtrains_signal.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_signal_30.b3d b/advtrains/models/advtrains_signal_30.b3d deleted file mode 100644 index 0b949a7..0000000 Binary files a/advtrains/models/advtrains_signal_30.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_signal_45.b3d b/advtrains/models/advtrains_signal_45.b3d deleted file mode 100644 index ccaebf4..0000000 Binary files a/advtrains/models/advtrains_signal_45.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_signal_60.b3d b/advtrains/models/advtrains_signal_60.b3d deleted file mode 100644 index cf41e6d..0000000 Binary files a/advtrains/models/advtrains_signal_60.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_track_cr.b3d b/advtrains/models/advtrains_track_cr.b3d deleted file mode 100644 index b0f5e4b..0000000 Binary files a/advtrains/models/advtrains_track_cr.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_track_st.b3d b/advtrains/models/advtrains_track_st.b3d deleted file mode 100644 index 10b5d90..0000000 Binary files a/advtrains/models/advtrains_track_st.b3d and /dev/null differ diff --git a/advtrains/models/advtrains_track_st_45.b3d b/advtrains/models/advtrains_track_st_45.b3d deleted file mode 100644 index 32505a1..0000000 Binary files a/advtrains/models/advtrains_track_st_45.b3d and /dev/null differ diff --git a/advtrains/models/blender/engine-with-animation.blend b/advtrains/models/blender/engine-with-animation.blend deleted file mode 100644 index 2649587..0000000 Binary files a/advtrains/models/blender/engine-with-animation.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/detectorpart.png b/advtrains/models/blender/gleis/detectorpart.png deleted file mode 100644 index fc24181..0000000 Binary files a/advtrains/models/blender/gleis/detectorpart.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/infos/Grafik_weiche.png b/advtrains/models/blender/gleis/infos/Grafik_weiche.png deleted file mode 100644 index 6674eb3..0000000 Binary files a/advtrains/models/blender/gleis/infos/Grafik_weiche.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/infos/breite b/advtrains/models/blender/gleis/infos/breite deleted file mode 100644 index b2862c6..0000000 --- a/advtrains/models/blender/gleis/infos/breite +++ /dev/null @@ -1 +0,0 @@ -1435mm diff --git a/advtrains/models/blender/gleis/licence.txt~ b/advtrains/models/blender/gleis/licence.txt~ deleted file mode 100644 index e69de29..0000000 diff --git a/advtrains/models/blender/gleis/rail_my.blend b/advtrains/models/blender/gleis/rail_my.blend deleted file mode 100644 index 3c741bc..0000000 Binary files a/advtrains/models/blender/gleis/rail_my.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my.blend1 b/advtrains/models/blender/gleis/rail_my.blend1 deleted file mode 100644 index 6322856..0000000 Binary files a/advtrains/models/blender/gleis/rail_my.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt.blend b/advtrains/models/blender/gleis/rail_my_rt.blend deleted file mode 100644 index 8372a0c..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt.blend1 b/advtrains/models/blender/gleis/rail_my_rt.blend1 deleted file mode 100644 index 7d0978e..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_final.blend b/advtrains/models/blender/gleis/rail_my_rt_final.blend deleted file mode 100644 index d07a65d..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_final.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_final.blend1 b/advtrains/models/blender/gleis/rail_my_rt_final.blend1 deleted file mode 100644 index 8a2d213..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_final.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_switches.blend b/advtrains/models/blender/gleis/rail_my_rt_switches.blend deleted file mode 100644 index fdce427..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_switches.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_switches.blend1 b/advtrains/models/blender/gleis/rail_my_rt_switches.blend1 deleted file mode 100644 index 04370ba..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_switches.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_switches2.blend b/advtrains/models/blender/gleis/rail_my_rt_switches2.blend deleted file mode 100644 index 9562e4d..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_switches2.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_my_rt_switches2.blend1 b/advtrains/models/blender/gleis/rail_my_rt_switches2.blend1 deleted file mode 100644 index 07a155f..0000000 Binary files a/advtrains/models/blender/gleis/rail_my_rt_switches2.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_together.blend b/advtrains/models/blender/gleis/rail_together.blend deleted file mode 100644 index cff51ea..0000000 Binary files a/advtrains/models/blender/gleis/rail_together.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_together.png b/advtrains/models/blender/gleis/rail_together.png deleted file mode 100644 index 386cd5c..0000000 Binary files a/advtrains/models/blender/gleis/rail_together.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_together2.png b/advtrains/models/blender/gleis/rail_together2.png deleted file mode 100644 index 3effe34..0000000 Binary files a/advtrains/models/blender/gleis/rail_together2.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_together3.png b/advtrains/models/blender/gleis/rail_together3.png deleted file mode 100644 index 4a183c1..0000000 Binary files a/advtrains/models/blender/gleis/rail_together3.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals.blend b/advtrains/models/blender/gleis/rail_verticals.blend deleted file mode 100644 index 45c37e1..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals.blend1 b/advtrains/models/blender/gleis/rail_verticals.blend1 deleted file mode 100644 index 320f30b..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals3.blend b/advtrains/models/blender/gleis/rail_verticals3.blend deleted file mode 100644 index 5d62959..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals3.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals3.blend1 b/advtrains/models/blender/gleis/rail_verticals3.blend1 deleted file mode 100644 index 893f2ea..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals3.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals45.blend b/advtrains/models/blender/gleis/rail_verticals45.blend deleted file mode 100644 index a1589e3..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals45.blend and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals45.blend1 b/advtrains/models/blender/gleis/rail_verticals45.blend1 deleted file mode 100644 index 6b44d1c..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals45.blend1 and /dev/null differ diff --git a/advtrains/models/blender/gleis/rail_verticals45.blend11 b/advtrains/models/blender/gleis/rail_verticals45.blend11 deleted file mode 100644 index 48316e8..0000000 Binary files a/advtrains/models/blender/gleis/rail_verticals45.blend11 and /dev/null differ diff --git a/advtrains/models/blender/gleis/texturen/rail.png b/advtrains/models/blender/gleis/texturen/rail.png deleted file mode 100644 index 8478cf6..0000000 Binary files a/advtrains/models/blender/gleis/texturen/rail.png and /dev/null differ diff --git a/advtrains/models/blender/gleis/texturen/uv.png b/advtrains/models/blender/gleis/texturen/uv.png deleted file mode 100644 index fb0af3e..0000000 Binary files a/advtrains/models/blender/gleis/texturen/uv.png and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_loc.blend b/advtrains/models/blender/industrial/industry_loc.blend deleted file mode 100644 index 1a6cb2b..0000000 Binary files a/advtrains/models/blender/industrial/industry_loc.blend and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_loc.blend1 b/advtrains/models/blender/industrial/industry_loc.blend1 deleted file mode 100644 index af54c3f..0000000 Binary files a/advtrains/models/blender/industrial/industry_loc.blend1 and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_loc.blend11 b/advtrains/models/blender/industrial/industry_loc.blend11 deleted file mode 100644 index a089a65..0000000 Binary files a/advtrains/models/blender/industrial/industry_loc.blend11 and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_oil_ wagong.blend b/advtrains/models/blender/industrial/industry_oil_ wagong.blend deleted file mode 100644 index 30bde51..0000000 Binary files a/advtrains/models/blender/industrial/industry_oil_ wagong.blend and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_oil_ wagong.blend1 b/advtrains/models/blender/industrial/industry_oil_ wagong.blend1 deleted file mode 100644 index 849971d..0000000 Binary files a/advtrains/models/blender/industrial/industry_oil_ wagong.blend1 and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_tree_wagong.blend b/advtrains/models/blender/industrial/industry_tree_wagong.blend deleted file mode 100644 index 23de208..0000000 Binary files a/advtrains/models/blender/industrial/industry_tree_wagong.blend and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_tree_wagong.blend1 b/advtrains/models/blender/industrial/industry_tree_wagong.blend1 deleted file mode 100644 index bf2c9ed..0000000 Binary files a/advtrains/models/blender/industrial/industry_tree_wagong.blend1 and /dev/null differ diff --git a/advtrains/models/blender/industrial/industry_tree_wagong.png b/advtrains/models/blender/industrial/industry_tree_wagong.png deleted file mode 100644 index 87109dd..0000000 Binary files a/advtrains/models/blender/industrial/industry_tree_wagong.png and /dev/null differ diff --git a/advtrains/models/blender/locomotive.blend b/advtrains/models/blender/locomotive.blend deleted file mode 100644 index 8fd6059..0000000 Binary files a/advtrains/models/blender/locomotive.blend and /dev/null differ diff --git a/advtrains/models/blender/magnet_track.blend b/advtrains/models/blender/magnet_track.blend deleted file mode 100644 index 0ab14e7..0000000 Binary files a/advtrains/models/blender/magnet_track.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/advtrains_wagon_japan.xcf b/advtrains/models/blender/mbb/advtrains_wagon_japan.xcf deleted file mode 100644 index 4fc88c0..0000000 Binary files a/advtrains/models/blender/mbb/advtrains_wagon_japan.xcf and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_japanlocomotive.blend b/advtrains/models/blender/mbb/modern_japanlocomotive.blend deleted file mode 100644 index 6eb8f3d..0000000 Binary files a/advtrains/models/blender/mbb/modern_japanlocomotive.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_japanlocomotive.blend1 b/advtrains/models/blender/mbb/modern_japanlocomotive.blend1 deleted file mode 100644 index a2e745d..0000000 Binary files a/advtrains/models/blender/mbb/modern_japanlocomotive.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_japanlocomotive.png b/advtrains/models/blender/mbb/modern_japanlocomotive.png deleted file mode 100644 index b80d16f..0000000 Binary files a/advtrains/models/blender/mbb/modern_japanlocomotive.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_japanlocomotive.xcf b/advtrains/models/blender/mbb/modern_japanlocomotive.xcf deleted file mode 100644 index bb28534..0000000 Binary files a/advtrains/models/blender/mbb/modern_japanlocomotive.xcf and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_locomotive.blend b/advtrains/models/blender/mbb/modern_locomotive.blend deleted file mode 100644 index 8e72233..0000000 Binary files a/advtrains/models/blender/mbb/modern_locomotive.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_wagong.blend b/advtrains/models/blender/mbb/modern_wagong.blend deleted file mode 100644 index f32710a..0000000 Binary files a/advtrains/models/blender/mbb/modern_wagong.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_wagong.blend1 b/advtrains/models/blender/mbb/modern_wagong.blend1 deleted file mode 100644 index 376831c..0000000 Binary files a/advtrains/models/blender/mbb/modern_wagong.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_wagong_uv.blend b/advtrains/models/blender/mbb/modern_wagong_uv.blend deleted file mode 100644 index 4c10fb3..0000000 Binary files a/advtrains/models/blender/mbb/modern_wagong_uv.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_wagong_uv.blend1 b/advtrains/models/blender/mbb/modern_wagong_uv.blend1 deleted file mode 100644 index ce77416..0000000 Binary files a/advtrains/models/blender/mbb/modern_wagong_uv.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/modern_wagong_uv.png b/advtrains/models/blender/mbb/modern_wagong_uv.png deleted file mode 100644 index 68018ea..0000000 Binary files a/advtrains/models/blender/mbb/modern_wagong_uv.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/prellbock.blend b/advtrains/models/blender/mbb/prellbock.blend deleted file mode 100644 index 1c20ab2..0000000 Binary files a/advtrains/models/blender/mbb/prellbock.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/prellbock.blend1 b/advtrains/models/blender/mbb/prellbock.blend1 deleted file mode 100644 index 981538e..0000000 Binary files a/advtrains/models/blender/mbb/prellbock.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/prellbock.uv.png b/advtrains/models/blender/mbb/prellbock.uv.png deleted file mode 100644 index 7730753..0000000 Binary files a/advtrains/models/blender/mbb/prellbock.uv.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/regio-lokomotive.blend b/advtrains/models/blender/mbb/regio-lokomotive.blend deleted file mode 100644 index 210e60e..0000000 Binary files a/advtrains/models/blender/mbb/regio-lokomotive.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/regio-waron.blend b/advtrains/models/blender/mbb/regio-waron.blend deleted file mode 100644 index 19b07ce..0000000 Binary files a/advtrains/models/blender/mbb/regio-waron.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/retrosignal.blend b/advtrains/models/blender/mbb/retrosignal.blend deleted file mode 100644 index b795215..0000000 Binary files a/advtrains/models/blender/mbb/retrosignal.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/retrosignal.blend1 b/advtrains/models/blender/mbb/retrosignal.blend1 deleted file mode 100644 index 94af470..0000000 Binary files a/advtrains/models/blender/mbb/retrosignal.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal(2)_hoch.blend b/advtrains/models/blender/mbb/signal(2)_hoch.blend deleted file mode 100644 index 70391f6..0000000 Binary files a/advtrains/models/blender/mbb/signal(2)_hoch.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal(2)_unten.blend b/advtrains/models/blender/mbb/signal(2)_unten.blend deleted file mode 100644 index 4e917bc..0000000 Binary files a/advtrains/models/blender/mbb/signal(2)_unten.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal.blend b/advtrains/models/blender/mbb/signal.blend deleted file mode 100644 index 135c7b4..0000000 Binary files a/advtrains/models/blender/mbb/signal.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal.blend1 b/advtrains/models/blender/mbb/signal.blend1 deleted file mode 100644 index 63a8c99..0000000 Binary files a/advtrains/models/blender/mbb/signal.blend1 and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal.png b/advtrains/models/blender/mbb/signal.png deleted file mode 100644 index 779cdda..0000000 Binary files a/advtrains/models/blender/mbb/signal.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal.xcf b/advtrains/models/blender/mbb/signal.xcf deleted file mode 100644 index f667739..0000000 Binary files a/advtrains/models/blender/mbb/signal.xcf and /dev/null differ diff --git a/advtrains/models/blender/mbb/signal2.png b/advtrains/models/blender/mbb/signal2.png deleted file mode 100644 index 7af4e2d..0000000 Binary files a/advtrains/models/blender/mbb/signal2.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/tr-logo.png b/advtrains/models/blender/mbb/tr-logo.png deleted file mode 100644 index 9bc0f10..0000000 Binary files a/advtrains/models/blender/mbb/tr-logo.png and /dev/null differ diff --git a/advtrains/models/blender/mbb/weichenhebel1.blend b/advtrains/models/blender/mbb/weichenhebel1.blend deleted file mode 100644 index 70b997d..0000000 Binary files a/advtrains/models/blender/mbb/weichenhebel1.blend and /dev/null differ diff --git a/advtrains/models/blender/mbb/weichenhebel2.blend b/advtrains/models/blender/mbb/weichenhebel2.blend deleted file mode 100644 index c1c3aac..0000000 Binary files a/advtrains/models/blender/mbb/weichenhebel2.blend and /dev/null differ diff --git a/advtrains/models/blender/newlocomotive.blend b/advtrains/models/blender/newlocomotive.blend deleted file mode 100644 index 858882b..0000000 Binary files a/advtrains/models/blender/newlocomotive.blend and /dev/null differ diff --git a/advtrains/models/blender/newlocomotive.blend1 b/advtrains/models/blender/newlocomotive.blend1 deleted file mode 100644 index 4b8b24f..0000000 Binary files a/advtrains/models/blender/newlocomotive.blend1 and /dev/null differ diff --git a/advtrains/models/blender/newlocomotive_uvs.png b/advtrains/models/blender/newlocomotive_uvs.png deleted file mode 100644 index 879be65..0000000 Binary files a/advtrains/models/blender/newlocomotive_uvs.png and /dev/null differ diff --git a/advtrains/models/blender/newwagon.blend b/advtrains/models/blender/newwagon.blend deleted file mode 100644 index 1cedc55..0000000 Binary files a/advtrains/models/blender/newwagon.blend and /dev/null differ diff --git a/advtrains/models/blender/newwagon.blend1 b/advtrains/models/blender/newwagon.blend1 deleted file mode 100644 index eb30fde..0000000 Binary files a/advtrains/models/blender/newwagon.blend1 and /dev/null differ diff --git a/advtrains/models/blender/newwagon.png b/advtrains/models/blender/newwagon.png deleted file mode 100644 index 812bc32..0000000 Binary files a/advtrains/models/blender/newwagon.png and /dev/null differ diff --git a/advtrains/models/blender/subway-train.blend b/advtrains/models/blender/subway-train.blend deleted file mode 100644 index 690d87b..0000000 Binary files a/advtrains/models/blender/subway-train.blend and /dev/null differ diff --git a/advtrains/models/blender/subway-train.blend1 b/advtrains/models/blender/subway-train.blend1 deleted file mode 100644 index 86d1f92..0000000 Binary files a/advtrains/models/blender/subway-train.blend1 and /dev/null differ diff --git a/advtrains/models/blender/subway-train.png b/advtrains/models/blender/subway-train.png deleted file mode 100644 index d0b9731..0000000 Binary files a/advtrains/models/blender/subway-train.png and /dev/null differ diff --git a/advtrains/models/blender/subway-train.xcf b/advtrains/models/blender/subway-train.xcf deleted file mode 100644 index 775b87c..0000000 Binary files a/advtrains/models/blender/subway-train.xcf and /dev/null differ diff --git a/advtrains/models/blender/trackplane.blend b/advtrains/models/blender/trackplane.blend deleted file mode 100644 index 79365f7..0000000 Binary files a/advtrains/models/blender/trackplane.blend and /dev/null differ diff --git a/advtrains/models/blender/trackvertical1.blend b/advtrains/models/blender/trackvertical1.blend deleted file mode 100644 index fca6742..0000000 Binary files a/advtrains/models/blender/trackvertical1.blend and /dev/null differ diff --git a/advtrains/models/blender/trackvertical1.blend1 b/advtrains/models/blender/trackvertical1.blend1 deleted file mode 100644 index b146b56..0000000 Binary files a/advtrains/models/blender/trackvertical1.blend1 and /dev/null differ diff --git a/advtrains/models/blender/trackvertical1.png b/advtrains/models/blender/trackvertical1.png deleted file mode 100644 index a998dcb..0000000 Binary files a/advtrains/models/blender/trackvertical1.png and /dev/null differ diff --git a/advtrains/models/blender/trackvertical2.blend b/advtrains/models/blender/trackvertical2.blend deleted file mode 100644 index a066b84..0000000 Binary files a/advtrains/models/blender/trackvertical2.blend and /dev/null differ diff --git a/advtrains/models/blender/trackvertical2.png b/advtrains/models/blender/trackvertical2.png deleted file mode 100644 index 43142f9..0000000 Binary files a/advtrains/models/blender/trackvertical2.png and /dev/null differ diff --git a/advtrains/models/oldmodels/locomotive.b3d b/advtrains/models/oldmodels/locomotive.b3d deleted file mode 100644 index 5e16be3..0000000 Binary files a/advtrains/models/oldmodels/locomotive.b3d and /dev/null differ diff --git a/advtrains/models/oldmodels/trackvertical1.b3d b/advtrains/models/oldmodels/trackvertical1.b3d deleted file mode 100644 index 5620f60..0000000 Binary files a/advtrains/models/oldmodels/trackvertical1.b3d and /dev/null differ diff --git a/advtrains/models/oldmodels/trackvertical2.b3d b/advtrains/models/oldmodels/trackvertical2.b3d deleted file mode 100644 index 22dbb20..0000000 Binary files a/advtrains/models/oldmodels/trackvertical2.b3d and /dev/null differ diff --git a/advtrains/models/trackplane.b3d b/advtrains/models/trackplane.b3d deleted file mode 100644 index b4728c3..0000000 Binary files a/advtrains/models/trackplane.b3d and /dev/null differ diff --git a/advtrains/modpack.txt b/advtrains/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/advtrains/pseudoload.lua b/advtrains/pseudoload.lua deleted file mode 100644 index 677cd14..0000000 --- a/advtrains/pseudoload.lua +++ /dev/null @@ -1,182 +0,0 @@ -local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end - ---pseudoload.lua ---responsible for keeping up a database of all rail nodes existant in the world, regardless of whether the mapchunk is loaded. - -advtrains.trackdb={} ---trackdb[tt][y][x][z]={conn1, conn2, rely1, rely2, railheight} ---serialization format: ---(2byte x)(2byte y)(2byte z)(4bits conn1, 4bits conn2)[(plain rely1)|(plain rely2)|(plain railheight)]\n ---[] may be missing if 0,0,0 - ---load initially - ---[[ TODO temporary outcomment - ---delayed since all traintypes need to be registered -minetest.after(0, function() - -for tt, _ in pairs(advtrains.all_traintypes) do - local pl_fpath=minetest.get_worldpath().."/advtrains_trackdb_"..tt - advtrains.trackdb[tt]={} - local file, err = io.open(pl_fpath, "r") - if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed loading advtrains trackdb save file "..er) - else - --custom format to save memory - while true do - local xbytes=file:read(2) - if not xbytes or #xbytes<2 then - break --eof reached - end - print(xbytes) - local ybytes=file:read(2) - local zbytes=file:read(2) - local x=(string.byte(xbytes[1])-128)*256+(string.byte(xbytes[2])) - local y=(string.byte(ybytes[1])-128)*256+(string.byte(ybytes[2])) - local z=(string.byte(zbytes[1])-128)*256+(string.byte(zbytes[2])) - - local conn1=string.byte(file:read(1)) - local conn1=string.byte(file:read(1)) - - if not advtrains.trackdb[tt][y] then advtrains.trackdb[tt][y]={} end - if not advtrains.trackdb[tt][y][x] then advtrains.trackdb[tt][y][x]={} end - - local rest=file.read("*l") - if rest~="" then - local rely1, rely2, railheight=string.match(rest, "([^|]+)|([^|]+)|([^|]+)") - if rely1 and rely2 and railheight then - advtrains.trackdb[tt][y][x][z]={ - conn1=conn1, conn2=conn2, - rely1=rely1, rely2=rely2, - railheight=railheight - } - else - advtrains.trackdb[tt][y][x][z]={ - conn1=conn1, conn2=conn2 - } - end - else - advtrains.trackdb[tt][y][x][z]={ - conn1=conn1, conn2=conn2 - } - end - end - file:close() - end -end - ---end minetest.after -end) - -function advtrains.save_trackdb() - for tt, _ in pairs(advtrains.all_traintypes) do - local pl_fpath=minetest.get_worldpath().."/advtrains_trackdb_"..tt - local file, err = io.open(pl_fpath, "w") - if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed saving advtrains trackdb save file "..er) - else - --custom format to save memory - for y,tyl in pairs(advtrains.trackdb[tt]) do - for x,txl in pairs(tyl) do - for z,rail in pairs(txl) do - print("write "..x.." "..y.." "..z.." "..minetest.serialize(rail)) - file:write(string.char(math.floor(x/256)+128)..string.char((x%256))) - file:write(string.char(math.floor(y/256)+128)..string.char((y%256))) - file:write(string.char(math.floor(z/256)+128)..string.char((z%256))) - file:write(string.char(rail.conn1)) - file:write(string.char(rail.conn2)) - if (rail.rely1 and rail.rely1~=0) or (rail.rely2 and rail.rely2~=0) or (rail.railheight and rail.railheight~=0) then - file:write(rail.rely1.."|"..rail.rely2.."|"..rail.railheight) - end - file:write("\n") - end - end - end - file:close() - end - end -end -]]--end temp outcomment -advtrains.trackdb={} -advtrains.fpath_tdb=minetest.get_worldpath().."/advtrains_trackdb2" -local file, err = io.open(advtrains.fpath_tdb, "r") -if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed loading advtrains save file "..er) -else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - advtrains.trackdb=tbl - end - file:close() -end -function advtrains.save_trackdb() - local datastr = minetest.serialize(advtrains.trackdb) - if not datastr then - minetest.log("error", "[advtrains] Failed to serialize trackdb data!") - return - end - local file, err = io.open(advtrains.fpath_tdb, "w") - if err then - return err - end - file:write(datastr) - file:close() -end - ---get_node with pseudoload. ---returns: ---true, conn1, conn2, rely1, rely2, railheight in case everything's right. ---false if it's not a rail or the train does not drive on this rail, but it is loaded or ---nil if the node is neither loaded nor in trackdb ---the distraction between false and nil will be needed only in special cases.(train initpos) -function advtrains.get_rail_info_at(pos, drives_on) - local node=minetest.get_node_or_nil(pos) - if not node then - --try raildb - local rdp=vector.round(pos) - local dbe=(advtrains.trackdb[traintype] and advtrains.trackdb[traintype][rdp.y] and advtrains.trackdb[traintype][rdp.y][rdp.x] and advtrains.trackdb[traintype][rdp.y][rdp.x][rdp.z]) - if dbe then - for tt,_ in pairs(drives_on) do - if not dbe.tracktype or tt==dbe.tracktype then - return true, dbe.conn1, dbe.conn2, dbe.rely1 or 0, dbe.rely2 or 0, dbe.railheight or 0 - end - end - else - return nil - end - end - local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, drives_on)) then - return false - end - local conn1, conn2, rely1, rely2, railheight, tracktype=advtrains.get_track_connections(node.name, node.param2) - - --already in trackdb? - local rdp=vector.round(pos) - if not (advtrains.trackdb and advtrains.trackdb[rdp.y] and advtrains.trackdb[rdp.y][rdp.x] and advtrains.trackdb[rdp.y][rdp.x][rdp.z]) then--TODO is this necessary? - if not advtrains.trackdb then advtrains.trackdb={} end - if not advtrains.trackdb[rdp.y] then advtrains.trackdb[rdp.y]={} end - if not advtrains.trackdb[rdp.y][rdp.x] then advtrains.trackdb[rdp.y][rdp.x]={} end - advtrains.trackdb[rdp.y][rdp.x][rdp.z]={ - conn1=conn1, conn2=conn2, - rely1=rely1, rely2=rely2, - railheight=railheight, tracktype=tracktype - } - end - - return true, conn1, conn2, rely1, rely2, railheight -end -function advtrains.reset_trackdb_position(pos) - local rdp=vector.round(pos) - if not advtrains.trackdb then advtrains.trackdb={} end - if not advtrains.trackdb[rdp.y] then advtrains.trackdb[rdp.y]={} end - if not advtrains.trackdb[rdp.y][rdp.x] then advtrains.trackdb[rdp.y][rdp.x]={} end - advtrains.trackdb[rdp.y][rdp.x][rdp.z]=nil - advtrains.get_rail_info_at(pos, advtrains.all_tracktypes)--to restore it. -end - - diff --git a/advtrains/readme.txt b/advtrains/readme.txt deleted file mode 100644 index ad093bd..0000000 --- a/advtrains/readme.txt +++ /dev/null @@ -1,23 +0,0 @@ - -## ADVTRAINS ## realistic trains in Minetest! -by orwell96 and contributors(see below) - -For up-to-date information, visit https://forum.minetest.net/viewtopic.php?f=9&t=14726 - - -Manual: -If manual.pdf is not present (which is the case when you downloaded the zip file), see https://github.com/orwell96/advtrains/blob/master/manual.pdf - -License of code: LGPL 2.1 -License of media: CC-BY-NC-SA 3.0 - -Contributions: - -Gravel Texture : from Minetest Game -Initial rail model/texture : DS-minetest -Models for signals/bumpers : mbb -Steam engine / wagon texture: mbb -Industrial engine/wagons : mbb -Inventory images : mbb -Small code contributions : NaruTrey / gpcf -Mod Description : hajo \ No newline at end of file diff --git a/advtrains/screenshot.png b/advtrains/screenshot.png new file mode 100644 index 0000000..78783e1 Binary files /dev/null and b/advtrains/screenshot.png differ diff --git a/advtrains/signals.lua b/advtrains/signals.lua deleted file mode 100644 index 8be65e0..0000000 --- a/advtrains/signals.lua +++ /dev/null @@ -1,76 +0,0 @@ ---advtrains by orwell96 ---signals.lua -for r,f in pairs({on="off", off="on"}) do - - advtrains.trackplacer.register_tracktype("advtrains:retrosignal", "") - advtrains.trackplacer.register_tracktype("advtrains:signal", "") - - for rotid, rotation in ipairs({"", "_30", "_45", "_60"}) do - local crea=1 - if rotid==1 and r=="off" then crea=0 end - - minetest.register_node("advtrains:retrosignal_"..r..rotation, { - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4}, - }, - mesh = "advtrains_retrosignal_"..r..rotation..".b3d", - tiles = {"advtrains_retrosignal.png"}, - inventory_image="advtrains_retrosignal_inv.png", - drop="advtrains:retrosignal_off", - description="Lampless Signal ("..r..rotation..")", - on_rightclick=switchfunc, - sunlight_propagates=true, - groups = { - choppy=3, - not_blocking_trains=1, - not_in_creative_inventory=crea, - }, - mesecons = {effector = { - ["action_"..f] = function (pos, node) - minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f..rotation, param2 = node.param2}) - end - }}, - on_rightclick=function(pos, node, clicker) - minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f..rotation, param2 = node.param2}) - end, - }) - advtrains.trackplacer.add_worked("advtrains:retrosignal", r, rotation, nil) - minetest.register_node("advtrains:signal_"..r..rotation, { - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4}, - }, - mesh = "advtrains_signal"..rotation..".b3d", - tiles = {"advtrains_signal_"..r..".png"}, - inventory_image="advtrains_signal_inv.png", - drop="advtrains:signal_off", - description="Signal ("..r..rotation..")", - on_rightclick=switchfunc, - groups = { - choppy=3, - not_blocking_trains=1, - not_in_creative_inventory=crea, - }, - light_source = 1, - sunlight_propagates=true, - mesecons = {effector = { - ["action_"..f] = function (pos, node) - minetest.swap_node(pos, {name = "advtrains:signal_"..f..rotation, param2 = node.param2}) - end - }}, - on_rightclick=function(pos, node, clicker) - minetest.swap_node(pos, {name = "advtrains:signal_"..f..rotation, param2 = node.param2}) - end, - }) - advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil) - end -end diff --git a/advtrains/textures/advtrains_couple.png b/advtrains/textures/advtrains_couple.png deleted file mode 100644 index 9e997e4..0000000 Binary files a/advtrains/textures/advtrains_couple.png and /dev/null differ diff --git a/advtrains/textures/advtrains_discouple.png b/advtrains/textures/advtrains_discouple.png deleted file mode 100644 index b27c4fb..0000000 Binary files a/advtrains/textures/advtrains_discouple.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_atc_placer.png b/advtrains/textures/advtrains_dtrack_atc_placer.png deleted file mode 100644 index 31c2b30..0000000 Binary files a/advtrains/textures/advtrains_dtrack_atc_placer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_bumper_placer.png b/advtrains/textures/advtrains_dtrack_bumper_placer.png deleted file mode 100644 index 27191fe..0000000 Binary files a/advtrains/textures/advtrains_dtrack_bumper_placer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_detector_placer.png b/advtrains/textures/advtrains_dtrack_detector_placer.png deleted file mode 100644 index e6c6ad6..0000000 Binary files a/advtrains/textures/advtrains_dtrack_detector_placer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_placer.png b/advtrains/textures/advtrains_dtrack_placer.png deleted file mode 100644 index 7bef8a9..0000000 Binary files a/advtrains/textures/advtrains_dtrack_placer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_rail.png b/advtrains/textures/advtrains_dtrack_rail.png deleted file mode 100644 index 1cf7f83..0000000 Binary files a/advtrains/textures/advtrains_dtrack_rail.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_rail_atc.png b/advtrains/textures/advtrains_dtrack_rail_atc.png deleted file mode 100644 index d171985..0000000 Binary files a/advtrains/textures/advtrains_dtrack_rail_atc.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_rail_detector_on.png b/advtrains/textures/advtrains_dtrack_rail_detector_on.png deleted file mode 100644 index 4f09b35..0000000 Binary files a/advtrains/textures/advtrains_dtrack_rail_detector_on.png and /dev/null differ diff --git a/advtrains/textures/advtrains_dtrack_slopeplacer.png b/advtrains/textures/advtrains_dtrack_slopeplacer.png deleted file mode 100644 index 1d456b0..0000000 Binary files a/advtrains/textures/advtrains_dtrack_slopeplacer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_newlocomotive.xcf b/advtrains/textures/advtrains_newlocomotive.xcf deleted file mode 100644 index 9ad5187..0000000 Binary files a/advtrains/textures/advtrains_newlocomotive.xcf and /dev/null differ diff --git a/advtrains/textures/advtrains_platform.png b/advtrains/textures/advtrains_platform.png deleted file mode 100644 index 5ba9663..0000000 Binary files a/advtrains/textures/advtrains_platform.png and /dev/null differ diff --git a/advtrains/textures/advtrains_retrosignal.png b/advtrains/textures/advtrains_retrosignal.png deleted file mode 100644 index 141198d..0000000 Binary files a/advtrains/textures/advtrains_retrosignal.png and /dev/null differ diff --git a/advtrains/textures/advtrains_retrosignal_inv.png b/advtrains/textures/advtrains_retrosignal_inv.png deleted file mode 100644 index 1036594..0000000 Binary files a/advtrains/textures/advtrains_retrosignal_inv.png and /dev/null differ diff --git a/advtrains/textures/advtrains_signal_inv.png b/advtrains/textures/advtrains_signal_inv.png deleted file mode 100644 index ed64ed9..0000000 Binary files a/advtrains/textures/advtrains_signal_inv.png and /dev/null differ diff --git a/advtrains/textures/advtrains_signal_off.png b/advtrains/textures/advtrains_signal_off.png deleted file mode 100644 index 8046e52..0000000 Binary files a/advtrains/textures/advtrains_signal_off.png and /dev/null differ diff --git a/advtrains/textures/advtrains_signal_on.png b/advtrains/textures/advtrains_signal_on.png deleted file mode 100644 index 5228bb3..0000000 Binary files a/advtrains/textures/advtrains_signal_on.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_cr.png b/advtrains/textures/advtrains_track_cr.png deleted file mode 100644 index 40f0cc5..0000000 Binary files a/advtrains/textures/advtrains_track_cr.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_cr_45.png b/advtrains/textures/advtrains_track_cr_45.png deleted file mode 100644 index 54966b3..0000000 Binary files a/advtrains/textures/advtrains_track_cr_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_placer.png b/advtrains/textures/advtrains_track_placer.png deleted file mode 100644 index 03e17ed..0000000 Binary files a/advtrains/textures/advtrains_track_placer.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_st.png b/advtrains/textures/advtrains_track_st.png deleted file mode 100644 index 5ad7e4f..0000000 Binary files a/advtrains/textures/advtrains_track_st.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_st_45.png b/advtrains/textures/advtrains_track_st_45.png deleted file mode 100644 index 63b4c96..0000000 Binary files a/advtrains/textures/advtrains_track_st_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swlcr.png b/advtrains/textures/advtrains_track_swlcr.png deleted file mode 100644 index d9b5c0b..0000000 Binary files a/advtrains/textures/advtrains_track_swlcr.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swlcr_45.png b/advtrains/textures/advtrains_track_swlcr_45.png deleted file mode 100644 index f098fc9..0000000 Binary files a/advtrains/textures/advtrains_track_swlcr_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swlst.png b/advtrains/textures/advtrains_track_swlst.png deleted file mode 100644 index 314bd2d..0000000 Binary files a/advtrains/textures/advtrains_track_swlst.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swlst_45.png b/advtrains/textures/advtrains_track_swlst_45.png deleted file mode 100644 index 765d0ec..0000000 Binary files a/advtrains/textures/advtrains_track_swlst_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swrcr.png b/advtrains/textures/advtrains_track_swrcr.png deleted file mode 100644 index f74e1bc..0000000 Binary files a/advtrains/textures/advtrains_track_swrcr.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swrcr_45.png b/advtrains/textures/advtrains_track_swrcr_45.png deleted file mode 100644 index fa432aa..0000000 Binary files a/advtrains/textures/advtrains_track_swrcr_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swrst.png b/advtrains/textures/advtrains_track_swrst.png deleted file mode 100644 index 06ea29e..0000000 Binary files a/advtrains/textures/advtrains_track_swrst.png and /dev/null differ diff --git a/advtrains/textures/advtrains_track_swrst_45.png b/advtrains/textures/advtrains_track_swrst_45.png deleted file mode 100644 index be477b7..0000000 Binary files a/advtrains/textures/advtrains_track_swrst_45.png and /dev/null differ diff --git a/advtrains/textures/advtrains_trackworker.png b/advtrains/textures/advtrains_trackworker.png deleted file mode 100644 index b50bcae..0000000 Binary files a/advtrains/textures/advtrains_trackworker.png and /dev/null differ diff --git a/advtrains/textures/drwho_screwdriver.png b/advtrains/textures/drwho_screwdriver.png deleted file mode 100644 index b50bcae..0000000 Binary files a/advtrains/textures/drwho_screwdriver.png and /dev/null differ diff --git a/advtrains/textures/larger rails.xcf b/advtrains/textures/larger rails.xcf deleted file mode 100644 index 42ae592..0000000 Binary files a/advtrains/textures/larger rails.xcf and /dev/null differ diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua deleted file mode 100644 index b24103a..0000000 --- a/advtrains/trackplacer.lua +++ /dev/null @@ -1,297 +0,0 @@ ---trackplacer.lua ---holds code for the track-placing system. the default 'track' item will be a craftitem that places rails as needed. this will neither place or change switches nor place vertical rails. - ---all new trackplacer code -local tp={ - tracks={} -} - -function tp.register_tracktype(nnprefix, n_suffix) - tp.tracks[nnprefix]={ - default=n_suffix, - single_conn={}, - double_conn={}, - --keys:conn1_conn2 (example:1_4) - --values:{name=x, param2=x} - twcycle={}, - twrotate={},--indexed by suffix, list, tells order of rotations - modify={} - } -end -function tp.add_double_conn(nnprefix, suffix, rotation, conns) - local nodename=nnprefix.."_"..suffix..rotation - for i=0,3 do - tp.tracks[nnprefix].double_conn[((conns.conn1+4*i)%16).."_"..((conns.conn2+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].double_conn[((conns.conn2+4*i)%16).."_"..((conns.conn1+4*i)%16)]={name=nodename, param2=i} - end - tp.tracks[nnprefix].modify[nodename]=true -end -function tp.add_single_conn(nnprefix, suffix, rotation, conns) - local nodename=nnprefix.."_"..suffix..rotation - for i=0,3 do - tp.tracks[nnprefix].single_conn[((conns.conn1+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].single_conn[((conns.conn2+4*i)%16)]={name=nodename, param2=i} - end - tp.tracks[nnprefix].modify[nodename]=true -end - -function tp.add_worked(nnprefix, suffix, rotation, cycle_follows) - tp.tracks[nnprefix].twcycle[suffix]=cycle_follows - if not tp.tracks[nnprefix].twrotate[suffix] then tp.tracks[nnprefix].twrotate[suffix]={} end - table.insert(tp.tracks[nnprefix].twrotate[suffix], rotation) -end - - ---[[ - rewrite algorithm. - selection criteria: these will never be changed or even selected: - - tracks being already connected on both sides - - tracks that are already connected on one side but are not bendable to the desired position - the following situations can occur: - 1. there are two more than two rails around - 1.1 there is one or more subset(s) that can be directly connected - -> choose the first possibility - 2.2 not - -> choose the first one and orient straight - 2. there's exactly 1 rail around - -> choose and orient straight - 3. there's no rail around - -> set straight -]] -function tp.find_already_connected(pos)--TODO vertical calculations(check node below) - local function istrackandbc(pos, conn) - local cnode=minetest.get_node(advtrains.dirCoordSet(pos, conn)) - local bconn=(conn+8)%16 - if advtrains.is_track_and_drives_on(cnode.name, advtrains.all_tracktypes) then - local cconn1, cconn2=advtrains.get_track_connections(cnode.name, cnode.param2) - return cconn1==bconn or cconn2==bconn - end - return false - end - local dnode=minetest.get_node(pos) - local dconn1, dconn2=advtrains.get_track_connections(dnode.name, dnode.param2) - local t={[true]="true", [false]="false"} - if istrackandbc(pos, dconn1) and istrackandbc(pos, dconn2) then return dconn1, dconn2 - elseif istrackandbc(pos, dconn1) then return dconn1 - elseif istrackandbc(pos, dconn2) then return dconn2 - end - return nil -end -function tp.rail_and_can_be_bent(originpos, conn, nnpref) - local pos=advtrains.dirCoordSet(originpos, conn) - local newdir=(conn+8)%16 - local node=minetest.get_node(pos) - local tr=tp.tracks[nnpref] - if not advtrains.is_track_and_drives_on(node.name, advtrains.all_tracktypes) then - return false - end - --rail at other end? - local adj1, adj2=tp.find_already_connected(pos) - if adj1 and adj2 then - return false--dont destroy existing track - elseif adj1 and not adj2 then - if tr.double_conn[adj1.."_"..newdir] then - return true--if exists, connect new rail and old end - end - return false - else - if tr.single_conn[newdir] then--just rotate old rail to right orientation - return true - end - return false - end -end -function tp.bend_rail(originpos, conn, nnpref) - local pos=advtrains.dirCoordSet(originpos, conn) - local newdir=(conn+8)%16 - local node=minetest.get_node(pos) - local tr=tp.tracks[nnpref] - --is rail already connected? no need to bend. - local conn1, conn2=advtrains.get_track_connections(node.name, node.param2) - if newdir==conn1 or newdir==conn2 then - return - end - --rail at other end? - local adj1, adj2=tp.find_already_connected(pos) - if adj1 and adj2 then - return false--dont destroy existing track - elseif adj1 and not adj2 then - if tr.double_conn[adj1.."_"..newdir] then - minetest.set_node(pos, tr.double_conn[adj1.."_"..newdir]) - return true--if exists, connect new rail and old end - end - return false - else - if tr.single_conn[newdir] then--just rotate old rail to right orientation - minetest.set_node(pos, tr.single_conn[newdir]) - return true - end - return false - end -end -function tp.placetrack(pos, nnpref, placer, itemstack, pointed_thing) - --1. find all rails that are likely to be connected - local tr=tp.tracks[nnpref] - local p_rails={} - for i=0,15 do - if tp.rail_and_can_be_bent(pos, i, nnpref) then - p_rails[#p_rails+1]=i - end - end - if #p_rails==0 then - minetest.set_node(pos, {name=nnpref.."_"..tr.default}) - if minetest.registered_nodes[nnpref.."_"..tr.default] and minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node then - minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node(pos, placer, itemstack, pointed_thing) - end - elseif #p_rails==1 then - tp.bend_rail(pos, p_rails[1], nnpref) - minetest.set_node(pos, tr.single_conn[p_rails[1]]) - local nname=tr.single_conn[p_rails[1]].name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - else - --iterate subsets - for k1, conn1 in ipairs(p_rails) do - for k2, conn2 in ipairs(p_rails) do - if k1~=k2 then - if (tr.double_conn[conn1.."_"..conn2]) then - tp.bend_rail(pos, conn1, nnpref) - tp.bend_rail(pos, conn2, nnpref) - minetest.set_node(pos, tr.double_conn[conn1.."_"..conn2]) - local nname=tr.double_conn[conn1.."_"..conn2].name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - return - end - end - end - end - --not found - tp.bend_rail(pos, p_rails[1], nnpref) - minetest.set_node(pos, tr.single_conn[p_rails[1]]) - local nname=tr.single_conn[p_rails[1]].name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - end -end - - -function tp.register_track_placer(nnprefix, imgprefix, dispname) - minetest.register_craftitem(nnprefix.."_placer",{ - description = dispname, - inventory_image = imgprefix.."_placer.png", - wield_image = imgprefix.."_placer.png", - groups={}, - on_place = function(itemstack, placer, pointed_thing) - local name = placer:get_player_name() - if not name then - return itemstack - end - if pointed_thing.type=="node" then - local pos=pointed_thing.above - local upos=pointed_thing.under - if minetest.is_protected(pos,name) and minetest.is_protected(upos,name) then - return itemstack - end - if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to - and minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable then - tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing) - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - end - end - return itemstack - end, - }) -end - - - -minetest.register_craftitem("advtrains:trackworker",{ - description = "Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc.", - groups = {cracky=1}, -- key=name, value=rating; rating=1..3. - inventory_image = "advtrains_trackworker.png", - wield_image = "advtrains_trackworker.png", - stack_max = 1, - on_place = function(itemstack, placer, pointed_thing) - local name = placer:get_player_name() - if not name then - return - end - if pointed_thing.type=="node" then - local pos=pointed_thing.under - if minetest.is_protected(pos, name) then - return - end - local node=minetest.get_node(pos) - - --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end - if advtrains.is_train_at_pos(pos) then return end - - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --print(node.name.."\npattern recognizes:"..nodeprefix.." / "..railtype.." / "..rotation) - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then - nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") - rotation = "" - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then - minetest.chat_send_player(placer:get_player_name(), "This node can't be rotated using the trackworker!") - return - end - end - local modext=tp.tracks[nnprefix].twrotate[suffix] - - if rotation==modext[#modext] then --increase param2 - minetest.swap_node(pos, {name=nnprefix.."_"..suffix..modext[1], param2=(node.param2+1)%4}) - return - else - local modpos - for k,v in pairs(modext) do if v==rotation then modpos=k end end - if not modpos then - minetest.chat_send_player(placer:get_player_name(), "This node can't be rotated using the trackworker!") - return - end - minetest.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) - end - advtrains.invalidate_all_paths() - end - end, - on_use=function(itemstack, user, pointed_thing) - local name = user:get_player_name() - if not name then - return - end - if pointed_thing.type=="node" then - local pos=pointed_thing.under - local node=minetest.get_node(pos) - if minetest.is_protected(pos, name) then - return - end - - --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end - if advtrains.is_train_at_pos(pos) then return end - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --print(node.name.."\npattern recognizes:"..nodeprefix.." / "..railtype.." / "..rotation) - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then - nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") - rotation = "" - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then - minetest.chat_send_player(user:get_player_name(), "This node can't be changed using the trackworker!") - return - end - end - local nextsuffix=tp.tracks[nnprefix].twcycle[suffix] - minetest.swap_node(pos, {name=nnprefix.."_"..nextsuffix..rotation, param2=node.param2}) - --invalidate trains - advtrains.invalidate_all_paths() - else - print(name, dump(tp.tracks)) - end - end, -}) - ---putting into right place -advtrains.trackplacer=tp diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua deleted file mode 100644 index beb0bbc..0000000 --- a/advtrains/tracks.lua +++ /dev/null @@ -1,721 +0,0 @@ ---advtrains by orwell96, see readme.txt - ---dev-time settings: ---EDIT HERE ---If the old non-model rails on straight tracks should be replaced by the new... ---false: no ---true: yes -advtrains.register_replacement_lbms=false - ---[[TracksDefinition -nodename_prefix -texture_prefix -description -common={} -straight={} -straight45={} -curve={} -curve45={} -lswitchst={} -lswitchst45={} -rswitchst={} -rswitchst45={} -lswitchcr={} -lswitchcr45={} -rswitchcr={} -rswitchcr45={} -vert1={ - --you'll probably want to override mesh here -} -vert2={ - --you'll probably want to override mesh here -} -]]-- -advtrains.all_tracktypes={} - ---definition preparation -local function conns(c1, c2, r1, r2, rh, rots) return {conn1=c1, conn2=c2, rely1=r1, rely2=r2, railheight=rh} end - -local ap={} -ap.t_30deg={ - regstep=1, - variant={ - st=conns(0,8), - cr=conns(0,7), - swlst=conns(0,8), - swlcr=conns(0,7), - swrst=conns(0,8), - swrcr=conns(0,9), - vst1=conns(8,0,0,0.5,0.25), - vst2=conns(8,0,0.5,1,0.75), - vst31=conns(8,0,0,0.33,0.16), - vst32=conns(8,0,0.33,0.66,0.5), - vst33=conns(8,0,0.66,1,0.83), - }, - description={ - st="straight", - cr="curve", - swlst="left switch (straight)", - swlcr="left switch (curve)", - swrst="right switch (straight)", - swrcr="right switch (curve)", - vst1="steep uphill 1/2", - vst2="steep uphill 2/2", - vst31="uphill 1/3", - vst32="uphill 2/3", - vst33="uphill 3/3", - }, - switch={ - swlst="swlcr", - swlcr="swlst", - swrst="swrcr", - swrcr="swrst", - }, - switchmc={ - swlst="on", - swlcr="off", - swrst="on", - swrcr="off", - }, - regtp=true, - trackplacer={ - st=true, - cr=true, - }, - tpsingle={ - st=true, - }, - tpdefault="st", - trackworker={ - ["swrcr"]="st", - ["swrst"]="st", - ["st"]="cr", - ["cr"]="swlst", - ["swlcr"]="swrcr", - ["swlst"]="swrst", - }, - regsp=true, - slopenodes={ - vst1=true, vst2=true, - vst31=true, vst32=true, vst33=true, - }, - slopeplacer={ - [2]={"vst1", "vst2"}, - [3]={"vst31", "vst32", "vst33"}, - max=3,--highest entry - }, - slopeplacer_45={ - [2]={"vst1_45", "vst2_45"}, - max=2, - }, - rotation={"", "_30", "_45", "_60"}, - increativeinv={}, -} -ap.t_30deg_straightonly={ - regstep=1, - variant={ - st=conns(0,8), - }, - description={ - st="straight", - }, - switch={ - }, - switchmc={ - }, - regtp=true, - trackplacer={ - }, - tpsingle={ - }, - tpdefault="st", - trackworker={ - ["st"]="st", - }, - slopenodes={}, - rotation={"", "_30", "_45", "_60"}, - increativeinv={st}, -} -ap.t_30deg_straightonly_noplacer={ - regstep=1, - variant={ - st=conns(0,8), - }, - description={ - st="straight", - }, - switch={ - }, - switchmc={ - }, - regtp=false, - trackplacer={ - }, - tpsingle={ - }, - tpdefault="st", - trackworker={ - ["st"]="st", - }, - slopenodes={}, - rotation={"", "_30", "_45", "_60"}, - increativeinv={st}, -} -ap.t_45deg={ - regstep=2, - variant={ - st=conns(0,8), - cr=conns(0,6), - swlst=conns(0,8), - swlcr=conns(0,6), - swrst=conns(0,8), - swrcr=conns(0,10), - vst1=conns(8,0,0,0.5,0.25), - vst2=conns(8,0,0.5,1,0.75), - }, - description={ - st="straight", - cr="curve", - swlst="left switch (straight)", - swlcr="left switch (curve)", - swrst="right switch (straight)", - swrcr="right switch (curve)", - vst1="vertical lower node", - vst2="vertical upper node", - }, - switch={ - swlst="swlcr", - swlcr="swlst", - swrst="swrcr", - swrcr="swrst", - }, - switchmc={ - swlst="on", - swlcr="off", - swrst="on", - swrcr="off", - }, - regtp=true, - trackplacer={ - st=true, - cr=true, - }, - tpsingle={ - st=true, - }, - tpdefault="st", - trackworker={ - ["swrcr"]="st", - ["swrst"]="st", - ["st"]="cr", - ["cr"]="swlst", - ["swlcr"]="swrcr", - ["swlst"]="swrst", - }, - slopenodes={}, - rotation={"", "_45"}, - increativeinv={vst1=true, vst2=true} -} -advtrains.trackpresets = ap - ---definition format: ([] optional) ---[[{ - nodename_prefix - texture_prefix - [shared_texture] - models_prefix - models_suffix (with dot) - [shared_model] - formats={ - st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 - (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) - } - common={} change something on common rail appearance -}]] -function advtrains.register_tracks(tracktype, def, preset) - local function make_switchfunc(suffix_target, mesecon_state) - local switchfunc=function(pos, node) - if advtrains.is_train_at_pos(pos) then return end - minetest.set_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) - advtrains.invalidate_all_paths() - advtrains.reset_trackdb_position(pos) - end - return switchfunc, {effector = { - ["action_"..mesecon_state] = switchfunc, - rules=advtrains.meseconrules - }} - end - local function make_overdef(suffix, rotation, conns, switchfunc, mesecontbl, in_creative_inv, drop_slope) - local img_suffix=suffix..rotation - return { - mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix), - tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png")}, - --inventory_image = def.texture_prefix.."_"..img_suffix..".png", - --wield_image = def.texture_prefix.."_"..img_suffix..".png", - description=def.description.."("..preset.description[suffix]..rotation..")", - connect1=conns.conn1, - connect2=conns.conn2, - rely1=conns.rely1 or 0, - rely2=conns.rely2 or 0, - railheight=conns.railheight or 0, - on_rightclick=switchfunc, - groups = { - attached_node=1, - ["advtrains_track_"..tracktype]=1, - dig_immediate=2, - not_in_creative_inventory=(not in_creative_inv and 1 or nil), - not_blocking_trains=1, - }, - mesecons=mesecontbl, - drop = increativeinv and def.nodename_prefix.."_"..suffix..rotation or (drop_slope and def.nodename_prefix.."_slopeplacer" or def.nodename_prefix.."_placer"), - } - end - local function cycle_conns(conns, rotid) - local add=(rotid-1)*preset.regstep - return { - conn1=(conns.conn1+add)%16, - conn2=(conns.conn2+add)%16, - rely1=conns.rely1 or 0, - rely2=conns.rely2 or 0, - railheight=conns.railheight or 0, - } - end - local common_def=advtrains.merge_tables({ - description = def.description, - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, - }, - rely1=0, - rely2=0, - railheight=0, - drop=def.nodename_prefix.."_placer", - can_dig=function(pos) - return not advtrains.is_train_at_pos(pos) - end, - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.reset_trackdb_position(pos) - end, - after_place_node=function(pos) - advtrains.reset_trackdb_position(pos) - end, - on_place_rail=function(pos) - advtrains.reset_trackdb_position(pos) - end, - }, def.common or {}) - --make trackplacer base def - advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault) - if preset.regtp then - advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description) - end - if preset.regsp then - advtrains.slope.register_placer(def, preset) - end - for suffix, conns in pairs(preset.variant) do - for rotid, rotation in ipairs(preset.rotation) do - if not def.formats[suffix] or def.formats[suffix][rotid] then - local switchfunc, mesecontbl - if preset.switch[suffix] then - switchfunc, mesecontbl=make_switchfunc(preset.switch[suffix]..rotation, preset.switchmc[suffix]) - end - local adef={} - if def.get_additional_definiton then - adef=def.get_additional_definiton(def, preset, suffix, rotation) - end - - minetest.register_node(def.nodename_prefix.."_"..suffix..rotation, advtrains.merge_tables( - common_def, - make_overdef( - suffix, rotation, - cycle_conns(conns, rotid), - switchfunc, mesecontbl, preset.increativeinv[suffix], preset.slopenodes[suffix] - ), - adef - ) - ) - --trackplacer - if preset.regtp then - if preset.trackplacer[suffix] then - advtrains.trackplacer.add_double_conn(def.nodename_prefix, suffix, rotation, cycle_conns(conns, rotid)) - end - if preset.tpsingle[suffix] then - advtrains.trackplacer.add_single_conn(def.nodename_prefix, suffix, rotation, cycle_conns(conns, rotid)) - end - end - advtrains.trackplacer.add_worked(def.nodename_prefix, suffix, rotation, preset.trackworker[suffix]) - end - end - end - advtrains.all_tracktypes[tracktype]=true -end - - -function advtrains.is_track_and_drives_on(nodename, drives_on_p) - if not minetest.registered_nodes[nodename] then - return false - end - local nodedef=minetest.registered_nodes[nodename] - for k,v in pairs(drives_on_p) do - if nodedef.groups["advtrains_track_"..k] then - return true - end - end - return false -end - -function advtrains.get_track_connections(name, param2) - local nodedef=minetest.registered_nodes[name] - if not nodedef then print("[advtrains] get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return 0, 8, 0, 0, 0 end - local noderot=param2 - if not param2 then noderot=0 end - if noderot > 3 then print("[advtrains] get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end - - return (nodedef.connect1 + 4 * noderot)%16, (nodedef.connect2 + 4 * noderot)%16, nodedef.rely1 or 0, nodedef.rely2 or 0, nodedef.railheight or 0 -end - ---detector code ---holds a table with nodes on which trains are on. - -advtrains.detector = {} -advtrains.detector.on_node = {} -advtrains.detector.on_node_restore = {} ---set if paths were invalidated before. tells trainlogic.lua to call advtrains.detector.finalize_restore() -advtrains.detector.clean_step_before = false - ---when train enters a node, call this ---The entry already being contained in advtrains.detector.on_node_restore will not trigger an on_train_enter event on the node. (when path is reset, this is saved). -function advtrains.detector.enter_node(pos, train_id) - local pts = minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) - --print("enterNode "..pts.." "..sid(train_id)) - if advtrains.detector.on_node[pts] then - if advtrains.trains[advtrains.detector.on_node[pts]] then - --print(""..pts.." already occupied") - return false - else - advtrains.detector.leave_node(pos, advtrains.detector.on_node[pts]) - end - end - advtrains.detector.on_node[pts]=train_id - if advtrains.detector.on_node_restore[pts] then - advtrains.detector.on_node_restore[pts]=nil - else - advtrains.detector.call_enter_callback(advtrains.round_vector_floor_y(pos), train_id) - end - return true -end -function advtrains.detector.leave_node(pos, train_id) - local pts = minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) - --print("leaveNode "..pts.." "..sid(train_id)) - if not advtrains.detector.on_node[pts] then - --print(""..pts.." leave: nothing here") - return false - end - if advtrains.detector.on_node[pts]==train_id then - advtrains.detector.call_leave_callback(advtrains.round_vector_floor_y(pos), train_id) - advtrains.detector.on_node[pts]=nil - else - if advtrains.trains[advtrains.detector.on_node[pts]] then - --print(""..pts.." occupied by another train") - return false - else - advtrains.detector.leave_node(pos, advtrains.detector.on_node[pts]) - return false - end - end - return true -end ---called immediately before invalidating paths -function advtrains.detector.setup_restore() - --print("setup_restore") - advtrains.detector.on_node_restore = advtrains.detector.on_node - advtrains.detector.on_node = {} -end ---called one step after invalidating paths, when all trains have restored their path and called enter_node for their contents. -function advtrains.detector.finalize_restore() - --print("finalize_restore") - for pts, train_id in pairs(advtrains.detector.on_node_restore) do - --print("called leave callback "..pts.." "..train_id) - advtrains.detector.call_leave_callback(minetest.string_to_pos(pts), train_id) - end - advtrains.detector.on_node_restore = {} -end -function advtrains.detector.call_enter_callback(pos, train_id) - --print("instructed to call enter calback") - - local node = minetest.get_node(pos) --this spares the check if node is nil, it has a name in any case - local mregnode=minetest.registered_nodes[node.name] - if mregnode and mregnode.advtrains and mregnode.advtrains.on_train_enter then - mregnode.advtrains.on_train_enter(pos, train_id) - end - - --atc code wants to be notified too - advtrains.atc.trigger_controller_train_enter(pos, train_id) -end -function advtrains.detector.call_leave_callback(pos, train_id) - --print("instructed to call leave calback") - - local node = minetest.get_node(pos) --this spares the check if node is nil, it has a name in any case - local mregnode=minetest.registered_nodes[node.name] - if mregnode and mregnode.advtrains and mregnode.advtrains.on_train_leave then - mregnode.advtrains.on_train_leave(pos, train_id) - end -end - --- slope placer. Defined in register_tracks. ---crafted with rail and gravel -local sl={} -function sl.register_placer(def, preset) - minetest.register_craftitem(def.nodename_prefix.."_slopeplacer",{ - description = def.description.." Slope", - inventory_image = def.texture_prefix.."_slopeplacer.png", - wield_image = def.texture_prefix.."_slopeplacer.png", - groups={}, - on_place = sl.create_slopeplacer_on_place(def, preset) - }) -end ---(itemstack, placer, pointed_thing) -function sl.create_slopeplacer_on_place(def, preset) - return function(istack, player, pt) - if not pt.type=="node" then - minetest.chat_send_player(player:get_player_name(), "Can't place: not pointing at node") - return istack - end - local pos=pt.above - if not pos then - minetest.chat_send_player(player:get_player_name(), "Can't place: not pointing at node") - return istack - end - local node=minetest.get_node(pos) - if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to then - minetest.chat_send_player(player:get_player_name(), "Can't place: space occupied!") - return istack - end - if minetest.is_protected(pos, player:get_player_name()) then - minetest.chat_send_player(player:get_player_name(), "Can't place: protected position!") - return istack - end - --determine player orientation (only horizontal component) - --get_look_horizontal may not be available - local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2) - - --rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5. - dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} - --translate to direction to look up inside the preset table - local param2, rot45=({ - [-1]={ - [-1]=2, - [0]=3, - [1]=3, - }, - [0]={ - [-1]=2, - [1]=0, - }, - [1]={ - [-1]=1, - [0]=1, - [1]=0, - }, - })[dirvec.x][dirvec.z], dirvec.x~=0 and dirvec.z~=0 - local lookup=preset.slopeplacer - if rot45 then lookup=preset.slopeplacer_45 end - - --go unitvector forward and look how far the next node is - local step=1 - while step<=lookup.max do - local node=minetest.get_node(vector.add(pos, dirvec)) - --next node solid? - if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or minetest.is_protected(pos, player:get_player_name()) then - --do slopes of this distance exist? - if lookup[step] then - if minetest.setting_getbool("creative_mode") or istack:get_count()>=step then - --start placing - local placenodes=lookup[step] - while step>0 do - minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2}) - if not minetest.setting_getbool("creative_mode") then - istack:take_item() - end - step=step-1 - pos=vector.subtract(pos, dirvec) - end - else - minetest.chat_send_player(player:get_player_name(), "Can't place: Not enough slope items left ("..step.." required)") - end - else - minetest.chat_send_player(player:get_player_name(), "Can't place: There's no slope of length "..step) - end - return istack - end - step=step+1 - pos=vector.add(pos, dirvec) - end - minetest.chat_send_player(player:get_player_name(), "Can't place: no supporting node at upper end.") - return itemstack - end -end - -advtrains.slope=sl - ---END code, BEGIN definition ---definition format: ([] optional) ---[[{ - nodename_prefix - texture_prefix - [shared_texture] - models_prefix - models_suffix (with dot) - [shared_model] - formats={ - st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 - (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) - } - common={} change something on common rail appearance -}]] - -advtrains.register_tracks("regular", { - nodename_prefix="advtrains:track", - texture_prefix="advtrains_track", - shared_model="trackplane.b3d", - description="Deprecated Track", - formats={vst1={}, vst2={}}, -}, ap.t_45deg) - - -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail.png", - description="Track", - formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, -}, ap.t_30deg) - ---bumpers -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_bumper", - texture_prefix="advtrains_dtrack_bumper", - models_prefix="advtrains_dtrack_bumper", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail.png", - description="Bumper", - formats={}, -}, ap.t_30deg_straightonly) ---legacy bumpers -for _,rot in ipairs({"", "_30", "_45", "_60"}) do - minetest.register_alias("advtrains:dtrack_bumper"..rot, "advtrains:dtrack_bumper_st"..rot) -end - -if mesecon then - advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_detector_off", - texture_prefix="advtrains_dtrack_detector", - models_prefix="advtrains_dtrack_detector", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail.png", - description="Detector Rail", - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - mesecons = { - receptor = { - state = mesecon.state.off, - rules = advtrains.meseconrules - } - }, - advtrains = { - on_train_enter=function(pos, train_id) - minetest.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=minetest.get_node(pos).param2}) - mesecon.receptor_on(pos, advtrains.meseconrules) - end - } - } - end - }, ap.t_30deg_straightonly) - advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_detector_on", - texture_prefix="advtrains_dtrack_detector", - models_prefix="advtrains_dtrack_detector", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail_detector_on.png", - description="Detector(on)(you hacker you)", - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - mesecons = { - receptor = { - state = mesecon.state.on, - rules = advtrains.meseconrules - } - }, - advtrains = { - on_train_leave=function(pos, train_id) - minetest.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=minetest.get_node(pos).param2}) - mesecon.receptor_off(pos, advtrains.meseconrules) - end - } - } - end - }, ap.t_30deg_straightonly_noplacer) -end ---TODO legacy ---I know lbms are better for this purpose -for name,rep in pairs({swl_st="swlst", swr_st="swrst", swl_cr="swlcr", swr_cr="swrcr", }) do - minetest.register_abm({ - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_"..name}, - interval = 1.0, -- Operation interval in seconds - chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep, param2=node.param2}) end, - }) - minetest.register_abm({ - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_"..name.."_45"}, - interval = 1.0, -- Operation interval in seconds - chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep.."_45", param2=node.param2}) end, - }) -end - -if advtrains.register_replacement_lbms then -minetest.register_lbm({ - name = "advtrains:ramp_replacement_1", --- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_vert1"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst1", param2=(node.param2+2)%4}) end, -}) -minetest.register_lbm({ - name = "advtrains:ramp_replacement_1", --- -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_vert2"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst2", param2=(node.param2+2)%4}) end, -}) - minetest.register_abm({ - name = "advtrains:st_rep_1", - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_st"}, - interval=1, - chance=1, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st", param2=node.param2}) end, - }) - minetest.register_lbm({ - name = "advtrains:st_rep_1", - -- -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_st_45"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st_45", param2=node.param2}) end, - }) -end - - - - - - - - diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua deleted file mode 100644 index e69f04a..0000000 --- a/advtrains/trainhud.lua +++ /dev/null @@ -1,109 +0,0 @@ ---trainhud.lua: holds all the code for train controlling - -advtrains.hud = {} - -minetest.register_on_leaveplayer(function(player) -advtrains.hud[player:get_player_name()] = nil -end) - -local mletter={[1]="F", [-1]="R", [0]="N"} - -function advtrains.on_control_change(pc, train, flip) - if pc.sneak then - if pc.up then - train.tarvelocity = train.max_speed or 10 - end - if pc.down then - train.tarvelocity = 0 - end - if pc.left then - train.tarvelocity = 4 - end - if pc.right then - train.tarvelocity = 8 - end - if pc.jump then - train.brake = true - --0: released, 1: brake and pressed, 2: released and brake, 3: pressed and brake - if not train.brake_hold_state or train.brake_hold_state==0 then - train.brake_hold_state = 1 - elseif train.brake_hold_state==2 then - train.brake_hold_state = 3 - end - elseif train.brake_hold_state==1 then - train.brake_hold_state = 2 - elseif train.brake_hold_state==3 then - train.brake = false - train.brake_hold_state = 0 - end - --shift+use:see wagons.lua - else - if pc.up then - train.tarvelocity = train.tarvelocity + 1 - end - if pc.down then - if train.velocity>0 then - train.tarvelocity = math.max(train.tarvelocity - 1, 0) - else - train.movedir = -train.movedir - end - end - if train.brake_hold_state~=2 then - train.brake = false - end - if pc.jump then - train.brake = true - end - if pc.aux1 then - --horn - end - end -end -function advtrains.update_driver_hud(pname, train, flip) - advtrains.set_trainhud(pname, advtrains.hud_train_format(train, flip)) -end -function advtrains.clear_driver_hud(pname) - advtrains.set_trainhud(pname, "") -end - -function advtrains.set_trainhud(name, text) - local hud = advtrains.hud[name] - local player=minetest.get_player_by_name(name) - if not player then - return - end - if not hud then - hud = {} - advtrains.hud[name] = hud - hud.id = player:hud_add({ - hud_elem_type = "text", - name = "ADVTRAINS", - number = 0xFFFFFF, - position = {x=0.5, y=0.7}, - offset = {x=0, y=0}, - text = text, - scale = {x=200, y=60}, - alignment = {x=0, y=0}, - }) - hud.oldText=text - return - elseif hud.oldText ~= text then - player:hud_change(hud.id, "text", text) - hud.oldText=text - end -end -function advtrains.hud_train_format(train, flip) - local fct=flip and -1 or 1 - if not train then return "" end - - local max=train.max_speed or 10 - local vel=advtrains.abs_ceil(train.velocity) - local tvel=advtrains.abs_ceil(train.tarvelocity) - local topLine, firstLine, secondLine - - topLine="Train".." ["..mletter[fct*train.movedir].."] "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") - firstLine="Speed: |"..string.rep("+", vel)..string.rep("_", max-vel)..">" - secondLine="Target: |"..string.rep("+", tvel)..string.rep("_", max-tvel)..">" - - return topLine.."\n"..firstLine.."\n"..secondLine -end diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua deleted file mode 100644 index eb45500..0000000 --- a/advtrains/trainlogic.lua +++ /dev/null @@ -1,875 +0,0 @@ ---trainlogic.lua ---controls train entities stuff about connecting/disconnecting/colliding trains and other things - - -local benchmark=false -local bm={} -local bmlt=0 -local bmsteps=0 -local bmstepint=200 -printbm=function(action, ta) - if not benchmark then return end - local t=(os.clock()-ta)*1000 - if not bm[action] then - bm[action]=t - else - bm[action]=bm[action]+t - end - bmlt=bmlt+t -end -function endstep() - if not benchmark then return end - bmsteps=bmsteps-1 - if bmsteps<=0 then - bmsteps=bmstepint - for key, value in pairs(bm) do - minetest.chat_send_all(key.." "..(value/bmstepint).." ms avg.") - end - minetest.chat_send_all("Total time consumed by all advtrains actions per step: "..(bmlt/bmstepint).." ms avg.") - bm={} - bmlt=0 - end -end - -advtrains.train_accel_force=2--per second and divided by number of wagons -advtrains.train_brake_force=3--per second, not divided by number of wagons -advtrains.train_roll_force=0.5--per second, not divided by number of wagons, acceleration when rolling without brake -advtrains.train_emerg_force=10--for emergency brakes(when going off track) - -advtrains.audit_interval=30 - - -advtrains.trains={} -advtrains.wagon_save={} - ---load initially -advtrains.fpath=minetest.get_worldpath().."/advtrains" -local file, err = io.open(advtrains.fpath, "r") -if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed loading advtrains save file "..er) -else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - advtrains.trains=tbl - end - file:close() -end -advtrains.fpath_ws=minetest.get_worldpath().."/advtrains_wagon_save" -local file, err = io.open(advtrains.fpath_ws, "r") -if not file then - local er=err or "Unknown Error" - print("[advtrains]Failed loading advtrains save file "..er) -else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - advtrains.wagon_save=tbl - end - file:close() -end - - -advtrains.save = function() - --print("[advtrains]saving") - advtrains.invalidate_all_paths() - local datastr = minetest.serialize(advtrains.trains) - if not datastr then - minetest.log("error", "[advtrains] Failed to serialize train data!") - return - end - local file, err = io.open(advtrains.fpath, "w") - if err then - return err - end - file:write(datastr) - file:close() - - -- update wagon saves - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized then - wagon:get_staticdata() - end - end - --cross out userdata - for w_id, data in pairs(advtrains.wagon_save) do - data.name=nil - data.object=nil - if data.driver then - data.driver_name=data.driver:get_player_name() - data.driver=nil - else - data.driver_name=nil - end - if data.discouple then - data.discouple.object:remove() - data.discouple=nil - end - end - --print(dump(advtrains.wagon_save)) - datastr = minetest.serialize(advtrains.wagon_save) - if not datastr then - minetest.log("error", "[advtrains] Failed to serialize train data!") - return - end - file, err = io.open(advtrains.fpath_ws, "w") - if err then - return err - end - file:write(datastr) - file:close() - - advtrains.save_trackdb() - advtrains.atc.save() -end -minetest.register_on_shutdown(advtrains.save) - -advtrains.save_and_audit_timer=advtrains.audit_interval -minetest.register_globalstep(function(dtime) - advtrains.save_and_audit_timer=advtrains.save_and_audit_timer-dtime - if advtrains.save_and_audit_timer<=0 then - local t=os.clock() - - --save - advtrains.save() - advtrains.save_and_audit_timer=advtrains.audit_interval - printbm("saving", t) - end - --regular train step - local t=os.clock() - for k,v in pairs(advtrains.trains) do - advtrains.train_step(k, v, dtime) - end - - --see tracks.lua - if advtrains.detector.clean_step_before then - advtrains.detector.finalize_restore() - end - - printbm("trainsteps", t) - endstep() -end) - -function advtrains.train_step(id, train, dtime) - --Legacy: set drives_on and max_speed - if not train.drives_on or not train.max_speed then - advtrains.update_trainpart_properties(id) - end - --TODO check for all vars to be present - if not train.velocity then - train.velocity=0 - end - if not train.movedir or (train.movedir~=1 and train.movedir~=-1) then - train.movedir=1 - end - --very unimportant thing: check if couple is here - if train.couple_eid_front and (not minetest.luaentities[train.couple_eid_front] or not minetest.luaentities[train.couple_eid_front].is_couple) then train.couple_eid_front=nil end - if train.couple_eid_back and (not minetest.luaentities[train.couple_eid_back] or not minetest.luaentities[train.couple_eid_back].is_couple) then train.couple_eid_back=nil end - - --skip certain things (esp. collision) when not moving - local train_moves=(train.velocity~=0) - - --if not train.last_pos then advtrains.trains[id]=nil return end - - if not advtrains.pathpredict(id, train) then - print("pathpredict failed(returned false)") - train.velocity=0 - train.tarvelocity=0 - return - end - - local path=advtrains.get_or_create_path(id, train) - if not path then - train.velocity=0 - train.tarvelocity=0 - print("train has no path for whatever reason") - return - end - - local train_end_index=advtrains.get_train_end_index(train) - --apply off-track handling: - local front_off_track=train.max_index_on_track and train.index>train.max_index_on_track - local back_off_track=train.min_index_on_track and train_end_index1 then train.tarvelocity=1 end - elseif front_off_track then--allow movement only backward - if train.movedir==1 and train.tarvelocity>0 then train.tarvelocity=0 end - if train.movedir==-1 and train.tarvelocity>1 then train.tarvelocity=1 end - elseif back_off_track then--allow movement only forward - if train.movedir==-1 and train.tarvelocity>0 then train.tarvelocity=0 end - if train.movedir==1 and train.tarvelocity>1 then train.tarvelocity=1 end - end - - --update advtrains.detector - if not train.detector_old_index then - train.detector_old_index = math.floor(train_end_index) - train.detector_old_end_index = math.floor(train_end_index) - end - local ifo, ifn, ibo, ibn = train.detector_old_index, math.floor(train.index), train.detector_old_end_index, math.floor(train_end_index) - if ifn>ifo then - for i=ifo, ifn do - if path[i] then - advtrains.detector.enter_node(path[i], id) - end - end - elseif ifnibo then - for i=ibo, ibn do - if path[i] then - advtrains.detector.leave_node(path[i], id) - end - end - end - train.detector_old_index = math.floor(train.index) - train.detector_old_end_index = math.floor(train_end_index) - - --remove? - if #train.trainparts==0 then - print("[advtrains][train "..sid(id).."] has empty trainparts, removing.") - advtrains.detector.leave_node(path[train.detector_old_index], id) - advtrains.trains[id]=nil - return - end - - if train_moves then - --check for collisions by finding objects - - --heh, new collision again. - --this time, based on NODES and the advtrains.detector.on_node table. - local collpos - local coll_grace=1 - if train.movedir==1 then - collpos=advtrains.get_real_index_position(path, train.index-coll_grace) - else - collpos=advtrains.get_real_index_position(path, train_end_index+coll_grace) - end - if collpos then - local rcollpos=advtrains.round_vector_floor_y(collpos) - for x=-1,1 do - for z=-1,1 do - local testpos=vector.add(rcollpos, {x=x, y=0, z=z}) - local testpts=minetest.pos_to_string(testpos) - if advtrains.detector.on_node[testpts] and advtrains.detector.on_node[testpts]~=id then - --collides - advtrains.spawn_couple_on_collide(id, testpos, advtrains.detector.on_node[testpts], train.movedir==-1) - - train.recently_collided_with_env=true - train.velocity=0.5*train.velocity - train.movedir=train.movedir*-1 - train.tarvelocity=0 - - end - end - end - end - end - --check for any trainpart entities if they have been unloaded. do this only if train is near a player, to not spawn entities into unloaded areas - --todo function will be taken by update_trainpart_properties - train.check_trainpartload=(train.check_trainpartload or 0)-dtime - local node_range=(math.max((minetest.setting_get("active_block_range") or 0),1)*16) - if train.check_trainpartload<=0 then - local ori_pos=advtrains.get_real_index_position(path, train.index) --not much to calculate - --print("[advtrains][train "..id.."] at "..minetest.pos_to_string(vector.round(ori_pos))) - - local should_check=false - for _,p in ipairs(minetest.get_connected_players()) do - should_check=should_check or ((vector.distance(ori_pos, p:getpos())=train.velocity then - train.atc_brake_target=nil - end - if train.atc_wait_finish then - if not train.atc_brake_target and train.velocity==train.tarvelocity then - train.atc_wait_finish=nil - end - end - if train.atc_command then - if train.atc_delay<=0 and not train.atc_wait_finish then - advtrains.atc.execute_atc_command(id, train) - else - train.atc_delay=train.atc_delay-dtime - end - end - - --make brake adjust the tarvelocity if necessary - if train.brake and (math.ceil(train.velocity)-1)0 then--accelerating, force will be brought on only by locomotives. - --print("accelerating with default force") - applydiff=(math.min((advtrains.train_accel_force*train.locomotives_in_train*dtime)/mass, math.abs(diff))) - else--decelerating - if front_off_track or back_off_track or train.recently_collided_with_env then --every wagon has a brake, so not divided by mass. - --print("braking with emergency force") - applydiff= -(math.min((advtrains.train_emerg_force*dtime), math.abs(diff))) - elseif train.brake or (train.atc_brake_target and train.atc_brake_target0 then - if train.movedir>0 then - pregen_front=2+math.ceil(train.velocity*0.15) --assumes server step of 0.1 seconds, +50% tolerance - else - pregen_back=2+math.ceil(train.velocity*0.15) - end - end - - - local maxn=advtrains.maxN(train.path) - while (maxn-train.index) < pregen_front do--pregenerate - --print("[advtrains]maxn conway for ",maxn,minetest.pos_to_string(path[maxn]),maxn-1,minetest.pos_to_string(path[maxn-1])) - local conway=advtrains.conway(train.path[maxn], train.path[maxn-1], train.drives_on) - if conway then - train.path[maxn+1]=conway - train.max_index_on_track=maxn - else - --do as if nothing has happened and preceed with path - --but do not update max_index_on_track - --print("over-generating path max to index "..maxn+1) - train.path[maxn+1]=vector.add(train.path[maxn], vector.subtract(train.path[maxn], train.path[maxn-1])) - end - train.path_dist[maxn]=vector.distance(train.path[maxn+1], train.path[maxn]) - maxn=advtrains.maxN(train.path) - end - - local minn=advtrains.minN(train.path) - while (train.index-minn) < (train.trainlen or 0) + pregen_back do --post_generate. has to be at least trainlen. (we let go of the exact calculation here since this would be unuseful here) - --print("[advtrains]minn conway for ",minn,minetest.pos_to_string(path[minn]),minn+1,minetest.pos_to_string(path[minn+1])) - local conway=advtrains.conway(train.path[minn], train.path[minn+1], train.drives_on) - if conway then - train.path[minn-1]=conway - train.min_index_on_track=minn - else - --do as if nothing has happened and preceed with path - --but do not update min_index_on_track - --print("over-generating path min to index "..minn-1) - train.path[minn-1]=vector.add(train.path[minn], vector.subtract(train.path[minn], train.path[minn+1])) - end - train.path_dist[minn-1]=vector.distance(train.path[minn], train.path[minn-1]) - minn=advtrains.minN(train.path) - end - if not train.min_index_on_track then train.min_index_on_track=0 end - if not train.max_index_on_track then train.max_index_on_track=0 end - - --make pos/yaw available for possible recover calls - if train.max_index_on_tracktrain.index then --whoops, train went even more far. same behavior - train.savedpos_off_track_index_offset=train.index-train.min_index_on_track - train.last_pos=train.path[train.min_index_on_track+1] - train.last_pos_prev=train.path[train.min_index_on_track] - --print("train is off-track (back), last positions kept at "..minetest.pos_to_string(train.last_pos).." / "..minetest.pos_to_string(train.last_pos_prev)) - else --regular case - train.savedpos_off_track_index_offset=nil - train.last_pos=train.path[math.floor(train.index+0.5)] - train.last_pos_prev=train.path[math.floor(train.index-0.5)] - end - return train.path -end -function advtrains.get_train_end_index(train) - return advtrains.get_real_path_index(train, train.trainlen or 2)--this function can be found inside wagons.lua since it's more related to wagons. we just set trainlen as pos_in_train -end - -function advtrains.get_or_create_path(id, train) - if not train.path then return advtrains.pathpredict(id, train) end - return train.path -end - -function advtrains.add_wagon_to_train(wagon, train_id, index) - local train=advtrains.trains[train_id] - if index then - table.insert(train.trainparts, index, wagon.unique_id) - else - table.insert(train.trainparts, wagon.unique_id) - end - --this is not the usual case!!! - --we may set initialized because the wagon has no chance to step() - wagon.initialized=true - --TODO is this art or can we throw it away? - advtrains.update_trainpart_properties(train_id) -end -function advtrains.update_trainpart_properties(train_id, invert_flipstate) - local train=advtrains.trains[train_id] - train.drives_on=advtrains.all_tracktypes - train.max_speed=100 - local rel_pos=0 - local count_l=0 - for i, w_id in ipairs(train.trainparts) do - local wagon=nil - for _,iwagon in pairs(minetest.luaentities) do - if iwagon.is_wagon and iwagon.initialized and iwagon.unique_id==w_id then - if wagon then - --duplicate - iwagon.object:remove() - else - wagon=iwagon - end - end - end - if not wagon then - if advtrains.wagon_save[w_id] then - --spawn a new and initialize it with the properties from wagon_save - wagon=minetest.env:add_entity(train.last_pos, advtrains.wagon_save[w_id].entity_name):get_luaentity() - wagon:init_from_wagon_save(w_id) - end - end - if wagon then - rel_pos=rel_pos+wagon.wagon_span - wagon.train_id=train_id - wagon.pos_in_train=rel_pos - wagon.pos_in_trainparts=i - wagon.old_velocity_vector=nil - if wagon.is_locomotive then - count_l=count_l+1 - end - if invert_flipstate then - wagon.wagon_flipped = not wagon.wagon_flipped - end - rel_pos=rel_pos+wagon.wagon_span - any_loaded=true - - if wagon.drives_on then - for k,_ in pairs(train.drives_on) do - if not wagon.drives_on[k] then - train.drives_on[k]=nil - end - end - end - train.max_speed=math.min(train.max_speed, wagon.max_speed) - else - print(w_id.." not loaded and no save available") - --what the hell... - table.remove(train.trainparts, pit) - end - end - train.trainlen=rel_pos - train.locomotives_in_train=count_l -end - -function advtrains.split_train_at_wagon(wagon) - --get train - local train=advtrains.trains[wagon.train_id] - local real_pos_in_train=advtrains.get_real_path_index(train, wagon.pos_in_train) - local pos_for_new_train=advtrains.get_or_create_path(wagon.train_id, train)[math.floor(real_pos_in_train+wagon.wagon_span)] - local pos_for_new_train_prev=advtrains.get_or_create_path(wagon.train_id, train)[math.floor(real_pos_in_train-1+wagon.wagon_span)] - - --before doing anything, check if both are rails. else do not allow - if not pos_for_new_train then - print("split_train: pos_for_new_train not set") - return false - end - local node_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) - if not node_ok then - print("split_train: pos_for_new_train "..minetest.pos_to_string(advtrains.round_vector_floor_y(pos_for_new_train_prev)).." not loaded or is not a rail") - return false - end - - if not train.last_pos_prev then - print("split_train: pos_for_new_train_prev not set") - return false - end - - local prevnode_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) - if not prevnode_ok then - print("split_train: pos_for_new_train_prev "..minetest.pos_to_string(advtrains.round_vector_floor_y(pos_for_new_train_prev)).." not loaded or is not a rail") - return false - end - - --create subtrain - local newtrain_id=advtrains.create_new_train_at(pos_for_new_train, pos_for_new_train_prev) - local newtrain=advtrains.trains[newtrain_id] - --insert all wagons to new train - for k,v in ipairs(train.trainparts) do - if k>=wagon.pos_in_trainparts then - table.insert(newtrain.trainparts, v) - train.trainparts[k]=nil - end - end - --update train parts - advtrains.update_trainpart_properties(wagon.train_id)--atm it still is the desierd id. - advtrains.update_trainpart_properties(newtrain_id) - train.tarvelocity=0 - newtrain.velocity=train.velocity - newtrain.tarvelocity=0 -end - ---there are 4 cases: ---1/2. F<->R F<->R regular, put second train behind first ---->frontpos of first train will match backpos of second ---3. F<->R R<->F flip one of these trains, take the other as new train ---->backpos's will match ---4. R<->F F<->R flip one of these trains and take it as new parent ---->frontpos's will match - ---true when trains are facing each other. needed on colliding. --- check done by iterating paths and checking their direction ---returns nil when not on the same track at all OR when required path items are not generated. this distinction may not always be needed. -function advtrains.trains_facing(train1, train2) - local sr_pos=train1.path[math.floor(train1.index)] - local sr_pos_p=train1.path[math.floor(train1.index)-1] - - for i=advtrains.minN(train2.path), advtrains.maxN(train2.path) do - if vector.equals(sr_pos, train2.path[i]) then - if train2.path[i+1] and vector.equals(sr_pos_p, train2.path[i+1]) then return true end - if train2.path[i-1] and vector.equals(sr_pos_p, train2.path[i-1]) then return false end - return nil - end - end - return nil -end - -function advtrains.spawn_couple_on_collide(id1, pos, id2, t1_is_backpos) - print("COLLISION: "..sid(id1).." and "..sid(id2).." at "..minetest.pos_to_string(pos)..", t1_is_backpos="..(t1_is_backpos and "true" or "false")) - --TODO: - local train1=advtrains.trains[id1] - local train2=advtrains.trains[id2] - - local found - for i=advtrains.minN(train1.path), advtrains.maxN(train1.path) do - if vector.equals(train1.path[i], pos) then - found=true - end - end - if not found then - print("Err: pos not in path") - return - end - - local frontpos2=train2.path[math.floor(train2.detector_old_index)] - local backpos2=train2.path[math.floor(train2.detector_old_end_index)] - local t2_is_backpos - print("End positions: "..minetest.pos_to_string(frontpos2)..minetest.pos_to_string(backpos2)) - - if vector.equals(frontpos2, pos) then - t2_is_backpos=false - elseif vector.equals(backpos2, pos) then - t2_is_backpos=true - else - print("Err: not a endpos") - return --the collision position is not the end position. - end - print("t2_is_backpos="..(t2_is_backpos and "true" or "false")) - - local t1_has_couple - if t1_is_backpos then - t1_has_couple=train1.couple_eid_back - else - t1_has_couple=train1.couple_eid_front - end - local t2_has_couple - if t2_is_backpos then - t2_has_couple=train2.couple_eid_back - else - t2_has_couple=train2.couple_eid_front - end - - if t1_has_couple then - if minetest.object_refs[t1_has_couple] then minetest.object_refs[t1_has_couple]:remove() end - end - if t2_has_couple then - if minetest.object_refs[t2_has_couple] then minetest.object_refs[t2_has_couple]:remove() end - end - local obj=minetest.add_entity(pos, "advtrains:couple") - if not obj then print("failed creating object") return end - local le=obj:get_luaentity() - le.train_id_1=id1 - le.train_id_2=id2 - le.train1_is_backpos=t1_is_backpos - le.train2_is_backpos=t2_is_backpos - --find in object_refs - for aoi, compare in pairs(minetest.object_refs) do - if compare==obj then - if t1_is_backpos then - train1.couple_eid_back=aoi - else - train1.couple_eid_front=aoi - end - if t2_is_backpos then - train2.couple_eid_back=aoi - else - train2.couple_eid_front=aoi - end - end - end - print("Couple entity:"..dump(le)) - - --also TODO: integrate check_trainpartload into update_trainpart_properties. -end ---order of trains may be irrelevant in some cases. check opposite cases. TODO does this work? ---pos1 and pos2 are just needed to form a median. - - -function advtrains.do_connect_trains(first_id, second_id) - local first_wagoncnt=#advtrains.trains[first_id].trainparts - local second_wagoncnt=#advtrains.trains[second_id].trainparts - - for _,v in ipairs(advtrains.trains[second_id].trainparts) do - table.insert(advtrains.trains[first_id].trainparts, v) - end - --kick it like physics (with mass being #wagons) - local new_velocity=((advtrains.trains[first_id].velocity*first_wagoncnt)+(advtrains.trains[second_id].velocity*second_wagoncnt))/(first_wagoncnt+second_wagoncnt) - advtrains.trains[second_id]=nil - advtrains.update_trainpart_properties(first_id) - advtrains.trains[first_id].velocity=new_velocity - advtrains.trains[first_id].tarvelocity=0 -end - -function advtrains.invert_train(train_id) - local train=advtrains.trains[train_id] - - local old_path=advtrains.get_or_create_path(train_id, train) - train.path={} - train.index= - advtrains.get_train_end_index(train) - train.velocity=-train.velocity - train.tarvelocity=-train.tarvelocity - for k,v in pairs(old_path) do - train.path[-k]=v - end - local old_trainparts=train.trainparts - train.trainparts={} - for k,v in ipairs(old_trainparts) do - table.insert(train.trainparts, 1, v)--notice insertion at first place - end - advtrains.update_trainpart_properties(train_id, true) -end - -function advtrains.is_train_at_pos(pos) - --print("istrainat: pos "..minetest.pos_to_string(pos)) - local checked_trains={} - local objrefs=minetest.get_objects_inside_radius(pos, 2) - for _,v in pairs(objrefs) do - local le=v:get_luaentity() - if le and le.is_wagon and le.initialized and le.train_id and not checked_trains[le.train_id] then - --print("istrainat: checking "..le.train_id) - checked_trains[le.train_id]=true - local path=advtrains.get_or_create_path(le.train_id, le:train()) - if path then - --print("has path") - for i=math.floor(advtrains.get_train_end_index(le:train())+0.5),math.floor(le:train().index+0.5) do - if path[i] then - --print("has pathitem "..i.." "..minetest.pos_to_string(path[i])) - if vector.equals(advtrains.round_vector_floor_y(path[i]), pos) then - return true - end - end - end - end - end - end - return false -end -function advtrains.invalidate_all_paths() - --print("invalidating all paths") - for k,v in pairs(advtrains.trains) do - if v.index then - v.restore_add_index=v.index-math.floor(v.index+0.5) - end - v.path=nil - v.path_dist=nil - v.index=nil - v.min_index_on_track=nil - v.max_index_on_track=nil - - advtrains.detector.setup_restore() - v.detector_old_index=nil - v.detector_old_end_index=nil - end -end - ---not blocking trains group -function advtrains.train_collides(node) - if node and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].walkable then - if not minetest.registered_nodes[node.name].groups.not_blocking_trains then - return true - end - end - return false -end - -local nonblocknodes={ - "default:fence_wood", - "default:fence_acacia_wood", - "default:fence_aspen_wood", - "default:fence_pine_wood", - "default:fence_junglewood", - "default:torch", - - "default:sign_wall", - "signs:sign_wall", - "signs:sign_wall_blue", - "signs:sign_wall_brown", - "signs:sign_wall_orange", - "signs:sign_wall_green", - "signs:sign_yard", - "signs:sign_wall_white_black", - "signs:sign_wall_red", - "signs:sign_wall_white_red", - "signs:sign_wall_yellow", - "signs:sign_post", - "signs:sign_hanging", - - -} -minetest.after(0, function() - for _,name in ipairs(nonblocknodes) do - if minetest.registered_nodes[name] then - minetest.registered_nodes[name].groups.not_blocking_trains=1 - end - end -end) diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua deleted file mode 100644 index 495f914..0000000 --- a/advtrains/wagons.lua +++ /dev/null @@ -1,573 +0,0 @@ ---atan2 counts angles clockwise, minetest does counterclockwise ---local print=function(t) minetest.log("action", t) minetest.chat_send_all(t) end -local print=function() end - -local wagon={ - collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, - --physical = true, - visual = "mesh", - mesh = "wagon.b3d", - visual_size = {x=3, y=3}, - textures = {"black.png"}, - is_wagon=true, - wagon_span=1,--how many index units of space does this wagon consume - has_inventory=false, -} - - - -function wagon:on_rightclick(clicker) - if not self:ensure_init() then return end - if not clicker or not clicker:is_player() then - return - end - if clicker:get_player_control().aux1 then - --advtrains.dumppath(self:train().path) - --minetest.chat_send_all("at index "..(self:train().index or "nil")) - --advtrains.invert_train(self.train_id) - minetest.chat_send_all(dump(self:train())) - return - end - local no=self:get_seatno(clicker:get_player_name()) - if no then - self:get_off(no) - else - self:show_get_on_form(clicker:get_player_name()) - end -end - -function wagon:train() - return advtrains.trains[self.train_id] -end - ---[[about 'initalized': - when initialized is false, the entity hasn't got any data yet and should wait for these to be set before doing anything - when loading an existing object (with staticdata), it will be set - when instanciating a new object via add_entity, it is not set at the time on_activate is called. - then, wagon:initialize() will be called - - wagon will save only uid in staticdata, no serialized table -]] -function wagon:on_activate(sd_uid, dtime_s) - print("[advtrains][wagon "..((sd_uid and sd_uid~="" and sd_uid) or "no-id").."] activated") - self.object:set_armor_groups({immortal=1}) - if sd_uid and sd_uid~="" then - --legacy - --expect this to be a serialized table and handle - if minetest.deserialize(sd_uid) then - self:init_from_wagon_save(minetest.deserialize(sd_uid).unique_id) - else - self:init_from_wagon_save(sd_uid) - end - end - self.entity_name=self.name - - --duplicates? - for ao_id,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.unique_id==self.unique_id and wagon~=self then--i am a duplicate! - print("[advtrains][wagon "..((sd_uid and sd_uid~="" and sd_uid) or "no-id").."] duplicate found(ao_id:"..ao_id.."), removing") - self.object:remove() - minetest.after(0.5, function() advtrains.update_trainpart_properties(self.train_id) end) - return - end - end - - if self.custom_on_activate then - self:custom_on_activate(dtime_s) - end -end - -function wagon:get_staticdata() - if not self:ensure_init() then return end - print("[advtrains][wagon "..((self.unique_id and self.unique_id~="" and self.unique_id) or "no-id").."]: saving to wagon_save") - --serialize inventory, if it has one - if self.has_inventory then - local inv=minetest.get_inventory({type="detached", name="advtrains_wgn_"..self.unique_id}) - self.ser_inv=advtrains.serialize_inventory(inv) - end - --save to table before being unloaded - advtrains.wagon_save[self.unique_id]=advtrains.merge_tables(self) - advtrains.wagon_save[self.unique_id].entity_name=self.name - advtrains.wagon_save[self.unique_id].name=nil - advtrains.wagon_save[self.unique_id].object=nil - return self.unique_id -end ---returns: uid of wagon -function wagon:init_new_instance(train_id, properties) - self.unique_id=os.time()..os.clock() - self.train_id=train_id - for k,v in pairs(properties) do - if k~="name" and k~="object" then - self[k]=v - end - end - self:init_shared() - self.initialized=true - print("init_new_instance "..self.unique_id.." ("..self.train_id..")") - return self.unique_id -end -function wagon:init_from_wagon_save(uid) - if not advtrains.wagon_save[uid] then - self.object:remove() - return - end - self.unique_id=uid - for k,v in pairs(advtrains.wagon_save[uid]) do - if k~="name" and k~="object" then - self[k]=v - end - end - if not self.train_id or not self:train() then - self.object:remove() - return - end - self:init_shared() - self.initialized=true - minetest.after(1, function() self:reattach_all() end) - print("init_from_wagon_save "..self.unique_id.." ("..self.train_id..")") - advtrains.update_trainpart_properties(self.train_id) -end -function wagon:init_shared() - if self.has_inventory then - local uid_noptr=self.unique_id.."" - --to be used later - local inv=minetest.create_detached_inventory("advtrains_wgn_"..self.unique_id, { - allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) - return count - end, - allow_put = function(inv, listname, index, stack, player) - return stack:get_count() - end, - allow_take = function(inv, listname, index, stack, player) - return stack:get_count() - end - }) - if self.ser_inv then - advtrains.deserialize_inventory(self.ser_inv, inv) - end - if self.inventory_list_sizes then - for lst, siz in pairs(self.inventory_list_sizes) do - inv:set_size(lst, siz) - end - end - end -end -function wagon:ensure_init() - if self.initialized then return true end - self.object:setvelocity({x=0,y=0,z=0}) - return false -end - --- Remove the wagon -function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) - if not self:ensure_init() then return end - if not puncher or not puncher:is_player() then - return - end - if self.owner and puncher:get_player_name()~=self.owner then - minetest.chat_send_player(puncher:get_player_name(), "This wagon is owned by "..self.owner..", you can't destroy it.") - return - end - - if minetest.setting_getbool("creative_mode") then - if not self:destroy() then return end - - local inv = puncher:get_inventory() - if not inv:contains_item("main", self.name) then - inv:add_item("main", self.name) - end - else - local pc=puncher:get_player_control() - if not pc.sneak then - minetest.chat_send_player(puncher:get_player_name(), "Warning: If you destroy this wagon, you only get some steel back! If you are sure, shift-leftclick the wagon.") - return - end - - if not self:destroy() then return end - - local inv = puncher:get_inventory() - for _,item in ipairs(self.drops or {self.name}) do - inv:add_item("main", item) - end - end -end -function wagon:destroy() - --some rules: - -- you get only some items back - -- single left-click shows warning - -- shift leftclick destroys - -- not when a driver is inside - - for _,_ in pairs(self.seatp) do - return - end - - if self.custom_may_destroy then - if not self.custom_may_destroy(self, puncher, time_from_last_punch, tool_capabilities, direction) then - return - end - end - if self.custom_on_destroy then - self.custom_on_destroy(self, puncher, time_from_last_punch, tool_capabilities, direction) - end - - print("[advtrains][wagon "..((self.unique_id and self.unique_id~="" and self.unique_id) or "no-id").."]: destroying") - - self.object:remove() - - table.remove(self:train().trainparts, self.pos_in_trainparts) - advtrains.update_trainpart_properties(self.train_id) - advtrains.wagon_save[self.unique_id]=nil - if self.discouple then self.discouple.object:remove() end--will have no effect on unloaded objects - return true -end - - -function wagon:on_step(dtime) - if not self:ensure_init() then return end - - local t=os.clock() - local pos = self.object:getpos() - - if not pos then - print("["..self.unique_id.."][fatal] missing position (object:getpos() returned nil)") - return - end - - self.entity_name=self.name - - --is my train still here - if not self.train_id or not self:train() then - print("[advtrains][wagon "..self.unique_id.."] missing train_id, destroying") - self.object:remove() - return - elseif not self.initialized then - self.initialized=true - end - if not self.seatp then - self.seatp={} - end - - --custom on_step function - if self.custom_on_step then - self:custom_on_step(self, dtime) - end - - --driver control - for seatno, seat in ipairs(self.seats) do - if seat.driving_ctrl_access then - local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) - local get_off_pressed=false - if driver and driver:get_player_control_bits()~=self.old_player_control_bits then - local pc=driver:get_player_control() - - advtrains.on_control_change(pc, self:train(), self.wagon_flipped) - if pc.aux1 and pc.sneak then - get_off_pressed=true - end - - self.old_player_control_bits=driver:get_player_control_bits() - end - if driver then - if get_off_pressed then - self:get_off(seatno) - else - advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped) - end - end - end - end - - local gp=self:train() - - --DisCouple - if self.pos_in_trainparts and self.pos_in_trainparts>1 then - if gp.velocity==0 then - if not self.discouple or not self.discouple.object:getyaw() then - local object=minetest.add_entity(pos, "advtrains:discouple") - if object then - local le=object:get_luaentity() - le.wagon=self - --box is hidden when attached, so unuseful. - --object:set_attach(self.object, "", {x=0, y=0, z=self.wagon_span*10}, {x=0, y=0, z=0}) - self.discouple=le - else - print("Couldn't spawn DisCouple") - end - end - else - if self.discouple and self.discouple.object:getyaw() then - self.discouple.object:remove() - end - end - end - --for path to be available. if not, skip step - if not advtrains.get_or_create_path(self.train_id, gp) then - self.object:setvelocity({x=0, y=0, z=0}) - return - end - if not self.pos_in_train then - --why ever. but better continue next step... - advtrains.update_trainpart_properties(self.train_id) - return - end - - local index=advtrains.get_real_path_index(self:train(), self.pos_in_train) - --print("trainindex "..gp.index.." wagonindex "..index) - - --position recalculation - local first_pos=gp.path[math.floor(index)] - local second_pos=gp.path[math.floor(index)+1] - if not first_pos or not second_pos then - --print("[advtrains] object "..self.unique_id.." path end reached!") - self.object:setvelocity({x=0,y=0,z=0}) - return - end - - --checking for environment collisions(a 3x3 cube around the center) - if not gp.recently_collided_with_env then - local collides=false - for x=-1,1 do - for y=0,2 do - for z=-1,1 do - local node=minetest.get_node_or_nil(vector.add(first_pos, {x=x, y=y, z=z})) - if (advtrains.train_collides(node)) then - collides=true - end - end - end - end - if collides then - gp.recently_collided_with_env=true - gp.velocity=-0.5*gp.velocity - gp.tarvelocity=0 - end - end - - --FIX: use index of the wagon, not of the train. - local velocity=(gp.velocity*gp.movedir)/(gp.path_dist[math.floor(index)] or 1) - local acceleration=(gp.last_accel or 0)/(gp.path_dist[math.floor(index)] or 1) - local factor=index-math.floor(index) - local actual_pos={x=first_pos.x-(first_pos.x-second_pos.x)*factor, y=first_pos.y-(first_pos.y-second_pos.y)*factor, z=first_pos.z-(first_pos.z-second_pos.z)*factor,} - local velocityvec={x=(first_pos.x-second_pos.x)*velocity*-1, z=(first_pos.z-second_pos.z)*velocity*-1, y=(first_pos.y-second_pos.y)*velocity*-1} - local accelerationvec={x=(first_pos.x-second_pos.x)*acceleration*-1, z=(first_pos.z-second_pos.z)*acceleration*-1, y=(first_pos.y-second_pos.y)*acceleration*-1} - - --some additional positions to determine orientation - local aposfwd=gp.path[math.floor(index+2)] - local aposbwd=gp.path[math.floor(index-1)] - - local yaw - if aposfwd and aposbwd then - yaw=advtrains.get_wagon_yaw(aposfwd, second_pos, first_pos, aposbwd, factor)+math.pi--TODO remove when cleaning up - else - yaw=math.atan2((first_pos.x-second_pos.x), (second_pos.z-first_pos.z)) - end - if self.wagon_flipped then - yaw=yaw+math.pi - end - - self.updatepct_timer=(self.updatepct_timer or 0)-dtime - if not self.old_velocity_vector - or not vector.equals(velocityvec, self.old_velocity_vector) - or not self.old_acceleration_vector - or not vector.equals(accelerationvec, self.old_acceleration_vector) - or self.old_yaw~=yaw - or self.updatepct_timer<=0 then--only send update packet if something changed - self.object:setpos(actual_pos) - self.object:setvelocity(velocityvec) - self.object:setacceleration(accelerationvec) - self.object:setyaw(yaw) - self.updatepct_timer=2 - if self.update_animation then - self:update_animation(gp.velocity) - end - end - - - self.old_velocity_vector=velocityvec - self.old_acceleration_vector=accelerationvec - self.old_yaw=yaw - printbm("wagon step", t) -end - -function advtrains.get_real_path_index(train, pit) - local pos_in_train_left=pit - local index=train.index - if pos_in_train_left>(index-math.floor(index))*(train.path_dist[math.floor(index)] or 1) then - pos_in_train_left=pos_in_train_left - (index-math.floor(index))*(train.path_dist[math.floor(index)] or 1) - index=math.floor(index) - while pos_in_train_left>(train.path_dist[index-1] or 1) do - pos_in_train_left=pos_in_train_left - (train.path_dist[index-1] or 1) - index=index-1 - end - index=index-(pos_in_train_left/(train.path_dist[index-1] or 1)) - else - index=index-(pos_in_train_left/(train.path_dist[math.floor(index-1)] or 1)) - end - return index -end - -function wagon:get_on(clicker, seatno) - if not self.seatp then - self.seatp={} - end - if not self.seats[seatno] then return end - if self.seatp[seatno] and self.seatp[seatno]~=clicker:get_player_name() then - self:get_off(seatno) - end - self.seatp[seatno] = clicker:get_player_name() - advtrains.player_to_train_mapping[clicker:get_player_name()]=self.train_id - clicker:set_attach(self.object, "", self.seats[seatno].attach_offset, {x=0,y=0,z=0}) - clicker:set_eye_offset(self.seats[seatno].view_offset, self.seats[seatno].view_offset) -end -function wagon:get_off_plr(pname) - local no=self:get_seatno(pname) - if no then - self:get_off(no) - end -end -function wagon:get_seatno(pname) - for no, cont in pairs(self.seatp) do - if cont==pname then - return no - end - end - return nil -end -function wagon:get_off(seatno) - if not self.seatp[seatno] then return end - local pname = self.seatp[seatno] - local clicker = minetest.get_player_by_name(pname) - advtrains.player_to_train_mapping[pname]=nil - advtrains.clear_driver_hud(pname) - if clicker then - clicker:set_detach() - clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) - local objpos=advtrains.round_vector_floor_y(self.object:getpos()) - local yaw=self.object:getyaw() - local isx=(yaw < math.pi/4) or (yaw > 3*math.pi/4 and yaw < 5*math.pi/4) or (yaw > 7*math.pi/4) - --abuse helper function - for _,r in ipairs({-1, 1}) do - local p=vector.add({x=isx and r or 0, y=0, z=not isx and r or 0}, objpos) - if minetest.get_item_group(minetest.get_node(p).name, "platform")>0 then - minetest.after(0.2, function() clicker:setpos({x=p.x, y=p.y+1, z=p.z}) end) - end - end - end - self.seatp[seatno]=nil -end -function wagon:show_get_on_form(pname) - if not self.initialized then return end - if #self.seats==0 then - if self.has_inventory and self.get_inventory_formspec then - minetest.show_formspec(pname, "advtrains_inv_"..self.unique_id, self:get_inventory_formspec(pname)) - end - return - end - local form, comma="size[5,8]label[0.5,0.5;Select seat:]textlist[0.5,1;4,6;seat;", "" - for seatno, seattbl in ipairs(self.seats) do - local addtext, colorcode="", "" - if self.seatp and self.seatp[seatno] then - colorcode="#FF0000" - addtext=" ("..self.seatp[seatno]..")" - end - form=form..comma..colorcode..seattbl.name..addtext - comma="," - end - form=form..";0,false]" - if self.has_inventory and self.get_inventory_formspec then - form=form.."button_exit[1,7;3,1;inv;Show Inventory]" - end - minetest.show_formspec(pname, "advtrains_geton_"..self.unique_id, form) -end -minetest.register_on_player_receive_fields(function(player, formname, fields) - local uid=string.match(formname, "^advtrains_geton_(.+)$") - if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then - if fields.inv then - if wagon.has_inventory and wagon.get_inventory_formspec then - minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..uid, wagon:get_inventory_formspec(player:get_player_name())) - end - elseif fields.seat then - local val=minetest.explode_textlist_event(fields.seat) - if val and val.type~="INV" and not wagon.seatp[player:get_player_name()] then - --get on - wagon:get_on(player, val.index) - --will work with the new close_formspec functionality. close exactly this formspec. - minetest.show_formspec(player:get_player_name(), formname, "") - end - end - end - end - end -end) -function wagon:reattach_all() - if not self.seatp then self.seatp={} end - for seatno, pname in pairs(self.seatp) do - local p=minetest.get_player_by_name(pname) - if p then - self:get_on(p ,seatno) - end - end -end -minetest.register_on_joinplayer(function(player) - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized then - wagon:reattach_all() - end - end -end) - -function advtrains.register_wagon(sysname, prototype, desc, inv_img) - setmetatable(prototype, {__index=wagon}) - minetest.register_entity(":advtrains:"..sysname,prototype) - - minetest.register_craftitem(":advtrains:"..sysname, { - description = desc, - inventory_image = inv_img, - wield_image = inv_img, - stack_max = 1, - - on_place = function(itemstack, placer, pointed_thing) - if not pointed_thing.type == "node" then - return - end - - local node=minetest.env:get_node_or_nil(pointed_thing.under) - if not node then print("[advtrains]Ignore at placer position") return itemstack end - local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, prototype.drives_on)) then - print("[advtrains]no track here, not placing.") - return itemstack - end - local conn1=advtrains.get_track_connections(node.name, node.param2) - local id=advtrains.create_new_train_at(pointed_thing.under, advtrains.dirCoordSet(pointed_thing.under, conn1)) - - local ob=minetest.env:add_entity(pointed_thing.under, "advtrains:"..sysname) - if not ob then - print("[advtrains]couldn't add_entity, aborting") - end - local le=ob:get_luaentity() - - le.owner=placer:get_player_name() - le.infotext=desc..", owned by "..placer:get_player_name() - - local wagon_uid=le:init_new_instance(id, {}) - - advtrains.add_wagon_to_train(le, id) - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - return itemstack - - end, - }) -end - ---[[ - wagons can define update_animation(self, velocity) if they have a speed-dependent animation - this function will be called when the velocity vector changes or every 2 seconds. -]] - - diff --git a/advtrains_train_industrial/depends.txt b/advtrains_train_industrial/depends.txt deleted file mode 100644 index 6f00bf6..0000000 --- a/advtrains_train_industrial/depends.txt +++ /dev/null @@ -1 +0,0 @@ -advtrains \ No newline at end of file diff --git a/advtrains_train_industrial/init.lua b/advtrains_train_industrial/init.lua deleted file mode 100644 index 379832c..0000000 --- a/advtrains_train_industrial/init.lua +++ /dev/null @@ -1,67 +0,0 @@ -advtrains.register_wagon("engine_industrial", { - mesh="advtrains_engine_industrial.b3d", - textures = {"advtrains_engine_industrial.png"}, - drives_on={default=true}, - max_speed=20, - seats = { - { - name="Driver Stand (left)", - attach_offset={x=-5, y=10, z=-10}, - view_offset={x=0, y=10, z=0}, - driving_ctrl_access=true, - }, - { - name="Driver Stand (right)", - attach_offset={x=5, y=10, z=-10}, - view_offset={x=0, y=10, z=0}, - driving_ctrl_access=true, - }, - }, - 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"}, -}, "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 = function(self) - return "size[8,11]".. - "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. - "list[current_player;main;0,7;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*6, - }, -}, "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 = function(self) - return "size[8,11]".. - "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. - "list[current_player;main;0,7;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*6, - }, -}, "Industrial wood wagon", "advtrains_wagon_wood_inv.png") diff --git a/advtrains_train_industrial/models/advtrains_engine_industrial.b3d b/advtrains_train_industrial/models/advtrains_engine_industrial.b3d deleted file mode 100644 index f1ea485..0000000 Binary files a/advtrains_train_industrial/models/advtrains_engine_industrial.b3d and /dev/null differ diff --git a/advtrains_train_industrial/models/advtrains_wagon_tank.b3d b/advtrains_train_industrial/models/advtrains_wagon_tank.b3d deleted file mode 100644 index af2604b..0000000 Binary files a/advtrains_train_industrial/models/advtrains_wagon_tank.b3d and /dev/null differ diff --git a/advtrains_train_industrial/models/advtrains_wagon_wood.b3d b/advtrains_train_industrial/models/advtrains_wagon_wood.b3d deleted file mode 100644 index 0e7fb4b..0000000 Binary files a/advtrains_train_industrial/models/advtrains_wagon_wood.b3d and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_engine_industrial.png b/advtrains_train_industrial/textures/advtrains_engine_industrial.png deleted file mode 100644 index 38a872f..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_engine_industrial.png and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png b/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png deleted file mode 100644 index be4e80f..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_wagon_tank.png b/advtrains_train_industrial/textures/advtrains_wagon_tank.png deleted file mode 100644 index 79b1316..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_wagon_tank.png and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png b/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png deleted file mode 100644 index 03401be..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_wagon_wood.png b/advtrains_train_industrial/textures/advtrains_wagon_wood.png deleted file mode 100644 index acc6f72..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_wagon_wood.png and /dev/null differ diff --git a/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png b/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png deleted file mode 100644 index 87109dd..0000000 Binary files a/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png and /dev/null differ diff --git a/advtrains_train_japan/depends.txt b/advtrains_train_japan/depends.txt deleted file mode 100644 index 6f00bf6..0000000 --- a/advtrains_train_japan/depends.txt +++ /dev/null @@ -1 +0,0 @@ -advtrains \ No newline at end of file diff --git a/advtrains_train_japan/init.lua b/advtrains_train_japan/init.lua deleted file mode 100644 index 47f50cf..0000000 --- a/advtrains_train_japan/init.lua +++ /dev/null @@ -1,38 +0,0 @@ -advtrains.register_wagon("engine_japan", { - mesh="advtrains_engine_japan.b3d", - textures = {"advtrains_engine_japan.png"}, - drives_on={default=true}, - max_speed=20, - seats = { - { - name="Default Seat (driver stand)", - attach_offset={x=0, y=10, z=0}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - }, - }, - 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"}, -}, "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="Default Seat", - attach_offset={x=0, y=10, z=0}, - view_offset={x=0, y=6, z=0}, - }, - }, - 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"}, -}, "Japanese Train Wagon", "advtrains_wagon_japan_inv.png") - diff --git a/advtrains_train_japan/models/advtrains_engine_japan.b3d b/advtrains_train_japan/models/advtrains_engine_japan.b3d deleted file mode 100644 index f82c33e..0000000 Binary files a/advtrains_train_japan/models/advtrains_engine_japan.b3d and /dev/null differ diff --git a/advtrains_train_japan/models/advtrains_wagon_japan.b3d b/advtrains_train_japan/models/advtrains_wagon_japan.b3d deleted file mode 100644 index 7970438..0000000 Binary files a/advtrains_train_japan/models/advtrains_wagon_japan.b3d and /dev/null differ diff --git a/advtrains_train_japan/textures/advtrains_engine_japan.png b/advtrains_train_japan/textures/advtrains_engine_japan.png deleted file mode 100644 index b286b38..0000000 Binary files a/advtrains_train_japan/textures/advtrains_engine_japan.png and /dev/null differ diff --git a/advtrains_train_japan/textures/advtrains_engine_japan_inv.png b/advtrains_train_japan/textures/advtrains_engine_japan_inv.png deleted file mode 100644 index 6af0636..0000000 Binary files a/advtrains_train_japan/textures/advtrains_engine_japan_inv.png and /dev/null differ diff --git a/advtrains_train_japan/textures/advtrains_wagon_japan.png b/advtrains_train_japan/textures/advtrains_wagon_japan.png deleted file mode 100644 index bee565e..0000000 Binary files a/advtrains_train_japan/textures/advtrains_wagon_japan.png and /dev/null differ diff --git a/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png b/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png deleted file mode 100644 index 3e6357c..0000000 Binary files a/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png and /dev/null differ diff --git a/advtrains_train_steam/depends.txt b/advtrains_train_steam/depends.txt deleted file mode 100644 index 6f00bf6..0000000 --- a/advtrains_train_steam/depends.txt +++ /dev/null @@ -1 +0,0 @@ -advtrains \ No newline at end of file diff --git a/advtrains_train_steam/init.lua b/advtrains_train_steam/init.lua deleted file mode 100644 index ca52516..0000000 --- a/advtrains_train_steam/init.lua +++ /dev/null @@ -1,121 +0,0 @@ -advtrains.register_wagon("newlocomotive", { - mesh="advtrains_engine_steam.b3d", - textures = {"advtrains_newlocomotive.png"}, - is_locomotive=true, - drives_on={default=true}, - max_speed=10, - seats = { - { - name="Driver Stand (left)", - attach_offset={x=-5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - }, - { - name="Driver Stand (right)", - attach_offset={x=5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - }, - }, - visual_size = {x=1, y=1}, - wagon_span=1.85, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - --update_animation=function(self, velocity) - --if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - -- self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) - --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 4"}, -}, "Steam Engine", "advtrains_newlocomotive_inv.png") -advtrains.register_wagon("wagon_default", { - mesh="advtrains_wagon.b3d", - textures = {"advtrains_wagon.png"}, - drives_on={default=true}, - max_speed=10, - seats = { - { - name="Default Seat", - attach_offset={x=0, y=10, z=0}, - view_offset={x=0, y=6, z=0}, - }, - }, - 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"}, -}, "Passenger Wagon", "advtrains_wagon_inv.png") -advtrains.register_wagon("wagon_box", { - mesh="advtrains_wagon.b3d", - textures = {"advtrains_wagon_box.png"}, - drives_on={default=true}, - max_speed=10, - seats = {}, - 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 = function(self) - return "size[8,11]".. - "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,6;]".. - "list[current_player;main;0,7;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*6, - }, -}, "Box Wagon", "advtrains_wagon_box_inv.png") - -minetest.register_craft({ - output = 'advtrains:newlocomotive', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:steelblock', 'dye:black', 'default:steelblock'}, - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - }, -}) -minetest.register_craft({ - output = 'advtrains:wagon_default', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:steelblock', 'dye:dark_green', 'default:steelblock'}, - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - }, -}) -minetest.register_craft({ - output = 'advtrains:wagon_box', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:steelblock', 'default:chest', 'default:steelblock'}, - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - }, -}) diff --git a/advtrains_train_steam/models/advtrains_engine_steam.b3d b/advtrains_train_steam/models/advtrains_engine_steam.b3d deleted file mode 100644 index 36bdd15..0000000 Binary files a/advtrains_train_steam/models/advtrains_engine_steam.b3d and /dev/null differ diff --git a/advtrains_train_steam/models/advtrains_wagon.b3d b/advtrains_train_steam/models/advtrains_wagon.b3d deleted file mode 100644 index 5c8214c..0000000 Binary files a/advtrains_train_steam/models/advtrains_wagon.b3d and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_newlocomotive.png b/advtrains_train_steam/textures/advtrains_newlocomotive.png deleted file mode 100644 index e461bc7..0000000 Binary files a/advtrains_train_steam/textures/advtrains_newlocomotive.png and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png b/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png deleted file mode 100644 index 8d3fafb..0000000 Binary files a/advtrains_train_steam/textures/advtrains_newlocomotive_inv.png and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_wagon.png b/advtrains_train_steam/textures/advtrains_wagon.png deleted file mode 100644 index c37c979..0000000 Binary files a/advtrains_train_steam/textures/advtrains_wagon.png and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_wagon_box.png b/advtrains_train_steam/textures/advtrains_wagon_box.png deleted file mode 100644 index 8bfbe06..0000000 Binary files a/advtrains_train_steam/textures/advtrains_wagon_box.png and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_wagon_box_inv.png b/advtrains_train_steam/textures/advtrains_wagon_box_inv.png deleted file mode 100644 index 480f245..0000000 Binary files a/advtrains_train_steam/textures/advtrains_wagon_box_inv.png and /dev/null differ diff --git a/advtrains_train_steam/textures/advtrains_wagon_inv.png b/advtrains_train_steam/textures/advtrains_wagon_inv.png deleted file mode 100644 index 0b72ac3..0000000 Binary files a/advtrains_train_steam/textures/advtrains_wagon_inv.png and /dev/null differ diff --git a/advtrains_train_subway/depends.txt b/advtrains_train_subway/depends.txt deleted file mode 100644 index 6f00bf6..0000000 --- a/advtrains_train_subway/depends.txt +++ /dev/null @@ -1 +0,0 @@ -advtrains \ No newline at end of file diff --git a/advtrains_train_subway/init.lua b/advtrains_train_subway/init.lua deleted file mode 100644 index b5bdb18..0000000 --- a/advtrains_train_subway/init.lua +++ /dev/null @@ -1,30 +0,0 @@ - -advtrains.register_wagon("subway_wagon", { - mesh="advtrains_subway_train.b3d", - textures = {"advtrains_subway_train.png"}, - drives_on={default=true}, - max_speed=15, - seats = { - { - name="Default Seat (driver stand)", - attach_offset={x=0, y=10, z=0}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - }, - }, - visual_size = {x=1, y=1}, - wagon_span=1.8, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - is_locomotive=true, - drops={"default:steelblock 4"}, -}, "Subway Passenger Wagon", "advtrains_subway_train_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'}, - }, -}) diff --git a/advtrains_train_subway/models/advtrains_subway_train.b3d b/advtrains_train_subway/models/advtrains_subway_train.b3d deleted file mode 100644 index a824d33..0000000 Binary files a/advtrains_train_subway/models/advtrains_subway_train.b3d and /dev/null differ diff --git a/advtrains_train_subway/textures/advtrains_subway_train.png b/advtrains_train_subway/textures/advtrains_subway_train.png deleted file mode 100644 index 1d569f3..0000000 Binary files a/advtrains_train_subway/textures/advtrains_subway_train.png and /dev/null differ diff --git a/advtrains_train_subway/textures/advtrains_subway_train_inv.png b/advtrains_train_subway/textures/advtrains_subway_train_inv.png deleted file mode 100644 index 1d0e809..0000000 Binary files a/advtrains_train_subway/textures/advtrains_subway_train_inv.png and /dev/null differ diff --git a/assets/advtrains_newlocomotive.xcf b/assets/advtrains_newlocomotive.xcf new file mode 100644 index 0000000..9ad5187 Binary files /dev/null and b/assets/advtrains_newlocomotive.xcf differ diff --git a/assets/blender/engine-with-animation.blend b/assets/blender/engine-with-animation.blend new file mode 100644 index 0000000..2649587 Binary files /dev/null and b/assets/blender/engine-with-animation.blend differ diff --git a/assets/blender/gleis/detectorpart.png b/assets/blender/gleis/detectorpart.png new file mode 100644 index 0000000..fc24181 Binary files /dev/null and b/assets/blender/gleis/detectorpart.png differ diff --git a/assets/blender/gleis/infos/Grafik_weiche.png b/assets/blender/gleis/infos/Grafik_weiche.png new file mode 100644 index 0000000..6674eb3 Binary files /dev/null and b/assets/blender/gleis/infos/Grafik_weiche.png differ diff --git a/assets/blender/gleis/infos/breite b/assets/blender/gleis/infos/breite new file mode 100644 index 0000000..b2862c6 --- /dev/null +++ b/assets/blender/gleis/infos/breite @@ -0,0 +1 @@ +1435mm diff --git a/assets/blender/gleis/licence.txt~ b/assets/blender/gleis/licence.txt~ new file mode 100644 index 0000000..e69de29 diff --git a/assets/blender/gleis/rail_my.blend b/assets/blender/gleis/rail_my.blend new file mode 100644 index 0000000..3c741bc Binary files /dev/null and b/assets/blender/gleis/rail_my.blend differ diff --git a/assets/blender/gleis/rail_my.blend1 b/assets/blender/gleis/rail_my.blend1 new file mode 100644 index 0000000..6322856 Binary files /dev/null and b/assets/blender/gleis/rail_my.blend1 differ diff --git a/assets/blender/gleis/rail_my_rt.blend b/assets/blender/gleis/rail_my_rt.blend new file mode 100644 index 0000000..8372a0c Binary files /dev/null and b/assets/blender/gleis/rail_my_rt.blend differ diff --git a/assets/blender/gleis/rail_my_rt.blend1 b/assets/blender/gleis/rail_my_rt.blend1 new file mode 100644 index 0000000..7d0978e Binary files /dev/null and b/assets/blender/gleis/rail_my_rt.blend1 differ diff --git a/assets/blender/gleis/rail_my_rt_final.blend b/assets/blender/gleis/rail_my_rt_final.blend new file mode 100644 index 0000000..d07a65d Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_final.blend differ diff --git a/assets/blender/gleis/rail_my_rt_final.blend1 b/assets/blender/gleis/rail_my_rt_final.blend1 new file mode 100644 index 0000000..8a2d213 Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_final.blend1 differ diff --git a/assets/blender/gleis/rail_my_rt_switches.blend b/assets/blender/gleis/rail_my_rt_switches.blend new file mode 100644 index 0000000..fdce427 Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_switches.blend differ diff --git a/assets/blender/gleis/rail_my_rt_switches.blend1 b/assets/blender/gleis/rail_my_rt_switches.blend1 new file mode 100644 index 0000000..04370ba Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_switches.blend1 differ diff --git a/assets/blender/gleis/rail_my_rt_switches2.blend b/assets/blender/gleis/rail_my_rt_switches2.blend new file mode 100644 index 0000000..9562e4d Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_switches2.blend differ diff --git a/assets/blender/gleis/rail_my_rt_switches2.blend1 b/assets/blender/gleis/rail_my_rt_switches2.blend1 new file mode 100644 index 0000000..07a155f Binary files /dev/null and b/assets/blender/gleis/rail_my_rt_switches2.blend1 differ diff --git a/assets/blender/gleis/rail_together.blend b/assets/blender/gleis/rail_together.blend new file mode 100644 index 0000000..cff51ea Binary files /dev/null and b/assets/blender/gleis/rail_together.blend differ diff --git a/assets/blender/gleis/rail_together.png b/assets/blender/gleis/rail_together.png new file mode 100644 index 0000000..386cd5c Binary files /dev/null and b/assets/blender/gleis/rail_together.png differ diff --git a/assets/blender/gleis/rail_together2.png b/assets/blender/gleis/rail_together2.png new file mode 100644 index 0000000..3effe34 Binary files /dev/null and b/assets/blender/gleis/rail_together2.png differ diff --git a/assets/blender/gleis/rail_together3.png b/assets/blender/gleis/rail_together3.png new file mode 100644 index 0000000..4a183c1 Binary files /dev/null and b/assets/blender/gleis/rail_together3.png differ diff --git a/assets/blender/gleis/rail_verticals.blend b/assets/blender/gleis/rail_verticals.blend new file mode 100644 index 0000000..45c37e1 Binary files /dev/null and b/assets/blender/gleis/rail_verticals.blend differ diff --git a/assets/blender/gleis/rail_verticals.blend1 b/assets/blender/gleis/rail_verticals.blend1 new file mode 100644 index 0000000..320f30b Binary files /dev/null and b/assets/blender/gleis/rail_verticals.blend1 differ diff --git a/assets/blender/gleis/rail_verticals3.blend b/assets/blender/gleis/rail_verticals3.blend new file mode 100644 index 0000000..5d62959 Binary files /dev/null and b/assets/blender/gleis/rail_verticals3.blend differ diff --git a/assets/blender/gleis/rail_verticals3.blend1 b/assets/blender/gleis/rail_verticals3.blend1 new file mode 100644 index 0000000..893f2ea Binary files /dev/null and b/assets/blender/gleis/rail_verticals3.blend1 differ diff --git a/assets/blender/gleis/rail_verticals45.blend b/assets/blender/gleis/rail_verticals45.blend new file mode 100644 index 0000000..a1589e3 Binary files /dev/null and b/assets/blender/gleis/rail_verticals45.blend differ diff --git a/assets/blender/gleis/rail_verticals45.blend1 b/assets/blender/gleis/rail_verticals45.blend1 new file mode 100644 index 0000000..6b44d1c Binary files /dev/null and b/assets/blender/gleis/rail_verticals45.blend1 differ diff --git a/assets/blender/gleis/rail_verticals45.blend11 b/assets/blender/gleis/rail_verticals45.blend11 new file mode 100644 index 0000000..48316e8 Binary files /dev/null and b/assets/blender/gleis/rail_verticals45.blend11 differ diff --git a/assets/blender/gleis/texturen/rail.png b/assets/blender/gleis/texturen/rail.png new file mode 100644 index 0000000..8478cf6 Binary files /dev/null and b/assets/blender/gleis/texturen/rail.png differ diff --git a/assets/blender/gleis/texturen/uv.png b/assets/blender/gleis/texturen/uv.png new file mode 100644 index 0000000..fb0af3e Binary files /dev/null and b/assets/blender/gleis/texturen/uv.png differ diff --git a/assets/blender/industrial/industry_loc.blend b/assets/blender/industrial/industry_loc.blend new file mode 100644 index 0000000..1a6cb2b Binary files /dev/null and b/assets/blender/industrial/industry_loc.blend differ diff --git a/assets/blender/industrial/industry_loc.blend1 b/assets/blender/industrial/industry_loc.blend1 new file mode 100644 index 0000000..af54c3f Binary files /dev/null and b/assets/blender/industrial/industry_loc.blend1 differ diff --git a/assets/blender/industrial/industry_loc.blend11 b/assets/blender/industrial/industry_loc.blend11 new file mode 100644 index 0000000..a089a65 Binary files /dev/null and b/assets/blender/industrial/industry_loc.blend11 differ diff --git a/assets/blender/industrial/industry_oil_ wagong.blend b/assets/blender/industrial/industry_oil_ wagong.blend new file mode 100644 index 0000000..30bde51 Binary files /dev/null and b/assets/blender/industrial/industry_oil_ wagong.blend differ diff --git a/assets/blender/industrial/industry_oil_ wagong.blend1 b/assets/blender/industrial/industry_oil_ wagong.blend1 new file mode 100644 index 0000000..849971d Binary files /dev/null and b/assets/blender/industrial/industry_oil_ wagong.blend1 differ diff --git a/assets/blender/industrial/industry_tree_wagong.blend b/assets/blender/industrial/industry_tree_wagong.blend new file mode 100644 index 0000000..23de208 Binary files /dev/null and b/assets/blender/industrial/industry_tree_wagong.blend differ diff --git a/assets/blender/industrial/industry_tree_wagong.blend1 b/assets/blender/industrial/industry_tree_wagong.blend1 new file mode 100644 index 0000000..bf2c9ed Binary files /dev/null and b/assets/blender/industrial/industry_tree_wagong.blend1 differ diff --git a/assets/blender/industrial/industry_tree_wagong.png b/assets/blender/industrial/industry_tree_wagong.png new file mode 100644 index 0000000..87109dd Binary files /dev/null and b/assets/blender/industrial/industry_tree_wagong.png differ diff --git a/assets/blender/locomotive.blend b/assets/blender/locomotive.blend new file mode 100644 index 0000000..8fd6059 Binary files /dev/null and b/assets/blender/locomotive.blend differ diff --git a/assets/blender/magnet_track.blend b/assets/blender/magnet_track.blend new file mode 100644 index 0000000..0ab14e7 Binary files /dev/null and b/assets/blender/magnet_track.blend differ diff --git a/assets/blender/mbb/advtrains_wagon_japan.xcf b/assets/blender/mbb/advtrains_wagon_japan.xcf new file mode 100644 index 0000000..4fc88c0 Binary files /dev/null and b/assets/blender/mbb/advtrains_wagon_japan.xcf differ diff --git a/assets/blender/mbb/modern_japanlocomotive.blend b/assets/blender/mbb/modern_japanlocomotive.blend new file mode 100644 index 0000000..6eb8f3d Binary files /dev/null and b/assets/blender/mbb/modern_japanlocomotive.blend differ diff --git a/assets/blender/mbb/modern_japanlocomotive.blend1 b/assets/blender/mbb/modern_japanlocomotive.blend1 new file mode 100644 index 0000000..a2e745d Binary files /dev/null and b/assets/blender/mbb/modern_japanlocomotive.blend1 differ diff --git a/assets/blender/mbb/modern_japanlocomotive.png b/assets/blender/mbb/modern_japanlocomotive.png new file mode 100644 index 0000000..b80d16f Binary files /dev/null and b/assets/blender/mbb/modern_japanlocomotive.png differ diff --git a/assets/blender/mbb/modern_japanlocomotive.xcf b/assets/blender/mbb/modern_japanlocomotive.xcf new file mode 100644 index 0000000..bb28534 Binary files /dev/null and b/assets/blender/mbb/modern_japanlocomotive.xcf differ diff --git a/assets/blender/mbb/modern_locomotive.blend b/assets/blender/mbb/modern_locomotive.blend new file mode 100644 index 0000000..8e72233 Binary files /dev/null and b/assets/blender/mbb/modern_locomotive.blend differ diff --git a/assets/blender/mbb/modern_wagong.blend b/assets/blender/mbb/modern_wagong.blend new file mode 100644 index 0000000..f32710a Binary files /dev/null and b/assets/blender/mbb/modern_wagong.blend differ diff --git a/assets/blender/mbb/modern_wagong.blend1 b/assets/blender/mbb/modern_wagong.blend1 new file mode 100644 index 0000000..376831c Binary files /dev/null and b/assets/blender/mbb/modern_wagong.blend1 differ diff --git a/assets/blender/mbb/modern_wagong_uv.blend b/assets/blender/mbb/modern_wagong_uv.blend new file mode 100644 index 0000000..4c10fb3 Binary files /dev/null and b/assets/blender/mbb/modern_wagong_uv.blend differ diff --git a/assets/blender/mbb/modern_wagong_uv.blend1 b/assets/blender/mbb/modern_wagong_uv.blend1 new file mode 100644 index 0000000..ce77416 Binary files /dev/null and b/assets/blender/mbb/modern_wagong_uv.blend1 differ diff --git a/assets/blender/mbb/modern_wagong_uv.png b/assets/blender/mbb/modern_wagong_uv.png new file mode 100644 index 0000000..68018ea Binary files /dev/null and b/assets/blender/mbb/modern_wagong_uv.png differ diff --git a/assets/blender/mbb/prellbock.blend b/assets/blender/mbb/prellbock.blend new file mode 100644 index 0000000..1c20ab2 Binary files /dev/null and b/assets/blender/mbb/prellbock.blend differ diff --git a/assets/blender/mbb/prellbock.blend1 b/assets/blender/mbb/prellbock.blend1 new file mode 100644 index 0000000..981538e Binary files /dev/null and b/assets/blender/mbb/prellbock.blend1 differ diff --git a/assets/blender/mbb/prellbock.uv.png b/assets/blender/mbb/prellbock.uv.png new file mode 100644 index 0000000..7730753 Binary files /dev/null and b/assets/blender/mbb/prellbock.uv.png differ diff --git a/assets/blender/mbb/regio-lokomotive.blend b/assets/blender/mbb/regio-lokomotive.blend new file mode 100644 index 0000000..210e60e Binary files /dev/null and b/assets/blender/mbb/regio-lokomotive.blend differ diff --git a/assets/blender/mbb/regio-waron.blend b/assets/blender/mbb/regio-waron.blend new file mode 100644 index 0000000..19b07ce Binary files /dev/null and b/assets/blender/mbb/regio-waron.blend differ diff --git a/assets/blender/mbb/retrosignal.blend b/assets/blender/mbb/retrosignal.blend new file mode 100644 index 0000000..b795215 Binary files /dev/null and b/assets/blender/mbb/retrosignal.blend differ diff --git a/assets/blender/mbb/retrosignal.blend1 b/assets/blender/mbb/retrosignal.blend1 new file mode 100644 index 0000000..94af470 Binary files /dev/null and b/assets/blender/mbb/retrosignal.blend1 differ diff --git a/assets/blender/mbb/signal(2)_hoch.blend b/assets/blender/mbb/signal(2)_hoch.blend new file mode 100644 index 0000000..70391f6 Binary files /dev/null and b/assets/blender/mbb/signal(2)_hoch.blend differ diff --git a/assets/blender/mbb/signal(2)_unten.blend b/assets/blender/mbb/signal(2)_unten.blend new file mode 100644 index 0000000..4e917bc Binary files /dev/null and b/assets/blender/mbb/signal(2)_unten.blend differ diff --git a/assets/blender/mbb/signal.blend b/assets/blender/mbb/signal.blend new file mode 100644 index 0000000..135c7b4 Binary files /dev/null and b/assets/blender/mbb/signal.blend differ diff --git a/assets/blender/mbb/signal.blend1 b/assets/blender/mbb/signal.blend1 new file mode 100644 index 0000000..63a8c99 Binary files /dev/null and b/assets/blender/mbb/signal.blend1 differ diff --git a/assets/blender/mbb/signal.png b/assets/blender/mbb/signal.png new file mode 100644 index 0000000..779cdda Binary files /dev/null and b/assets/blender/mbb/signal.png differ diff --git a/assets/blender/mbb/signal.xcf b/assets/blender/mbb/signal.xcf new file mode 100644 index 0000000..f667739 Binary files /dev/null and b/assets/blender/mbb/signal.xcf differ diff --git a/assets/blender/mbb/signal2.png b/assets/blender/mbb/signal2.png new file mode 100644 index 0000000..7af4e2d Binary files /dev/null and b/assets/blender/mbb/signal2.png differ diff --git a/assets/blender/mbb/tr-logo.png b/assets/blender/mbb/tr-logo.png new file mode 100644 index 0000000..9bc0f10 Binary files /dev/null and b/assets/blender/mbb/tr-logo.png differ diff --git a/assets/blender/mbb/weichenhebel1.blend b/assets/blender/mbb/weichenhebel1.blend new file mode 100644 index 0000000..70b997d Binary files /dev/null and b/assets/blender/mbb/weichenhebel1.blend differ diff --git a/assets/blender/mbb/weichenhebel2.blend b/assets/blender/mbb/weichenhebel2.blend new file mode 100644 index 0000000..c1c3aac Binary files /dev/null and b/assets/blender/mbb/weichenhebel2.blend differ diff --git a/assets/blender/newlocomotive.blend b/assets/blender/newlocomotive.blend new file mode 100644 index 0000000..858882b Binary files /dev/null and b/assets/blender/newlocomotive.blend differ diff --git a/assets/blender/newlocomotive.blend1 b/assets/blender/newlocomotive.blend1 new file mode 100644 index 0000000..4b8b24f Binary files /dev/null and b/assets/blender/newlocomotive.blend1 differ diff --git a/assets/blender/newlocomotive_uvs.png b/assets/blender/newlocomotive_uvs.png new file mode 100644 index 0000000..879be65 Binary files /dev/null and b/assets/blender/newlocomotive_uvs.png differ diff --git a/assets/blender/newwagon.blend b/assets/blender/newwagon.blend new file mode 100644 index 0000000..1cedc55 Binary files /dev/null and b/assets/blender/newwagon.blend differ diff --git a/assets/blender/newwagon.blend1 b/assets/blender/newwagon.blend1 new file mode 100644 index 0000000..eb30fde Binary files /dev/null and b/assets/blender/newwagon.blend1 differ diff --git a/assets/blender/newwagon.png b/assets/blender/newwagon.png new file mode 100644 index 0000000..812bc32 Binary files /dev/null and b/assets/blender/newwagon.png differ diff --git a/assets/blender/subway-train.blend b/assets/blender/subway-train.blend new file mode 100644 index 0000000..690d87b Binary files /dev/null and b/assets/blender/subway-train.blend differ diff --git a/assets/blender/subway-train.blend1 b/assets/blender/subway-train.blend1 new file mode 100644 index 0000000..86d1f92 Binary files /dev/null and b/assets/blender/subway-train.blend1 differ diff --git a/assets/blender/subway-train.png b/assets/blender/subway-train.png new file mode 100644 index 0000000..d0b9731 Binary files /dev/null and b/assets/blender/subway-train.png differ diff --git a/assets/blender/subway-train.xcf b/assets/blender/subway-train.xcf new file mode 100644 index 0000000..775b87c Binary files /dev/null and b/assets/blender/subway-train.xcf differ diff --git a/assets/blender/trackplane.blend b/assets/blender/trackplane.blend new file mode 100644 index 0000000..79365f7 Binary files /dev/null and b/assets/blender/trackplane.blend differ diff --git a/assets/blender/trackvertical1.blend b/assets/blender/trackvertical1.blend new file mode 100644 index 0000000..fca6742 Binary files /dev/null and b/assets/blender/trackvertical1.blend differ diff --git a/assets/blender/trackvertical1.blend1 b/assets/blender/trackvertical1.blend1 new file mode 100644 index 0000000..b146b56 Binary files /dev/null and b/assets/blender/trackvertical1.blend1 differ diff --git a/assets/blender/trackvertical1.png b/assets/blender/trackvertical1.png new file mode 100644 index 0000000..a998dcb Binary files /dev/null and b/assets/blender/trackvertical1.png differ diff --git a/assets/blender/trackvertical2.blend b/assets/blender/trackvertical2.blend new file mode 100644 index 0000000..a066b84 Binary files /dev/null and b/assets/blender/trackvertical2.blend differ diff --git a/assets/blender/trackvertical2.png b/assets/blender/trackvertical2.png new file mode 100644 index 0000000..43142f9 Binary files /dev/null and b/assets/blender/trackvertical2.png differ diff --git a/assets/init.lua b/assets/init.lua new file mode 100644 index 0000000..e69de29 diff --git a/assets/larger rails.xcf b/assets/larger rails.xcf new file mode 100644 index 0000000..42ae592 Binary files /dev/null and b/assets/larger rails.xcf differ diff --git a/assets/oldmodels/locomotive.b3d b/assets/oldmodels/locomotive.b3d new file mode 100644 index 0000000..5e16be3 Binary files /dev/null and b/assets/oldmodels/locomotive.b3d differ diff --git a/assets/oldmodels/trackvertical1.b3d b/assets/oldmodels/trackvertical1.b3d new file mode 100644 index 0000000..5620f60 Binary files /dev/null and b/assets/oldmodels/trackvertical1.b3d differ diff --git a/assets/oldmodels/trackvertical2.b3d b/assets/oldmodels/trackvertical2.b3d new file mode 100644 index 0000000..22dbb20 Binary files /dev/null and b/assets/oldmodels/trackvertical2.b3d differ diff --git a/license.txt b/license.txt deleted file mode 100644 index 68a4b60..0000000 --- a/license.txt +++ /dev/null @@ -1,142 +0,0 @@ -GNU LESSER GENERAL PUBLIC LICENSE - -Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. - -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. - -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. - -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. - d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. - - (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - - a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS diff --git a/license_media.txt b/license_media.txt deleted file mode 100644 index c0da560..0000000 --- a/license_media.txt +++ /dev/null @@ -1,63 +0,0 @@ -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. - -1. Definitions - - "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. - "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. - "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. - "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike. - "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. - "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. - "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. - "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. - "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. - "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. - -2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. - -3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: - - to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; - to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; - to Distribute and Publicly Perform the Work including as incorporated in Collections; and, - to Distribute and Publicly Perform Adaptations. - -The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e). - -4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: - - You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested. - You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License. - You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works. - If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. - - For the avoidance of doubt: - Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; - Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and, - Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c). - Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. - -5. Representations, Warranties and Disclaimer - -UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU. - -6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. Termination - - This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. - Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. - -8. Miscellaneous - - Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. - Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. - If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. - The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. - diff --git a/manual.pdf b/manual.pdf deleted file mode 100644 index e8c6380..0000000 Binary files a/manual.pdf and /dev/null differ diff --git a/screenshot.png b/screenshot.png deleted file mode 100644 index 78783e1..0000000 Binary files a/screenshot.png and /dev/null differ -- cgit v1.2.3