aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation
Commit message (Collapse)AuthorAge
* readme atc_set_ars_disable typoMaverick27972021-11-09
|
* split_at_index where index=1Maverick27972021-11-08
| | | | | Splitting at index=1 results in multiple empty trains being created. Can be prevented by an atc_speed > 0 check by the user, but easier just to return false and do nothing.
* LuaATC: remove accidental mesecons hard-dependencyorwell962021-11-04
|
* LuaATC: Fix position of error label, use consistent name "LuaATC" instead of ↵orwell962021-11-02
| | | | "LuaAutomation"
* LuaATC: Add Mesecons LuaATC Controller (similar to Mesecons Luacontroller)orwell962021-11-02
|
* LuaATC PCNaming: Allow naming active components using the toolorwell962021-11-02
|
* Hopefully fix #177orwell962021-04-25
|
* Fix undeclared globals warnings (#176)orwell962021-04-25
| | | | Reported by Vanessa Dannenberg
* Increase size of LuaATC code input forms to 15x12 unitsorwell962021-03-22
| | | | | The current size of the code form is rather limiting as it fills only a small part of the screen. Also adds global constant in init.lua so this can easily adapted in the future
* Remove "Last punched" from LuaATC init code fshlqkj2021-03-22
| | | | | Also removed the now-dead last punch pos helper code. Resized buttons accordinghly.
* Rework active_common formspec layouthlqkj2021-03-22
| | | | | | - Aligned stuff - Added style to use monospaced font in the code editor textarea - Added label to the environment dropdown
* Rework envsetup formspec layouthlqkj2021-03-22
| | | | | - Aligned stuff - Added style to use monospaced font in the code editor textarea
* Replace deprecated depends.txt's by mod.conf and organize dependencies ↵orwell962021-03-13
| | | | consistently, add modpack.conf
* LuaATC: add sending atc command to train by ID, and getters for in/out text ↵orwell962021-03-02
| | | | (solves #124 and #166)
* LuaATC: add interrupt_safe() and clear_interrupts(), fix queue mainlooporwell962021-02-17
|
* LuaATC: Improve error/print logging, log only to subscribed playersorwell962021-02-17
|
* Clean up structure of atlatc README.md after rebaseorwell962021-02-17
|
* Updated atlac readme to consistently use Markdown formattingMaverick27972021-02-17
|
* Restore LuaATC autocouple interface accidentally lost in 74a2199orwell962021-02-15
| | | | During rebase, this part of the autocouple feature must have been accidentally lost
* luaatc: Train event: also remember arrow connection in enter callback, ↵orwell962021-02-10
| | | | remove obsolete code
* luaatc: don't fail train event when train has already passed the rail at ↵orwell962021-02-10
| | | | event time
* Add debug prints, modify LZB to fix problems with look_aheadorwell962021-02-10
|
* Fix things, rework signal aspect select dialog, transform old aspects on-the-flyorwell962021-02-10
|
* Simplify Signal Aspect Table (H#132) [breaks compatibility with signal API]orwell962021-02-10
|
* Fix lots of things around new LZBorwell962021-02-10
|
* Disable ARS train flag and surrounding usesorwell962021-02-10
|
* Add approach callback mechanism to LuaATCorwell962021-02-10
|
* Make is_node_loaded() checks also for mesecon interactions and ↵orwell962021-02-04
| | | | digiline_send(), move on_updated_from_nodedb to advtrains table
* Discard get_node_or_nil() for area-loaded check and use either a ↵orwell962021-02-03
| | | | | | distance-based approach or minetest.is_block_active() if available See also https://github.com/minetest/minetest/pull/10897
* Make advtrains use serialize_lib (save version 4)orwell962021-01-12
| | | | Old save format will be gracefully migrated
* add maximum length parameter to split_at_fc and split_off_locomotiveGabriel Pérez-Cerezo2020-08-21
|
* Add command to split off locomotiveGabriel Pérez-Cerezo2020-07-28
|
* Complete Documentation on return value of split_at_fc()Gabriel Pérez-Cerezo2020-07-28
|
* Document new luaatc commandsGabriel Pérez-Cerezo2020-07-28
|
* add train_length command to luaatcGabriel Pérez-Cerezo2020-07-27
|
* Add function to step through freight codesGabriel Pérez-Cerezo2020-07-26
|
* add split_train_at_fc luaatc commandGabriel Pérez-Cerezo2020-07-26
| | | | | | This command splits the train at the second non-empty FC it encounters, taking with it the first few freight cars that all go to the same destination.
* Make using the default tracks optional, even in submodsBlockhead2020-07-10
| | | | | | | | | | If advtrains_train_track is disabled, don't register any tracks that use its model like the LuaATC automation rail, point speed restriction rail, station/stop rail. For LuaATC, the definition for firing an event when a train runs over the rail needs to be moved into the common defs so that other mods like linetrack can use that as an interface.
* Add "Fallback state" for freed routes, move p_mesecon_iface.lua to coreorwell962020-07-07
|
* fix typo in luaautomationGabriel Pérez-Cerezo2020-07-02
|
* Add autocouple modeGabriel Pérez-Cerezo2020-06-29
| | | | | | | The shunting mode no longer makes trains couple, since it was meant for other purposes. For autocoupling, the new autocoupling mode is used. If trains are in autocouple mode, they couple when they collide with another train.
* document shunting mode, add unset_shunt to luaatcGabriel Pérez-Cerezo2020-06-08
|
* Apply minetest.formspec_escape() to prevent formspec injection (H#143)MT0.4Blockhead2020-01-04
|
* Fix RWT initialization when creating new world (H#142)orwell962019-12-18
|
* Fix scheduler crash (H#133)orwell962019-11-21
| | | | for loops don't work with manipulating i
* Add "discard all" function to scheduler events and use it to clear schedules ↵orwell962019-11-06
| | | | in luaatc rails
* atlatc: fix operation panel not in ndb, add warning when node is not found ↵orwell962019-11-06
| | | | on queue run
* Add lines scheduler for reliable railway-time scheduling(which is also safer ↵orwell962019-08-26
| | | | than the atlatc scheduler) and document new atlatc functions
* Shunting mode now couples trains on collision.Gabriel Pérez-Cerezo2019-08-11
| | | | Trains now get coupled when one of them is in coupling mode.
* Document luaatc decouplingGabriel Pérez-Cerezo2019-08-11
|
n class="hl opt">.param1 .. "," .. node.param2) advtrains.ndb.swap_node(pos, { name="advtrains:dtrack_xing90plusx_45l", param1=node.param1, param2=node.param2, }) end }) -- This will replace any items left in the inventory minetest.register_alias("advtrains:dtrack_xing4590_placer", "advtrains:dtrack_xing90plusx_placer") -- Diagonal -- This set of rail crossings is named based on the angle of each intersecting -- direction when facing east and param2=0. Rails with l/r swapped are mirror -- images. For example, 30r45l is the mirror image of 30l45r. advtrains.register_tracks("default", { nodename_prefix="advtrains:dtrack_xingdiag", texture_prefix="advtrains_dtrack_xingdiag", models_prefix="advtrains_dtrack_xingdiag", models_suffix=".obj", shared_texture="advtrains_dtrack_shared.png", description=attrans("Diagonal Diamond Crossing Track"), formats = {}, }, advtrains.ap.t_diagonalcrossing) minetest.register_craft({ output = 'advtrains:dtrack_xingdiag_placer 2', recipe = { {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}, {'', 'advtrains:dtrack_placer', ''}, {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'} } }) ---- Not included: very shallow crossings like (30/60)+45. ---- At an angle of only 18.4 degrees, the models would not ---- translate well to a block game. -- END crossings --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}}, }, advtrains.ap.t_30deg_slope) minetest.register_craft({ type = "shapeless", output = 'advtrains:dtrack_slopeplacer 2', recipe = { "advtrains:dtrack_placer", "advtrains:dtrack_placer", "default:gravel", }, }) --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={}, }, advtrains.ap.t_30deg_straightonly) minetest.register_craft({ output = 'advtrains:dtrack_bumper_placer 2', recipe = { {'group:wood', 'dye:red'}, {'default:steel_ingot', 'default:steel_ingot'}, {'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, }, }) --legacy bumpers for _,rot in ipairs({"", "_30", "_45", "_60"}) do minetest.register_alias("advtrains:dtrack_bumper"..rot, "advtrains:dtrack_bumper_st"..rot) end -- atc track 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 = advtrains.atc_function }, advtrains.trackpresets.t_30deg_straightonly) -- Tracks for loading and unloading trains -- Copyright (C) 2017 Gabriel Pérez-Cerezo <gabriel@gpcf.eu> 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 and i:get_list("box") 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