From d65c4916ceaeed6eec5fe3f344d4e71b3c96a80b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 20 Sep 2017 17:05:04 +0100 Subject: Remove zip release files, move mod to root, exclude assets from Makefile (#92) --- advtrains/advtrains.zip | Bin 1488724 -> 0 bytes advtrains/advtrains/api_doc.txt | 157 --- advtrains/advtrains/atc.lua | 312 ------ advtrains/advtrains/couple.lua | 184 ---- advtrains/advtrains/craft_items.lua | 23 - advtrains/advtrains/crafting.lua | 110 --- advtrains/advtrains/debugitems.lua | 28 - advtrains/advtrains/debugringbuffer.lua | 44 - advtrains/advtrains/depends.txt | 3 - advtrains/advtrains/description.txt | 8 - advtrains/advtrains/digtron.lua | 25 - advtrains/advtrains/helpers.lua | 262 ----- advtrains/advtrains/init.lua | 400 -------- advtrains/advtrains/loading.lua | 99 -- advtrains/advtrains/locale/de.txt | 50 - advtrains/advtrains/misc_nodes.lua | 67 -- advtrains/advtrains/models/advtrains_across.obj | 537 ----------- .../models/advtrains_dtrack_bumper_st.b3d | Bin 32927 -> 0 bytes .../models/advtrains_dtrack_bumper_st_30.b3d | Bin 48546 -> 0 bytes .../models/advtrains_dtrack_bumper_st_45.b3d | Bin 32926 -> 0 bytes .../models/advtrains_dtrack_bumper_st_60.b3d | Bin 48546 -> 0 bytes advtrains/advtrains/models/advtrains_dtrack_cr.b3d | Bin 28040 -> 0 bytes .../advtrains/models/advtrains_dtrack_cr_30.b3d | Bin 28043 -> 0 bytes .../advtrains/models/advtrains_dtrack_cr_45.b3d | Bin 34483 -> 0 bytes .../advtrains/models/advtrains_dtrack_cr_60.b3d | Bin 34483 -> 0 bytes advtrains/advtrains/models/advtrains_dtrack_st.b3d | Bin 10712 -> 0 bytes .../advtrains/models/advtrains_dtrack_st_30.b3d | Bin 20043 -> 0 bytes .../advtrains/models/advtrains_dtrack_st_45.b3d | Bin 12235 -> 0 bytes .../advtrains/models/advtrains_dtrack_st_60.b3d | Bin 20043 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlcr.b3d | Bin 36203 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlcr_30.b3d | Bin 39958 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlcr_45.b3d | Bin 41302 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlcr_60.b3d | Bin 46270 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlst.b3d | Bin 36203 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlst_30.b3d | Bin 39958 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlst_45.b3d | Bin 41302 -> 0 bytes .../advtrains/models/advtrains_dtrack_swlst_60.b3d | Bin 46270 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrcr.b3d | Bin 36203 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrcr_30.b3d | Bin 46270 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrcr_45.b3d | Bin 41302 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrcr_60.b3d | Bin 39958 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrst.b3d | Bin 36203 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrst_30.b3d | Bin 46270 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrst_45.b3d | Bin 41302 -> 0 bytes .../advtrains/models/advtrains_dtrack_swrst_60.b3d | Bin 39958 -> 0 bytes .../advtrains/models/advtrains_dtrack_vst1.obj | 348 ------- .../advtrains/models/advtrains_dtrack_vst1_45.obj | 434 --------- .../advtrains/models/advtrains_dtrack_vst2.obj | 372 -------- .../advtrains/models/advtrains_dtrack_vst2_45.obj | 462 --------- .../advtrains/models/advtrains_dtrack_vst31.obj | 348 ------- .../advtrains/models/advtrains_dtrack_vst32.obj | 372 -------- .../advtrains/models/advtrains_dtrack_vst33.obj | 388 -------- .../advtrains/models/advtrains_modernwagon.b3d | Bin 172028 -> 0 bytes .../advtrains/models/advtrains_retrosignal_off.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_off_30.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_off_45.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_off_60.b3d | Bin 13093 -> 0 bytes .../advtrains/models/advtrains_retrosignal_on.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_on_30.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_on_45.b3d | Bin 13093 -> 0 bytes .../models/advtrains_retrosignal_on_60.b3d | Bin 13093 -> 0 bytes advtrains/advtrains/models/advtrains_signal.b3d | Bin 61544 -> 0 bytes advtrains/advtrains/models/advtrains_signal_30.b3d | Bin 61544 -> 0 bytes advtrains/advtrains/models/advtrains_signal_45.b3d | Bin 61544 -> 0 bytes advtrains/advtrains/models/advtrains_signal_60.b3d | Bin 61544 -> 0 bytes .../advtrains/models/advtrains_signal_wall_l.b3d | Bin 40514 -> 0 bytes .../advtrains/models/advtrains_signal_wall_r.b3d | Bin 40514 -> 0 bytes .../advtrains/models/advtrains_signal_wall_t.b3d | Bin 40514 -> 0 bytes advtrains/advtrains/models/advtrains_track_cr.b3d | Bin 8023 -> 0 bytes advtrains/advtrains/models/advtrains_track_st.b3d | Bin 15831 -> 0 bytes .../advtrains/models/advtrains_track_st_45.b3d | Bin 8935 -> 0 bytes advtrains/advtrains/models/trackplane.b3d | Bin 262 -> 0 bytes advtrains/advtrains/nodedb.lua | 307 ------ advtrains/advtrains/settingtypes.txt | 8 - advtrains/advtrains/signals.lua | 227 ----- advtrains/advtrains/textures/advtrains_across.png | Bin 302 -> 0 bytes .../advtrains/textures/advtrains_across_anim.png | Bin 524 -> 0 bytes advtrains/advtrains/textures/advtrains_boiler.png | Bin 413 -> 0 bytes advtrains/advtrains/textures/advtrains_chimney.png | Bin 309 -> 0 bytes advtrains/advtrains/textures/advtrains_couple.png | Bin 339 -> 0 bytes .../advtrains/textures/advtrains_discouple.png | Bin 293 -> 0 bytes .../advtrains/textures/advtrains_driver_cab.png | Bin 352 -> 0 bytes .../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 .../textures/advtrains_dtrack_load_placer.png | Bin 1248 -> 0 bytes .../advtrains/textures/advtrains_dtrack_placer.png | Bin 1097 -> 0 bytes .../advtrains/textures/advtrains_dtrack_rail.png | Bin 4582 -> 0 bytes .../advtrains/textures/advtrains_dtrack_shared.png | Bin 7141 -> 0 bytes .../textures/advtrains_dtrack_shared_atc.png | Bin 7215 -> 0 bytes .../advtrains_dtrack_shared_detector_off.png | Bin 7180 -> 0 bytes .../advtrains_dtrack_shared_detector_on.png | Bin 7181 -> 0 bytes .../textures/advtrains_dtrack_shared_load.png | Bin 7339 -> 0 bytes .../textures/advtrains_dtrack_shared_unload.png | Bin 7338 -> 0 bytes .../textures/advtrains_dtrack_slopeplacer.png | Bin 2415 -> 0 bytes .../textures/advtrains_dtrack_unload_placer.png | Bin 1260 -> 0 bytes .../advtrains/textures/advtrains_platform.png | Bin 193 -> 0 bytes .../advtrains/textures/advtrains_retrosignal.png | Bin 8496 -> 0 bytes .../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 .../textures/advtrains_signal_wall_off.png | Bin 3056 -> 0 bytes .../textures/advtrains_signal_wall_on.png | Bin 3043 -> 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 .../textures/advtrains_track_swlcr_45.png | Bin 45772 -> 0 bytes .../advtrains/textures/advtrains_track_swlst.png | Bin 32321 -> 0 bytes .../textures/advtrains_track_swlst_45.png | Bin 46408 -> 0 bytes .../advtrains/textures/advtrains_track_swrcr.png | Bin 33670 -> 0 bytes .../textures/advtrains_track_swrcr_45.png | Bin 46865 -> 0 bytes .../advtrains/textures/advtrains_track_swrst.png | Bin 32654 -> 0 bytes .../textures/advtrains_track_swrst_45.png | Bin 47636 -> 0 bytes .../advtrains/textures/advtrains_trackworker.png | Bin 328 -> 0 bytes advtrains/advtrains/textures/advtrains_wheel.png | Bin 582 -> 0 bytes advtrains/advtrains/textures/drwho_screwdriver.png | Bin 328 -> 0 bytes advtrains/advtrains/trackdb_legacy.lua | 27 - advtrains/advtrains/trackplacer.lua | 305 ------ advtrains/advtrains/tracks.lua | 734 -------------- advtrains/advtrains/trainhud.lua | 126 --- advtrains/advtrains/trainlogic.lua | 1005 -------------------- advtrains/advtrains/wagons.lua | 900 ------------------ advtrains/advtrains_itrainmap/depends.txt | 1 - advtrains/advtrains_itrainmap/init.lua | 149 --- .../advtrains_itrainmap/textures/itm_example.png | Bin 154460 -> 0 bytes advtrains/advtrains_luaautomation/README.txt | 165 ---- .../advtrains_luaautomation/active_common.lua | 134 --- advtrains/advtrains_luaautomation/atc_rail.lua | 124 --- advtrains/advtrains_luaautomation/chatcmds.lua | 84 -- advtrains/advtrains_luaautomation/depends.txt | 2 - advtrains/advtrains_luaautomation/environment.lua | 275 ------ advtrains/advtrains_luaautomation/init.lua | 110 --- advtrains/advtrains_luaautomation/interrupt.lua | 46 - .../advtrains_luaautomation/operation_panel.lua | 23 - advtrains/advtrains_luaautomation/p_display.lua | 0 .../advtrains_luaautomation/p_mesecon_iface.lua | 53 -- advtrains/advtrains_luaautomation/passive.lua | 39 - advtrains/advtrains_luaautomation/passive_api.txt | 23 - advtrains/advtrains_luaautomation/pcnaming.lua | 74 -- .../textures/atlatc_oppanel.png | Bin 631 -> 0 bytes .../textures/atlatc_pcnaming.png | Bin 329 -> 0 bytes advtrains/advtrains_train_industrial/depends.txt | 2 - advtrains/advtrains_train_industrial/init.lua | 84 -- advtrains/advtrains_train_industrial/locale/de.txt | 5 - .../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/advtrains_train_japan/depends.txt | 2 - advtrains/advtrains_train_japan/init.lua | 144 --- advtrains/advtrains_train_japan/locale/de.txt | 4 - .../models/advtrains_engine_japan.b3d | Bin 437635 -> 0 bytes .../models/advtrains_wagon_japan.b3d | Bin 554284 -> 0 bytes .../textures/advtrains_engine_japan.png | Bin 27935 -> 0 bytes .../textures/advtrains_engine_japan_inv.png | Bin 434 -> 0 bytes .../textures/advtrains_wagon_japan.png | Bin 54396 -> 0 bytes .../textures/advtrains_wagon_japan_inv.png | Bin 400 -> 0 bytes advtrains/advtrains_train_steam/depends.txt | 2 - advtrains/advtrains_train_steam/init.lua | 245 ----- advtrains/advtrains_train_steam/locale/de.txt | 6 - .../models/advtrains_detailed_steam_engine.b3d | Bin 468002 -> 0 bytes .../models/advtrains_engine_steam.b3d | Bin 437126 -> 0 bytes .../models/advtrains_passenger_wagon.b3d | Bin 145287 -> 0 bytes .../models/advtrains_wagon.b3d | Bin 107352 -> 0 bytes .../models/advtrains_wagon_box.b3d | Bin 50385 -> 0 bytes advtrains/advtrains_train_steam/screenshot.png | Bin 809738 -> 0 bytes .../advtrains_detailed_engine_steam_inv.png | Bin 462 -> 0 bytes .../textures/advtrains_detailed_steam_engine.png | Bin 61988 -> 0 bytes .../textures/advtrains_engine_steam.png | Bin 31915 -> 0 bytes .../textures/advtrains_engine_steam_inv.png | Bin 469 -> 0 bytes .../textures/advtrains_wagon.png | Bin 17701 -> 0 bytes .../textures/advtrains_wagon_box.png | Bin 15197 -> 0 bytes .../textures/advtrains_wagon_box_inv.png | Bin 347 -> 0 bytes .../textures/advtrains_wagon_inv.png | Bin 699 -> 0 bytes advtrains/advtrains_train_subway/depends.txt | 2 - advtrains/advtrains_train_subway/init.lua | 90 -- advtrains/advtrains_train_subway/locale/de.txt | 2 - .../models/advtrains_subway_wagon.b3d | Bin 460013 -> 0 bytes .../textures/advtrains_subway_wagon.png | Bin 3618 -> 0 bytes .../textures/advtrains_subway_wagon_inv.png | Bin 900 -> 0 bytes advtrains/api_doc.txt | 157 +++ advtrains/atc.lua | 312 ++++++ advtrains/atc_command.txt | 83 -- advtrains/couple.lua | 184 ++++ advtrains/craft_items.lua | 23 + advtrains/crafting.lua | 110 +++ advtrains/debugitems.lua | 28 + advtrains/debugringbuffer.lua | 44 + advtrains/depends.txt | 3 + advtrains/description.txt | 9 +- advtrains/digtron.lua | 25 + advtrains/helpers.lua | 262 +++++ advtrains/init.lua | 400 ++++++++ advtrains/license.txt | 142 --- advtrains/license_media.txt | 68 -- advtrains/loading.lua | 99 ++ advtrains/locale/de.txt | 50 + advtrains/manual.pdf | Bin 801491 -> 0 bytes advtrains/misc_nodes.lua | 67 ++ advtrains/models/advtrains_across.obj | 537 +++++++++++ advtrains/models/advtrains_dtrack_bumper_st.b3d | Bin 0 -> 32927 bytes advtrains/models/advtrains_dtrack_bumper_st_30.b3d | Bin 0 -> 48546 bytes advtrains/models/advtrains_dtrack_bumper_st_45.b3d | Bin 0 -> 32926 bytes advtrains/models/advtrains_dtrack_bumper_st_60.b3d | Bin 0 -> 48546 bytes advtrains/models/advtrains_dtrack_cr.b3d | Bin 0 -> 28040 bytes advtrains/models/advtrains_dtrack_cr_30.b3d | Bin 0 -> 28043 bytes advtrains/models/advtrains_dtrack_cr_45.b3d | Bin 0 -> 34483 bytes advtrains/models/advtrains_dtrack_cr_60.b3d | Bin 0 -> 34483 bytes advtrains/models/advtrains_dtrack_st.b3d | Bin 0 -> 10712 bytes advtrains/models/advtrains_dtrack_st_30.b3d | Bin 0 -> 20043 bytes advtrains/models/advtrains_dtrack_st_45.b3d | Bin 0 -> 12235 bytes advtrains/models/advtrains_dtrack_st_60.b3d | Bin 0 -> 20043 bytes advtrains/models/advtrains_dtrack_swlcr.b3d | Bin 0 -> 36203 bytes advtrains/models/advtrains_dtrack_swlcr_30.b3d | Bin 0 -> 39958 bytes advtrains/models/advtrains_dtrack_swlcr_45.b3d | Bin 0 -> 41302 bytes advtrains/models/advtrains_dtrack_swlcr_60.b3d | Bin 0 -> 46270 bytes advtrains/models/advtrains_dtrack_swlst.b3d | Bin 0 -> 36203 bytes advtrains/models/advtrains_dtrack_swlst_30.b3d | Bin 0 -> 39958 bytes advtrains/models/advtrains_dtrack_swlst_45.b3d | Bin 0 -> 41302 bytes advtrains/models/advtrains_dtrack_swlst_60.b3d | Bin 0 -> 46270 bytes advtrains/models/advtrains_dtrack_swrcr.b3d | Bin 0 -> 36203 bytes advtrains/models/advtrains_dtrack_swrcr_30.b3d | Bin 0 -> 46270 bytes advtrains/models/advtrains_dtrack_swrcr_45.b3d | Bin 0 -> 41302 bytes advtrains/models/advtrains_dtrack_swrcr_60.b3d | Bin 0 -> 39958 bytes advtrains/models/advtrains_dtrack_swrst.b3d | Bin 0 -> 36203 bytes advtrains/models/advtrains_dtrack_swrst_30.b3d | Bin 0 -> 46270 bytes advtrains/models/advtrains_dtrack_swrst_45.b3d | Bin 0 -> 41302 bytes advtrains/models/advtrains_dtrack_swrst_60.b3d | Bin 0 -> 39958 bytes advtrains/models/advtrains_dtrack_vst1.obj | 348 +++++++ advtrains/models/advtrains_dtrack_vst1_45.obj | 434 +++++++++ advtrains/models/advtrains_dtrack_vst2.obj | 372 ++++++++ advtrains/models/advtrains_dtrack_vst2_45.obj | 462 +++++++++ advtrains/models/advtrains_dtrack_vst31.obj | 348 +++++++ advtrains/models/advtrains_dtrack_vst32.obj | 372 ++++++++ advtrains/models/advtrains_dtrack_vst33.obj | 388 ++++++++ advtrains/models/advtrains_modernwagon.b3d | Bin 0 -> 172028 bytes advtrains/models/advtrains_retrosignal_off.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_off_30.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_off_45.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_off_60.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_on.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_on_30.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_on_45.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_retrosignal_on_60.b3d | Bin 0 -> 13093 bytes advtrains/models/advtrains_signal.b3d | Bin 0 -> 61544 bytes advtrains/models/advtrains_signal_30.b3d | Bin 0 -> 61544 bytes advtrains/models/advtrains_signal_45.b3d | Bin 0 -> 61544 bytes advtrains/models/advtrains_signal_60.b3d | Bin 0 -> 61544 bytes advtrains/models/advtrains_signal_wall_l.b3d | Bin 0 -> 40514 bytes advtrains/models/advtrains_signal_wall_r.b3d | Bin 0 -> 40514 bytes advtrains/models/advtrains_signal_wall_t.b3d | Bin 0 -> 40514 bytes advtrains/models/advtrains_track_cr.b3d | Bin 0 -> 8023 bytes advtrains/models/advtrains_track_st.b3d | Bin 0 -> 15831 bytes advtrains/models/advtrains_track_st_45.b3d | Bin 0 -> 8935 bytes advtrains/models/trackplane.b3d | Bin 0 -> 262 bytes advtrains/modpack.txt | 0 advtrains/nodedb.lua | 307 ++++++ advtrains/readme.txt | 25 - advtrains/screenshot.png | Bin 809738 -> 0 bytes advtrains/settingtypes.txt | 8 + advtrains/signals.lua | 227 +++++ advtrains/textures/advtrains_across.png | Bin 0 -> 302 bytes advtrains/textures/advtrains_across_anim.png | Bin 0 -> 524 bytes advtrains/textures/advtrains_boiler.png | Bin 0 -> 413 bytes advtrains/textures/advtrains_chimney.png | Bin 0 -> 309 bytes advtrains/textures/advtrains_couple.png | Bin 0 -> 339 bytes advtrains/textures/advtrains_discouple.png | Bin 0 -> 293 bytes advtrains/textures/advtrains_driver_cab.png | Bin 0 -> 352 bytes advtrains/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 .../textures/advtrains_dtrack_load_placer.png | Bin 0 -> 1248 bytes advtrains/textures/advtrains_dtrack_placer.png | Bin 0 -> 1097 bytes advtrains/textures/advtrains_dtrack_rail.png | Bin 0 -> 4582 bytes advtrains/textures/advtrains_dtrack_shared.png | Bin 0 -> 7141 bytes advtrains/textures/advtrains_dtrack_shared_atc.png | Bin 0 -> 7215 bytes .../advtrains_dtrack_shared_detector_off.png | Bin 0 -> 7180 bytes .../advtrains_dtrack_shared_detector_on.png | Bin 0 -> 7181 bytes .../textures/advtrains_dtrack_shared_load.png | Bin 0 -> 7339 bytes .../textures/advtrains_dtrack_shared_unload.png | Bin 0 -> 7338 bytes .../textures/advtrains_dtrack_slopeplacer.png | Bin 0 -> 2415 bytes .../textures/advtrains_dtrack_unload_placer.png | Bin 0 -> 1260 bytes advtrains/textures/advtrains_platform.png | Bin 0 -> 193 bytes advtrains/textures/advtrains_retrosignal.png | Bin 0 -> 8496 bytes advtrains/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_signal_wall_off.png | Bin 0 -> 3056 bytes advtrains/textures/advtrains_signal_wall_on.png | Bin 0 -> 3043 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 advtrains/textures/advtrains_track_swlcr_45.png | Bin 0 -> 45772 bytes advtrains/textures/advtrains_track_swlst.png | Bin 0 -> 32321 bytes advtrains/textures/advtrains_track_swlst_45.png | Bin 0 -> 46408 bytes advtrains/textures/advtrains_track_swrcr.png | Bin 0 -> 33670 bytes advtrains/textures/advtrains_track_swrcr_45.png | Bin 0 -> 46865 bytes advtrains/textures/advtrains_track_swrst.png | Bin 0 -> 32654 bytes advtrains/textures/advtrains_track_swrst_45.png | Bin 0 -> 47636 bytes advtrains/textures/advtrains_trackworker.png | Bin 0 -> 328 bytes advtrains/textures/advtrains_wheel.png | Bin 0 -> 582 bytes advtrains/textures/drwho_screwdriver.png | Bin 0 -> 328 bytes advtrains/trackdb_legacy.lua | 27 + advtrains/trackplacer.lua | 305 ++++++ advtrains/tracks.lua | 734 ++++++++++++++ advtrains/trainhud.lua | 126 +++ advtrains/trainlogic.lua | 1005 ++++++++++++++++++++ advtrains/wagons.lua | 900 ++++++++++++++++++ 321 files changed, 8672 insertions(+), 10881 deletions(-) delete mode 100644 advtrains/advtrains.zip delete mode 100644 advtrains/advtrains/api_doc.txt delete mode 100644 advtrains/advtrains/atc.lua delete mode 100644 advtrains/advtrains/couple.lua delete mode 100644 advtrains/advtrains/craft_items.lua delete mode 100644 advtrains/advtrains/crafting.lua delete mode 100644 advtrains/advtrains/debugitems.lua delete mode 100644 advtrains/advtrains/debugringbuffer.lua delete mode 100644 advtrains/advtrains/depends.txt delete mode 100644 advtrains/advtrains/description.txt delete mode 100644 advtrains/advtrains/digtron.lua delete mode 100644 advtrains/advtrains/helpers.lua delete mode 100644 advtrains/advtrains/init.lua delete mode 100644 advtrains/advtrains/loading.lua delete mode 100644 advtrains/advtrains/locale/de.txt delete mode 100644 advtrains/advtrains/misc_nodes.lua delete mode 100644 advtrains/advtrains/models/advtrains_across.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_st.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_st_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst1.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst1_45.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst2.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst2_45.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst31.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst32.obj delete mode 100644 advtrains/advtrains/models/advtrains_dtrack_vst33.obj delete mode 100644 advtrains/advtrains/models/advtrains_modernwagon.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_30.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_45.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_60.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_wall_l.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_wall_r.b3d delete mode 100644 advtrains/advtrains/models/advtrains_signal_wall_t.b3d delete mode 100644 advtrains/advtrains/models/advtrains_track_cr.b3d delete mode 100644 advtrains/advtrains/models/advtrains_track_st.b3d delete mode 100644 advtrains/advtrains/models/advtrains_track_st_45.b3d delete mode 100644 advtrains/advtrains/models/trackplane.b3d delete mode 100644 advtrains/advtrains/nodedb.lua delete mode 100644 advtrains/advtrains/settingtypes.txt delete mode 100644 advtrains/advtrains/signals.lua delete mode 100755 advtrains/advtrains/textures/advtrains_across.png delete mode 100755 advtrains/advtrains/textures/advtrains_across_anim.png delete mode 100755 advtrains/advtrains/textures/advtrains_boiler.png delete mode 100755 advtrains/advtrains/textures/advtrains_chimney.png delete mode 100755 advtrains/advtrains/textures/advtrains_couple.png delete mode 100755 advtrains/advtrains/textures/advtrains_discouple.png delete mode 100755 advtrains/advtrains/textures/advtrains_driver_cab.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_load_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_rail.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared_atc.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared_detector_off.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared_detector_on.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared_load.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_shared_unload.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png delete mode 100755 advtrains/advtrains/textures/advtrains_dtrack_unload_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_platform.png delete mode 100755 advtrains/advtrains/textures/advtrains_retrosignal.png delete mode 100755 advtrains/advtrains/textures/advtrains_retrosignal_inv.png delete mode 100755 advtrains/advtrains/textures/advtrains_signal_inv.png delete mode 100755 advtrains/advtrains/textures/advtrains_signal_off.png delete mode 100755 advtrains/advtrains/textures/advtrains_signal_on.png delete mode 100755 advtrains/advtrains/textures/advtrains_signal_wall_off.png delete mode 100755 advtrains/advtrains/textures/advtrains_signal_wall_on.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_cr.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_cr_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_placer.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_st.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_st_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swlcr.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swlcr_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swlst.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swlst_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swrcr.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swrcr_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swrst.png delete mode 100755 advtrains/advtrains/textures/advtrains_track_swrst_45.png delete mode 100755 advtrains/advtrains/textures/advtrains_trackworker.png delete mode 100755 advtrains/advtrains/textures/advtrains_wheel.png delete mode 100755 advtrains/advtrains/textures/drwho_screwdriver.png delete mode 100644 advtrains/advtrains/trackdb_legacy.lua delete mode 100644 advtrains/advtrains/trackplacer.lua delete mode 100644 advtrains/advtrains/tracks.lua delete mode 100644 advtrains/advtrains/trainhud.lua delete mode 100644 advtrains/advtrains/trainlogic.lua delete mode 100644 advtrains/advtrains/wagons.lua delete mode 100644 advtrains/advtrains_itrainmap/depends.txt delete mode 100644 advtrains/advtrains_itrainmap/init.lua delete mode 100644 advtrains/advtrains_itrainmap/textures/itm_example.png delete mode 100644 advtrains/advtrains_luaautomation/README.txt delete mode 100644 advtrains/advtrains_luaautomation/active_common.lua delete mode 100644 advtrains/advtrains_luaautomation/atc_rail.lua delete mode 100644 advtrains/advtrains_luaautomation/chatcmds.lua delete mode 100644 advtrains/advtrains_luaautomation/depends.txt delete mode 100644 advtrains/advtrains_luaautomation/environment.lua delete mode 100644 advtrains/advtrains_luaautomation/init.lua delete mode 100644 advtrains/advtrains_luaautomation/interrupt.lua delete mode 100644 advtrains/advtrains_luaautomation/operation_panel.lua delete mode 100644 advtrains/advtrains_luaautomation/p_display.lua delete mode 100644 advtrains/advtrains_luaautomation/p_mesecon_iface.lua delete mode 100644 advtrains/advtrains_luaautomation/passive.lua delete mode 100644 advtrains/advtrains_luaautomation/passive_api.txt delete mode 100644 advtrains/advtrains_luaautomation/pcnaming.lua delete mode 100644 advtrains/advtrains_luaautomation/textures/atlatc_oppanel.png delete mode 100644 advtrains/advtrains_luaautomation/textures/atlatc_pcnaming.png delete mode 100644 advtrains/advtrains_train_industrial/depends.txt delete mode 100644 advtrains/advtrains_train_industrial/init.lua delete mode 100644 advtrains/advtrains_train_industrial/locale/de.txt delete mode 100644 advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d delete mode 100644 advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d delete mode 100644 advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png delete mode 100644 advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png delete mode 100644 advtrains/advtrains_train_japan/depends.txt delete mode 100644 advtrains/advtrains_train_japan/init.lua delete mode 100644 advtrains/advtrains_train_japan/locale/de.txt delete mode 100644 advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d delete mode 100644 advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d delete mode 100644 advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png delete mode 100644 advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png delete mode 100644 advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png delete mode 100644 advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png delete mode 100755 advtrains/advtrains_train_steam/depends.txt delete mode 100755 advtrains/advtrains_train_steam/init.lua delete mode 100755 advtrains/advtrains_train_steam/locale/de.txt delete mode 100755 advtrains/advtrains_train_steam/models/advtrains_detailed_steam_engine.b3d delete mode 100755 advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d delete mode 100644 advtrains/advtrains_train_steam/models/advtrains_passenger_wagon.b3d delete mode 100644 advtrains/advtrains_train_steam/models/advtrains_wagon.b3d delete mode 100755 advtrains/advtrains_train_steam/models/advtrains_wagon_box.b3d delete mode 100644 advtrains/advtrains_train_steam/screenshot.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_detailed_engine_steam_inv.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_detailed_steam_engine.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_engine_steam.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_engine_steam_inv.png delete mode 100644 advtrains/advtrains_train_steam/textures/advtrains_wagon.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png delete mode 100755 advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png delete mode 100644 advtrains/advtrains_train_subway/depends.txt delete mode 100644 advtrains/advtrains_train_subway/init.lua delete mode 100644 advtrains/advtrains_train_subway/locale/de.txt delete mode 100644 advtrains/advtrains_train_subway/models/advtrains_subway_wagon.b3d delete mode 100644 advtrains/advtrains_train_subway/textures/advtrains_subway_wagon.png delete mode 100644 advtrains/advtrains_train_subway/textures/advtrains_subway_wagon_inv.png create mode 100644 advtrains/api_doc.txt create mode 100644 advtrains/atc.lua delete mode 100644 advtrains/atc_command.txt create mode 100644 advtrains/couple.lua create mode 100644 advtrains/craft_items.lua create mode 100644 advtrains/crafting.lua create mode 100644 advtrains/debugitems.lua create mode 100644 advtrains/debugringbuffer.lua create mode 100644 advtrains/depends.txt create mode 100644 advtrains/digtron.lua create mode 100644 advtrains/helpers.lua create mode 100644 advtrains/init.lua delete mode 100644 advtrains/license.txt delete mode 100644 advtrains/license_media.txt create mode 100644 advtrains/loading.lua create mode 100644 advtrains/locale/de.txt delete mode 100644 advtrains/manual.pdf create mode 100644 advtrains/misc_nodes.lua create mode 100644 advtrains/models/advtrains_across.obj create mode 100644 advtrains/models/advtrains_dtrack_bumper_st.b3d create mode 100644 advtrains/models/advtrains_dtrack_bumper_st_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_bumper_st_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_bumper_st_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_cr.b3d create mode 100644 advtrains/models/advtrains_dtrack_cr_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_cr_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_cr_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_st.b3d create mode 100644 advtrains/models/advtrains_dtrack_st_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_st_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_st_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlcr.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlcr_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlcr_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlcr_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlst.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlst_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlst_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_swlst_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrcr.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrcr_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrcr_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrcr_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrst.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrst_30.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrst_45.b3d create mode 100644 advtrains/models/advtrains_dtrack_swrst_60.b3d create mode 100644 advtrains/models/advtrains_dtrack_vst1.obj create mode 100644 advtrains/models/advtrains_dtrack_vst1_45.obj create mode 100644 advtrains/models/advtrains_dtrack_vst2.obj create mode 100644 advtrains/models/advtrains_dtrack_vst2_45.obj create mode 100644 advtrains/models/advtrains_dtrack_vst31.obj create mode 100644 advtrains/models/advtrains_dtrack_vst32.obj create mode 100644 advtrains/models/advtrains_dtrack_vst33.obj create mode 100644 advtrains/models/advtrains_modernwagon.b3d create mode 100644 advtrains/models/advtrains_retrosignal_off.b3d create mode 100644 advtrains/models/advtrains_retrosignal_off_30.b3d create mode 100644 advtrains/models/advtrains_retrosignal_off_45.b3d create mode 100644 advtrains/models/advtrains_retrosignal_off_60.b3d create mode 100644 advtrains/models/advtrains_retrosignal_on.b3d create mode 100644 advtrains/models/advtrains_retrosignal_on_30.b3d create mode 100644 advtrains/models/advtrains_retrosignal_on_45.b3d create mode 100644 advtrains/models/advtrains_retrosignal_on_60.b3d create mode 100644 advtrains/models/advtrains_signal.b3d create mode 100644 advtrains/models/advtrains_signal_30.b3d create mode 100644 advtrains/models/advtrains_signal_45.b3d create mode 100644 advtrains/models/advtrains_signal_60.b3d create mode 100644 advtrains/models/advtrains_signal_wall_l.b3d create mode 100644 advtrains/models/advtrains_signal_wall_r.b3d create mode 100644 advtrains/models/advtrains_signal_wall_t.b3d create mode 100644 advtrains/models/advtrains_track_cr.b3d create mode 100644 advtrains/models/advtrains_track_st.b3d create mode 100644 advtrains/models/advtrains_track_st_45.b3d create mode 100644 advtrains/models/trackplane.b3d delete mode 100644 advtrains/modpack.txt create mode 100644 advtrains/nodedb.lua delete mode 100644 advtrains/readme.txt delete mode 100644 advtrains/screenshot.png create mode 100644 advtrains/settingtypes.txt create mode 100644 advtrains/signals.lua create mode 100755 advtrains/textures/advtrains_across.png create mode 100755 advtrains/textures/advtrains_across_anim.png create mode 100755 advtrains/textures/advtrains_boiler.png create mode 100755 advtrains/textures/advtrains_chimney.png create mode 100755 advtrains/textures/advtrains_couple.png create mode 100755 advtrains/textures/advtrains_discouple.png create mode 100755 advtrains/textures/advtrains_driver_cab.png create mode 100755 advtrains/textures/advtrains_dtrack_atc_placer.png create mode 100755 advtrains/textures/advtrains_dtrack_bumper_placer.png create mode 100755 advtrains/textures/advtrains_dtrack_detector_placer.png create mode 100755 advtrains/textures/advtrains_dtrack_load_placer.png create mode 100755 advtrains/textures/advtrains_dtrack_placer.png create mode 100755 advtrains/textures/advtrains_dtrack_rail.png create mode 100755 advtrains/textures/advtrains_dtrack_shared.png create mode 100755 advtrains/textures/advtrains_dtrack_shared_atc.png create mode 100755 advtrains/textures/advtrains_dtrack_shared_detector_off.png create mode 100755 advtrains/textures/advtrains_dtrack_shared_detector_on.png create mode 100755 advtrains/textures/advtrains_dtrack_shared_load.png create mode 100755 advtrains/textures/advtrains_dtrack_shared_unload.png create mode 100755 advtrains/textures/advtrains_dtrack_slopeplacer.png create mode 100755 advtrains/textures/advtrains_dtrack_unload_placer.png create mode 100755 advtrains/textures/advtrains_platform.png create mode 100755 advtrains/textures/advtrains_retrosignal.png create mode 100755 advtrains/textures/advtrains_retrosignal_inv.png create mode 100755 advtrains/textures/advtrains_signal_inv.png create mode 100755 advtrains/textures/advtrains_signal_off.png create mode 100755 advtrains/textures/advtrains_signal_on.png create mode 100755 advtrains/textures/advtrains_signal_wall_off.png create mode 100755 advtrains/textures/advtrains_signal_wall_on.png create mode 100755 advtrains/textures/advtrains_track_cr.png create mode 100755 advtrains/textures/advtrains_track_cr_45.png create mode 100755 advtrains/textures/advtrains_track_placer.png create mode 100755 advtrains/textures/advtrains_track_st.png create mode 100755 advtrains/textures/advtrains_track_st_45.png create mode 100755 advtrains/textures/advtrains_track_swlcr.png create mode 100755 advtrains/textures/advtrains_track_swlcr_45.png create mode 100755 advtrains/textures/advtrains_track_swlst.png create mode 100755 advtrains/textures/advtrains_track_swlst_45.png create mode 100755 advtrains/textures/advtrains_track_swrcr.png create mode 100755 advtrains/textures/advtrains_track_swrcr_45.png create mode 100755 advtrains/textures/advtrains_track_swrst.png create mode 100755 advtrains/textures/advtrains_track_swrst_45.png create mode 100755 advtrains/textures/advtrains_trackworker.png create mode 100755 advtrains/textures/advtrains_wheel.png create mode 100755 advtrains/textures/drwho_screwdriver.png create mode 100644 advtrains/trackdb_legacy.lua create mode 100644 advtrains/trackplacer.lua create mode 100644 advtrains/tracks.lua create mode 100644 advtrains/trainhud.lua create mode 100644 advtrains/trainlogic.lua create mode 100644 advtrains/wagons.lua (limited to 'advtrains') diff --git a/advtrains/advtrains.zip b/advtrains/advtrains.zip deleted file mode 100644 index a3dab82..0000000 Binary files a/advtrains/advtrains.zip and /dev/null differ diff --git a/advtrains/advtrains/api_doc.txt b/advtrains/advtrains/api_doc.txt deleted file mode 100644 index 20f285f..0000000 --- a/advtrains/advtrains/api_doc.txt +++ /dev/null @@ -1,157 +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 = { - ^- contains zero or more seat definitions. A seat is a place where a player can be attached when getting on a wagon. - { - 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. - group="default" - ^- optional. Defines the seat group. See 'seat_groups' below - }, - }, - seat_groups = { - ^- optional. If defined, activates advanced seating behavior. See "seating behavior". - default = { - name = "Seats" - ^- name of this seat group, to be shown in get-on menu. - access_to = {"foo", "bar"} - ^- List of seat groups you can access from this seat using the menu when sitting inside the train. - require_doors_open = true - ^- Only allow getting on and off if doors are open. - } - } - assign_to_seat_group = {"default"}, - ^- optional, like seat_groups. When player right_clicks the wagon, player will be assigned to the first free seat group in the list. - - doors={ - ^- optional. If defined, defines door animation frames. Opposite door has to be closed during animation period. - ^- Remember, advtrains can't handle doors on both sides opened simultaneously. - open={ - [-1]={frames={x=0, y=20}, time=1}, -- open left doors - [1]={frames={x=40, y=60}, time=1} -- open right doors - }, - close={ - [-1]={frames={x=20, y=40}, time=1}, -- close left doors - [1]={frames={x=60, y=80}, time=1} -- close right doors - } - }, - door_entry={ 1.5, -1.5 } - ^- optional. If defined, defines the locations of the doors on the model as distance from the object center on the path. - ^- Getting on by walking in then takes effect. - ^- Positive values mean front, negative ones back. Resulting position is automatically shifted to the right side. - - 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. - -# Seating behavior -If the advanced seating behavior is active, clicking on a wagon will immediately get you on that wagon depending on the entries in assign_to_seat_group. -If all seat groups are full, if the doors are closed or if you are not authorized to enter this seat group(e.g. driver stands), will show a warning. -On a train, right-clicking the wagon will make you get off the train unless: -- the doors are closed and it requires open doors. -- you have access to a seat group specified in access_to (you may enter it and it's not full) -- you are the owner and can access the wagon preferences -In case there's no possibility, does nothing. -In case there are multiple possibilities, will show a form. - -If you can't enter or leave a train because the doors are closed, holding the Sneak key while right-clicking bypasses the "doors have to be open" enforcement. - -### 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.get_train_at_pos(pos) - end, - after_dig_node=function(pos) - advtrains.ndb.update(pos) - end, - after_place_node=function(pos) - advtrains.ndb.update(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 deleted file mode 100644 index 5f1f64d..0000000 --- a/advtrains/advtrains/atc.lua +++ /dev/null @@ -1,312 +0,0 @@ ---atc.lua ---registers and controls the ATC system - -local atc={} --- ATC persistence table. advtrains.atc is created by init.lua when it loads the save file. -atc.controllers = {} -function atc.load_data(data) - local temp = data and data.controllers or {} - --transcode atc controller data to node hashes: table access times for numbers are far less than for strings - for pts, data in pairs(temp) do - if type(pts)=="number" then - pts=minetest.pos_to_string(minetest.get_position_from_hash(pts)) - end - atc.controllers[pts] = data - end -end -function atc.save_data() - return {controllers = atc.controllers} -end ---contents: {command="...", arrowconn=0-15 where arrow points} - ---general - -function atc.send_command(pos, par_tid) - local pts=minetest.pos_to_string(pos) - if atc.controllers[pts] then - --atprint("Called send_command at "..pts) - local train_id = par_tid or advtrains.detector.on_node[pts] - if train_id then - if advtrains.trains[train_id] then - --atprint("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 - atprint("Sending ATC Command: ", atc.controllers[pts].command) - return true - end - end - atwarn("ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!") - advtrains.trains[train_id].atc_arrow=true - advtrains.trains[train_id].atc_command=atc.controllers[pts].command - atprint("Sending ATC Command: ", atc.controllers[pts].command) - else - atwarn("ATC rail at", pos, ": Sending command failed: The train",train_id,"does not exist. This seems to be a bug.") - end - else - atwarn("ATC rail at", pos, ": Sending command failed: There's no train at this position. This seems to be a bug.") - end - else - atwarn("ATC rail at", pos, ": Sending command failed: Entry for controller not found.") - atwarn("ATC rail at", pos, ": Please visit controller and click 'Save'") - 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, node) - advtrains.ndb.update(pos, node) - local meta=minetest.get_meta(pos) - if meta then - meta:set_string("infotext", attrans("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", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_atc.png", - description=attrans("ATC controller"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_place_node=apn_func, - after_dig_node=function(pos) - return advtrains.pcall(function() - advtrains.invalidate_all_paths(pos) - advtrains.ndb.clear(pos) - local pts=minetest.pos_to_string(pos) - atc.controllers[pts]=nil - end) - end, - on_receive_fields = function(pos, formname, fields, player) - return advtrains.pcall(function() - if advtrains.is_protected(pos, player:get_player_name()) then - minetest.record_protection_violation(pos, player:get_player_name()) - 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]) - if fields.mode=="digiline" then - meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) - else - meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) - end - 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) - if fields.mode=="digiline" then - meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) - else - meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) - end - 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} - if advtrains.detector.on_node[pts] then - atc.send_command(pos) - end - end - end) - end, - advtrains = { - on_train_enter = function(pos, train_id) - atc.send_command(pos) - 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;"..attrans("Command")..";"..minetest.formspec_escape(command).."]" - if tonumber(mode)==2 then - formspec=formspec.."field[0.5,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]" - end - else - formspec=formspec.."field[0.5,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]" - end - return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("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 - atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving!")) - end - return 1 - end, - ["O([LRC])"]=function(id, train, match) - local tt={L=-1, R=1, C=0} - local arr=train.atc_arrow and 1 or -1 - train.door_open = tt[match]*arr*train.movedir - return 2 - 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, compare - 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 - atprint("Evaluating if statement: "..command) - atprint("Cond: "..(cond or "nil")) - atprint("Applies: "..(cond_applies and "true" or "false")) - atprint("Rest: "..rest) - --find end of conditional statement - local nest, pos, elsepos=0, 1 - while nest>=0 do - if pos>#rest then - atwarn(sid(id), attrans("ATC command syntax error: I statement not closed: @1",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 - atprint("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) - - atprint("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 - atwarn(sid(id), attrans("ATC command parse error: Unknown command: @1", command)) - atc.train_reset_command(id) -end - - - ---move table to desired place -advtrains.atc=atc diff --git a/advtrains/advtrains/couple.lua b/advtrains/advtrains/couple.lua deleted file mode 100644 index 7bab241..0000000 --- a/advtrains/advtrains/couple.lua +++ /dev/null @@ -1,184 +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 -]] - -local couple_max_dist=3 - -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... - atprint("Discouple loaded from staticdata, destroying") - self.object:remove() - return - end - self.object:set_armor_groups({immortal=1}) - end, - get_staticdata=function() return "DISCOUPLE" end, - on_punch=function(self, player) - return advtrains.pcall(function() - --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 and not self.wagon.lock_couples 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, attrans("You need to own at least one neighboring wagon to destroy this couple.")) - return - end - end - end - end - atprint("Discouple punched. Splitting train", self.wagon.train_id) - advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua - self.object:remove() - elseif self.wagon.lock_couples then - minetest.chat_send_player(own, "Couples of one of the wagons are locked, can't discouple!") - else - minetest.chat_send_player(own, attrans("You need to own at least one neighboring wagon to destroy this couple.")) - end - end) - end, - on_step=function(self, dtime) - return advtrains.pcall(function() - local t=os.clock() - if not self.wagon then - self.object:remove() - atprint("Discouple: no wagon, destroying") - 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 - atprint("Discouple: wagon no longer loaded, destroying") - 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 - atprintbm("discouple_step", t) - end) - 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) - return advtrains.pcall(function() - if staticdata=="COUPLE" then - --couple entities have no right to exist further... - atprint("Couple loaded from staticdata, destroying") - self.object:remove() - return - end - end) - end, - get_staticdata=function(self) return "COUPLE" end, - on_rightclick=function(self, clicker) - return advtrains.pcall(function() - 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, clicker) - --case 2 (second train is front) - elseif self.train2_is_backpos and not self.train1_is_backpos then - advtrains.do_connect_trains(id2, id1, clicker) - --case 3 - elseif self.train1_is_backpos and self.train2_is_backpos then - advtrains.invert_train(id2) - advtrains.do_connect_trains(id1, id2, clicker) - --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, clicker) - end - atprint("Coupled trains", id1, id2) - self.object:remove() - end) - end, - on_step=function(self, dtime) - return advtrains.pcall(function() - advtrains.atprint_context_tid=sid(self.train_id_1) - advtrains.atprint_context_tid_full=self.train_id_1 - local t=os.clock() - if not self.train_id_1 or not self.train_id_2 then atprint("Couple: train ids not set!") self.object:remove() return end - local train1=advtrains.trains[self.train_id_1] - local train2=advtrains.trains[self.train_id_2] - if not train1 or not train2 then - atprint("Couple: trains missing, destroying") - self.object:remove() - return - end - if not train1.path or not train2.path or not train1.index or not train2.index or not train1.end_index or not train2.end_index then - atprint("Couple: paths or end_index missing. Might happen when paths got cleared") - 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, train1.end_index) - 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, train2.end_index) - end - if not tp1 or not tp2 or not (vector.distance(tp1,tp2) ringbuflen then - ringbufcnt[tid]=0 - end -end -function advtrains.drb_dump(tid) - atdebug("Debug ring buffer output for '"..tid.."':") - local stopcnt=ringbufcnt[tid] - if not stopcnt then - atdebug("ID unknown!") - return - end - repeat - atdebug(ringbufs[tid][ringbufcnt[tid]]) - ringbufcnt[tid]=ringbufcnt[tid]+1 - if ringbufcnt[tid] > ringbuflen then - ringbufcnt[tid]=0 - end - until ringbufcnt[tid]==stopcnt -end - -minetest.register_chatcommand("atdebug_show", - { - params = "train sid", -- Short parameter description - description = "Dump debug log", -- Full description - privs = {train_operator=true}, -- Require the "privs" privilege to run - func = function(name, param) - advtrains.drb_dump(param) - end, -- Called when command is run. - -- Returns boolean success and text output. - }) diff --git a/advtrains/advtrains/depends.txt b/advtrains/advtrains/depends.txt deleted file mode 100644 index 1815e54..0000000 --- a/advtrains/advtrains/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -default -mesecons? -digtron? \ No newline at end of file diff --git a/advtrains/advtrains/description.txt b/advtrains/advtrains/description.txt deleted file mode 100644 index bb13b97..0000000 --- a/advtrains/advtrains/description.txt +++ /dev/null @@ -1,8 +0,0 @@ -Advanced Trains v1.3.8, 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 diff --git a/advtrains/advtrains/digtron.lua b/advtrains/advtrains/digtron.lua deleted file mode 100644 index 7105a54..0000000 --- a/advtrains/advtrains/digtron.lua +++ /dev/null @@ -1,25 +0,0 @@ ---digtron.lua ---make tracks placeable by digtrons by overriding the place function. - -local old_item_place = digtron.item_place_node - -digtron.item_place_node = function(itemstack, placer, place_to, param2) - if minetest.get_item_group(itemstack:get_name(), "advtrains_trackplacer")>0 then - return advtrains.pcall(function() - local def = minetest.registered_items[itemstack:get_name()] - if not def then return itemstack, false end - - local pointed_thing = {} - pointed_thing.type = "node" - pointed_thing.above = {x=place_to.x, y=place_to.y, z=place_to.z} - pointed_thing.under = {x=place_to.x, y=place_to.y - 1, z=place_to.z} - - --call the on_rightclick callback - local success - itemstack, success = def.on_place(itemstack, placer, pointed_thing) - return itemstack, success - end) - else - return old_item_place(itemstack, placer, place_to, param2) - end -end diff --git a/advtrains/advtrains/helpers.lua b/advtrains/advtrains/helpers.lua deleted file mode 100644 index df2d9a8..0000000 --- a/advtrains/advtrains/helpers.lua +++ /dev/null @@ -1,262 +0,0 @@ ---advtrains by orwell96, see readme.txt - -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) - - local midnode_ok, middir1, middir2, midrely1, midrely2=advtrains.get_rail_info_at(mid, drives_on) - if not midnode_ok then - return nil - end - - local next, chkdir, chkrely, y_offset - y_offset=0 - --atprint(" in order mid1,mid2",middir1,middir2) - --try if it is dir1 - local cor1=advtrains.dirCoordSet(mid, middir2)--<<<< - if cor1.x==prev.x and cor1.z==prev.z then--this was previous - next=advtrains.dirCoordSet(mid, middir1) - if midrely1>=1 then - next.y=next.y+1 - --atprint("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 - --atprint("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 - --atprint("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 - --atprint(" dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") - end - --atprint("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 - --atprint("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 - --atprint("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 - --atprint("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 - --atprint("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 - --atprint("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 - --atprint("in conway: one below "..minetest.pos_to_string(next).." rail not connecting, returning!") - --atprint(" in order mid1,2,next1,2,chkdir "..middir1.." "..middir2.." "..nextdir1.." "..nextdir2.." "..chkdir) - return nil - end - end - - --atprint("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) - atlog("Dumping a path:") - if not path then atlog("dumppath: no path(nil)") return end - local temp_path={} - for ipt, iit in pairs(path) do - temp_path[#temp_path+1]={i=ipt, p=iit} - end - table.sort(temp_path, function (k1, k2) return k1.i < k2.i end) - for _,pit in ipairs(temp_path) do - atlog(pit.i.." > "..minetest.pos_to_string(pit.p)) - 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 - --atprint("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)) - --atprint("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 - --atprint("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) - --atprint("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 - ---is_protected wrapper that checks for protection_bypass privilege -function advtrains.is_protected(pos, name) - if not name then - error("advtrains.is_protected() called without name parameter!") - end - if minetest.check_player_privs(name, {protection_bypass=true}) then - --player can bypass protection - return false - end - return minetest.is_protected(pos, name) -end diff --git a/advtrains/advtrains/init.lua b/advtrains/advtrains/init.lua deleted file mode 100644 index 301ff89..0000000 --- a/advtrains/advtrains/init.lua +++ /dev/null @@ -1,400 +0,0 @@ --- Boilerplate to support localized strings if intllib mod is installed. -if minetest.get_modpath("intllib") then - attrans = intllib.Getter() -else - attrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - ---advtrains - -advtrains = {trains={}, wagon_save={}, player_to_train_mapping={}} - ---pcall -local no_action=false - -local function reload_saves() - atwarn("Restoring saved state in 1 second...") - no_action=true - --read last save state and continue, as if server was restarted - for aoi, le in pairs(minetest.luaentities) do - if le.is_wagon then - le.object:remove() - end - end - minetest.after(1, function() - advtrains.load() - atwarn("Reload successful!") - advtrains.ndb.restore_all() - end) -end - -function advtrains.pcall(fun) - if no_action then return end - - local succ, return1, return2, return3, return4=xpcall(fun, function(err) - if advtrains.atprint_context_tid then - local train=advtrains.trains[advtrains.atprint_context_tid_full] - advtrains.dumppath(train.path) - atwarn("Dumping last debug outputs: ", err) - atprint("Train state: index",train.index,"end_index", train.end_index,"| max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> pe_min", train.path_extent_min,"pe_max", train.path_extent_max) - advtrains.drb_dump(advtrains.atprint_context_tid) - end - atwarn("Lua Error occured: ", err) - atwarn(debug.traceback()) - end) - if not succ then - reload_saves() - else - return return1, return2, return3, return4 - end -end - - -advtrains.modpath = minetest.get_modpath("advtrains") - -function advtrains.print_concat_table(a) - local str="" - local stra="" - local t - for i=1,20 do - t=a[i] - if t==nil then - stra=stra.."nil " - else - str=str..stra - stra="" - if type(t)=="table" then - if t.x and t.y and t.z then - str=str..minetest.pos_to_string(t) - else - str=str..dump(t) - end - elseif type(t)=="boolean" then - if t then - str=str.."true" - else - str=str.."false" - end - else - str=str..t - end - str=str.." " - end - end - return str -end - -atprint=function() end -atdebug=function() end -atlog=function(t, ...) - local text=advtrains.print_concat_table({t, ...}) - minetest.log("action", "[advtrains]"..text) -end -atwarn=function(t, ...) - local text=advtrains.print_concat_table({t, ...}) - minetest.log("warning", "[advtrains]"..text) - minetest.chat_send_all("[advtrains] -!- "..text) -end -sid=function(id) if id then return string.sub(id, -6) end end - -if minetest.settings:get_bool("advtrains_enable_debugging") then - atprint=function(t, ...) - local context=advtrains.atprint_context_tid - if not context then return end - local text=advtrains.print_concat_table({t, ...}) - advtrains.drb_record(context, text) - end - atdebug=function(t, ...) - local text=advtrains.print_concat_table({t, ...}) - minetest.log("action", "[advtrains]"..text) - minetest.chat_send_all("[advtrains]"..text) - end - dofile(advtrains.modpath.."/debugringbuffer.lua") -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.."/trackdb_legacy.lua") -dofile(advtrains.modpath.."/nodedb.lua") -dofile(advtrains.modpath.."/couple.lua") - -dofile(advtrains.modpath.."/signals.lua") -dofile(advtrains.modpath.."/misc_nodes.lua") -dofile(advtrains.modpath.."/crafting.lua") -dofile(advtrains.modpath.."/craft_items.lua") -dofile(advtrains.modpath.."/loading.lua") - -if minetest.global_exists("digtron") then - dofile(advtrains.modpath.."/digtron.lua") -end - ---load/save - -advtrains.fpath=minetest.get_worldpath().."/advtrains" - -function advtrains.avt_load() - local file, err = io.open(advtrains.fpath, "r") - if not file then - minetest.log("error", " Failed to read advtrains save data from file "..advtrains.fpath..": "..(err or "Unknown Error")) - else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - if tbl.version then - --congrats, we have the new save format. - advtrains.trains = tbl.trains - advtrains.wagon_save = tbl.wagon_save - advtrains.player_to_train_mapping = tbl.ptmap or {} - advtrains.ndb.load_data(tbl.ndb) - advtrains.atc.load_data(tbl.atc) - else - --oh no, its the old one... - advtrains.trains=tbl - --load ATC - 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" - atprint("Failed loading advtrains atc save file "..er) - else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - advtrains.atc.controllers=tbl.controllers - end - file:close() - end - --load wagon saves - 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" - atprint("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 - end - else - minetest.log("error", " Failed to deserialize advtrains save data: Not a table!") - end - file:close() - end -end - -advtrains.avt_save = function(remove_players_from_wagons) - --atprint("saving") - --No more invalidating. - --Instead, remove path a.s.o from the saved table manually - - -- 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 - if remove_players_from_wagons then - data.seatp={} - end - end - if remove_players_from_wagons then - advtrains.player_to_train_mapping={} - end - - local tmp_trains={} - for id, train in pairs(advtrains.trains) do - --first, deep_copy the train - local v=advtrains.merge_tables(train) - --then invalidate - 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.end_index=nil - v.min_index_on_track=nil - v.max_index_on_track=nil - v.path_extent_min=nil - v.path_extent_max=nil - - v.detector_old_index=nil - v.detector_old_end_index=nil - - --then save it - tmp_trains[id]=v - end - - --versions: - -- 1 - Initial new save format. - local save_tbl={ - trains = tmp_trains, - wagon_save = advtrains.wagon_save, - ptmap = advtrains.player_to_train_mapping, - atc = advtrains.atc.save_data(), - ndb = advtrains.ndb.save_data(), - version = 1, - } - local datastr = minetest.serialize(save_tbl) - if not datastr then - minetest.log("error", " Failed to serialize advtrains save data!") - return - end - local file, err = io.open(advtrains.fpath, "w") - if err then - minetest.log("error", " Failed to write advtrains save data to file "..advtrains.fpath..": "..(err or "Unknown Error")) - return - end - file:write(datastr) - file:close() -end - ---## MAIN LOOP ##-- ---Calls all subsequent main tasks of both advtrains and atlatc -local init_load=false -local save_interval=20 -local save_timer=save_interval -advtrains.mainloop_runcnt=0 - -minetest.register_globalstep(function(dtime_mt) - return advtrains.pcall(function() - advtrains.mainloop_runcnt=advtrains.mainloop_runcnt+1 - atprint("Running the main loop, runcnt",advtrains.mainloop_runcnt) - --call load once. see advtrains.load() comment - if not init_load then - advtrains.load() - end - --limit dtime: if trains move too far in one step, automation may cause stuck and wrongly braking trains - local dtime=dtime_mt - if dtime>0.2 then - atprint("Limiting dtime to 0.2!") - dtime=0.2 - end - - advtrains.mainloop_trainlogic(dtime) - if advtrains_itm_mainloop then - advtrains_itm_mainloop(dtime) - end - if atlatc then - atlatc.mainloop_stepcode(dtime) - atlatc.interrupt.mainloop(dtime) - end - - - --trigger a save when necessary - save_timer=save_timer-dtime - if save_timer<=0 then - local t=os.clock() - --save - advtrains.save() - save_timer=save_interval - atprintbm("saving", t) - end - end) -end) - ---if something goes wrong in these functions, there is no help. no pcall here. - ---## MAIN LOAD ROUTINE ## --- Causes the loading of everything --- first time called in main loop (after the init phase) because luaautomation has to initialize first. -function advtrains.load() - advtrains.avt_load() --loading advtrains. includes ndb at advtrains.ndb.load_data() - if atlatc then - atlatc.load() --includes interrupts - end - if advtrains_itm_init then - advtrains_itm_init() - end - init_load=true - no_action=false - atlog("[load_all]Loaded advtrains save files") -end - ---## MAIN SAVE ROUTINE ## --- Causes the saving of everything -function advtrains.save(remove_players_from_wagons) - if not init_load then - --wait... we haven't loaded yet?! - atwarn("Instructed to save() but load() was never called!") - return - end - advtrains.avt_save(remove_players_from_wagons) --saving advtrains. includes ndb at advtrains.ndb.save_data() - if atlatc then - atlatc.save() - end - atprint("[save_all]Saved advtrains save files") -end -minetest.register_on_shutdown(advtrains.save) - --- This chat command provides a solution to the problem known on the LinuxWorks server --- There are many players that joined a single time, got on a train and then left forever --- These players still occupy seats in the trains. -minetest.register_chatcommand("at_empty_seats", - { - params = "", -- Short parameter description - description = "Detach all players, especially the offline ones, from all trains. Use only when no one serious is on a train.", -- Full description - privs = {train_operator=true, server=true}, -- Require the "privs" privilege to run - func = function(name, param) - return advtrains.pcall(function() - atwarn("Data is being saved. While saving, advtrains will remove the players from trains. Save files will be reloaded afterwards!") - advtrains.save(true) - reload_saves() - end) - end, -}) --- This chat command solves another problem: Trains getting randomly stuck. -minetest.register_chatcommand("at_reroute", - { - params = "", - description = "Delete all train routes, force them to recalculate", - privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe. - func = function(name, param) - return advtrains.pcall(function() - atwarn("Train routes will be recalculated now") - advtrains.save(false) - reload_saves() - end) - end, -}) - diff --git a/advtrains/advtrains/loading.lua b/advtrains/advtrains/loading.lua deleted file mode 100644 index 8ac7b00..0000000 --- a/advtrains/advtrains/loading.lua +++ /dev/null @@ -1,99 +0,0 @@ --- Tracks for loading and unloading trains --- Copyright (C) 2017 Gabriel Pérez-Cerezo - -local function get_far_node(pos) - local node = minetest.get_node(pos) - if node.name == "ignore" then - minetest.get_voxel_manip():read_from_map(pos, pos) - node = minetest.get_node(pos) - end - return node -end - -local function train_load(pos, train_id, unload) - local train=advtrains.trains[train_id] - local below = get_far_node({x=pos.x, y=pos.y-1, z=pos.z}) - if not string.match(below.name, "chest") then - atprint("this is not a chest! at "..minetest.pos_to_string(pos)) - return - end - local inv = minetest.get_inventory({type="node", pos={x=pos.x, y=pos.y-1, z=pos.z}}) - if inv and train.velocity < 2 then - for k, v in ipairs(train.trainparts) do - - local i=minetest.get_inventory({type="detached", name="advtrains_wgn_"..v}) - if i then - if not unload then - for _, item in ipairs(inv:get_list("main")) do - if i:get_list("box") and i:room_for_item("box", item) then - i:add_item("box", item) - inv:remove_item("main", item) - end - end - else - for _, item in ipairs(i:get_list("box")) do - if inv:get_list("main") and inv:room_for_item("main", item) then - i:remove_item("box", item) - inv:add_item("main", item) - end - end - end - end - end - end -end - - -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_unload", - texture_prefix="advtrains_dtrack_unload", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_unload.png", - description=attrans("Unloading Track"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.ndb.clear(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(), attrans("This position is protected!")) - -- return - -- end - -- end, - advtrains = { - on_train_enter = function(pos, train_id) - train_load(pos, train_id, true) - end, - }, - } - end - }, advtrains.trackpresets.t_30deg_straightonly) -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_load", - texture_prefix="advtrains_dtrack_load", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_load.png", - description=attrans("Loading Track"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.ndb.clear(pos) - end, - - advtrains = { - on_train_enter = function(pos, train_id) - train_load(pos, train_id, false) - end, - }, - } - end - }, advtrains.trackpresets.t_30deg_straightonly) diff --git a/advtrains/advtrains/locale/de.txt b/advtrains/advtrains/locale/de.txt deleted file mode 100644 index fe770d8..0000000 --- a/advtrains/advtrains/locale/de.txt +++ /dev/null @@ -1,50 +0,0 @@ -This wagon is owned by @1, you can't destroy it. = Dieser Waggon gehört @1, du kannst ihn nicht abbauen. -Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click the wagon. = Warnung: Du erhältst nur etwas Stahl zurück. Wenn du sicher bist, dass du den Waggon zerstören willst, halte 'Schleichen' und klicke links. -Show Inventory = Zeige Inventar -Select seat: = Wähle einen Sitzplatz aus: -ATC controller, unconfigured. = Zugbeeinflussungsschiene, nicht konfiguiert. -ATC controller = Zugbeeinflussungsschiene -ATC controller, mode @1\nChannel: @2 = Zugbeeinflussungsschiene in Betriebsart "@1"\nKanal: @2 -ATC controller, mode @1\nCommand: @2 = Zugbeeinflussungsschiene in Betriebsart "@1"\nBefehl: @2 -Command = Befehl -Command (on) = Befehl (wenn ein) -Digiline channel = Digiline-Kanal -Save = Speichern -ATC Reverse command warning: didn't reverse train, train moving! = Zugbeeinflussung - Warnung: Befehl 'R' nicht ausgeführt, Zug in Bewegung! -ATC command syntax error: I statement not closed: @1 = Zugbeeinflussung - Syntaxfehler: I-Anweisung nicht geschlossen: @1 -ATC command parse error: Unknown command: @1 = Zugbeeinflussung - Fehler: Unbekannter Befehl: @1 -This position is protected! = Diese Position ist geschützt! -You need to own at least one neighboring wagon to destroy this couple. = Du musst Besitzer eines angrenzenden Waggons sein, um hier abzukuppeln. -@1 Platform (low) = Niedriger @1-Bahnsteig -@1 Platform (high) = Hoher @1-Bahnsteig -off = aus -on = ein -Lampless Signal (@1) = Mechanisches Signal (@1) -Signal (@1) = Lichtsignal (@1) -Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc. = Schienenwerkzeug\n\nLinksklick: Schienentyp ändern, Rechtsklick: Objekt drehen. -This node can't be rotated using the trackworker! = Kann diesen Block nicht mit dem Schienenwerkzeug drehen. -This node can't be changed using the trackworker! = Kann diesen Block nicht mit dem Schienenwerkzeug bearbeiten. -Can't place: not pointing at node = Kann nicht platzieren: Du zeigst nicht auf einen Block. -Can't place: space occupied! = Kann nicht platzieren: Platz besetzt. -Can't place: protected position! = Kann nicht platzieren: Position geschützt. -Can't place: Not enough slope items left (@1 required) = Kann nicht platzieren: nicht genug Steigungsblöcke, es werden insgesamt @1 benötigt. -Can't place: There's no slope of length @1 = Kann nicht platzieren: Keine Steigung der Länge @1 definiert. -Can't place: no supporting node at upper end. = Kann nicht platzieren: kein unterstützender Block am Ende der Steigung. -Deprecated Track = ausrangierte Schiene, nicht verwenden. -Track = Schiene -Bumper = Prellbock -Detector Rail = Detektorschiene -Speed: = Geschw.: -Target: = Zielges.: -@1 Slope = @1 Steigung -Can't get on: wagon full or doors closed! = Kann nicht einsteigen: Waggon voll oder Türen geschlossen. -Use Sneak+rightclick to bypass closed doors! = Nutze Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem einzusteigen. -Lock couples = Kupplungen sperren -Save wagon properties = Waggon-Einstellungen speichern -Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off! = Türen sind geschlossen! Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem auszusteigen. -Wagon properties = Waggon-Einstellungen -Get off = Aussteigen -Get off (forced) = Aussteigen (erzwingen) -(Doors closed) = (Türen geschlossen) -Access to @1 = Zugang zu @1 - diff --git a/advtrains/advtrains/misc_nodes.lua b/advtrains/advtrains/misc_nodes.lua deleted file mode 100644 index 37f535d..0000000 --- a/advtrains/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", " 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 = attrans("@1 Platform (low)", desc), - 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 = attrans("@1 Platform (high)", desc), - 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_across.obj b/advtrains/advtrains/models/advtrains_across.obj deleted file mode 100644 index 4ebf393..0000000 --- a/advtrains/advtrains/models/advtrains_across.obj +++ /dev/null @@ -1,537 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'andreaskreuz.blend' -# www.blender.org -o Cube -v 0.183133 0.500062 -0.365883 -v 0.300122 0.552646 -0.365883 -v 0.300122 0.552646 -0.337392 -v 0.183133 0.500062 -0.337392 -v -0.300121 1.575195 -0.365883 -v -0.183133 1.627780 -0.365883 -v -0.183133 1.627780 -0.337392 -v -0.300121 1.575195 -0.337392 -v -0.035079 -0.503415 -0.299723 -v -0.035079 1.055075 -0.299723 -v -0.024805 -0.503415 -0.324528 -v -0.024805 1.055075 -0.324528 -v -0.000000 -0.503415 -0.334802 -v -0.000000 1.055075 -0.334802 -v 0.024805 -0.503415 -0.324528 -v 0.024805 1.055075 -0.324528 -v 0.035079 -0.503415 -0.299723 -v 0.035079 1.055075 -0.299723 -v 0.024805 -0.503415 -0.274918 -v 0.024805 1.055075 -0.274918 -v -0.000000 -0.503415 -0.264644 -v -0.000000 1.055075 -0.264644 -v -0.024805 -0.503415 -0.274918 -v -0.024805 1.055075 -0.274918 -v -0.000000 -0.698893 -0.299723 -v -0.032318 0.979391 -0.365883 -v -0.084671 1.095865 -0.365883 -v 0.084671 1.031976 -0.365883 -v 0.032318 1.148450 -0.365883 -v 0.084671 1.031976 -0.337392 -v 0.032318 1.148450 -0.337392 -v -0.032318 0.979391 -0.337392 -v -0.084671 1.095865 -0.337392 -v -0.133841 1.055075 -0.323880 -v -0.096352 1.055075 -0.376499 -v -0.115909 0.988154 -0.323880 -v -0.083444 1.006899 -0.376499 -v -0.066920 0.939165 -0.323880 -v -0.048176 0.971631 -0.376499 -v -0.000000 0.921234 -0.323880 -v -0.000000 0.958722 -0.376499 -v 0.066920 0.939165 -0.323880 -v 0.048176 0.971631 -0.376499 -v 0.115909 0.988154 -0.323880 -v 0.083443 1.006899 -0.376499 -v 0.133841 1.055075 -0.323880 -v 0.096352 1.055075 -0.376499 -v 0.115909 1.121995 -0.323880 -v 0.083443 1.103251 -0.376499 -v 0.066920 1.170984 -0.323880 -v 0.048176 1.138518 -0.376499 -v 0.000000 1.188915 -0.323880 -v 0.000000 1.151427 -0.376499 -v -0.066920 1.170984 -0.323880 -v -0.048176 1.138518 -0.376499 -v -0.115909 1.121995 -0.323880 -v -0.083444 1.103251 -0.376499 -v -0.115909 0.988154 -0.376499 -v -0.133841 1.055075 -0.376499 -v -0.066920 0.939165 -0.376499 -v -0.000000 0.921234 -0.376499 -v 0.066920 0.939165 -0.376499 -v 0.115909 0.988154 -0.376499 -v 0.133841 1.055075 -0.376499 -v 0.115909 1.121995 -0.376499 -v 0.066920 1.170984 -0.376499 -v 0.000000 1.188915 -0.376499 -v -0.066920 1.170984 -0.376499 -v -0.115909 1.121995 -0.376499 -v -0.094673 1.000415 -0.376499 -v -0.109318 1.055075 -0.376499 -v -0.054659 0.960402 -0.376499 -v -0.000000 0.945756 -0.376499 -v 0.054659 0.960402 -0.376499 -v 0.094672 1.000415 -0.376499 -v 0.109318 1.055075 -0.376499 -v 0.094672 1.109734 -0.376499 -v 0.054659 1.149747 -0.376499 -v 0.000000 1.164393 -0.376499 -v -0.054659 1.149747 -0.376499 -v -0.094672 1.109734 -0.376499 -v -0.094673 1.000415 -0.397361 -v -0.109318 1.055075 -0.397361 -v -0.054659 0.960402 -0.397361 -v -0.000000 0.945756 -0.397361 -v 0.054659 0.960402 -0.397361 -v 0.094672 1.000415 -0.397361 -v 0.109318 1.055075 -0.397361 -v 0.094672 1.109734 -0.459571 -v 0.054659 1.149747 -0.459571 -v 0.000000 1.164393 -0.459571 -v -0.054659 1.149747 -0.459571 -v -0.094672 1.109734 -0.459571 -v -0.083444 1.006899 -0.397361 -v -0.096352 1.055075 -0.397361 -v -0.048176 0.971631 -0.397361 -v -0.000000 0.958722 -0.397361 -v 0.048176 0.971631 -0.397361 -v 0.083443 1.006899 -0.397361 -v 0.096352 1.055075 -0.397361 -v 0.083443 1.103251 -0.459571 -v 0.048176 1.138518 -0.459571 -v 0.000000 1.151427 -0.459571 -v -0.048176 1.138518 -0.459571 -v -0.083444 1.103251 -0.459571 -v 0.084671 1.095865 -0.337392 -v 0.032318 0.979391 -0.337392 -v -0.032318 1.148450 -0.337392 -v -0.084671 1.031976 -0.337392 -v -0.032318 1.148450 -0.365883 -v -0.084671 1.031976 -0.365883 -v 0.084671 1.095865 -0.365883 -v 0.032318 0.979391 -0.365883 -v 0.300122 1.575195 -0.337392 -v 0.183133 1.627780 -0.337392 -v 0.183133 1.627780 -0.365883 -v 0.300122 1.575195 -0.365883 -v -0.183133 0.500062 -0.337392 -v -0.300121 0.552646 -0.337392 -v -0.300121 0.552646 -0.365883 -v -0.183133 0.500062 -0.365883 -vt 0.9201 0.4239 -vt 0.9201 0.4892 -vt 0.9044 0.4892 -vt 0.9044 0.4239 -vt 0.1944 0.7581 -vt 0.2101 0.7581 -vt 0.2101 0.8279 -vt 0.1944 0.8279 -vt 0.2539 0.3060 -vt 0.2539 0.0160 -vt 0.3247 0.0160 -vt 0.3247 0.3060 -vt 0.4596 0.8350 -vt 0.7496 0.8350 -vt 0.7496 0.8507 -vt 0.4596 0.8507 -vt 0.2539 0.6281 -vt 0.2539 0.3381 -vt 0.3247 0.3381 -vt 0.3247 0.6281 -vt 0.7609 0.4251 -vt 0.7609 0.1508 -vt 0.7767 0.1508 -vt 0.7767 0.4251 -vt 0.2081 0.7222 -vt 0.2081 0.0160 -vt 0.2218 0.0199 -vt 0.2218 0.7261 -vt 0.0434 0.0160 -vt 0.0434 0.9840 -vt 0.0297 0.9840 -vt 0.0297 0.0160 -vt 0.0160 0.9840 -vt 0.0160 0.0160 -vt 0.1623 0.0183 -vt 0.1623 0.9082 -vt 0.1486 0.9060 -vt 0.1486 0.0160 -vt 0.1350 0.9082 -vt 0.1350 0.0183 -vt 0.0755 0.9840 -vt 0.0755 0.0160 -vt 0.0892 0.0160 -vt 0.0892 0.9840 -vt 0.7932 0.9090 -vt 0.7830 0.8984 -vt 0.7830 0.8836 -vt 0.7932 0.8734 -vt 0.8076 0.8737 -vt 0.8178 0.8844 -vt 0.8178 0.8991 -vt 0.8076 0.9093 -vt 0.1029 0.0160 -vt 0.1029 0.9840 -vt 0.1944 0.7261 -vt 0.1944 0.0199 -vt 0.2199 0.8822 -vt 0.2124 0.8943 -vt 0.2019 0.8972 -vt 0.1944 0.8892 -vt 0.1944 0.8750 -vt 0.2019 0.8629 -vt 0.2124 0.8600 -vt 0.2199 0.8680 -vt 0.8087 0.4251 -vt 0.8087 0.1508 -vt 0.8245 0.1508 -vt 0.8245 0.4251 -vt 0.4275 0.3381 -vt 0.4275 0.6281 -vt 0.3567 0.6281 -vt 0.3567 0.3381 -vt 0.6653 0.4408 -vt 0.6653 0.1508 -vt 0.6811 0.1508 -vt 0.6811 0.4408 -vt 0.5625 0.3060 -vt 0.5625 0.0160 -vt 0.6333 0.0160 -vt 0.6333 0.3060 -vt 0.7433 0.4931 -vt 0.7723 0.4931 -vt 0.7723 0.5268 -vt 0.7433 0.5268 -vt 0.7723 0.5650 -vt 0.7433 0.5650 -vt 0.7723 0.5975 -vt 0.7433 0.5975 -vt 0.9044 0.2874 -vt 0.9334 0.2874 -vt 0.9334 0.3198 -vt 0.9044 0.3198 -vt 0.9334 0.3581 -vt 0.9044 0.3581 -vt 0.9334 0.3918 -vt 0.9044 0.3918 -vt 0.8566 0.8329 -vt 0.8856 0.8329 -vt 0.8856 0.8708 -vt 0.8566 0.8708 -vt 0.8856 0.9063 -vt 0.8566 0.9063 -vt 0.9334 0.2553 -vt 0.9044 0.2553 -vt 0.9044 0.2220 -vt 0.9334 0.2220 -vt 0.9044 0.1838 -vt 0.9334 0.1838 -vt 0.7029 0.1188 -vt 0.6791 0.1050 -vt 0.6653 0.0812 -vt 0.6653 0.0536 -vt 0.6791 0.0298 -vt 0.7029 0.0160 -vt 0.7305 0.0160 -vt 0.7543 0.0298 -vt 0.7681 0.0536 -vt 0.7681 0.0812 -vt 0.7543 0.1050 -vt 0.7305 0.1188 -vt 0.9044 0.1508 -vt 0.9334 0.1508 -vt 0.7433 0.4729 -vt 0.7723 0.4729 -vt 0.4596 0.7507 -vt 0.4596 0.7124 -vt 0.4787 0.6793 -vt 0.5118 0.6602 -vt 0.5501 0.6602 -vt 0.5832 0.6793 -vt 0.6023 0.7124 -vt 0.6023 0.7507 -vt 0.5832 0.7838 -vt 0.5501 0.8029 -vt 0.5118 0.8029 -vt 0.4787 0.7838 -vt 0.3408 0.6733 -vt 0.3096 0.6733 -vt 0.3061 0.6602 -vt 0.3443 0.6602 -vt 0.2826 0.6889 -vt 0.2730 0.6793 -vt 0.2669 0.7160 -vt 0.2539 0.7124 -vt 0.2669 0.7472 -vt 0.2539 0.7507 -vt 0.2826 0.7742 -vt 0.2730 0.7838 -vt 0.3096 0.7898 -vt 0.3061 0.8029 -vt 0.3408 0.7898 -vt 0.3443 0.8029 -vt 0.3679 0.7742 -vt 0.3774 0.7838 -vt 0.3835 0.7472 -vt 0.3966 0.7507 -vt 0.3835 0.7160 -vt 0.3966 0.7124 -vt 0.3679 0.6889 -vt 0.3774 0.6793 -vt 0.8044 0.4994 -vt 0.8044 0.4729 -vt 0.8159 0.4729 -vt 0.8159 0.4994 -vt 0.9044 0.6442 -vt 0.9044 0.6187 -vt 0.9159 0.6187 -vt 0.9159 0.6442 -vt 0.8460 0.0160 -vt 0.8460 0.0429 -vt 0.8001 0.0429 -vt 0.8001 0.0160 -vt 0.2773 0.8808 -vt 0.2539 0.8808 -vt 0.2539 0.8350 -vt 0.2773 0.8350 -vt 0.7112 0.4729 -vt 0.7112 0.4994 -vt 0.6997 0.4994 -vt 0.6997 0.4729 -vt 0.9044 0.6715 -vt 0.9159 0.6715 -vt 0.8460 0.0742 -vt 0.8001 0.0742 -vt 0.3048 0.8808 -vt 0.3048 0.8350 -vt 0.7112 0.5306 -vt 0.6997 0.5306 -vt 0.8460 0.1014 -vt 0.8001 0.1014 -vt 0.3290 0.8808 -vt 0.3290 0.8693 -vt 0.7112 0.5582 -vt 0.6997 0.5582 -vt 0.7302 0.7561 -vt 0.7440 0.7323 -vt 0.7509 0.7341 -vt 0.7353 0.7611 -vt 0.7440 0.7047 -vt 0.7509 0.7029 -vt 0.7302 0.6809 -vt 0.7353 0.6758 -vt 0.7064 0.6671 -vt 0.7083 0.6602 -vt 0.6789 0.6671 -vt 0.6770 0.6602 -vt 0.6550 0.6809 -vt 0.6500 0.6758 -vt 0.6413 0.7047 -vt 0.6344 0.7029 -vt 0.6413 0.7323 -vt 0.6344 0.7341 -vt 0.6550 0.7561 -vt 0.6500 0.7611 -vt 0.6789 0.7699 -vt 0.6770 0.7768 -vt 0.7064 0.7699 -vt 0.7083 0.7768 -vt 0.9024 0.7257 -vt 0.9024 0.7491 -vt 0.8566 0.7491 -vt 0.8566 0.7257 -vt 0.7112 0.5746 -vt 0.6653 0.5746 -vt 0.8896 0.0160 -vt 0.8896 0.0400 -vt 0.8781 0.0400 -vt 0.8781 0.0160 -vt 0.8044 0.5306 -vt 0.8159 0.5306 -vt 0.9024 0.7766 -vt 0.8566 0.7766 -vt 0.8896 0.0675 -vt 0.8781 0.0675 -vt 0.8044 0.5582 -vt 0.8159 0.5582 -vt 0.9024 0.8008 -vt 0.8909 0.8008 -vt 0.8896 0.0912 -vt 0.8781 0.0912 -vt 0.3756 0.8659 -vt 0.3756 0.8350 -vt 0.3872 0.8350 -vt 0.4215 0.8659 -vt 0.3436 0.8808 -vt 0.3436 0.8693 -vt 0.3756 0.8949 -vt 0.4215 0.8949 -vt 0.7987 0.8413 -vt 0.7830 0.8413 -vt 0.7830 0.6602 -vt 0.7987 0.6602 -vt 0.4596 0.0160 -vt 0.5304 0.0160 -vt 0.5304 0.3060 -vt 0.4596 0.3060 -vt 0.8723 0.6936 -vt 0.8566 0.6936 -vt 0.8566 0.5125 -vt 0.8723 0.5125 -vt 0.8723 0.4572 -vt 0.8566 0.4572 -vt 0.9044 0.5213 -vt 0.9201 0.5213 -vt 0.9201 0.5866 -vt 0.9044 0.5866 -vt 0.5304 0.6281 -vt 0.4596 0.6281 -vt 0.4596 0.3381 -vt 0.5304 0.3381 -vt 0.3567 0.0160 -vt 0.4275 0.0160 -vt 0.4275 0.3060 -vt 0.3567 0.3060 -vt 0.8723 0.4251 -vt 0.8566 0.4251 -vt 0.8566 0.1508 -vt 0.8723 0.1508 -vt 0.7289 0.4251 -vt 0.7131 0.4251 -vt 0.7131 0.1508 -vt 0.7289 0.1508 -vt 0.6333 0.6281 -vt 0.5625 0.6281 -vt 0.5625 0.3381 -vt 0.6333 0.3381 -vn 0.4100 -0.9121 0.0000 -vn -0.4100 0.9121 0.0000 -vn 0.0000 0.0000 -1.0000 -vn 0.9121 0.4100 0.0000 -vn 0.0000 0.0000 1.0000 -vn -0.9121 -0.4100 0.0000 -vn -0.9239 0.0000 -0.3827 -vn -0.3827 0.0000 -0.9239 -vn 0.3827 0.0000 -0.9239 -vn 0.9239 0.0000 -0.3827 -vn 0.9239 0.0000 0.3827 -vn 0.3827 0.0000 0.9239 -vn 0.0000 1.0000 0.0000 -vn -0.3827 0.0000 0.9239 -vn -0.9239 0.0000 0.3827 -vn 0.0000 -1.0000 0.0000 -vn -0.9659 -0.2588 0.0000 -vn -0.7071 -0.7071 0.0000 -vn -0.2588 -0.9659 -0.0000 -vn 0.2588 -0.9659 0.0000 -vn 0.7071 -0.7071 0.0000 -vn 0.9659 -0.2588 0.0000 -vn 0.9659 0.2588 0.0000 -vn 0.7071 0.7071 0.0000 -vn 0.2588 0.9659 0.0000 -vn -0.2588 0.9659 -0.0000 -vn -0.7071 0.7071 0.0000 -vn -0.9659 0.2588 0.0000 -vn 0.1966 -0.7339 -0.6502 -vn -0.1967 -0.7339 -0.6502 -vn -0.9121 0.4100 0.0000 -vn 0.4100 0.9121 0.0000 -vn -0.4100 -0.9121 0.0000 -vn 0.9121 -0.4100 -0.0000 -s off -f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/2 8/6/2 7/7/2 6/8/2 -f 27/9/3 5/10/3 6/11/3 29/12/3 -f 29/13/4 6/14/4 7/15/4 31/16/4 -f 31/17/5 7/18/5 8/19/5 33/20/5 -f 26/21/6 1/22/6 4/23/6 32/24/6 -f 9/25/7 10/26/7 12/27/7 11/28/7 -f 11/29/8 12/30/8 14/31/8 13/32/8 -f 13/32/9 14/31/9 16/33/9 15/34/9 -f 15/35/10 16/36/10 18/37/10 17/38/10 -f 17/38/11 18/37/11 20/39/11 19/40/11 -f 19/41/12 20/42/12 22/43/12 21/44/12 -f 12/45/13 10/46/13 24/47/13 22/48/13 20/49/13 18/50/13 16/51/13 14/52/13 -f 21/44/14 22/43/14 24/53/14 23/54/14 -f 23/55/15 24/56/15 10/26/15 9/25/15 -f 9/57/16 11/58/16 13/59/16 15/60/16 17/61/16 19/62/16 21/63/16 23/64/16 -f 5/65/6 27/66/6 33/67/6 8/68/6 -f 3/69/5 30/70/5 32/71/5 4/72/5 -f 2/73/4 28/74/4 30/75/4 3/76/4 -f 1/77/3 26/78/3 28/79/3 2/80/3 -f 34/81/17 59/82/17 58/83/17 36/84/17 -f 36/84/18 58/83/18 60/85/18 38/86/18 -f 38/86/19 60/85/19 61/87/19 40/88/19 -f 40/89/20 61/90/20 62/91/20 42/92/20 -f 42/92/21 62/91/21 63/93/21 44/94/21 -f 44/94/22 63/93/22 64/95/22 46/96/22 -f 46/97/23 64/98/23 65/99/23 48/100/23 -f 48/100/24 65/99/24 66/101/24 50/102/24 -f 50/103/25 66/104/25 67/105/25 52/106/25 -f 52/106/26 67/105/26 68/107/26 54/108/26 -f 37/109/3 35/110/3 57/111/3 55/112/3 53/113/3 51/114/3 49/115/3 47/116/3 45/117/3 43/118/3 41/119/3 39/120/3 -f 54/108/27 68/107/27 69/121/27 56/122/27 -f 56/123/28 69/124/28 59/82/28 34/81/28 -f 34/125/5 36/126/5 38/127/5 40/128/5 42/129/5 44/130/5 46/131/5 48/132/5 50/133/5 52/134/5 54/135/5 56/136/5 -f 71/137/3 70/138/3 58/139/3 59/140/3 -f 70/138/3 72/141/3 60/142/3 58/139/3 -f 72/141/3 73/143/3 61/144/3 60/142/3 -f 73/143/3 74/145/3 62/146/3 61/144/3 -f 74/145/3 75/147/3 63/148/3 62/146/3 -f 75/147/3 76/149/3 64/150/3 63/148/3 -f 76/149/3 77/151/3 65/152/3 64/150/3 -f 77/151/3 78/153/3 66/154/3 65/152/3 -f 78/153/3 79/155/3 67/156/3 66/154/3 -f 79/155/3 80/157/3 68/158/3 67/156/3 -f 80/157/3 81/159/3 69/160/3 68/158/3 -f 81/159/3 71/137/3 59/140/3 69/160/3 -f 74/161/20 73/162/20 85/163/20 86/164/20 -f 37/165/24 39/166/24 96/167/24 94/168/24 -f 81/169/27 80/170/27 92/171/27 93/172/27 -f 51/173/19 53/174/19 103/175/19 102/176/19 -f 73/177/19 72/178/19 84/179/19 85/180/19 -f 35/181/23 37/165/23 94/168/23 95/182/23 -f 80/170/26 79/183/26 91/184/26 92/171/26 -f 49/185/18 51/173/18 102/176/18 101/186/18 -f 72/178/18 70/187/18 82/188/18 84/179/18 -f 79/183/25 78/189/25 90/190/25 91/184/25 -f 47/191/17 49/185/17 101/186/17 100/192/17 -f 70/187/17 71/193/17 83/194/17 82/188/17 -f 95/195/3 94/196/3 82/197/3 83/198/3 -f 94/196/3 96/199/3 84/200/3 82/197/3 -f 96/199/3 97/201/3 85/202/3 84/200/3 -f 97/201/3 98/203/3 86/204/3 85/202/3 -f 98/203/3 99/205/3 87/206/3 86/204/3 -f 99/205/3 100/207/3 88/208/3 87/206/3 -f 100/207/29 101/209/29 89/210/29 88/208/29 -f 101/209/3 102/211/3 90/212/3 89/210/3 -f 102/211/3 103/213/3 91/214/3 90/212/3 -f 103/213/3 104/215/3 92/216/3 91/214/3 -f 104/215/3 105/217/3 93/218/3 92/216/3 -f 105/217/30 95/195/30 83/198/30 93/218/30 -f 53/219/20 55/220/20 104/221/20 103/222/20 -f 71/193/28 81/223/28 93/224/28 83/194/28 -f 39/225/25 41/226/25 97/227/25 96/228/25 -f 75/229/21 74/161/21 86/164/21 87/230/21 -f 55/220/21 57/231/21 105/232/21 104/221/21 -f 41/226/26 43/233/26 98/234/26 97/227/26 -f 76/235/22 75/229/22 87/230/22 88/236/22 -f 57/231/22 35/237/22 95/238/22 105/232/22 -f 43/233/27 45/239/27 99/240/27 98/234/27 -f 77/241/23 76/242/23 88/243/23 89/244/23 -f 45/245/28 47/191/28 100/192/28 99/246/28 -f 78/247/24 77/241/24 89/244/24 90/248/24 -f 120/249/31 119/250/31 109/251/31 111/252/31 -f 112/253/3 110/254/3 116/255/3 117/256/3 -f 110/257/31 108/258/31 115/259/31 116/260/31 -f 117/261/32 116/260/32 115/259/32 114/262/32 -f 121/263/33 118/264/33 119/265/33 120/266/33 -f 119/267/5 118/268/5 107/269/5 109/270/5 -f 108/271/5 106/272/5 114/273/5 115/274/5 -f 113/275/34 107/276/34 118/277/34 121/278/34 -f 117/279/34 114/280/34 106/281/34 112/282/34 -f 121/283/3 120/284/3 111/285/3 113/286/3 diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d deleted file mode 100644 index a6d9745..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_bumper_st.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d deleted file mode 100644 index 5f5b3f4..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d deleted file mode 100644 index f13ae75..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d deleted file mode 100644 index 59a2285..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_bumper_st_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr.b3d deleted file mode 100644 index c708292..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_cr.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d deleted file mode 100644 index 7ca0bda..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_cr_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d deleted file mode 100644 index b22ea0d..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_cr_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d deleted file mode 100644 index e9b16d6..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_cr_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st.b3d b/advtrains/advtrains/models/advtrains_dtrack_st.b3d deleted file mode 100644 index c240416..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_st.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d deleted file mode 100644 index fd77e66..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_st_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d deleted file mode 100644 index af3afb1..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_st_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d deleted file mode 100644 index 6cb19e6..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_st_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d deleted file mode 100644 index 8b1ac0e..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlcr.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d deleted file mode 100644 index 6def7ab..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlcr_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d deleted file mode 100644 index cc874ca..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlcr_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d deleted file mode 100644 index 1472a00..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlcr_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d deleted file mode 100644 index ecdb326..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlst.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d deleted file mode 100644 index fd6e91d..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlst_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d deleted file mode 100644 index dae694e..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlst_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d deleted file mode 100644 index 8f2b0e2..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swlst_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d deleted file mode 100644 index 4610826..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrcr.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d deleted file mode 100644 index 71b87f3..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrcr_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d deleted file mode 100644 index 5457972..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrcr_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d deleted file mode 100644 index 167a3ff..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrcr_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d deleted file mode 100644 index 69b6996..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrst.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d deleted file mode 100644 index 19ee483..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrst_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d deleted file mode 100644 index 70d051f..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrst_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d b/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d deleted file mode 100644 index 69a58fb..0000000 Binary files a/advtrains/advtrains/models/advtrains_dtrack_swrst_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst1.obj b/advtrains/advtrains/models/advtrains_dtrack_vst1.obj deleted file mode 100644 index 33d9bf3..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst1.obj +++ /dev/null @@ -1,348 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst1_Cube.031 -v 0.753760 -0.500000 -0.500000 -v 0.753760 -0.500000 0.500000 -v 0.753760 -0.000000 0.500000 -v -0.753760 -0.500000 -0.500000 -v -0.753760 -0.500000 0.500000 -v -0.753760 -0.000000 0.500000 -v 0.329165 -0.196108 0.171599 -v 0.329165 -0.032047 0.171599 -v 0.329165 -0.367707 -0.171599 -v 0.329165 -0.203646 -0.171599 -v 0.462280 -0.196108 0.171599 -v 0.462280 -0.032047 0.171599 -v 0.462280 -0.367707 -0.171599 -v 0.462280 -0.203646 -0.171599 -v 0.412289 0.040000 0.500000 -v 0.412289 -0.460000 -0.500000 -v 0.560528 -0.460000 -0.500000 -v 0.560528 0.040000 0.500000 -v 0.474055 0.060000 0.500000 -v 0.474055 -0.440000 -0.500000 -v 0.498762 -0.440000 -0.500000 -v 0.498762 0.060000 0.500000 -v 0.474055 0.110000 0.500000 -v 0.474055 -0.390000 -0.500000 -v 0.498762 -0.390000 -0.500000 -v 0.498762 0.110000 0.500000 -v 0.529645 -0.385000 -0.500000 -v 0.529645 0.115000 0.500000 -v 0.443172 0.115000 0.500000 -v 0.443172 -0.385000 -0.500000 -v 0.529645 -0.360000 -0.500000 -v 0.529645 0.140000 0.500000 -v 0.443172 0.140000 0.500000 -v 0.443172 -0.360000 -0.500000 -v 0.741194 -0.042500 0.435000 -v -0.741194 -0.042500 0.435000 -v -0.741194 -0.102500 0.315000 -v 0.741194 -0.102500 0.315000 -v 0.741193 0.007500 0.435000 -v -0.741194 0.007500 0.435000 -v -0.741194 -0.052500 0.315000 -v 0.741194 -0.052500 0.315000 -v -0.011733 2.879186 0.500000 -v -0.011732 2.379186 -0.500001 -v -0.011733 2.900814 0.500000 -v -0.011732 2.400814 -0.500000 -v 0.011732 2.379186 -0.500000 -v 0.011732 2.879186 0.500000 -v 0.011732 2.400814 -0.500000 -v 0.011732 2.900814 0.500000 -v -0.412289 -0.460000 -0.500000 -v -0.412289 0.040000 0.500000 -v -0.560528 0.040000 0.500000 -v -0.560528 -0.460000 -0.500000 -v -0.474055 -0.440000 -0.500000 -v -0.474055 0.060000 0.500000 -v -0.498762 0.060000 0.500000 -v -0.498762 -0.440000 -0.500000 -v -0.474055 -0.390000 -0.500000 -v -0.474055 0.110000 0.500000 -v -0.498762 0.110000 0.500000 -v -0.498762 -0.390000 -0.500000 -v -0.529645 0.115000 0.500000 -v -0.529645 -0.385000 -0.500000 -v -0.443172 -0.385000 -0.500000 -v -0.443172 0.115000 0.500000 -v -0.529645 0.140000 0.500000 -v -0.529645 -0.360000 -0.500000 -v -0.443172 -0.360000 -0.500000 -v -0.443172 0.140000 0.500000 -v -0.741194 -0.477500 -0.435000 -v 0.741194 -0.477500 -0.435000 -v 0.741194 -0.417500 -0.315000 -v -0.741194 -0.417500 -0.315000 -v -0.741193 -0.427500 -0.435000 -v 0.741194 -0.427500 -0.435000 -v 0.741194 -0.367500 -0.315000 -v -0.741194 -0.367500 -0.315000 -v 0.741194 -0.166069 0.187862 -v -0.741194 -0.166069 0.187862 -v -0.741194 -0.226069 0.067862 -v 0.741194 -0.226069 0.067862 -v 0.741193 -0.116069 0.187862 -v -0.741194 -0.116069 0.187862 -v -0.741194 -0.176069 0.067862 -v 0.741194 -0.176069 0.067862 -v -0.741194 -0.353931 -0.187862 -v 0.741194 -0.353931 -0.187862 -v 0.741194 -0.293931 -0.067862 -v -0.741194 -0.293931 -0.067862 -v -0.741193 -0.303931 -0.187862 -v 0.741194 -0.303931 -0.187862 -v 0.741194 -0.243931 -0.067862 -v -0.741194 -0.243931 -0.067862 -v -0.329165 -0.196108 0.171599 -v -0.329165 -0.032047 0.171599 -v -0.329165 -0.367707 -0.171599 -v -0.329165 -0.203646 -0.171599 -v -0.462280 -0.196108 0.171599 -v -0.462280 -0.032047 0.171599 -v -0.462280 -0.367707 -0.171599 -v -0.462280 -0.203646 -0.171599 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 1.2064 -0.1190 -vt -0.2978 -0.1190 -vt -0.2978 -0.6179 -vt 1.2064 -0.6179 -vt -0.2924 0.9963 -vt -0.2924 -0.0015 -vt 1.2117 -0.0015 -vt 1.2117 0.9963 -vt 1.2064 0.9965 -vt 1.6526 0.1041 -vt -0.2978 0.9965 -vt -0.7440 0.1041 -vn -1.0000 0.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn -0.0000 0.0000 1.0000 -vn 0.0000 0.8944 -0.4472 -vn 1.0000 0.0000 0.0000 -vn -0.2782 0.8591 -0.4296 -vn 0.2782 0.8591 -0.4296 -vn 0.1433 -0.8852 0.4426 -vn -0.1433 -0.8852 0.4426 -vn 0.0000 -0.8944 0.4472 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst1_Cube.031_SlopeRailMaterial -s off -f 8/1/1 10/2/1 9/3/1 7/4/1 -f 10/2/2 14/5/2 13/6/2 9/7/2 -f 12/8/3 8/1/3 7/9/3 11/10/3 -f 12/8/4 14/5/4 10/2/4 8/1/4 -f 22/11/5 21/12/5 25/13/5 26/14/5 -f 15/15/6 19/16/6 20/17/6 16/18/6 -f 16/19/2 20/20/2 21/21/2 17/22/2 -f 17/23/7 21/12/7 22/11/7 18/24/7 -f 19/25/3 15/26/3 18/27/3 22/28/3 -f 26/29/3 23/30/3 19/25/3 22/28/3 -f 19/16/1 23/31/1 24/32/1 20/17/1 -f 21/21/2 20/20/2 24/33/2 25/34/2 -f 26/14/8 25/13/8 27/35/8 28/36/8 -f 24/32/9 23/31/9 29/37/9 30/38/9 -f 28/36/5 27/35/5 31/39/5 32/40/5 -f 30/38/1 29/37/1 33/41/1 34/42/1 -f 31/39/4 34/42/4 33/41/4 32/40/4 -f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 -f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 -f 39/47/4 42/48/4 41/49/4 40/50/4 -f 35/51/3 39/47/3 40/50/3 36/52/3 -f 36/53/1 40/50/1 41/49/1 37/54/1 -f 37/55/2 41/49/2 42/48/2 38/56/2 -f 39/47/5 35/57/5 38/58/5 42/48/5 -f 43/59/1 45/60/1 46/61/1 44/62/1 -f 47/63/5 49/64/5 50/65/5 48/66/5 -f 43/67/10 44/68/10 47/63/10 48/66/10 -f 45/60/4 50/65/4 49/64/4 46/61/4 -f 58/69/1 57/70/1 61/71/1 62/72/1 -f 51/73/7 55/74/7 56/75/7 52/76/7 -f 52/77/3 56/78/3 57/79/3 53/80/3 -f 53/81/6 57/70/6 58/69/6 54/82/6 -f 55/83/2 51/84/2 54/85/2 58/86/2 -f 62/87/2 59/88/2 55/83/2 58/86/2 -f 55/74/5 59/89/5 60/90/5 56/75/5 -f 57/79/3 56/78/3 60/91/3 61/92/3 -f 62/72/9 61/71/9 63/93/9 64/94/9 -f 60/90/8 59/89/8 65/95/8 66/96/8 -f 64/94/1 63/93/1 67/97/1 68/98/1 -f 66/96/5 65/95/5 69/99/5 70/100/5 -f 67/97/4 70/100/4 69/99/4 68/98/4 -f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 -f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 -f 75/105/4 78/106/4 77/107/4 76/108/4 -f 71/109/2 75/105/2 76/108/2 72/110/2 -f 72/111/5 76/108/5 77/107/5 73/112/5 -f 73/113/3 77/107/3 78/106/3 74/114/3 -f 75/105/1 71/115/1 74/116/1 78/106/1 -f 83/117/4 86/118/4 85/119/4 84/120/4 -f 79/121/3 83/117/3 84/120/3 80/122/3 -f 80/123/1 84/120/1 85/119/1 81/124/1 -f 81/125/2 85/119/2 86/118/2 82/126/2 -f 83/117/5 79/127/5 82/128/5 86/118/5 -f 91/129/4 94/130/4 93/131/4 92/132/4 -f 87/133/2 91/129/2 92/132/2 88/134/2 -f 88/135/5 92/132/5 93/131/5 89/136/5 -f 89/137/3 93/131/3 94/130/3 90/138/3 -f 91/129/1 87/139/1 90/140/1 94/130/1 -f 96/141/5 95/142/5 97/143/5 98/144/5 -f 98/144/2 97/145/2 101/146/2 102/147/2 -f 100/148/3 99/149/3 95/150/3 96/141/3 -f 100/148/4 96/141/4 98/144/4 102/147/4 -g dtrack_vst1_Cube.031_SlopeGravelMaterial -f 3/151/3 6/152/3 5/153/3 2/154/3 -f 1/155/11 2/156/11 5/157/11 4/158/11 -f 1/159/5 3/151/5 2/160/5 -f 6/152/1 4/161/1 5/162/1 -f 4/161/4 6/152/4 3/151/4 1/159/4 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst1_45.obj b/advtrains/advtrains/models/advtrains_dtrack_vst1_45.obj deleted file mode 100644 index 8ff8343..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst1_45.obj +++ /dev/null @@ -1,434 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst1_45_Cube.033 -v 0.111416 -0.221340 0.354093 -v 0.111416 -0.057279 0.354093 -v 0.354093 -0.342660 0.111416 -v 0.354093 -0.178600 0.111416 -v 0.205542 -0.221340 0.448220 -v 0.205542 -0.057279 0.448220 -v 0.448220 -0.342660 0.205543 -v 0.448220 -0.178600 0.205543 -v -0.208358 0.039814 0.791422 -v 0.791423 -0.460000 -0.208357 -v 0.896243 -0.460000 -0.103536 -v -0.103538 0.039814 0.896242 -v -0.164683 0.059814 0.835097 -v 0.835098 -0.440000 -0.164682 -v 0.852568 -0.440000 -0.147212 -v -0.147213 0.059814 0.852567 -v -0.164683 0.109814 0.835097 -v 0.835098 -0.390000 -0.164682 -v 0.852568 -0.390000 -0.147212 -v -0.147213 0.109814 0.852567 -v 0.874406 -0.385000 -0.125374 -v -0.125375 0.114814 0.874405 -v -0.186520 0.114814 0.813259 -v 0.813260 -0.385000 -0.186519 -v 0.874406 -0.360000 -0.125374 -v -0.125375 0.139814 0.874405 -v -0.186520 0.139814 0.813259 -v 0.813260 -0.360000 -0.186519 -v 0.476117 -0.186104 0.572089 -v -0.572088 -0.186104 -0.476117 -v -0.656942 -0.143684 -0.391265 -v 0.391264 -0.143684 0.656941 -v 0.476117 -0.236104 0.572089 -v -0.572088 -0.236104 -0.476117 -v -0.656941 -0.193684 -0.391265 -v 0.391264 -0.193684 0.656942 -v -0.508186 2.879001 0.491594 -v 0.491594 2.379186 -0.508186 -v -0.508186 2.900629 0.491593 -v 0.491594 2.400814 -0.508186 -v 0.508186 2.379186 -0.491594 -v -0.491594 2.879001 0.508186 -v 0.508186 2.400814 -0.491594 -v -0.491594 2.900629 0.508186 -v 0.208358 -0.460000 -0.791421 -v -0.791423 0.039814 0.208357 -v -0.896244 0.039814 0.103537 -v 0.103537 -0.460000 -0.896242 -v 0.164682 -0.440000 -0.835097 -v -0.835099 0.059815 0.164682 -v -0.852568 0.059814 0.147212 -v 0.147212 -0.440000 -0.852567 -v 0.164682 -0.390000 -0.835097 -v -0.835099 0.109815 0.164682 -v -0.852568 0.109814 0.147212 -v 0.147212 -0.390000 -0.852567 -v -0.874406 0.114814 0.125374 -v 0.125375 -0.385000 -0.874404 -v 0.186520 -0.385000 -0.813259 -v -0.813261 0.114815 0.186520 -v -0.874406 0.139814 0.125374 -v 0.125375 -0.360000 -0.874404 -v 0.186520 -0.360000 -0.813259 -v -0.813261 0.139814 0.186520 -v -0.230055 -0.407095 -0.818151 -v 0.818151 -0.407095 0.230055 -v 0.733298 -0.364675 0.314908 -v -0.314908 -0.364675 -0.733299 -v -0.230055 -0.357095 -0.818151 -v 0.818151 -0.357095 0.230056 -v 0.733298 -0.314675 0.314908 -v -0.314908 -0.314675 -0.733298 -v 0.314908 -0.105511 0.733298 -v -0.733298 -0.105511 -0.314908 -v -0.818151 -0.063091 -0.230056 -v 0.230055 -0.063091 0.818151 -v 0.314908 -0.155511 0.733298 -v -0.733298 -0.155511 -0.314908 -v -0.818151 -0.113091 -0.230055 -v 0.230055 -0.113091 0.818151 -v -0.391264 -0.326502 -0.656942 -v 0.656941 -0.326502 0.391265 -v 0.572089 -0.284082 0.476118 -v -0.476117 -0.284082 -0.572089 -v -0.391264 -0.276502 -0.656941 -v 0.656942 -0.276502 0.391265 -v 0.572088 -0.234082 0.476117 -v -0.476117 -0.234082 -0.572089 -v -0.354093 -0.221340 -0.111416 -v -0.354093 -0.057279 -0.111416 -v -0.111416 -0.342660 -0.354093 -v -0.111416 -0.178600 -0.354093 -v -0.448220 -0.221340 -0.205543 -v -0.448220 -0.057279 -0.205543 -v -0.205543 -0.342660 -0.448220 -v -0.205543 -0.178600 -0.448220 -v -0.069408 -0.487406 -0.978798 -v 0.978798 -0.487406 0.069409 -v 0.893945 -0.444986 0.154261 -v -0.154261 -0.444986 -0.893945 -v -0.069408 -0.437406 -0.978798 -v 0.978798 -0.437406 0.069409 -v 0.893945 -0.394986 0.154261 -v -0.154261 -0.394986 -0.893945 -v 0.069408 -0.032780 0.978798 -v -0.978798 -0.032780 -0.069409 -v -0.893945 -0.075200 -0.154261 -v 0.154261 -0.075200 0.893945 -v 0.069408 0.017220 0.978797 -v -0.978798 0.017220 -0.069409 -v -0.893945 -0.025200 -0.154261 -v 0.154261 -0.025200 0.893945 -v -0.029561 -0.500000 -1.029558 -v 1.029558 -0.500000 0.029561 -v -1.029558 -0.500000 -0.029561 -v -1.029558 0.000000 -0.029561 -v 0.029561 -0.500000 1.029558 -v 0.029561 0.000000 1.029558 -v -0.500000 0.000000 1.559119 -v -1.559119 0.000000 0.500000 -v -0.499999 0.000000 0.499999 -v -1.559120 -0.500000 0.500000 -v -0.500000 -0.500000 1.559119 -v -0.500003 -0.500000 0.500000 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.8837 0.9625 -vt 0.8524 0.0348 -vt 0.8837 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.0035 -vt 0.9588 0.0348 -vt 0.8837 0.0035 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.8837 0.9625 -vt 0.8524 0.0348 -vt 0.8837 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.0035 -vt 0.9588 0.0348 -vt 0.8837 0.0035 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt -0.3235 0.5003 -vt 0.6181 0.0296 -vt 0.6181 0.5003 -vt 0.6188 0.9848 -vt -0.3228 0.5141 -vt 0.6188 0.5141 -vt 0.0669 1.0031 -vt 0.0669 0.5045 -vt 0.0669 0.0059 -vt 1.1195 0.0059 -vt 1.1195 1.0031 -vt 0.1925 0.0071 -vt 0.1925 0.5057 -vt -0.3061 0.0071 -vt -0.4317 1.0031 -vt -0.4317 0.0059 -vt 1.1341 0.0071 -vt 1.1341 1.0043 -vt 0.1925 1.0043 -vt 1.1202 0.9906 -vt 0.4151 0.9906 -vt 0.4151 0.5199 -vt 1.1202 0.5199 -vt 0.4050 0.0285 -vt 1.1101 0.0285 -vt 1.1101 0.4992 -vt 0.4050 0.4992 -vt -0.3061 1.0043 -vt 1.1174 0.5141 -vt 1.1174 0.9848 -vt 1.1167 0.0296 -vt 1.1167 0.5003 -vn -0.7071 0.0000 -0.7071 -vn 0.7071 0.0000 -0.7071 -vn -0.7071 0.0000 0.7071 -vn 0.2357 0.9428 -0.2357 -vn 0.7071 0.0000 0.7071 -vn 0.0189 0.9017 -0.4319 -vn 0.4319 0.9017 -0.0189 -vn -0.1263 -0.9320 0.3397 -vn -0.3397 -0.9320 0.1263 -vn -0.2357 -0.9428 0.2357 -vn 0.0000 -1.0000 0.0000 -vn 0.0000 1.0000 0.0000 -vn 0.0000 0.0000 1.0000 -vn -1.0000 0.0000 0.0000 -g dtrack_vst1_45_Cube.033_SlopeRailMaterial -s off -f 2/1/1 4/2/1 3/3/1 1/4/1 -f 4/2/2 8/5/2 7/6/2 3/7/2 -f 6/8/3 2/1/3 1/9/3 5/10/3 -f 6/8/4 8/5/4 4/2/4 2/1/4 -f 16/11/5 15/12/5 19/13/5 20/14/5 -f 9/15/6 13/16/6 14/17/6 10/18/6 -f 10/19/2 14/20/2 15/21/2 11/22/2 -f 11/23/7 15/12/7 16/11/7 12/24/7 -f 13/25/3 9/26/3 12/27/3 16/28/3 -f 20/29/3 17/30/3 13/25/3 16/28/3 -f 13/16/1 17/31/1 18/32/1 14/17/1 -f 15/21/2 14/20/2 18/33/2 19/34/2 -f 20/14/8 19/13/8 21/35/8 22/36/8 -f 18/32/9 17/31/9 23/37/9 24/38/9 -f 22/36/5 21/35/5 25/39/5 26/40/5 -f 24/38/1 23/37/1 27/41/1 28/42/1 -f 25/39/4 28/42/4 27/41/4 26/40/4 -f 17/30/3 20/29/3 22/43/3 26/40/3 27/41/3 23/44/3 -f 18/33/2 24/45/2 28/42/2 25/39/2 21/46/2 19/34/2 -f 32/47/5 36/48/5 33/49/5 29/50/5 -f 34/51/2 30/52/2 29/50/2 33/53/2 -f 35/54/1 31/55/1 30/52/1 34/56/1 -f 36/57/3 32/47/3 31/55/3 35/58/3 -f 32/47/4 29/50/4 30/52/4 31/55/4 -f 37/59/1 39/60/1 40/61/1 38/62/1 -f 41/63/5 43/64/5 44/65/5 42/66/5 -f 37/67/10 38/68/10 41/63/10 42/66/10 -f 39/60/4 44/65/4 43/64/4 40/61/4 -f 52/69/1 51/70/1 55/71/1 56/72/1 -f 45/73/7 49/74/7 50/75/7 46/76/7 -f 46/77/3 50/78/3 51/79/3 47/80/3 -f 47/81/6 51/70/6 52/69/6 48/82/6 -f 49/83/2 45/84/2 48/85/2 52/86/2 -f 56/87/2 53/88/2 49/83/2 52/86/2 -f 49/74/5 53/89/5 54/90/5 50/75/5 -f 51/79/3 50/78/3 54/91/3 55/92/3 -f 56/72/9 55/71/9 57/93/9 58/94/9 -f 54/90/8 53/89/8 59/95/8 60/96/8 -f 58/94/1 57/93/1 61/97/1 62/98/1 -f 60/96/5 59/95/5 63/99/5 64/100/5 -f 61/97/4 64/100/4 63/99/4 62/98/4 -f 53/88/2 56/87/2 58/101/2 62/98/2 63/99/2 59/102/2 -f 54/91/3 60/103/3 64/100/3 61/97/3 57/104/3 55/92/3 -f 69/105/4 72/106/4 71/107/4 70/108/4 -f 65/109/2 69/105/2 70/108/2 66/110/2 -f 66/111/5 70/108/5 71/107/5 67/112/5 -f 67/113/3 71/107/3 72/106/3 68/114/3 -f 69/105/1 65/115/1 68/116/1 72/106/1 -f 76/117/5 80/118/5 77/119/5 73/120/5 -f 78/121/2 74/122/2 73/120/2 77/123/2 -f 79/124/1 75/125/1 74/122/1 78/126/1 -f 80/127/3 76/117/3 75/125/3 79/128/3 -f 76/117/4 73/120/4 74/122/4 75/125/4 -f 85/129/4 88/130/4 87/131/4 86/132/4 -f 81/133/2 85/129/2 86/132/2 82/134/2 -f 82/135/5 86/132/5 87/131/5 83/136/5 -f 83/137/3 87/131/3 88/130/3 84/138/3 -f 85/129/1 81/139/1 84/140/1 88/130/1 -f 90/141/5 89/142/5 91/143/5 92/144/5 -f 92/144/2 91/145/2 95/146/2 96/147/2 -f 94/148/3 93/149/3 89/150/3 90/141/3 -f 94/148/4 90/141/4 92/144/4 96/147/4 -f 101/151/4 104/152/4 103/153/4 102/154/4 -f 97/155/2 101/151/2 102/154/2 98/156/2 -f 98/157/5 102/154/5 103/153/5 99/158/5 -f 99/159/3 103/153/3 104/152/3 100/160/3 -f 101/151/1 97/161/1 100/162/1 104/152/1 -f 109/163/4 112/164/4 111/165/4 110/166/4 -f 105/167/3 109/163/3 110/166/3 106/168/3 -f 106/169/1 110/166/1 111/165/1 107/170/1 -f 107/171/2 111/165/2 112/164/2 108/172/2 -f 109/163/5 105/173/5 108/174/5 112/164/5 -g dtrack_vst1_45_Cube.033_SlopeGravelMaterial -f 114/175/5 118/176/5 117/177/5 -f 116/178/1 113/179/1 115/180/1 -f 116/181/4 121/182/4 118/183/4 114/184/4 113/185/4 -f 115/186/11 124/187/11 122/188/11 -f 116/181/12 120/189/12 121/182/12 -f 118/183/12 121/182/12 119/190/12 -f 113/191/11 114/192/11 117/193/11 124/187/11 115/186/11 -f 121/194/13 120/195/13 122/196/13 124/197/13 -f 119/198/14 121/199/14 124/200/14 123/201/14 -f 123/202/11 124/187/11 117/193/11 -f 116/178/1 115/180/1 122/203/1 120/204/1 -f 117/177/5 118/176/5 119/205/5 123/206/5 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst2.obj b/advtrains/advtrains/models/advtrains_dtrack_vst2.obj deleted file mode 100644 index 444ce42..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst2.obj +++ /dev/null @@ -1,372 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst2_Cube.032 -v 0.753760 0.000000 -0.500000 -v 0.753760 0.000000 0.500000 -v 0.753760 0.500000 0.500000 -v -0.753760 0.000000 -0.500000 -v -0.753760 0.000000 0.500000 -v -0.753760 0.500000 0.500000 -v 0.329165 0.303892 0.171599 -v 0.329165 0.467953 0.171599 -v 0.329165 0.132293 -0.171599 -v 0.329165 0.296354 -0.171599 -v 0.462280 0.303892 0.171599 -v 0.462280 0.467953 0.171599 -v 0.462280 0.132293 -0.171599 -v 0.462280 0.296354 -0.171599 -v 0.412289 0.540000 0.500000 -v 0.412289 0.040000 -0.500000 -v 0.560528 0.040000 -0.500000 -v 0.560528 0.540000 0.500000 -v 0.474055 0.560000 0.500000 -v 0.474055 0.060000 -0.500000 -v 0.498762 0.060000 -0.500000 -v 0.498762 0.560000 0.500000 -v 0.474055 0.610000 0.500000 -v 0.474055 0.110000 -0.500000 -v 0.498762 0.110000 -0.500000 -v 0.498762 0.610000 0.500000 -v 0.529645 0.115000 -0.500000 -v 0.529645 0.615000 0.500000 -v 0.443172 0.615000 0.500000 -v 0.443172 0.115000 -0.500000 -v 0.529645 0.140000 -0.500000 -v 0.529645 0.640000 0.500000 -v 0.443172 0.640000 0.500000 -v 0.443172 0.140000 -0.500000 -v 0.741194 0.457500 0.435000 -v -0.741194 0.457500 0.435000 -v -0.741194 0.397500 0.315000 -v 0.741194 0.397500 0.315000 -v 0.741193 0.507500 0.435000 -v -0.741194 0.507500 0.435000 -v -0.741194 0.447500 0.315000 -v 0.741194 0.447500 0.315000 -v -0.011733 3.379186 0.500000 -v -0.011732 2.879186 -0.500001 -v -0.011733 3.400814 0.500000 -v -0.011732 2.900814 -0.500000 -v 0.011732 2.879186 -0.500000 -v 0.011732 3.379186 0.500000 -v 0.011732 2.900814 -0.500000 -v 0.011732 3.400814 0.500000 -v -0.412289 0.040000 -0.500000 -v -0.412289 0.540000 0.500000 -v -0.560528 0.540000 0.500000 -v -0.560528 0.040000 -0.500000 -v -0.474055 0.060000 -0.500000 -v -0.474055 0.560000 0.500000 -v -0.498762 0.560000 0.500000 -v -0.498762 0.060000 -0.500000 -v -0.474055 0.110000 -0.500000 -v -0.474055 0.610000 0.500000 -v -0.498762 0.610000 0.500000 -v -0.498762 0.110000 -0.500000 -v -0.529645 0.615000 0.500000 -v -0.529645 0.115000 -0.500000 -v -0.443172 0.115000 -0.500000 -v -0.443172 0.615000 0.500000 -v -0.529645 0.640000 0.500000 -v -0.529645 0.140000 -0.500000 -v -0.443172 0.140000 -0.500000 -v -0.443172 0.640000 0.500000 -v -0.741194 0.022500 -0.435000 -v 0.741194 0.022500 -0.435000 -v 0.741194 0.082500 -0.315000 -v -0.741194 0.082500 -0.315000 -v -0.741193 0.072500 -0.435000 -v 0.741194 0.072500 -0.435000 -v 0.741194 0.132500 -0.315000 -v -0.741194 0.132500 -0.315000 -v 0.741194 0.333931 0.187862 -v -0.741194 0.333931 0.187862 -v -0.741194 0.273931 0.067862 -v 0.741194 0.273931 0.067862 -v 0.741193 0.383931 0.187862 -v -0.741194 0.383931 0.187862 -v -0.741194 0.323931 0.067862 -v 0.741194 0.323931 0.067862 -v -0.741194 0.146069 -0.187862 -v 0.741194 0.146069 -0.187862 -v 0.741194 0.206069 -0.067862 -v -0.741194 0.206069 -0.067862 -v -0.741193 0.196069 -0.187862 -v 0.741194 0.196069 -0.187862 -v 0.741194 0.256069 -0.067862 -v -0.741194 0.256069 -0.067862 -v -0.329165 0.303892 0.171599 -v -0.329165 0.467953 0.171599 -v -0.329165 0.132293 -0.171599 -v -0.329165 0.296354 -0.171599 -v -0.462280 0.303892 0.171599 -v -0.462280 0.467953 0.171599 -v -0.462280 0.132293 -0.171599 -v -0.462280 0.296354 -0.171599 -v 0.753760 -0.500000 0.500000 -v 0.753760 -0.500000 -0.500000 -v -0.753760 -0.500000 0.500000 -v -0.753760 -0.500000 -0.500000 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 1.2113 -0.1167 -vt -0.2846 -0.1167 -vt -0.2846 -0.6128 -vt 1.2113 -0.6128 -vt -0.2852 0.4989 -vt 1.2107 0.4989 -vt 1.2107 0.9950 -vt -0.2852 0.9950 -vt 1.2113 0.9927 -vt 1.6551 0.1052 -vt -0.2846 0.9927 -vt -0.7284 0.1052 -vt -0.2873 0.9952 -vt -0.2873 0.0029 -vt 1.2086 0.0029 -vt 1.2086 0.9952 -vt 0.7066 0.9945 -vt -0.2857 0.9945 -vt -0.2857 0.4984 -vt 0.7066 0.4984 -vt 1.2107 0.9918 -vt -0.2852 0.9918 -vt -0.2852 0.4956 -vt 1.2107 0.4956 -vt 0.7071 0.9996 -vt -0.2852 0.9996 -vt -0.2852 0.5034 -vt 0.7071 0.5034 -vn -1.0000 0.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn -0.0000 0.0000 1.0000 -vn 0.0000 0.8944 -0.4472 -vn 1.0000 0.0000 0.0000 -vn -0.2782 0.8591 -0.4296 -vn 0.2782 0.8591 -0.4296 -vn 0.1433 -0.8852 0.4426 -vn -0.1433 -0.8852 0.4426 -vn 0.0000 -0.8944 0.4472 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst2_Cube.032_SlopeRailMaterial -s off -f 8/1/1 10/2/1 9/3/1 7/4/1 -f 10/2/2 14/5/2 13/6/2 9/7/2 -f 12/8/3 8/1/3 7/9/3 11/10/3 -f 12/8/4 14/5/4 10/2/4 8/1/4 -f 22/11/5 21/12/5 25/13/5 26/14/5 -f 15/15/6 19/16/6 20/17/6 16/18/6 -f 16/19/2 20/20/2 21/21/2 17/22/2 -f 17/23/7 21/12/7 22/11/7 18/24/7 -f 19/25/3 15/26/3 18/27/3 22/28/3 -f 26/29/3 23/30/3 19/25/3 22/28/3 -f 19/16/1 23/31/1 24/32/1 20/17/1 -f 21/21/2 20/20/2 24/33/2 25/34/2 -f 26/14/8 25/13/8 27/35/8 28/36/8 -f 24/32/9 23/31/9 29/37/9 30/38/9 -f 28/36/5 27/35/5 31/39/5 32/40/5 -f 30/38/1 29/37/1 33/41/1 34/42/1 -f 31/39/4 34/42/4 33/41/4 32/40/4 -f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 -f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 -f 39/47/4 42/48/4 41/49/4 40/50/4 -f 35/51/3 39/47/3 40/50/3 36/52/3 -f 36/53/1 40/50/1 41/49/1 37/54/1 -f 37/55/2 41/49/2 42/48/2 38/56/2 -f 39/47/5 35/57/5 38/58/5 42/48/5 -f 43/59/1 45/60/1 46/61/1 44/62/1 -f 47/63/5 49/64/5 50/65/5 48/66/5 -f 43/67/10 44/68/10 47/63/10 48/66/10 -f 45/60/4 50/65/4 49/64/4 46/61/4 -f 58/69/1 57/70/1 61/71/1 62/72/1 -f 51/73/7 55/74/7 56/75/7 52/76/7 -f 52/77/3 56/78/3 57/79/3 53/80/3 -f 53/81/6 57/70/6 58/69/6 54/82/6 -f 55/83/2 51/84/2 54/85/2 58/86/2 -f 62/87/2 59/88/2 55/83/2 58/86/2 -f 55/74/5 59/89/5 60/90/5 56/75/5 -f 57/79/3 56/78/3 60/91/3 61/92/3 -f 62/72/9 61/71/9 63/93/9 64/94/9 -f 60/90/8 59/89/8 65/95/8 66/96/8 -f 64/94/1 63/93/1 67/97/1 68/98/1 -f 66/96/5 65/95/5 69/99/5 70/100/5 -f 67/97/4 70/100/4 69/99/4 68/98/4 -f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 -f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 -f 75/105/4 78/106/4 77/107/4 76/108/4 -f 71/109/2 75/105/2 76/108/2 72/110/2 -f 72/111/5 76/108/5 77/107/5 73/112/5 -f 73/113/3 77/107/3 78/106/3 74/114/3 -f 75/105/1 71/115/1 74/116/1 78/106/1 -f 83/117/4 86/118/4 85/119/4 84/120/4 -f 79/121/3 83/117/3 84/120/3 80/122/3 -f 80/123/1 84/120/1 85/119/1 81/124/1 -f 81/125/2 85/119/2 86/118/2 82/126/2 -f 83/117/5 79/127/5 82/128/5 86/118/5 -f 91/129/4 94/130/4 93/131/4 92/132/4 -f 87/133/2 91/129/2 92/132/2 88/134/2 -f 88/135/5 92/132/5 93/131/5 89/136/5 -f 89/137/3 93/131/3 94/130/3 90/138/3 -f 91/129/1 87/139/1 90/140/1 94/130/1 -f 96/141/5 95/142/5 97/143/5 98/144/5 -f 98/144/2 97/145/2 101/146/2 102/147/2 -f 100/148/3 99/149/3 95/150/3 96/141/3 -f 100/148/4 96/141/4 98/144/4 102/147/4 -g dtrack_vst2_Cube.032_SlopeGravelMaterial -f 3/151/3 6/152/3 5/153/3 2/154/3 -f 4/155/2 1/156/2 104/157/2 106/158/2 -f 1/159/5 3/151/5 2/160/5 -f 6/152/1 4/161/1 5/162/1 -f 4/161/4 6/152/4 3/151/4 1/159/4 -f 104/163/11 103/164/11 105/165/11 106/166/11 -f 5/167/1 4/168/1 106/169/1 105/170/1 -f 2/171/3 5/172/3 105/173/3 103/174/3 -f 1/175/5 2/176/5 103/177/5 104/178/5 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst2_45.obj b/advtrains/advtrains/models/advtrains_dtrack_vst2_45.obj deleted file mode 100644 index 5dc708b..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst2_45.obj +++ /dev/null @@ -1,462 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst2_45_Cube.035 -v 0.111416 0.278660 0.354093 -v 0.111416 0.442721 0.354093 -v 0.354093 0.157340 0.111416 -v 0.354093 0.321400 0.111416 -v 0.205542 0.278660 0.448220 -v 0.205542 0.442721 0.448220 -v 0.448220 0.157340 0.205543 -v 0.448220 0.321400 0.205543 -v -0.208358 0.539814 0.791422 -v 0.791423 0.040000 -0.208357 -v 0.896243 0.040000 -0.103536 -v -0.103538 0.539814 0.896242 -v -0.164683 0.559814 0.835097 -v 0.835098 0.060000 -0.164682 -v 0.852568 0.060000 -0.147212 -v -0.147213 0.559814 0.852567 -v -0.164683 0.609814 0.835097 -v 0.835098 0.110000 -0.164682 -v 0.852568 0.110000 -0.147212 -v -0.147213 0.609814 0.852567 -v 0.874406 0.115000 -0.125374 -v -0.125375 0.614814 0.874405 -v -0.186520 0.614814 0.813259 -v 0.813260 0.115000 -0.186519 -v 0.874406 0.140000 -0.125374 -v -0.125375 0.639814 0.874405 -v -0.186520 0.639814 0.813259 -v 0.813260 0.140000 -0.186519 -v 0.476117 0.313896 0.572089 -v -0.572088 0.313896 -0.476117 -v -0.656942 0.356316 -0.391265 -v 0.391264 0.356316 0.656941 -v 0.476117 0.263896 0.572089 -v -0.572088 0.263896 -0.476117 -v -0.656941 0.306316 -0.391265 -v 0.391264 0.306316 0.656942 -v -0.508186 3.379001 0.491594 -v 0.491594 2.879186 -0.508186 -v -0.508186 3.400629 0.491593 -v 0.491594 2.900814 -0.508186 -v 0.508186 2.879186 -0.491594 -v -0.491594 3.379001 0.508186 -v 0.508186 2.900814 -0.491594 -v -0.491594 3.400629 0.508186 -v 0.208358 0.040000 -0.791421 -v -0.791423 0.539814 0.208357 -v -0.896244 0.539814 0.103537 -v 0.103537 0.040000 -0.896242 -v 0.164682 0.060000 -0.835097 -v -0.835099 0.559815 0.164682 -v -0.852568 0.559814 0.147212 -v 0.147212 0.060000 -0.852567 -v 0.164682 0.110000 -0.835097 -v -0.835099 0.609815 0.164682 -v -0.852568 0.609814 0.147212 -v 0.147212 0.110000 -0.852567 -v -0.874406 0.614814 0.125374 -v 0.125375 0.115000 -0.874404 -v 0.186520 0.115000 -0.813259 -v -0.813261 0.614815 0.186520 -v -0.874406 0.639814 0.125374 -v 0.125375 0.140000 -0.874404 -v 0.186520 0.140000 -0.813259 -v -0.813261 0.639814 0.186520 -v -0.230055 0.092905 -0.818151 -v 0.818151 0.092905 0.230055 -v 0.733298 0.135325 0.314908 -v -0.314908 0.135325 -0.733299 -v -0.230055 0.142905 -0.818151 -v 0.818151 0.142905 0.230056 -v 0.733298 0.185325 0.314908 -v -0.314908 0.185325 -0.733298 -v 0.314908 0.394489 0.733298 -v -0.733298 0.394489 -0.314908 -v -0.818151 0.436909 -0.230056 -v 0.230055 0.436909 0.818151 -v 0.314908 0.344489 0.733298 -v -0.733298 0.344489 -0.314908 -v -0.818151 0.386909 -0.230055 -v 0.230055 0.386909 0.818151 -v -0.391264 0.173498 -0.656942 -v 0.656941 0.173498 0.391265 -v 0.572089 0.215918 0.476118 -v -0.476117 0.215918 -0.572089 -v -0.391264 0.223498 -0.656941 -v 0.656942 0.223498 0.391265 -v 0.572088 0.265918 0.476117 -v -0.476117 0.265918 -0.572089 -v -0.354093 0.278660 -0.111416 -v -0.354093 0.442721 -0.111416 -v -0.111416 0.157340 -0.354093 -v -0.111416 0.321400 -0.354093 -v -0.448220 0.278660 -0.205543 -v -0.448220 0.442721 -0.205543 -v -0.205543 0.157340 -0.448220 -v -0.205543 0.321400 -0.448220 -v -0.069408 0.012594 -0.978798 -v 0.978798 0.012594 0.069409 -v 0.893945 0.055014 0.154261 -v -0.154261 0.055014 -0.893945 -v -0.069408 0.062594 -0.978798 -v 0.978798 0.062594 0.069409 -v 0.893945 0.105014 0.154261 -v -0.154261 0.105014 -0.893945 -v 0.069408 0.467220 0.978798 -v -0.978798 0.467220 -0.069409 -v -0.893945 0.424800 -0.154261 -v 0.154261 0.424800 0.893945 -v 0.069408 0.517220 0.978797 -v -0.978798 0.517220 -0.069409 -v -0.893945 0.474800 -0.154261 -v 0.154261 0.474800 0.893945 -v -0.029561 -0.000000 -1.029558 -v 1.029558 0.000000 0.029561 -v -1.029558 -0.000000 -0.029561 -v -1.029558 0.500000 -0.029561 -v 0.029561 0.000000 1.029558 -v 0.029561 0.500000 1.029558 -v -0.500000 0.500000 1.559119 -v -1.559119 0.500000 0.500000 -v -0.499999 0.500000 0.499999 -v -1.559120 -0.000000 0.500000 -v -0.500000 0.000000 1.559119 -v -0.500003 0.000000 0.500000 -v 1.029558 -0.500000 0.029561 -v -0.029561 -0.500000 -1.029558 -v 0.029561 -0.500000 1.029558 -v -1.029558 -0.500000 -0.029561 -v -0.500003 -0.500000 0.500000 -v -0.500000 -0.500000 1.559119 -v -1.559120 -0.500000 0.500000 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.8837 0.9625 -vt 0.8524 0.0348 -vt 0.8837 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.0035 -vt 0.9588 0.0348 -vt 0.8837 0.0035 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.8837 0.9625 -vt 0.8524 0.0348 -vt 0.8837 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.0035 -vt 0.9588 0.0348 -vt 0.8837 0.0035 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt -0.2938 0.5095 -vt 0.6540 0.0358 -vt 0.6540 0.5096 -vt 0.6549 0.9852 -vt -0.2928 0.5114 -vt 0.6549 0.5114 -vt 0.1047 0.9953 -vt 0.1047 0.4934 -vt 0.1047 -0.0085 -vt 1.1643 -0.0085 -vt 1.1643 0.9953 -vt 1.1568 0.5114 -vt 0.6549 0.0377 -vt 1.1568 0.0377 -vt -0.3972 0.9953 -vt -0.3972 -0.0085 -vt 1.1431 0.5009 -vt 0.4334 0.5009 -vt 0.4334 0.0272 -vt 1.1431 0.0272 -vt 1.1431 0.9747 -vt 0.4334 0.9747 -vt 0.7633 0.9654 -vt 0.0536 0.9654 -vt 0.0536 0.4916 -vt 0.7633 0.4916 -vt 1.1559 0.5096 -vt 1.1559 0.9833 -vt 0.6540 0.9833 -vt 0.1053 -0.0176 -vt 0.1052 0.4843 -vt -0.3966 -0.0176 -vt 1.0530 -0.0176 -vt 1.0530 0.9861 -vt 0.1053 0.9861 -vt -0.3966 0.9861 -vt 0.0536 0.0179 -vt 0.7633 0.0179 -vt -0.2928 0.0377 -vt -0.2938 0.9833 -vt 0.0455 0.1273 -vt 1.0492 0.1273 -vt 1.0492 0.6011 -vt 0.0455 0.6011 -vt 1.1568 0.9852 -vt 1.1559 0.0358 -vn -0.7071 0.0000 -0.7071 -vn 0.7071 0.0000 -0.7071 -vn -0.7071 0.0000 0.7071 -vn 0.2357 0.9428 -0.2357 -vn 0.7071 0.0000 0.7071 -vn 0.0189 0.9017 -0.4319 -vn 0.4319 0.9017 -0.0189 -vn -0.1263 -0.9320 0.3397 -vn -0.3397 -0.9320 0.1263 -vn -0.2357 -0.9428 0.2357 -vn 0.0000 1.0000 0.0000 -vn -0.0000 0.0000 1.0000 -vn -1.0000 0.0000 0.0000 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst2_45_Cube.035_SlopeRailMaterial -s off -f 2/1/1 4/2/1 3/3/1 1/4/1 -f 4/2/2 8/5/2 7/6/2 3/7/2 -f 6/8/3 2/1/3 1/9/3 5/10/3 -f 6/8/4 8/5/4 4/2/4 2/1/4 -f 16/11/5 15/12/5 19/13/5 20/14/5 -f 9/15/6 13/16/6 14/17/6 10/18/6 -f 10/19/2 14/20/2 15/21/2 11/22/2 -f 11/23/7 15/12/7 16/11/7 12/24/7 -f 13/25/3 9/26/3 12/27/3 16/28/3 -f 20/29/3 17/30/3 13/25/3 16/28/3 -f 13/16/1 17/31/1 18/32/1 14/17/1 -f 15/21/2 14/20/2 18/33/2 19/34/2 -f 20/14/8 19/13/8 21/35/8 22/36/8 -f 18/32/9 17/31/9 23/37/9 24/38/9 -f 22/36/5 21/35/5 25/39/5 26/40/5 -f 24/38/1 23/37/1 27/41/1 28/42/1 -f 25/39/4 28/42/4 27/41/4 26/40/4 -f 17/30/3 20/29/3 22/43/3 26/40/3 27/41/3 23/44/3 -f 18/33/2 24/45/2 28/42/2 25/39/2 21/46/2 19/34/2 -f 32/47/5 36/48/5 33/49/5 29/50/5 -f 34/51/2 30/52/2 29/50/2 33/53/2 -f 35/54/1 31/55/1 30/52/1 34/56/1 -f 36/57/3 32/47/3 31/55/3 35/58/3 -f 32/47/4 29/50/4 30/52/4 31/55/4 -f 37/59/1 39/60/1 40/61/1 38/62/1 -f 41/63/5 43/64/5 44/65/5 42/66/5 -f 37/67/10 38/68/10 41/63/10 42/66/10 -f 39/60/4 44/65/4 43/64/4 40/61/4 -f 52/69/1 51/70/1 55/71/1 56/72/1 -f 45/73/7 49/74/7 50/75/7 46/76/7 -f 46/77/3 50/78/3 51/79/3 47/80/3 -f 47/81/6 51/70/6 52/69/6 48/82/6 -f 49/83/2 45/84/2 48/85/2 52/86/2 -f 56/87/2 53/88/2 49/83/2 52/86/2 -f 49/74/5 53/89/5 54/90/5 50/75/5 -f 51/79/3 50/78/3 54/91/3 55/92/3 -f 56/72/9 55/71/9 57/93/9 58/94/9 -f 54/90/8 53/89/8 59/95/8 60/96/8 -f 58/94/1 57/93/1 61/97/1 62/98/1 -f 60/96/5 59/95/5 63/99/5 64/100/5 -f 61/97/4 64/100/4 63/99/4 62/98/4 -f 53/88/2 56/87/2 58/101/2 62/98/2 63/99/2 59/102/2 -f 54/91/3 60/103/3 64/100/3 61/97/3 57/104/3 55/92/3 -f 69/105/4 72/106/4 71/107/4 70/108/4 -f 65/109/2 69/105/2 70/108/2 66/110/2 -f 66/111/5 70/108/5 71/107/5 67/112/5 -f 67/113/3 71/107/3 72/106/3 68/114/3 -f 69/105/1 65/115/1 68/116/1 72/106/1 -f 76/117/5 80/118/5 77/119/5 73/120/5 -f 78/121/2 74/122/2 73/120/2 77/123/2 -f 79/124/1 75/125/1 74/122/1 78/126/1 -f 80/127/3 76/117/3 75/125/3 79/128/3 -f 76/117/4 73/120/4 74/122/4 75/125/4 -f 85/129/4 88/130/4 87/131/4 86/132/4 -f 81/133/2 85/129/2 86/132/2 82/134/2 -f 82/135/5 86/132/5 87/131/5 83/136/5 -f 83/137/3 87/131/3 88/130/3 84/138/3 -f 85/129/1 81/139/1 84/140/1 88/130/1 -f 90/141/5 89/142/5 91/143/5 92/144/5 -f 92/144/2 91/145/2 95/146/2 96/147/2 -f 94/148/3 93/149/3 89/150/3 90/141/3 -f 94/148/4 90/141/4 92/144/4 96/147/4 -f 101/151/4 104/152/4 103/153/4 102/154/4 -f 97/155/2 101/151/2 102/154/2 98/156/2 -f 98/157/5 102/154/5 103/153/5 99/158/5 -f 99/159/3 103/153/3 104/152/3 100/160/3 -f 101/151/1 97/161/1 100/162/1 104/152/1 -f 109/163/4 112/164/4 111/165/4 110/166/4 -f 105/167/3 109/163/3 110/166/3 106/168/3 -f 106/169/1 110/166/1 111/165/1 107/170/1 -f 107/171/2 111/165/2 112/164/2 108/172/2 -f 109/163/5 105/173/5 108/174/5 112/164/5 -g dtrack_vst2_45_Cube.035_SlopeGravelMaterial -f 114/175/5 118/176/5 117/177/5 -f 116/178/1 113/179/1 115/180/1 -f 116/181/4 121/182/4 118/183/4 114/184/4 113/185/4 -f 122/186/1 115/180/1 128/187/1 131/188/1 -f 116/181/11 120/189/11 121/182/11 -f 118/183/11 121/182/11 119/190/11 -f 124/191/12 122/192/12 131/193/12 129/194/12 -f 121/195/12 120/196/12 122/192/12 124/191/12 -f 119/197/13 121/198/13 124/199/13 123/200/13 -f 117/177/5 123/201/5 130/202/5 127/203/5 -f 128/204/14 129/205/14 131/206/14 -f 126/207/14 125/208/14 127/209/14 129/205/14 128/204/14 -f 130/210/14 129/205/14 127/209/14 -f 123/200/13 124/199/13 129/211/13 130/212/13 -f 115/180/1 113/179/1 126/213/1 128/187/1 -f 114/175/5 117/177/5 127/203/5 125/214/5 -f 113/215/2 114/216/2 125/217/2 126/218/2 -f 116/178/1 115/180/1 122/186/1 120/219/1 -f 117/177/5 118/176/5 119/220/5 123/201/5 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst31.obj b/advtrains/advtrains/models/advtrains_dtrack_vst31.obj deleted file mode 100644 index c4cb84f..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst31.obj +++ /dev/null @@ -1,348 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst31_Cube.000 -v 0.753760 -0.500000 -0.500000 -v 0.753760 -0.500000 0.500000 -v 0.753760 -0.166667 0.500000 -v -0.753760 -0.500000 -0.500000 -v -0.753760 -0.500000 0.500000 -v -0.753760 -0.166667 0.500000 -v 0.329165 -0.308041 0.171599 -v 0.329165 -0.143980 0.171599 -v 0.329165 -0.422440 -0.171599 -v 0.329165 -0.258379 -0.171599 -v 0.462280 -0.308041 0.171599 -v 0.462280 -0.143980 0.171599 -v 0.462280 -0.422440 -0.171599 -v 0.462280 -0.258379 -0.171599 -v 0.412289 -0.126667 0.500000 -v 0.412289 -0.460000 -0.500000 -v 0.560528 -0.460000 -0.500000 -v 0.560528 -0.126667 0.500000 -v 0.474055 -0.106667 0.500000 -v 0.474055 -0.440000 -0.500000 -v 0.498762 -0.440000 -0.500000 -v 0.498762 -0.106667 0.500000 -v 0.474055 -0.056667 0.500000 -v 0.474055 -0.390000 -0.500000 -v 0.498762 -0.390000 -0.500000 -v 0.498762 -0.056667 0.500000 -v 0.529645 -0.385000 -0.500000 -v 0.529645 -0.051667 0.500000 -v 0.443172 -0.051667 0.500000 -v 0.443172 -0.385000 -0.500000 -v 0.529645 -0.360000 -0.500000 -v 0.529645 -0.026667 0.500000 -v 0.443172 -0.026667 0.500000 -v 0.443172 -0.360000 -0.500000 -v 0.741194 -0.198333 0.435000 -v -0.741194 -0.198333 0.435000 -v -0.741194 -0.238333 0.315000 -v 0.741194 -0.238333 0.315000 -v 0.741193 -0.148333 0.435000 -v -0.741194 -0.148333 0.435000 -v -0.741194 -0.188333 0.315000 -v 0.741194 -0.188333 0.315000 -v -0.011733 2.712519 0.500000 -v -0.011732 2.379186 -0.500001 -v -0.011733 2.734147 0.500000 -v -0.011732 2.400814 -0.500000 -v 0.011732 2.379186 -0.500000 -v 0.011732 2.712519 0.500000 -v 0.011732 2.400814 -0.500000 -v 0.011732 2.734148 0.500000 -v -0.412289 -0.460000 -0.500000 -v -0.412289 -0.126667 0.500000 -v -0.560528 -0.126667 0.500000 -v -0.560528 -0.460000 -0.500000 -v -0.474055 -0.440000 -0.500000 -v -0.474055 -0.106666 0.500000 -v -0.498762 -0.106667 0.500000 -v -0.498762 -0.440000 -0.500000 -v -0.474055 -0.390000 -0.500000 -v -0.474055 -0.056666 0.500000 -v -0.498762 -0.056667 0.500000 -v -0.498762 -0.390000 -0.500000 -v -0.529645 -0.051667 0.500000 -v -0.529645 -0.385000 -0.500000 -v -0.443172 -0.385000 -0.500000 -v -0.443172 -0.051666 0.500000 -v -0.529645 -0.026667 0.500000 -v -0.529645 -0.360000 -0.500000 -v -0.443172 -0.360000 -0.500000 -v -0.443172 -0.026666 0.500000 -v -0.741194 -0.488333 -0.435000 -v 0.741194 -0.488333 -0.435000 -v 0.741194 -0.448333 -0.315000 -v -0.741194 -0.448333 -0.315000 -v -0.741193 -0.438333 -0.435000 -v 0.741194 -0.438333 -0.435000 -v 0.741194 -0.398333 -0.315000 -v -0.741194 -0.398333 -0.315000 -v 0.741194 -0.280713 0.187862 -v -0.741194 -0.280713 0.187862 -v -0.741194 -0.320713 0.067862 -v 0.741194 -0.320713 0.067862 -v 0.741193 -0.230713 0.187862 -v -0.741194 -0.230713 0.187862 -v -0.741194 -0.270713 0.067862 -v 0.741194 -0.270713 0.067862 -v -0.741194 -0.405954 -0.187862 -v 0.741194 -0.405954 -0.187862 -v 0.741194 -0.365954 -0.067862 -v -0.741194 -0.365954 -0.067862 -v -0.741193 -0.355954 -0.187862 -v 0.741194 -0.355954 -0.187862 -v 0.741194 -0.315954 -0.067862 -v -0.741194 -0.315954 -0.067862 -v -0.329165 -0.308041 0.171599 -v -0.329165 -0.143980 0.171599 -v -0.329165 -0.422440 -0.171599 -v -0.329165 -0.258379 -0.171599 -v -0.462280 -0.308041 0.171599 -v -0.462280 -0.143980 0.171599 -v -0.462280 -0.422440 -0.171599 -v -0.462280 -0.258379 -0.171599 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 1.1949 -0.0470 -vt -0.3152 -0.0470 -vt -0.3152 -0.3809 -vt 1.1949 -0.3809 -vt -0.3120 1.0015 -vt -0.3120 -0.0002 -vt 1.1981 -0.0002 -vt 1.1981 1.0015 -vt 1.1949 1.0089 -vt 1.5117 0.0586 -vt -0.3152 1.0089 -vt -0.6320 0.0586 -vn -1.0000 0.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn -0.0000 0.0000 1.0000 -vn 0.0000 0.9487 -0.3162 -vn 1.0000 0.0000 0.0000 -vn -0.2936 0.9069 -0.3023 -vn 0.2936 0.9069 -0.3023 -vn 0.1518 -0.9377 0.3126 -vn -0.1518 -0.9377 0.3126 -vn 0.0000 -0.9487 0.3162 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst31_Cube.000_SlopeRailMaterial -s off -f 8/1/1 10/2/1 9/3/1 7/4/1 -f 10/2/2 14/5/2 13/6/2 9/7/2 -f 12/8/3 8/1/3 7/9/3 11/10/3 -f 12/8/4 14/5/4 10/2/4 8/1/4 -f 22/11/5 21/12/5 25/13/5 26/14/5 -f 15/15/6 19/16/6 20/17/6 16/18/6 -f 16/19/2 20/20/2 21/21/2 17/22/2 -f 17/23/7 21/12/7 22/11/7 18/24/7 -f 19/25/3 15/26/3 18/27/3 22/28/3 -f 26/29/3 23/30/3 19/25/3 22/28/3 -f 19/16/1 23/31/1 24/32/1 20/17/1 -f 21/21/2 20/20/2 24/33/2 25/34/2 -f 26/14/8 25/13/8 27/35/8 28/36/8 -f 24/32/9 23/31/9 29/37/9 30/38/9 -f 28/36/5 27/35/5 31/39/5 32/40/5 -f 30/38/1 29/37/1 33/41/1 34/42/1 -f 31/39/4 34/42/4 33/41/4 32/40/4 -f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 -f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 -f 39/47/4 42/48/4 41/49/4 40/50/4 -f 35/51/3 39/47/3 40/50/3 36/52/3 -f 36/53/1 40/50/1 41/49/1 37/54/1 -f 37/55/2 41/49/2 42/48/2 38/56/2 -f 39/47/5 35/57/5 38/58/5 42/48/5 -f 43/59/1 45/60/1 46/61/1 44/62/1 -f 47/63/5 49/64/5 50/65/5 48/66/5 -f 43/67/10 44/68/10 47/63/10 48/66/10 -f 45/60/4 50/65/4 49/64/4 46/61/4 -f 58/69/1 57/70/1 61/71/1 62/72/1 -f 51/73/7 55/74/7 56/75/7 52/76/7 -f 52/77/3 56/78/3 57/79/3 53/80/3 -f 53/81/6 57/70/6 58/69/6 54/82/6 -f 55/83/2 51/84/2 54/85/2 58/86/2 -f 62/87/2 59/88/2 55/83/2 58/86/2 -f 55/74/5 59/89/5 60/90/5 56/75/5 -f 57/79/3 56/78/3 60/91/3 61/92/3 -f 62/72/9 61/71/9 63/93/9 64/94/9 -f 60/90/8 59/89/8 65/95/8 66/96/8 -f 64/94/1 63/93/1 67/97/1 68/98/1 -f 66/96/5 65/95/5 69/99/5 70/100/5 -f 67/97/4 70/100/4 69/99/4 68/98/4 -f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 -f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 -f 75/105/4 78/106/4 77/107/4 76/108/4 -f 71/109/2 75/105/2 76/108/2 72/110/2 -f 72/111/5 76/108/5 77/107/5 73/112/5 -f 73/113/3 77/107/3 78/106/3 74/114/3 -f 75/105/1 71/115/1 74/116/1 78/106/1 -f 83/117/4 86/118/4 85/119/4 84/120/4 -f 79/121/3 83/117/3 84/120/3 80/122/3 -f 80/123/1 84/120/1 85/119/1 81/124/1 -f 81/125/2 85/119/2 86/118/2 82/126/2 -f 83/117/5 79/127/5 82/128/5 86/118/5 -f 91/129/4 94/130/4 93/131/4 92/132/4 -f 87/133/2 91/129/2 92/132/2 88/134/2 -f 88/135/5 92/132/5 93/131/5 89/136/5 -f 89/137/3 93/131/3 94/130/3 90/138/3 -f 91/129/1 87/139/1 90/140/1 94/130/1 -f 96/141/5 95/142/5 97/143/5 98/144/5 -f 98/144/2 97/145/2 101/146/2 102/147/2 -f 100/148/3 99/149/3 95/150/3 96/141/3 -f 100/148/4 96/141/4 98/144/4 102/147/4 -g dtrack_vst31_Cube.000_SlopeGravelMaterial -f 3/151/3 6/152/3 5/153/3 2/154/3 -f 1/155/11 2/156/11 5/157/11 4/158/11 -f 1/159/5 3/151/5 2/160/5 -f 6/152/1 4/161/1 5/162/1 -f 4/161/4 6/152/4 3/151/4 1/159/4 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst32.obj b/advtrains/advtrains/models/advtrains_dtrack_vst32.obj deleted file mode 100644 index 297d46b..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst32.obj +++ /dev/null @@ -1,372 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst32_Cube.028 -v 0.753760 -0.166667 -0.500000 -v 0.753760 -0.166667 0.500000 -v 0.753760 0.166667 0.500000 -v -0.753760 -0.166667 -0.500000 -v -0.753760 -0.166667 0.500000 -v -0.753760 0.166667 0.500000 -v 0.329165 0.025292 0.171599 -v 0.329165 0.189353 0.171599 -v 0.329165 -0.089107 -0.171599 -v 0.329165 0.074954 -0.171599 -v 0.462280 0.025292 0.171599 -v 0.462280 0.189353 0.171599 -v 0.462280 -0.089107 -0.171599 -v 0.462280 0.074954 -0.171599 -v 0.412289 0.206667 0.500000 -v 0.412289 -0.126667 -0.500000 -v 0.560528 -0.126667 -0.500000 -v 0.560528 0.206667 0.500000 -v 0.474055 0.226667 0.500000 -v 0.474055 -0.106667 -0.500000 -v 0.498762 -0.106667 -0.500000 -v 0.498762 0.226667 0.500000 -v 0.474055 0.276667 0.500000 -v 0.474055 -0.056667 -0.500000 -v 0.498762 -0.056667 -0.500000 -v 0.498762 0.276667 0.500000 -v 0.529645 -0.051667 -0.500000 -v 0.529645 0.281667 0.500000 -v 0.443172 0.281667 0.500000 -v 0.443172 -0.051667 -0.500000 -v 0.529645 -0.026667 -0.500000 -v 0.529645 0.306667 0.500000 -v 0.443172 0.306667 0.500000 -v 0.443172 -0.026667 -0.500000 -v 0.741194 0.135000 0.435000 -v -0.741194 0.135000 0.435000 -v -0.741194 0.095000 0.315000 -v 0.741194 0.095000 0.315000 -v 0.741193 0.185000 0.435000 -v -0.741194 0.185000 0.435000 -v -0.741194 0.145000 0.315000 -v 0.741194 0.145000 0.315000 -v -0.011733 3.045853 0.500000 -v -0.011732 2.712519 -0.500001 -v -0.011733 3.067481 0.500000 -v -0.011732 2.734147 -0.500000 -v 0.011732 2.712519 -0.500000 -v 0.011732 3.045853 0.500000 -v 0.011732 2.734147 -0.500000 -v 0.011732 3.067481 0.500000 -v -0.412289 -0.126667 -0.500000 -v -0.412289 0.206667 0.500000 -v -0.560528 0.206667 0.500000 -v -0.560528 -0.126667 -0.500000 -v -0.474055 -0.106667 -0.500000 -v -0.474055 0.226667 0.500000 -v -0.498762 0.226667 0.500000 -v -0.498762 -0.106667 -0.500000 -v -0.474055 -0.056667 -0.500000 -v -0.474055 0.276667 0.500000 -v -0.498762 0.276667 0.500000 -v -0.498762 -0.056667 -0.500000 -v -0.529645 0.281667 0.500000 -v -0.529645 -0.051667 -0.500000 -v -0.443172 -0.051667 -0.500000 -v -0.443172 0.281667 0.500000 -v -0.529645 0.306667 0.500000 -v -0.529645 -0.026667 -0.500000 -v -0.443172 -0.026667 -0.500000 -v -0.443172 0.306667 0.500000 -v -0.741194 -0.155000 -0.435000 -v 0.741194 -0.155000 -0.435000 -v 0.741194 -0.115000 -0.315000 -v -0.741194 -0.115000 -0.315000 -v -0.741193 -0.105000 -0.435000 -v 0.741194 -0.105000 -0.435000 -v 0.741194 -0.065000 -0.315000 -v -0.741194 -0.065000 -0.315000 -v 0.741194 0.052621 0.187862 -v -0.741194 0.052621 0.187862 -v -0.741194 0.012621 0.067862 -v 0.741194 0.012621 0.067862 -v 0.741193 0.102621 0.187862 -v -0.741194 0.102621 0.187862 -v -0.741194 0.062621 0.067862 -v 0.741194 0.062621 0.067862 -v -0.741194 -0.072621 -0.187862 -v 0.741194 -0.072621 -0.187862 -v 0.741194 -0.032621 -0.067862 -v -0.741194 -0.032621 -0.067862 -v -0.741193 -0.022621 -0.187862 -v 0.741194 -0.022621 -0.187862 -v 0.741194 0.017379 -0.067862 -v -0.741194 0.017379 -0.067862 -v -0.329165 0.025293 0.171599 -v -0.329165 0.189353 0.171599 -v -0.329165 -0.089107 -0.171599 -v -0.329165 0.074954 -0.171599 -v -0.462280 0.025293 0.171599 -v -0.462280 0.189353 0.171599 -v -0.462280 -0.089107 -0.171599 -v -0.462280 0.074954 -0.171599 -v 0.753760 -0.500000 0.500000 -v 0.753760 -0.500000 -0.500000 -v -0.753760 -0.500000 0.500000 -v -0.753760 -0.500000 -0.500000 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 1.2169 -0.0660 -vt -0.3162 -0.0660 -vt -0.3162 -0.4050 -vt 1.2169 -0.4050 -vt -0.3102 0.3256 -vt 1.2229 0.3256 -vt 1.2229 0.6646 -vt -0.3102 0.6646 -vt 1.2169 1.0060 -vt 1.5385 0.0412 -vt -0.3162 1.0060 -vt -0.6378 0.0412 -vt -0.3132 1.0050 -vt -0.3132 -0.0119 -vt 1.2199 -0.0119 -vt 1.2199 1.0050 -vt -0.3075 0.6587 -vt 0.7095 0.6587 -vt 0.7095 0.9977 -vt -0.3075 0.9977 -vt 1.2229 1.0022 -vt -0.3102 1.0022 -vt -0.3102 0.6632 -vt 1.2229 0.6632 -vt 0.7067 0.6635 -vt -0.3102 0.6635 -vt -0.3102 0.3245 -vt 0.7067 0.3245 -vn -1.0000 0.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn -0.0000 0.0000 1.0000 -vn 0.0000 0.9487 -0.3162 -vn 1.0000 0.0000 0.0000 -vn -0.2936 0.9069 -0.3023 -vn 0.2936 0.9069 -0.3023 -vn 0.1518 -0.9377 0.3126 -vn -0.1518 -0.9377 0.3126 -vn 0.0000 -0.9487 0.3162 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst32_Cube.028_SlopeRailMaterial -s off -f 8/1/1 10/2/1 9/3/1 7/4/1 -f 10/2/2 14/5/2 13/6/2 9/7/2 -f 12/8/3 8/1/3 7/9/3 11/10/3 -f 12/8/4 14/5/4 10/2/4 8/1/4 -f 22/11/5 21/12/5 25/13/5 26/14/5 -f 15/15/6 19/16/6 20/17/6 16/18/6 -f 16/19/2 20/20/2 21/21/2 17/22/2 -f 17/23/7 21/12/7 22/11/7 18/24/7 -f 19/25/3 15/26/3 18/27/3 22/28/3 -f 26/29/3 23/30/3 19/25/3 22/28/3 -f 19/16/1 23/31/1 24/32/1 20/17/1 -f 21/21/2 20/20/2 24/33/2 25/34/2 -f 26/14/8 25/13/8 27/35/8 28/36/8 -f 24/32/9 23/31/9 29/37/9 30/38/9 -f 28/36/5 27/35/5 31/39/5 32/40/5 -f 30/38/1 29/37/1 33/41/1 34/42/1 -f 31/39/4 34/42/4 33/41/4 32/40/4 -f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 -f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 -f 39/47/4 42/48/4 41/49/4 40/50/4 -f 35/51/3 39/47/3 40/50/3 36/52/3 -f 36/53/1 40/50/1 41/49/1 37/54/1 -f 37/55/2 41/49/2 42/48/2 38/56/2 -f 39/47/5 35/57/5 38/58/5 42/48/5 -f 43/59/1 45/60/1 46/61/1 44/62/1 -f 47/63/5 49/64/5 50/65/5 48/66/5 -f 43/67/10 44/68/10 47/63/10 48/66/10 -f 45/60/4 50/65/4 49/64/4 46/61/4 -f 58/69/1 57/70/1 61/71/1 62/72/1 -f 51/73/7 55/74/7 56/75/7 52/76/7 -f 52/77/3 56/78/3 57/79/3 53/80/3 -f 53/81/6 57/70/6 58/69/6 54/82/6 -f 55/83/2 51/84/2 54/85/2 58/86/2 -f 62/87/2 59/88/2 55/83/2 58/86/2 -f 55/74/5 59/89/5 60/90/5 56/75/5 -f 57/79/3 56/78/3 60/91/3 61/92/3 -f 62/72/9 61/71/9 63/93/9 64/94/9 -f 60/90/8 59/89/8 65/95/8 66/96/8 -f 64/94/1 63/93/1 67/97/1 68/98/1 -f 66/96/5 65/95/5 69/99/5 70/100/5 -f 67/97/4 70/100/4 69/99/4 68/98/4 -f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 -f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 -f 75/105/4 78/106/4 77/107/4 76/108/4 -f 71/109/2 75/105/2 76/108/2 72/110/2 -f 72/111/5 76/108/5 77/107/5 73/112/5 -f 73/113/3 77/107/3 78/106/3 74/114/3 -f 75/105/1 71/115/1 74/116/1 78/106/1 -f 83/117/4 86/118/4 85/119/4 84/120/4 -f 79/121/3 83/117/3 84/120/3 80/122/3 -f 80/123/1 84/120/1 85/119/1 81/124/1 -f 81/125/2 85/119/2 86/118/2 82/126/2 -f 83/117/5 79/127/5 82/128/5 86/118/5 -f 91/129/4 94/130/4 93/131/4 92/132/4 -f 87/133/2 91/129/2 92/132/2 88/134/2 -f 88/135/5 92/132/5 93/131/5 89/136/5 -f 89/137/3 93/131/3 94/130/3 90/138/3 -f 91/129/1 87/139/1 90/140/1 94/130/1 -f 96/141/5 95/142/5 97/143/5 98/144/5 -f 98/144/2 97/145/2 101/146/2 102/147/2 -f 100/148/3 99/149/3 95/150/3 96/141/3 -f 100/148/4 96/141/4 98/144/4 102/147/4 -g dtrack_vst32_Cube.028_SlopeGravelMaterial -f 3/151/3 6/152/3 5/153/3 2/154/3 -f 4/155/2 1/156/2 104/157/2 106/158/2 -f 1/159/5 3/151/5 2/160/5 -f 6/152/1 4/161/1 5/162/1 -f 4/161/4 6/152/4 3/151/4 1/159/4 -f 104/163/11 103/164/11 105/165/11 106/166/11 -f 5/167/1 4/168/1 106/169/1 105/170/1 -f 2/171/3 5/172/3 105/173/3 103/174/3 -f 1/175/5 2/176/5 103/177/5 104/178/5 diff --git a/advtrains/advtrains/models/advtrains_dtrack_vst33.obj b/advtrains/advtrains/models/advtrains_dtrack_vst33.obj deleted file mode 100644 index 8cb5f04..0000000 --- a/advtrains/advtrains/models/advtrains_dtrack_vst33.obj +++ /dev/null @@ -1,388 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' -# www.blender.org -o dtrack_vst33_Cube.030 -v 0.753760 0.166667 -0.500000 -v 0.753760 0.166667 0.500000 -v 0.753760 0.500000 0.500000 -v -0.753760 0.166667 -0.500000 -v -0.753760 0.166667 0.500000 -v -0.753760 0.500000 0.500000 -v 0.329165 0.358626 0.171599 -v 0.329165 0.522686 0.171599 -v 0.329165 0.244227 -0.171599 -v 0.329165 0.408287 -0.171599 -v 0.462280 0.358626 0.171599 -v 0.462280 0.522686 0.171599 -v 0.462280 0.244227 -0.171599 -v 0.462280 0.408287 -0.171599 -v 0.412289 0.540000 0.500000 -v 0.412289 0.206667 -0.500000 -v 0.560528 0.206667 -0.500000 -v 0.560528 0.540000 0.500000 -v 0.474055 0.560000 0.500000 -v 0.474055 0.226667 -0.500000 -v 0.498762 0.226667 -0.500000 -v 0.498762 0.560000 0.500000 -v 0.474055 0.610000 0.500000 -v 0.474055 0.276667 -0.500000 -v 0.498762 0.276667 -0.500000 -v 0.498762 0.610000 0.500000 -v 0.529645 0.281667 -0.500000 -v 0.529645 0.615000 0.500000 -v 0.443172 0.615000 0.500000 -v 0.443172 0.281667 -0.500000 -v 0.529645 0.306667 -0.500000 -v 0.529645 0.640000 0.500000 -v 0.443172 0.640000 0.500000 -v 0.443172 0.306667 -0.500000 -v 0.741194 0.468333 0.435000 -v -0.741194 0.468333 0.435000 -v -0.741194 0.428333 0.315000 -v 0.741194 0.428333 0.315000 -v 0.741193 0.518333 0.435000 -v -0.741194 0.518333 0.435000 -v -0.741194 0.478333 0.315000 -v 0.741194 0.478333 0.315000 -v -0.011733 3.379186 0.500000 -v -0.011732 3.045852 -0.500001 -v -0.011733 3.400814 0.500000 -v -0.011732 3.067481 -0.500000 -v 0.011732 3.045853 -0.500000 -v 0.011732 3.379186 0.500000 -v 0.011732 3.067481 -0.500000 -v 0.011732 3.400814 0.500000 -v -0.412289 0.206667 -0.500000 -v -0.412289 0.540000 0.500000 -v -0.560528 0.540000 0.500000 -v -0.560528 0.206667 -0.500000 -v -0.474055 0.226667 -0.500000 -v -0.474055 0.560000 0.500000 -v -0.498762 0.560000 0.500000 -v -0.498762 0.226667 -0.500000 -v -0.474055 0.276667 -0.500000 -v -0.474055 0.610000 0.500000 -v -0.498762 0.610000 0.500000 -v -0.498762 0.276667 -0.500000 -v -0.529645 0.615000 0.500000 -v -0.529645 0.281667 -0.500000 -v -0.443172 0.281667 -0.500000 -v -0.443172 0.615000 0.500000 -v -0.529645 0.640000 0.500000 -v -0.529645 0.306667 -0.500000 -v -0.443172 0.306667 -0.500000 -v -0.443172 0.640000 0.500000 -v -0.741194 0.178333 -0.435000 -v 0.741194 0.178333 -0.435000 -v 0.741194 0.218333 -0.315000 -v -0.741194 0.218333 -0.315000 -v -0.741193 0.228333 -0.435000 -v 0.741194 0.228333 -0.435000 -v 0.741194 0.268333 -0.315000 -v -0.741194 0.268333 -0.315000 -v 0.741194 0.385954 0.187862 -v -0.741194 0.385954 0.187862 -v -0.741194 0.345954 0.067862 -v 0.741194 0.345954 0.067862 -v 0.741193 0.435954 0.187862 -v -0.741194 0.435954 0.187862 -v -0.741194 0.395954 0.067862 -v 0.741194 0.395954 0.067862 -v -0.741194 0.260713 -0.187862 -v 0.741194 0.260713 -0.187862 -v 0.741194 0.300713 -0.067862 -v -0.741194 0.300713 -0.067862 -v -0.741193 0.310713 -0.187862 -v 0.741194 0.310713 -0.187862 -v 0.741194 0.350713 -0.067862 -v -0.741194 0.350713 -0.067862 -v -0.329165 0.358626 0.171599 -v -0.329165 0.522687 0.171599 -v -0.329165 0.244227 -0.171599 -v -0.329165 0.408287 -0.171599 -v -0.462280 0.358626 0.171599 -v -0.462280 0.522686 0.171599 -v -0.462280 0.244227 -0.171599 -v -0.462280 0.408287 -0.171599 -v 0.753760 -0.166667 0.500000 -v 0.753760 -0.166667 -0.500000 -v -0.753760 -0.166667 0.500000 -v -0.753760 -0.166667 -0.500000 -v 0.753760 -0.500000 0.500000 -v 0.753760 -0.500000 -0.500000 -v -0.753760 -0.500000 0.500000 -v -0.753760 -0.500000 -0.500000 -vt 0.7427 0.1169 -vt 0.7427 0.3317 -vt 0.6400 0.3317 -vt 0.6400 0.1169 -vt 0.8260 0.3317 -vt 0.8260 0.4343 -vt 0.7427 0.4343 -vt 0.8260 0.1169 -vt 0.7427 0.0142 -vt 0.8260 0.0142 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.6554 0.3627 -vt 0.6690 0.3627 -vt 0.6690 0.9885 -vt 0.6554 0.9885 -vt 0.6972 0.9885 -vt 0.6837 0.9885 -vt 0.6837 0.3627 -vt 0.6972 0.3627 -vt 0.7119 0.3627 -vt 0.7119 0.9885 -vt 0.5691 0.2971 -vt 0.5691 0.9229 -vt 0.5378 0.9229 -vt 0.5378 0.2971 -vt 0.3413 0.2971 -vt 0.3819 0.2971 -vt 0.3819 0.9229 -vt 0.3413 0.9229 -vt 0.4291 0.9855 -vt 0.4678 0.9730 -vt 0.4833 0.9730 -vt 0.5219 0.9855 -vt 0.6097 0.9229 -vt 0.6097 0.2971 -vt 0.4678 0.2470 -vt 0.4291 0.2345 -vt 0.5219 0.2345 -vt 0.4833 0.2470 -vt 0.4833 0.2783 -vt 0.4678 0.2783 -vt 0.4132 0.2971 -vt 0.4132 0.9229 -vt 0.4678 0.9417 -vt 0.4833 0.9417 -vt 0.5182 0.9229 -vt 0.5182 0.2971 -vt 0.4328 0.2971 -vt 0.4328 0.9229 -vt 0.5026 0.9229 -vt 0.5026 0.2971 -vt 0.4485 0.2971 -vt 0.4485 0.9229 -vt 0.5026 0.2814 -vt 0.4485 0.2814 -vt 0.4485 0.9386 -vt 0.5026 0.9386 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.9588 0.9625 -vt 0.8837 0.9625 -vt 0.8837 0.0348 -vt 0.9588 0.0348 -vt 0.9901 0.9625 -vt 0.9901 0.0348 -vt 0.9588 0.0035 -vt 0.8837 0.0035 -vt 0.8524 0.0348 -vt 0.8524 0.9625 -vt 0.9588 0.9938 -vt 0.8837 0.9938 -vt 0.7427 0.1169 -vt 0.6400 0.1169 -vt 0.6400 0.3317 -vt 0.7427 0.3317 -vt 0.7427 0.4343 -vt 0.8260 0.4343 -vt 0.8260 0.3317 -vt 0.8260 0.1169 -vt 0.8260 0.0142 -vt 0.7427 0.0142 -vt 1.2190 -0.0648 -vt -0.3252 -0.0648 -vt -0.3252 -0.4063 -vt 1.2190 -0.4063 -vt 1.2222 1.0112 -vt -0.3220 1.0112 -vt -0.3220 0.6697 -vt 1.2222 0.6697 -vt 1.2190 1.0149 -vt 1.5430 0.0432 -vt -0.3252 1.0149 -vt -0.6491 0.0432 -vt -0.3220 0.3283 -vt 1.2222 0.3283 -vt -0.3240 0.3223 -vt 0.7003 0.3223 -vt 0.7003 0.6637 -vt -0.3240 0.6637 -vt 1.2202 1.0043 -vt -0.3240 1.0043 -vt -0.3240 0.6629 -vt 1.2202 0.6629 -vt 0.6998 1.0039 -vt -0.3245 1.0039 -vt -0.3245 0.6625 -vt 0.6998 0.6625 -vt -0.3246 1.0127 -vt -0.3246 -0.0117 -vt 1.2196 -0.0117 -vt 1.2196 1.0127 -vt 0.7003 1.0051 -vt -0.3240 1.0051 -vt -0.3240 0.3214 -vt 1.2202 0.3214 -vt -0.3245 0.3210 -vt 0.6998 0.3210 -vn -1.0000 0.0000 -0.0000 -vn 0.0000 0.0000 -1.0000 -vn -0.0000 0.0000 1.0000 -vn 0.0000 0.9487 -0.3162 -vn 1.0000 0.0000 0.0000 -vn -0.2936 0.9069 -0.3023 -vn 0.2936 0.9069 -0.3023 -vn 0.1518 -0.9377 0.3126 -vn -0.1518 -0.9377 0.3126 -vn 0.0000 -0.9487 0.3162 -vn 0.0000 -1.0000 0.0000 -g dtrack_vst33_Cube.030_SlopeRailMaterial -s off -f 8/1/1 10/2/1 9/3/1 7/4/1 -f 10/2/2 14/5/2 13/6/2 9/7/2 -f 12/8/3 8/1/3 7/9/3 11/10/3 -f 12/8/4 14/5/4 10/2/4 8/1/4 -f 22/11/5 21/12/5 25/13/5 26/14/5 -f 15/15/6 19/16/6 20/17/6 16/18/6 -f 16/19/2 20/20/2 21/21/2 17/22/2 -f 17/23/7 21/12/7 22/11/7 18/24/7 -f 19/25/3 15/26/3 18/27/3 22/28/3 -f 26/29/3 23/30/3 19/25/3 22/28/3 -f 19/16/1 23/31/1 24/32/1 20/17/1 -f 21/21/2 20/20/2 24/33/2 25/34/2 -f 26/14/8 25/13/8 27/35/8 28/36/8 -f 24/32/9 23/31/9 29/37/9 30/38/9 -f 28/36/5 27/35/5 31/39/5 32/40/5 -f 30/38/1 29/37/1 33/41/1 34/42/1 -f 31/39/4 34/42/4 33/41/4 32/40/4 -f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 -f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 -f 39/47/4 42/48/4 41/49/4 40/50/4 -f 35/51/3 39/47/3 40/50/3 36/52/3 -f 36/53/1 40/50/1 41/49/1 37/54/1 -f 37/55/2 41/49/2 42/48/2 38/56/2 -f 39/47/5 35/57/5 38/58/5 42/48/5 -f 43/59/1 45/60/1 46/61/1 44/62/1 -f 47/63/5 49/64/5 50/65/5 48/66/5 -f 43/67/10 44/68/10 47/63/10 48/66/10 -f 45/60/4 50/65/4 49/64/4 46/61/4 -f 58/69/1 57/70/1 61/71/1 62/72/1 -f 51/73/7 55/74/7 56/75/7 52/76/7 -f 52/77/3 56/78/3 57/79/3 53/80/3 -f 53/81/6 57/70/6 58/69/6 54/82/6 -f 55/83/2 51/84/2 54/85/2 58/86/2 -f 62/87/2 59/88/2 55/83/2 58/86/2 -f 55/74/5 59/89/5 60/90/5 56/75/5 -f 57/79/3 56/78/3 60/91/3 61/92/3 -f 62/72/9 61/71/9 63/93/9 64/94/9 -f 60/90/8 59/89/8 65/95/8 66/96/8 -f 64/94/1 63/93/1 67/97/1 68/98/1 -f 66/96/5 65/95/5 69/99/5 70/100/5 -f 67/97/4 70/100/4 69/99/4 68/98/4 -f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 -f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 -f 75/105/4 78/106/4 77/107/4 76/108/4 -f 71/109/2 75/105/2 76/108/2 72/110/2 -f 72/111/5 76/108/5 77/107/5 73/112/5 -f 73/113/3 77/107/3 78/106/3 74/114/3 -f 75/105/1 71/115/1 74/116/1 78/106/1 -f 83/117/4 86/118/4 85/119/4 84/120/4 -f 79/121/3 83/117/3 84/120/3 80/122/3 -f 80/123/1 84/120/1 85/119/1 81/124/1 -f 81/125/2 85/119/2 86/118/2 82/126/2 -f 83/117/5 79/127/5 82/128/5 86/118/5 -f 91/129/4 94/130/4 93/131/4 92/132/4 -f 87/133/2 91/129/2 92/132/2 88/134/2 -f 88/135/5 92/132/5 93/131/5 89/136/5 -f 89/137/3 93/131/3 94/130/3 90/138/3 -f 91/129/1 87/139/1 90/140/1 94/130/1 -f 96/141/5 95/142/5 97/143/5 98/144/5 -f 98/144/2 97/145/2 101/146/2 102/147/2 -f 100/148/3 99/149/3 95/150/3 96/141/3 -f 100/148/4 96/141/4 98/144/4 102/147/4 -g dtrack_vst33_Cube.030_SlopeGravelMaterial -f 3/151/3 6/152/3 5/153/3 2/154/3 -f 4/155/2 1/156/2 104/157/2 106/158/2 -f 1/159/5 3/151/5 2/160/5 -f 6/152/1 4/161/1 5/162/1 -f 4/161/4 6/152/4 3/151/4 1/159/4 -f 106/158/2 104/157/2 108/163/2 110/164/2 -f 5/165/1 4/166/1 106/167/1 105/168/1 -f 2/169/3 5/170/3 105/171/3 103/172/3 -f 1/173/5 2/174/5 103/175/5 104/176/5 -f 108/177/11 107/178/11 109/179/11 110/180/11 -f 105/168/1 106/167/1 110/181/1 109/182/1 -f 103/172/3 105/171/3 109/183/3 107/184/3 -f 104/176/5 103/175/5 107/185/5 108/186/5 diff --git a/advtrains/advtrains/models/advtrains_modernwagon.b3d b/advtrains/advtrains/models/advtrains_modernwagon.b3d deleted file mode 100644 index aacddca..0000000 Binary files a/advtrains/advtrains/models/advtrains_modernwagon.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off.b3d deleted file mode 100644 index 3d231dd..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_off.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d deleted file mode 100644 index da258e1..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_off_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d deleted file mode 100644 index 338224a..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_off_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d b/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d deleted file mode 100644 index c560ca1..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_off_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on.b3d deleted file mode 100644 index 3d19439..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_on.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d deleted file mode 100644 index 98f8a92..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_on_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d deleted file mode 100644 index 414e121..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_on_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d b/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d deleted file mode 100644 index a51529a..0000000 Binary files a/advtrains/advtrains/models/advtrains_retrosignal_on_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal.b3d b/advtrains/advtrains/models/advtrains_signal.b3d deleted file mode 100644 index 7f69560..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_30.b3d b/advtrains/advtrains/models/advtrains_signal_30.b3d deleted file mode 100644 index 0b949a7..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_30.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_45.b3d b/advtrains/advtrains/models/advtrains_signal_45.b3d deleted file mode 100644 index ccaebf4..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_60.b3d b/advtrains/advtrains/models/advtrains_signal_60.b3d deleted file mode 100644 index cf41e6d..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_60.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_wall_l.b3d b/advtrains/advtrains/models/advtrains_signal_wall_l.b3d deleted file mode 100644 index b1bcbcf..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_wall_l.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_wall_r.b3d b/advtrains/advtrains/models/advtrains_signal_wall_r.b3d deleted file mode 100644 index cf26389..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_wall_r.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_signal_wall_t.b3d b/advtrains/advtrains/models/advtrains_signal_wall_t.b3d deleted file mode 100644 index 30e77f6..0000000 Binary files a/advtrains/advtrains/models/advtrains_signal_wall_t.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_track_cr.b3d b/advtrains/advtrains/models/advtrains_track_cr.b3d deleted file mode 100644 index b0f5e4b..0000000 Binary files a/advtrains/advtrains/models/advtrains_track_cr.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_track_st.b3d b/advtrains/advtrains/models/advtrains_track_st.b3d deleted file mode 100644 index 10b5d90..0000000 Binary files a/advtrains/advtrains/models/advtrains_track_st.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/advtrains_track_st_45.b3d b/advtrains/advtrains/models/advtrains_track_st_45.b3d deleted file mode 100644 index 32505a1..0000000 Binary files a/advtrains/advtrains/models/advtrains_track_st_45.b3d and /dev/null differ diff --git a/advtrains/advtrains/models/trackplane.b3d b/advtrains/advtrains/models/trackplane.b3d deleted file mode 100644 index b4728c3..0000000 Binary files a/advtrains/advtrains/models/trackplane.b3d and /dev/null differ diff --git a/advtrains/advtrains/nodedb.lua b/advtrains/advtrains/nodedb.lua deleted file mode 100644 index 862fd53..0000000 --- a/advtrains/advtrains/nodedb.lua +++ /dev/null @@ -1,307 +0,0 @@ ---nodedb.lua ---database of all nodes that have 'save_in_nodedb' field set to true in node definition - - ---serialization format: ---(2byte z) (2byte y) (2byte x) (2byte contentid) ---contentid := (14bit nodeid, 2bit param2) - -local function int_to_bytes(i) - local x=i+32768--clip to positive integers - local cH = math.floor(x / 256) % 256; - local cL = math.floor(x ) % 256; - return(string.char(cH, cL)); -end -local function bytes_to_int(bytes) - local t={string.byte(bytes,1,-1)} - local n = - t[1] * 256 + - t[2] - return n-32768 -end -local function l2b(x) - return x%4 -end -local function u14b(x) - return math.floor(x/4) -end -local ndb={} - ---local variables for performance -local ndb_nodeids={} -local ndb_nodes={} - -local function ndbget(x,y,z) - local ny=ndb_nodes[y] - if ny then - local nx=ny[x] - if nx then - return nx[z] - end - end - return nil -end -local function ndbset(x,y,z,v) - if not ndb_nodes[y] then - ndb_nodes[y]={} - end - if not ndb_nodes[y][x] then - ndb_nodes[y][x]={} - end - ndb_nodes[y][x][z]=v -end - - -local path=minetest.get_worldpath().."/advtrains_ndb2" ---load ---nodeids get loaded by advtrains init.lua and passed here -function ndb.load_data(data) - ndb_nodeids = data and data.nodeids or {} - local file, err = io.open(path, "r") - if not file then - atwarn("Couldn't load the node database: ", err or "Unknown Error") - else - local cnt=0 - local hst_z=file:read(2) - local hst_y=file:read(2) - local hst_x=file:read(2) - local cid=file:read(2) - while hst_z and hst_y and hst_x and cid and #hst_z==2 and #hst_y==2 and #hst_x==2 and #cid==2 do - ndbset(bytes_to_int(hst_x), bytes_to_int(hst_y), bytes_to_int(hst_z), bytes_to_int(cid)) - cnt=cnt+1 - hst_z=file:read(2) - hst_y=file:read(2) - hst_x=file:read(2) - cid=file:read(2) - end - atlog("nodedb: read", cnt, "nodes.") - file:close() - end -end - ---save -function ndb.save_data() - local file, err = io.open(path, "w") - if not file then - atwarn("Couldn't save the node database: ", err or "Unknown Error") - else - for y, ny in pairs(ndb_nodes) do - for x, nx in pairs(ny) do - for z, cid in pairs(nx) do - file:write(int_to_bytes(z)) - file:write(int_to_bytes(y)) - file:write(int_to_bytes(x)) - file:write(int_to_bytes(cid)) - end - end - end - file:close() - end - return {nodeids = ndb_nodeids} -end - ---function to get node. track database is not helpful here. -function ndb.get_node_or_nil(pos) - local node=minetest.get_node_or_nil(pos) - if node then - return node - else - --maybe we have the node in the database... - return ndb.get_node_raw(pos) - end - atprint("ndb.get_node_or_nil",pos,"not found") -end -function ndb.get_node(pos) - local n=ndb.get_node_or_nil(pos) - if not n then - return {name="ignore", param2=0} - end - return n -end -function ndb.get_node_raw(pos) - local cid=ndbget(pos.x, pos.y, pos.z) - if cid then - local nodeid = ndb_nodeids[u14b(cid)] - if nodeid then - return {name=nodeid, param2 = l2b(cid)} - end - end - return nil -end - - -function ndb.swap_node(pos, node) - minetest.swap_node(pos, node) - ndb.update(pos, node) -end - -function ndb.update(pos, pnode) - local node = pnode or minetest.get_node_or_nil(pos) - if not node or node.name=="ignore" then return end - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].groups.save_in_nodedb then - local nid - for tnid, nname in pairs(ndb_nodeids) do - if nname==node.name then - nid=tnid - end - end - if not nid then - nid=#ndb_nodeids+1 - ndb_nodeids[nid]=node.name - end - ndbset(pos.x, pos.y, pos.z, (nid * 4) + (l2b(node.param2 or 0)) ) - --atprint("nodedb: updating node", pos, "stored nid",nid,"assigned",ndb_nodeids[nid],"resulting cid",ndb_nodes[hash]) - else - --at this position there is no longer a node that needs to be tracked. - ndbset(pos.x, pos.y, pos.z, nil) - end -end - -function ndb.clear(pos) - ndbset(pos.x, pos.y, pos.z, nil) -end - - ---get_node with pseudoload. now we only need track data, so we can use the trackdb as second fallback ---nothing new will be saved inside the trackdb. ---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 rdp=advtrains.round_vector_floor_y(pos) - - local node=ndb.get_node_or_nil(rdp) - - --still no node? - --advtrains.trackdb is nil when there's no data available. - if not node then - if advtrains.trackdb then - --try raildb (see trackdb_legacy.lua) - local dbe=(advtrains.trackdb[rdp.y] and advtrains.trackdb[rdp.y][rdp.x] and advtrains.trackdb[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 - end - end - return nil - 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) - - return true, conn1, conn2, rely1, rely2, railheight -end - -ndb.run_lbm = function(pos, node) - return advtrains.pcall(function() - local cid=ndbget(pos.x, pos.y, pos.z) - if cid then - --if in database, detect changes and apply. - local nodeid = ndb_nodeids[u14b(cid)] - local param2 = l2b(cid) - if not nodeid then - --something went wrong - atwarn("Node Database corruption, couldn't determine node to set at", pos) - ndb.update(pos, node) - else - if (nodeid~=node.name or param2~=node.param2) then - atprint("nodedb: lbm replaced", pos, "with nodeid", nodeid, "param2", param2, "cid is", cid) - minetest.swap_node(pos, {name=nodeid, param2 = param2}) - local ndef=minetest.registered_nodes[nodeid] - if ndef and ndef.on_updated_from_nodedb then - ndef.on_updated_from_nodedb(pos, node) - end - return true - end - end - else - --if not in database, take it. - atlog("Node Database:", pos, "was not found in the database, have you used worldedit?") - ndb.update(pos, node) - end - return false - end) -end - - -minetest.register_lbm({ - name = "advtrains:nodedb_on_load_update", - nodenames = {"group:save_in_nodedb"}, - run_at_every_load = true, - run_on_every_load = true, - action = ndb.run_lbm, - interval=30, - chance=1, - }) - ---used when restoring stuff after a crash -ndb.restore_all = function() - atwarn("Updating the map from the nodedb, this may take a while") - local cnt=0 - for y, ny in pairs(ndb_nodes) do - for x, nx in pairs(ny) do - for z, _ in pairs(nx) do - local pos={x=x, y=y, z=z} - local node=minetest.get_node_or_nil(pos) - if node then - local ori_ndef=minetest.registered_nodes[node.name] - local ndbnode=ndb.get_node_raw(pos) - if ori_ndef and ori_ndef.groups.save_in_nodedb then --check if this node has been worldedited, and don't replace then - if (ndbnode.name~=node.name or ndbnode.param2~=node.param2) then - minetest.swap_node(pos, ndbnode) - atwarn("Replaced",node.name,"@",pos,"with",ndbnode.name) - end - else - ndb.clear(pos) - atwarn("Found ghost node (former",ndbnode.name,") @",pos,"deleting") - end - end - end - end - end - atwarn("Updated",cnt,"nodes") -end - -minetest.register_on_dignode(function(pos, oldnode, digger) - return advtrains.pcall(function() - ndb.clear(pos) - end) -end) - -function ndb.get_nodes() - return ndb_nodes -end -function ndb.get_nodeids() - return ndb_nodeids -end - - -advtrains.ndb=ndb - -local ptime=0 - -minetest.register_chatcommand("at_sync_ndb", - { - params = "", -- Short parameter description - description = "Write node db back to map and find ghost nodes", -- Full description - privs = {train_operator=true, worldedit=true}, -- Require the "privs" privilege to run - func = function(name, param) - return advtrains.pcall(function() - if not minetest.check_player_privs(name, {server=true}) and os.time() < ptime+30 then - return false, "Please wait at least 30s from the previous execution of /at_restore_ndb!" - end - ndb.restore_all() - ptime=os.time() - return true - end) - end, - privs = {train_operator=true}, -- Require the "privs" privilege to run - }) - diff --git a/advtrains/advtrains/settingtypes.txt b/advtrains/advtrains/settingtypes.txt deleted file mode 100644 index 60f8477..0000000 --- a/advtrains/advtrains/settingtypes.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Disable the train collision behavior. Trains will never collide and just drive through each other. -# Note that this makes coupling trains impossible, and introduces 'interesting' behavior with detector and ATC rails. -# Also, it is very hard to separate two subway trains that are stuck inside each other, since it can be impossible to access the driver seat. -advtrains_disable_collisions (Disable train collisions) bool false -# Enable the debug ring buffer -# This has no effect on the user experience, except decreased performance. Debug outputs are saved in a ring buffer to be printed when an error occurs. -# You probably want to leave this setting set to false. -advtrains_enable_debugging (Enable debugging) bool false \ No newline at end of file diff --git a/advtrains/advtrains/signals.lua b/advtrains/advtrains/signals.lua deleted file mode 100644 index 5c6e484..0000000 --- a/advtrains/advtrains/signals.lua +++ /dev/null @@ -1,227 +0,0 @@ ---advtrains by orwell96 ---signals.lua - ---this code /should/ work but does not. -local mrules_wallsignal = advtrains.meseconrules - -for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", als="green"}}) 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=attrans("Lampless Signal (@1)", attrans(r..rotation)), - sunlight_propagates=true, - groups = { - cracky=3, - not_blocking_trains=1, - not_in_creative_inventory=crea, - save_in_nodedb=1, - }, - mesecons = {effector = { - rules=advtrains.meseconrules, - ["action_"..f.as] = function (pos, node) - advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}) - end - }}, - on_rightclick=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}) - end - 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=attrans("Signal (@1)", attrans(r..rotation)), - groups = { - cracky=3, - not_blocking_trains=1, - not_in_creative_inventory=crea, - save_in_nodedb=1, - }, - light_source = 1, - sunlight_propagates=true, - mesecons = {effector = { - rules=advtrains.meseconrules, - ["action_"..f.as] = function (pos, node) - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) - end - }}, - luaautomation = { - getstate = f.ls, - setstate = function(pos, node, newstate) - if newstate == f.als then - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) - end - end, - }, - on_rightclick=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) - end - end, - }) - advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil) - end - - local crea=1 - if r=="off" then crea=0 end - - --tunnel signals. no rotations. - for loc, sbox in pairs({l={-1/2, -1/2, -1/4, 0, 1/2, 1/4}, r={0, -1/2, -1/4, 1/2, 1/2, 1/4}, t={-1/2, 0, -1/4, 1/2, 1/2, 1/4}}) do - minetest.register_node("advtrains:signal_wall_"..loc.."_"..r, { - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = sbox, - }, - mesh = "advtrains_signal_wall_"..loc..".b3d", - tiles = {"advtrains_signal_wall_"..r..".png"}, - drop="advtrains:signal_wall_"..loc.."_off", - description=attrans("Wallmounted Signal ("..loc..")"), - groups = { - cracky=3, - not_blocking_trains=1, - not_in_creative_inventory=crea, - save_in_nodedb=1, - }, - light_source = 1, - sunlight_propagates=true, - mesecons = {effector = { - rules = mrules_wallsignal, - ["action_"..f.as] = function (pos, node) - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) - end - }}, - luaautomation = { - getstate = f.ls, - setstate = function(pos, node, newstate) - if newstate == f.als then - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) - end - end, - }, - on_rightclick=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) - end - end, - }) - end -end - --- level crossing --- german version (Andrew's Cross) -minetest.register_node("advtrains:across_off", { - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/4, -1/2, -1/2, 1/4, 1.5, 0}, - }, - mesh = "advtrains_across.obj", - tiles = {"advtrains_across.png"}, - drop="advtrains:across_off", - description=attrans("Andrew's Cross"), - groups = { - cracky=3, - not_blocking_trains=1, - save_in_nodedb=1, - not_in_creative_inventory=nil, - }, - light_source = 1, - sunlight_propagates=true, - mesecons = {effector = { - rules = advtrains.meseconrules, - action_on = function (pos, node) - advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) - end - }}, - luaautomation = { - getstate = "off", - setstate = function(pos, node, newstate) - if newstate == "on" then - advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) - end - end, - }, - on_rightclick=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) - end - end, -}) -minetest.register_node("advtrains:across_on", { - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/4, -1/2, -1/2, 1/4, 1.5, 0}, - }, - mesh = "advtrains_across.obj", - tiles = {{name="advtrains_across_anim.png", animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.0}}}, - drop="advtrains:across_off", - description=attrans("Andrew's Cross (on) (you hacker you)"), - groups = { - cracky=3, - not_blocking_trains=1, - save_in_nodedb=1, - not_in_creative_inventory=1, - }, - light_source = 1, - sunlight_propagates=true, - mesecons = {effector = { - rules = advtrains.meseconrules, - action_off = function (pos, node) - advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) - end - }}, - luaautomation = { - getstate = "on", - setstate = function(pos, node, newstate) - if newstate == "off" then - advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) - end - end, - }, - on_rightclick=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) - end - end, -}) diff --git a/advtrains/advtrains/textures/advtrains_across.png b/advtrains/advtrains/textures/advtrains_across.png deleted file mode 100755 index da65a61..0000000 Binary files a/advtrains/advtrains/textures/advtrains_across.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_across_anim.png b/advtrains/advtrains/textures/advtrains_across_anim.png deleted file mode 100755 index 584d023..0000000 Binary files a/advtrains/advtrains/textures/advtrains_across_anim.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_boiler.png b/advtrains/advtrains/textures/advtrains_boiler.png deleted file mode 100755 index 8c7ff0d..0000000 Binary files a/advtrains/advtrains/textures/advtrains_boiler.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_chimney.png b/advtrains/advtrains/textures/advtrains_chimney.png deleted file mode 100755 index 285a1a6..0000000 Binary files a/advtrains/advtrains/textures/advtrains_chimney.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_couple.png b/advtrains/advtrains/textures/advtrains_couple.png deleted file mode 100755 index eda3704..0000000 Binary files a/advtrains/advtrains/textures/advtrains_couple.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_discouple.png b/advtrains/advtrains/textures/advtrains_discouple.png deleted file mode 100755 index 5c064c3..0000000 Binary files a/advtrains/advtrains/textures/advtrains_discouple.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_driver_cab.png b/advtrains/advtrains/textures/advtrains_driver_cab.png deleted file mode 100755 index 331bcc9..0000000 Binary files a/advtrains/advtrains/textures/advtrains_driver_cab.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png deleted file mode 100755 index 31c2b30..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_atc_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png deleted file mode 100755 index 27191fe..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_bumper_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png deleted file mode 100755 index e6c6ad6..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_detector_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_load_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_load_placer.png deleted file mode 100755 index 427c011..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_load_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_placer.png deleted file mode 100755 index 7bef8a9..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_rail.png b/advtrains/advtrains/textures/advtrains_dtrack_rail.png deleted file mode 100755 index bd0c217..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_rail.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared.png b/advtrains/advtrains/textures/advtrains_dtrack_shared.png deleted file mode 100755 index 736c7db..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared_atc.png b/advtrains/advtrains/textures/advtrains_dtrack_shared_atc.png deleted file mode 100755 index 1f83c37..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared_atc.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_off.png b/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_off.png deleted file mode 100755 index 724d907..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_off.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_on.png b/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_on.png deleted file mode 100755 index 7bb29d6..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared_detector_on.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared_load.png b/advtrains/advtrains/textures/advtrains_dtrack_shared_load.png deleted file mode 100755 index 5fd0d7a..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared_load.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_shared_unload.png b/advtrains/advtrains/textures/advtrains_dtrack_shared_unload.png deleted file mode 100755 index e9fc5bd..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_shared_unload.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png b/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png deleted file mode 100755 index 1d456b0..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_slopeplacer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_dtrack_unload_placer.png b/advtrains/advtrains/textures/advtrains_dtrack_unload_placer.png deleted file mode 100755 index 486861e..0000000 Binary files a/advtrains/advtrains/textures/advtrains_dtrack_unload_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_platform.png b/advtrains/advtrains/textures/advtrains_platform.png deleted file mode 100755 index 5ba9663..0000000 Binary files a/advtrains/advtrains/textures/advtrains_platform.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_retrosignal.png b/advtrains/advtrains/textures/advtrains_retrosignal.png deleted file mode 100755 index 141198d..0000000 Binary files a/advtrains/advtrains/textures/advtrains_retrosignal.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_retrosignal_inv.png b/advtrains/advtrains/textures/advtrains_retrosignal_inv.png deleted file mode 100755 index 1036594..0000000 Binary files a/advtrains/advtrains/textures/advtrains_retrosignal_inv.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_signal_inv.png b/advtrains/advtrains/textures/advtrains_signal_inv.png deleted file mode 100755 index ed64ed9..0000000 Binary files a/advtrains/advtrains/textures/advtrains_signal_inv.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_signal_off.png b/advtrains/advtrains/textures/advtrains_signal_off.png deleted file mode 100755 index 8046e52..0000000 Binary files a/advtrains/advtrains/textures/advtrains_signal_off.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_signal_on.png b/advtrains/advtrains/textures/advtrains_signal_on.png deleted file mode 100755 index 5228bb3..0000000 Binary files a/advtrains/advtrains/textures/advtrains_signal_on.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_signal_wall_off.png b/advtrains/advtrains/textures/advtrains_signal_wall_off.png deleted file mode 100755 index 3e7b1e1..0000000 Binary files a/advtrains/advtrains/textures/advtrains_signal_wall_off.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_signal_wall_on.png b/advtrains/advtrains/textures/advtrains_signal_wall_on.png deleted file mode 100755 index b628c7e..0000000 Binary files a/advtrains/advtrains/textures/advtrains_signal_wall_on.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_cr.png b/advtrains/advtrains/textures/advtrains_track_cr.png deleted file mode 100755 index 40f0cc5..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_cr.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_cr_45.png b/advtrains/advtrains/textures/advtrains_track_cr_45.png deleted file mode 100755 index 54966b3..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_cr_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_placer.png b/advtrains/advtrains/textures/advtrains_track_placer.png deleted file mode 100755 index 03e17ed..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_placer.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_st.png b/advtrains/advtrains/textures/advtrains_track_st.png deleted file mode 100755 index 5ad7e4f..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_st.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_st_45.png b/advtrains/advtrains/textures/advtrains_track_st_45.png deleted file mode 100755 index 63b4c96..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_st_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlcr.png b/advtrains/advtrains/textures/advtrains_track_swlcr.png deleted file mode 100755 index d9b5c0b..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swlcr.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlcr_45.png b/advtrains/advtrains/textures/advtrains_track_swlcr_45.png deleted file mode 100755 index f098fc9..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swlcr_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlst.png b/advtrains/advtrains/textures/advtrains_track_swlst.png deleted file mode 100755 index 314bd2d..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swlst.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swlst_45.png b/advtrains/advtrains/textures/advtrains_track_swlst_45.png deleted file mode 100755 index 765d0ec..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swlst_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrcr.png b/advtrains/advtrains/textures/advtrains_track_swrcr.png deleted file mode 100755 index f74e1bc..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swrcr.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrcr_45.png b/advtrains/advtrains/textures/advtrains_track_swrcr_45.png deleted file mode 100755 index fa432aa..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swrcr_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrst.png b/advtrains/advtrains/textures/advtrains_track_swrst.png deleted file mode 100755 index 06ea29e..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swrst.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_track_swrst_45.png b/advtrains/advtrains/textures/advtrains_track_swrst_45.png deleted file mode 100755 index be477b7..0000000 Binary files a/advtrains/advtrains/textures/advtrains_track_swrst_45.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_trackworker.png b/advtrains/advtrains/textures/advtrains_trackworker.png deleted file mode 100755 index b50bcae..0000000 Binary files a/advtrains/advtrains/textures/advtrains_trackworker.png and /dev/null differ diff --git a/advtrains/advtrains/textures/advtrains_wheel.png b/advtrains/advtrains/textures/advtrains_wheel.png deleted file mode 100755 index fb72879..0000000 Binary files a/advtrains/advtrains/textures/advtrains_wheel.png and /dev/null differ diff --git a/advtrains/advtrains/textures/drwho_screwdriver.png b/advtrains/advtrains/textures/drwho_screwdriver.png deleted file mode 100755 index b50bcae..0000000 Binary files a/advtrains/advtrains/textures/drwho_screwdriver.png and /dev/null differ diff --git a/advtrains/advtrains/trackdb_legacy.lua b/advtrains/advtrains/trackdb_legacy.lua deleted file mode 100644 index 99349e8..0000000 --- a/advtrains/advtrains/trackdb_legacy.lua +++ /dev/null @@ -1,27 +0,0 @@ ---trackdb_legacy.lua ---loads the (old) track database. the only use for this is to provide data for rails that haven't been written into the ndb database. ---nothing will be saved. ---if the user thinks that he has loaded every track in his world at least once, he can delete the track database. - ---trackdb[[y][x][z]={conn1, conn2, rely1, rely2, railheight} - - ---trackdb keeps its own save file. -advtrains.fpath_tdb=minetest.get_worldpath().."/advtrains_trackdb2" -local file, err = io.open(advtrains.fpath_tdb, "r") -if not file then - atprint("Not loading a trackdb file.") -else - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - advtrains.trackdb=tbl - atprint("Loaded trackdb file.") - end - file:close() -end - - - - - - diff --git a/advtrains/advtrains/trackplacer.lua b/advtrains/advtrains/trackplacer.lua deleted file mode 100644 index e94b4ff..0000000 --- a/advtrains/advtrains/trackplacer.lua +++ /dev/null @@ -1,305 +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) - if tp.tracks[nnprefix] then return end--due to the separate registration of slopes and flats for the same nnpref, definition would be overridden here. just don't. - 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 - advtrains.ndb.swap_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 - advtrains.ndb.swap_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) - advtrains.ndb.swap_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) - advtrains.ndb.swap_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) - advtrains.ndb.swap_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={advtrains_trackplacer=1}, - on_place = function(itemstack, placer, pointed_thing) - return advtrains.pcall(function() - local name = placer:get_player_name() - if not name then - return itemstack, false - end - if pointed_thing.type=="node" then - local pos=pointed_thing.above - local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0}) - if advtrains.is_protected(pos,name) then - minetest.record_protection_violation(pos, name) - return itemstack, false - 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.settings:get_bool("creative_mode") then - itemstack:take_item() - end - end - end - return itemstack, true - end) - end, - }) -end - - - -minetest.register_craftitem("advtrains:trackworker",{ - description = attrans("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) - return advtrains.pcall(function() - local name = placer:get_player_name() - if not name then - return - end - if pointed_thing.type=="node" then - local pos=pointed_thing.under - if advtrains.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - 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.get_train_at_pos(pos) then return end - - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --atprint(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(), attrans("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 - advtrains.ndb.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(), attrans("This node can't be rotated using the trackworker!")) - return - end - advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) - end - end - end) - end, - on_use=function(itemstack, user, pointed_thing) - return advtrains.pcall(function() - 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 advtrains.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return - end - - --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end - if advtrains.get_train_at_pos(pos) then return end - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --atprint(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(), attrans("This node can't be changed using the trackworker!")) - return - end - end - local nextsuffix=tp.tracks[nnprefix].twcycle[suffix] - advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..nextsuffix..rotation, param2=node.param2}) - - else - atprint(name, dump(tp.tracks)) - end - end) - end, -}) - ---putting into right place -advtrains.trackplacer=tp diff --git a/advtrains/advtrains/tracks.lua b/advtrains/advtrains/tracks.lua deleted file mode 100644 index d63e5c8..0000000 --- a/advtrains/advtrains/tracks.lua +++ /dev/null @@ -1,734 +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_flat={ - 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), - }, - description={ - st="straight", - cr="curve", - swlst="left switch (straight)", - swlcr="left switch (curve)", - swrst="right switch (straight)", - swrcr="right switch (curve)", - }, - switch={ - swlst="swlcr", - swlcr="swlst", - swrst="swrcr", - swrcr="swrst", - }, - switchmc={ - swlst="on", - swlcr="off", - swrst="on", - swrcr="off", - }, - switchst={ - swlst="st", - swlcr="cr", - swrst="st", - swrcr="cr", - }, - 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", - }, - rotation={"", "_30", "_45", "_60"}, - slopenodes={}, - increativeinv={}, -} -ap.t_30deg_slope={ - regstep=1, - variant={ - 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={ - vst1="steep uphill 1/2", - vst2="steep uphill 2/2", - vst31="uphill 1/3", - vst32="uphill 2/3", - vst33="uphill 3/3", - }, - switch={}, - switchmc={}, - switchst={}, - 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"}, - trackworker={}, - 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", - }, - switchst={ - swlst="st", - swlcr="cr", - swrst="st", - swrcr="cr", - }, - 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, is_state) - local rcswitchfunc=function(pos, node, player) - if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then - advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) - advtrains.invalidate_all_paths(pos) - end - end - local switchfunc=function(pos, node, newstate) - if newstate~=is_state then - advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) - advtrains.invalidate_all_paths(pos) - end - end - local mesec - if mesecon_state then -- if mesecons is not wanted, do not. - mesec = {effector = { - ["action_"..mesecon_state] = switchfunc, - rules=advtrains.meseconrules - }} - end - return rcswitchfunc, mesec, - { - getstate = is_state, - setstate = switchfunc, - } - end - local function make_overdef(suffix, rotation, conns, rcswitchfunc, mesecontbl, luaautomation, 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"), def.second_texture}, - --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=rcswitchfunc, - groups = { - attached_node=1, - ["advtrains_track_"..tracktype]=1, - save_in_nodedb=1, - dig_immediate=2, - not_in_creative_inventory=(not in_creative_inv and 1 or nil), - not_blocking_trains=1, - }, - mesecons=mesecontbl, - luaautomation=luaautomation, - drop = (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.get_train_at_pos(pos) - end, - after_dig_node=function(pos) - advtrains.ndb.update(pos) - end, - after_place_node=function(pos) - advtrains.ndb.update(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 rcswitchfunc, mesecontbl, luaautomation - if preset.switch[suffix] then - rcswitchfunc, mesecontbl, luaautomation=make_switchfunc(preset.switch[suffix]..rotation, preset.switchmc[suffix], preset.switchst[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), - rcswitchfunc, mesecontbl, luaautomation, 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 atprint(" 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 atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end - - local tracktype - for k,_ in pairs(nodedef.groups) do - local tt=string.match(k, "^advtrains_track_(.+)$") - if tt then - tracktype=tt - end - end - return (nodedef.connect1 + 4 * noderot)%16, (nodedef.connect2 + 4 * noderot)%16, nodedef.rely1 or 0, nodedef.rely2 or 0, nodedef.railheight or 0, tracktype -end - ---detector code ---holds a table with nodes on which trains are on. - -advtrains.detector = {} -advtrains.detector.on_node = {} - -function advtrains.detector.enter_node(pos, train_id) - local ppos=advtrains.round_vector_floor_y(pos) - local pts=minetest.pos_to_string(ppos) - advtrains.detector.on_node[pts]=train_id - advtrains.detector.call_enter_callback(ppos, train_id) -end -function advtrains.detector.leave_node(pos, train_id) - local ppos=advtrains.round_vector_floor_y(pos) - advtrains.detector.call_leave_callback(ppos, train_id) -end -function advtrains.detector.stay_node(pos, train_id) - local ppos=advtrains.round_vector_floor_y(pos) - local pts=minetest.pos_to_string(ppos) - advtrains.detector.on_node[pts]=train_id -end - - - -function advtrains.detector.call_enter_callback(pos, train_id) - --atprint("instructed to call enter calback") - - local node = advtrains.ndb.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 -end -function advtrains.detector.call_leave_callback(pos, train_id) - --atprint("instructed to call leave calback") - - local node = advtrains.ndb.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 = attrans("@1 Slope", def.description), - 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(), attrans("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(), attrans("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(), attrans("Can't place: space occupied!")) - return istack - end - if advtrains.is_protected(pos, player:get_player_name()) then - minetest.record_protection_violation(pos, player:get_player_name()) - 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 advtrains.is_protected(pos, player:get_player_name()) then - --do slopes of this distance exist? - if lookup[step] then - if minetest.settings:get_bool("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.settings:get_bool("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(), attrans("Can't place: Not enough slope items left (@1 required)", step)) - end - else - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: There's no slope of length @1",step)) - end - return istack - end - step=step+1 - pos=vector.add(pos, dirvec) - end - minetest.chat_send_player(player:get_player_name(), attrans("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=attrans("Deprecated Track"), - formats={vst1={}, vst2={}}, -}, ap.t_45deg) - ---flat -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("Track"), - formats={}, -}, ap.t_30deg_flat) ---slopes -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - second_texture="default_gravel.png", - description=attrans("Track"), - formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, -}, ap.t_30deg_slope) - ---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", - --bumpers still use the old texture until the models are redone. - description=attrans("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", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_detector_off.png", - description=attrans("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) - advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=advtrains.ndb.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", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_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) - advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=advtrains.ndb.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 deleted file mode 100644 index 591881a..0000000 --- a/advtrains/advtrains/trainhud.lua +++ /dev/null @@ -1,126 +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"} -local doorstr={[-1]="|<>| >|<", [0]=">|< >|<", [1]=">|< |<>|"} - -function advtrains.on_control_change(pc, train, flip) - local maxspeed = train.max_speed or 10 - if pc.sneak then - if pc.up then - train.tarvelocity = maxspeed - 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 = math.min(train.tarvelocity + 1, maxspeed) - 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 pc.left then - if train.door_open ~= 0 then - train.door_open = 0 - else - train.door_open = -train.movedir - end - end - if pc.right then - if train.door_open ~= 0 then - train.door_open = 0 - else - train.door_open = 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) - local inside=train.text_inside or "" - advtrains.set_trainhud(pname, inside.."\n"..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=" ["..mletter[fct*train.movedir].."] "..doorstr[(train.door_open or 0) * train.movedir].." "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") - firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", max-vel)..">" - secondLine=attrans("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 deleted file mode 100644 index 483ea52..0000000 --- a/advtrains/advtrains/trainlogic.lua +++ /dev/null @@ -1,1005 +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 -atprintbm=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.mainloop_trainlogic=function(dtime) - --build a table of all players indexed by pts. used by damage and door system. - advtrains.playersbypts={} - for _, player in pairs(minetest.get_connected_players()) do - if not advtrains.player_to_train_mapping[player:get_player_name()] then - --players in train are not subject to damage - local ptspos=minetest.pos_to_string(vector.round(player:getpos())) - advtrains.playersbypts[ptspos]=player - end - end - --regular train step - -- do in two steps: - -- a: predict path and add all nodes to the advtrains.detector.on_node table - -- b: check for collisions based on these data - -- (and more) - local t=os.clock() - advtrains.detector.on_node={} - for k,v in pairs(advtrains.trains) do - advtrains.atprint_context_tid=sid(k) - advtrains.atprint_context_tid_full=k - advtrains.train_step_a(k, v, dtime) - end - for k,v in pairs(advtrains.trains) do - advtrains.atprint_context_tid=sid(k) - advtrains.atprint_context_tid_full=k - advtrains.train_step_b(k, v, dtime) - end - - advtrains.atprint_context_tid=nil - advtrains.atprint_context_tid_full=nil - - atprintbm("trainsteps", t) - endstep() -end - -minetest.register_on_joinplayer(function(player) - return advtrains.pcall(function() - local pname=player:get_player_name() - local id=advtrains.player_to_train_mapping[pname] - if id then - local train=advtrains.trains[id] - if not train then advtrains.player_to_train_mapping[pname]=nil return end - --set the player to the train position. - --minetest will emerge the area and load the objects, which then will call reattach_all(). - --because player is in mapping, it will not be subject to dying. - player:setpos(train.last_pos_prev) - --independent of this, cause all wagons of the train which are loaded to reattach their players - --needed because already loaded wagons won't call reattach_all() - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.train_id==id then - wagon:reattach_all() - end - end - end - end) -end) - -minetest.register_on_dieplayer(function(player) - return advtrains.pcall(function() - local pname=player:get_player_name() - local id=advtrains.player_to_train_mapping[pname] - if id then - local train=advtrains.trains[id] - if not train then advtrains.player_to_train_mapping[pname]=nil return end - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.train_id==id then - --when player dies, detach him from the train - --call get_off_plr on every wagon since we don't know which one he's on. - wagon:get_off_plr(pname) - end - end - end - end) -end) ---[[ -train step structure: - - -- legacy stuff -- preparing the initial path and creating index -- setting node coverage old indices -- handle velocity influences: - - off-track - - atc - - player controls - - environment collision -- update index = move -- create path -- update node coverage -- do less important stuff such as checking trainpartload or removing - --- break -- -- handle train collisions - -]] - -function advtrains.train_step_a(id, train, dtime) - --atprint("--- runcnt ",advtrains.mainloop_runcnt,": index",train.index,"end_index", train.end_index,"| max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> pe_min", train.path_extent_min,"pe_max", train.path_extent_max) - if train.min_index_on_track then - assert(math.floor(train.min_index_on_track)==train.min_index_on_track) - end - --- 1. LEGACY STUFF --- - 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 - --- 2. prepare initial path and index if needed --- - if not train.index then train.index=0 end - if not train.path then - if not train.last_pos then - --no chance to recover - atprint("train hasn't saved last-pos, removing train.") - advtrains.trains[id]=nil - return false - end - - local node_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(train.last_pos), train.drives_on) - - if node_ok==nil then - --block not loaded, do nothing - atprint("last_pos", advtrains.round_vector_floor_y(train.last_pos), "not loaded and not in ndb, waiting") - return nil - elseif node_ok==false then - atprint("no track here, (fail) removing train.") - advtrains.trains[id]=nil - return false - end - - if not train.last_pos_prev then - --no chance to recover - atprint("train hasn't saved last-pos_prev, removing train.") - advtrains.trains[id]=nil - return false - end - - local prevnode_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(train.last_pos_prev), train.drives_on) - - if prevnode_ok==nil then - --block not loaded, do nothing - atprint("last_pos_prev", advtrains.round_vector_floor_y(train.last_pos_prev), "not loaded and not in ndb, waiting") - return nil - elseif prevnode_ok==false then - atprint("no track at prev, (fail) removing train.") - advtrains.trains[id]=nil - return false - end - - train.index=(train.restore_add_index or 0)+(train.savedpos_off_track_index_offset or 0) - --restore_add_index is set by save() to prevent trains hopping to next round index. should be between -0.5 and 0.5 - --savedpos_off_track_index_offset is set if train went off track. see below. - train.path={} - train.path_dist={} - train.path[0]=train.last_pos - train.path[-1]=train.last_pos_prev - train.path_dist[-1]=vector.distance(train.last_pos, train.last_pos_prev) - train.path_extent_min=-1 - train.path_extent_max=0 - train.min_index_on_track=-1 - train.max_index_on_track=0 - - --[[ - Bugfix for trains randomly ignoring ATC rails: - - Paths have been invalidated. 1 gets executed and ensures an initial path - - 2a sets train end index. The problem is that path_dist is not known for the whole path, so train end index will be nearly trainlen - - Since the detector indices are also unknown, they get set to the new (wrong) train_end_index. Enter_node calls are not executed for the nodes that lie in between real end_index and trainlen. - - The next step, mistake is recognized, train leaves some positions. From there, everything works again. - To overcome this, we will generate the full required path here so that path_dist is available for get_train_end_index(). - ]] - advtrains.pathpredict(id, train) - end - - --- 2a. set train.end_index which is required in different places, IF IT IS NOT SET YET by STMT afterwards. --- - --- table entry to avoid triple recalculation --- - if not train.end_index then - train.end_index=advtrains.get_train_end_index(train) - end - - --- 2b. set node coverage old indices --- - - train.detector_old_index = math.floor(train.index) - train.detector_old_end_index = math.floor(train.end_index) - - --- 3. handle velocity influences --- - local train_moves=(train.velocity~=0) - - if train.recently_collided_with_env then - train.tarvelocity=0 - if not train_moves then - train.recently_collided_with_env=false--reset status when stopped - end - end - if train.locomotives_in_train==0 then - train.tarvelocity=0 - end - - --- 3a. this can be useful for debugs/warnings and is used for check_trainpartload --- - local t_info, train_pos=sid(id), train.path[math.floor(train.index)] - if train_pos then - t_info=t_info.." @"..minetest.pos_to_string(train_pos) - --atprint("train_pos:",train_pos) - end - - --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 - atwarn("Train",t_info,"is off track at both ends. Clipping velocity to 1") - pprint=true - end - elseif front_off_track then--allow movement only backward - if train.movedir==1 and train.tarvelocity>0 then - train.tarvelocity=0 - atwarn("Train",t_info,"is off track. Trying to drive further out. Velocity clipped to 0") - pprint=true - end - if train.movedir==-1 and train.tarvelocity>1 then - train.tarvelocity=1 - atwarn("Train",t_info,"is off track. Velocity clipped to 1") - pprint=true - end - elseif back_off_track then--allow movement only forward - if train.movedir==-1 and train.tarvelocity>0 then - train.tarvelocity=0 - atwarn("Train",t_info,"is off track. Trying to drive further out. Velocity clipped to 0") - pprint=true - end - if train.movedir==1 and train.tarvelocity>1 then - train.tarvelocity=1 - atwarn("Train",t_info,"is off track. Velocity clipped to 1") - pprint=true - end - end - if pprint then - atprint("max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> index", train.index, "end_index", train.end_index) - end - - --interpret ATC command - if train.atc_brake_target and train.atc_brake_target>=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. - --atprint("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. - --atprint("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_targettrain.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] - atprint("train is off-track (back), last positions kept at", train.last_pos, "/", 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 - - --- 5b. Remove path items that are no longer used --- - -- Necessary since path items are no longer invalidated in save steps - local path_pregen_keep=20 - local offtrack_keep=4 - local gen_front_keep= path_pregen_keep - local gen_back_keep= math.floor(- train.trainlen - path_pregen_keep) - - local delete_min=math.min(train.max_index_on_track - offtrack_keep, math.floor(train.index)+gen_back_keep) - local delete_max=math.max(train.min_index_on_track + offtrack_keep, math.floor(train.index)+gen_front_keep) - - if train.path_extent_mindelete_max then - atprint(sid(id),"clearing path max ",train.path_extent_max," to ",delete_max) - train.path_dist[delete_max]=nil - for i=delete_max+1,train.path_extent_max do - train.path[i]=nil - train.path_dist[i]=nil - end - train.path_extent_max=delete_max - train.max_index_on_track=math.min(train.max_index_on_track, delete_max) - end - - --- 6. update node coverage --- - - -- when paths get cleared, the old indices set above will be up-to-date and represent the state in which the last run of this code was made - local ifo, ifn, ibo, ibn = train.detector_old_index, math.floor(train.index), train.detector_old_end_index, math.floor(train.end_index) - - local path=train.path - - if train.enter_node_all then - --field set by create_new_train_at. - --ensures that new train calls enter_node on all nodes - for i=ibn, ifn do - if path[i] then - advtrains.detector.enter_node(path[i], id) - end - end - train.enter_node_all=nil - else - for i=ibn, ifn do - if path[i] then - local pts=minetest.pos_to_string(path[i]) - if not (advtrains.detector.on_node[pts] and advtrains.detector.on_node[pts]~=id) then - advtrains.detector.stay_node(path[i], id) - end - end - end - - if ifn>ifo then - for i=ifo+1, ifn do - if path[i] then - local pts=minetest.pos_to_string(path[i]) - if advtrains.detector.on_node[pts] and advtrains.detector.on_node[pts]~=id then - --if another train has signed up for this position first, it won't be recognized in train_step_b. So do collision here. - atprint("Collision detected in enter_node callbacks (front) @",pts,"with",sid(advtrains.detector.on_node[pts])) - advtrains.collide_and_spawn_couple(id, path[i], advtrains.detector.on_node[pts], false) - end - atprint("enter_node (front) @index",i,"@",pts,"on_node",sid(advtrains.detector.on_node[pts])) - advtrains.detector.enter_node(path[i], id) - end - end - elseif ifnibo then - for i=ibo, ibn-1 do - if path[i] then - advtrains.detector.leave_node(path[i], id) - end - end - end - end - - --- 7. do less important stuff --- - --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 - - train.check_trainpartload=(train.check_trainpartload or 0)-dtime - local node_range=(math.max((minetest.settings:get("active_block_range") or 0),1)*16) - if train.check_trainpartload<=0 then - local ori_pos=train_pos --see 3a. - --atprint("[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()) gen_back do - local conway - if train.min_index_on_track == minn then - atprint("minn conway for ",minn,train.path[minn],minn+1,train.path[minn+1]) - conway=advtrains.conway(train.path[minn], train.path[minn+1], train.drives_on) - end - if conway then - train.path[minn-1]=conway - train.min_index_on_track=minn-1 - else - --do as if nothing has happened and preceed with path - --but do not update min_index_on_track - atprint("over-generating path min to index ",(minn-1)," (position ",train.path[minn]," )") - 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=minn-1 - end - train.path_extent_min=minn - if not train.min_index_on_track then train.min_index_on_track=-1 end - if not train.max_index_on_track then train.max_index_on_track=0 end -end - - -function advtrains.train_step_b(id, train, dtime) - - --hacky fix: if train_step_a returned in phase 2, end_index may not be set. - --just return - if not train.end_index then - return - end - - --- 8. check for collisions with other trains and damage players --- - - local train_moves=(train.velocity~=0) - - if train_moves then - local collpos - local coll_grace=1 - if train.movedir==1 then - collpos=advtrains.get_real_index_position(train.path, train.index-coll_grace) - else - collpos=advtrains.get_real_index_position(train.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}) - --- 8a Check collision --- - local testpts=minetest.pos_to_string(testpos) - if advtrains.detector.on_node[testpts] and advtrains.detector.on_node[testpts]~=id then - --collides - advtrains.collide_and_spawn_couple(id, testpos, advtrains.detector.on_node[testpts], train.movedir==-1) - end - --- 8b damage players --- - if not minetest.settings:get_bool("creative_mode") then - local player=advtrains.playersbypts[testpts] - if player and train.velocity>3 then - --instantly kill player - --drop inventory contents first, to not to spawn bones - local player_inv=player:get_inventory() - for i=1,player_inv:get_size("main") do - minetest.add_item(testpos, player_inv:get_stack("main", i)) - end - for i=1,player_inv:get_size("craft") do - minetest.add_item(testpos, player_inv:get_stack("craft", i)) - end - -- empty lists main and craft - player_inv:set_list("main", {}) - player_inv:set_list("craft", {}) - player:set_hp(0) - end - end - end - end - end - end -end - ---returns new id -function advtrains.create_new_train_at(pos, pos_prev) - local newtrain_id=os.time()..os.clock() - while advtrains.trains[newtrain_id] do newtrain_id=os.time()..os.clock() end--ensure uniqueness(will be unneccessary) - - advtrains.trains[newtrain_id]={} - advtrains.trains[newtrain_id].last_pos=pos - advtrains.trains[newtrain_id].last_pos_prev=pos_prev - advtrains.trains[newtrain_id].tarvelocity=0 - advtrains.trains[newtrain_id].velocity=0 - advtrains.trains[newtrain_id].trainparts={} - - advtrains.trains[newtrain_id].enter_node_all=true - - return newtrain_id -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.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=20 - local rel_pos=0 - local count_l=0 - for i, w_id in ipairs(train.trainparts) do - local wagon=nil - for aoid,iwagon in pairs(minetest.luaentities) do - if iwagon.is_wagon and iwagon.unique_id==w_id then - if wagon then - --duplicate - atprint("update_trainpart_properties: Removing duplicate wagon with id="..aoid) - 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.add_entity(train.last_pos, advtrains.wagon_save[w_id].entity_name):get_luaentity() - if not wagon then - minetest.chat_send_all("[advtrains] Warning: Wagon "..advtrains.wagon_save[w_id].entity_name.." does not exist. Make sure all required modules are loaded!") - else - wagon:init_from_wagon_save(w_id) - end - 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 - - 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) - if i==1 then - train.couple_lock_front=wagon.lock_couples - end - if i==#train.trainparts then - train.couple_lock_back=wagon.lock_couples - end - - else - atprint(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] - if not train.path then return end - - local real_pos_in_train=advtrains.get_real_path_index(train, wagon.pos_in_train) - local pos_for_new_train=train.path[math.floor(real_pos_in_train+wagon.wagon_span)] - local pos_for_new_train_prev=train.path[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 - atprint("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 - atprint("split_train: pos_for_new_train ",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 - atprint("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 - atprint("split_train: pos_for_new_train_prev ", 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 - newtrain.enter_node_all=true -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.collide_and_spawn_couple(id1, pos, id2, t1_is_backpos) - if minetest.settings:get_bool("advtrains_disable_collisions") then - return - end - - atprint("COLLISION: "..sid(id1).." and "..sid(id2).." at ",pos,", t1_is_backpos="..(t1_is_backpos and "true" or "false")) - --TODO: - local train1=advtrains.trains[id1] - - -- do collision - train1.recently_collided_with_env=true - train1.velocity=0.5*train1.velocity - train1.movedir=train1.movedir*-1 - train1.tarvelocity=0 - - local train2=advtrains.trains[id2] - - if not train1 or not train2 then return end - - 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 - atprint("Err: pos not in path. Not spawning a couple") - 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 - atprint("End positions: ",frontpos2,backpos2) - - t2_is_backpos = vector.distance(backpos2, pos) < vector.distance(frontpos2, pos) - - atprint("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 atprint("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 - local p_aoi - 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 - p_aoi=aoi - end - end - atprint("Couple spawned (ActiveObjectID ",p_aoi,")") -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, player) - local first, second=advtrains.trains[first_id], advtrains.trains[second_id] - - if not first or not second or not first.index or not second.index or not first.end_index or not second.end_index then - return false - end - - if first.couple_lock_back or second.couple_lock_front then - -- trains are ordered correctly! - if player then - minetest.chat_send_player(player:get_player_name(), "Can't couple: couples locked!") - end - return - end - - local first_wagoncnt=#first.trainparts - local second_wagoncnt=#second.trainparts - - for _,v in ipairs(second.trainparts) do - table.insert(first.trainparts, v) - end - --kick it like physics (with mass being #wagons) - local new_velocity=((first.velocity*first_wagoncnt)+(second.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 - return true -end - -function advtrains.invert_train(train_id) - local train=advtrains.trains[train_id] - - local old_path=train.path - local old_path_dist=train.path_dist - train.path={} - train.path_dist={} - train.index, train.end_index= -train.end_index, -train.index - train.path_extent_min, train.path_extent_max = -train.path_extent_max, -train.path_extent_min - train.min_index_on_track, train.max_index_on_track = -train.max_index_on_track, -train.min_index_on_track - train.detector_old_index, train.detector_old_end_index = -train.detector_old_end_index, -train.detector_old_index - - train.velocity=-train.velocity - train.tarvelocity=-train.tarvelocity - for k,v in pairs(old_path) do - train.path[-k]=v - train.path_dist[-k-1]=old_path_dist[k] - 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.get_train_at_pos(pos) - local ph=minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) - return advtrains.detector.on_node[ph] -end - -function advtrains.invalidate_all_paths(pos) - --if a position is given, only invalidate inside a radius to save performance - local inv_radius=50 - atprint("invalidating all paths") - for k,v in pairs(advtrains.trains) do - local exec=true - if pos and v.path and v.index and v.end_index then - --start and end pos of the train - local cmp1=v.path[math.floor(v.index)] - local cmp2=v.path[math.floor(v.end_index)] - if vector.distance(pos, cmp1)>inv_radius and vector.distance(pos, cmp2)>inv_radius then - exec=false - end - end - if exec then - --TODO duplicate code in init.lua avt_save()! - 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.end_index=nil - v.min_index_on_track=nil - v.max_index_on_track=nil - v.path_extent_min=nil - v.path_extent_max=nil - - v.detector_old_index=nil - v.detector_old_end_index=nil - end - 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 deleted file mode 100644 index 567b560..0000000 --- a/advtrains/advtrains/wagons.lua +++ /dev/null @@ -1,900 +0,0 @@ ---atan2 counts angles clockwise, minetest does counterclockwise - -minetest.register_privilege("train_place", { - description = "Player can place trains on tracks not owned by player", - give_to_singleplayer= false, -}); -minetest.register_privilege("train_remove", { - description = "Player can remove trains not owned by player", - give_to_singleplayer= false, -}); -minetest.register_privilege("train_operator", { - description = "Player may operate trains and switch signals. Given by default. Revoke to prevent players from griefing automated subway systems.", - give_to_singleplayer= true, - default= true, -}); - -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: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) - if sd_uid~="" then - --destroy when loaded from static block. - self.object:remove() - return - end - self.object:set_armor_groups({immortal=1}) - self.entity_name=self.name -end - -function wagon:get_staticdata() - return advtrains.pcall(function() - if not self:ensure_init() then return end - atprint("[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) -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 - atprint("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(0.2, function() self:reattach_all() end) - atprint("init_from_wagon_save "..self.unique_id.." ("..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 - if self.doors then - self.door_anim_timer=0 - self.door_state=0 - end - if self.custom_on_activate then - self:custom_on_activate(dtime_s) - end -end -function wagon:ensure_init() - if self.initialized then - if self.noninitticks then self.noninitticks=nil end - return true - end - if not self.noninitticks then self.noninitticks=0 end - self.noninitticks=self.noninitticks+1 - if self.noninitticks>20 then - self.object:remove() - else - self.object:setvelocity({x=0,y=0,z=0}) - end - return false -end - --- Remove the wagon -function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) - return advtrains.pcall(function() - 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 and (not minetest.check_player_privs(puncher, {train_remove = true })) then - minetest.chat_send_player(puncher:get_player_name(), attrans("This wagon is owned by @1, you can't destroy it.", self.owner)); - return - end - - if minetest.settings:get_bool("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(), attrans("Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click 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) -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 - - atprint("[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) - return advtrains.pcall(function() - if not self:ensure_init() then return end - - local t=os.clock() - local pos = self.object:getpos() - - if not pos then - atprint("["..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 - atprint("[wagon "..self.unique_id.."] missing train_id, destroying") - self.object:remove() - return - end - if not self.seatp then - self.seatp={} - end - if not self.seatpc then - self.seatpc={} - end - - --Legacy: remove infotext since it does not work this way anyways - self.infotext=nil - - --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 - local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) - local has_driverstand=seat.driving_ctrl_access and self.seatp[seatno] and minetest.check_player_privs(self.seatp[seatno], {train_operator=true}) - if has_driverstand and driver then - advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped) - elseif driver then - --only show the inside text - local inside=self:train().text_inside or "" - advtrains.set_trainhud(driver:get_player_name(), inside) - end - if driver and driver:get_player_control_bits()~=self.seatpc[seatno] then - local pc=driver:get_player_control() - self.seatpc[seatno]=driver:get_player_control_bits() - - if has_driverstand then - --regular driver stand controls - advtrains.on_control_change(pc, self:train(), self.wagon_flipped) - else - -- If on a passenger seat and doors are open, get off when W or D pressed. - local pass = self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) - if pass and self:train().door_open~=0 then - local pc=pass:get_player_control() - if pc.up or pc.down then - self:get_off(seatno) - end - end - end - if pc.aux1 and pc.sneak then - self:get_off(seatno) - end - end - end - - --check infotext - local outside=self:train().text_outside or "" - if self.object:get_properties().infotext~=outside then - self.object:set_properties({infotext=outside}) - end - - local gp=self:train() - local fct=self.wagon_flipped and -1 or 1 - --door animation - if self.doors then - if (self.door_anim_timer or 0)<=0 then - local dstate = (gp.door_open or 0) * fct - if dstate ~= self.door_state then - local at - --meaning of the train.door_open field: - -- -1: left doors (rel. to train orientation) - -- 0: closed - -- 1: right doors - --this code produces the following behavior: - -- if changed from 0 to +-1, play open anim. if changed from +-1 to 0, play close. - -- if changed from +-1 to -+1, first close and set 0, then it will detect state change again and run open. - if self.door_state == 0 then - at=self.doors.open[dstate] - self.object:set_animation(at.frames, at.speed or 15, at.blend or 0, false) - self.door_state = dstate - else - at=self.doors.close[self.door_state or 1]--in case it has not been set yet - self.object:set_animation(at.frames, at.speed or 15, at.blend or 0, false) - self.door_state = 0 - end - self.door_anim_timer = at.time - end - else - self.door_anim_timer = (self.door_anim_timer or 0) - dtime - end - end - - --DisCouple - if self.pos_in_trainparts and self.pos_in_trainparts>1 then - if gp.velocity==0 and not self.lock_couples 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 - atprint("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 gp.path 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) - --atprint("trainindex "..gp.index.." wagonindex "..index) - - --automatic get_on - --needs to know index and path - if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 then - --using the mapping created by the trainlogic globalstep - for i, ino in ipairs(self.door_entry) do - --fct is the flipstate flag from door animation above - local aci = index + ino*fct - local ix1=gp.path[math.floor(aci)] - local ix2=gp.path[math.floor(aci+1)] - -- the two wanted positions are ix1 and ix2 + (2nd-1st rotated by 90deg) - -- (x z) rotated by 90deg is (-z x) (http://stackoverflow.com/a/4780141) - local add = { x = (ix2.z-ix1.z)*gp.door_open, y = 0, z = (ix1.x-ix2.x)*gp.door_open } - local pts1=vector.round(vector.add(ix1, add)) - local pts2=vector.round(vector.add(ix2, add)) - if minetest.get_item_group(minetest.get_node(pts1).name, "platform")>0 then - local ckpts={ - pts1, - pts2, - vector.add(pts1, {x=0, y=1, z=0}), - vector.add(pts2, {x=0, y=1, z=0}), - } - for _,ckpos in ipairs(ckpts) do - local cpp=minetest.pos_to_string(ckpos) - if advtrains.playersbypts[cpp] then - self:on_rightclick(advtrains.playersbypts[cpp]) - end - end - end - end - end - - --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 - --atprint(" 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 - if self.collision_count and self.collision_count>10 then - --enable collision mercy to get trains stuck in walls out of walls - --actually do nothing except limiting the velocity to 1 - gp.velocity=math.min(gp.velocity, 1) - gp.tarvelocity=math.min(gp.tarvelocity, 1) - else - gp.recently_collided_with_env=true - gp.velocity=2*gp.velocity - gp.movedir=-gp.movedir - gp.tarvelocity=0 - self.collision_count=(self.collision_count or 0)+1 - end - else - self.collision_count=nil - 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 - atprintbm("wagon step", t) - end) -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:on_rightclick(clicker) - return advtrains.pcall(function() - 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) - atprint(dump(self)) - return - end - local pname=clicker:get_player_name() - local no=self:get_seatno(pname) - if no then - if self.seat_groups then - local poss={} - local sgr=self.seats[no].group - for _,access in ipairs(self.seat_groups[sgr].access_to) do - if self:check_seat_group_access(pname, access) then - poss[#poss+1]={name=self.seat_groups[access].name, key="sgr_"..access} - end - end - if self.has_inventory and self.get_inventory_formspec then - poss[#poss+1]={name=attrans("Show Inventory"), key="inv"} - end - if self.owner==pname then - poss[#poss+1]={name=attrans("Wagon properties"), key="prop"} - end - if not self.seat_groups[sgr].require_doors_open or self:train().door_open~=0 then - poss[#poss+1]={name=attrans("Get off"), key="off"} - else - if clicker:get_player_control().sneak then - poss[#poss+1]={name=attrans("Get off (forced)"), key="off"} - else - poss[#poss+1]={name=attrans("(Doors closed)"), key="dcwarn"} - end - end - if #poss==0 then - --can't do anything. - elseif #poss==1 then - self:seating_from_key_helper(pname, {[poss[1].key]=true}, no) - else - local form = "size[5,"..1+(#poss).."]" - for pos,ent in ipairs(poss) do - form = form .. "button_exit[0.5,"..(pos-0.5)..";4,1;"..ent.key..";"..ent.name.."]" - end - minetest.show_formspec(pname, "advtrains_seating_"..self.unique_id, form) - end - else - self:get_off(no) - end - else - --do not attach if already on a train - if advtrains.player_to_train_mapping[pname] then return end - if self.seat_groups then - 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 doors_open = self:train().door_open~=0 or clicker:get_player_control().sneak - for _,sgr in ipairs(self.assign_to_seat_group) do - if self:check_seat_group_access(pname, sgr) then - for seatid, seatdef in ipairs(self.seats) do - if seatdef.group==sgr and not self.seatp[seatid] and (not self.seat_groups[sgr].require_doors_open or doors_open) then - self:get_on(clicker, seatid) - return - end - end - end - end - minetest.chat_send_player(pname, attrans("Can't get on: wagon full or doors closed!")) - minetest.chat_send_player(pname, attrans("Use Sneak+rightclick to bypass closed doors!")) - else - self:show_get_on_form(pname) - end - end - end) -end - -function wagon:get_on(clicker, seatno) - if not self.seatp then self.seatp={}end - if not self.seatpc then self.seatpc={}end--player controls in driver stands - - if not self.seats[seatno] then return end - local oldno=self:get_seatno(clicker:get_player_name()) - if oldno then - atprint("get_on: clearing oldno",seatno) - advtrains.player_to_train_mapping[clicker:get_player_name()]=nil - advtrains.clear_driver_hud(clicker:get_player_name()) - self.seatp[oldno]=nil - end - if self.seatp[seatno] and self.seatp[seatno]~=clicker:get_player_name() then - atprint("get_on: throwing off",self.seatp[seatno],"from seat",seatno) - self:get_off(seatno) - end - atprint("get_on: attaching",clicker:get_player_name()) - self.seatp[seatno] = clicker:get_player_name() - self.seatpc[seatno] = clicker:get_player_control_bits() - 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) - self.seatp[seatno]=nil - self.seatpc[seatno]=nil - if clicker then - atprint("get_off: detaching",clicker:get_player_name()) - clicker:set_detach() - clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) - local gp=self:train() - --code as in step - automatic get on - if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 and gp.index and gp.path then - local index=advtrains.get_real_path_index(gp, self.pos_in_train) - --using the mapping created by the trainlogic globalstep - for i, ino in ipairs(self.door_entry) do - local aci = index + ino*(self.wagon_flipped and -1 or 1) - local ix1=gp.path[math.floor(aci)] - local ix2=gp.path[math.floor(aci+1)] - -- the two wanted positions are ix1 and ix2 + (2nd-1st rotated by 90deg) - -- (x z) rotated by 90deg is (-z x) (http://stackoverflow.com/a/4780141) - -- multiplied by 2 here, to place off on platform, y of add is 1. - local add = { x = (ix2.z-ix1.z)*gp.door_open, y = 0, z = (ix1.x-ix2.x)*gp.door_open} - local oadd = { x = (ix2.z-ix1.z)*gp.door_open*2, y = 1, z = (ix1.x-ix2.x)*gp.door_open*2} - local platpos=vector.round(vector.add(ix1, add)) - local offpos=vector.round(vector.add(ix1, oadd)) - atprint("platpos:", platpos, "offpos:", offpos) - if minetest.get_item_group(minetest.get_node(platpos).name, "platform")>0 then - minetest.after(0.2, function() clicker:setpos(offpos) end) - return - end - end - else--if not door_entry, or paths missing, fall back to old method - 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) - local offp=vector.add({x=isx and r*2 or 0, y=1, z=not isx and r*2 or 0}, objpos) - if minetest.get_item_group(minetest.get_node(p).name, "platform")>0 then - minetest.after(0.2, function() clicker:setpos(offp) end) - return - end - end - end - end -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;"..attrans("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;"..attrans("Show Inventory").."]" - end - minetest.show_formspec(pname, "advtrains_geton_"..self.unique_id, form) -end -function wagon:show_wagon_properties(pname) - local numsgr=0 - if self.seat_groups then - numsgr=#self.seat_groups - end - if not self.seat_access then - self.seat_access={} - end - --[[ - fields: seat access: empty: everyone - checkbox: lock couples - button: save - ]] - local form="size[5,"..(numsgr*1.5+7).."]" - local at=0 - if self.seat_groups then - for sgr,sgrdef in pairs(self.seat_groups) do - local text = attrans("Access to @1",sgrdef.name) - form=form.."field[0.5,"..(0.5+at*1.5)..";4,1;sgr_"..sgr..";"..text..";"..(self.seat_access[sgr] or "").."]" - at=at+1 - end - end - form=form.."checkbox[0,"..(at*1.5)..";lock_couples;"..attrans("Lock couples")..";"..(self.lock_couples and "true" or "false").."]" - if self:train() then --just in case - form=form.."field[0.5,"..(1.5+at*1.5)..";4,1;text_outside;"..attrans("Text displayed outside on train")..";"..(self:train().text_outside or "").."]" - form=form.."field[0.5,"..(2.5+at*1.5)..";4,1;text_inside;"..attrans("Text displayed inside train")..";"..(self:train().text_inside or "").."]" - end - form=form.."button_exit[0.5,"..(3+at*1.5)..";4,1;save;"..attrans("Save wagon properties").."]" - minetest.show_formspec(pname, "advtrains_prop_"..self.unique_id, form) -end -minetest.register_on_player_receive_fields(function(player, formname, fields) - return advtrains.pcall(function() - 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 - uid=string.match(formname, "^advtrains_seating_(.+)$") - if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then - local pname=player:get_player_name() - local no=wagon:get_seatno(pname) - if no then - if wagon.seat_groups then - wagon:seating_from_key_helper(pname, fields, no) - end - end - end - end - end - uid=string.match(formname, "^advtrains_prop_(.+)$") - if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then - local pname=player:get_player_name() - if pname~=wagon.owner then - return true - end - if fields.save or not fields.quit then - for sgr,sgrdef in pairs(wagon.seat_groups) do - if fields["sgr_"..sgr] then - local fcont = fields["sgr_"..sgr] - wagon.seat_access[sgr] = fcont~="" and fcont or nil - end - end - if fields.lock_couples then - wagon.lock_couples = fields.lock_couples == "true" - end - if fields.text_outside then - if fields.text_outside~="" then - wagon:train().text_outside=fields.text_outside - else - wagon:train().text_outside=nil - end - end - if fields.text_inside then - if fields.text_inside~="" then - wagon:train().text_inside=fields.text_inside - else - wagon:train().text_inside=nil - end - end - - end - end - end - end - end) -end) -function wagon:seating_from_key_helper(pname, fields, no) - local sgr=self.seats[no].group - for _,access in ipairs(self.seat_groups[sgr].access_to) do - if fields["sgr_"..access] and self:check_seat_group_access(pname, access) then - for seatid, seatdef in ipairs(self.seats) do - if seatdef.group==access and not self.seatp[seatid] then - self:get_on(minetest.get_player_by_name(pname), seatid) - return - end - end - end - end - if fields.inv and self.has_inventory and self.get_inventory_formspec then - minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..self.unique_id, wagon:get_inventory_formspec(player:get_player_name())) - end - if fields.prop and self.owner==pname then - self:show_wagon_properties(pname) - end - if fields.dcwarn then - minetest.chat_send_player(pname, attrans("Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off!")) - end - if fields.off then - self:get_off(no) - end -end -function wagon:check_seat_group_access(pname, sgr) - if not self.seat_access then - return true - end - local sae=self.seat_access[sgr] - if not sae or sae=="" then - return true - end - for name in string.gmatch(sae, "%S+") do - if name==pname then - return true - end - end - return false -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 - -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) - return advtrains.pcall(function() - if not pointed_thing.type == "node" then - return - end - - - local node=minetest.get_node_or_nil(pointed_thing.under) - if not node then atprint("[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 - atprint("no track here, not placing.") - return itemstack - end - if not minetest.check_player_privs(placer, {train_place = true }) and minetest.is_protected(pointed_thing.under, placer:get_player_name()) then - minetest.record_protection_violation(pointed_thing.under, placer:get_player_name()) - return - 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.add_entity(pointed_thing.under, "advtrains:"..sysname) - if not ob then - atprint("couldn't add_entity, aborting") - end - local le=ob:get_luaentity() - - le.owner=placer:get_player_name() - - local wagon_uid=le:init_new_instance(id, {}) - - advtrains.add_wagon_to_train(le, id) - if not minetest.settings:get_bool("creative_mode") then - itemstack:take_item() - end - return itemstack - - end) - 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_itrainmap/depends.txt b/advtrains/advtrains_itrainmap/depends.txt deleted file mode 100644 index 6f00bf6..0000000 --- a/advtrains/advtrains_itrainmap/depends.txt +++ /dev/null @@ -1 +0,0 @@ -advtrains \ No newline at end of file diff --git a/advtrains/advtrains_itrainmap/init.lua b/advtrains/advtrains_itrainmap/init.lua deleted file mode 100644 index 756f1da..0000000 --- a/advtrains/advtrains_itrainmap/init.lua +++ /dev/null @@ -1,149 +0,0 @@ - - -local map_def={ - example = { - p1x=168, - p1z=530, - p2x=780, - p2z=1016, - background="itm_example.png", - }, -} - -local itm_cache={} -local itm_pdata={} -local itm_conf_mindia=0.1 - -minetest.register_privilege("itm", { description = "Allows to display train map", give_to_singleplayer = true, default = false }) - -local function create_map_form_with_bg(d) - local minx, minz, maxx, maxz = math.min(d.p1x, d.p2x), math.min(d.p1z, d.p2z), math.max(d.p1x, d.p2x), math.max(d.p1z, d.p2z) - local form_x, form_z=10,10 - local edge_x, edge_z = form_x/(maxx-minx), form_z/(maxz-minz) - local len_x, len_z=math.max(edge_x, itm_conf_mindia), math.max(edge_z, itm_conf_mindia) - local form="size["..(form_x+edge_x)..","..(form_z+edge_z).."] background[0,0;0,0;"..d.background..";true] " - local lbl={} - - for pts, tid in pairs(advtrains.detector.on_node) do - local pos=minetest.string_to_pos(pts) - form=form.."box["..(edge_x*(pos.x-minx))..","..(form_z-(edge_z*(pos.z-minz)))..";"..len_x..","..len_z..";red]" - lbl[sid(tid)]=pos - end - - for t_id, xz in pairs(lbl) do - form=form.."label["..(edge_x*(xz.x-minx))..","..(form_x-(edge_z*(xz.z-minz)))..";"..t_id.."]" - end - return form -end - -local function create_map_form(d) - if d.background then - return create_map_form_with_bg(d) - end - - local minx, minz, maxx, maxz = math.min(d.p1x, d.p2x), math.min(d.p1z, d.p2z), math.max(d.p1x, d.p2x), math.max(d.p1z, d.p2z) - local form_x, form_z=10,10 - local edge_x, edge_z = form_x/(maxx-minx), form_z/(maxz-minz) - local len_x, len_z=math.max(edge_x, itm_conf_mindia), math.max(edge_z, itm_conf_mindia) - local form="size["..(form_x+edge_x)..","..(form_z+edge_z).."]" - local lbl={} - - for x,itx in pairs(itm_cache) do - if x>=minx and x<=maxx then - for z,y in pairs(itx) do - if z>=minz and z<=maxz then - local adn=advtrains.detector.on_node[minetest.pos_to_string({x=x, y=y, z=z})] - local color="gray" - if adn then - color="red" - lbl[sid(adn)]={x=x, z=z} - end - form=form.."box["..(edge_x*(x-minx))..","..(form_z-(edge_z*(z-minz)))..";"..len_x..","..len_z..";"..color.."]" - end - end - end - end - for t_id, xz in pairs(lbl) do - form=form.."label["..(edge_x*(xz.x-minx))..","..(form_x-(edge_z*(xz.z-minz)))..";"..t_id.."]" - end - return form -end - -local function cache_ndb() - itm_cache={} - local ndb_nodes=advtrains.ndb.get_nodes() - for y, xzt in pairs(ndb_nodes) do - for x, zt in pairs(xzt) do - for z, _ in pairs(zt) do - if not itm_cache[x] then - itm_cache[x]={} - end - itm_cache[x][z]=y - end - end - end -end - -minetest.register_chatcommand("itm", { - params="[x1 z1 x2 z2] or [mdef]", - description="Display advtrains train map of given area.\nFirst form:[x1 z1 x2 z2] - specify area directly.\nSecond form:[mdef] - Use a predefined map background(see init.lua)\nThird form: No parameters - use WorldEdit position markers.", - privs={itm=true}, - func = function(name, param) - local mdef=string.match(param, "^(%S+)$") - if mdef then - local d=map_def[mdef] - if not d then - return false, "Map definiton not found: "..mdef - end - itm_pdata[name]=map_def[mdef] - minetest.show_formspec(name, "itrainmap", create_map_form(d)) - return true, "Showing train map: "..mdef - end - local x1, z1, x2, z2=string.match(param, "^(%S+) (%S+) (%S+) (%S+)$") - if not (x1 and z1 and x2 and z2) then - if worldedit then - local wep1, wep2=worldedit.pos1[name], worldedit.pos2[name] - if wep1 and wep2 then - x1, z1, x2, z2=wep1.x, wep1.z, wep2.x, wep2.z - end - end - end - if not (x1 and z1 and x2 and z2) then - return false, "Invalid parameters and no WE positions set" - end - local d={p1x=x1, p1z=z1, p2x=x2, p2z=z2} - itm_pdata[name]=d - minetest.show_formspec(name, "itrainmap", create_map_form(d)) - return true, "Showing ("..x1..","..z1..")-("..x2..","..z2..")" - end, -}) -minetest.register_chatcommand("itm_cache_ndb", { - params="", - description="Cache advtrains node database again. Run when tracks changed.", - privs={itm=true}, - func = function(name, param) - cache_ndb() - return true, "Done caching node database." - end, -}) - -local timer=0 -function advtrains_itm_mainloop(dtime) - timer=timer-math.min(dtime, 0.1) - if timer<=0 then - for pname,d in pairs(itm_pdata) do - minetest.show_formspec(pname, "itrainmap", create_map_form(d)) - end - timer=2 - end -end -minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname=="itrainmap" and fields.quit then - itm_pdata[player:get_player_name()]=nil - end -end) - -function advtrains_itm_init() - --automatically run itm_cache_ndb - minetest.after(2, cache_ndb) -end diff --git a/advtrains/advtrains_itrainmap/textures/itm_example.png b/advtrains/advtrains_itrainmap/textures/itm_example.png deleted file mode 100644 index caf084a..0000000 Binary files a/advtrains/advtrains_itrainmap/textures/itm_example.png and /dev/null differ diff --git a/advtrains/advtrains_luaautomation/README.txt b/advtrains/advtrains_luaautomation/README.txt deleted file mode 100644 index f2219bf..0000000 --- a/advtrains/advtrains_luaautomation/README.txt +++ /dev/null @@ -1,165 +0,0 @@ - -#### Advtrains - Lua Automation features - -This mod offers components that run LUA code and interface with each other through a global environment. It makes complex automated railway systems possible. - -### atlatc -The mod is sometimes abbreviated as 'atlatc'. This stands for AdvTrainsLuaATC. This short name has been chosen for user convenience, since the name of this mod ('advtrains_luaautomation') is very long. - -### Privilege -To perform any operations using this mod (except executing operation panels), players need the "atlatc" privilege. -This privilege should never be granted to anyone except trusted administrators. Even though the LUA environment is sandboxed, it is still possible to DoS the server by coding infinite loops or requesting expotentially growing interrupts. - -### Active and passive -Active components are these who have LUA code running in them. They are triggered on specific events. Passive components are dumb, they only have a state and can be set to another state, they can't perform actions themselves. - -### Environments - -Each active component is assigned to an environment. This is where all data are held. Components in different environments can't inferface with each other. -This system allows multiple independent automation systems to run simultaneously without polluting each other's environment. - -/env_create -Create environment with the given name. To be able to do anything, you first need to create an environment. Choose the name wisely, you can't change it afterwards. - -/env_setup -Invoke the form to edit the environment's initialization code. For more information, see the section on active components. You can also delete an environment from here. - -### Active components - -The code of every active component is run on specific events which are explained soon. When run, every variable written that is not local and is no function or userdata is saved over code re-runs and over server restarts. Additionally, the following global variables are defined: - -# event -The variable 'event' contains a table with information on the current event. How this table can look is explained below. - -# S -The variable 'S' contains a table which is shared between all components of the environment. Its contents are persistent over server restarts. May not contain functions, every other value is allowed. -Example: -Component 1: S.stuff="foo" -Component 2: print(S.stuff) --> foo - -# F -The variable 'F' also contains a table which is shared between all components of the environment. Its contents are discarded on server shutdown or when the init code gets re-run. Every data type is allowed, even functions. -The purpose of this table is not to save data, but to provide static value and function definitions. The table should be populated by the init code. - -# Standard Lua functions -The following standard Lua libraries are available: -string, math, table, os -The following standard Lua functions are available: -assert, error, ipairs, pairs, next, select, tonumber, tostring, type, unpack - -Every attempt to overwrite any of the predefined values results in an error. - -# LuaAutomation-specific global functions - -POS(x,y,z) -Shorthand function to create a position vector {x=?, y=?, z=?} with less characters - -getstate(pos) -Get the state of the passive component at position 'pos'. See section on passive components for more info. -pos can be either a position vector (created by POS()) or a string, the name of this passive component. - -setstate(pos, newstate) -Set the state of the passive component at position 'pos'. -pos can be either a position vector (created by POS()) or a string, the name of this passive component. - -interrupt(time, message) -Cause LuaAutomation to trigger an 'int' event on this component after the given time in seconds with the specified 'message' field. 'message' can be of any Lua data type. -Not available in init code! - -interrupt_pos(pos, message) -Immediately trigger an 'ext_int' event on the active component at position pos. 'message' is like in interrupt(). -USE WITH CARE, or better don't use! Incorrect use can result in expotential growth of interrupts. - -## Components and events - -The event table is a table of the following format: -{ - type = "", - = true, - ... additional content ... -} -You can check for the event type by either using -if event.type == "wanted" then ...do stuff... end -or -if event.wanted then ...do stuff... end -(if 'wanted' is the event type to check for) - -# Init code -The initialization code is not a component as such, but rather a part of the whole environment. It can (and should) be used to make definitions that other components can refer to. -Examples: -A function to define behavior for trains in subway stations: -function F.station() - if event.train then atc_send("B0WOL") end - if event.int and event.message="depart" then atc_send("OCD1SM") end -end - -The init code is run whenever the F table needs to be refilled with data. This is the case on server startup and whenever the init code is changed and you choose to run it. -Functions are run in the environment of the currently active node, regardless of where they were defined. So, the 'event' table always reflects the state of the calling node. - -The 'event' table of the init code is always {type="init", init=true}. - -# ATC rails -The Lua-controlled ATC rails are the only components that can actually interface with trains. The following event types are generated: - -{type="train", train=true, id=""} -This event is fired when a train enters the rail. The field 'id' is the unique train ID, which is a long string (generated by concatenating os.time() and os.clock() at creation time). The Itrainmap mod displays the last 4 digits of this ID. - -{type="int", int=true, message=} -Fired when an interrupt set by the 'interrupt' function runs out. 'message' is the message passed to the interrupt function. -{type="ext_int", ext_int=true, message=} -Fired when another node called 'interrupt_pos' on this position. 'message' is the message passed to the interrupt_pos function. - -In addition to the default environment functions, the following functions are available: - -atc_send() - Sends the specified ATC command to the train and returns true. If there is no train, returns false and does nothing. -atc_reset() - Resets the train's current ATC command. If there is no train, returns false and does nothing. -atc_arrow - Boolean, true when the train is driving in the direction of the arrows of the ATC rail. Nil if there is no train. -atc_id - Train ID of the train currently passing the controller. Nil if there's no train. -atc_speed - Speed of the train, or nil if there is no train. -atc_set_text_outside(text) - Set text shown on the outside of the train. Pass nil to show no text. -atc_set_text_inside(text) - Set text shown to train passengers. Pass nil to show no text. - -# Operator panel -This simple node executes its actions when punched. It can be used to change a switch and update the corresponding signals or similar applications. - -The event fired is {type="punch", punch=true} by default. In case of an interrupt, the events are similar to the ones of the ATC rail. - -### Passive components - -All passive components can be interfaced with the setstate and getstate functions(see above). -Below, each apperance is mapped to the "state" of that node. - -## Signals -The light signals are interfaceable, the analog signals are not. -"green" - Signal shows green light -"red" - Signal shows red light - -## Switches -All default rail switches are interfaceable, independent of orientation. -"cr" - The switch is set in the direction that is not straight. -"st" - The switch is set in the direction that is straight. - -## Mesecon Switch -The Mesecon switch can be switched using LuaAutomation. Note that this is not possible on levers, only the full-node 'Switch' block. -"on" - the switch is switched on -"off" - the switch is switched off - -##Andrew's Cross -"on" - it blinks -"off" - it does not blink - -### Passive component naming -You can assign names to passive components using the Passive Component Naming tool. -Once you set a name for any component, you can reference it by that name in the getstate() and setstate() functions, like this: -(Imagine a signal that you have named "Stn_P1_out" at position (1,2,3) ) -setstate("Stn_P1_out", "green") instead of setstate(POS(1,2,3), "green") -This way, you don't need to memorize positions. - diff --git a/advtrains/advtrains_luaautomation/active_common.lua b/advtrains/advtrains_luaautomation/active_common.lua deleted file mode 100644 index 8c910c6..0000000 --- a/advtrains/advtrains_luaautomation/active_common.lua +++ /dev/null @@ -1,134 +0,0 @@ - - -local ac = {nodes={}} - -function ac.load(data) - if data then - ac.nodes=data.nodes - end -end -function ac.save() - return {nodes = ac.nodes} -end - -function ac.after_place_node(pos, player) - advtrains.ndb.update(pos) - local meta=minetest.get_meta(pos) - meta:set_string("formspec", ac.getform(pos, meta)) - meta:set_string("infotext", "LuaAutomation component, unconfigured.") - local ph=minetest.pos_to_string(pos) - --just get first available key! - for en,_ in pairs(atlatc.envs) do - ac.nodes[ph]={env=en} - return - end -end -function ac.getform(pos, meta_p) - local meta = meta_p or minetest.get_meta(pos) - local envs_asvalues={} - - local ph=minetest.pos_to_string(pos) - local nodetbl = ac.nodes[ph] - local env, code, err = nil, "", "" - if nodetbl then - code=nodetbl.code or "" - err=nodetbl.err or "" - env=nodetbl.env or "" - end - local sel = 1 - for n,_ in pairs(atlatc.envs) do - envs_asvalues[#envs_asvalues+1]=n - if n==env then - sel=#envs_asvalues - end - end - local form = "size[10,10]dropdown[0,0;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" - .."button[4,0;2,1;save;Save]button[7,0;2,1;cle;Clear local env] textarea[0.2,1;10,10;code;Code;"..minetest.formspec_escape(code).."]" - .."label[0,9.8;"..err.."]" - return form -end - -function ac.after_dig_node(pos, node, player) - advtrains.invalidate_all_paths(pos) - advtrains.ndb.clear(pos) - local ph=minetest.pos_to_string(pos) - ac.nodes[ph]=nil -end - -function ac.on_receive_fields(pos, formname, fields, player) - if not minetest.check_player_privs(player:get_player_name(), {atlatc=true}) then - minetest.chat_send_player(player:get_player_name(), "Missing privilege: atlatc - Operation cancelled!") - return - end - - local meta=minetest.get_meta(pos) - local ph=minetest.pos_to_string(pos) - local nodetbl = ac.nodes[ph] or {} - --if fields.quit then return end - if fields.env then - nodetbl.env=fields.env - end - if fields.code then - nodetbl.code=fields.code - end - if fields.save then - nodetbl.err=nil - end - if fields.cle then - nodetbl.data={} - end - - ac.nodes[ph]=nodetbl - - meta:set_string("formspec", ac.getform(pos, meta)) - if nodetbl.env then - meta:set_string("infotext", "LuaAutomation component, assigned to environment '"..nodetbl.env.."'") - else - meta:set_string("infotext", "LuaAutomation component, invalid enviroment set!") - end -end - -function ac.run_in_env(pos, evtdata, customfct_p) - local ph=minetest.pos_to_string(pos) - local nodetbl = ac.nodes[ph] - if not nodetbl then - atwarn("LuaAutomation component at",ph,": Data not in memory! Please visit component and click 'Save'!") - return - end - - local meta - if minetest.get_node_or_nil(pos) then - meta=minetest.get_meta(pos) - end - - if not nodetbl.env or not atlatc.envs[nodetbl.env] then - atwarn("LuaAutomation component at",ph,": Not an existing environment: "..(nodetbl.env or "")) - return false - end - if not nodetbl.code or nodetbl.code=="" then - atwarn("LuaAutomation component at",ph,": No code to run! (insert -- to suppress warning)") - return false - end - - local customfct=customfct_p or {} - customfct.interrupt=function(t, imesg) - atlatc.interrupt.add(t, pos, {type="int", int=true, message=imesg}) - end - - local datain=nodetbl.data or {} - local succ, dataout = atlatc.envs[nodetbl.env]:execute_code(datain, nodetbl.code, evtdata, customfct) - if succ then - atlatc.active.nodes[ph].data=atlatc.remove_invalid_data(dataout) - else - atlatc.active.nodes[ph].err=dataout - atwarn("LuaAutomation ATC interface rail at",ph,": LUA Error:",dataout) - if meta then - meta:set_string("infotext", "LuaAutomation ATC interface rail, ERROR:"..dataout) - end - end - if meta then - meta:set_string("formspec", ac.getform(pos, meta)) - end -end - -atlatc.active=ac diff --git a/advtrains/advtrains_luaautomation/atc_rail.lua b/advtrains/advtrains_luaautomation/atc_rail.lua deleted file mode 100644 index 3ec82c8..0000000 --- a/advtrains/advtrains_luaautomation/atc_rail.lua +++ /dev/null @@ -1,124 +0,0 @@ --- atc_rail.lua --- registers and handles the ATC rail. Active component. --- This is the only component that can interface with trains, so train interface goes here too. - ---Using subtable -local r={} - -function r.fire_event(pos, evtdata) - - local ph=minetest.pos_to_string(pos) - local railtbl = atlatc.active.nodes[ph] - - if not railtbl then - atwarn("LuaAutomation ATC interface rail at",ph,": Data not in memory! Please visit position and click 'Save'!") - return - end - - - local arrowconn = railtbl.arrowconn - if not arrowconn then - atwarn("LuaAutomation ATC interface rail at",ph,": Incomplete Data! Please visit position and click 'Save'!") - return - end - - --prepare ingame API for ATC. Regenerate each time since pos needs to be known - --If no train, then return false. - local train_id=advtrains.detector.on_node[ph] - local train, atc_arrow, tvel - if train_id then train=advtrains.trains[train_id] end - if train then - if not train.path then - --we happened to get in between an invalidation step - --delay - atlatc.interrupt.add(0,pos,evtdata) - return - end - for index, ppos in pairs(train.path) do - if vector.equals(advtrains.round_vector_floor_y(ppos), pos) then - atc_arrow = - vector.equals( - advtrains.dirCoordSet(pos, arrowconn), - advtrains.round_vector_floor_y(train.path[index+train.movedir]) - ) - end - end - if atc_arrow==nil then - atwarn("LuaAutomation ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!") - atc_arrow=true - end - tvel=train.velocity - end - local customfct={ - atc_send = function(cmd) - if not train_id then return false end - assertt(cmd, "string") - advtrains.atc.train_reset_command(train_id) - train.atc_command=cmd - train.atc_arrow=atc_arrow - return true - end, - atc_reset = function(cmd) - if not train_id then return false end - assertt(cmd, "string") - advtrains.atc.train_reset_command(train_id) - return true - end, - atc_arrow = atc_arrow, - atc_id = train_id, - atc_speed = tvel, - atc_set_text_outside = function(text) - if not train_id then return false end - if text then assertt(text, "string") end - advtrains.trains[train_id].text_outside=text - return true - end, - atc_set_text_inside = function(text) - if not train_id then return false end - if text then assertt(text, "string") end - advtrains.trains[train_id].text_inside=text - return true - end, - } - - atlatc.active.run_in_env(pos, evtdata, customfct) - -end - -advtrains.register_tracks("default", { - nodename_prefix="advtrains_luaautomation:dtrack", - texture_prefix="advtrains_dtrack_atc", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_atc.png", - description=atltrans("LuaAutomation ATC Rail"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_place_node = atlatc.active.after_place_node, - after_dig_node = atlatc.active.after_dig_node, - - on_receive_fields = function(pos, ...) - atlatc.active.on_receive_fields(pos, ...) - - --set arrowconn (for ATC) - local ph=minetest.pos_to_string(pos) - local _, conn1=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) - atlatc.active.nodes[ph].arrowconn=conn1 - end, - - advtrains = { - on_train_enter = function(pos, train_id) - --do async. Event is fired in train steps - atlatc.interrupt.add(0, pos, {type="train", train=true, id=train_id}) - end, - }, - luaautomation = { - fire_event=r.fire_event - } - } - end -}, advtrains.trackpresets.t_30deg_straightonly) - - -atlatc.rail = r diff --git a/advtrains/advtrains_luaautomation/chatcmds.lua b/advtrains/advtrains_luaautomation/chatcmds.lua deleted file mode 100644 index 2d0c69d..0000000 --- a/advtrains/advtrains_luaautomation/chatcmds.lua +++ /dev/null @@ -1,84 +0,0 @@ ---chatcmds.lua ---Registers commands to modify the init and step code for LuaAutomation - ---position helper. ---punching a node will result in that position being saved and inserted into a text field on the top of init form. -local punchpos={} - -minetest.register_on_punchnode(function(pos, node, player, pointed_thing) - local pname=player:get_player_name() - punchpos[pname]=pos -end) - -local function get_init_form(env, pname) - local err = env.init_err or "" - local code = env.init_code or "" - local ppos=punchpos[pname] - local pp="" - if ppos then - pp="POS"..minetest.pos_to_string(ppos) - end - local form = "size[10,10]button[0,0;2,1;run;Run InitCode]button[2,0;2,1;cls;Clear S]" - .."button[4,0;2,1;save;Save] button[6,0;2,1;del;Delete Env.] field[8.1,0.5;2,1;punchpos;Last punched position;"..pp.."]" - .."textarea[0.2,1;10,10;code;Environment initialization code;"..minetest.formspec_escape(code).."]" - .."label[0,9.8;"..err.."]" - return form -end - -core.register_chatcommand("env_setup", { - params = "", - description = "Set up and modify AdvTrains LuaAutomation environment", - privs = {atlatc=true}, - func = function(name, param) - local env=atlatc.envs[param] - if not env then return false,"Invalid environment name!" end - minetest.show_formspec(name, "atlatc_envsetup_"..param, get_init_form(env, name)) - return true - end, -}) - -core.register_chatcommand("env_create", { - params = "", - description = "Create an AdvTrains LuaAutomation environment", - privs = {atlatc=true}, - func = function(name, param) - if not param or param=="" then return false, "Name required!" end - if atlatc.envs[param] then return false, "Environment already exists!" end - atlatc.envs[param] = atlatc.env_new(param) - return true, "Created environment '"..param.."'. Use '/env_setup "..param.."' to define global initialization code, or start building LuaATC components!" - end, -}) - - -minetest.register_on_player_receive_fields(function(player, formname, fields) - - local pname=player:get_player_name() - if not minetest.check_player_privs(pname, {atlatc=true}) then return end - - local envname=string.match(formname, "^atlatc_delconfirm_(.+)$") - if envname and fields.sure=="YES" then - atlatc.envs[envname]=nil - minetest.chat_send_player(pname, "Environment deleted!") - return - end - - envname=string.match(formname, "^atlatc_envsetup_(.+)$") - if not envname then return end - - local env=atlatc.envs[envname] - if not env then return end - - if fields.del then - minetest.show_formspec(pname, "atlatc_delconfirm_"..envname, "field[sure;"..minetest.formspec_escape("SURE TO DELETE ENVIRONMENT "..envname.."? Type YES (all uppercase) to continue or just quit form to cancel.")..";]") - return - end - - env.init_err=nil - if fields.code then - env.init_code=fields.code - end - if fields.run then - env:run_initcode() - minetest.show_formspec(pname, formname, get_init_form(env, pname)) - end -end) diff --git a/advtrains/advtrains_luaautomation/depends.txt b/advtrains/advtrains_luaautomation/depends.txt deleted file mode 100644 index 602cf47..0000000 --- a/advtrains/advtrains_luaautomation/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -advtrains -mesecons_switch? \ No newline at end of file diff --git a/advtrains/advtrains_luaautomation/environment.lua b/advtrains/advtrains_luaautomation/environment.lua deleted file mode 100644 index 0b25e87..0000000 --- a/advtrains/advtrains_luaautomation/environment.lua +++ /dev/null @@ -1,275 +0,0 @@ -------------- --- lua sandboxed environment - --- function to cross out functions and userdata. --- modified from dump() -function atlatc.remove_invalid_data(o, nested) - if o==nil then return nil end - local valid_dt={["nil"]=true, boolean=true, number=true, string=true} - if type(o) ~= "table" then - --check valid data type - if not valid_dt[type(o)] then - return nil - end - return o - end - -- Contains table -> true/nil of currently nested tables - nested = nested or {} - if nested[o] then - return nil - end - nested[o] = true - for k, v in pairs(o) do - v = atlatc.remove_invalid_data(v, nested) - end - nested[o] = nil - return o -end - - -local env_proto={ - load = function(self, envname, data) - self.name=envname - self.sdata=data.sdata and atlatc.remove_invalid_data(data.sdata) or {} - self.fdata={} - self.init_code=data.init_code or "" - self.step_code=data.step_code or "" - end, - save = function(self) - -- throw any function values out of the sdata table - self.sdata = atlatc.remove_invalid_data(self.sdata) - return {sdata = self.sdata, init_code=self.init_code, step_code=self.step_code} - end, -} - ---Environment ---Code modified from mesecons_luacontroller (credit goes to Jeija and mesecons contributors) - -local safe_globals = { - "assert", "error", "ipairs", "next", "pairs", "select", - "tonumber", "tostring", "type", "unpack", "_VERSION" -} - ---print is actually minetest.chat_send_all() ---using advtrains.print_concat_table because it's cool -local function safe_print(t, ...) - local str=advtrains.print_concat_table({t, ...}) - minetest.log("action", "[atlatc] "..str) - minetest.chat_send_all(str) -end - -local function safe_date() - return(os.date("*t",os.time())) -end - --- string.rep(str, n) with a high value for n can be used to DoS --- the server. Therefore, limit max. length of generated string. -local function safe_string_rep(str, n) - if #str * n > 2000 then - debug.sethook() -- Clear hook - error("string.rep: string length overflow", 2) - end - - return string.rep(str, n) -end - --- string.find with a pattern can be used to DoS the server. --- Therefore, limit string.find to patternless matching. --- Note: Disabled security since there are enough security leaks and this would be unneccessary anyway to DoS the server -local function safe_string_find(...) - --if (select(4, ...)) ~= true then - -- debug.sethook() -- Clear hook - -- error("string.find: 'plain' (fourth parameter) must always be true for security reasons.") - --end - - return string.find(...) -end - -local mp=minetest.get_modpath("advtrains_luaautomation") -local p_api_getstate, p_api_setstate = dofile(mp.."/passive.lua") - -local static_env = { - --core LUA functions - print = safe_print, - string = { - byte = string.byte, - char = string.char, - format = string.format, - len = string.len, - lower = string.lower, - upper = string.upper, - rep = safe_string_rep, - reverse = string.reverse, - sub = string.sub, - find = safe_string_find, - }, - math = { - abs = math.abs, - acos = math.acos, - asin = math.asin, - atan = math.atan, - atan2 = math.atan2, - ceil = math.ceil, - cos = math.cos, - cosh = math.cosh, - deg = math.deg, - exp = math.exp, - floor = math.floor, - fmod = math.fmod, - frexp = math.frexp, - huge = math.huge, - ldexp = math.ldexp, - log = math.log, - log10 = math.log10, - max = math.max, - min = math.min, - modf = math.modf, - pi = math.pi, - pow = math.pow, - rad = math.rad, - random = math.random, - sin = math.sin, - sinh = math.sinh, - sqrt = math.sqrt, - tan = math.tan, - tanh = math.tanh, - }, - table = { - concat = table.concat, - insert = table.insert, - maxn = table.maxn, - remove = table.remove, - sort = table.sort, - }, - os = { - clock = os.clock, - difftime = os.difftime, - time = os.time, - date = safe_date, - }, - POS = function(x,y,z) return {x=x, y=y, z=z} end, - getstate = p_api_getstate, - setstate = p_api_setstate, - --interrupts are handled per node, position unknown. - --however external interrupts can be set here. - interrupt_pos = function(pos, imesg) - if not type(pos)=="table" or not pos.x or not pos.y or not pos.z then - debug.sethook() - error("Invalid position supplied to interrupt_pos") - end - atlatc.interrupt.add(0, pos, {type="ext_int", ext_int=true, message=imesg}) - end, -} - -for _, name in pairs(safe_globals) do - static_env[name] = _G[name] -end - - ---The environment all code calls get is a table that has set static_env as metatable. ---In general, every variable is local to a single code chunk, but kept persistent over code re-runs. Data is also saved, but functions and userdata and circular references are removed ---Init code and step code's environments are not saved --- S - Table that can contain any save data global to the environment. Will be saved statically. Can't contain functions or userdata or circular references. --- F - Table global to the environment, can contain volatile data that is deleted when server quits. --- The init code should populate this table with functions and other definitions. - -local proxy_env={} ---proxy_env gets a new metatable in every run, but is the shared environment of all functions ever defined. - --- returns: true, fenv if successful; nil, error if error -function env_proto:execute_code(localenv, code, evtdata, customfct) - local metatbl ={ - __index = function(t, i) - if i=="S" then - return self.sdata - elseif i=="F" then - return self.fdata - elseif i=="event" then - return evtdata - elseif customfct and customfct[i] then - return customfct[i] - elseif localenv and localenv[i] then - return localenv[i] - end - return static_env[i] - end, - __newindex = function(t, i, v) - if i=="S" or i=="F" or i=="event" or (customfct and customfct[i]) or static_env[i] then - debug.sethook() - error("Trying to overwrite environment contents") - end - localenv[i]=v - end, - } - setmetatable(proxy_env, metatbl) - local fun, err=loadstring(code) - if not fun then - return false, err - end - - setfenv(fun, proxy_env) - local succ, data = pcall(fun) - if succ then - data=localenv - end - return succ, data -end - -function env_proto:run_initcode() - if self.init_code and self.init_code~="" then - local old_fdata=self.fdata - self.fdata = {} - atprint("[atlatc]Running initialization code for environment '"..self.name.."'") - local succ, err = self:execute_code({}, self.init_code, {type="init", init=true}) - if not succ then - atwarn("[atlatc]Executing InitCode for '"..self.name.."' failed:"..err) - self.init_err=err - if old_fdata then - self.fdata=old_fdata - atwarn("[atlatc]The 'F' table has been restored to the previous state.") - end - end - end -end -function env_proto:run_stepcode() - if self.step_code and self.step_code~="" then - local succ, err = self:execute_code({}, self.step_code, nil, {}) - if not succ then - --TODO - end - end -end - ---- class interface - -function atlatc.env_new(name) - local newenv={ - name=name, - init_code="", - step_code="", - sdata={} - } - setmetatable(newenv, {__index=env_proto}) - return newenv -end -function atlatc.env_load(name, data) - local newenv={} - setmetatable(newenv, {__index=env_proto}) - newenv:load(name, data) - return newenv -end - -function atlatc.run_initcode() - for envname, env in pairs(atlatc.envs) do - env:run_initcode() - end -end -function atlatc.run_stepcode() - for envname, env in pairs(atlatc.envs) do - env:run_stepcode() - end -end - - - - diff --git a/advtrains/advtrains_luaautomation/init.lua b/advtrains/advtrains_luaautomation/init.lua deleted file mode 100644 index 0257aef..0000000 --- a/advtrains/advtrains_luaautomation/init.lua +++ /dev/null @@ -1,110 +0,0 @@ --- advtrains_luaautomation/init.lua --- Lua automation features for advtrains --- Uses global table 'atlatc' (AdvTrains_LuaATC) - --- Boilerplate to support localized strings if intllib mod is installed. -if minetest.get_modpath("intllib") then - atltrans = intllib.Getter() -else - atltrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - ---Privilege ---Only trusted players should be enabled to build stuff which can break the server. - -atlatc = { envs = {}} - -minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false }) - ---assertt helper. error if a variable is not of a type -function assertt(var, typ) - if type(var)~=typ then - error("Assertion failed, variable has to be of type "..typ) - end -end - -local mp=minetest.get_modpath("advtrains_luaautomation") -if not mp then - error("Mod name error: Mod folder is not named 'advtrains_luaautomation'!") -end -dofile(mp.."/environment.lua") -dofile(mp.."/interrupt.lua") -dofile(mp.."/active_common.lua") -dofile(mp.."/atc_rail.lua") -dofile(mp.."/operation_panel.lua") -dofile(mp.."/pcnaming.lua") -if mesecon then - dofile(mp.."/p_mesecon_iface.lua") -end -dofile(mp.."/chatcmds.lua") - - -local filename=minetest.get_worldpath().."/advtrains_luaautomation" - -function atlatc.load() - local file, err = io.open(filename, "r") - if not file then - minetest.log("error", " Failed to read advtrains_luaautomation save data from file "..filename..": "..(err or "Unknown Error")) - else - atprint("luaautomation reading file:",filename) - local tbl = minetest.deserialize(file:read("*a")) - if type(tbl) == "table" then - if tbl.version==1 then - for envname, data in pairs(tbl.envs) do - atlatc.envs[envname]=atlatc.env_load(envname, data) - end - atlatc.active.load(tbl.active) - atlatc.interrupt.load(tbl.interrupt) - atlatc.pcnaming.load(tbl.pcnaming) - end - else - minetest.log("error", " Failed to read advtrains_luaautomation save data from file "..filename..": Not a table!") - end - file:close() - end - -- run init code of all environments - atlatc.run_initcode() -end - - -atlatc.save = function() - --versions: - -- 1 - Initial save format. - - local envdata={} - for envname, env in pairs(atlatc.envs) do - envdata[envname]=env:save() - end - local save_tbl={ - version = 1, - envs=envdata, - active = atlatc.active.save(), - interrupt = atlatc.interrupt.save(), - pcnaming = atlatc.pcnaming.save(), - } - - local datastr = minetest.serialize(save_tbl) - if not datastr then - minetest.log("error", " Failed to save advtrains_luaautomation save data to file "..filename..": Can't serialize!") - return - end - local file, err = io.open(filename, "w") - if err then - minetest.log("error", " Failed to save advtrains_luaautomation save data to file "..filename..": "..(err or "Unknown Error")) - return - end - file:write(datastr) - file:close() -end - - --- globalstep for step code -local timer, step_int=0, 2 - -function atlatc.mainloop_stepcode(dtime) - timer=timer+dtime - if timer>step_int then - timer=0 - atlatc.run_stepcode() - end -end diff --git a/advtrains/advtrains_luaautomation/interrupt.lua b/advtrains/advtrains_luaautomation/interrupt.lua deleted file mode 100644 index 718b8c7..0000000 --- a/advtrains/advtrains_luaautomation/interrupt.lua +++ /dev/null @@ -1,46 +0,0 @@ --- interrupt.lua --- implements interrupt queue - ---to be saved: pos and evtdata -local iq={} -local queue={} -local timer=0 -local run=false - -function iq.load(data) - local d=data or {} - queue = d.queue or {} - timer = d.timer or 0 -end -function iq.save() - return {queue = queue, timer=timer} -end - -function iq.add(t, pos, evtdata) - queue[#queue+1]={t=t+timer, p=pos, e=evtdata} - run=true -end - -function iq.mainloop(dtime) - timer=timer + math.min(dtime, 0.2) - for i=1,#queue do - local qe=queue[i] - if not qe then - table.remove(queue, i) - i=i-1 - elseif timer>qe.t then - local pos, evtdata=queue[i].p, queue[i].e - local node=advtrains.ndb.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - if ndef and ndef.luaautomation and ndef.luaautomation.fire_event then - ndef.luaautomation.fire_event(pos, evtdata) - end - table.remove(queue, i) - i=i-1 - end - end -end - - - -atlatc.interrupt=iq diff --git a/advtrains/advtrains_luaautomation/operation_panel.lua b/advtrains/advtrains_luaautomation/operation_panel.lua deleted file mode 100644 index 1d585f7..0000000 --- a/advtrains/advtrains_luaautomation/operation_panel.lua +++ /dev/null @@ -1,23 +0,0 @@ - -local function on_punch(pos, player) - atlatc.interrupt.add(0, pos, {type="punch", punch=true}) -end - - -minetest.register_node("advtrains_luaautomation:oppanel", { - drawtype = "normal", - tiles={"atlatc_oppanel.png"}, - description = "LuaAutomation operation panel", - groups = { - choppy = 1, - save_in_nodedb=1, - }, - after_place_node = atlatc.active.after_place_node, - after_dig_node = atlatc.active.after_dig_node, - on_receive_fields = atlatc.active.on_receive_fields, - on_punch = on_punch, - luaautomation = { - fire_event=atlatc.active.run_in_env - } - -}) diff --git a/advtrains/advtrains_luaautomation/p_display.lua b/advtrains/advtrains_luaautomation/p_display.lua deleted file mode 100644 index e69de29..0000000 diff --git a/advtrains/advtrains_luaautomation/p_mesecon_iface.lua b/advtrains/advtrains_luaautomation/p_mesecon_iface.lua deleted file mode 100644 index 95e5d8a..0000000 --- a/advtrains/advtrains_luaautomation/p_mesecon_iface.lua +++ /dev/null @@ -1,53 +0,0 @@ --- p_mesecon_iface.lua --- Mesecons interface by overriding the switch - -if not mesecon then return end - -minetest.override_item("mesecons_switch:mesecon_switch_off", { - groups = { - dig_immediate=2, - save_in_nodedb=1, - }, - on_rightclick = function (pos, node) - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2}) - mesecon.receptor_on(pos) - minetest.sound_play("mesecons_switch", {pos=pos}) - end, - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_off(pos) - end, - luaautomation = { - getstate = "off", - setstate = function(pos, node, newstate) - if newstate=="on" then - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2}) - mesecon.receptor_on(pos) - end - end, - }, -}) - -minetest.override_item("mesecons_switch:mesecon_switch_on", { - groups = { - dig_immediate=2, - save_in_nodedb=1, - not_in_creative_inventory=1, - }, - on_rightclick = function (pos, node) - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_off", param2=node.param2}) - mesecon.receptor_off(pos) - minetest.sound_play("mesecons_switch", {pos=pos}) - end, - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_on(pos) - end, - luaautomation = { - getstate = "on", - setstate = function(pos, node, newstate) - if newstate=="off" then - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_off", param2=node.param2}) - mesecon.receptor_off(pos) - end - end, - }, -}) diff --git a/advtrains/advtrains_luaautomation/passive.lua b/advtrains/advtrains_luaautomation/passive.lua deleted file mode 100644 index 774df8a..0000000 --- a/advtrains/advtrains_luaautomation/passive.lua +++ /dev/null @@ -1,39 +0,0 @@ --- passive.lua --- API to passive components, as described in passive_api.txt - -local function getstate(parpos) - local pos=atlatc.pcnaming.resolve_pos(parpos) - if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then - debug.sethook() - error("Invalid position supplied to getstate") - end - local node=advtrains.ndb.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - if ndef and ndef.luaautomation and ndef.luaautomation.getstate then - local st=ndef.luaautomation.getstate - if type(st)=="function" then - return st(pos, node) - else - return st - end - end - return nil -end - -local function setstate(parpos, newstate) - local pos=atlatc.pcnaming.resolve_pos(parpos) - if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then - debug.sethook() - error("Invalid position supplied to setstate") - end - local node=advtrains.ndb.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - if ndef and ndef.luaautomation and ndef.luaautomation.setstate then - local st=ndef.luaautomation.setstate - st(pos, node, newstate) - end -end - --- gets called from environment.lua --- return the values here to keep them local -return getstate, setstate diff --git a/advtrains/advtrains_luaautomation/passive_api.txt b/advtrains/advtrains_luaautomation/passive_api.txt deleted file mode 100644 index a735208..0000000 --- a/advtrains/advtrains_luaautomation/passive_api.txt +++ /dev/null @@ -1,23 +0,0 @@ -Lua Automation - Passive Component API - -Passive components are nodes that do not have code running in them. However, active components can query these and request actions from them. Examples: -Switches -Signals -Displays -Mesecon Transmitter - -All passive components have a table called 'luaautomation' in their node definition and have the group 'save_in_nodedb' set, so they work in unloaded chunks. -Example for a switch: -luaautomation = { - getstate = function(pos, node) - return "st" - end, - -- OR - getstate = "st", - - setstate = function(pos, node, newstate) - if newstate=="cr" then - advtrains.ndb.swap_node(pos, ) - end - end -} \ No newline at end of file diff --git a/advtrains/advtrains_luaautomation/pcnaming.lua b/advtrains/advtrains_luaautomation/pcnaming.lua deleted file mode 100644 index 56ed2d6..0000000 --- a/advtrains/advtrains_luaautomation/pcnaming.lua +++ /dev/null @@ -1,74 +0,0 @@ ---pcnaming.lua ---a.k.a Passive component naming ---Allows to assign names to passive components, so they can be called like: ---setstate("iamasignal", "green") -atlatc.pcnaming={name_map={}} -function atlatc.pcnaming.load(stuff) - if type(stuff)=="table" then - atlatc.pcnaming.name_map=stuff - end -end -function atlatc.pcnaming.save() - return atlatc.pcnaming.name_map -end - -function atlatc.pcnaming.resolve_pos(posorname) - if type(posorname)=="table" then return posorname end - return atlatc.pcnaming.name_map[posorname] -end - -minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ - description = attrans("Passive Component Naming Tool\n\nRight-click to name a passive component."), - groups = {cracky=1}, -- key=name, value=rating; rating=1..3. - inventory_image = "atlatc_pcnaming.png", - wield_image = "atlatc_pcnaming.png", - stack_max = 1, - on_place = function(itemstack, placer, pointed_thing) - local pname = placer:get_player_name() - if not pname then - return - end - if not minetest.check_player_privs(pname, {atlatc=true}) then - minetest.chat_send_player(pname, "Missing privilege: atlatc") - return - end - if pointed_thing.type=="node" then - local pos=pointed_thing.under - if advtrains.is_protected(pos, pname) then - minetest.record_protection_violation(pos, pname) - return - end - local node=minetest.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - if ndef then - if ndef.luaautomation then - --look if this one already has a name - local pn="" - for name, npos in pairs(atlatc.pcnaming.name_map) do - if vector.equals(npos, pos) then - pn=name - end - end - minetest.show_formspec(pname, "atlatc_naming_"..minetest.pos_to_string(pos), "field[pn;Set name of component (empty to clear);"..pn.."]") - end - end - end - end, -}) -minetest.register_on_player_receive_fields(function(player, formname, fields) - local pts=string.match(formname, "^atlatc_naming_(.+)") - if pts then - local pos=minetest.string_to_pos(pts) - if fields.pn then - --first remove all occurences - for name, npos in pairs(atlatc.pcnaming.name_map) do - if vector.equals(npos, pos) then - atlatc.pcnaming.name_map[name]=nil - end - end - if fields.pn~="" then - atlatc.pcnaming.name_map[fields.pn]=pos - end - end - end -end) diff --git a/advtrains/advtrains_luaautomation/textures/atlatc_oppanel.png b/advtrains/advtrains_luaautomation/textures/atlatc_oppanel.png deleted file mode 100644 index 96eb30e..0000000 Binary files a/advtrains/advtrains_luaautomation/textures/atlatc_oppanel.png and /dev/null differ diff --git a/advtrains/advtrains_luaautomation/textures/atlatc_pcnaming.png b/advtrains/advtrains_luaautomation/textures/atlatc_pcnaming.png deleted file mode 100644 index 3fccdfc..0000000 Binary files a/advtrains/advtrains_luaautomation/textures/atlatc_pcnaming.png and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/depends.txt b/advtrains/advtrains_train_industrial/depends.txt deleted file mode 100644 index 1fb6665..0000000 --- a/advtrains/advtrains_train_industrial/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -advtrains -intllib? \ No newline at end of file diff --git a/advtrains/advtrains_train_industrial/init.lua b/advtrains/advtrains_train_industrial/init.lua deleted file mode 100644 index ebf8d65..0000000 --- a/advtrains/advtrains_train_industrial/init.lua +++ /dev/null @@ -1,84 +0,0 @@ --- Boilerplate to support localized strings if intllib mod is installed. -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - -advtrains.register_wagon("engine_industrial", { - mesh="advtrains_engine_industrial.b3d", - textures = {"advtrains_engine_industrial.png"}, - drives_on={default=true}, - max_speed=20, - seats = { - { - name=S("Driver Stand (left)"), - attach_offset={x=-5, y=10, z=-10}, - view_offset={x=0, y=10, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - { - name=S("Driver Stand (right)"), - attach_offset={x=5, y=10, z=-10}, - view_offset={x=0, y=10, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - }, - seat_groups = { - dstand={ - name = "Driver Stand", - access_to = {}, - }, - }, - assign_to_seat_group = {"dstand"}, - visual_size = {x=1, y=1}, - wagon_span=2.6, - is_locomotive=true, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - drops={"default:steelblock 4"}, -}, S("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,3;]".. - "list[current_player;main;0,5;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*3, - }, -}, S("Industrial tank wagon"), "advtrains_wagon_tank_inv.png") -advtrains.register_wagon("wagon_wood", { - mesh="advtrains_wagon_wood.b3d", - textures = {"advtrains_wagon_wood.png"}, - seats = {}, - drives_on={default=true}, - max_speed=20, - visual_size = {x=1, y=1}, - wagon_span=1.8, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - drops={"default:steelblock 4"}, - has_inventory = true, - get_inventory_formspec = function(self) - return "size[8,11]".. - "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,3;]".. - "list[current_player;main;0,5;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*3, - }, -}, S("Industrial wood wagon"), "advtrains_wagon_wood_inv.png") diff --git a/advtrains/advtrains_train_industrial/locale/de.txt b/advtrains/advtrains_train_industrial/locale/de.txt deleted file mode 100644 index a45ca27..0000000 --- a/advtrains/advtrains_train_industrial/locale/de.txt +++ /dev/null @@ -1,5 +0,0 @@ -Driver Stand (left) = Führerstand Links -Driver Stand (right) = Führerstand Rechts -Industrial Train Engine = Industrielle Lokomotive -Industrial tank wagon = Tankwaggon -Industrial wood wagon = Holztransportwaggon \ No newline at end of file diff --git a/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d b/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d deleted file mode 100644 index f1ea485..0000000 Binary files a/advtrains/advtrains_train_industrial/models/advtrains_engine_industrial.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d b/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d deleted file mode 100644 index af2604b..0000000 Binary files a/advtrains/advtrains_train_industrial/models/advtrains_wagon_tank.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d b/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d deleted file mode 100644 index 0e7fb4b..0000000 Binary files a/advtrains/advtrains_train_industrial/models/advtrains_wagon_wood.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png b/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png deleted file mode 100644 index 38a872f..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial.png and /dev/null 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 deleted file mode 100644 index be4e80f..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_engine_industrial_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png deleted file mode 100644 index 79b1316..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank.png and /dev/null 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 deleted file mode 100644 index 03401be..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_tank_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png b/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png deleted file mode 100644 index acc6f72..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood.png and /dev/null 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 deleted file mode 100644 index 87109dd..0000000 Binary files a/advtrains/advtrains_train_industrial/textures/advtrains_wagon_wood_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_japan/depends.txt b/advtrains/advtrains_train_japan/depends.txt deleted file mode 100644 index 1fb6665..0000000 --- a/advtrains/advtrains_train_japan/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -advtrains -intllib? \ No newline at end of file diff --git a/advtrains/advtrains_train_japan/init.lua b/advtrains/advtrains_train_japan/init.lua deleted file mode 100644 index 8816db3..0000000 --- a/advtrains/advtrains_train_japan/init.lua +++ /dev/null @@ -1,144 +0,0 @@ -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - -advtrains.register_wagon("engine_japan", { - mesh="advtrains_engine_japan.b3d", - textures = {"advtrains_engine_japan.png"}, - drives_on={default=true}, - max_speed=20, - seats = { - { - name=S("Driver stand"), - attach_offset={x=0, y=8, z=13}, - view_offset={x=0, y=0, z=0}, - driving_ctrl_access=true, - group="dstand", - }, - { - name="1", - attach_offset={x=-4, y=8, z=0}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="2", - attach_offset={x=4, y=8, z=0}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="3", - attach_offset={x=-4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="4", - attach_offset={x=4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - }, - seat_groups = { - dstand={ - name = "Driver Stand", - access_to = {"pass"}, - require_doors_open=true, - }, - pass={ - name = "Passenger area", - access_to = {"dstand"}, - require_doors_open=true, - }, - }, - assign_to_seat_group = {"dstand", "pass"}, - doors={ - open={ - [-1]={frames={x=0, y=20}, time=1}, - [1]={frames={x=40, y=60}, time=1} - }, - close={ - [-1]={frames={x=20, y=40}, time=1}, - [1]={frames={x=60, y=80}, time=1} - } - }, - door_entry={-1}, - 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"}, -}, S("Japanese Train Engine"), "advtrains_engine_japan_inv.png") - -advtrains.register_wagon("wagon_japan", { - mesh="advtrains_wagon_japan.b3d", - textures = {"advtrains_wagon_japan.png"}, - drives_on={default=true}, - max_speed=20, - seats = { - { - name="1", - attach_offset={x=-4, y=8, z=8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="2", - attach_offset={x=4, y=8, z=8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="1a", - attach_offset={x=-4, y=8, z=0}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="2a", - attach_offset={x=4, y=8, z=0}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="3", - attach_offset={x=-4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="4", - attach_offset={x=4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - }, - seat_groups = { - pass={ - name = "Passenger area", - access_to = {}, - require_doors_open=true, - }, - }, - assign_to_seat_group = {"pass"}, - doors={ - open={ - [-1]={frames={x=0, y=20}, time=1}, - [1]={frames={x=40, y=60}, time=1} - }, - close={ - [-1]={frames={x=20, y=40}, time=1}, - [1]={frames={x=60, y=80}, time=1} - } - }, - door_entry={-1, 1}, - visual_size = {x=1, y=1}, - wagon_span=2.3, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - drops={"default:steelblock 4"}, -}, S("Japanese Train Wagon"), "advtrains_wagon_japan_inv.png") - diff --git a/advtrains/advtrains_train_japan/locale/de.txt b/advtrains/advtrains_train_japan/locale/de.txt deleted file mode 100644 index 63d7a97..0000000 --- a/advtrains/advtrains_train_japan/locale/de.txt +++ /dev/null @@ -1,4 +0,0 @@ -Driver Stand = Führerstand -Japanese Train Engine = Japanische Personenzug-Lokomotive -Default Seat = Standardsitzplatz -Japanese Train Wagon = Japanischer Personenzug-Passagierwaggon \ No newline at end of file diff --git a/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d b/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d deleted file mode 100644 index 218d965..0000000 Binary files a/advtrains/advtrains_train_japan/models/advtrains_engine_japan.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d b/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d deleted file mode 100644 index e6263dd..0000000 Binary files a/advtrains/advtrains_train_japan/models/advtrains_wagon_japan.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png b/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png deleted file mode 100644 index 2bc5fb8..0000000 Binary files a/advtrains/advtrains_train_japan/textures/advtrains_engine_japan.png and /dev/null 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 deleted file mode 100644 index 6af0636..0000000 Binary files a/advtrains/advtrains_train_japan/textures/advtrains_engine_japan_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png b/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png deleted file mode 100644 index c9cddc8..0000000 Binary files a/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan.png and /dev/null 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 deleted file mode 100644 index 3e6357c..0000000 Binary files a/advtrains/advtrains_train_japan/textures/advtrains_wagon_japan_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/depends.txt b/advtrains/advtrains_train_steam/depends.txt deleted file mode 100755 index 1fb6665..0000000 --- a/advtrains/advtrains_train_steam/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -advtrains -intllib? \ No newline at end of file diff --git a/advtrains/advtrains_train_steam/init.lua b/advtrains/advtrains_train_steam/init.lua deleted file mode 100755 index 315104a..0000000 --- a/advtrains/advtrains_train_steam/init.lua +++ /dev/null @@ -1,245 +0,0 @@ -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - -advtrains.register_wagon("newlocomotive", { - mesh="advtrains_engine_steam.b3d", - textures = {"advtrains_engine_steam.png"}, - is_locomotive=true, - drives_on={default=true}, - max_speed=10, - seats = { - { - name=S("Driver Stand (left)"), - attach_offset={x=-5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - { - name=S("Driver Stand (right)"), - attach_offset={x=5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - }, - seat_groups = { - dstand={ - name = "Driver Stand", - access_to = {}, - }, - }, - assign_to_seat_group = {"dstand"}, - visual_size = {x=1, y=1}, - wagon_span=2.3, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - update_animation=function(self, velocity) - if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true) - self.old_anim_velocity=advtrains.abs_ceil(velocity) - end - end, - custom_on_activate = function(self, staticdata_table, dtime_s) - minetest.add_particlespawner({ - amount = 10, - time = 0, - -- ^ If time is 0 has infinite lifespan and spawns the amount on a per-second base - minpos = {x=0, y=2, z=1.2}, - maxpos = {x=0, y=2, z=1.2}, - minvel = {x=-0.2, y=1.8, z=-0.2}, - maxvel = {x=0.2, y=2, z=0.2}, - minacc = {x=0, y=-0.1, z=0}, - maxacc = {x=0, y=-0.3, z=0}, - minexptime = 2, - maxexptime = 4, - minsize = 1, - maxsize = 5, - -- ^ The particle's properties are random values in between the bounds: - -- ^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration), - -- ^ minsize/maxsize, minexptime/maxexptime (expirationtime) - collisiondetection = true, - -- ^ collisiondetection: if true uses collision detection - vertical = false, - -- ^ vertical: if true faces player using y axis only - texture = "smoke_puff.png", - -- ^ Uses texture (string) - attached = self.object, - }) - end, - drops={"default:steelblock 4"}, -}, S("Steam Engine"), "advtrains_engine_steam_inv.png") - -advtrains.register_wagon("detailed_steam_engine", { - mesh="advtrains_detailed_steam_engine.b3d", - textures = {"advtrains_detailed_steam_engine.png"}, - is_locomotive=true, - drives_on={default=true}, - max_speed=10, - seats = { - { - name=S("Driver Stand (left)"), - attach_offset={x=-5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - { - name=S("Driver Stand (right)"), - attach_offset={x=5, y=10, z=-10}, - view_offset={x=0, y=6, z=0}, - driving_ctrl_access=true, - group = "dstand", - }, - }, - seat_groups = { - dstand={ - name = "Driver Stand", - access_to = {}, - }, - }, - assign_to_seat_group = {"dstand"}, - visual_size = {x=1, y=1}, - wagon_span=2.05, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - update_animation=function(self, velocity) - if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true) - self.old_anim_velocity=advtrains.abs_ceil(velocity) - end - end, - custom_on_activate = function(self, staticdata_table, dtime_s) - minetest.add_particlespawner({ - amount = 10, - time = 0, - -- ^ If time is 0 has infinite lifespan and spawns the amount on a per-second base - minpos = {x=0, y=2.3, z=1.45}, - maxpos = {x=0, y=2.3, z=1.4}, - minvel = {x=-0.2, y=1.8, z=-0.2}, - maxvel = {x=0.2, y=2, z=0.2}, - minacc = {x=0, y=-0.1, z=0}, - maxacc = {x=0, y=-0.3, z=0}, - minexptime = 2, - maxexptime = 4, - minsize = 1, - maxsize = 5, - -- ^ The particle's properties are random values in between the bounds: - -- ^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration), - -- ^ minsize/maxsize, minexptime/maxexptime (expirationtime) - collisiondetection = true, - -- ^ collisiondetection: if true uses collision detection - vertical = false, - -- ^ vertical: if true faces player using y axis only - texture = "smoke_puff.png", - -- ^ Uses texture (string) - attached = self.object, - }) - end, - drops={"default:steelblock 4"}, -}, S("Detailed Steam Engine"), "advtrains_detailed_engine_steam_inv.png") - -advtrains.register_wagon("wagon_default", { - mesh="advtrains_passenger_wagon.b3d", - textures = {"advtrains_wagon.png"}, - drives_on={default=true}, - max_speed=10, - seats = { - { - name="1", - attach_offset={x=2, y=6, z=8}, - view_offset={x=0, y=-4, z=0}, - group="pass", - }, - { - name="2", - attach_offset={x=-1, y=6, z=8}, - view_offset={x=0, y=-4, z=0}, - group="pass", - }, - { - name="3", - attach_offset={x=-4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="4", - attach_offset={x=4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - }, - seat_groups = { - pass={ - name = "Passenger area", - access_to = {}, - }, - }, - - assign_to_seat_group = {"pass"}, - visual_size = {x=1, y=1}, - wagon_span=2.634, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - drops={"default:steelblock 4"}, -}, S("Passenger Wagon"), "advtrains_wagon_inv.png") - - -advtrains.register_wagon("wagon_box", { - mesh="advtrains_wagon_box.b3d", - textures = {"advtrains_wagon_box.png"}, - drives_on={default=true}, - max_speed=10, - seats = {}, - visual_size = {x=1, y=1}, - wagon_span=2, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - drops={"default:steelblock 4"}, - has_inventory = true, - get_inventory_formspec = function(self) - return "size[8,11]".. - "list[detached:advtrains_wgn_"..self.unique_id..";box;0,0;8,3;]".. - "list[current_player;main;0,5;8,4;]".. - "listring[]" - end, - inventory_list_sizes = { - box=8*3, - }, -}, S("Box Wagon"), "advtrains_wagon_box_inv.png") - -minetest.register_craft({ - output = 'advtrains:newlocomotive', - recipe = { - {'', '', 'advtrains:chimney'}, - {'advtrains:driver_cab', 'dye:black', 'advtrains:boiler'}, - {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'}, - }, -}) - -minetest.register_craft({ - output = 'advtrains:detailed_steam_engine', - recipe = { - {'', '', 'advtrains:chimney'}, - {'advtrains:driver_cab', 'dye:green', 'advtrains:boiler'}, - {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'}, - }, -}) - -minetest.register_craft({ - output = 'advtrains:wagon_default', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:glass', 'dye:dark_green', 'default:glass'}, - {'advtrains:wheel', 'advtrains:wheel', 'advtrains:wheel'}, - }, -}) -minetest.register_craft({ - output = 'advtrains:wagon_box', - recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'default:chest', 'group:wood'}, - {'advtrains:wheel', '', 'advtrains:wheel'}, - }, -}) diff --git a/advtrains/advtrains_train_steam/locale/de.txt b/advtrains/advtrains_train_steam/locale/de.txt deleted file mode 100755 index ac06e20..0000000 --- a/advtrains/advtrains_train_steam/locale/de.txt +++ /dev/null @@ -1,6 +0,0 @@ -Driver Stand (left) = Führerstand Links -Driver Stand (right) = Führerstand Rechts -Steam Engine = Dampflokomotive -Detailed Steam Engine = detaillierte Dampflokomotive -Passenger Wagon = Passagierwaggon -Box wagon = Güterwaggon \ No newline at end of file diff --git a/advtrains/advtrains_train_steam/models/advtrains_detailed_steam_engine.b3d b/advtrains/advtrains_train_steam/models/advtrains_detailed_steam_engine.b3d deleted file mode 100755 index 7418d8a..0000000 Binary files a/advtrains/advtrains_train_steam/models/advtrains_detailed_steam_engine.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d b/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d deleted file mode 100755 index 6a92f57..0000000 Binary files a/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_steam/models/advtrains_passenger_wagon.b3d b/advtrains/advtrains_train_steam/models/advtrains_passenger_wagon.b3d deleted file mode 100644 index 2bc01b2..0000000 Binary files a/advtrains/advtrains_train_steam/models/advtrains_passenger_wagon.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d b/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d deleted file mode 100644 index 5c8214c..0000000 Binary files a/advtrains/advtrains_train_steam/models/advtrains_wagon.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_steam/models/advtrains_wagon_box.b3d b/advtrains/advtrains_train_steam/models/advtrains_wagon_box.b3d deleted file mode 100755 index 914975f..0000000 Binary files a/advtrains/advtrains_train_steam/models/advtrains_wagon_box.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_steam/screenshot.png b/advtrains/advtrains_train_steam/screenshot.png deleted file mode 100644 index 089da73..0000000 Binary files a/advtrains/advtrains_train_steam/screenshot.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_detailed_engine_steam_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_detailed_engine_steam_inv.png deleted file mode 100755 index 51adb5a..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_detailed_engine_steam_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_detailed_steam_engine.png b/advtrains/advtrains_train_steam/textures/advtrains_detailed_steam_engine.png deleted file mode 100755 index eab4dc8..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_detailed_steam_engine.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_engine_steam.png b/advtrains/advtrains_train_steam/textures/advtrains_engine_steam.png deleted file mode 100755 index 4b27e77..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_engine_steam.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_engine_steam_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_engine_steam_inv.png deleted file mode 100755 index 8d3fafb..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_engine_steam_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon.png deleted file mode 100644 index bd34e68..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_wagon.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png deleted file mode 100755 index 8cdd440..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_wagon_box.png and /dev/null 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 deleted file mode 100755 index 480f245..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_wagon_box_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png b/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png deleted file mode 100755 index 65f7984..0000000 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_wagon_inv.png and /dev/null differ diff --git a/advtrains/advtrains_train_subway/depends.txt b/advtrains/advtrains_train_subway/depends.txt deleted file mode 100644 index 1fb6665..0000000 --- a/advtrains/advtrains_train_subway/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -advtrains -intllib? \ No newline at end of file diff --git a/advtrains/advtrains_train_subway/init.lua b/advtrains/advtrains_train_subway/init.lua deleted file mode 100644 index 8864e92..0000000 --- a/advtrains/advtrains_train_subway/init.lua +++ /dev/null @@ -1,90 +0,0 @@ -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end - -advtrains.register_wagon("subway_wagon", { - mesh="advtrains_subway_wagon.b3d", - textures = {"advtrains_subway_wagon.png"}, - drives_on={default=true}, - max_speed=15, - seats = { - { - name="Driver stand", - attach_offset={x=0, y=10, z=0}, - view_offset={x=0, y=0, z=0}, - driving_ctrl_access=true, - group="dstand", - }, - { - name="1", - attach_offset={x=-4, y=8, z=8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="2", - attach_offset={x=4, y=8, z=8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="3", - attach_offset={x=-4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - { - name="4", - attach_offset={x=4, y=8, z=-8}, - view_offset={x=0, y=0, z=0}, - group="pass", - }, - }, - seat_groups = { - dstand={ - name = "Driver Stand", - access_to = {"pass"}, - require_doors_open=true, - }, - pass={ - name = "Passenger area", - access_to = {"dstand"}, - require_doors_open=true, - }, - }, - assign_to_seat_group = {"pass","dstand"}, - doors={ - open={ - [-1]={frames={x=0, y=20}, time=1}, - [1]={frames={x=40, y=60}, time=1} - }, - close={ - [-1]={frames={x=20, y=40}, time=1}, - [1]={frames={x=60, y=80}, time=1} - } - }, - door_entry={-1, 1}, - visual_size = {x=1, y=1}, - wagon_span=2, - --collisionbox = {-1.0,-0.5,-1.8, 1.0,2.5,1.8}, - collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - is_locomotive=true, - drops={"default:steelblock 4"}, - --custom_on_activate = function(self, dtime_s) - -- atprint("subway custom_on_activate") - -- self.object:set_animation({x=1,y=80}, 15, 0, true) - --end, -}, S("Subway Passenger Wagon"), "advtrains_subway_wagon_inv.png") - ---wagons -minetest.register_craft({ - output = 'advtrains:subway_wagon', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:steelblock', 'dye:yellow', 'default:steelblock'}, - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - }, -}) diff --git a/advtrains/advtrains_train_subway/locale/de.txt b/advtrains/advtrains_train_subway/locale/de.txt deleted file mode 100644 index 4aceebd..0000000 --- a/advtrains/advtrains_train_subway/locale/de.txt +++ /dev/null @@ -1,2 +0,0 @@ -Default Seat (driver stand) = Standardsitzplatz (Führerstand) -Subway Passenger Wagon = U-Bahn-Waggon \ No newline at end of file diff --git a/advtrains/advtrains_train_subway/models/advtrains_subway_wagon.b3d b/advtrains/advtrains_train_subway/models/advtrains_subway_wagon.b3d deleted file mode 100644 index cbd0f8e..0000000 Binary files a/advtrains/advtrains_train_subway/models/advtrains_subway_wagon.b3d and /dev/null differ diff --git a/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon.png b/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon.png deleted file mode 100644 index 079d797..0000000 Binary files a/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon.png and /dev/null differ diff --git a/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon_inv.png b/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon_inv.png deleted file mode 100644 index 1d0e809..0000000 Binary files a/advtrains/advtrains_train_subway/textures/advtrains_subway_wagon_inv.png and /dev/null differ diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt new file mode 100644 index 0000000..20f285f --- /dev/null +++ b/advtrains/api_doc.txt @@ -0,0 +1,157 @@ +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 = { + ^- contains zero or more seat definitions. A seat is a place where a player can be attached when getting on a wagon. + { + 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. + group="default" + ^- optional. Defines the seat group. See 'seat_groups' below + }, + }, + seat_groups = { + ^- optional. If defined, activates advanced seating behavior. See "seating behavior". + default = { + name = "Seats" + ^- name of this seat group, to be shown in get-on menu. + access_to = {"foo", "bar"} + ^- List of seat groups you can access from this seat using the menu when sitting inside the train. + require_doors_open = true + ^- Only allow getting on and off if doors are open. + } + } + assign_to_seat_group = {"default"}, + ^- optional, like seat_groups. When player right_clicks the wagon, player will be assigned to the first free seat group in the list. + + doors={ + ^- optional. If defined, defines door animation frames. Opposite door has to be closed during animation period. + ^- Remember, advtrains can't handle doors on both sides opened simultaneously. + open={ + [-1]={frames={x=0, y=20}, time=1}, -- open left doors + [1]={frames={x=40, y=60}, time=1} -- open right doors + }, + close={ + [-1]={frames={x=20, y=40}, time=1}, -- close left doors + [1]={frames={x=60, y=80}, time=1} -- close right doors + } + }, + door_entry={ 1.5, -1.5 } + ^- optional. If defined, defines the locations of the doors on the model as distance from the object center on the path. + ^- Getting on by walking in then takes effect. + ^- Positive values mean front, negative ones back. Resulting position is automatically shifted to the right side. + + 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. + +# Seating behavior +If the advanced seating behavior is active, clicking on a wagon will immediately get you on that wagon depending on the entries in assign_to_seat_group. +If all seat groups are full, if the doors are closed or if you are not authorized to enter this seat group(e.g. driver stands), will show a warning. +On a train, right-clicking the wagon will make you get off the train unless: +- the doors are closed and it requires open doors. +- you have access to a seat group specified in access_to (you may enter it and it's not full) +- you are the owner and can access the wagon preferences +In case there's no possibility, does nothing. +In case there are multiple possibilities, will show a form. + +If you can't enter or leave a train because the doors are closed, holding the Sneak key while right-clicking bypasses the "doors have to be open" enforcement. + +### 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.get_train_at_pos(pos) + end, + after_dig_node=function(pos) + advtrains.ndb.update(pos) + end, + after_place_node=function(pos) + advtrains.ndb.update(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 new file mode 100644 index 0000000..5f1f64d --- /dev/null +++ b/advtrains/atc.lua @@ -0,0 +1,312 @@ +--atc.lua +--registers and controls the ATC system + +local atc={} +-- ATC persistence table. advtrains.atc is created by init.lua when it loads the save file. +atc.controllers = {} +function atc.load_data(data) + local temp = data and data.controllers or {} + --transcode atc controller data to node hashes: table access times for numbers are far less than for strings + for pts, data in pairs(temp) do + if type(pts)=="number" then + pts=minetest.pos_to_string(minetest.get_position_from_hash(pts)) + end + atc.controllers[pts] = data + end +end +function atc.save_data() + return {controllers = atc.controllers} +end +--contents: {command="...", arrowconn=0-15 where arrow points} + +--general + +function atc.send_command(pos, par_tid) + local pts=minetest.pos_to_string(pos) + if atc.controllers[pts] then + --atprint("Called send_command at "..pts) + local train_id = par_tid or advtrains.detector.on_node[pts] + if train_id then + if advtrains.trains[train_id] then + --atprint("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 + atprint("Sending ATC Command: ", atc.controllers[pts].command) + return true + end + end + atwarn("ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!") + advtrains.trains[train_id].atc_arrow=true + advtrains.trains[train_id].atc_command=atc.controllers[pts].command + atprint("Sending ATC Command: ", atc.controllers[pts].command) + else + atwarn("ATC rail at", pos, ": Sending command failed: The train",train_id,"does not exist. This seems to be a bug.") + end + else + atwarn("ATC rail at", pos, ": Sending command failed: There's no train at this position. This seems to be a bug.") + end + else + atwarn("ATC rail at", pos, ": Sending command failed: Entry for controller not found.") + atwarn("ATC rail at", pos, ": Please visit controller and click 'Save'") + 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, node) + advtrains.ndb.update(pos, node) + local meta=minetest.get_meta(pos) + if meta then + meta:set_string("infotext", attrans("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", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_atc.png", + description=attrans("ATC controller"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_place_node=apn_func, + after_dig_node=function(pos) + return advtrains.pcall(function() + advtrains.invalidate_all_paths(pos) + advtrains.ndb.clear(pos) + local pts=minetest.pos_to_string(pos) + atc.controllers[pts]=nil + end) + end, + on_receive_fields = function(pos, formname, fields, player) + return advtrains.pcall(function() + if advtrains.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + 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]) + if fields.mode=="digiline" then + meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) + else + meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) + end + 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) + if fields.mode=="digiline" then + meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) + else + meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) + end + 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} + if advtrains.detector.on_node[pts] then + atc.send_command(pos) + end + end + end) + end, + advtrains = { + on_train_enter = function(pos, train_id) + atc.send_command(pos) + 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;"..attrans("Command")..";"..minetest.formspec_escape(command).."]" + if tonumber(mode)==2 then + formspec=formspec.."field[0.5,3;7,1;command_on;"..attrans("Command (on)")..";"..minetest.formspec_escape(command_on).."]" + end + else + formspec=formspec.."field[0.5,1.5;7,1;channel;"..attrans("Digiline channel")..";"..minetest.formspec_escape(channel).."]" + end + return formspec.."button_exit[0.5,4.5;7,1;save;"..attrans("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 + atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving!")) + end + return 1 + end, + ["O([LRC])"]=function(id, train, match) + local tt={L=-1, R=1, C=0} + local arr=train.atc_arrow and 1 or -1 + train.door_open = tt[match]*arr*train.movedir + return 2 + 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, compare + 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 + atprint("Evaluating if statement: "..command) + atprint("Cond: "..(cond or "nil")) + atprint("Applies: "..(cond_applies and "true" or "false")) + atprint("Rest: "..rest) + --find end of conditional statement + local nest, pos, elsepos=0, 1 + while nest>=0 do + if pos>#rest then + atwarn(sid(id), attrans("ATC command syntax error: I statement not closed: @1",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 + atprint("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) + + atprint("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 + atwarn(sid(id), attrans("ATC command parse error: Unknown command: @1", 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 3df60c8..0000000 --- a/advtrains/atc_command.txt +++ /dev/null @@ -1,83 +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 - -OL -Open left doors -OR -Open right doors -OC -Close Doors -All door commands are relative to the arrow direction, so if a train drives to opposite arrow direction, L will open its right doors from driver perspective. -Execution continues immediately, there is no way to wait for all doors to be opened/closed. - -Example: -B0 W OL D10 OC D1 SM -Subway train: stop in station and open doors, depart after 10 seconds. - -# 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. -** the latter two are not yet implemented. - -# 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 new file mode 100644 index 0000000..7bab241 --- /dev/null +++ b/advtrains/couple.lua @@ -0,0 +1,184 @@ +--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 +]] + +local couple_max_dist=3 + +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... + atprint("Discouple loaded from staticdata, destroying") + self.object:remove() + return + end + self.object:set_armor_groups({immortal=1}) + end, + get_staticdata=function() return "DISCOUPLE" end, + on_punch=function(self, player) + return advtrains.pcall(function() + --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 and not self.wagon.lock_couples 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, attrans("You need to own at least one neighboring wagon to destroy this couple.")) + return + end + end + end + end + atprint("Discouple punched. Splitting train", self.wagon.train_id) + advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua + self.object:remove() + elseif self.wagon.lock_couples then + minetest.chat_send_player(own, "Couples of one of the wagons are locked, can't discouple!") + else + minetest.chat_send_player(own, attrans("You need to own at least one neighboring wagon to destroy this couple.")) + end + end) + end, + on_step=function(self, dtime) + return advtrains.pcall(function() + local t=os.clock() + if not self.wagon then + self.object:remove() + atprint("Discouple: no wagon, destroying") + 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 + atprint("Discouple: wagon no longer loaded, destroying") + 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 + atprintbm("discouple_step", t) + end) + 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) + return advtrains.pcall(function() + if staticdata=="COUPLE" then + --couple entities have no right to exist further... + atprint("Couple loaded from staticdata, destroying") + self.object:remove() + return + end + end) + end, + get_staticdata=function(self) return "COUPLE" end, + on_rightclick=function(self, clicker) + return advtrains.pcall(function() + 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, clicker) + --case 2 (second train is front) + elseif self.train2_is_backpos and not self.train1_is_backpos then + advtrains.do_connect_trains(id2, id1, clicker) + --case 3 + elseif self.train1_is_backpos and self.train2_is_backpos then + advtrains.invert_train(id2) + advtrains.do_connect_trains(id1, id2, clicker) + --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, clicker) + end + atprint("Coupled trains", id1, id2) + self.object:remove() + end) + end, + on_step=function(self, dtime) + return advtrains.pcall(function() + advtrains.atprint_context_tid=sid(self.train_id_1) + advtrains.atprint_context_tid_full=self.train_id_1 + local t=os.clock() + if not self.train_id_1 or not self.train_id_2 then atprint("Couple: train ids not set!") self.object:remove() return end + local train1=advtrains.trains[self.train_id_1] + local train2=advtrains.trains[self.train_id_2] + if not train1 or not train2 then + atprint("Couple: trains missing, destroying") + self.object:remove() + return + end + if not train1.path or not train2.path or not train1.index or not train2.index or not train1.end_index or not train2.end_index then + atprint("Couple: paths or end_index missing. Might happen when paths got cleared") + 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, train1.end_index) + 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, train2.end_index) + end + if not tp1 or not tp2 or not (vector.distance(tp1,tp2) ringbuflen then + ringbufcnt[tid]=0 + end +end +function advtrains.drb_dump(tid) + atdebug("Debug ring buffer output for '"..tid.."':") + local stopcnt=ringbufcnt[tid] + if not stopcnt then + atdebug("ID unknown!") + return + end + repeat + atdebug(ringbufs[tid][ringbufcnt[tid]]) + ringbufcnt[tid]=ringbufcnt[tid]+1 + if ringbufcnt[tid] > ringbuflen then + ringbufcnt[tid]=0 + end + until ringbufcnt[tid]==stopcnt +end + +minetest.register_chatcommand("atdebug_show", + { + params = "train sid", -- Short parameter description + description = "Dump debug log", -- Full description + privs = {train_operator=true}, -- Require the "privs" privilege to run + func = function(name, param) + advtrains.drb_dump(param) + end, -- Called when command is run. + -- Returns boolean success and text output. + }) diff --git a/advtrains/depends.txt b/advtrains/depends.txt new file mode 100644 index 0000000..1815e54 --- /dev/null +++ b/advtrains/depends.txt @@ -0,0 +1,3 @@ +default +mesecons? +digtron? \ No newline at end of file diff --git a/advtrains/description.txt b/advtrains/description.txt index 4fa50ae..bb13b97 100644 --- a/advtrains/description.txt +++ b/advtrains/description.txt @@ -1 +1,8 @@ -advtrains 1.3.8 +Advanced Trains v1.3.8, 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 diff --git a/advtrains/digtron.lua b/advtrains/digtron.lua new file mode 100644 index 0000000..7105a54 --- /dev/null +++ b/advtrains/digtron.lua @@ -0,0 +1,25 @@ +--digtron.lua +--make tracks placeable by digtrons by overriding the place function. + +local old_item_place = digtron.item_place_node + +digtron.item_place_node = function(itemstack, placer, place_to, param2) + if minetest.get_item_group(itemstack:get_name(), "advtrains_trackplacer")>0 then + return advtrains.pcall(function() + local def = minetest.registered_items[itemstack:get_name()] + if not def then return itemstack, false end + + local pointed_thing = {} + pointed_thing.type = "node" + pointed_thing.above = {x=place_to.x, y=place_to.y, z=place_to.z} + pointed_thing.under = {x=place_to.x, y=place_to.y - 1, z=place_to.z} + + --call the on_rightclick callback + local success + itemstack, success = def.on_place(itemstack, placer, pointed_thing) + return itemstack, success + end) + else + return old_item_place(itemstack, placer, place_to, param2) + end +end diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua new file mode 100644 index 0000000..df2d9a8 --- /dev/null +++ b/advtrains/helpers.lua @@ -0,0 +1,262 @@ +--advtrains by orwell96, see readme.txt + +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) + + local midnode_ok, middir1, middir2, midrely1, midrely2=advtrains.get_rail_info_at(mid, drives_on) + if not midnode_ok then + return nil + end + + local next, chkdir, chkrely, y_offset + y_offset=0 + --atprint(" in order mid1,mid2",middir1,middir2) + --try if it is dir1 + local cor1=advtrains.dirCoordSet(mid, middir2)--<<<< + if cor1.x==prev.x and cor1.z==prev.z then--this was previous + next=advtrains.dirCoordSet(mid, middir1) + if midrely1>=1 then + next.y=next.y+1 + --atprint("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 + --atprint("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 + --atprint("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 + --atprint(" dir2 applied next pos:",minetest.pos_to_string(next),"(chkdir is ",chkdir,")") + end + --atprint("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 + --atprint("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 + --atprint("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 + --atprint("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 + --atprint("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 + --atprint("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 + --atprint("in conway: one below "..minetest.pos_to_string(next).." rail not connecting, returning!") + --atprint(" in order mid1,2,next1,2,chkdir "..middir1.." "..middir2.." "..nextdir1.." "..nextdir2.." "..chkdir) + return nil + end + end + + --atprint("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) + atlog("Dumping a path:") + if not path then atlog("dumppath: no path(nil)") return end + local temp_path={} + for ipt, iit in pairs(path) do + temp_path[#temp_path+1]={i=ipt, p=iit} + end + table.sort(temp_path, function (k1, k2) return k1.i < k2.i end) + for _,pit in ipairs(temp_path) do + atlog(pit.i.." > "..minetest.pos_to_string(pit.p)) + 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 + --atprint("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)) + --atprint("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 + --atprint("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) + --atprint("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 + +--is_protected wrapper that checks for protection_bypass privilege +function advtrains.is_protected(pos, name) + if not name then + error("advtrains.is_protected() called without name parameter!") + end + if minetest.check_player_privs(name, {protection_bypass=true}) then + --player can bypass protection + return false + end + return minetest.is_protected(pos, name) +end diff --git a/advtrains/init.lua b/advtrains/init.lua new file mode 100644 index 0000000..301ff89 --- /dev/null +++ b/advtrains/init.lua @@ -0,0 +1,400 @@ +-- Boilerplate to support localized strings if intllib mod is installed. +if minetest.get_modpath("intllib") then + attrans = intllib.Getter() +else + attrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end +end + +--advtrains + +advtrains = {trains={}, wagon_save={}, player_to_train_mapping={}} + +--pcall +local no_action=false + +local function reload_saves() + atwarn("Restoring saved state in 1 second...") + no_action=true + --read last save state and continue, as if server was restarted + for aoi, le in pairs(minetest.luaentities) do + if le.is_wagon then + le.object:remove() + end + end + minetest.after(1, function() + advtrains.load() + atwarn("Reload successful!") + advtrains.ndb.restore_all() + end) +end + +function advtrains.pcall(fun) + if no_action then return end + + local succ, return1, return2, return3, return4=xpcall(fun, function(err) + if advtrains.atprint_context_tid then + local train=advtrains.trains[advtrains.atprint_context_tid_full] + advtrains.dumppath(train.path) + atwarn("Dumping last debug outputs: ", err) + atprint("Train state: index",train.index,"end_index", train.end_index,"| max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> pe_min", train.path_extent_min,"pe_max", train.path_extent_max) + advtrains.drb_dump(advtrains.atprint_context_tid) + end + atwarn("Lua Error occured: ", err) + atwarn(debug.traceback()) + end) + if not succ then + reload_saves() + else + return return1, return2, return3, return4 + end +end + + +advtrains.modpath = minetest.get_modpath("advtrains") + +function advtrains.print_concat_table(a) + local str="" + local stra="" + local t + for i=1,20 do + t=a[i] + if t==nil then + stra=stra.."nil " + else + str=str..stra + stra="" + if type(t)=="table" then + if t.x and t.y and t.z then + str=str..minetest.pos_to_string(t) + else + str=str..dump(t) + end + elseif type(t)=="boolean" then + if t then + str=str.."true" + else + str=str.."false" + end + else + str=str..t + end + str=str.." " + end + end + return str +end + +atprint=function() end +atdebug=function() end +atlog=function(t, ...) + local text=advtrains.print_concat_table({t, ...}) + minetest.log("action", "[advtrains]"..text) +end +atwarn=function(t, ...) + local text=advtrains.print_concat_table({t, ...}) + minetest.log("warning", "[advtrains]"..text) + minetest.chat_send_all("[advtrains] -!- "..text) +end +sid=function(id) if id then return string.sub(id, -6) end end + +if minetest.settings:get_bool("advtrains_enable_debugging") then + atprint=function(t, ...) + local context=advtrains.atprint_context_tid + if not context then return end + local text=advtrains.print_concat_table({t, ...}) + advtrains.drb_record(context, text) + end + atdebug=function(t, ...) + local text=advtrains.print_concat_table({t, ...}) + minetest.log("action", "[advtrains]"..text) + minetest.chat_send_all("[advtrains]"..text) + end + dofile(advtrains.modpath.."/debugringbuffer.lua") +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.."/trackdb_legacy.lua") +dofile(advtrains.modpath.."/nodedb.lua") +dofile(advtrains.modpath.."/couple.lua") + +dofile(advtrains.modpath.."/signals.lua") +dofile(advtrains.modpath.."/misc_nodes.lua") +dofile(advtrains.modpath.."/crafting.lua") +dofile(advtrains.modpath.."/craft_items.lua") +dofile(advtrains.modpath.."/loading.lua") + +if minetest.global_exists("digtron") then + dofile(advtrains.modpath.."/digtron.lua") +end + +--load/save + +advtrains.fpath=minetest.get_worldpath().."/advtrains" + +function advtrains.avt_load() + local file, err = io.open(advtrains.fpath, "r") + if not file then + minetest.log("error", " Failed to read advtrains save data from file "..advtrains.fpath..": "..(err or "Unknown Error")) + else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + if tbl.version then + --congrats, we have the new save format. + advtrains.trains = tbl.trains + advtrains.wagon_save = tbl.wagon_save + advtrains.player_to_train_mapping = tbl.ptmap or {} + advtrains.ndb.load_data(tbl.ndb) + advtrains.atc.load_data(tbl.atc) + else + --oh no, its the old one... + advtrains.trains=tbl + --load ATC + 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" + atprint("Failed loading advtrains atc save file "..er) + else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.atc.controllers=tbl.controllers + end + file:close() + end + --load wagon saves + 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" + atprint("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 + end + else + minetest.log("error", " Failed to deserialize advtrains save data: Not a table!") + end + file:close() + end +end + +advtrains.avt_save = function(remove_players_from_wagons) + --atprint("saving") + --No more invalidating. + --Instead, remove path a.s.o from the saved table manually + + -- 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 + if remove_players_from_wagons then + data.seatp={} + end + end + if remove_players_from_wagons then + advtrains.player_to_train_mapping={} + end + + local tmp_trains={} + for id, train in pairs(advtrains.trains) do + --first, deep_copy the train + local v=advtrains.merge_tables(train) + --then invalidate + 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.end_index=nil + v.min_index_on_track=nil + v.max_index_on_track=nil + v.path_extent_min=nil + v.path_extent_max=nil + + v.detector_old_index=nil + v.detector_old_end_index=nil + + --then save it + tmp_trains[id]=v + end + + --versions: + -- 1 - Initial new save format. + local save_tbl={ + trains = tmp_trains, + wagon_save = advtrains.wagon_save, + ptmap = advtrains.player_to_train_mapping, + atc = advtrains.atc.save_data(), + ndb = advtrains.ndb.save_data(), + version = 1, + } + local datastr = minetest.serialize(save_tbl) + if not datastr then + minetest.log("error", " Failed to serialize advtrains save data!") + return + end + local file, err = io.open(advtrains.fpath, "w") + if err then + minetest.log("error", " Failed to write advtrains save data to file "..advtrains.fpath..": "..(err or "Unknown Error")) + return + end + file:write(datastr) + file:close() +end + +--## MAIN LOOP ##-- +--Calls all subsequent main tasks of both advtrains and atlatc +local init_load=false +local save_interval=20 +local save_timer=save_interval +advtrains.mainloop_runcnt=0 + +minetest.register_globalstep(function(dtime_mt) + return advtrains.pcall(function() + advtrains.mainloop_runcnt=advtrains.mainloop_runcnt+1 + atprint("Running the main loop, runcnt",advtrains.mainloop_runcnt) + --call load once. see advtrains.load() comment + if not init_load then + advtrains.load() + end + --limit dtime: if trains move too far in one step, automation may cause stuck and wrongly braking trains + local dtime=dtime_mt + if dtime>0.2 then + atprint("Limiting dtime to 0.2!") + dtime=0.2 + end + + advtrains.mainloop_trainlogic(dtime) + if advtrains_itm_mainloop then + advtrains_itm_mainloop(dtime) + end + if atlatc then + atlatc.mainloop_stepcode(dtime) + atlatc.interrupt.mainloop(dtime) + end + + + --trigger a save when necessary + save_timer=save_timer-dtime + if save_timer<=0 then + local t=os.clock() + --save + advtrains.save() + save_timer=save_interval + atprintbm("saving", t) + end + end) +end) + +--if something goes wrong in these functions, there is no help. no pcall here. + +--## MAIN LOAD ROUTINE ## +-- Causes the loading of everything +-- first time called in main loop (after the init phase) because luaautomation has to initialize first. +function advtrains.load() + advtrains.avt_load() --loading advtrains. includes ndb at advtrains.ndb.load_data() + if atlatc then + atlatc.load() --includes interrupts + end + if advtrains_itm_init then + advtrains_itm_init() + end + init_load=true + no_action=false + atlog("[load_all]Loaded advtrains save files") +end + +--## MAIN SAVE ROUTINE ## +-- Causes the saving of everything +function advtrains.save(remove_players_from_wagons) + if not init_load then + --wait... we haven't loaded yet?! + atwarn("Instructed to save() but load() was never called!") + return + end + advtrains.avt_save(remove_players_from_wagons) --saving advtrains. includes ndb at advtrains.ndb.save_data() + if atlatc then + atlatc.save() + end + atprint("[save_all]Saved advtrains save files") +end +minetest.register_on_shutdown(advtrains.save) + +-- This chat command provides a solution to the problem known on the LinuxWorks server +-- There are many players that joined a single time, got on a train and then left forever +-- These players still occupy seats in the trains. +minetest.register_chatcommand("at_empty_seats", + { + params = "", -- Short parameter description + description = "Detach all players, especially the offline ones, from all trains. Use only when no one serious is on a train.", -- Full description + privs = {train_operator=true, server=true}, -- Require the "privs" privilege to run + func = function(name, param) + return advtrains.pcall(function() + atwarn("Data is being saved. While saving, advtrains will remove the players from trains. Save files will be reloaded afterwards!") + advtrains.save(true) + reload_saves() + end) + end, +}) +-- This chat command solves another problem: Trains getting randomly stuck. +minetest.register_chatcommand("at_reroute", + { + params = "", + description = "Delete all train routes, force them to recalculate", + privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe. + func = function(name, param) + return advtrains.pcall(function() + atwarn("Train routes will be recalculated now") + advtrains.save(false) + reload_saves() + end) + end, +}) + diff --git a/advtrains/license.txt b/advtrains/license.txt deleted file mode 100644 index 68a4b60..0000000 --- a/advtrains/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/advtrains/license_media.txt b/advtrains/license_media.txt deleted file mode 100644 index 888cf00..0000000 --- a/advtrains/license_media.txt +++ /dev/null @@ -1,68 +0,0 @@ -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(f) 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 below) for the purposes of this License. - "Creative Commons Compatible License" means a license that is listed at https://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as 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, 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. - - 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 waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, - Voluntary License Schemes. The Licensor waives 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. - -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. - -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(c), 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(c), as requested. - You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) 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-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) 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; (III) 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; (IV) 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. - 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 Ssection 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(c) 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. - 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, 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, MERCHANTIBILITY, 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 SUCH 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. - - Creative Commons Notice - - Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. - - Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License. - - Creative Commons may be contacted at https://creativecommons.org/. diff --git a/advtrains/loading.lua b/advtrains/loading.lua new file mode 100644 index 0000000..8ac7b00 --- /dev/null +++ b/advtrains/loading.lua @@ -0,0 +1,99 @@ +-- Tracks for loading and unloading trains +-- Copyright (C) 2017 Gabriel Pérez-Cerezo + +local function get_far_node(pos) + local node = minetest.get_node(pos) + if node.name == "ignore" then + minetest.get_voxel_manip():read_from_map(pos, pos) + node = minetest.get_node(pos) + end + return node +end + +local function train_load(pos, train_id, unload) + local train=advtrains.trains[train_id] + local below = get_far_node({x=pos.x, y=pos.y-1, z=pos.z}) + if not string.match(below.name, "chest") then + atprint("this is not a chest! at "..minetest.pos_to_string(pos)) + return + end + local inv = minetest.get_inventory({type="node", pos={x=pos.x, y=pos.y-1, z=pos.z}}) + if inv and train.velocity < 2 then + for k, v in ipairs(train.trainparts) do + + local i=minetest.get_inventory({type="detached", name="advtrains_wgn_"..v}) + if i then + if not unload then + for _, item in ipairs(inv:get_list("main")) do + if i:get_list("box") and i:room_for_item("box", item) then + i:add_item("box", item) + inv:remove_item("main", item) + end + end + else + for _, item in ipairs(i:get_list("box")) do + if inv:get_list("main") and inv:room_for_item("main", item) then + i:remove_item("box", item) + inv:add_item("main", item) + end + end + end + end + end + end +end + + +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_unload", + texture_prefix="advtrains_dtrack_unload", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_unload.png", + description=attrans("Unloading Track"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.ndb.clear(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(), attrans("This position is protected!")) + -- return + -- end + -- end, + advtrains = { + on_train_enter = function(pos, train_id) + train_load(pos, train_id, true) + end, + }, + } + end + }, advtrains.trackpresets.t_30deg_straightonly) +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_load", + texture_prefix="advtrains_dtrack_load", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_load.png", + description=attrans("Loading Track"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.ndb.clear(pos) + end, + + advtrains = { + on_train_enter = function(pos, train_id) + train_load(pos, train_id, false) + end, + }, + } + end + }, advtrains.trackpresets.t_30deg_straightonly) diff --git a/advtrains/locale/de.txt b/advtrains/locale/de.txt new file mode 100644 index 0000000..fe770d8 --- /dev/null +++ b/advtrains/locale/de.txt @@ -0,0 +1,50 @@ +This wagon is owned by @1, you can't destroy it. = Dieser Waggon gehört @1, du kannst ihn nicht abbauen. +Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click the wagon. = Warnung: Du erhältst nur etwas Stahl zurück. Wenn du sicher bist, dass du den Waggon zerstören willst, halte 'Schleichen' und klicke links. +Show Inventory = Zeige Inventar +Select seat: = Wähle einen Sitzplatz aus: +ATC controller, unconfigured. = Zugbeeinflussungsschiene, nicht konfiguiert. +ATC controller = Zugbeeinflussungsschiene +ATC controller, mode @1\nChannel: @2 = Zugbeeinflussungsschiene in Betriebsart "@1"\nKanal: @2 +ATC controller, mode @1\nCommand: @2 = Zugbeeinflussungsschiene in Betriebsart "@1"\nBefehl: @2 +Command = Befehl +Command (on) = Befehl (wenn ein) +Digiline channel = Digiline-Kanal +Save = Speichern +ATC Reverse command warning: didn't reverse train, train moving! = Zugbeeinflussung - Warnung: Befehl 'R' nicht ausgeführt, Zug in Bewegung! +ATC command syntax error: I statement not closed: @1 = Zugbeeinflussung - Syntaxfehler: I-Anweisung nicht geschlossen: @1 +ATC command parse error: Unknown command: @1 = Zugbeeinflussung - Fehler: Unbekannter Befehl: @1 +This position is protected! = Diese Position ist geschützt! +You need to own at least one neighboring wagon to destroy this couple. = Du musst Besitzer eines angrenzenden Waggons sein, um hier abzukuppeln. +@1 Platform (low) = Niedriger @1-Bahnsteig +@1 Platform (high) = Hoher @1-Bahnsteig +off = aus +on = ein +Lampless Signal (@1) = Mechanisches Signal (@1) +Signal (@1) = Lichtsignal (@1) +Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc. = Schienenwerkzeug\n\nLinksklick: Schienentyp ändern, Rechtsklick: Objekt drehen. +This node can't be rotated using the trackworker! = Kann diesen Block nicht mit dem Schienenwerkzeug drehen. +This node can't be changed using the trackworker! = Kann diesen Block nicht mit dem Schienenwerkzeug bearbeiten. +Can't place: not pointing at node = Kann nicht platzieren: Du zeigst nicht auf einen Block. +Can't place: space occupied! = Kann nicht platzieren: Platz besetzt. +Can't place: protected position! = Kann nicht platzieren: Position geschützt. +Can't place: Not enough slope items left (@1 required) = Kann nicht platzieren: nicht genug Steigungsblöcke, es werden insgesamt @1 benötigt. +Can't place: There's no slope of length @1 = Kann nicht platzieren: Keine Steigung der Länge @1 definiert. +Can't place: no supporting node at upper end. = Kann nicht platzieren: kein unterstützender Block am Ende der Steigung. +Deprecated Track = ausrangierte Schiene, nicht verwenden. +Track = Schiene +Bumper = Prellbock +Detector Rail = Detektorschiene +Speed: = Geschw.: +Target: = Zielges.: +@1 Slope = @1 Steigung +Can't get on: wagon full or doors closed! = Kann nicht einsteigen: Waggon voll oder Türen geschlossen. +Use Sneak+rightclick to bypass closed doors! = Nutze Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem einzusteigen. +Lock couples = Kupplungen sperren +Save wagon properties = Waggon-Einstellungen speichern +Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off! = Türen sind geschlossen! Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem auszusteigen. +Wagon properties = Waggon-Einstellungen +Get off = Aussteigen +Get off (forced) = Aussteigen (erzwingen) +(Doors closed) = (Türen geschlossen) +Access to @1 = Zugang zu @1 + diff --git a/advtrains/manual.pdf b/advtrains/manual.pdf deleted file mode 100644 index 68691a2..0000000 Binary files a/advtrains/manual.pdf and /dev/null differ diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua new file mode 100644 index 0000000..37f535d --- /dev/null +++ b/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", " 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 = attrans("@1 Platform (low)", desc), + 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 = attrans("@1 Platform (high)", desc), + 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_across.obj b/advtrains/models/advtrains_across.obj new file mode 100644 index 0000000..4ebf393 --- /dev/null +++ b/advtrains/models/advtrains_across.obj @@ -0,0 +1,537 @@ +# Blender v2.78 (sub 0) OBJ File: 'andreaskreuz.blend' +# www.blender.org +o Cube +v 0.183133 0.500062 -0.365883 +v 0.300122 0.552646 -0.365883 +v 0.300122 0.552646 -0.337392 +v 0.183133 0.500062 -0.337392 +v -0.300121 1.575195 -0.365883 +v -0.183133 1.627780 -0.365883 +v -0.183133 1.627780 -0.337392 +v -0.300121 1.575195 -0.337392 +v -0.035079 -0.503415 -0.299723 +v -0.035079 1.055075 -0.299723 +v -0.024805 -0.503415 -0.324528 +v -0.024805 1.055075 -0.324528 +v -0.000000 -0.503415 -0.334802 +v -0.000000 1.055075 -0.334802 +v 0.024805 -0.503415 -0.324528 +v 0.024805 1.055075 -0.324528 +v 0.035079 -0.503415 -0.299723 +v 0.035079 1.055075 -0.299723 +v 0.024805 -0.503415 -0.274918 +v 0.024805 1.055075 -0.274918 +v -0.000000 -0.503415 -0.264644 +v -0.000000 1.055075 -0.264644 +v -0.024805 -0.503415 -0.274918 +v -0.024805 1.055075 -0.274918 +v -0.000000 -0.698893 -0.299723 +v -0.032318 0.979391 -0.365883 +v -0.084671 1.095865 -0.365883 +v 0.084671 1.031976 -0.365883 +v 0.032318 1.148450 -0.365883 +v 0.084671 1.031976 -0.337392 +v 0.032318 1.148450 -0.337392 +v -0.032318 0.979391 -0.337392 +v -0.084671 1.095865 -0.337392 +v -0.133841 1.055075 -0.323880 +v -0.096352 1.055075 -0.376499 +v -0.115909 0.988154 -0.323880 +v -0.083444 1.006899 -0.376499 +v -0.066920 0.939165 -0.323880 +v -0.048176 0.971631 -0.376499 +v -0.000000 0.921234 -0.323880 +v -0.000000 0.958722 -0.376499 +v 0.066920 0.939165 -0.323880 +v 0.048176 0.971631 -0.376499 +v 0.115909 0.988154 -0.323880 +v 0.083443 1.006899 -0.376499 +v 0.133841 1.055075 -0.323880 +v 0.096352 1.055075 -0.376499 +v 0.115909 1.121995 -0.323880 +v 0.083443 1.103251 -0.376499 +v 0.066920 1.170984 -0.323880 +v 0.048176 1.138518 -0.376499 +v 0.000000 1.188915 -0.323880 +v 0.000000 1.151427 -0.376499 +v -0.066920 1.170984 -0.323880 +v -0.048176 1.138518 -0.376499 +v -0.115909 1.121995 -0.323880 +v -0.083444 1.103251 -0.376499 +v -0.115909 0.988154 -0.376499 +v -0.133841 1.055075 -0.376499 +v -0.066920 0.939165 -0.376499 +v -0.000000 0.921234 -0.376499 +v 0.066920 0.939165 -0.376499 +v 0.115909 0.988154 -0.376499 +v 0.133841 1.055075 -0.376499 +v 0.115909 1.121995 -0.376499 +v 0.066920 1.170984 -0.376499 +v 0.000000 1.188915 -0.376499 +v -0.066920 1.170984 -0.376499 +v -0.115909 1.121995 -0.376499 +v -0.094673 1.000415 -0.376499 +v -0.109318 1.055075 -0.376499 +v -0.054659 0.960402 -0.376499 +v -0.000000 0.945756 -0.376499 +v 0.054659 0.960402 -0.376499 +v 0.094672 1.000415 -0.376499 +v 0.109318 1.055075 -0.376499 +v 0.094672 1.109734 -0.376499 +v 0.054659 1.149747 -0.376499 +v 0.000000 1.164393 -0.376499 +v -0.054659 1.149747 -0.376499 +v -0.094672 1.109734 -0.376499 +v -0.094673 1.000415 -0.397361 +v -0.109318 1.055075 -0.397361 +v -0.054659 0.960402 -0.397361 +v -0.000000 0.945756 -0.397361 +v 0.054659 0.960402 -0.397361 +v 0.094672 1.000415 -0.397361 +v 0.109318 1.055075 -0.397361 +v 0.094672 1.109734 -0.459571 +v 0.054659 1.149747 -0.459571 +v 0.000000 1.164393 -0.459571 +v -0.054659 1.149747 -0.459571 +v -0.094672 1.109734 -0.459571 +v -0.083444 1.006899 -0.397361 +v -0.096352 1.055075 -0.397361 +v -0.048176 0.971631 -0.397361 +v -0.000000 0.958722 -0.397361 +v 0.048176 0.971631 -0.397361 +v 0.083443 1.006899 -0.397361 +v 0.096352 1.055075 -0.397361 +v 0.083443 1.103251 -0.459571 +v 0.048176 1.138518 -0.459571 +v 0.000000 1.151427 -0.459571 +v -0.048176 1.138518 -0.459571 +v -0.083444 1.103251 -0.459571 +v 0.084671 1.095865 -0.337392 +v 0.032318 0.979391 -0.337392 +v -0.032318 1.148450 -0.337392 +v -0.084671 1.031976 -0.337392 +v -0.032318 1.148450 -0.365883 +v -0.084671 1.031976 -0.365883 +v 0.084671 1.095865 -0.365883 +v 0.032318 0.979391 -0.365883 +v 0.300122 1.575195 -0.337392 +v 0.183133 1.627780 -0.337392 +v 0.183133 1.627780 -0.365883 +v 0.300122 1.575195 -0.365883 +v -0.183133 0.500062 -0.337392 +v -0.300121 0.552646 -0.337392 +v -0.300121 0.552646 -0.365883 +v -0.183133 0.500062 -0.365883 +vt 0.9201 0.4239 +vt 0.9201 0.4892 +vt 0.9044 0.4892 +vt 0.9044 0.4239 +vt 0.1944 0.7581 +vt 0.2101 0.7581 +vt 0.2101 0.8279 +vt 0.1944 0.8279 +vt 0.2539 0.3060 +vt 0.2539 0.0160 +vt 0.3247 0.0160 +vt 0.3247 0.3060 +vt 0.4596 0.8350 +vt 0.7496 0.8350 +vt 0.7496 0.8507 +vt 0.4596 0.8507 +vt 0.2539 0.6281 +vt 0.2539 0.3381 +vt 0.3247 0.3381 +vt 0.3247 0.6281 +vt 0.7609 0.4251 +vt 0.7609 0.1508 +vt 0.7767 0.1508 +vt 0.7767 0.4251 +vt 0.2081 0.7222 +vt 0.2081 0.0160 +vt 0.2218 0.0199 +vt 0.2218 0.7261 +vt 0.0434 0.0160 +vt 0.0434 0.9840 +vt 0.0297 0.9840 +vt 0.0297 0.0160 +vt 0.0160 0.9840 +vt 0.0160 0.0160 +vt 0.1623 0.0183 +vt 0.1623 0.9082 +vt 0.1486 0.9060 +vt 0.1486 0.0160 +vt 0.1350 0.9082 +vt 0.1350 0.0183 +vt 0.0755 0.9840 +vt 0.0755 0.0160 +vt 0.0892 0.0160 +vt 0.0892 0.9840 +vt 0.7932 0.9090 +vt 0.7830 0.8984 +vt 0.7830 0.8836 +vt 0.7932 0.8734 +vt 0.8076 0.8737 +vt 0.8178 0.8844 +vt 0.8178 0.8991 +vt 0.8076 0.9093 +vt 0.1029 0.0160 +vt 0.1029 0.9840 +vt 0.1944 0.7261 +vt 0.1944 0.0199 +vt 0.2199 0.8822 +vt 0.2124 0.8943 +vt 0.2019 0.8972 +vt 0.1944 0.8892 +vt 0.1944 0.8750 +vt 0.2019 0.8629 +vt 0.2124 0.8600 +vt 0.2199 0.8680 +vt 0.8087 0.4251 +vt 0.8087 0.1508 +vt 0.8245 0.1508 +vt 0.8245 0.4251 +vt 0.4275 0.3381 +vt 0.4275 0.6281 +vt 0.3567 0.6281 +vt 0.3567 0.3381 +vt 0.6653 0.4408 +vt 0.6653 0.1508 +vt 0.6811 0.1508 +vt 0.6811 0.4408 +vt 0.5625 0.3060 +vt 0.5625 0.0160 +vt 0.6333 0.0160 +vt 0.6333 0.3060 +vt 0.7433 0.4931 +vt 0.7723 0.4931 +vt 0.7723 0.5268 +vt 0.7433 0.5268 +vt 0.7723 0.5650 +vt 0.7433 0.5650 +vt 0.7723 0.5975 +vt 0.7433 0.5975 +vt 0.9044 0.2874 +vt 0.9334 0.2874 +vt 0.9334 0.3198 +vt 0.9044 0.3198 +vt 0.9334 0.3581 +vt 0.9044 0.3581 +vt 0.9334 0.3918 +vt 0.9044 0.3918 +vt 0.8566 0.8329 +vt 0.8856 0.8329 +vt 0.8856 0.8708 +vt 0.8566 0.8708 +vt 0.8856 0.9063 +vt 0.8566 0.9063 +vt 0.9334 0.2553 +vt 0.9044 0.2553 +vt 0.9044 0.2220 +vt 0.9334 0.2220 +vt 0.9044 0.1838 +vt 0.9334 0.1838 +vt 0.7029 0.1188 +vt 0.6791 0.1050 +vt 0.6653 0.0812 +vt 0.6653 0.0536 +vt 0.6791 0.0298 +vt 0.7029 0.0160 +vt 0.7305 0.0160 +vt 0.7543 0.0298 +vt 0.7681 0.0536 +vt 0.7681 0.0812 +vt 0.7543 0.1050 +vt 0.7305 0.1188 +vt 0.9044 0.1508 +vt 0.9334 0.1508 +vt 0.7433 0.4729 +vt 0.7723 0.4729 +vt 0.4596 0.7507 +vt 0.4596 0.7124 +vt 0.4787 0.6793 +vt 0.5118 0.6602 +vt 0.5501 0.6602 +vt 0.5832 0.6793 +vt 0.6023 0.7124 +vt 0.6023 0.7507 +vt 0.5832 0.7838 +vt 0.5501 0.8029 +vt 0.5118 0.8029 +vt 0.4787 0.7838 +vt 0.3408 0.6733 +vt 0.3096 0.6733 +vt 0.3061 0.6602 +vt 0.3443 0.6602 +vt 0.2826 0.6889 +vt 0.2730 0.6793 +vt 0.2669 0.7160 +vt 0.2539 0.7124 +vt 0.2669 0.7472 +vt 0.2539 0.7507 +vt 0.2826 0.7742 +vt 0.2730 0.7838 +vt 0.3096 0.7898 +vt 0.3061 0.8029 +vt 0.3408 0.7898 +vt 0.3443 0.8029 +vt 0.3679 0.7742 +vt 0.3774 0.7838 +vt 0.3835 0.7472 +vt 0.3966 0.7507 +vt 0.3835 0.7160 +vt 0.3966 0.7124 +vt 0.3679 0.6889 +vt 0.3774 0.6793 +vt 0.8044 0.4994 +vt 0.8044 0.4729 +vt 0.8159 0.4729 +vt 0.8159 0.4994 +vt 0.9044 0.6442 +vt 0.9044 0.6187 +vt 0.9159 0.6187 +vt 0.9159 0.6442 +vt 0.8460 0.0160 +vt 0.8460 0.0429 +vt 0.8001 0.0429 +vt 0.8001 0.0160 +vt 0.2773 0.8808 +vt 0.2539 0.8808 +vt 0.2539 0.8350 +vt 0.2773 0.8350 +vt 0.7112 0.4729 +vt 0.7112 0.4994 +vt 0.6997 0.4994 +vt 0.6997 0.4729 +vt 0.9044 0.6715 +vt 0.9159 0.6715 +vt 0.8460 0.0742 +vt 0.8001 0.0742 +vt 0.3048 0.8808 +vt 0.3048 0.8350 +vt 0.7112 0.5306 +vt 0.6997 0.5306 +vt 0.8460 0.1014 +vt 0.8001 0.1014 +vt 0.3290 0.8808 +vt 0.3290 0.8693 +vt 0.7112 0.5582 +vt 0.6997 0.5582 +vt 0.7302 0.7561 +vt 0.7440 0.7323 +vt 0.7509 0.7341 +vt 0.7353 0.7611 +vt 0.7440 0.7047 +vt 0.7509 0.7029 +vt 0.7302 0.6809 +vt 0.7353 0.6758 +vt 0.7064 0.6671 +vt 0.7083 0.6602 +vt 0.6789 0.6671 +vt 0.6770 0.6602 +vt 0.6550 0.6809 +vt 0.6500 0.6758 +vt 0.6413 0.7047 +vt 0.6344 0.7029 +vt 0.6413 0.7323 +vt 0.6344 0.7341 +vt 0.6550 0.7561 +vt 0.6500 0.7611 +vt 0.6789 0.7699 +vt 0.6770 0.7768 +vt 0.7064 0.7699 +vt 0.7083 0.7768 +vt 0.9024 0.7257 +vt 0.9024 0.7491 +vt 0.8566 0.7491 +vt 0.8566 0.7257 +vt 0.7112 0.5746 +vt 0.6653 0.5746 +vt 0.8896 0.0160 +vt 0.8896 0.0400 +vt 0.8781 0.0400 +vt 0.8781 0.0160 +vt 0.8044 0.5306 +vt 0.8159 0.5306 +vt 0.9024 0.7766 +vt 0.8566 0.7766 +vt 0.8896 0.0675 +vt 0.8781 0.0675 +vt 0.8044 0.5582 +vt 0.8159 0.5582 +vt 0.9024 0.8008 +vt 0.8909 0.8008 +vt 0.8896 0.0912 +vt 0.8781 0.0912 +vt 0.3756 0.8659 +vt 0.3756 0.8350 +vt 0.3872 0.8350 +vt 0.4215 0.8659 +vt 0.3436 0.8808 +vt 0.3436 0.8693 +vt 0.3756 0.8949 +vt 0.4215 0.8949 +vt 0.7987 0.8413 +vt 0.7830 0.8413 +vt 0.7830 0.6602 +vt 0.7987 0.6602 +vt 0.4596 0.0160 +vt 0.5304 0.0160 +vt 0.5304 0.3060 +vt 0.4596 0.3060 +vt 0.8723 0.6936 +vt 0.8566 0.6936 +vt 0.8566 0.5125 +vt 0.8723 0.5125 +vt 0.8723 0.4572 +vt 0.8566 0.4572 +vt 0.9044 0.5213 +vt 0.9201 0.5213 +vt 0.9201 0.5866 +vt 0.9044 0.5866 +vt 0.5304 0.6281 +vt 0.4596 0.6281 +vt 0.4596 0.3381 +vt 0.5304 0.3381 +vt 0.3567 0.0160 +vt 0.4275 0.0160 +vt 0.4275 0.3060 +vt 0.3567 0.3060 +vt 0.8723 0.4251 +vt 0.8566 0.4251 +vt 0.8566 0.1508 +vt 0.8723 0.1508 +vt 0.7289 0.4251 +vt 0.7131 0.4251 +vt 0.7131 0.1508 +vt 0.7289 0.1508 +vt 0.6333 0.6281 +vt 0.5625 0.6281 +vt 0.5625 0.3381 +vt 0.6333 0.3381 +vn 0.4100 -0.9121 0.0000 +vn -0.4100 0.9121 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.9121 0.4100 0.0000 +vn 0.0000 0.0000 1.0000 +vn -0.9121 -0.4100 0.0000 +vn -0.9239 0.0000 -0.3827 +vn -0.3827 0.0000 -0.9239 +vn 0.3827 0.0000 -0.9239 +vn 0.9239 0.0000 -0.3827 +vn 0.9239 0.0000 0.3827 +vn 0.3827 0.0000 0.9239 +vn 0.0000 1.0000 0.0000 +vn -0.3827 0.0000 0.9239 +vn -0.9239 0.0000 0.3827 +vn 0.0000 -1.0000 0.0000 +vn -0.9659 -0.2588 0.0000 +vn -0.7071 -0.7071 0.0000 +vn -0.2588 -0.9659 -0.0000 +vn 0.2588 -0.9659 0.0000 +vn 0.7071 -0.7071 0.0000 +vn 0.9659 -0.2588 0.0000 +vn 0.9659 0.2588 0.0000 +vn 0.7071 0.7071 0.0000 +vn 0.2588 0.9659 0.0000 +vn -0.2588 0.9659 -0.0000 +vn -0.7071 0.7071 0.0000 +vn -0.9659 0.2588 0.0000 +vn 0.1966 -0.7339 -0.6502 +vn -0.1967 -0.7339 -0.6502 +vn -0.9121 0.4100 0.0000 +vn 0.4100 0.9121 0.0000 +vn -0.4100 -0.9121 0.0000 +vn 0.9121 -0.4100 -0.0000 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 8/6/2 7/7/2 6/8/2 +f 27/9/3 5/10/3 6/11/3 29/12/3 +f 29/13/4 6/14/4 7/15/4 31/16/4 +f 31/17/5 7/18/5 8/19/5 33/20/5 +f 26/21/6 1/22/6 4/23/6 32/24/6 +f 9/25/7 10/26/7 12/27/7 11/28/7 +f 11/29/8 12/30/8 14/31/8 13/32/8 +f 13/32/9 14/31/9 16/33/9 15/34/9 +f 15/35/10 16/36/10 18/37/10 17/38/10 +f 17/38/11 18/37/11 20/39/11 19/40/11 +f 19/41/12 20/42/12 22/43/12 21/44/12 +f 12/45/13 10/46/13 24/47/13 22/48/13 20/49/13 18/50/13 16/51/13 14/52/13 +f 21/44/14 22/43/14 24/53/14 23/54/14 +f 23/55/15 24/56/15 10/26/15 9/25/15 +f 9/57/16 11/58/16 13/59/16 15/60/16 17/61/16 19/62/16 21/63/16 23/64/16 +f 5/65/6 27/66/6 33/67/6 8/68/6 +f 3/69/5 30/70/5 32/71/5 4/72/5 +f 2/73/4 28/74/4 30/75/4 3/76/4 +f 1/77/3 26/78/3 28/79/3 2/80/3 +f 34/81/17 59/82/17 58/83/17 36/84/17 +f 36/84/18 58/83/18 60/85/18 38/86/18 +f 38/86/19 60/85/19 61/87/19 40/88/19 +f 40/89/20 61/90/20 62/91/20 42/92/20 +f 42/92/21 62/91/21 63/93/21 44/94/21 +f 44/94/22 63/93/22 64/95/22 46/96/22 +f 46/97/23 64/98/23 65/99/23 48/100/23 +f 48/100/24 65/99/24 66/101/24 50/102/24 +f 50/103/25 66/104/25 67/105/25 52/106/25 +f 52/106/26 67/105/26 68/107/26 54/108/26 +f 37/109/3 35/110/3 57/111/3 55/112/3 53/113/3 51/114/3 49/115/3 47/116/3 45/117/3 43/118/3 41/119/3 39/120/3 +f 54/108/27 68/107/27 69/121/27 56/122/27 +f 56/123/28 69/124/28 59/82/28 34/81/28 +f 34/125/5 36/126/5 38/127/5 40/128/5 42/129/5 44/130/5 46/131/5 48/132/5 50/133/5 52/134/5 54/135/5 56/136/5 +f 71/137/3 70/138/3 58/139/3 59/140/3 +f 70/138/3 72/141/3 60/142/3 58/139/3 +f 72/141/3 73/143/3 61/144/3 60/142/3 +f 73/143/3 74/145/3 62/146/3 61/144/3 +f 74/145/3 75/147/3 63/148/3 62/146/3 +f 75/147/3 76/149/3 64/150/3 63/148/3 +f 76/149/3 77/151/3 65/152/3 64/150/3 +f 77/151/3 78/153/3 66/154/3 65/152/3 +f 78/153/3 79/155/3 67/156/3 66/154/3 +f 79/155/3 80/157/3 68/158/3 67/156/3 +f 80/157/3 81/159/3 69/160/3 68/158/3 +f 81/159/3 71/137/3 59/140/3 69/160/3 +f 74/161/20 73/162/20 85/163/20 86/164/20 +f 37/165/24 39/166/24 96/167/24 94/168/24 +f 81/169/27 80/170/27 92/171/27 93/172/27 +f 51/173/19 53/174/19 103/175/19 102/176/19 +f 73/177/19 72/178/19 84/179/19 85/180/19 +f 35/181/23 37/165/23 94/168/23 95/182/23 +f 80/170/26 79/183/26 91/184/26 92/171/26 +f 49/185/18 51/173/18 102/176/18 101/186/18 +f 72/178/18 70/187/18 82/188/18 84/179/18 +f 79/183/25 78/189/25 90/190/25 91/184/25 +f 47/191/17 49/185/17 101/186/17 100/192/17 +f 70/187/17 71/193/17 83/194/17 82/188/17 +f 95/195/3 94/196/3 82/197/3 83/198/3 +f 94/196/3 96/199/3 84/200/3 82/197/3 +f 96/199/3 97/201/3 85/202/3 84/200/3 +f 97/201/3 98/203/3 86/204/3 85/202/3 +f 98/203/3 99/205/3 87/206/3 86/204/3 +f 99/205/3 100/207/3 88/208/3 87/206/3 +f 100/207/29 101/209/29 89/210/29 88/208/29 +f 101/209/3 102/211/3 90/212/3 89/210/3 +f 102/211/3 103/213/3 91/214/3 90/212/3 +f 103/213/3 104/215/3 92/216/3 91/214/3 +f 104/215/3 105/217/3 93/218/3 92/216/3 +f 105/217/30 95/195/30 83/198/30 93/218/30 +f 53/219/20 55/220/20 104/221/20 103/222/20 +f 71/193/28 81/223/28 93/224/28 83/194/28 +f 39/225/25 41/226/25 97/227/25 96/228/25 +f 75/229/21 74/161/21 86/164/21 87/230/21 +f 55/220/21 57/231/21 105/232/21 104/221/21 +f 41/226/26 43/233/26 98/234/26 97/227/26 +f 76/235/22 75/229/22 87/230/22 88/236/22 +f 57/231/22 35/237/22 95/238/22 105/232/22 +f 43/233/27 45/239/27 99/240/27 98/234/27 +f 77/241/23 76/242/23 88/243/23 89/244/23 +f 45/245/28 47/191/28 100/192/28 99/246/28 +f 78/247/24 77/241/24 89/244/24 90/248/24 +f 120/249/31 119/250/31 109/251/31 111/252/31 +f 112/253/3 110/254/3 116/255/3 117/256/3 +f 110/257/31 108/258/31 115/259/31 116/260/31 +f 117/261/32 116/260/32 115/259/32 114/262/32 +f 121/263/33 118/264/33 119/265/33 120/266/33 +f 119/267/5 118/268/5 107/269/5 109/270/5 +f 108/271/5 106/272/5 114/273/5 115/274/5 +f 113/275/34 107/276/34 118/277/34 121/278/34 +f 117/279/34 114/280/34 106/281/34 112/282/34 +f 121/283/3 120/284/3 111/285/3 113/286/3 diff --git a/advtrains/models/advtrains_dtrack_bumper_st.b3d b/advtrains/models/advtrains_dtrack_bumper_st.b3d new file mode 100644 index 0000000..a6d9745 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_bumper_st.b3d differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_30.b3d b/advtrains/models/advtrains_dtrack_bumper_st_30.b3d new file mode 100644 index 0000000..5f5b3f4 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_bumper_st_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_45.b3d b/advtrains/models/advtrains_dtrack_bumper_st_45.b3d new file mode 100644 index 0000000..f13ae75 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_bumper_st_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_bumper_st_60.b3d b/advtrains/models/advtrains_dtrack_bumper_st_60.b3d new file mode 100644 index 0000000..59a2285 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_bumper_st_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_cr.b3d b/advtrains/models/advtrains_dtrack_cr.b3d new file mode 100644 index 0000000..c708292 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_cr.b3d differ diff --git a/advtrains/models/advtrains_dtrack_cr_30.b3d b/advtrains/models/advtrains_dtrack_cr_30.b3d new file mode 100644 index 0000000..7ca0bda Binary files /dev/null and b/advtrains/models/advtrains_dtrack_cr_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_cr_45.b3d b/advtrains/models/advtrains_dtrack_cr_45.b3d new file mode 100644 index 0000000..b22ea0d Binary files /dev/null and b/advtrains/models/advtrains_dtrack_cr_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_cr_60.b3d b/advtrains/models/advtrains_dtrack_cr_60.b3d new file mode 100644 index 0000000..e9b16d6 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_cr_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_st.b3d b/advtrains/models/advtrains_dtrack_st.b3d new file mode 100644 index 0000000..c240416 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_st.b3d differ diff --git a/advtrains/models/advtrains_dtrack_st_30.b3d b/advtrains/models/advtrains_dtrack_st_30.b3d new file mode 100644 index 0000000..fd77e66 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_st_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_st_45.b3d b/advtrains/models/advtrains_dtrack_st_45.b3d new file mode 100644 index 0000000..af3afb1 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_st_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_st_60.b3d b/advtrains/models/advtrains_dtrack_st_60.b3d new file mode 100644 index 0000000..6cb19e6 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_st_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlcr.b3d b/advtrains/models/advtrains_dtrack_swlcr.b3d new file mode 100644 index 0000000..8b1ac0e Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlcr.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_30.b3d b/advtrains/models/advtrains_dtrack_swlcr_30.b3d new file mode 100644 index 0000000..6def7ab Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlcr_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_45.b3d b/advtrains/models/advtrains_dtrack_swlcr_45.b3d new file mode 100644 index 0000000..cc874ca Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlcr_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlcr_60.b3d b/advtrains/models/advtrains_dtrack_swlcr_60.b3d new file mode 100644 index 0000000..1472a00 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlcr_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlst.b3d b/advtrains/models/advtrains_dtrack_swlst.b3d new file mode 100644 index 0000000..ecdb326 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlst.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlst_30.b3d b/advtrains/models/advtrains_dtrack_swlst_30.b3d new file mode 100644 index 0000000..fd6e91d Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlst_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlst_45.b3d b/advtrains/models/advtrains_dtrack_swlst_45.b3d new file mode 100644 index 0000000..dae694e Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlst_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swlst_60.b3d b/advtrains/models/advtrains_dtrack_swlst_60.b3d new file mode 100644 index 0000000..8f2b0e2 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swlst_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrcr.b3d b/advtrains/models/advtrains_dtrack_swrcr.b3d new file mode 100644 index 0000000..4610826 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrcr.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_30.b3d b/advtrains/models/advtrains_dtrack_swrcr_30.b3d new file mode 100644 index 0000000..71b87f3 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrcr_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_45.b3d b/advtrains/models/advtrains_dtrack_swrcr_45.b3d new file mode 100644 index 0000000..5457972 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrcr_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrcr_60.b3d b/advtrains/models/advtrains_dtrack_swrcr_60.b3d new file mode 100644 index 0000000..167a3ff Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrcr_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrst.b3d b/advtrains/models/advtrains_dtrack_swrst.b3d new file mode 100644 index 0000000..69b6996 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrst.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrst_30.b3d b/advtrains/models/advtrains_dtrack_swrst_30.b3d new file mode 100644 index 0000000..19ee483 Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrst_30.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrst_45.b3d b/advtrains/models/advtrains_dtrack_swrst_45.b3d new file mode 100644 index 0000000..70d051f Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrst_45.b3d differ diff --git a/advtrains/models/advtrains_dtrack_swrst_60.b3d b/advtrains/models/advtrains_dtrack_swrst_60.b3d new file mode 100644 index 0000000..69a58fb Binary files /dev/null and b/advtrains/models/advtrains_dtrack_swrst_60.b3d differ diff --git a/advtrains/models/advtrains_dtrack_vst1.obj b/advtrains/models/advtrains_dtrack_vst1.obj new file mode 100644 index 0000000..33d9bf3 --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst1.obj @@ -0,0 +1,348 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst1_Cube.031 +v 0.753760 -0.500000 -0.500000 +v 0.753760 -0.500000 0.500000 +v 0.753760 -0.000000 0.500000 +v -0.753760 -0.500000 -0.500000 +v -0.753760 -0.500000 0.500000 +v -0.753760 -0.000000 0.500000 +v 0.329165 -0.196108 0.171599 +v 0.329165 -0.032047 0.171599 +v 0.329165 -0.367707 -0.171599 +v 0.329165 -0.203646 -0.171599 +v 0.462280 -0.196108 0.171599 +v 0.462280 -0.032047 0.171599 +v 0.462280 -0.367707 -0.171599 +v 0.462280 -0.203646 -0.171599 +v 0.412289 0.040000 0.500000 +v 0.412289 -0.460000 -0.500000 +v 0.560528 -0.460000 -0.500000 +v 0.560528 0.040000 0.500000 +v 0.474055 0.060000 0.500000 +v 0.474055 -0.440000 -0.500000 +v 0.498762 -0.440000 -0.500000 +v 0.498762 0.060000 0.500000 +v 0.474055 0.110000 0.500000 +v 0.474055 -0.390000 -0.500000 +v 0.498762 -0.390000 -0.500000 +v 0.498762 0.110000 0.500000 +v 0.529645 -0.385000 -0.500000 +v 0.529645 0.115000 0.500000 +v 0.443172 0.115000 0.500000 +v 0.443172 -0.385000 -0.500000 +v 0.529645 -0.360000 -0.500000 +v 0.529645 0.140000 0.500000 +v 0.443172 0.140000 0.500000 +v 0.443172 -0.360000 -0.500000 +v 0.741194 -0.042500 0.435000 +v -0.741194 -0.042500 0.435000 +v -0.741194 -0.102500 0.315000 +v 0.741194 -0.102500 0.315000 +v 0.741193 0.007500 0.435000 +v -0.741194 0.007500 0.435000 +v -0.741194 -0.052500 0.315000 +v 0.741194 -0.052500 0.315000 +v -0.011733 2.879186 0.500000 +v -0.011732 2.379186 -0.500001 +v -0.011733 2.900814 0.500000 +v -0.011732 2.400814 -0.500000 +v 0.011732 2.379186 -0.500000 +v 0.011732 2.879186 0.500000 +v 0.011732 2.400814 -0.500000 +v 0.011732 2.900814 0.500000 +v -0.412289 -0.460000 -0.500000 +v -0.412289 0.040000 0.500000 +v -0.560528 0.040000 0.500000 +v -0.560528 -0.460000 -0.500000 +v -0.474055 -0.440000 -0.500000 +v -0.474055 0.060000 0.500000 +v -0.498762 0.060000 0.500000 +v -0.498762 -0.440000 -0.500000 +v -0.474055 -0.390000 -0.500000 +v -0.474055 0.110000 0.500000 +v -0.498762 0.110000 0.500000 +v -0.498762 -0.390000 -0.500000 +v -0.529645 0.115000 0.500000 +v -0.529645 -0.385000 -0.500000 +v -0.443172 -0.385000 -0.500000 +v -0.443172 0.115000 0.500000 +v -0.529645 0.140000 0.500000 +v -0.529645 -0.360000 -0.500000 +v -0.443172 -0.360000 -0.500000 +v -0.443172 0.140000 0.500000 +v -0.741194 -0.477500 -0.435000 +v 0.741194 -0.477500 -0.435000 +v 0.741194 -0.417500 -0.315000 +v -0.741194 -0.417500 -0.315000 +v -0.741193 -0.427500 -0.435000 +v 0.741194 -0.427500 -0.435000 +v 0.741194 -0.367500 -0.315000 +v -0.741194 -0.367500 -0.315000 +v 0.741194 -0.166069 0.187862 +v -0.741194 -0.166069 0.187862 +v -0.741194 -0.226069 0.067862 +v 0.741194 -0.226069 0.067862 +v 0.741193 -0.116069 0.187862 +v -0.741194 -0.116069 0.187862 +v -0.741194 -0.176069 0.067862 +v 0.741194 -0.176069 0.067862 +v -0.741194 -0.353931 -0.187862 +v 0.741194 -0.353931 -0.187862 +v 0.741194 -0.293931 -0.067862 +v -0.741194 -0.293931 -0.067862 +v -0.741193 -0.303931 -0.187862 +v 0.741194 -0.303931 -0.187862 +v 0.741194 -0.243931 -0.067862 +v -0.741194 -0.243931 -0.067862 +v -0.329165 -0.196108 0.171599 +v -0.329165 -0.032047 0.171599 +v -0.329165 -0.367707 -0.171599 +v -0.329165 -0.203646 -0.171599 +v -0.462280 -0.196108 0.171599 +v -0.462280 -0.032047 0.171599 +v -0.462280 -0.367707 -0.171599 +v -0.462280 -0.203646 -0.171599 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 1.2064 -0.1190 +vt -0.2978 -0.1190 +vt -0.2978 -0.6179 +vt 1.2064 -0.6179 +vt -0.2924 0.9963 +vt -0.2924 -0.0015 +vt 1.2117 -0.0015 +vt 1.2117 0.9963 +vt 1.2064 0.9965 +vt 1.6526 0.1041 +vt -0.2978 0.9965 +vt -0.7440 0.1041 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 0.8944 -0.4472 +vn 1.0000 0.0000 0.0000 +vn -0.2782 0.8591 -0.4296 +vn 0.2782 0.8591 -0.4296 +vn 0.1433 -0.8852 0.4426 +vn -0.1433 -0.8852 0.4426 +vn 0.0000 -0.8944 0.4472 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst1_Cube.031_SlopeRailMaterial +s off +f 8/1/1 10/2/1 9/3/1 7/4/1 +f 10/2/2 14/5/2 13/6/2 9/7/2 +f 12/8/3 8/1/3 7/9/3 11/10/3 +f 12/8/4 14/5/4 10/2/4 8/1/4 +f 22/11/5 21/12/5 25/13/5 26/14/5 +f 15/15/6 19/16/6 20/17/6 16/18/6 +f 16/19/2 20/20/2 21/21/2 17/22/2 +f 17/23/7 21/12/7 22/11/7 18/24/7 +f 19/25/3 15/26/3 18/27/3 22/28/3 +f 26/29/3 23/30/3 19/25/3 22/28/3 +f 19/16/1 23/31/1 24/32/1 20/17/1 +f 21/21/2 20/20/2 24/33/2 25/34/2 +f 26/14/8 25/13/8 27/35/8 28/36/8 +f 24/32/9 23/31/9 29/37/9 30/38/9 +f 28/36/5 27/35/5 31/39/5 32/40/5 +f 30/38/1 29/37/1 33/41/1 34/42/1 +f 31/39/4 34/42/4 33/41/4 32/40/4 +f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 +f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 +f 39/47/4 42/48/4 41/49/4 40/50/4 +f 35/51/3 39/47/3 40/50/3 36/52/3 +f 36/53/1 40/50/1 41/49/1 37/54/1 +f 37/55/2 41/49/2 42/48/2 38/56/2 +f 39/47/5 35/57/5 38/58/5 42/48/5 +f 43/59/1 45/60/1 46/61/1 44/62/1 +f 47/63/5 49/64/5 50/65/5 48/66/5 +f 43/67/10 44/68/10 47/63/10 48/66/10 +f 45/60/4 50/65/4 49/64/4 46/61/4 +f 58/69/1 57/70/1 61/71/1 62/72/1 +f 51/73/7 55/74/7 56/75/7 52/76/7 +f 52/77/3 56/78/3 57/79/3 53/80/3 +f 53/81/6 57/70/6 58/69/6 54/82/6 +f 55/83/2 51/84/2 54/85/2 58/86/2 +f 62/87/2 59/88/2 55/83/2 58/86/2 +f 55/74/5 59/89/5 60/90/5 56/75/5 +f 57/79/3 56/78/3 60/91/3 61/92/3 +f 62/72/9 61/71/9 63/93/9 64/94/9 +f 60/90/8 59/89/8 65/95/8 66/96/8 +f 64/94/1 63/93/1 67/97/1 68/98/1 +f 66/96/5 65/95/5 69/99/5 70/100/5 +f 67/97/4 70/100/4 69/99/4 68/98/4 +f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 +f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 +f 75/105/4 78/106/4 77/107/4 76/108/4 +f 71/109/2 75/105/2 76/108/2 72/110/2 +f 72/111/5 76/108/5 77/107/5 73/112/5 +f 73/113/3 77/107/3 78/106/3 74/114/3 +f 75/105/1 71/115/1 74/116/1 78/106/1 +f 83/117/4 86/118/4 85/119/4 84/120/4 +f 79/121/3 83/117/3 84/120/3 80/122/3 +f 80/123/1 84/120/1 85/119/1 81/124/1 +f 81/125/2 85/119/2 86/118/2 82/126/2 +f 83/117/5 79/127/5 82/128/5 86/118/5 +f 91/129/4 94/130/4 93/131/4 92/132/4 +f 87/133/2 91/129/2 92/132/2 88/134/2 +f 88/135/5 92/132/5 93/131/5 89/136/5 +f 89/137/3 93/131/3 94/130/3 90/138/3 +f 91/129/1 87/139/1 90/140/1 94/130/1 +f 96/141/5 95/142/5 97/143/5 98/144/5 +f 98/144/2 97/145/2 101/146/2 102/147/2 +f 100/148/3 99/149/3 95/150/3 96/141/3 +f 100/148/4 96/141/4 98/144/4 102/147/4 +g dtrack_vst1_Cube.031_SlopeGravelMaterial +f 3/151/3 6/152/3 5/153/3 2/154/3 +f 1/155/11 2/156/11 5/157/11 4/158/11 +f 1/159/5 3/151/5 2/160/5 +f 6/152/1 4/161/1 5/162/1 +f 4/161/4 6/152/4 3/151/4 1/159/4 diff --git a/advtrains/models/advtrains_dtrack_vst1_45.obj b/advtrains/models/advtrains_dtrack_vst1_45.obj new file mode 100644 index 0000000..8ff8343 --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst1_45.obj @@ -0,0 +1,434 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst1_45_Cube.033 +v 0.111416 -0.221340 0.354093 +v 0.111416 -0.057279 0.354093 +v 0.354093 -0.342660 0.111416 +v 0.354093 -0.178600 0.111416 +v 0.205542 -0.221340 0.448220 +v 0.205542 -0.057279 0.448220 +v 0.448220 -0.342660 0.205543 +v 0.448220 -0.178600 0.205543 +v -0.208358 0.039814 0.791422 +v 0.791423 -0.460000 -0.208357 +v 0.896243 -0.460000 -0.103536 +v -0.103538 0.039814 0.896242 +v -0.164683 0.059814 0.835097 +v 0.835098 -0.440000 -0.164682 +v 0.852568 -0.440000 -0.147212 +v -0.147213 0.059814 0.852567 +v -0.164683 0.109814 0.835097 +v 0.835098 -0.390000 -0.164682 +v 0.852568 -0.390000 -0.147212 +v -0.147213 0.109814 0.852567 +v 0.874406 -0.385000 -0.125374 +v -0.125375 0.114814 0.874405 +v -0.186520 0.114814 0.813259 +v 0.813260 -0.385000 -0.186519 +v 0.874406 -0.360000 -0.125374 +v -0.125375 0.139814 0.874405 +v -0.186520 0.139814 0.813259 +v 0.813260 -0.360000 -0.186519 +v 0.476117 -0.186104 0.572089 +v -0.572088 -0.186104 -0.476117 +v -0.656942 -0.143684 -0.391265 +v 0.391264 -0.143684 0.656941 +v 0.476117 -0.236104 0.572089 +v -0.572088 -0.236104 -0.476117 +v -0.656941 -0.193684 -0.391265 +v 0.391264 -0.193684 0.656942 +v -0.508186 2.879001 0.491594 +v 0.491594 2.379186 -0.508186 +v -0.508186 2.900629 0.491593 +v 0.491594 2.400814 -0.508186 +v 0.508186 2.379186 -0.491594 +v -0.491594 2.879001 0.508186 +v 0.508186 2.400814 -0.491594 +v -0.491594 2.900629 0.508186 +v 0.208358 -0.460000 -0.791421 +v -0.791423 0.039814 0.208357 +v -0.896244 0.039814 0.103537 +v 0.103537 -0.460000 -0.896242 +v 0.164682 -0.440000 -0.835097 +v -0.835099 0.059815 0.164682 +v -0.852568 0.059814 0.147212 +v 0.147212 -0.440000 -0.852567 +v 0.164682 -0.390000 -0.835097 +v -0.835099 0.109815 0.164682 +v -0.852568 0.109814 0.147212 +v 0.147212 -0.390000 -0.852567 +v -0.874406 0.114814 0.125374 +v 0.125375 -0.385000 -0.874404 +v 0.186520 -0.385000 -0.813259 +v -0.813261 0.114815 0.186520 +v -0.874406 0.139814 0.125374 +v 0.125375 -0.360000 -0.874404 +v 0.186520 -0.360000 -0.813259 +v -0.813261 0.139814 0.186520 +v -0.230055 -0.407095 -0.818151 +v 0.818151 -0.407095 0.230055 +v 0.733298 -0.364675 0.314908 +v -0.314908 -0.364675 -0.733299 +v -0.230055 -0.357095 -0.818151 +v 0.818151 -0.357095 0.230056 +v 0.733298 -0.314675 0.314908 +v -0.314908 -0.314675 -0.733298 +v 0.314908 -0.105511 0.733298 +v -0.733298 -0.105511 -0.314908 +v -0.818151 -0.063091 -0.230056 +v 0.230055 -0.063091 0.818151 +v 0.314908 -0.155511 0.733298 +v -0.733298 -0.155511 -0.314908 +v -0.818151 -0.113091 -0.230055 +v 0.230055 -0.113091 0.818151 +v -0.391264 -0.326502 -0.656942 +v 0.656941 -0.326502 0.391265 +v 0.572089 -0.284082 0.476118 +v -0.476117 -0.284082 -0.572089 +v -0.391264 -0.276502 -0.656941 +v 0.656942 -0.276502 0.391265 +v 0.572088 -0.234082 0.476117 +v -0.476117 -0.234082 -0.572089 +v -0.354093 -0.221340 -0.111416 +v -0.354093 -0.057279 -0.111416 +v -0.111416 -0.342660 -0.354093 +v -0.111416 -0.178600 -0.354093 +v -0.448220 -0.221340 -0.205543 +v -0.448220 -0.057279 -0.205543 +v -0.205543 -0.342660 -0.448220 +v -0.205543 -0.178600 -0.448220 +v -0.069408 -0.487406 -0.978798 +v 0.978798 -0.487406 0.069409 +v 0.893945 -0.444986 0.154261 +v -0.154261 -0.444986 -0.893945 +v -0.069408 -0.437406 -0.978798 +v 0.978798 -0.437406 0.069409 +v 0.893945 -0.394986 0.154261 +v -0.154261 -0.394986 -0.893945 +v 0.069408 -0.032780 0.978798 +v -0.978798 -0.032780 -0.069409 +v -0.893945 -0.075200 -0.154261 +v 0.154261 -0.075200 0.893945 +v 0.069408 0.017220 0.978797 +v -0.978798 0.017220 -0.069409 +v -0.893945 -0.025200 -0.154261 +v 0.154261 -0.025200 0.893945 +v -0.029561 -0.500000 -1.029558 +v 1.029558 -0.500000 0.029561 +v -1.029558 -0.500000 -0.029561 +v -1.029558 0.000000 -0.029561 +v 0.029561 -0.500000 1.029558 +v 0.029561 0.000000 1.029558 +v -0.500000 0.000000 1.559119 +v -1.559119 0.000000 0.500000 +v -0.499999 0.000000 0.499999 +v -1.559120 -0.500000 0.500000 +v -0.500000 -0.500000 1.559119 +v -0.500003 -0.500000 0.500000 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.8837 0.9625 +vt 0.8524 0.0348 +vt 0.8837 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.0035 +vt 0.9588 0.0348 +vt 0.8837 0.0035 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.8837 0.9625 +vt 0.8524 0.0348 +vt 0.8837 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.0035 +vt 0.9588 0.0348 +vt 0.8837 0.0035 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt -0.3235 0.5003 +vt 0.6181 0.0296 +vt 0.6181 0.5003 +vt 0.6188 0.9848 +vt -0.3228 0.5141 +vt 0.6188 0.5141 +vt 0.0669 1.0031 +vt 0.0669 0.5045 +vt 0.0669 0.0059 +vt 1.1195 0.0059 +vt 1.1195 1.0031 +vt 0.1925 0.0071 +vt 0.1925 0.5057 +vt -0.3061 0.0071 +vt -0.4317 1.0031 +vt -0.4317 0.0059 +vt 1.1341 0.0071 +vt 1.1341 1.0043 +vt 0.1925 1.0043 +vt 1.1202 0.9906 +vt 0.4151 0.9906 +vt 0.4151 0.5199 +vt 1.1202 0.5199 +vt 0.4050 0.0285 +vt 1.1101 0.0285 +vt 1.1101 0.4992 +vt 0.4050 0.4992 +vt -0.3061 1.0043 +vt 1.1174 0.5141 +vt 1.1174 0.9848 +vt 1.1167 0.0296 +vt 1.1167 0.5003 +vn -0.7071 0.0000 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn -0.7071 0.0000 0.7071 +vn 0.2357 0.9428 -0.2357 +vn 0.7071 0.0000 0.7071 +vn 0.0189 0.9017 -0.4319 +vn 0.4319 0.9017 -0.0189 +vn -0.1263 -0.9320 0.3397 +vn -0.3397 -0.9320 0.1263 +vn -0.2357 -0.9428 0.2357 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +g dtrack_vst1_45_Cube.033_SlopeRailMaterial +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/2/2 8/5/2 7/6/2 3/7/2 +f 6/8/3 2/1/3 1/9/3 5/10/3 +f 6/8/4 8/5/4 4/2/4 2/1/4 +f 16/11/5 15/12/5 19/13/5 20/14/5 +f 9/15/6 13/16/6 14/17/6 10/18/6 +f 10/19/2 14/20/2 15/21/2 11/22/2 +f 11/23/7 15/12/7 16/11/7 12/24/7 +f 13/25/3 9/26/3 12/27/3 16/28/3 +f 20/29/3 17/30/3 13/25/3 16/28/3 +f 13/16/1 17/31/1 18/32/1 14/17/1 +f 15/21/2 14/20/2 18/33/2 19/34/2 +f 20/14/8 19/13/8 21/35/8 22/36/8 +f 18/32/9 17/31/9 23/37/9 24/38/9 +f 22/36/5 21/35/5 25/39/5 26/40/5 +f 24/38/1 23/37/1 27/41/1 28/42/1 +f 25/39/4 28/42/4 27/41/4 26/40/4 +f 17/30/3 20/29/3 22/43/3 26/40/3 27/41/3 23/44/3 +f 18/33/2 24/45/2 28/42/2 25/39/2 21/46/2 19/34/2 +f 32/47/5 36/48/5 33/49/5 29/50/5 +f 34/51/2 30/52/2 29/50/2 33/53/2 +f 35/54/1 31/55/1 30/52/1 34/56/1 +f 36/57/3 32/47/3 31/55/3 35/58/3 +f 32/47/4 29/50/4 30/52/4 31/55/4 +f 37/59/1 39/60/1 40/61/1 38/62/1 +f 41/63/5 43/64/5 44/65/5 42/66/5 +f 37/67/10 38/68/10 41/63/10 42/66/10 +f 39/60/4 44/65/4 43/64/4 40/61/4 +f 52/69/1 51/70/1 55/71/1 56/72/1 +f 45/73/7 49/74/7 50/75/7 46/76/7 +f 46/77/3 50/78/3 51/79/3 47/80/3 +f 47/81/6 51/70/6 52/69/6 48/82/6 +f 49/83/2 45/84/2 48/85/2 52/86/2 +f 56/87/2 53/88/2 49/83/2 52/86/2 +f 49/74/5 53/89/5 54/90/5 50/75/5 +f 51/79/3 50/78/3 54/91/3 55/92/3 +f 56/72/9 55/71/9 57/93/9 58/94/9 +f 54/90/8 53/89/8 59/95/8 60/96/8 +f 58/94/1 57/93/1 61/97/1 62/98/1 +f 60/96/5 59/95/5 63/99/5 64/100/5 +f 61/97/4 64/100/4 63/99/4 62/98/4 +f 53/88/2 56/87/2 58/101/2 62/98/2 63/99/2 59/102/2 +f 54/91/3 60/103/3 64/100/3 61/97/3 57/104/3 55/92/3 +f 69/105/4 72/106/4 71/107/4 70/108/4 +f 65/109/2 69/105/2 70/108/2 66/110/2 +f 66/111/5 70/108/5 71/107/5 67/112/5 +f 67/113/3 71/107/3 72/106/3 68/114/3 +f 69/105/1 65/115/1 68/116/1 72/106/1 +f 76/117/5 80/118/5 77/119/5 73/120/5 +f 78/121/2 74/122/2 73/120/2 77/123/2 +f 79/124/1 75/125/1 74/122/1 78/126/1 +f 80/127/3 76/117/3 75/125/3 79/128/3 +f 76/117/4 73/120/4 74/122/4 75/125/4 +f 85/129/4 88/130/4 87/131/4 86/132/4 +f 81/133/2 85/129/2 86/132/2 82/134/2 +f 82/135/5 86/132/5 87/131/5 83/136/5 +f 83/137/3 87/131/3 88/130/3 84/138/3 +f 85/129/1 81/139/1 84/140/1 88/130/1 +f 90/141/5 89/142/5 91/143/5 92/144/5 +f 92/144/2 91/145/2 95/146/2 96/147/2 +f 94/148/3 93/149/3 89/150/3 90/141/3 +f 94/148/4 90/141/4 92/144/4 96/147/4 +f 101/151/4 104/152/4 103/153/4 102/154/4 +f 97/155/2 101/151/2 102/154/2 98/156/2 +f 98/157/5 102/154/5 103/153/5 99/158/5 +f 99/159/3 103/153/3 104/152/3 100/160/3 +f 101/151/1 97/161/1 100/162/1 104/152/1 +f 109/163/4 112/164/4 111/165/4 110/166/4 +f 105/167/3 109/163/3 110/166/3 106/168/3 +f 106/169/1 110/166/1 111/165/1 107/170/1 +f 107/171/2 111/165/2 112/164/2 108/172/2 +f 109/163/5 105/173/5 108/174/5 112/164/5 +g dtrack_vst1_45_Cube.033_SlopeGravelMaterial +f 114/175/5 118/176/5 117/177/5 +f 116/178/1 113/179/1 115/180/1 +f 116/181/4 121/182/4 118/183/4 114/184/4 113/185/4 +f 115/186/11 124/187/11 122/188/11 +f 116/181/12 120/189/12 121/182/12 +f 118/183/12 121/182/12 119/190/12 +f 113/191/11 114/192/11 117/193/11 124/187/11 115/186/11 +f 121/194/13 120/195/13 122/196/13 124/197/13 +f 119/198/14 121/199/14 124/200/14 123/201/14 +f 123/202/11 124/187/11 117/193/11 +f 116/178/1 115/180/1 122/203/1 120/204/1 +f 117/177/5 118/176/5 119/205/5 123/206/5 diff --git a/advtrains/models/advtrains_dtrack_vst2.obj b/advtrains/models/advtrains_dtrack_vst2.obj new file mode 100644 index 0000000..444ce42 --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst2.obj @@ -0,0 +1,372 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst2_Cube.032 +v 0.753760 0.000000 -0.500000 +v 0.753760 0.000000 0.500000 +v 0.753760 0.500000 0.500000 +v -0.753760 0.000000 -0.500000 +v -0.753760 0.000000 0.500000 +v -0.753760 0.500000 0.500000 +v 0.329165 0.303892 0.171599 +v 0.329165 0.467953 0.171599 +v 0.329165 0.132293 -0.171599 +v 0.329165 0.296354 -0.171599 +v 0.462280 0.303892 0.171599 +v 0.462280 0.467953 0.171599 +v 0.462280 0.132293 -0.171599 +v 0.462280 0.296354 -0.171599 +v 0.412289 0.540000 0.500000 +v 0.412289 0.040000 -0.500000 +v 0.560528 0.040000 -0.500000 +v 0.560528 0.540000 0.500000 +v 0.474055 0.560000 0.500000 +v 0.474055 0.060000 -0.500000 +v 0.498762 0.060000 -0.500000 +v 0.498762 0.560000 0.500000 +v 0.474055 0.610000 0.500000 +v 0.474055 0.110000 -0.500000 +v 0.498762 0.110000 -0.500000 +v 0.498762 0.610000 0.500000 +v 0.529645 0.115000 -0.500000 +v 0.529645 0.615000 0.500000 +v 0.443172 0.615000 0.500000 +v 0.443172 0.115000 -0.500000 +v 0.529645 0.140000 -0.500000 +v 0.529645 0.640000 0.500000 +v 0.443172 0.640000 0.500000 +v 0.443172 0.140000 -0.500000 +v 0.741194 0.457500 0.435000 +v -0.741194 0.457500 0.435000 +v -0.741194 0.397500 0.315000 +v 0.741194 0.397500 0.315000 +v 0.741193 0.507500 0.435000 +v -0.741194 0.507500 0.435000 +v -0.741194 0.447500 0.315000 +v 0.741194 0.447500 0.315000 +v -0.011733 3.379186 0.500000 +v -0.011732 2.879186 -0.500001 +v -0.011733 3.400814 0.500000 +v -0.011732 2.900814 -0.500000 +v 0.011732 2.879186 -0.500000 +v 0.011732 3.379186 0.500000 +v 0.011732 2.900814 -0.500000 +v 0.011732 3.400814 0.500000 +v -0.412289 0.040000 -0.500000 +v -0.412289 0.540000 0.500000 +v -0.560528 0.540000 0.500000 +v -0.560528 0.040000 -0.500000 +v -0.474055 0.060000 -0.500000 +v -0.474055 0.560000 0.500000 +v -0.498762 0.560000 0.500000 +v -0.498762 0.060000 -0.500000 +v -0.474055 0.110000 -0.500000 +v -0.474055 0.610000 0.500000 +v -0.498762 0.610000 0.500000 +v -0.498762 0.110000 -0.500000 +v -0.529645 0.615000 0.500000 +v -0.529645 0.115000 -0.500000 +v -0.443172 0.115000 -0.500000 +v -0.443172 0.615000 0.500000 +v -0.529645 0.640000 0.500000 +v -0.529645 0.140000 -0.500000 +v -0.443172 0.140000 -0.500000 +v -0.443172 0.640000 0.500000 +v -0.741194 0.022500 -0.435000 +v 0.741194 0.022500 -0.435000 +v 0.741194 0.082500 -0.315000 +v -0.741194 0.082500 -0.315000 +v -0.741193 0.072500 -0.435000 +v 0.741194 0.072500 -0.435000 +v 0.741194 0.132500 -0.315000 +v -0.741194 0.132500 -0.315000 +v 0.741194 0.333931 0.187862 +v -0.741194 0.333931 0.187862 +v -0.741194 0.273931 0.067862 +v 0.741194 0.273931 0.067862 +v 0.741193 0.383931 0.187862 +v -0.741194 0.383931 0.187862 +v -0.741194 0.323931 0.067862 +v 0.741194 0.323931 0.067862 +v -0.741194 0.146069 -0.187862 +v 0.741194 0.146069 -0.187862 +v 0.741194 0.206069 -0.067862 +v -0.741194 0.206069 -0.067862 +v -0.741193 0.196069 -0.187862 +v 0.741194 0.196069 -0.187862 +v 0.741194 0.256069 -0.067862 +v -0.741194 0.256069 -0.067862 +v -0.329165 0.303892 0.171599 +v -0.329165 0.467953 0.171599 +v -0.329165 0.132293 -0.171599 +v -0.329165 0.296354 -0.171599 +v -0.462280 0.303892 0.171599 +v -0.462280 0.467953 0.171599 +v -0.462280 0.132293 -0.171599 +v -0.462280 0.296354 -0.171599 +v 0.753760 -0.500000 0.500000 +v 0.753760 -0.500000 -0.500000 +v -0.753760 -0.500000 0.500000 +v -0.753760 -0.500000 -0.500000 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 1.2113 -0.1167 +vt -0.2846 -0.1167 +vt -0.2846 -0.6128 +vt 1.2113 -0.6128 +vt -0.2852 0.4989 +vt 1.2107 0.4989 +vt 1.2107 0.9950 +vt -0.2852 0.9950 +vt 1.2113 0.9927 +vt 1.6551 0.1052 +vt -0.2846 0.9927 +vt -0.7284 0.1052 +vt -0.2873 0.9952 +vt -0.2873 0.0029 +vt 1.2086 0.0029 +vt 1.2086 0.9952 +vt 0.7066 0.9945 +vt -0.2857 0.9945 +vt -0.2857 0.4984 +vt 0.7066 0.4984 +vt 1.2107 0.9918 +vt -0.2852 0.9918 +vt -0.2852 0.4956 +vt 1.2107 0.4956 +vt 0.7071 0.9996 +vt -0.2852 0.9996 +vt -0.2852 0.5034 +vt 0.7071 0.5034 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 0.8944 -0.4472 +vn 1.0000 0.0000 0.0000 +vn -0.2782 0.8591 -0.4296 +vn 0.2782 0.8591 -0.4296 +vn 0.1433 -0.8852 0.4426 +vn -0.1433 -0.8852 0.4426 +vn 0.0000 -0.8944 0.4472 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst2_Cube.032_SlopeRailMaterial +s off +f 8/1/1 10/2/1 9/3/1 7/4/1 +f 10/2/2 14/5/2 13/6/2 9/7/2 +f 12/8/3 8/1/3 7/9/3 11/10/3 +f 12/8/4 14/5/4 10/2/4 8/1/4 +f 22/11/5 21/12/5 25/13/5 26/14/5 +f 15/15/6 19/16/6 20/17/6 16/18/6 +f 16/19/2 20/20/2 21/21/2 17/22/2 +f 17/23/7 21/12/7 22/11/7 18/24/7 +f 19/25/3 15/26/3 18/27/3 22/28/3 +f 26/29/3 23/30/3 19/25/3 22/28/3 +f 19/16/1 23/31/1 24/32/1 20/17/1 +f 21/21/2 20/20/2 24/33/2 25/34/2 +f 26/14/8 25/13/8 27/35/8 28/36/8 +f 24/32/9 23/31/9 29/37/9 30/38/9 +f 28/36/5 27/35/5 31/39/5 32/40/5 +f 30/38/1 29/37/1 33/41/1 34/42/1 +f 31/39/4 34/42/4 33/41/4 32/40/4 +f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 +f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 +f 39/47/4 42/48/4 41/49/4 40/50/4 +f 35/51/3 39/47/3 40/50/3 36/52/3 +f 36/53/1 40/50/1 41/49/1 37/54/1 +f 37/55/2 41/49/2 42/48/2 38/56/2 +f 39/47/5 35/57/5 38/58/5 42/48/5 +f 43/59/1 45/60/1 46/61/1 44/62/1 +f 47/63/5 49/64/5 50/65/5 48/66/5 +f 43/67/10 44/68/10 47/63/10 48/66/10 +f 45/60/4 50/65/4 49/64/4 46/61/4 +f 58/69/1 57/70/1 61/71/1 62/72/1 +f 51/73/7 55/74/7 56/75/7 52/76/7 +f 52/77/3 56/78/3 57/79/3 53/80/3 +f 53/81/6 57/70/6 58/69/6 54/82/6 +f 55/83/2 51/84/2 54/85/2 58/86/2 +f 62/87/2 59/88/2 55/83/2 58/86/2 +f 55/74/5 59/89/5 60/90/5 56/75/5 +f 57/79/3 56/78/3 60/91/3 61/92/3 +f 62/72/9 61/71/9 63/93/9 64/94/9 +f 60/90/8 59/89/8 65/95/8 66/96/8 +f 64/94/1 63/93/1 67/97/1 68/98/1 +f 66/96/5 65/95/5 69/99/5 70/100/5 +f 67/97/4 70/100/4 69/99/4 68/98/4 +f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 +f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 +f 75/105/4 78/106/4 77/107/4 76/108/4 +f 71/109/2 75/105/2 76/108/2 72/110/2 +f 72/111/5 76/108/5 77/107/5 73/112/5 +f 73/113/3 77/107/3 78/106/3 74/114/3 +f 75/105/1 71/115/1 74/116/1 78/106/1 +f 83/117/4 86/118/4 85/119/4 84/120/4 +f 79/121/3 83/117/3 84/120/3 80/122/3 +f 80/123/1 84/120/1 85/119/1 81/124/1 +f 81/125/2 85/119/2 86/118/2 82/126/2 +f 83/117/5 79/127/5 82/128/5 86/118/5 +f 91/129/4 94/130/4 93/131/4 92/132/4 +f 87/133/2 91/129/2 92/132/2 88/134/2 +f 88/135/5 92/132/5 93/131/5 89/136/5 +f 89/137/3 93/131/3 94/130/3 90/138/3 +f 91/129/1 87/139/1 90/140/1 94/130/1 +f 96/141/5 95/142/5 97/143/5 98/144/5 +f 98/144/2 97/145/2 101/146/2 102/147/2 +f 100/148/3 99/149/3 95/150/3 96/141/3 +f 100/148/4 96/141/4 98/144/4 102/147/4 +g dtrack_vst2_Cube.032_SlopeGravelMaterial +f 3/151/3 6/152/3 5/153/3 2/154/3 +f 4/155/2 1/156/2 104/157/2 106/158/2 +f 1/159/5 3/151/5 2/160/5 +f 6/152/1 4/161/1 5/162/1 +f 4/161/4 6/152/4 3/151/4 1/159/4 +f 104/163/11 103/164/11 105/165/11 106/166/11 +f 5/167/1 4/168/1 106/169/1 105/170/1 +f 2/171/3 5/172/3 105/173/3 103/174/3 +f 1/175/5 2/176/5 103/177/5 104/178/5 diff --git a/advtrains/models/advtrains_dtrack_vst2_45.obj b/advtrains/models/advtrains_dtrack_vst2_45.obj new file mode 100644 index 0000000..5dc708b --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst2_45.obj @@ -0,0 +1,462 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst2_45_Cube.035 +v 0.111416 0.278660 0.354093 +v 0.111416 0.442721 0.354093 +v 0.354093 0.157340 0.111416 +v 0.354093 0.321400 0.111416 +v 0.205542 0.278660 0.448220 +v 0.205542 0.442721 0.448220 +v 0.448220 0.157340 0.205543 +v 0.448220 0.321400 0.205543 +v -0.208358 0.539814 0.791422 +v 0.791423 0.040000 -0.208357 +v 0.896243 0.040000 -0.103536 +v -0.103538 0.539814 0.896242 +v -0.164683 0.559814 0.835097 +v 0.835098 0.060000 -0.164682 +v 0.852568 0.060000 -0.147212 +v -0.147213 0.559814 0.852567 +v -0.164683 0.609814 0.835097 +v 0.835098 0.110000 -0.164682 +v 0.852568 0.110000 -0.147212 +v -0.147213 0.609814 0.852567 +v 0.874406 0.115000 -0.125374 +v -0.125375 0.614814 0.874405 +v -0.186520 0.614814 0.813259 +v 0.813260 0.115000 -0.186519 +v 0.874406 0.140000 -0.125374 +v -0.125375 0.639814 0.874405 +v -0.186520 0.639814 0.813259 +v 0.813260 0.140000 -0.186519 +v 0.476117 0.313896 0.572089 +v -0.572088 0.313896 -0.476117 +v -0.656942 0.356316 -0.391265 +v 0.391264 0.356316 0.656941 +v 0.476117 0.263896 0.572089 +v -0.572088 0.263896 -0.476117 +v -0.656941 0.306316 -0.391265 +v 0.391264 0.306316 0.656942 +v -0.508186 3.379001 0.491594 +v 0.491594 2.879186 -0.508186 +v -0.508186 3.400629 0.491593 +v 0.491594 2.900814 -0.508186 +v 0.508186 2.879186 -0.491594 +v -0.491594 3.379001 0.508186 +v 0.508186 2.900814 -0.491594 +v -0.491594 3.400629 0.508186 +v 0.208358 0.040000 -0.791421 +v -0.791423 0.539814 0.208357 +v -0.896244 0.539814 0.103537 +v 0.103537 0.040000 -0.896242 +v 0.164682 0.060000 -0.835097 +v -0.835099 0.559815 0.164682 +v -0.852568 0.559814 0.147212 +v 0.147212 0.060000 -0.852567 +v 0.164682 0.110000 -0.835097 +v -0.835099 0.609815 0.164682 +v -0.852568 0.609814 0.147212 +v 0.147212 0.110000 -0.852567 +v -0.874406 0.614814 0.125374 +v 0.125375 0.115000 -0.874404 +v 0.186520 0.115000 -0.813259 +v -0.813261 0.614815 0.186520 +v -0.874406 0.639814 0.125374 +v 0.125375 0.140000 -0.874404 +v 0.186520 0.140000 -0.813259 +v -0.813261 0.639814 0.186520 +v -0.230055 0.092905 -0.818151 +v 0.818151 0.092905 0.230055 +v 0.733298 0.135325 0.314908 +v -0.314908 0.135325 -0.733299 +v -0.230055 0.142905 -0.818151 +v 0.818151 0.142905 0.230056 +v 0.733298 0.185325 0.314908 +v -0.314908 0.185325 -0.733298 +v 0.314908 0.394489 0.733298 +v -0.733298 0.394489 -0.314908 +v -0.818151 0.436909 -0.230056 +v 0.230055 0.436909 0.818151 +v 0.314908 0.344489 0.733298 +v -0.733298 0.344489 -0.314908 +v -0.818151 0.386909 -0.230055 +v 0.230055 0.386909 0.818151 +v -0.391264 0.173498 -0.656942 +v 0.656941 0.173498 0.391265 +v 0.572089 0.215918 0.476118 +v -0.476117 0.215918 -0.572089 +v -0.391264 0.223498 -0.656941 +v 0.656942 0.223498 0.391265 +v 0.572088 0.265918 0.476117 +v -0.476117 0.265918 -0.572089 +v -0.354093 0.278660 -0.111416 +v -0.354093 0.442721 -0.111416 +v -0.111416 0.157340 -0.354093 +v -0.111416 0.321400 -0.354093 +v -0.448220 0.278660 -0.205543 +v -0.448220 0.442721 -0.205543 +v -0.205543 0.157340 -0.448220 +v -0.205543 0.321400 -0.448220 +v -0.069408 0.012594 -0.978798 +v 0.978798 0.012594 0.069409 +v 0.893945 0.055014 0.154261 +v -0.154261 0.055014 -0.893945 +v -0.069408 0.062594 -0.978798 +v 0.978798 0.062594 0.069409 +v 0.893945 0.105014 0.154261 +v -0.154261 0.105014 -0.893945 +v 0.069408 0.467220 0.978798 +v -0.978798 0.467220 -0.069409 +v -0.893945 0.424800 -0.154261 +v 0.154261 0.424800 0.893945 +v 0.069408 0.517220 0.978797 +v -0.978798 0.517220 -0.069409 +v -0.893945 0.474800 -0.154261 +v 0.154261 0.474800 0.893945 +v -0.029561 -0.000000 -1.029558 +v 1.029558 0.000000 0.029561 +v -1.029558 -0.000000 -0.029561 +v -1.029558 0.500000 -0.029561 +v 0.029561 0.000000 1.029558 +v 0.029561 0.500000 1.029558 +v -0.500000 0.500000 1.559119 +v -1.559119 0.500000 0.500000 +v -0.499999 0.500000 0.499999 +v -1.559120 -0.000000 0.500000 +v -0.500000 0.000000 1.559119 +v -0.500003 0.000000 0.500000 +v 1.029558 -0.500000 0.029561 +v -0.029561 -0.500000 -1.029558 +v 0.029561 -0.500000 1.029558 +v -1.029558 -0.500000 -0.029561 +v -0.500003 -0.500000 0.500000 +v -0.500000 -0.500000 1.559119 +v -1.559120 -0.500000 0.500000 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.8837 0.9625 +vt 0.8524 0.0348 +vt 0.8837 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.0035 +vt 0.9588 0.0348 +vt 0.8837 0.0035 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.8837 0.9625 +vt 0.8524 0.0348 +vt 0.8837 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.0035 +vt 0.9588 0.0348 +vt 0.8837 0.0035 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt -0.2938 0.5095 +vt 0.6540 0.0358 +vt 0.6540 0.5096 +vt 0.6549 0.9852 +vt -0.2928 0.5114 +vt 0.6549 0.5114 +vt 0.1047 0.9953 +vt 0.1047 0.4934 +vt 0.1047 -0.0085 +vt 1.1643 -0.0085 +vt 1.1643 0.9953 +vt 1.1568 0.5114 +vt 0.6549 0.0377 +vt 1.1568 0.0377 +vt -0.3972 0.9953 +vt -0.3972 -0.0085 +vt 1.1431 0.5009 +vt 0.4334 0.5009 +vt 0.4334 0.0272 +vt 1.1431 0.0272 +vt 1.1431 0.9747 +vt 0.4334 0.9747 +vt 0.7633 0.9654 +vt 0.0536 0.9654 +vt 0.0536 0.4916 +vt 0.7633 0.4916 +vt 1.1559 0.5096 +vt 1.1559 0.9833 +vt 0.6540 0.9833 +vt 0.1053 -0.0176 +vt 0.1052 0.4843 +vt -0.3966 -0.0176 +vt 1.0530 -0.0176 +vt 1.0530 0.9861 +vt 0.1053 0.9861 +vt -0.3966 0.9861 +vt 0.0536 0.0179 +vt 0.7633 0.0179 +vt -0.2928 0.0377 +vt -0.2938 0.9833 +vt 0.0455 0.1273 +vt 1.0492 0.1273 +vt 1.0492 0.6011 +vt 0.0455 0.6011 +vt 1.1568 0.9852 +vt 1.1559 0.0358 +vn -0.7071 0.0000 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn -0.7071 0.0000 0.7071 +vn 0.2357 0.9428 -0.2357 +vn 0.7071 0.0000 0.7071 +vn 0.0189 0.9017 -0.4319 +vn 0.4319 0.9017 -0.0189 +vn -0.1263 -0.9320 0.3397 +vn -0.3397 -0.9320 0.1263 +vn -0.2357 -0.9428 0.2357 +vn 0.0000 1.0000 0.0000 +vn -0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst2_45_Cube.035_SlopeRailMaterial +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/2/2 8/5/2 7/6/2 3/7/2 +f 6/8/3 2/1/3 1/9/3 5/10/3 +f 6/8/4 8/5/4 4/2/4 2/1/4 +f 16/11/5 15/12/5 19/13/5 20/14/5 +f 9/15/6 13/16/6 14/17/6 10/18/6 +f 10/19/2 14/20/2 15/21/2 11/22/2 +f 11/23/7 15/12/7 16/11/7 12/24/7 +f 13/25/3 9/26/3 12/27/3 16/28/3 +f 20/29/3 17/30/3 13/25/3 16/28/3 +f 13/16/1 17/31/1 18/32/1 14/17/1 +f 15/21/2 14/20/2 18/33/2 19/34/2 +f 20/14/8 19/13/8 21/35/8 22/36/8 +f 18/32/9 17/31/9 23/37/9 24/38/9 +f 22/36/5 21/35/5 25/39/5 26/40/5 +f 24/38/1 23/37/1 27/41/1 28/42/1 +f 25/39/4 28/42/4 27/41/4 26/40/4 +f 17/30/3 20/29/3 22/43/3 26/40/3 27/41/3 23/44/3 +f 18/33/2 24/45/2 28/42/2 25/39/2 21/46/2 19/34/2 +f 32/47/5 36/48/5 33/49/5 29/50/5 +f 34/51/2 30/52/2 29/50/2 33/53/2 +f 35/54/1 31/55/1 30/52/1 34/56/1 +f 36/57/3 32/47/3 31/55/3 35/58/3 +f 32/47/4 29/50/4 30/52/4 31/55/4 +f 37/59/1 39/60/1 40/61/1 38/62/1 +f 41/63/5 43/64/5 44/65/5 42/66/5 +f 37/67/10 38/68/10 41/63/10 42/66/10 +f 39/60/4 44/65/4 43/64/4 40/61/4 +f 52/69/1 51/70/1 55/71/1 56/72/1 +f 45/73/7 49/74/7 50/75/7 46/76/7 +f 46/77/3 50/78/3 51/79/3 47/80/3 +f 47/81/6 51/70/6 52/69/6 48/82/6 +f 49/83/2 45/84/2 48/85/2 52/86/2 +f 56/87/2 53/88/2 49/83/2 52/86/2 +f 49/74/5 53/89/5 54/90/5 50/75/5 +f 51/79/3 50/78/3 54/91/3 55/92/3 +f 56/72/9 55/71/9 57/93/9 58/94/9 +f 54/90/8 53/89/8 59/95/8 60/96/8 +f 58/94/1 57/93/1 61/97/1 62/98/1 +f 60/96/5 59/95/5 63/99/5 64/100/5 +f 61/97/4 64/100/4 63/99/4 62/98/4 +f 53/88/2 56/87/2 58/101/2 62/98/2 63/99/2 59/102/2 +f 54/91/3 60/103/3 64/100/3 61/97/3 57/104/3 55/92/3 +f 69/105/4 72/106/4 71/107/4 70/108/4 +f 65/109/2 69/105/2 70/108/2 66/110/2 +f 66/111/5 70/108/5 71/107/5 67/112/5 +f 67/113/3 71/107/3 72/106/3 68/114/3 +f 69/105/1 65/115/1 68/116/1 72/106/1 +f 76/117/5 80/118/5 77/119/5 73/120/5 +f 78/121/2 74/122/2 73/120/2 77/123/2 +f 79/124/1 75/125/1 74/122/1 78/126/1 +f 80/127/3 76/117/3 75/125/3 79/128/3 +f 76/117/4 73/120/4 74/122/4 75/125/4 +f 85/129/4 88/130/4 87/131/4 86/132/4 +f 81/133/2 85/129/2 86/132/2 82/134/2 +f 82/135/5 86/132/5 87/131/5 83/136/5 +f 83/137/3 87/131/3 88/130/3 84/138/3 +f 85/129/1 81/139/1 84/140/1 88/130/1 +f 90/141/5 89/142/5 91/143/5 92/144/5 +f 92/144/2 91/145/2 95/146/2 96/147/2 +f 94/148/3 93/149/3 89/150/3 90/141/3 +f 94/148/4 90/141/4 92/144/4 96/147/4 +f 101/151/4 104/152/4 103/153/4 102/154/4 +f 97/155/2 101/151/2 102/154/2 98/156/2 +f 98/157/5 102/154/5 103/153/5 99/158/5 +f 99/159/3 103/153/3 104/152/3 100/160/3 +f 101/151/1 97/161/1 100/162/1 104/152/1 +f 109/163/4 112/164/4 111/165/4 110/166/4 +f 105/167/3 109/163/3 110/166/3 106/168/3 +f 106/169/1 110/166/1 111/165/1 107/170/1 +f 107/171/2 111/165/2 112/164/2 108/172/2 +f 109/163/5 105/173/5 108/174/5 112/164/5 +g dtrack_vst2_45_Cube.035_SlopeGravelMaterial +f 114/175/5 118/176/5 117/177/5 +f 116/178/1 113/179/1 115/180/1 +f 116/181/4 121/182/4 118/183/4 114/184/4 113/185/4 +f 122/186/1 115/180/1 128/187/1 131/188/1 +f 116/181/11 120/189/11 121/182/11 +f 118/183/11 121/182/11 119/190/11 +f 124/191/12 122/192/12 131/193/12 129/194/12 +f 121/195/12 120/196/12 122/192/12 124/191/12 +f 119/197/13 121/198/13 124/199/13 123/200/13 +f 117/177/5 123/201/5 130/202/5 127/203/5 +f 128/204/14 129/205/14 131/206/14 +f 126/207/14 125/208/14 127/209/14 129/205/14 128/204/14 +f 130/210/14 129/205/14 127/209/14 +f 123/200/13 124/199/13 129/211/13 130/212/13 +f 115/180/1 113/179/1 126/213/1 128/187/1 +f 114/175/5 117/177/5 127/203/5 125/214/5 +f 113/215/2 114/216/2 125/217/2 126/218/2 +f 116/178/1 115/180/1 122/186/1 120/219/1 +f 117/177/5 118/176/5 119/220/5 123/201/5 diff --git a/advtrains/models/advtrains_dtrack_vst31.obj b/advtrains/models/advtrains_dtrack_vst31.obj new file mode 100644 index 0000000..c4cb84f --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst31.obj @@ -0,0 +1,348 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst31_Cube.000 +v 0.753760 -0.500000 -0.500000 +v 0.753760 -0.500000 0.500000 +v 0.753760 -0.166667 0.500000 +v -0.753760 -0.500000 -0.500000 +v -0.753760 -0.500000 0.500000 +v -0.753760 -0.166667 0.500000 +v 0.329165 -0.308041 0.171599 +v 0.329165 -0.143980 0.171599 +v 0.329165 -0.422440 -0.171599 +v 0.329165 -0.258379 -0.171599 +v 0.462280 -0.308041 0.171599 +v 0.462280 -0.143980 0.171599 +v 0.462280 -0.422440 -0.171599 +v 0.462280 -0.258379 -0.171599 +v 0.412289 -0.126667 0.500000 +v 0.412289 -0.460000 -0.500000 +v 0.560528 -0.460000 -0.500000 +v 0.560528 -0.126667 0.500000 +v 0.474055 -0.106667 0.500000 +v 0.474055 -0.440000 -0.500000 +v 0.498762 -0.440000 -0.500000 +v 0.498762 -0.106667 0.500000 +v 0.474055 -0.056667 0.500000 +v 0.474055 -0.390000 -0.500000 +v 0.498762 -0.390000 -0.500000 +v 0.498762 -0.056667 0.500000 +v 0.529645 -0.385000 -0.500000 +v 0.529645 -0.051667 0.500000 +v 0.443172 -0.051667 0.500000 +v 0.443172 -0.385000 -0.500000 +v 0.529645 -0.360000 -0.500000 +v 0.529645 -0.026667 0.500000 +v 0.443172 -0.026667 0.500000 +v 0.443172 -0.360000 -0.500000 +v 0.741194 -0.198333 0.435000 +v -0.741194 -0.198333 0.435000 +v -0.741194 -0.238333 0.315000 +v 0.741194 -0.238333 0.315000 +v 0.741193 -0.148333 0.435000 +v -0.741194 -0.148333 0.435000 +v -0.741194 -0.188333 0.315000 +v 0.741194 -0.188333 0.315000 +v -0.011733 2.712519 0.500000 +v -0.011732 2.379186 -0.500001 +v -0.011733 2.734147 0.500000 +v -0.011732 2.400814 -0.500000 +v 0.011732 2.379186 -0.500000 +v 0.011732 2.712519 0.500000 +v 0.011732 2.400814 -0.500000 +v 0.011732 2.734148 0.500000 +v -0.412289 -0.460000 -0.500000 +v -0.412289 -0.126667 0.500000 +v -0.560528 -0.126667 0.500000 +v -0.560528 -0.460000 -0.500000 +v -0.474055 -0.440000 -0.500000 +v -0.474055 -0.106666 0.500000 +v -0.498762 -0.106667 0.500000 +v -0.498762 -0.440000 -0.500000 +v -0.474055 -0.390000 -0.500000 +v -0.474055 -0.056666 0.500000 +v -0.498762 -0.056667 0.500000 +v -0.498762 -0.390000 -0.500000 +v -0.529645 -0.051667 0.500000 +v -0.529645 -0.385000 -0.500000 +v -0.443172 -0.385000 -0.500000 +v -0.443172 -0.051666 0.500000 +v -0.529645 -0.026667 0.500000 +v -0.529645 -0.360000 -0.500000 +v -0.443172 -0.360000 -0.500000 +v -0.443172 -0.026666 0.500000 +v -0.741194 -0.488333 -0.435000 +v 0.741194 -0.488333 -0.435000 +v 0.741194 -0.448333 -0.315000 +v -0.741194 -0.448333 -0.315000 +v -0.741193 -0.438333 -0.435000 +v 0.741194 -0.438333 -0.435000 +v 0.741194 -0.398333 -0.315000 +v -0.741194 -0.398333 -0.315000 +v 0.741194 -0.280713 0.187862 +v -0.741194 -0.280713 0.187862 +v -0.741194 -0.320713 0.067862 +v 0.741194 -0.320713 0.067862 +v 0.741193 -0.230713 0.187862 +v -0.741194 -0.230713 0.187862 +v -0.741194 -0.270713 0.067862 +v 0.741194 -0.270713 0.067862 +v -0.741194 -0.405954 -0.187862 +v 0.741194 -0.405954 -0.187862 +v 0.741194 -0.365954 -0.067862 +v -0.741194 -0.365954 -0.067862 +v -0.741193 -0.355954 -0.187862 +v 0.741194 -0.355954 -0.187862 +v 0.741194 -0.315954 -0.067862 +v -0.741194 -0.315954 -0.067862 +v -0.329165 -0.308041 0.171599 +v -0.329165 -0.143980 0.171599 +v -0.329165 -0.422440 -0.171599 +v -0.329165 -0.258379 -0.171599 +v -0.462280 -0.308041 0.171599 +v -0.462280 -0.143980 0.171599 +v -0.462280 -0.422440 -0.171599 +v -0.462280 -0.258379 -0.171599 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 1.1949 -0.0470 +vt -0.3152 -0.0470 +vt -0.3152 -0.3809 +vt 1.1949 -0.3809 +vt -0.3120 1.0015 +vt -0.3120 -0.0002 +vt 1.1981 -0.0002 +vt 1.1981 1.0015 +vt 1.1949 1.0089 +vt 1.5117 0.0586 +vt -0.3152 1.0089 +vt -0.6320 0.0586 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 0.9487 -0.3162 +vn 1.0000 0.0000 0.0000 +vn -0.2936 0.9069 -0.3023 +vn 0.2936 0.9069 -0.3023 +vn 0.1518 -0.9377 0.3126 +vn -0.1518 -0.9377 0.3126 +vn 0.0000 -0.9487 0.3162 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst31_Cube.000_SlopeRailMaterial +s off +f 8/1/1 10/2/1 9/3/1 7/4/1 +f 10/2/2 14/5/2 13/6/2 9/7/2 +f 12/8/3 8/1/3 7/9/3 11/10/3 +f 12/8/4 14/5/4 10/2/4 8/1/4 +f 22/11/5 21/12/5 25/13/5 26/14/5 +f 15/15/6 19/16/6 20/17/6 16/18/6 +f 16/19/2 20/20/2 21/21/2 17/22/2 +f 17/23/7 21/12/7 22/11/7 18/24/7 +f 19/25/3 15/26/3 18/27/3 22/28/3 +f 26/29/3 23/30/3 19/25/3 22/28/3 +f 19/16/1 23/31/1 24/32/1 20/17/1 +f 21/21/2 20/20/2 24/33/2 25/34/2 +f 26/14/8 25/13/8 27/35/8 28/36/8 +f 24/32/9 23/31/9 29/37/9 30/38/9 +f 28/36/5 27/35/5 31/39/5 32/40/5 +f 30/38/1 29/37/1 33/41/1 34/42/1 +f 31/39/4 34/42/4 33/41/4 32/40/4 +f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 +f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 +f 39/47/4 42/48/4 41/49/4 40/50/4 +f 35/51/3 39/47/3 40/50/3 36/52/3 +f 36/53/1 40/50/1 41/49/1 37/54/1 +f 37/55/2 41/49/2 42/48/2 38/56/2 +f 39/47/5 35/57/5 38/58/5 42/48/5 +f 43/59/1 45/60/1 46/61/1 44/62/1 +f 47/63/5 49/64/5 50/65/5 48/66/5 +f 43/67/10 44/68/10 47/63/10 48/66/10 +f 45/60/4 50/65/4 49/64/4 46/61/4 +f 58/69/1 57/70/1 61/71/1 62/72/1 +f 51/73/7 55/74/7 56/75/7 52/76/7 +f 52/77/3 56/78/3 57/79/3 53/80/3 +f 53/81/6 57/70/6 58/69/6 54/82/6 +f 55/83/2 51/84/2 54/85/2 58/86/2 +f 62/87/2 59/88/2 55/83/2 58/86/2 +f 55/74/5 59/89/5 60/90/5 56/75/5 +f 57/79/3 56/78/3 60/91/3 61/92/3 +f 62/72/9 61/71/9 63/93/9 64/94/9 +f 60/90/8 59/89/8 65/95/8 66/96/8 +f 64/94/1 63/93/1 67/97/1 68/98/1 +f 66/96/5 65/95/5 69/99/5 70/100/5 +f 67/97/4 70/100/4 69/99/4 68/98/4 +f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 +f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 +f 75/105/4 78/106/4 77/107/4 76/108/4 +f 71/109/2 75/105/2 76/108/2 72/110/2 +f 72/111/5 76/108/5 77/107/5 73/112/5 +f 73/113/3 77/107/3 78/106/3 74/114/3 +f 75/105/1 71/115/1 74/116/1 78/106/1 +f 83/117/4 86/118/4 85/119/4 84/120/4 +f 79/121/3 83/117/3 84/120/3 80/122/3 +f 80/123/1 84/120/1 85/119/1 81/124/1 +f 81/125/2 85/119/2 86/118/2 82/126/2 +f 83/117/5 79/127/5 82/128/5 86/118/5 +f 91/129/4 94/130/4 93/131/4 92/132/4 +f 87/133/2 91/129/2 92/132/2 88/134/2 +f 88/135/5 92/132/5 93/131/5 89/136/5 +f 89/137/3 93/131/3 94/130/3 90/138/3 +f 91/129/1 87/139/1 90/140/1 94/130/1 +f 96/141/5 95/142/5 97/143/5 98/144/5 +f 98/144/2 97/145/2 101/146/2 102/147/2 +f 100/148/3 99/149/3 95/150/3 96/141/3 +f 100/148/4 96/141/4 98/144/4 102/147/4 +g dtrack_vst31_Cube.000_SlopeGravelMaterial +f 3/151/3 6/152/3 5/153/3 2/154/3 +f 1/155/11 2/156/11 5/157/11 4/158/11 +f 1/159/5 3/151/5 2/160/5 +f 6/152/1 4/161/1 5/162/1 +f 4/161/4 6/152/4 3/151/4 1/159/4 diff --git a/advtrains/models/advtrains_dtrack_vst32.obj b/advtrains/models/advtrains_dtrack_vst32.obj new file mode 100644 index 0000000..297d46b --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst32.obj @@ -0,0 +1,372 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst32_Cube.028 +v 0.753760 -0.166667 -0.500000 +v 0.753760 -0.166667 0.500000 +v 0.753760 0.166667 0.500000 +v -0.753760 -0.166667 -0.500000 +v -0.753760 -0.166667 0.500000 +v -0.753760 0.166667 0.500000 +v 0.329165 0.025292 0.171599 +v 0.329165 0.189353 0.171599 +v 0.329165 -0.089107 -0.171599 +v 0.329165 0.074954 -0.171599 +v 0.462280 0.025292 0.171599 +v 0.462280 0.189353 0.171599 +v 0.462280 -0.089107 -0.171599 +v 0.462280 0.074954 -0.171599 +v 0.412289 0.206667 0.500000 +v 0.412289 -0.126667 -0.500000 +v 0.560528 -0.126667 -0.500000 +v 0.560528 0.206667 0.500000 +v 0.474055 0.226667 0.500000 +v 0.474055 -0.106667 -0.500000 +v 0.498762 -0.106667 -0.500000 +v 0.498762 0.226667 0.500000 +v 0.474055 0.276667 0.500000 +v 0.474055 -0.056667 -0.500000 +v 0.498762 -0.056667 -0.500000 +v 0.498762 0.276667 0.500000 +v 0.529645 -0.051667 -0.500000 +v 0.529645 0.281667 0.500000 +v 0.443172 0.281667 0.500000 +v 0.443172 -0.051667 -0.500000 +v 0.529645 -0.026667 -0.500000 +v 0.529645 0.306667 0.500000 +v 0.443172 0.306667 0.500000 +v 0.443172 -0.026667 -0.500000 +v 0.741194 0.135000 0.435000 +v -0.741194 0.135000 0.435000 +v -0.741194 0.095000 0.315000 +v 0.741194 0.095000 0.315000 +v 0.741193 0.185000 0.435000 +v -0.741194 0.185000 0.435000 +v -0.741194 0.145000 0.315000 +v 0.741194 0.145000 0.315000 +v -0.011733 3.045853 0.500000 +v -0.011732 2.712519 -0.500001 +v -0.011733 3.067481 0.500000 +v -0.011732 2.734147 -0.500000 +v 0.011732 2.712519 -0.500000 +v 0.011732 3.045853 0.500000 +v 0.011732 2.734147 -0.500000 +v 0.011732 3.067481 0.500000 +v -0.412289 -0.126667 -0.500000 +v -0.412289 0.206667 0.500000 +v -0.560528 0.206667 0.500000 +v -0.560528 -0.126667 -0.500000 +v -0.474055 -0.106667 -0.500000 +v -0.474055 0.226667 0.500000 +v -0.498762 0.226667 0.500000 +v -0.498762 -0.106667 -0.500000 +v -0.474055 -0.056667 -0.500000 +v -0.474055 0.276667 0.500000 +v -0.498762 0.276667 0.500000 +v -0.498762 -0.056667 -0.500000 +v -0.529645 0.281667 0.500000 +v -0.529645 -0.051667 -0.500000 +v -0.443172 -0.051667 -0.500000 +v -0.443172 0.281667 0.500000 +v -0.529645 0.306667 0.500000 +v -0.529645 -0.026667 -0.500000 +v -0.443172 -0.026667 -0.500000 +v -0.443172 0.306667 0.500000 +v -0.741194 -0.155000 -0.435000 +v 0.741194 -0.155000 -0.435000 +v 0.741194 -0.115000 -0.315000 +v -0.741194 -0.115000 -0.315000 +v -0.741193 -0.105000 -0.435000 +v 0.741194 -0.105000 -0.435000 +v 0.741194 -0.065000 -0.315000 +v -0.741194 -0.065000 -0.315000 +v 0.741194 0.052621 0.187862 +v -0.741194 0.052621 0.187862 +v -0.741194 0.012621 0.067862 +v 0.741194 0.012621 0.067862 +v 0.741193 0.102621 0.187862 +v -0.741194 0.102621 0.187862 +v -0.741194 0.062621 0.067862 +v 0.741194 0.062621 0.067862 +v -0.741194 -0.072621 -0.187862 +v 0.741194 -0.072621 -0.187862 +v 0.741194 -0.032621 -0.067862 +v -0.741194 -0.032621 -0.067862 +v -0.741193 -0.022621 -0.187862 +v 0.741194 -0.022621 -0.187862 +v 0.741194 0.017379 -0.067862 +v -0.741194 0.017379 -0.067862 +v -0.329165 0.025293 0.171599 +v -0.329165 0.189353 0.171599 +v -0.329165 -0.089107 -0.171599 +v -0.329165 0.074954 -0.171599 +v -0.462280 0.025293 0.171599 +v -0.462280 0.189353 0.171599 +v -0.462280 -0.089107 -0.171599 +v -0.462280 0.074954 -0.171599 +v 0.753760 -0.500000 0.500000 +v 0.753760 -0.500000 -0.500000 +v -0.753760 -0.500000 0.500000 +v -0.753760 -0.500000 -0.500000 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 1.2169 -0.0660 +vt -0.3162 -0.0660 +vt -0.3162 -0.4050 +vt 1.2169 -0.4050 +vt -0.3102 0.3256 +vt 1.2229 0.3256 +vt 1.2229 0.6646 +vt -0.3102 0.6646 +vt 1.2169 1.0060 +vt 1.5385 0.0412 +vt -0.3162 1.0060 +vt -0.6378 0.0412 +vt -0.3132 1.0050 +vt -0.3132 -0.0119 +vt 1.2199 -0.0119 +vt 1.2199 1.0050 +vt -0.3075 0.6587 +vt 0.7095 0.6587 +vt 0.7095 0.9977 +vt -0.3075 0.9977 +vt 1.2229 1.0022 +vt -0.3102 1.0022 +vt -0.3102 0.6632 +vt 1.2229 0.6632 +vt 0.7067 0.6635 +vt -0.3102 0.6635 +vt -0.3102 0.3245 +vt 0.7067 0.3245 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 0.9487 -0.3162 +vn 1.0000 0.0000 0.0000 +vn -0.2936 0.9069 -0.3023 +vn 0.2936 0.9069 -0.3023 +vn 0.1518 -0.9377 0.3126 +vn -0.1518 -0.9377 0.3126 +vn 0.0000 -0.9487 0.3162 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst32_Cube.028_SlopeRailMaterial +s off +f 8/1/1 10/2/1 9/3/1 7/4/1 +f 10/2/2 14/5/2 13/6/2 9/7/2 +f 12/8/3 8/1/3 7/9/3 11/10/3 +f 12/8/4 14/5/4 10/2/4 8/1/4 +f 22/11/5 21/12/5 25/13/5 26/14/5 +f 15/15/6 19/16/6 20/17/6 16/18/6 +f 16/19/2 20/20/2 21/21/2 17/22/2 +f 17/23/7 21/12/7 22/11/7 18/24/7 +f 19/25/3 15/26/3 18/27/3 22/28/3 +f 26/29/3 23/30/3 19/25/3 22/28/3 +f 19/16/1 23/31/1 24/32/1 20/17/1 +f 21/21/2 20/20/2 24/33/2 25/34/2 +f 26/14/8 25/13/8 27/35/8 28/36/8 +f 24/32/9 23/31/9 29/37/9 30/38/9 +f 28/36/5 27/35/5 31/39/5 32/40/5 +f 30/38/1 29/37/1 33/41/1 34/42/1 +f 31/39/4 34/42/4 33/41/4 32/40/4 +f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 +f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 +f 39/47/4 42/48/4 41/49/4 40/50/4 +f 35/51/3 39/47/3 40/50/3 36/52/3 +f 36/53/1 40/50/1 41/49/1 37/54/1 +f 37/55/2 41/49/2 42/48/2 38/56/2 +f 39/47/5 35/57/5 38/58/5 42/48/5 +f 43/59/1 45/60/1 46/61/1 44/62/1 +f 47/63/5 49/64/5 50/65/5 48/66/5 +f 43/67/10 44/68/10 47/63/10 48/66/10 +f 45/60/4 50/65/4 49/64/4 46/61/4 +f 58/69/1 57/70/1 61/71/1 62/72/1 +f 51/73/7 55/74/7 56/75/7 52/76/7 +f 52/77/3 56/78/3 57/79/3 53/80/3 +f 53/81/6 57/70/6 58/69/6 54/82/6 +f 55/83/2 51/84/2 54/85/2 58/86/2 +f 62/87/2 59/88/2 55/83/2 58/86/2 +f 55/74/5 59/89/5 60/90/5 56/75/5 +f 57/79/3 56/78/3 60/91/3 61/92/3 +f 62/72/9 61/71/9 63/93/9 64/94/9 +f 60/90/8 59/89/8 65/95/8 66/96/8 +f 64/94/1 63/93/1 67/97/1 68/98/1 +f 66/96/5 65/95/5 69/99/5 70/100/5 +f 67/97/4 70/100/4 69/99/4 68/98/4 +f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 +f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 +f 75/105/4 78/106/4 77/107/4 76/108/4 +f 71/109/2 75/105/2 76/108/2 72/110/2 +f 72/111/5 76/108/5 77/107/5 73/112/5 +f 73/113/3 77/107/3 78/106/3 74/114/3 +f 75/105/1 71/115/1 74/116/1 78/106/1 +f 83/117/4 86/118/4 85/119/4 84/120/4 +f 79/121/3 83/117/3 84/120/3 80/122/3 +f 80/123/1 84/120/1 85/119/1 81/124/1 +f 81/125/2 85/119/2 86/118/2 82/126/2 +f 83/117/5 79/127/5 82/128/5 86/118/5 +f 91/129/4 94/130/4 93/131/4 92/132/4 +f 87/133/2 91/129/2 92/132/2 88/134/2 +f 88/135/5 92/132/5 93/131/5 89/136/5 +f 89/137/3 93/131/3 94/130/3 90/138/3 +f 91/129/1 87/139/1 90/140/1 94/130/1 +f 96/141/5 95/142/5 97/143/5 98/144/5 +f 98/144/2 97/145/2 101/146/2 102/147/2 +f 100/148/3 99/149/3 95/150/3 96/141/3 +f 100/148/4 96/141/4 98/144/4 102/147/4 +g dtrack_vst32_Cube.028_SlopeGravelMaterial +f 3/151/3 6/152/3 5/153/3 2/154/3 +f 4/155/2 1/156/2 104/157/2 106/158/2 +f 1/159/5 3/151/5 2/160/5 +f 6/152/1 4/161/1 5/162/1 +f 4/161/4 6/152/4 3/151/4 1/159/4 +f 104/163/11 103/164/11 105/165/11 106/166/11 +f 5/167/1 4/168/1 106/169/1 105/170/1 +f 2/171/3 5/172/3 105/173/3 103/174/3 +f 1/175/5 2/176/5 103/177/5 104/178/5 diff --git a/advtrains/models/advtrains_dtrack_vst33.obj b/advtrains/models/advtrains_dtrack_vst33.obj new file mode 100644 index 0000000..8cb5f04 --- /dev/null +++ b/advtrains/models/advtrains_dtrack_vst33.obj @@ -0,0 +1,388 @@ +# Blender v2.78 (sub 0) OBJ File: 'rail_redo.blend' +# www.blender.org +o dtrack_vst33_Cube.030 +v 0.753760 0.166667 -0.500000 +v 0.753760 0.166667 0.500000 +v 0.753760 0.500000 0.500000 +v -0.753760 0.166667 -0.500000 +v -0.753760 0.166667 0.500000 +v -0.753760 0.500000 0.500000 +v 0.329165 0.358626 0.171599 +v 0.329165 0.522686 0.171599 +v 0.329165 0.244227 -0.171599 +v 0.329165 0.408287 -0.171599 +v 0.462280 0.358626 0.171599 +v 0.462280 0.522686 0.171599 +v 0.462280 0.244227 -0.171599 +v 0.462280 0.408287 -0.171599 +v 0.412289 0.540000 0.500000 +v 0.412289 0.206667 -0.500000 +v 0.560528 0.206667 -0.500000 +v 0.560528 0.540000 0.500000 +v 0.474055 0.560000 0.500000 +v 0.474055 0.226667 -0.500000 +v 0.498762 0.226667 -0.500000 +v 0.498762 0.560000 0.500000 +v 0.474055 0.610000 0.500000 +v 0.474055 0.276667 -0.500000 +v 0.498762 0.276667 -0.500000 +v 0.498762 0.610000 0.500000 +v 0.529645 0.281667 -0.500000 +v 0.529645 0.615000 0.500000 +v 0.443172 0.615000 0.500000 +v 0.443172 0.281667 -0.500000 +v 0.529645 0.306667 -0.500000 +v 0.529645 0.640000 0.500000 +v 0.443172 0.640000 0.500000 +v 0.443172 0.306667 -0.500000 +v 0.741194 0.468333 0.435000 +v -0.741194 0.468333 0.435000 +v -0.741194 0.428333 0.315000 +v 0.741194 0.428333 0.315000 +v 0.741193 0.518333 0.435000 +v -0.741194 0.518333 0.435000 +v -0.741194 0.478333 0.315000 +v 0.741194 0.478333 0.315000 +v -0.011733 3.379186 0.500000 +v -0.011732 3.045852 -0.500001 +v -0.011733 3.400814 0.500000 +v -0.011732 3.067481 -0.500000 +v 0.011732 3.045853 -0.500000 +v 0.011732 3.379186 0.500000 +v 0.011732 3.067481 -0.500000 +v 0.011732 3.400814 0.500000 +v -0.412289 0.206667 -0.500000 +v -0.412289 0.540000 0.500000 +v -0.560528 0.540000 0.500000 +v -0.560528 0.206667 -0.500000 +v -0.474055 0.226667 -0.500000 +v -0.474055 0.560000 0.500000 +v -0.498762 0.560000 0.500000 +v -0.498762 0.226667 -0.500000 +v -0.474055 0.276667 -0.500000 +v -0.474055 0.610000 0.500000 +v -0.498762 0.610000 0.500000 +v -0.498762 0.276667 -0.500000 +v -0.529645 0.615000 0.500000 +v -0.529645 0.281667 -0.500000 +v -0.443172 0.281667 -0.500000 +v -0.443172 0.615000 0.500000 +v -0.529645 0.640000 0.500000 +v -0.529645 0.306667 -0.500000 +v -0.443172 0.306667 -0.500000 +v -0.443172 0.640000 0.500000 +v -0.741194 0.178333 -0.435000 +v 0.741194 0.178333 -0.435000 +v 0.741194 0.218333 -0.315000 +v -0.741194 0.218333 -0.315000 +v -0.741193 0.228333 -0.435000 +v 0.741194 0.228333 -0.435000 +v 0.741194 0.268333 -0.315000 +v -0.741194 0.268333 -0.315000 +v 0.741194 0.385954 0.187862 +v -0.741194 0.385954 0.187862 +v -0.741194 0.345954 0.067862 +v 0.741194 0.345954 0.067862 +v 0.741193 0.435954 0.187862 +v -0.741194 0.435954 0.187862 +v -0.741194 0.395954 0.067862 +v 0.741194 0.395954 0.067862 +v -0.741194 0.260713 -0.187862 +v 0.741194 0.260713 -0.187862 +v 0.741194 0.300713 -0.067862 +v -0.741194 0.300713 -0.067862 +v -0.741193 0.310713 -0.187862 +v 0.741194 0.310713 -0.187862 +v 0.741194 0.350713 -0.067862 +v -0.741194 0.350713 -0.067862 +v -0.329165 0.358626 0.171599 +v -0.329165 0.522687 0.171599 +v -0.329165 0.244227 -0.171599 +v -0.329165 0.408287 -0.171599 +v -0.462280 0.358626 0.171599 +v -0.462280 0.522686 0.171599 +v -0.462280 0.244227 -0.171599 +v -0.462280 0.408287 -0.171599 +v 0.753760 -0.166667 0.500000 +v 0.753760 -0.166667 -0.500000 +v -0.753760 -0.166667 0.500000 +v -0.753760 -0.166667 -0.500000 +v 0.753760 -0.500000 0.500000 +v 0.753760 -0.500000 -0.500000 +v -0.753760 -0.500000 0.500000 +v -0.753760 -0.500000 -0.500000 +vt 0.7427 0.1169 +vt 0.7427 0.3317 +vt 0.6400 0.3317 +vt 0.6400 0.1169 +vt 0.8260 0.3317 +vt 0.8260 0.4343 +vt 0.7427 0.4343 +vt 0.8260 0.1169 +vt 0.7427 0.0142 +vt 0.8260 0.0142 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.6554 0.3627 +vt 0.6690 0.3627 +vt 0.6690 0.9885 +vt 0.6554 0.9885 +vt 0.6972 0.9885 +vt 0.6837 0.9885 +vt 0.6837 0.3627 +vt 0.6972 0.3627 +vt 0.7119 0.3627 +vt 0.7119 0.9885 +vt 0.5691 0.2971 +vt 0.5691 0.9229 +vt 0.5378 0.9229 +vt 0.5378 0.2971 +vt 0.3413 0.2971 +vt 0.3819 0.2971 +vt 0.3819 0.9229 +vt 0.3413 0.9229 +vt 0.4291 0.9855 +vt 0.4678 0.9730 +vt 0.4833 0.9730 +vt 0.5219 0.9855 +vt 0.6097 0.9229 +vt 0.6097 0.2971 +vt 0.4678 0.2470 +vt 0.4291 0.2345 +vt 0.5219 0.2345 +vt 0.4833 0.2470 +vt 0.4833 0.2783 +vt 0.4678 0.2783 +vt 0.4132 0.2971 +vt 0.4132 0.9229 +vt 0.4678 0.9417 +vt 0.4833 0.9417 +vt 0.5182 0.9229 +vt 0.5182 0.2971 +vt 0.4328 0.2971 +vt 0.4328 0.9229 +vt 0.5026 0.9229 +vt 0.5026 0.2971 +vt 0.4485 0.2971 +vt 0.4485 0.9229 +vt 0.5026 0.2814 +vt 0.4485 0.2814 +vt 0.4485 0.9386 +vt 0.5026 0.9386 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.9588 0.9625 +vt 0.8837 0.9625 +vt 0.8837 0.0348 +vt 0.9588 0.0348 +vt 0.9901 0.9625 +vt 0.9901 0.0348 +vt 0.9588 0.0035 +vt 0.8837 0.0035 +vt 0.8524 0.0348 +vt 0.8524 0.9625 +vt 0.9588 0.9938 +vt 0.8837 0.9938 +vt 0.7427 0.1169 +vt 0.6400 0.1169 +vt 0.6400 0.3317 +vt 0.7427 0.3317 +vt 0.7427 0.4343 +vt 0.8260 0.4343 +vt 0.8260 0.3317 +vt 0.8260 0.1169 +vt 0.8260 0.0142 +vt 0.7427 0.0142 +vt 1.2190 -0.0648 +vt -0.3252 -0.0648 +vt -0.3252 -0.4063 +vt 1.2190 -0.4063 +vt 1.2222 1.0112 +vt -0.3220 1.0112 +vt -0.3220 0.6697 +vt 1.2222 0.6697 +vt 1.2190 1.0149 +vt 1.5430 0.0432 +vt -0.3252 1.0149 +vt -0.6491 0.0432 +vt -0.3220 0.3283 +vt 1.2222 0.3283 +vt -0.3240 0.3223 +vt 0.7003 0.3223 +vt 0.7003 0.6637 +vt -0.3240 0.6637 +vt 1.2202 1.0043 +vt -0.3240 1.0043 +vt -0.3240 0.6629 +vt 1.2202 0.6629 +vt 0.6998 1.0039 +vt -0.3245 1.0039 +vt -0.3245 0.6625 +vt 0.6998 0.6625 +vt -0.3246 1.0127 +vt -0.3246 -0.0117 +vt 1.2196 -0.0117 +vt 1.2196 1.0127 +vt 0.7003 1.0051 +vt -0.3240 1.0051 +vt -0.3240 0.3214 +vt 1.2202 0.3214 +vt -0.3245 0.3210 +vt 0.6998 0.3210 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 0.9487 -0.3162 +vn 1.0000 0.0000 0.0000 +vn -0.2936 0.9069 -0.3023 +vn 0.2936 0.9069 -0.3023 +vn 0.1518 -0.9377 0.3126 +vn -0.1518 -0.9377 0.3126 +vn 0.0000 -0.9487 0.3162 +vn 0.0000 -1.0000 0.0000 +g dtrack_vst33_Cube.030_SlopeRailMaterial +s off +f 8/1/1 10/2/1 9/3/1 7/4/1 +f 10/2/2 14/5/2 13/6/2 9/7/2 +f 12/8/3 8/1/3 7/9/3 11/10/3 +f 12/8/4 14/5/4 10/2/4 8/1/4 +f 22/11/5 21/12/5 25/13/5 26/14/5 +f 15/15/6 19/16/6 20/17/6 16/18/6 +f 16/19/2 20/20/2 21/21/2 17/22/2 +f 17/23/7 21/12/7 22/11/7 18/24/7 +f 19/25/3 15/26/3 18/27/3 22/28/3 +f 26/29/3 23/30/3 19/25/3 22/28/3 +f 19/16/1 23/31/1 24/32/1 20/17/1 +f 21/21/2 20/20/2 24/33/2 25/34/2 +f 26/14/8 25/13/8 27/35/8 28/36/8 +f 24/32/9 23/31/9 29/37/9 30/38/9 +f 28/36/5 27/35/5 31/39/5 32/40/5 +f 30/38/1 29/37/1 33/41/1 34/42/1 +f 31/39/4 34/42/4 33/41/4 32/40/4 +f 23/30/3 26/29/3 28/43/3 32/40/3 33/41/3 29/44/3 +f 24/33/2 30/45/2 34/42/2 31/39/2 27/46/2 25/34/2 +f 39/47/4 42/48/4 41/49/4 40/50/4 +f 35/51/3 39/47/3 40/50/3 36/52/3 +f 36/53/1 40/50/1 41/49/1 37/54/1 +f 37/55/2 41/49/2 42/48/2 38/56/2 +f 39/47/5 35/57/5 38/58/5 42/48/5 +f 43/59/1 45/60/1 46/61/1 44/62/1 +f 47/63/5 49/64/5 50/65/5 48/66/5 +f 43/67/10 44/68/10 47/63/10 48/66/10 +f 45/60/4 50/65/4 49/64/4 46/61/4 +f 58/69/1 57/70/1 61/71/1 62/72/1 +f 51/73/7 55/74/7 56/75/7 52/76/7 +f 52/77/3 56/78/3 57/79/3 53/80/3 +f 53/81/6 57/70/6 58/69/6 54/82/6 +f 55/83/2 51/84/2 54/85/2 58/86/2 +f 62/87/2 59/88/2 55/83/2 58/86/2 +f 55/74/5 59/89/5 60/90/5 56/75/5 +f 57/79/3 56/78/3 60/91/3 61/92/3 +f 62/72/9 61/71/9 63/93/9 64/94/9 +f 60/90/8 59/89/8 65/95/8 66/96/8 +f 64/94/1 63/93/1 67/97/1 68/98/1 +f 66/96/5 65/95/5 69/99/5 70/100/5 +f 67/97/4 70/100/4 69/99/4 68/98/4 +f 59/88/2 62/87/2 64/101/2 68/98/2 69/99/2 65/102/2 +f 60/91/3 66/103/3 70/100/3 67/97/3 63/104/3 61/92/3 +f 75/105/4 78/106/4 77/107/4 76/108/4 +f 71/109/2 75/105/2 76/108/2 72/110/2 +f 72/111/5 76/108/5 77/107/5 73/112/5 +f 73/113/3 77/107/3 78/106/3 74/114/3 +f 75/105/1 71/115/1 74/116/1 78/106/1 +f 83/117/4 86/118/4 85/119/4 84/120/4 +f 79/121/3 83/117/3 84/120/3 80/122/3 +f 80/123/1 84/120/1 85/119/1 81/124/1 +f 81/125/2 85/119/2 86/118/2 82/126/2 +f 83/117/5 79/127/5 82/128/5 86/118/5 +f 91/129/4 94/130/4 93/131/4 92/132/4 +f 87/133/2 91/129/2 92/132/2 88/134/2 +f 88/135/5 92/132/5 93/131/5 89/136/5 +f 89/137/3 93/131/3 94/130/3 90/138/3 +f 91/129/1 87/139/1 90/140/1 94/130/1 +f 96/141/5 95/142/5 97/143/5 98/144/5 +f 98/144/2 97/145/2 101/146/2 102/147/2 +f 100/148/3 99/149/3 95/150/3 96/141/3 +f 100/148/4 96/141/4 98/144/4 102/147/4 +g dtrack_vst33_Cube.030_SlopeGravelMaterial +f 3/151/3 6/152/3 5/153/3 2/154/3 +f 4/155/2 1/156/2 104/157/2 106/158/2 +f 1/159/5 3/151/5 2/160/5 +f 6/152/1 4/161/1 5/162/1 +f 4/161/4 6/152/4 3/151/4 1/159/4 +f 106/158/2 104/157/2 108/163/2 110/164/2 +f 5/165/1 4/166/1 106/167/1 105/168/1 +f 2/169/3 5/170/3 105/171/3 103/172/3 +f 1/173/5 2/174/5 103/175/5 104/176/5 +f 108/177/11 107/178/11 109/179/11 110/180/11 +f 105/168/1 106/167/1 110/181/1 109/182/1 +f 103/172/3 105/171/3 109/183/3 107/184/3 +f 104/176/5 103/175/5 107/185/5 108/186/5 diff --git a/advtrains/models/advtrains_modernwagon.b3d b/advtrains/models/advtrains_modernwagon.b3d new file mode 100644 index 0000000..aacddca Binary files /dev/null and b/advtrains/models/advtrains_modernwagon.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_off.b3d b/advtrains/models/advtrains_retrosignal_off.b3d new file mode 100644 index 0000000..3d231dd Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_off.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_off_30.b3d b/advtrains/models/advtrains_retrosignal_off_30.b3d new file mode 100644 index 0000000..da258e1 Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_off_30.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_off_45.b3d b/advtrains/models/advtrains_retrosignal_off_45.b3d new file mode 100644 index 0000000..338224a Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_off_45.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_off_60.b3d b/advtrains/models/advtrains_retrosignal_off_60.b3d new file mode 100644 index 0000000..c560ca1 Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_off_60.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_on.b3d b/advtrains/models/advtrains_retrosignal_on.b3d new file mode 100644 index 0000000..3d19439 Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_on.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_on_30.b3d b/advtrains/models/advtrains_retrosignal_on_30.b3d new file mode 100644 index 0000000..98f8a92 Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_on_30.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_on_45.b3d b/advtrains/models/advtrains_retrosignal_on_45.b3d new file mode 100644 index 0000000..414e121 Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_on_45.b3d differ diff --git a/advtrains/models/advtrains_retrosignal_on_60.b3d b/advtrains/models/advtrains_retrosignal_on_60.b3d new file mode 100644 index 0000000..a51529a Binary files /dev/null and b/advtrains/models/advtrains_retrosignal_on_60.b3d differ diff --git a/advtrains/models/advtrains_signal.b3d b/advtrains/models/advtrains_signal.b3d new file mode 100644 index 0000000..7f69560 Binary files /dev/null and b/advtrains/models/advtrains_signal.b3d differ diff --git a/advtrains/models/advtrains_signal_30.b3d b/advtrains/models/advtrains_signal_30.b3d new file mode 100644 index 0000000..0b949a7 Binary files /dev/null and b/advtrains/models/advtrains_signal_30.b3d differ diff --git a/advtrains/models/advtrains_signal_45.b3d b/advtrains/models/advtrains_signal_45.b3d new file mode 100644 index 0000000..ccaebf4 Binary files /dev/null and b/advtrains/models/advtrains_signal_45.b3d differ diff --git a/advtrains/models/advtrains_signal_60.b3d b/advtrains/models/advtrains_signal_60.b3d new file mode 100644 index 0000000..cf41e6d Binary files /dev/null and b/advtrains/models/advtrains_signal_60.b3d differ diff --git a/advtrains/models/advtrains_signal_wall_l.b3d b/advtrains/models/advtrains_signal_wall_l.b3d new file mode 100644 index 0000000..b1bcbcf Binary files /dev/null and b/advtrains/models/advtrains_signal_wall_l.b3d differ diff --git a/advtrains/models/advtrains_signal_wall_r.b3d b/advtrains/models/advtrains_signal_wall_r.b3d new file mode 100644 index 0000000..cf26389 Binary files /dev/null and b/advtrains/models/advtrains_signal_wall_r.b3d differ diff --git a/advtrains/models/advtrains_signal_wall_t.b3d b/advtrains/models/advtrains_signal_wall_t.b3d new file mode 100644 index 0000000..30e77f6 Binary files /dev/null and b/advtrains/models/advtrains_signal_wall_t.b3d differ diff --git a/advtrains/models/advtrains_track_cr.b3d b/advtrains/models/advtrains_track_cr.b3d new file mode 100644 index 0000000..b0f5e4b Binary files /dev/null and b/advtrains/models/advtrains_track_cr.b3d differ diff --git a/advtrains/models/advtrains_track_st.b3d b/advtrains/models/advtrains_track_st.b3d new file mode 100644 index 0000000..10b5d90 Binary files /dev/null and b/advtrains/models/advtrains_track_st.b3d differ diff --git a/advtrains/models/advtrains_track_st_45.b3d b/advtrains/models/advtrains_track_st_45.b3d new file mode 100644 index 0000000..32505a1 Binary files /dev/null and b/advtrains/models/advtrains_track_st_45.b3d differ diff --git a/advtrains/models/trackplane.b3d b/advtrains/models/trackplane.b3d new file mode 100644 index 0000000..b4728c3 Binary files /dev/null and b/advtrains/models/trackplane.b3d differ diff --git a/advtrains/modpack.txt b/advtrains/modpack.txt deleted file mode 100644 index e69de29..0000000 diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua new file mode 100644 index 0000000..862fd53 --- /dev/null +++ b/advtrains/nodedb.lua @@ -0,0 +1,307 @@ +--nodedb.lua +--database of all nodes that have 'save_in_nodedb' field set to true in node definition + + +--serialization format: +--(2byte z) (2byte y) (2byte x) (2byte contentid) +--contentid := (14bit nodeid, 2bit param2) + +local function int_to_bytes(i) + local x=i+32768--clip to positive integers + local cH = math.floor(x / 256) % 256; + local cL = math.floor(x ) % 256; + return(string.char(cH, cL)); +end +local function bytes_to_int(bytes) + local t={string.byte(bytes,1,-1)} + local n = + t[1] * 256 + + t[2] + return n-32768 +end +local function l2b(x) + return x%4 +end +local function u14b(x) + return math.floor(x/4) +end +local ndb={} + +--local variables for performance +local ndb_nodeids={} +local ndb_nodes={} + +local function ndbget(x,y,z) + local ny=ndb_nodes[y] + if ny then + local nx=ny[x] + if nx then + return nx[z] + end + end + return nil +end +local function ndbset(x,y,z,v) + if not ndb_nodes[y] then + ndb_nodes[y]={} + end + if not ndb_nodes[y][x] then + ndb_nodes[y][x]={} + end + ndb_nodes[y][x][z]=v +end + + +local path=minetest.get_worldpath().."/advtrains_ndb2" +--load +--nodeids get loaded by advtrains init.lua and passed here +function ndb.load_data(data) + ndb_nodeids = data and data.nodeids or {} + local file, err = io.open(path, "r") + if not file then + atwarn("Couldn't load the node database: ", err or "Unknown Error") + else + local cnt=0 + local hst_z=file:read(2) + local hst_y=file:read(2) + local hst_x=file:read(2) + local cid=file:read(2) + while hst_z and hst_y and hst_x and cid and #hst_z==2 and #hst_y==2 and #hst_x==2 and #cid==2 do + ndbset(bytes_to_int(hst_x), bytes_to_int(hst_y), bytes_to_int(hst_z), bytes_to_int(cid)) + cnt=cnt+1 + hst_z=file:read(2) + hst_y=file:read(2) + hst_x=file:read(2) + cid=file:read(2) + end + atlog("nodedb: read", cnt, "nodes.") + file:close() + end +end + +--save +function ndb.save_data() + local file, err = io.open(path, "w") + if not file then + atwarn("Couldn't save the node database: ", err or "Unknown Error") + else + for y, ny in pairs(ndb_nodes) do + for x, nx in pairs(ny) do + for z, cid in pairs(nx) do + file:write(int_to_bytes(z)) + file:write(int_to_bytes(y)) + file:write(int_to_bytes(x)) + file:write(int_to_bytes(cid)) + end + end + end + file:close() + end + return {nodeids = ndb_nodeids} +end + +--function to get node. track database is not helpful here. +function ndb.get_node_or_nil(pos) + local node=minetest.get_node_or_nil(pos) + if node then + return node + else + --maybe we have the node in the database... + return ndb.get_node_raw(pos) + end + atprint("ndb.get_node_or_nil",pos,"not found") +end +function ndb.get_node(pos) + local n=ndb.get_node_or_nil(pos) + if not n then + return {name="ignore", param2=0} + end + return n +end +function ndb.get_node_raw(pos) + local cid=ndbget(pos.x, pos.y, pos.z) + if cid then + local nodeid = ndb_nodeids[u14b(cid)] + if nodeid then + return {name=nodeid, param2 = l2b(cid)} + end + end + return nil +end + + +function ndb.swap_node(pos, node) + minetest.swap_node(pos, node) + ndb.update(pos, node) +end + +function ndb.update(pos, pnode) + local node = pnode or minetest.get_node_or_nil(pos) + if not node or node.name=="ignore" then return end + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].groups.save_in_nodedb then + local nid + for tnid, nname in pairs(ndb_nodeids) do + if nname==node.name then + nid=tnid + end + end + if not nid then + nid=#ndb_nodeids+1 + ndb_nodeids[nid]=node.name + end + ndbset(pos.x, pos.y, pos.z, (nid * 4) + (l2b(node.param2 or 0)) ) + --atprint("nodedb: updating node", pos, "stored nid",nid,"assigned",ndb_nodeids[nid],"resulting cid",ndb_nodes[hash]) + else + --at this position there is no longer a node that needs to be tracked. + ndbset(pos.x, pos.y, pos.z, nil) + end +end + +function ndb.clear(pos) + ndbset(pos.x, pos.y, pos.z, nil) +end + + +--get_node with pseudoload. now we only need track data, so we can use the trackdb as second fallback +--nothing new will be saved inside the trackdb. +--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 rdp=advtrains.round_vector_floor_y(pos) + + local node=ndb.get_node_or_nil(rdp) + + --still no node? + --advtrains.trackdb is nil when there's no data available. + if not node then + if advtrains.trackdb then + --try raildb (see trackdb_legacy.lua) + local dbe=(advtrains.trackdb[rdp.y] and advtrains.trackdb[rdp.y][rdp.x] and advtrains.trackdb[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 + end + end + return nil + 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) + + return true, conn1, conn2, rely1, rely2, railheight +end + +ndb.run_lbm = function(pos, node) + return advtrains.pcall(function() + local cid=ndbget(pos.x, pos.y, pos.z) + if cid then + --if in database, detect changes and apply. + local nodeid = ndb_nodeids[u14b(cid)] + local param2 = l2b(cid) + if not nodeid then + --something went wrong + atwarn("Node Database corruption, couldn't determine node to set at", pos) + ndb.update(pos, node) + else + if (nodeid~=node.name or param2~=node.param2) then + atprint("nodedb: lbm replaced", pos, "with nodeid", nodeid, "param2", param2, "cid is", cid) + minetest.swap_node(pos, {name=nodeid, param2 = param2}) + local ndef=minetest.registered_nodes[nodeid] + if ndef and ndef.on_updated_from_nodedb then + ndef.on_updated_from_nodedb(pos, node) + end + return true + end + end + else + --if not in database, take it. + atlog("Node Database:", pos, "was not found in the database, have you used worldedit?") + ndb.update(pos, node) + end + return false + end) +end + + +minetest.register_lbm({ + name = "advtrains:nodedb_on_load_update", + nodenames = {"group:save_in_nodedb"}, + run_at_every_load = true, + run_on_every_load = true, + action = ndb.run_lbm, + interval=30, + chance=1, + }) + +--used when restoring stuff after a crash +ndb.restore_all = function() + atwarn("Updating the map from the nodedb, this may take a while") + local cnt=0 + for y, ny in pairs(ndb_nodes) do + for x, nx in pairs(ny) do + for z, _ in pairs(nx) do + local pos={x=x, y=y, z=z} + local node=minetest.get_node_or_nil(pos) + if node then + local ori_ndef=minetest.registered_nodes[node.name] + local ndbnode=ndb.get_node_raw(pos) + if ori_ndef and ori_ndef.groups.save_in_nodedb then --check if this node has been worldedited, and don't replace then + if (ndbnode.name~=node.name or ndbnode.param2~=node.param2) then + minetest.swap_node(pos, ndbnode) + atwarn("Replaced",node.name,"@",pos,"with",ndbnode.name) + end + else + ndb.clear(pos) + atwarn("Found ghost node (former",ndbnode.name,") @",pos,"deleting") + end + end + end + end + end + atwarn("Updated",cnt,"nodes") +end + +minetest.register_on_dignode(function(pos, oldnode, digger) + return advtrains.pcall(function() + ndb.clear(pos) + end) +end) + +function ndb.get_nodes() + return ndb_nodes +end +function ndb.get_nodeids() + return ndb_nodeids +end + + +advtrains.ndb=ndb + +local ptime=0 + +minetest.register_chatcommand("at_sync_ndb", + { + params = "", -- Short parameter description + description = "Write node db back to map and find ghost nodes", -- Full description + privs = {train_operator=true, worldedit=true}, -- Require the "privs" privilege to run + func = function(name, param) + return advtrains.pcall(function() + if not minetest.check_player_privs(name, {server=true}) and os.time() < ptime+30 then + return false, "Please wait at least 30s from the previous execution of /at_restore_ndb!" + end + ndb.restore_all() + ptime=os.time() + return true + end) + end, + privs = {train_operator=true}, -- Require the "privs" privilege to run + }) + diff --git a/advtrains/readme.txt b/advtrains/readme.txt deleted file mode 100644 index eaed121..0000000 --- a/advtrains/readme.txt +++ /dev/null @@ -1,25 +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-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 -Detailed Steam engine : mbb / Krokoschlange(animation) -Industrial engine/wagons : mbb -Inventory images : mbb -Small code contributions : NaruTrey / gpcf -Mod Description : hajo -If I forgot someone please punish me for that. \ No newline at end of file diff --git a/advtrains/screenshot.png b/advtrains/screenshot.png deleted file mode 100644 index 089da73..0000000 Binary files a/advtrains/screenshot.png and /dev/null differ diff --git a/advtrains/settingtypes.txt b/advtrains/settingtypes.txt new file mode 100644 index 0000000..60f8477 --- /dev/null +++ b/advtrains/settingtypes.txt @@ -0,0 +1,8 @@ +# Disable the train collision behavior. Trains will never collide and just drive through each other. +# Note that this makes coupling trains impossible, and introduces 'interesting' behavior with detector and ATC rails. +# Also, it is very hard to separate two subway trains that are stuck inside each other, since it can be impossible to access the driver seat. +advtrains_disable_collisions (Disable train collisions) bool false +# Enable the debug ring buffer +# This has no effect on the user experience, except decreased performance. Debug outputs are saved in a ring buffer to be printed when an error occurs. +# You probably want to leave this setting set to false. +advtrains_enable_debugging (Enable debugging) bool false \ No newline at end of file diff --git a/advtrains/signals.lua b/advtrains/signals.lua new file mode 100644 index 0000000..5c6e484 --- /dev/null +++ b/advtrains/signals.lua @@ -0,0 +1,227 @@ +--advtrains by orwell96 +--signals.lua + +--this code /should/ work but does not. +local mrules_wallsignal = advtrains.meseconrules + +for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", als="green"}}) 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=attrans("Lampless Signal (@1)", attrans(r..rotation)), + sunlight_propagates=true, + groups = { + cracky=3, + not_blocking_trains=1, + not_in_creative_inventory=crea, + save_in_nodedb=1, + }, + mesecons = {effector = { + rules=advtrains.meseconrules, + ["action_"..f.as] = function (pos, node) + advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}) + end + }}, + on_rightclick=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}) + end + 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=attrans("Signal (@1)", attrans(r..rotation)), + groups = { + cracky=3, + not_blocking_trains=1, + not_in_creative_inventory=crea, + save_in_nodedb=1, + }, + light_source = 1, + sunlight_propagates=true, + mesecons = {effector = { + rules=advtrains.meseconrules, + ["action_"..f.as] = function (pos, node) + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) + end + }}, + luaautomation = { + getstate = f.ls, + setstate = function(pos, node, newstate) + if newstate == f.als then + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) + end + end, + }, + on_rightclick=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_"..f.as..rotation, param2 = node.param2}) + end + end, + }) + advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil) + end + + local crea=1 + if r=="off" then crea=0 end + + --tunnel signals. no rotations. + for loc, sbox in pairs({l={-1/2, -1/2, -1/4, 0, 1/2, 1/4}, r={0, -1/2, -1/4, 1/2, 1/2, 1/4}, t={-1/2, 0, -1/4, 1/2, 1/2, 1/4}}) do + minetest.register_node("advtrains:signal_wall_"..loc.."_"..r, { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = sbox, + }, + mesh = "advtrains_signal_wall_"..loc..".b3d", + tiles = {"advtrains_signal_wall_"..r..".png"}, + drop="advtrains:signal_wall_"..loc.."_off", + description=attrans("Wallmounted Signal ("..loc..")"), + groups = { + cracky=3, + not_blocking_trains=1, + not_in_creative_inventory=crea, + save_in_nodedb=1, + }, + light_source = 1, + sunlight_propagates=true, + mesecons = {effector = { + rules = mrules_wallsignal, + ["action_"..f.as] = function (pos, node) + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) + end + }}, + luaautomation = { + getstate = f.ls, + setstate = function(pos, node, newstate) + if newstate == f.als then + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) + end + end, + }, + on_rightclick=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_"..f.as, param2 = node.param2}) + end + end, + }) + end +end + +-- level crossing +-- german version (Andrew's Cross) +minetest.register_node("advtrains:across_off", { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/2, 1/4, 1.5, 0}, + }, + mesh = "advtrains_across.obj", + tiles = {"advtrains_across.png"}, + drop="advtrains:across_off", + description=attrans("Andrew's Cross"), + groups = { + cracky=3, + not_blocking_trains=1, + save_in_nodedb=1, + not_in_creative_inventory=nil, + }, + light_source = 1, + sunlight_propagates=true, + mesecons = {effector = { + rules = advtrains.meseconrules, + action_on = function (pos, node) + advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) + end + }}, + luaautomation = { + getstate = "off", + setstate = function(pos, node, newstate) + if newstate == "on" then + advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) + end + end, + }, + on_rightclick=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name = "advtrains:across_on", param2 = node.param2}) + end + end, +}) +minetest.register_node("advtrains:across_on", { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/2, 1/4, 1.5, 0}, + }, + mesh = "advtrains_across.obj", + tiles = {{name="advtrains_across_anim.png", animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.0}}}, + drop="advtrains:across_off", + description=attrans("Andrew's Cross (on) (you hacker you)"), + groups = { + cracky=3, + not_blocking_trains=1, + save_in_nodedb=1, + not_in_creative_inventory=1, + }, + light_source = 1, + sunlight_propagates=true, + mesecons = {effector = { + rules = advtrains.meseconrules, + action_off = function (pos, node) + advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) + end + }}, + luaautomation = { + getstate = "on", + setstate = function(pos, node, newstate) + if newstate == "off" then + advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) + end + end, + }, + on_rightclick=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name = "advtrains:across_off", param2 = node.param2}) + end + end, +}) diff --git a/advtrains/textures/advtrains_across.png b/advtrains/textures/advtrains_across.png new file mode 100755 index 0000000..da65a61 Binary files /dev/null and b/advtrains/textures/advtrains_across.png differ diff --git a/advtrains/textures/advtrains_across_anim.png b/advtrains/textures/advtrains_across_anim.png new file mode 100755 index 0000000..584d023 Binary files /dev/null and b/advtrains/textures/advtrains_across_anim.png differ diff --git a/advtrains/textures/advtrains_boiler.png b/advtrains/textures/advtrains_boiler.png new file mode 100755 index 0000000..8c7ff0d Binary files /dev/null and b/advtrains/textures/advtrains_boiler.png differ diff --git a/advtrains/textures/advtrains_chimney.png b/advtrains/textures/advtrains_chimney.png new file mode 100755 index 0000000..285a1a6 Binary files /dev/null and b/advtrains/textures/advtrains_chimney.png differ diff --git a/advtrains/textures/advtrains_couple.png b/advtrains/textures/advtrains_couple.png new file mode 100755 index 0000000..eda3704 Binary files /dev/null and b/advtrains/textures/advtrains_couple.png differ diff --git a/advtrains/textures/advtrains_discouple.png b/advtrains/textures/advtrains_discouple.png new file mode 100755 index 0000000..5c064c3 Binary files /dev/null and b/advtrains/textures/advtrains_discouple.png differ diff --git a/advtrains/textures/advtrains_driver_cab.png b/advtrains/textures/advtrains_driver_cab.png new file mode 100755 index 0000000..331bcc9 Binary files /dev/null and b/advtrains/textures/advtrains_driver_cab.png differ diff --git a/advtrains/textures/advtrains_dtrack_atc_placer.png b/advtrains/textures/advtrains_dtrack_atc_placer.png new file mode 100755 index 0000000..31c2b30 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_atc_placer.png differ diff --git a/advtrains/textures/advtrains_dtrack_bumper_placer.png b/advtrains/textures/advtrains_dtrack_bumper_placer.png new file mode 100755 index 0000000..27191fe Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_bumper_placer.png differ diff --git a/advtrains/textures/advtrains_dtrack_detector_placer.png b/advtrains/textures/advtrains_dtrack_detector_placer.png new file mode 100755 index 0000000..e6c6ad6 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_detector_placer.png differ diff --git a/advtrains/textures/advtrains_dtrack_load_placer.png b/advtrains/textures/advtrains_dtrack_load_placer.png new file mode 100755 index 0000000..427c011 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_load_placer.png differ diff --git a/advtrains/textures/advtrains_dtrack_placer.png b/advtrains/textures/advtrains_dtrack_placer.png new file mode 100755 index 0000000..7bef8a9 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_placer.png differ diff --git a/advtrains/textures/advtrains_dtrack_rail.png b/advtrains/textures/advtrains_dtrack_rail.png new file mode 100755 index 0000000..bd0c217 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_rail.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared.png b/advtrains/textures/advtrains_dtrack_shared.png new file mode 100755 index 0000000..736c7db Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared_atc.png b/advtrains/textures/advtrains_dtrack_shared_atc.png new file mode 100755 index 0000000..1f83c37 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared_atc.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared_detector_off.png b/advtrains/textures/advtrains_dtrack_shared_detector_off.png new file mode 100755 index 0000000..724d907 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared_detector_off.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared_detector_on.png b/advtrains/textures/advtrains_dtrack_shared_detector_on.png new file mode 100755 index 0000000..7bb29d6 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared_detector_on.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared_load.png b/advtrains/textures/advtrains_dtrack_shared_load.png new file mode 100755 index 0000000..5fd0d7a Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared_load.png differ diff --git a/advtrains/textures/advtrains_dtrack_shared_unload.png b/advtrains/textures/advtrains_dtrack_shared_unload.png new file mode 100755 index 0000000..e9fc5bd Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_shared_unload.png differ diff --git a/advtrains/textures/advtrains_dtrack_slopeplacer.png b/advtrains/textures/advtrains_dtrack_slopeplacer.png new file mode 100755 index 0000000..1d456b0 Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_slopeplacer.png differ diff --git a/advtrains/textures/advtrains_dtrack_unload_placer.png b/advtrains/textures/advtrains_dtrack_unload_placer.png new file mode 100755 index 0000000..486861e Binary files /dev/null and b/advtrains/textures/advtrains_dtrack_unload_placer.png differ diff --git a/advtrains/textures/advtrains_platform.png b/advtrains/textures/advtrains_platform.png new file mode 100755 index 0000000..5ba9663 Binary files /dev/null and b/advtrains/textures/advtrains_platform.png differ diff --git a/advtrains/textures/advtrains_retrosignal.png b/advtrains/textures/advtrains_retrosignal.png new file mode 100755 index 0000000..141198d Binary files /dev/null and b/advtrains/textures/advtrains_retrosignal.png differ diff --git a/advtrains/textures/advtrains_retrosignal_inv.png b/advtrains/textures/advtrains_retrosignal_inv.png new file mode 100755 index 0000000..1036594 Binary files /dev/null and b/advtrains/textures/advtrains_retrosignal_inv.png differ diff --git a/advtrains/textures/advtrains_signal_inv.png b/advtrains/textures/advtrains_signal_inv.png new file mode 100755 index 0000000..ed64ed9 Binary files /dev/null and b/advtrains/textures/advtrains_signal_inv.png differ diff --git a/advtrains/textures/advtrains_signal_off.png b/advtrains/textures/advtrains_signal_off.png new file mode 100755 index 0000000..8046e52 Binary files /dev/null and b/advtrains/textures/advtrains_signal_off.png differ diff --git a/advtrains/textures/advtrains_signal_on.png b/advtrains/textures/advtrains_signal_on.png new file mode 100755 index 0000000..5228bb3 Binary files /dev/null and b/advtrains/textures/advtrains_signal_on.png differ diff --git a/advtrains/textures/advtrains_signal_wall_off.png b/advtrains/textures/advtrains_signal_wall_off.png new file mode 100755 index 0000000..3e7b1e1 Binary files /dev/null and b/advtrains/textures/advtrains_signal_wall_off.png differ diff --git a/advtrains/textures/advtrains_signal_wall_on.png b/advtrains/textures/advtrains_signal_wall_on.png new file mode 100755 index 0000000..b628c7e Binary files /dev/null and b/advtrains/textures/advtrains_signal_wall_on.png differ diff --git a/advtrains/textures/advtrains_track_cr.png b/advtrains/textures/advtrains_track_cr.png new file mode 100755 index 0000000..40f0cc5 Binary files /dev/null and b/advtrains/textures/advtrains_track_cr.png differ diff --git a/advtrains/textures/advtrains_track_cr_45.png b/advtrains/textures/advtrains_track_cr_45.png new file mode 100755 index 0000000..54966b3 Binary files /dev/null and b/advtrains/textures/advtrains_track_cr_45.png differ diff --git a/advtrains/textures/advtrains_track_placer.png b/advtrains/textures/advtrains_track_placer.png new file mode 100755 index 0000000..03e17ed Binary files /dev/null and b/advtrains/textures/advtrains_track_placer.png differ diff --git a/advtrains/textures/advtrains_track_st.png b/advtrains/textures/advtrains_track_st.png new file mode 100755 index 0000000..5ad7e4f Binary files /dev/null and b/advtrains/textures/advtrains_track_st.png differ diff --git a/advtrains/textures/advtrains_track_st_45.png b/advtrains/textures/advtrains_track_st_45.png new file mode 100755 index 0000000..63b4c96 Binary files /dev/null and b/advtrains/textures/advtrains_track_st_45.png differ diff --git a/advtrains/textures/advtrains_track_swlcr.png b/advtrains/textures/advtrains_track_swlcr.png new file mode 100755 index 0000000..d9b5c0b Binary files /dev/null and b/advtrains/textures/advtrains_track_swlcr.png differ diff --git a/advtrains/textures/advtrains_track_swlcr_45.png b/advtrains/textures/advtrains_track_swlcr_45.png new file mode 100755 index 0000000..f098fc9 Binary files /dev/null and b/advtrains/textures/advtrains_track_swlcr_45.png differ diff --git a/advtrains/textures/advtrains_track_swlst.png b/advtrains/textures/advtrains_track_swlst.png new file mode 100755 index 0000000..314bd2d Binary files /dev/null and b/advtrains/textures/advtrains_track_swlst.png differ diff --git a/advtrains/textures/advtrains_track_swlst_45.png b/advtrains/textures/advtrains_track_swlst_45.png new file mode 100755 index 0000000..765d0ec Binary files /dev/null and b/advtrains/textures/advtrains_track_swlst_45.png differ diff --git a/advtrains/textures/advtrains_track_swrcr.png b/advtrains/textures/advtrains_track_swrcr.png new file mode 100755 index 0000000..f74e1bc Binary files /dev/null and b/advtrains/textures/advtrains_track_swrcr.png differ diff --git a/advtrains/textures/advtrains_track_swrcr_45.png b/advtrains/textures/advtrains_track_swrcr_45.png new file mode 100755 index 0000000..fa432aa Binary files /dev/null and b/advtrains/textures/advtrains_track_swrcr_45.png differ diff --git a/advtrains/textures/advtrains_track_swrst.png b/advtrains/textures/advtrains_track_swrst.png new file mode 100755 index 0000000..06ea29e Binary files /dev/null and b/advtrains/textures/advtrains_track_swrst.png differ diff --git a/advtrains/textures/advtrains_track_swrst_45.png b/advtrains/textures/advtrains_track_swrst_45.png new file mode 100755 index 0000000..be477b7 Binary files /dev/null and b/advtrains/textures/advtrains_track_swrst_45.png differ diff --git a/advtrains/textures/advtrains_trackworker.png b/advtrains/textures/advtrains_trackworker.png new file mode 100755 index 0000000..b50bcae Binary files /dev/null and b/advtrains/textures/advtrains_trackworker.png differ diff --git a/advtrains/textures/advtrains_wheel.png b/advtrains/textures/advtrains_wheel.png new file mode 100755 index 0000000..fb72879 Binary files /dev/null and b/advtrains/textures/advtrains_wheel.png differ diff --git a/advtrains/textures/drwho_screwdriver.png b/advtrains/textures/drwho_screwdriver.png new file mode 100755 index 0000000..b50bcae Binary files /dev/null and b/advtrains/textures/drwho_screwdriver.png differ diff --git a/advtrains/trackdb_legacy.lua b/advtrains/trackdb_legacy.lua new file mode 100644 index 0000000..99349e8 --- /dev/null +++ b/advtrains/trackdb_legacy.lua @@ -0,0 +1,27 @@ +--trackdb_legacy.lua +--loads the (old) track database. the only use for this is to provide data for rails that haven't been written into the ndb database. +--nothing will be saved. +--if the user thinks that he has loaded every track in his world at least once, he can delete the track database. + +--trackdb[[y][x][z]={conn1, conn2, rely1, rely2, railheight} + + +--trackdb keeps its own save file. +advtrains.fpath_tdb=minetest.get_worldpath().."/advtrains_trackdb2" +local file, err = io.open(advtrains.fpath_tdb, "r") +if not file then + atprint("Not loading a trackdb file.") +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.trackdb=tbl + atprint("Loaded trackdb file.") + end + file:close() +end + + + + + + diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua new file mode 100644 index 0000000..e94b4ff --- /dev/null +++ b/advtrains/trackplacer.lua @@ -0,0 +1,305 @@ +--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) + if tp.tracks[nnprefix] then return end--due to the separate registration of slopes and flats for the same nnpref, definition would be overridden here. just don't. + 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 + advtrains.ndb.swap_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 + advtrains.ndb.swap_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) + advtrains.ndb.swap_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) + advtrains.ndb.swap_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) + advtrains.ndb.swap_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={advtrains_trackplacer=1}, + on_place = function(itemstack, placer, pointed_thing) + return advtrains.pcall(function() + local name = placer:get_player_name() + if not name then + return itemstack, false + end + if pointed_thing.type=="node" then + local pos=pointed_thing.above + local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0}) + if advtrains.is_protected(pos,name) then + minetest.record_protection_violation(pos, name) + return itemstack, false + 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.settings:get_bool("creative_mode") then + itemstack:take_item() + end + end + end + return itemstack, true + end) + end, + }) +end + + + +minetest.register_craftitem("advtrains:trackworker",{ + description = attrans("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) + return advtrains.pcall(function() + local name = placer:get_player_name() + if not name then + return + end + if pointed_thing.type=="node" then + local pos=pointed_thing.under + if advtrains.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + 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.get_train_at_pos(pos) then return end + + local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") + --atprint(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(), attrans("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 + advtrains.ndb.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(), attrans("This node can't be rotated using the trackworker!")) + return + end + advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) + end + end + end) + end, + on_use=function(itemstack, user, pointed_thing) + return advtrains.pcall(function() + 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 advtrains.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return + end + + --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end + if advtrains.get_train_at_pos(pos) then return end + local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") + --atprint(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(), attrans("This node can't be changed using the trackworker!")) + return + end + end + local nextsuffix=tp.tracks[nnprefix].twcycle[suffix] + advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..nextsuffix..rotation, param2=node.param2}) + + else + atprint(name, dump(tp.tracks)) + end + end) + end, +}) + +--putting into right place +advtrains.trackplacer=tp diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua new file mode 100644 index 0000000..d63e5c8 --- /dev/null +++ b/advtrains/tracks.lua @@ -0,0 +1,734 @@ +--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_flat={ + 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), + }, + description={ + st="straight", + cr="curve", + swlst="left switch (straight)", + swlcr="left switch (curve)", + swrst="right switch (straight)", + swrcr="right switch (curve)", + }, + switch={ + swlst="swlcr", + swlcr="swlst", + swrst="swrcr", + swrcr="swrst", + }, + switchmc={ + swlst="on", + swlcr="off", + swrst="on", + swrcr="off", + }, + switchst={ + swlst="st", + swlcr="cr", + swrst="st", + swrcr="cr", + }, + 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", + }, + rotation={"", "_30", "_45", "_60"}, + slopenodes={}, + increativeinv={}, +} +ap.t_30deg_slope={ + regstep=1, + variant={ + 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={ + vst1="steep uphill 1/2", + vst2="steep uphill 2/2", + vst31="uphill 1/3", + vst32="uphill 2/3", + vst33="uphill 3/3", + }, + switch={}, + switchmc={}, + switchst={}, + 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"}, + trackworker={}, + 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", + }, + switchst={ + swlst="st", + swlcr="cr", + swrst="st", + swrcr="cr", + }, + 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, is_state) + local rcswitchfunc=function(pos, node, player) + if minetest.check_player_privs(player:get_player_name(), {train_operator=true}) then + advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) + advtrains.invalidate_all_paths(pos) + end + end + local switchfunc=function(pos, node, newstate) + if newstate~=is_state then + advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..suffix_target, param2=node.param2}) + advtrains.invalidate_all_paths(pos) + end + end + local mesec + if mesecon_state then -- if mesecons is not wanted, do not. + mesec = {effector = { + ["action_"..mesecon_state] = switchfunc, + rules=advtrains.meseconrules + }} + end + return rcswitchfunc, mesec, + { + getstate = is_state, + setstate = switchfunc, + } + end + local function make_overdef(suffix, rotation, conns, rcswitchfunc, mesecontbl, luaautomation, 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"), def.second_texture}, + --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=rcswitchfunc, + groups = { + attached_node=1, + ["advtrains_track_"..tracktype]=1, + save_in_nodedb=1, + dig_immediate=2, + not_in_creative_inventory=(not in_creative_inv and 1 or nil), + not_blocking_trains=1, + }, + mesecons=mesecontbl, + luaautomation=luaautomation, + drop = (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.get_train_at_pos(pos) + end, + after_dig_node=function(pos) + advtrains.ndb.update(pos) + end, + after_place_node=function(pos) + advtrains.ndb.update(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 rcswitchfunc, mesecontbl, luaautomation + if preset.switch[suffix] then + rcswitchfunc, mesecontbl, luaautomation=make_switchfunc(preset.switch[suffix]..rotation, preset.switchmc[suffix], preset.switchst[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), + rcswitchfunc, mesecontbl, luaautomation, 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 atprint(" 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 atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end + + local tracktype + for k,_ in pairs(nodedef.groups) do + local tt=string.match(k, "^advtrains_track_(.+)$") + if tt then + tracktype=tt + end + end + return (nodedef.connect1 + 4 * noderot)%16, (nodedef.connect2 + 4 * noderot)%16, nodedef.rely1 or 0, nodedef.rely2 or 0, nodedef.railheight or 0, tracktype +end + +--detector code +--holds a table with nodes on which trains are on. + +advtrains.detector = {} +advtrains.detector.on_node = {} + +function advtrains.detector.enter_node(pos, train_id) + local ppos=advtrains.round_vector_floor_y(pos) + local pts=minetest.pos_to_string(ppos) + advtrains.detector.on_node[pts]=train_id + advtrains.detector.call_enter_callback(ppos, train_id) +end +function advtrains.detector.leave_node(pos, train_id) + local ppos=advtrains.round_vector_floor_y(pos) + advtrains.detector.call_leave_callback(ppos, train_id) +end +function advtrains.detector.stay_node(pos, train_id) + local ppos=advtrains.round_vector_floor_y(pos) + local pts=minetest.pos_to_string(ppos) + advtrains.detector.on_node[pts]=train_id +end + + + +function advtrains.detector.call_enter_callback(pos, train_id) + --atprint("instructed to call enter calback") + + local node = advtrains.ndb.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 +end +function advtrains.detector.call_leave_callback(pos, train_id) + --atprint("instructed to call leave calback") + + local node = advtrains.ndb.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 = attrans("@1 Slope", def.description), + 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(), attrans("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(), attrans("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(), attrans("Can't place: space occupied!")) + return istack + end + if advtrains.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + 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 advtrains.is_protected(pos, player:get_player_name()) then + --do slopes of this distance exist? + if lookup[step] then + if minetest.settings:get_bool("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.settings:get_bool("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(), attrans("Can't place: Not enough slope items left (@1 required)", step)) + end + else + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: There's no slope of length @1",step)) + end + return istack + end + step=step+1 + pos=vector.add(pos, dirvec) + end + minetest.chat_send_player(player:get_player_name(), attrans("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=attrans("Deprecated Track"), + formats={vst1={}, vst2={}}, +}, ap.t_45deg) + +--flat +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("Track"), + formats={}, +}, ap.t_30deg_flat) +--slopes +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + second_texture="default_gravel.png", + description=attrans("Track"), + formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, +}, ap.t_30deg_slope) + +--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", + --bumpers still use the old texture until the models are redone. + description=attrans("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", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_detector_off.png", + description=attrans("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) + advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=advtrains.ndb.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", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_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) + advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=advtrains.ndb.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 new file mode 100644 index 0000000..591881a --- /dev/null +++ b/advtrains/trainhud.lua @@ -0,0 +1,126 @@ +--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"} +local doorstr={[-1]="|<>| >|<", [0]=">|< >|<", [1]=">|< |<>|"} + +function advtrains.on_control_change(pc, train, flip) + local maxspeed = train.max_speed or 10 + if pc.sneak then + if pc.up then + train.tarvelocity = maxspeed + 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 = math.min(train.tarvelocity + 1, maxspeed) + 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 pc.left then + if train.door_open ~= 0 then + train.door_open = 0 + else + train.door_open = -train.movedir + end + end + if pc.right then + if train.door_open ~= 0 then + train.door_open = 0 + else + train.door_open = 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) + local inside=train.text_inside or "" + advtrains.set_trainhud(pname, inside.."\n"..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=" ["..mletter[fct*train.movedir].."] "..doorstr[(train.door_open or 0) * train.movedir].." "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") + firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", max-vel)..">" + secondLine=attrans("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 new file mode 100644 index 0000000..483ea52 --- /dev/null +++ b/advtrains/trainlogic.lua @@ -0,0 +1,1005 @@ +--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 +atprintbm=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.mainloop_trainlogic=function(dtime) + --build a table of all players indexed by pts. used by damage and door system. + advtrains.playersbypts={} + for _, player in pairs(minetest.get_connected_players()) do + if not advtrains.player_to_train_mapping[player:get_player_name()] then + --players in train are not subject to damage + local ptspos=minetest.pos_to_string(vector.round(player:getpos())) + advtrains.playersbypts[ptspos]=player + end + end + --regular train step + -- do in two steps: + -- a: predict path and add all nodes to the advtrains.detector.on_node table + -- b: check for collisions based on these data + -- (and more) + local t=os.clock() + advtrains.detector.on_node={} + for k,v in pairs(advtrains.trains) do + advtrains.atprint_context_tid=sid(k) + advtrains.atprint_context_tid_full=k + advtrains.train_step_a(k, v, dtime) + end + for k,v in pairs(advtrains.trains) do + advtrains.atprint_context_tid=sid(k) + advtrains.atprint_context_tid_full=k + advtrains.train_step_b(k, v, dtime) + end + + advtrains.atprint_context_tid=nil + advtrains.atprint_context_tid_full=nil + + atprintbm("trainsteps", t) + endstep() +end + +minetest.register_on_joinplayer(function(player) + return advtrains.pcall(function() + local pname=player:get_player_name() + local id=advtrains.player_to_train_mapping[pname] + if id then + local train=advtrains.trains[id] + if not train then advtrains.player_to_train_mapping[pname]=nil return end + --set the player to the train position. + --minetest will emerge the area and load the objects, which then will call reattach_all(). + --because player is in mapping, it will not be subject to dying. + player:setpos(train.last_pos_prev) + --independent of this, cause all wagons of the train which are loaded to reattach their players + --needed because already loaded wagons won't call reattach_all() + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.train_id==id then + wagon:reattach_all() + end + end + end + end) +end) + +minetest.register_on_dieplayer(function(player) + return advtrains.pcall(function() + local pname=player:get_player_name() + local id=advtrains.player_to_train_mapping[pname] + if id then + local train=advtrains.trains[id] + if not train then advtrains.player_to_train_mapping[pname]=nil return end + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.train_id==id then + --when player dies, detach him from the train + --call get_off_plr on every wagon since we don't know which one he's on. + wagon:get_off_plr(pname) + end + end + end + end) +end) +--[[ +train step structure: + + +- legacy stuff +- preparing the initial path and creating index +- setting node coverage old indices +- handle velocity influences: + - off-track + - atc + - player controls + - environment collision +- update index = move +- create path +- update node coverage +- do less important stuff such as checking trainpartload or removing + +-- break -- +- handle train collisions + +]] + +function advtrains.train_step_a(id, train, dtime) + --atprint("--- runcnt ",advtrains.mainloop_runcnt,": index",train.index,"end_index", train.end_index,"| max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> pe_min", train.path_extent_min,"pe_max", train.path_extent_max) + if train.min_index_on_track then + assert(math.floor(train.min_index_on_track)==train.min_index_on_track) + end + --- 1. LEGACY STUFF --- + 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 + --- 2. prepare initial path and index if needed --- + if not train.index then train.index=0 end + if not train.path then + if not train.last_pos then + --no chance to recover + atprint("train hasn't saved last-pos, removing train.") + advtrains.trains[id]=nil + return false + end + + local node_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(train.last_pos), train.drives_on) + + if node_ok==nil then + --block not loaded, do nothing + atprint("last_pos", advtrains.round_vector_floor_y(train.last_pos), "not loaded and not in ndb, waiting") + return nil + elseif node_ok==false then + atprint("no track here, (fail) removing train.") + advtrains.trains[id]=nil + return false + end + + if not train.last_pos_prev then + --no chance to recover + atprint("train hasn't saved last-pos_prev, removing train.") + advtrains.trains[id]=nil + return false + end + + local prevnode_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(train.last_pos_prev), train.drives_on) + + if prevnode_ok==nil then + --block not loaded, do nothing + atprint("last_pos_prev", advtrains.round_vector_floor_y(train.last_pos_prev), "not loaded and not in ndb, waiting") + return nil + elseif prevnode_ok==false then + atprint("no track at prev, (fail) removing train.") + advtrains.trains[id]=nil + return false + end + + train.index=(train.restore_add_index or 0)+(train.savedpos_off_track_index_offset or 0) + --restore_add_index is set by save() to prevent trains hopping to next round index. should be between -0.5 and 0.5 + --savedpos_off_track_index_offset is set if train went off track. see below. + train.path={} + train.path_dist={} + train.path[0]=train.last_pos + train.path[-1]=train.last_pos_prev + train.path_dist[-1]=vector.distance(train.last_pos, train.last_pos_prev) + train.path_extent_min=-1 + train.path_extent_max=0 + train.min_index_on_track=-1 + train.max_index_on_track=0 + + --[[ + Bugfix for trains randomly ignoring ATC rails: + - Paths have been invalidated. 1 gets executed and ensures an initial path + - 2a sets train end index. The problem is that path_dist is not known for the whole path, so train end index will be nearly trainlen + - Since the detector indices are also unknown, they get set to the new (wrong) train_end_index. Enter_node calls are not executed for the nodes that lie in between real end_index and trainlen. + - The next step, mistake is recognized, train leaves some positions. From there, everything works again. + To overcome this, we will generate the full required path here so that path_dist is available for get_train_end_index(). + ]] + advtrains.pathpredict(id, train) + end + + --- 2a. set train.end_index which is required in different places, IF IT IS NOT SET YET by STMT afterwards. --- + --- table entry to avoid triple recalculation --- + if not train.end_index then + train.end_index=advtrains.get_train_end_index(train) + end + + --- 2b. set node coverage old indices --- + + train.detector_old_index = math.floor(train.index) + train.detector_old_end_index = math.floor(train.end_index) + + --- 3. handle velocity influences --- + local train_moves=(train.velocity~=0) + + if train.recently_collided_with_env then + train.tarvelocity=0 + if not train_moves then + train.recently_collided_with_env=false--reset status when stopped + end + end + if train.locomotives_in_train==0 then + train.tarvelocity=0 + end + + --- 3a. this can be useful for debugs/warnings and is used for check_trainpartload --- + local t_info, train_pos=sid(id), train.path[math.floor(train.index)] + if train_pos then + t_info=t_info.." @"..minetest.pos_to_string(train_pos) + --atprint("train_pos:",train_pos) + end + + --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 + atwarn("Train",t_info,"is off track at both ends. Clipping velocity to 1") + pprint=true + end + elseif front_off_track then--allow movement only backward + if train.movedir==1 and train.tarvelocity>0 then + train.tarvelocity=0 + atwarn("Train",t_info,"is off track. Trying to drive further out. Velocity clipped to 0") + pprint=true + end + if train.movedir==-1 and train.tarvelocity>1 then + train.tarvelocity=1 + atwarn("Train",t_info,"is off track. Velocity clipped to 1") + pprint=true + end + elseif back_off_track then--allow movement only forward + if train.movedir==-1 and train.tarvelocity>0 then + train.tarvelocity=0 + atwarn("Train",t_info,"is off track. Trying to drive further out. Velocity clipped to 0") + pprint=true + end + if train.movedir==1 and train.tarvelocity>1 then + train.tarvelocity=1 + atwarn("Train",t_info,"is off track. Velocity clipped to 1") + pprint=true + end + end + if pprint then + atprint("max_iot", train.max_index_on_track, "min_iot", train.min_index_on_track, "<> index", train.index, "end_index", train.end_index) + end + + --interpret ATC command + if train.atc_brake_target and train.atc_brake_target>=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. + --atprint("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. + --atprint("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_targettrain.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] + atprint("train is off-track (back), last positions kept at", train.last_pos, "/", 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 + + --- 5b. Remove path items that are no longer used --- + -- Necessary since path items are no longer invalidated in save steps + local path_pregen_keep=20 + local offtrack_keep=4 + local gen_front_keep= path_pregen_keep + local gen_back_keep= math.floor(- train.trainlen - path_pregen_keep) + + local delete_min=math.min(train.max_index_on_track - offtrack_keep, math.floor(train.index)+gen_back_keep) + local delete_max=math.max(train.min_index_on_track + offtrack_keep, math.floor(train.index)+gen_front_keep) + + if train.path_extent_mindelete_max then + atprint(sid(id),"clearing path max ",train.path_extent_max," to ",delete_max) + train.path_dist[delete_max]=nil + for i=delete_max+1,train.path_extent_max do + train.path[i]=nil + train.path_dist[i]=nil + end + train.path_extent_max=delete_max + train.max_index_on_track=math.min(train.max_index_on_track, delete_max) + end + + --- 6. update node coverage --- + + -- when paths get cleared, the old indices set above will be up-to-date and represent the state in which the last run of this code was made + local ifo, ifn, ibo, ibn = train.detector_old_index, math.floor(train.index), train.detector_old_end_index, math.floor(train.end_index) + + local path=train.path + + if train.enter_node_all then + --field set by create_new_train_at. + --ensures that new train calls enter_node on all nodes + for i=ibn, ifn do + if path[i] then + advtrains.detector.enter_node(path[i], id) + end + end + train.enter_node_all=nil + else + for i=ibn, ifn do + if path[i] then + local pts=minetest.pos_to_string(path[i]) + if not (advtrains.detector.on_node[pts] and advtrains.detector.on_node[pts]~=id) then + advtrains.detector.stay_node(path[i], id) + end + end + end + + if ifn>ifo then + for i=ifo+1, ifn do + if path[i] then + local pts=minetest.pos_to_string(path[i]) + if advtrains.detector.on_node[pts] and advtrains.detector.on_node[pts]~=id then + --if another train has signed up for this position first, it won't be recognized in train_step_b. So do collision here. + atprint("Collision detected in enter_node callbacks (front) @",pts,"with",sid(advtrains.detector.on_node[pts])) + advtrains.collide_and_spawn_couple(id, path[i], advtrains.detector.on_node[pts], false) + end + atprint("enter_node (front) @index",i,"@",pts,"on_node",sid(advtrains.detector.on_node[pts])) + advtrains.detector.enter_node(path[i], id) + end + end + elseif ifnibo then + for i=ibo, ibn-1 do + if path[i] then + advtrains.detector.leave_node(path[i], id) + end + end + end + end + + --- 7. do less important stuff --- + --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 + + train.check_trainpartload=(train.check_trainpartload or 0)-dtime + local node_range=(math.max((minetest.settings:get("active_block_range") or 0),1)*16) + if train.check_trainpartload<=0 then + local ori_pos=train_pos --see 3a. + --atprint("[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()) gen_back do + local conway + if train.min_index_on_track == minn then + atprint("minn conway for ",minn,train.path[minn],minn+1,train.path[minn+1]) + conway=advtrains.conway(train.path[minn], train.path[minn+1], train.drives_on) + end + if conway then + train.path[minn-1]=conway + train.min_index_on_track=minn-1 + else + --do as if nothing has happened and preceed with path + --but do not update min_index_on_track + atprint("over-generating path min to index ",(minn-1)," (position ",train.path[minn]," )") + 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=minn-1 + end + train.path_extent_min=minn + if not train.min_index_on_track then train.min_index_on_track=-1 end + if not train.max_index_on_track then train.max_index_on_track=0 end +end + + +function advtrains.train_step_b(id, train, dtime) + + --hacky fix: if train_step_a returned in phase 2, end_index may not be set. + --just return + if not train.end_index then + return + end + + --- 8. check for collisions with other trains and damage players --- + + local train_moves=(train.velocity~=0) + + if train_moves then + local collpos + local coll_grace=1 + if train.movedir==1 then + collpos=advtrains.get_real_index_position(train.path, train.index-coll_grace) + else + collpos=advtrains.get_real_index_position(train.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}) + --- 8a Check collision --- + local testpts=minetest.pos_to_string(testpos) + if advtrains.detector.on_node[testpts] and advtrains.detector.on_node[testpts]~=id then + --collides + advtrains.collide_and_spawn_couple(id, testpos, advtrains.detector.on_node[testpts], train.movedir==-1) + end + --- 8b damage players --- + if not minetest.settings:get_bool("creative_mode") then + local player=advtrains.playersbypts[testpts] + if player and train.velocity>3 then + --instantly kill player + --drop inventory contents first, to not to spawn bones + local player_inv=player:get_inventory() + for i=1,player_inv:get_size("main") do + minetest.add_item(testpos, player_inv:get_stack("main", i)) + end + for i=1,player_inv:get_size("craft") do + minetest.add_item(testpos, player_inv:get_stack("craft", i)) + end + -- empty lists main and craft + player_inv:set_list("main", {}) + player_inv:set_list("craft", {}) + player:set_hp(0) + end + end + end + end + end + end +end + +--returns new id +function advtrains.create_new_train_at(pos, pos_prev) + local newtrain_id=os.time()..os.clock() + while advtrains.trains[newtrain_id] do newtrain_id=os.time()..os.clock() end--ensure uniqueness(will be unneccessary) + + advtrains.trains[newtrain_id]={} + advtrains.trains[newtrain_id].last_pos=pos + advtrains.trains[newtrain_id].last_pos_prev=pos_prev + advtrains.trains[newtrain_id].tarvelocity=0 + advtrains.trains[newtrain_id].velocity=0 + advtrains.trains[newtrain_id].trainparts={} + + advtrains.trains[newtrain_id].enter_node_all=true + + return newtrain_id +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.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=20 + local rel_pos=0 + local count_l=0 + for i, w_id in ipairs(train.trainparts) do + local wagon=nil + for aoid,iwagon in pairs(minetest.luaentities) do + if iwagon.is_wagon and iwagon.unique_id==w_id then + if wagon then + --duplicate + atprint("update_trainpart_properties: Removing duplicate wagon with id="..aoid) + 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.add_entity(train.last_pos, advtrains.wagon_save[w_id].entity_name):get_luaentity() + if not wagon then + minetest.chat_send_all("[advtrains] Warning: Wagon "..advtrains.wagon_save[w_id].entity_name.." does not exist. Make sure all required modules are loaded!") + else + wagon:init_from_wagon_save(w_id) + end + 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 + + 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) + if i==1 then + train.couple_lock_front=wagon.lock_couples + end + if i==#train.trainparts then + train.couple_lock_back=wagon.lock_couples + end + + else + atprint(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] + if not train.path then return end + + local real_pos_in_train=advtrains.get_real_path_index(train, wagon.pos_in_train) + local pos_for_new_train=train.path[math.floor(real_pos_in_train+wagon.wagon_span)] + local pos_for_new_train_prev=train.path[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 + atprint("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 + atprint("split_train: pos_for_new_train ",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 + atprint("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 + atprint("split_train: pos_for_new_train_prev ", 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 + newtrain.enter_node_all=true +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.collide_and_spawn_couple(id1, pos, id2, t1_is_backpos) + if minetest.settings:get_bool("advtrains_disable_collisions") then + return + end + + atprint("COLLISION: "..sid(id1).." and "..sid(id2).." at ",pos,", t1_is_backpos="..(t1_is_backpos and "true" or "false")) + --TODO: + local train1=advtrains.trains[id1] + + -- do collision + train1.recently_collided_with_env=true + train1.velocity=0.5*train1.velocity + train1.movedir=train1.movedir*-1 + train1.tarvelocity=0 + + local train2=advtrains.trains[id2] + + if not train1 or not train2 then return end + + 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 + atprint("Err: pos not in path. Not spawning a couple") + 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 + atprint("End positions: ",frontpos2,backpos2) + + t2_is_backpos = vector.distance(backpos2, pos) < vector.distance(frontpos2, pos) + + atprint("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 atprint("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 + local p_aoi + 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 + p_aoi=aoi + end + end + atprint("Couple spawned (ActiveObjectID ",p_aoi,")") +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, player) + local first, second=advtrains.trains[first_id], advtrains.trains[second_id] + + if not first or not second or not first.index or not second.index or not first.end_index or not second.end_index then + return false + end + + if first.couple_lock_back or second.couple_lock_front then + -- trains are ordered correctly! + if player then + minetest.chat_send_player(player:get_player_name(), "Can't couple: couples locked!") + end + return + end + + local first_wagoncnt=#first.trainparts + local second_wagoncnt=#second.trainparts + + for _,v in ipairs(second.trainparts) do + table.insert(first.trainparts, v) + end + --kick it like physics (with mass being #wagons) + local new_velocity=((first.velocity*first_wagoncnt)+(second.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 + return true +end + +function advtrains.invert_train(train_id) + local train=advtrains.trains[train_id] + + local old_path=train.path + local old_path_dist=train.path_dist + train.path={} + train.path_dist={} + train.index, train.end_index= -train.end_index, -train.index + train.path_extent_min, train.path_extent_max = -train.path_extent_max, -train.path_extent_min + train.min_index_on_track, train.max_index_on_track = -train.max_index_on_track, -train.min_index_on_track + train.detector_old_index, train.detector_old_end_index = -train.detector_old_end_index, -train.detector_old_index + + train.velocity=-train.velocity + train.tarvelocity=-train.tarvelocity + for k,v in pairs(old_path) do + train.path[-k]=v + train.path_dist[-k-1]=old_path_dist[k] + 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.get_train_at_pos(pos) + local ph=minetest.pos_to_string(advtrains.round_vector_floor_y(pos)) + return advtrains.detector.on_node[ph] +end + +function advtrains.invalidate_all_paths(pos) + --if a position is given, only invalidate inside a radius to save performance + local inv_radius=50 + atprint("invalidating all paths") + for k,v in pairs(advtrains.trains) do + local exec=true + if pos and v.path and v.index and v.end_index then + --start and end pos of the train + local cmp1=v.path[math.floor(v.index)] + local cmp2=v.path[math.floor(v.end_index)] + if vector.distance(pos, cmp1)>inv_radius and vector.distance(pos, cmp2)>inv_radius then + exec=false + end + end + if exec then + --TODO duplicate code in init.lua avt_save()! + 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.end_index=nil + v.min_index_on_track=nil + v.max_index_on_track=nil + v.path_extent_min=nil + v.path_extent_max=nil + + v.detector_old_index=nil + v.detector_old_end_index=nil + end + 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 new file mode 100644 index 0000000..567b560 --- /dev/null +++ b/advtrains/wagons.lua @@ -0,0 +1,900 @@ +--atan2 counts angles clockwise, minetest does counterclockwise + +minetest.register_privilege("train_place", { + description = "Player can place trains on tracks not owned by player", + give_to_singleplayer= false, +}); +minetest.register_privilege("train_remove", { + description = "Player can remove trains not owned by player", + give_to_singleplayer= false, +}); +minetest.register_privilege("train_operator", { + description = "Player may operate trains and switch signals. Given by default. Revoke to prevent players from griefing automated subway systems.", + give_to_singleplayer= true, + default= true, +}); + +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: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) + if sd_uid~="" then + --destroy when loaded from static block. + self.object:remove() + return + end + self.object:set_armor_groups({immortal=1}) + self.entity_name=self.name +end + +function wagon:get_staticdata() + return advtrains.pcall(function() + if not self:ensure_init() then return end + atprint("[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) +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 + atprint("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(0.2, function() self:reattach_all() end) + atprint("init_from_wagon_save "..self.unique_id.." ("..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 + if self.doors then + self.door_anim_timer=0 + self.door_state=0 + end + if self.custom_on_activate then + self:custom_on_activate(dtime_s) + end +end +function wagon:ensure_init() + if self.initialized then + if self.noninitticks then self.noninitticks=nil end + return true + end + if not self.noninitticks then self.noninitticks=0 end + self.noninitticks=self.noninitticks+1 + if self.noninitticks>20 then + self.object:remove() + else + self.object:setvelocity({x=0,y=0,z=0}) + end + return false +end + +-- Remove the wagon +function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) + return advtrains.pcall(function() + 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 and (not minetest.check_player_privs(puncher, {train_remove = true })) then + minetest.chat_send_player(puncher:get_player_name(), attrans("This wagon is owned by @1, you can't destroy it.", self.owner)); + return + end + + if minetest.settings:get_bool("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(), attrans("Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click 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) +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 + + atprint("[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) + return advtrains.pcall(function() + if not self:ensure_init() then return end + + local t=os.clock() + local pos = self.object:getpos() + + if not pos then + atprint("["..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 + atprint("[wagon "..self.unique_id.."] missing train_id, destroying") + self.object:remove() + return + end + if not self.seatp then + self.seatp={} + end + if not self.seatpc then + self.seatpc={} + end + + --Legacy: remove infotext since it does not work this way anyways + self.infotext=nil + + --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 + local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) + local has_driverstand=seat.driving_ctrl_access and self.seatp[seatno] and minetest.check_player_privs(self.seatp[seatno], {train_operator=true}) + if has_driverstand and driver then + advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped) + elseif driver then + --only show the inside text + local inside=self:train().text_inside or "" + advtrains.set_trainhud(driver:get_player_name(), inside) + end + if driver and driver:get_player_control_bits()~=self.seatpc[seatno] then + local pc=driver:get_player_control() + self.seatpc[seatno]=driver:get_player_control_bits() + + if has_driverstand then + --regular driver stand controls + advtrains.on_control_change(pc, self:train(), self.wagon_flipped) + else + -- If on a passenger seat and doors are open, get off when W or D pressed. + local pass = self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno]) + if pass and self:train().door_open~=0 then + local pc=pass:get_player_control() + if pc.up or pc.down then + self:get_off(seatno) + end + end + end + if pc.aux1 and pc.sneak then + self:get_off(seatno) + end + end + end + + --check infotext + local outside=self:train().text_outside or "" + if self.object:get_properties().infotext~=outside then + self.object:set_properties({infotext=outside}) + end + + local gp=self:train() + local fct=self.wagon_flipped and -1 or 1 + --door animation + if self.doors then + if (self.door_anim_timer or 0)<=0 then + local dstate = (gp.door_open or 0) * fct + if dstate ~= self.door_state then + local at + --meaning of the train.door_open field: + -- -1: left doors (rel. to train orientation) + -- 0: closed + -- 1: right doors + --this code produces the following behavior: + -- if changed from 0 to +-1, play open anim. if changed from +-1 to 0, play close. + -- if changed from +-1 to -+1, first close and set 0, then it will detect state change again and run open. + if self.door_state == 0 then + at=self.doors.open[dstate] + self.object:set_animation(at.frames, at.speed or 15, at.blend or 0, false) + self.door_state = dstate + else + at=self.doors.close[self.door_state or 1]--in case it has not been set yet + self.object:set_animation(at.frames, at.speed or 15, at.blend or 0, false) + self.door_state = 0 + end + self.door_anim_timer = at.time + end + else + self.door_anim_timer = (self.door_anim_timer or 0) - dtime + end + end + + --DisCouple + if self.pos_in_trainparts and self.pos_in_trainparts>1 then + if gp.velocity==0 and not self.lock_couples 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 + atprint("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 gp.path 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) + --atprint("trainindex "..gp.index.." wagonindex "..index) + + --automatic get_on + --needs to know index and path + if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 then + --using the mapping created by the trainlogic globalstep + for i, ino in ipairs(self.door_entry) do + --fct is the flipstate flag from door animation above + local aci = index + ino*fct + local ix1=gp.path[math.floor(aci)] + local ix2=gp.path[math.floor(aci+1)] + -- the two wanted positions are ix1 and ix2 + (2nd-1st rotated by 90deg) + -- (x z) rotated by 90deg is (-z x) (http://stackoverflow.com/a/4780141) + local add = { x = (ix2.z-ix1.z)*gp.door_open, y = 0, z = (ix1.x-ix2.x)*gp.door_open } + local pts1=vector.round(vector.add(ix1, add)) + local pts2=vector.round(vector.add(ix2, add)) + if minetest.get_item_group(minetest.get_node(pts1).name, "platform")>0 then + local ckpts={ + pts1, + pts2, + vector.add(pts1, {x=0, y=1, z=0}), + vector.add(pts2, {x=0, y=1, z=0}), + } + for _,ckpos in ipairs(ckpts) do + local cpp=minetest.pos_to_string(ckpos) + if advtrains.playersbypts[cpp] then + self:on_rightclick(advtrains.playersbypts[cpp]) + end + end + end + end + end + + --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 + --atprint(" 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 + if self.collision_count and self.collision_count>10 then + --enable collision mercy to get trains stuck in walls out of walls + --actually do nothing except limiting the velocity to 1 + gp.velocity=math.min(gp.velocity, 1) + gp.tarvelocity=math.min(gp.tarvelocity, 1) + else + gp.recently_collided_with_env=true + gp.velocity=2*gp.velocity + gp.movedir=-gp.movedir + gp.tarvelocity=0 + self.collision_count=(self.collision_count or 0)+1 + end + else + self.collision_count=nil + 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 + atprintbm("wagon step", t) + end) +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:on_rightclick(clicker) + return advtrains.pcall(function() + 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) + atprint(dump(self)) + return + end + local pname=clicker:get_player_name() + local no=self:get_seatno(pname) + if no then + if self.seat_groups then + local poss={} + local sgr=self.seats[no].group + for _,access in ipairs(self.seat_groups[sgr].access_to) do + if self:check_seat_group_access(pname, access) then + poss[#poss+1]={name=self.seat_groups[access].name, key="sgr_"..access} + end + end + if self.has_inventory and self.get_inventory_formspec then + poss[#poss+1]={name=attrans("Show Inventory"), key="inv"} + end + if self.owner==pname then + poss[#poss+1]={name=attrans("Wagon properties"), key="prop"} + end + if not self.seat_groups[sgr].require_doors_open or self:train().door_open~=0 then + poss[#poss+1]={name=attrans("Get off"), key="off"} + else + if clicker:get_player_control().sneak then + poss[#poss+1]={name=attrans("Get off (forced)"), key="off"} + else + poss[#poss+1]={name=attrans("(Doors closed)"), key="dcwarn"} + end + end + if #poss==0 then + --can't do anything. + elseif #poss==1 then + self:seating_from_key_helper(pname, {[poss[1].key]=true}, no) + else + local form = "size[5,"..1+(#poss).."]" + for pos,ent in ipairs(poss) do + form = form .. "button_exit[0.5,"..(pos-0.5)..";4,1;"..ent.key..";"..ent.name.."]" + end + minetest.show_formspec(pname, "advtrains_seating_"..self.unique_id, form) + end + else + self:get_off(no) + end + else + --do not attach if already on a train + if advtrains.player_to_train_mapping[pname] then return end + if self.seat_groups then + 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 doors_open = self:train().door_open~=0 or clicker:get_player_control().sneak + for _,sgr in ipairs(self.assign_to_seat_group) do + if self:check_seat_group_access(pname, sgr) then + for seatid, seatdef in ipairs(self.seats) do + if seatdef.group==sgr and not self.seatp[seatid] and (not self.seat_groups[sgr].require_doors_open or doors_open) then + self:get_on(clicker, seatid) + return + end + end + end + end + minetest.chat_send_player(pname, attrans("Can't get on: wagon full or doors closed!")) + minetest.chat_send_player(pname, attrans("Use Sneak+rightclick to bypass closed doors!")) + else + self:show_get_on_form(pname) + end + end + end) +end + +function wagon:get_on(clicker, seatno) + if not self.seatp then self.seatp={}end + if not self.seatpc then self.seatpc={}end--player controls in driver stands + + if not self.seats[seatno] then return end + local oldno=self:get_seatno(clicker:get_player_name()) + if oldno then + atprint("get_on: clearing oldno",seatno) + advtrains.player_to_train_mapping[clicker:get_player_name()]=nil + advtrains.clear_driver_hud(clicker:get_player_name()) + self.seatp[oldno]=nil + end + if self.seatp[seatno] and self.seatp[seatno]~=clicker:get_player_name() then + atprint("get_on: throwing off",self.seatp[seatno],"from seat",seatno) + self:get_off(seatno) + end + atprint("get_on: attaching",clicker:get_player_name()) + self.seatp[seatno] = clicker:get_player_name() + self.seatpc[seatno] = clicker:get_player_control_bits() + 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) + self.seatp[seatno]=nil + self.seatpc[seatno]=nil + if clicker then + atprint("get_off: detaching",clicker:get_player_name()) + clicker:set_detach() + clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) + local gp=self:train() + --code as in step - automatic get on + if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 and gp.index and gp.path then + local index=advtrains.get_real_path_index(gp, self.pos_in_train) + --using the mapping created by the trainlogic globalstep + for i, ino in ipairs(self.door_entry) do + local aci = index + ino*(self.wagon_flipped and -1 or 1) + local ix1=gp.path[math.floor(aci)] + local ix2=gp.path[math.floor(aci+1)] + -- the two wanted positions are ix1 and ix2 + (2nd-1st rotated by 90deg) + -- (x z) rotated by 90deg is (-z x) (http://stackoverflow.com/a/4780141) + -- multiplied by 2 here, to place off on platform, y of add is 1. + local add = { x = (ix2.z-ix1.z)*gp.door_open, y = 0, z = (ix1.x-ix2.x)*gp.door_open} + local oadd = { x = (ix2.z-ix1.z)*gp.door_open*2, y = 1, z = (ix1.x-ix2.x)*gp.door_open*2} + local platpos=vector.round(vector.add(ix1, add)) + local offpos=vector.round(vector.add(ix1, oadd)) + atprint("platpos:", platpos, "offpos:", offpos) + if minetest.get_item_group(minetest.get_node(platpos).name, "platform")>0 then + minetest.after(0.2, function() clicker:setpos(offpos) end) + return + end + end + else--if not door_entry, or paths missing, fall back to old method + 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) + local offp=vector.add({x=isx and r*2 or 0, y=1, z=not isx and r*2 or 0}, objpos) + if minetest.get_item_group(minetest.get_node(p).name, "platform")>0 then + minetest.after(0.2, function() clicker:setpos(offp) end) + return + end + end + end + end +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;"..attrans("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;"..attrans("Show Inventory").."]" + end + minetest.show_formspec(pname, "advtrains_geton_"..self.unique_id, form) +end +function wagon:show_wagon_properties(pname) + local numsgr=0 + if self.seat_groups then + numsgr=#self.seat_groups + end + if not self.seat_access then + self.seat_access={} + end + --[[ + fields: seat access: empty: everyone + checkbox: lock couples + button: save + ]] + local form="size[5,"..(numsgr*1.5+7).."]" + local at=0 + if self.seat_groups then + for sgr,sgrdef in pairs(self.seat_groups) do + local text = attrans("Access to @1",sgrdef.name) + form=form.."field[0.5,"..(0.5+at*1.5)..";4,1;sgr_"..sgr..";"..text..";"..(self.seat_access[sgr] or "").."]" + at=at+1 + end + end + form=form.."checkbox[0,"..(at*1.5)..";lock_couples;"..attrans("Lock couples")..";"..(self.lock_couples and "true" or "false").."]" + if self:train() then --just in case + form=form.."field[0.5,"..(1.5+at*1.5)..";4,1;text_outside;"..attrans("Text displayed outside on train")..";"..(self:train().text_outside or "").."]" + form=form.."field[0.5,"..(2.5+at*1.5)..";4,1;text_inside;"..attrans("Text displayed inside train")..";"..(self:train().text_inside or "").."]" + end + form=form.."button_exit[0.5,"..(3+at*1.5)..";4,1;save;"..attrans("Save wagon properties").."]" + minetest.show_formspec(pname, "advtrains_prop_"..self.unique_id, form) +end +minetest.register_on_player_receive_fields(function(player, formname, fields) + return advtrains.pcall(function() + 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 + uid=string.match(formname, "^advtrains_seating_(.+)$") + if uid then + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then + local pname=player:get_player_name() + local no=wagon:get_seatno(pname) + if no then + if wagon.seat_groups then + wagon:seating_from_key_helper(pname, fields, no) + end + end + end + end + end + uid=string.match(formname, "^advtrains_prop_(.+)$") + if uid then + for _,wagon in pairs(minetest.luaentities) do + if wagon.is_wagon and wagon.initialized and wagon.unique_id==uid then + local pname=player:get_player_name() + if pname~=wagon.owner then + return true + end + if fields.save or not fields.quit then + for sgr,sgrdef in pairs(wagon.seat_groups) do + if fields["sgr_"..sgr] then + local fcont = fields["sgr_"..sgr] + wagon.seat_access[sgr] = fcont~="" and fcont or nil + end + end + if fields.lock_couples then + wagon.lock_couples = fields.lock_couples == "true" + end + if fields.text_outside then + if fields.text_outside~="" then + wagon:train().text_outside=fields.text_outside + else + wagon:train().text_outside=nil + end + end + if fields.text_inside then + if fields.text_inside~="" then + wagon:train().text_inside=fields.text_inside + else + wagon:train().text_inside=nil + end + end + + end + end + end + end + end) +end) +function wagon:seating_from_key_helper(pname, fields, no) + local sgr=self.seats[no].group + for _,access in ipairs(self.seat_groups[sgr].access_to) do + if fields["sgr_"..access] and self:check_seat_group_access(pname, access) then + for seatid, seatdef in ipairs(self.seats) do + if seatdef.group==access and not self.seatp[seatid] then + self:get_on(minetest.get_player_by_name(pname), seatid) + return + end + end + end + end + if fields.inv and self.has_inventory and self.get_inventory_formspec then + minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..self.unique_id, wagon:get_inventory_formspec(player:get_player_name())) + end + if fields.prop and self.owner==pname then + self:show_wagon_properties(pname) + end + if fields.dcwarn then + minetest.chat_send_player(pname, attrans("Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off!")) + end + if fields.off then + self:get_off(no) + end +end +function wagon:check_seat_group_access(pname, sgr) + if not self.seat_access then + return true + end + local sae=self.seat_access[sgr] + if not sae or sae=="" then + return true + end + for name in string.gmatch(sae, "%S+") do + if name==pname then + return true + end + end + return false +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 + +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) + return advtrains.pcall(function() + if not pointed_thing.type == "node" then + return + end + + + local node=minetest.get_node_or_nil(pointed_thing.under) + if not node then atprint("[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 + atprint("no track here, not placing.") + return itemstack + end + if not minetest.check_player_privs(placer, {train_place = true }) and minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + minetest.record_protection_violation(pointed_thing.under, placer:get_player_name()) + return + 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.add_entity(pointed_thing.under, "advtrains:"..sysname) + if not ob then + atprint("couldn't add_entity, aborting") + end + local le=ob:get_luaentity() + + le.owner=placer:get_player_name() + + local wagon_uid=le:init_new_instance(id, {}) + + advtrains.add_wagon_to_train(le, id) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + + end) + 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. +]] + + -- cgit v1.2.3