Commit Graph

713 Commits (114b915518190e112c7aa8f94a86f3e19660bd6e)

Author SHA1 Message Date
Blockhead 8d58bd51cd Workaround to destroy looping sounds
Needed for linetrack boat sound bug
2020-11-02 12:12:41 +01:00
Blockhead b616ae4425 Add missing recipe: 45_low platforms 2020-10-19 16:13:02 +02:00
Gabriel Pérez-Cerezo 964b0a7ab6 Remove couple entities when out of range from players
Work around the entity flood bug caused by improper engine handling of
static_save=false
2020-10-12 15:41:27 +02:00
Gabriel Pérez-Cerezo dcf5b8670e Remove last files with CR-LF line endings. 2020-10-11 12:36:06 +02:00
Blockhead 2ecd474ed7 Fix 3-way conns table so traverser doesn't complain
The remaining patch to make advtrains master stable: we can't have any conns
entries without a 'c' member, so make all ["3"] entries into just ["c"] entries.
2020-10-11 12:28:41 +02:00
orwell96 3256c2778d Forbid track modification when train, IP or TCB is on it, better handle removing of TCBs (H#149) 2020-10-07 17:20:47 +02:00
orwell96 a73236d7eb Don't allow wagons with non-empty inventories to be destroyed (H#164) 2020-10-07 15:19:55 +02:00
orwell96 d89b8b1c89 Fix schedule_in() crash when RWT is not in number format (H#159) 2020-10-07 14:54:04 +02:00
orwell96 b892d793ac Add windows compatibility in nodedb saving (H#153)
Note: it does not simply add os.delete()  but reverts to the "old" behavior of directly overwriting the file, because this did work before.
2020-10-07 14:41:57 +02:00
Gabriel Pérez-Cerezo 1a743c2dd6 Fix manual switching on regular track switches. 2020-09-14 16:51:43 +02:00
Blockhead 61009bf00d Fix issues introduced by changes to switching
The code I wrote worked only for my y-turnout and 3-way variants because
it assumed the variant name == the switching state, which is obviously
wrong for the default sw(l|r)(st|cr) variants. I have added a
'switchprefix' property to address this.
2020-09-14 19:59:15 +10:00
Blockhead 487ca4e38c Enable three-way turnouts with proper conns support on all sides
I chose to make three-way turnouts have 5 conns (last one is not used) so
that they can be distinguished from crossings easily without refactoring the
code. Three-ways should have their last entry with {["3"]=0} instead as a sort
of internal mark.
2020-09-11 17:19:23 +10:00
Blockhead 1d224d6b4c Add 3-way turnouts and y-turnouts (both diverging) 2020-09-11 04:25:38 +10:00
Blockhead 7879a0a215 Make the models for Y and three-way turnouts 2020-09-11 04:24:36 +10:00
Gabriel Pérez-Cerezo 606fc83465 localize split function to prevent conflicts with the builtin one 2020-09-04 20:25:12 +02:00
orwell96 0aa83e4932 Escape fields in wagon properties (H#158) 2020-09-04 16:15:27 +02:00
Linus Jahn 00be2b5b5f tcb: Fix crash when player is nil 2020-09-01 15:20:15 +02:00
Relatio e4ccf8ffce Fix seating_from_key_helper: use pname instead of player:get_player_name() 2020-08-27 19:18:52 +02:00
Blockhead 595f26b450 Deprecate old 4590 crossings
This is done with a task that runs once when the nodedb is loaded. A new
field of advtrains_ndb will keep a version integer to indicate migration
versions. This introduces verson 1, no version being equivalent to 0.
An LBM is also registered to replace the tracks in the world.
2020-08-21 16:02:02 +02:00
Blockhead b707f20ba2 Add two new sets of diamond crossing types
Add two new sets of diamond crossings in addition to the current set
of perpendicular crossings. Also cleans up the inside edges on the
perpendicular set models. All of these varieties have their mirror
images, which was previously a problem with the 45/90 crossing.

The naming convention for all of these rail types is this: when facing
east and param2=0, the angle and direction of the two crossing rails is
indicated. So 30l45r means 30 degrees left and 45 degrees right. The
mirror image of that would be 30r45l.

There is a recipe for each set of crossing types and the trackworker can
change geometry within types with left cick, and rotate between two 90
degree rotations with right-click. When left-clicking, the angles move
in an intuitive fashion like rotating rails.

* The perpendicular set (already existing) has rails that cross at 90
degrees.
* The 90+x set has 90 degree (straight, node aligned) rails plus a rail
intersecting that at 30, 45 or 60 degrees.
* The diagonal set has both rails not axis-aligned, for example 30r-45l,
60l60r. The latter is quite useful for scissors crossovers.
2020-08-21 16:02:02 +02:00
Blockhead b75752a3e0 Add models for all diamond crossing varieties to .blend
This was actually 34 individual commits over the course of a month but
is best to leave as one commit. It is also now a compressed .blend file
(an option available inside blender).
2020-08-21 16:02:02 +02:00
Gabriel Pérez-Cerezo b23d346ace add maximum length parameter to split_at_fc and split_off_locomotive 2020-08-21 15:58:12 +02:00
Gabriel Pérez-Cerezo 36d8c8b716 Add command to split off locomotive 2020-07-28 20:39:35 +02:00
Gabriel Pérez-Cerezo c7ea09ed59 Complete Documentation on return value of split_at_fc() 2020-07-28 20:10:08 +02:00
Gabriel Pérez-Cerezo 3b9b884988 Document new luaatc commands 2020-07-28 12:00:27 +02:00
Gabriel Pérez-Cerezo 549db4737f add train_length command to luaatc 2020-07-27 21:50:22 +02:00
Gabriel Pérez-Cerezo 45413ee5c0 Add function to step through freight codes 2020-07-26 23:30:07 +02:00
Gabriel Pérez-Cerezo c54e0b341a add split_train_at_fc luaatc command
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.
2020-07-26 23:30:07 +02:00
Gabriel Pérez-Cerezo de8add139c add Freightcodes to wagon properties formspec 2020-07-26 23:30:07 +02:00
orwell96 00031064a5 Do not unload wagons when a player that is logged in sits in it 2020-07-26 18:53:16 +02:00
Blockhead d65ba80df7 Add low 45 degree platforms
I would like to take this opportunity to credit Och_Noe as the original
author for the plans to the 45 degree platform model. I failed to credit
him properly when the first lot of 45 degree platforms were added.
2020-07-25 19:14:57 +02:00
Hume2 643d69db9c subway trains: display up to two digits
Additionally, as an addition by gpcf, trains having an S as the first
letter of their LN get the number behind the S displayed as a line
number
2020-07-25 19:07:02 +02:00
Gabriel Pérez-Cerezo 7e83b718a6 Merge branch 'master' of bananach.space:advtrains 2020-07-24 11:25:37 +02:00
orwell96 3c9215f037 DISCARD ON MERGE!: Temporary compatibility fix: translate signal aspects back to old format if they are in the new format, to allow reverting from new_lzb 2020-07-23 19:28:46 +02:00
Gabriel Pérez-Cerezo 9d52770f21 Add client side translations by ywang 2020-07-19 23:04:13 +02:00
Gabriel Pérez-Cerezo 8c66f1caf4 Fix error in workaround causing train entities to despawn. 2020-07-19 23:00:07 +02:00
Gabriel Pérez-Cerezo 7de2a9142f Merge branch 'master' of bananach.space:advtrains 2020-07-19 22:57:29 +02: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
Blockhead 3040c53413 Move recipes to train_track and add crossing recipes 2020-07-10 22:14:39 +02:00
Blockhead ad49854fed Make using the default tracks optional, even in submods
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.
2020-07-10 22:14:39 +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