Commit Graph

67 Commits (5c2534cc35bc0fc47b53c8a992e3e71b15a60ec4)

Author SHA1 Message Date
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
orwell96 1a64e96ae9 Complete Track Section handling, incl. removing tcb's and marker entities 2018-06-26 10:46:40 +02:00
orwell96 e1ebbff23c Add track section concept and rework TCB design, implement new linking behavior 2018-06-21 20:34:20 +02:00
orwell96 08ac0f9c05 Check for inventory existence before serializing, and do not create it again if it already exists. 2018-06-19 19:49:24 +02:00
orwell96 a961e7f672 Fix box wagon inventory serialization and make box wagons protected. 2018-06-14 22:25:54 +02:00
orwell96 3d7924c751 Fix bugs found while testing 2018-06-14 17:39:42 +02:00
orwell96 2a76d4a960 Fix final bugs and to-do's (u.a.save/load system) 2018-06-14 17:39:42 +02:00
orwell96 254c32e304 Fix yaw calculations, track placement orientation and speed up direction lookup functions 2018-06-14 17:39:42 +02:00
orwell96 5dca155333 Implement collisions. (does not work yet, still code errors) 2018-06-14 17:39:42 +02:00
orwell96 caf2bda7bc Fix path_dir to actually be an angle, path item deletion and orientation of wagons
The occupation system as it is now will change. For each position, I will save the index in the train's path,
and implement a callback system. I need this because the occupation window system will not be enough to cover all use cases
(e.g. to make a train stop with it's center or back at a certain position, I need 3 different brake distances, which doesn't fit into the scheme)
2018-06-14 17:39:42 +02:00
orwell96 139a26fccc Bugfixes part 1
There's something wrong with the new paths, next time build a path validity checker to trace the issue
2018-06-14 17:39:42 +02:00
orwell96 3420a1a912 Restructure path system
The changes to the path system have not yet been integrated...
2018-06-14 17:39:42 +02:00
Gabriel Pérez-Cerezo 38d10acca2
Merge branch 'master' of https://github.com/orwell96/advtrains 2018-06-10 17:30:50 +02:00
orwell96 8b576357ef Rework the privilege system completely
See privilege_guide.txt for information
2018-03-14 20:57:07 +01:00