Commit Graph

80 Commits (e7d0a5fac2d87b468199059f1dd5bffb8bbcb327)

Author SHA1 Message Date
orwell96 e7d0a5fac2 Train Coupling: Change behavior so that train direction of initiating train is kept, add ATC Cpl command 2021-10-25 21:04:45 +02:00
orwell96 c623a33860 Shutdown callback: don't save advtrains save files when MT crashed within advtrains's main step 2021-07-07 22:42:14 +02:00
Gabriel Pérez-Cerezo 9dd0313b71 Add /at_whereis command to check the position of a train. 2021-04-10 12:26:47 +02:00
orwell96 0bffd6ca64 Make DTIME_LIMIT and SAVE_INTERVAL globally accessible 2021-02-15 19:41:13 +01:00
orwell96 1b8a3dfaf2 Add save interval setting, fix accidental global variable, at_sync_ndb on server priv not limited, timetaking for restore_all 2021-02-10 16:42:15 +01:00
orwell96 56fe578916 Log how long saving takes 2021-02-10 16:39:46 +01:00
orwell96 080fbcf2fc Make dtime limiting a setting 2021-02-10 16:39:46 +01:00
orwell96 672b4a422c Remove debug facilities 2021-02-10 16:39:46 +01:00
orwell96 0cef88ba7f Add global slowdown factor instead of hard dtime limiting 2021-02-10 16:39:46 +01:00
orwell96 8f4c90c5a5 Add debug prints, modify LZB to fix problems with look_ahead 2021-02-10 16:39:46 +01:00
orwell96 080b8fb273 Add IGNORE_WORLD mode to test using only the advtrains save data 2021-02-10 16:39:45 +01:00
orwell96 573d6b06b2 Always do zero-barrier check and prevent LZB 0 overruns in movement logic 2021-02-10 16:36:24 +01:00
orwell96 8660794ef8 Fix lots of things around new LZB 2021-02-10 16:36:24 +01:00
orwell96 5c2534cc35 Remove pcall wrappers completely, add command to disable advtrains mainloop 2021-02-10 16:36:24 +01:00
orwell96 b59b0d587d Implement a LZB speed lookup table for the path and rewrite velocity controls 2021-02-10 16:35:45 +01:00
orwell96 816245588d Disable ARS train flag and surrounding uses 2021-02-10 16:35:45 +01:00
orwell96 0ba5874b4f Some more serializer fixes (backported from new_lzb):
- Move DUMP_DEBUG_SAVE block before the actual saving so it can be used to trace serializer errors
- Don't crash on functions in data, ignore them silently
- Increase the save interval
2021-01-12 13:31:03 +01:00
orwell96 ce4631dbee Backport ndb format from cellworld to also store the cids in the ndb file; integrate ndb in serialize_lib atomic system 2021-01-12 13:27:00 +01:00
orwell96 e42fbf9dcc Make advtrains use serialize_lib (save version 4)
Old save format will be gracefully migrated
2021-01-12 13:27:00 +01:00
orwell96 bdc49b919d DUMP_DEBUG_SAVE also dumps interlocking data 2021-01-12 13:27:00 +01:00
ywang cc78b63e34 [BREAKING] Use client-side translations instead of intllib; add zh_CN translations
* Client-side translations is used instead of intllib. [Breaks MT4 compat]
* Existing locale files have been moved to advtrains/locale and named with the format advtrains.[lang].tr
* Add zh_CN locale. (requires a font that supports CJK text)
2020-07-19 16:21:08 +02:00
orwell96 19509acf56 Add workaround to unload wagons that are too far away from players 2020-07-12 20:37:51 +02:00
orwell96 f33bb563e7 Add "Fallback state" for freed routes, move p_mesecon_iface.lua to core 2020-07-07 14:25:47 +02:00
Gabriel Pérez-Cerezo 0b14d8ddb1 Add autocouple mode
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.
2020-06-29 01:30:27 +02:00
orwell96 b13c725976 Workaround to handle split points (dt. aufgefahrene Weichen), fixing H#77 2020-06-10 20:56:35 +02:00
Blockhead 378d862572 Draft copy tool
The copy tool copies a train to a global clipboard.  It copies
the Line number, Routing code, inside text and outside text.
It copies the kinds of wagons in the train and whether they
are flipped around.

Pasting with the copy tool will conditionally flip the train
such that 'your front' of the train, rather than the absolute
front of the train, is what is output. The new train is
oriented to travel forward with the placing player's view.

Conditons are:
- Multi-unit/push-pull train (= has locomotives on both ends):
  Never flipped
- Locomotive-hauled train (= has one end with a locomotive):
  Flipped so that the locomotive is always at the front. If the
  locomotive points long hood forward, it will still point long
  hood forward.
- Rake of wagons (= has no locomotives on ends):
  Flipped according to which end of the train the player copies
  from. If the player is towards the back (wagon out of train
  divded by total wagons > 0.5), then the back becomes the new
  front. If the player is towards the front, no change.
2020-03-03 23:00:20 +11:00
orwell96 9d7b21c451 Relicense under AGPLv3 and update information in readme.txt 2020-02-15 22:19:22 +01:00
orwell96 1bb1d825f4 Use minetest.safe_file_write() to atomically save state [Breaks MT4 compat] 2020-01-10 14:08:56 +01:00
Gabriel Pérez-Cerezo 95fb122eca New version 3 save system.
This new save system exists to split up the save file into several
smaller ones, to bypass lua limitations.
2019-07-23 20:15:37 +02:00
Gabriel Pérez-Cerezo 7a6740eb8c Keep a backup file where stuff is written to when saving
This should prevent yet another train service disaster.
2019-07-16 17:17:18 +02:00
orwell96 24e56dbfc2 Railway Time: Basic time counter and utility functions 2019-06-19 09:56:30 +02:00
orwell96 ea33ad9de0 Move LZB system to core and unify approach callback mechanism 2019-04-16 09:16:44 +02:00
orwell96 1227456d46 Ugly workaround for green signals bug 2019-03-15 17:39:31 +01:00
orwell96 9da148347d Basic functions of "stop rail", missing ARS rules and signal.
For signal, need to think of a callback system for signals and moving atlatc queue to core?
2019-01-24 17:50:26 +01:00
orwell96 1c3ea96041 Possible fix for braking problems + debug outputs 2019-01-23 15:37:18 +01:00
orwell96 c3c96274be Add "routingcode" property
Used for ARS and stop points
2019-01-09 16:10:56 +01:00
orwell96 c3c5431412 Shunt signals (not exactly Ks), along with fixes in other components that those rely on 2018-12-08 17:12:57 +01:00
orwell96 ec68eaa229 Added on_train_approach callback, non-permanent external LZB brakepoints and basis for "stop rails"
Stop rails ATM use the aforementioned things to add a pointwise "2" speed restriction. Seems to work.
2018-11-29 17:52:56 +01:00
orwell96 5874a6d3f4 Fix protection regarding tracks (track_builder and railway_operator) and documentation on privileges 2018-11-12 22:24:56 +01:00
orwell96 07fa21f992 Increase savefile version to 2
(Master downgrade protection)
2018-11-10 22:53:12 +01:00
orwell96 b872bdae82 Remove "couple locks" and apply protection to the actual coupling process, and fix permissions on that 2018-11-10 12:12:52 +01:00
orwell96 60b7254992 atdump() to treat certain values special 2018-10-29 19:32:43 +01:00
orwell96 11fe530e18 Properly handle speed restrictions 2018-10-10 23:31:12 +02:00
orwell96 33c839b40d Add signal safety control override, restructure control system 2018-10-10 21:49:52 +02:00
orwell96 8df7bcf6b6 Improve route programming:
- Formspec for TCBs instead of unhandy chatcommands
- Ability to advance route over the next secction without punching end
- Better visualization
- Ability to route into dead-end sections
2018-10-07 22:21:49 +02:00
orwell96 2596866b74 Add interlocking guide/manual, silence debug outputs 2018-09-14 21:36:59 +02:00
orwell96 05cb6090ac Move passive API to the advtrains core
to remove dependency of interlocking on luaautomation
2018-08-16 19:18:03 +02:00
Gabriel Pérez-Cerezo ffc3cf9d10 Remove redundant digtron.lua file 2018-08-12 17:51:09 +02:00
orwell96 6cdb47edd2 Add routesetting callbacks.
Now, only the signal aspect setting is still missing
2018-08-12 13:23:36 +02:00
orwell96 820503ba81 Implement trains blocking sections 2018-06-29 16:16:55 +02:00