Commit Graph

624 Commits

Author SHA1 Message Date
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
techniX 74bf177cc8 optimize path_get_index_by_offset
Instead of calling path_get_adjacent twice (which calls path_get
twice, i.e. 4 times overall), we call path_get directly only 2 times
with min and max indices to generate all the path we need for
calculations.
2020-07-10 12:02:23 +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
Blockhead 96236c04dc Add perpendicular and 45/90 degree crossing rails
Add a set of new models for crossings to make some new track
arrangements possible. This commit adds perpendicular crossigns that can
be rotated at any angle: 30/45/60/90 and 45/90 degree crossings in two
rotations. In future, further crossing types can be added to the blender
file.

Add the blender file in rail_crossings.blend that is the source of these
files and which refers to the texture inside advtrains_train_track.

Add a set of prototypes for rail crossings to advtrains/tracks.lua and
register the new crossings in advtrains_train_track.
2020-07-06 17:32:22 +02:00
Gabriel Pérez-Cerezo 2a0c55099e fix typo in luaautomation 2020-07-02 14:45:38 +02:00
Blockhead eb2e5f4cdf Fix access control to wagon properties
Previously, players were able to open the wagon properties of any wagon at all
through the wagon properties button on the inventory formspec and through the
wagon buttons on the onboard computer. Add a check for ownership before
allowing players to open wagon properties.
2020-06-29 01:37:35 +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
Gabriel Pérez-Cerezo f458f39fde comment out annoying debug info 2020-06-14 12:24:30 +02:00
Gabriel Pérez-Cerezo 51c0920bc0 Merge branch 'master' of bananach.space:advtrains 2020-06-14 12:04:13 +02:00
Gabriel Pérez-Cerezo ae79af604c display oncoming lzb speed restrictions in HUD 2020-06-14 12:02:48 +02:00
orwell96 b13c725976 Workaround to handle split points (dt. aufgefahrene Weichen), fixing H#77 2020-06-10 20:56:35 +02:00
Gabriel Pérez-Cerezo d61c2145a0 Merge branch 'wagon_prop_formspec' of https://github.com/Montandalar/advtrains 2020-06-08 13:50:08 +02:00
Gabriel Pérez-Cerezo 15be500662 document shunting mode, add unset_shunt to luaatc 2020-06-08 13:42:24 +02:00
Gabriel Pérez-Cerezo 943e5208a9 Fix trains flipping when autocoupling 2020-06-08 00:25:29 +02:00
orwell96 657446e163 Fix minetest.after() loop between ARS->update_route->update_signal_aspect->invalidate_path 2020-06-05 13:48:12 +02:00
Blockhead e57c1eaa7f Remove debugging print statement 2020-04-12 18:44:57 +10:00
Blockhead f43254c282 Add road numbers to wagon properties, bordcom
A road number is used to allow users to set their own wagon numbers
other than the internal IDs assigned by advtrains. A railway company
would typically keep a roster of what rollingstock it has in road
numbers.

The road number can be set on the wagon properties formspec. It is
displayed above the wagon's inventory icon in the onboard computer as a
button, which will then open the wagon properties on that wagon.

Road numbers might be displayable as additional text entities on the
wagon like signs.

Currently opening the wagon properties (and sometimes onboard computer)
formspecs can be quite unreliable (at least on windows), so I hope that
closing the wagon 'main menu' before opening other formspecs helps that
reliability. It seems to be an upstream bug.
2020-04-07 14:16:47 +10:00
Blockhead d0629469aa Show the wagon properties button only to the owner 2020-03-18 01:13:06 +11:00
Blockhead 2da11c5a49 Use a standard wagon inventory formspec
This new formspec also allows access to the wagon properties. Once
whitelisted in the wagon properties, other players can access its
inventory.

Note on 'useless use' of OO: I tried passing just the wagon ID and
avoiding using the `self` object in order to bypass the need to look up
the lua entitie out of the list, but it ended up retrieving nil data.
The best way to solve this overhead might be to wait for some kind of
better way upstream in minetest's lua API to get entities, or to keep a
central record of entities. Either way, the solution is outside the
scope of this commit.
2020-03-18 00:35:30 +11:00
Gabriel Pérez-Cerezo fb837a449a Merge branch 'diagonal_platforms' of https://github.com/Montandalar/advtrains 2020-03-15 12:04:10 +01:00
Blockhead 301dcf953e Reduce the profile of the platforms by 0.1
Currently some trains clip the platform (especially E231
modpack), but they won't after the platform edge is moved
back slightly.
2020-03-15 21:56:42 +11:00
Blockhead 09fda4ffaa Add 45 degree diagonal platforms with a mesh 2020-03-15 21:51:38 +11:00
orwell96 372cd7eb80 Get rid of the "Subway Train" item (was an ugly hack anyways, and is obsolete now) 2020-03-08 18:50:04 +01:00
Blockhead 3b87ac5372 Delete train if it ends up off track, show a warning 2020-03-03 23:00:20 +11:00
Blockhead 0689c70aac Save clipboard on item metadata
Also a minor user feedback text cleanup
2020-03-03 23:00:20 +11:00
Blockhead 8a08d77166 Remove debugging print statements 2020-03-03 23:00:20 +11: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
orwell96 dbaafeda3e Merge branch 'mt5-fixes' 2020-01-04 18:37:52 +01:00
Blockhead c0c6fcf00b Apply minetest.formspec_escape() to prevent formspec injection (H#143) 2020-01-04 18:33:57 +01:00
orwell96 b905a8bf6d Remove fullbright (H#140) 2019-12-18 10:08:03 +01:00
orwell96 50a81dd1f3 Fix RWT initialization when creating new world (H#142) 2019-12-18 10:01:47 +01:00
orwell96 d123679b3c Do not set infotext on Ks signal aspect change
Possible migitation for Linuxworks RAM explosion
2019-12-14 22:26:04 +01:00
orwell96 a8ae0a5332 Simplify and optimize path_get_index_by_offset (cherrypicked) 2019-12-09 11:00:21 +01:00
orwell96 02025f53aa Move attachment positions down 1 node 2019-12-05 10:15:54 +01:00
Gabriel Pérez-Cerezo 9c1d356505 Add inverse ARS rules
!RC foo
!LN bar

will match all trains except those matching RC foo or LN bar. This can
be useful to exclude one specific service from a component.
2019-12-05 00:08:43 +01:00
orwell96 8d794525b3 Fix repeated log file opening/closing (H#136) 2019-12-04 10:09:19 +01:00
orwell96 e0662b2971 use group:wood in bumper recipe (H#120) 2019-12-04 10:09:19 +01:00
Gabriel Pérez-Cerezo 3db3f24857 Tentative fix for #31
This might fix #31 by clearing the HUD entry for the player when
joining
2019-12-03 21:35:42 +01:00
Gabriel Pérez-Cerezo 25a335203f Allow painting coupled wagons 2019-12-01 12:25:06 +01:00
Gabriel Pérez-Cerezo 0518fbbf3a Merge branch 'master' of https://git.bananach.space/advtrains 2019-12-01 12:09:04 +01:00
Gabriel Pérez-Cerezo b71c72b4ab Add experimental liveries feature
Please do not use this in your train mods yet, this may be subject to
changes!
2019-12-01 12:08:28 +01:00
ywang 2157a7ef36 Simplify formula for brake distance calculation 2019-11-27 10:37:25 +01:00
ywang 35a6f14561 Fix steam engine sound playing forever (H#121) 2019-11-27 10:23:05 +01:00
orwell96 7082038f75 Don't spawn couple entities when not loaded 2019-11-26 16:43:47 +01:00
orwell96 cf2179dea5 remove obsolete code/comments 2019-11-26 16:01:51 +01:00
orwell96 4ff8e05755 Fix trains not stopping when colliding with environment H#122 2019-11-26 15:49:36 +01:00
Gabriel Pérez-Cerezo ca4d65050c Add wagon_width attribute
This allows for wider vehicles than trains, such as boats to discharge
the passengers onto the platforms.
2019-11-22 20:29:57 +01:00