Commit Graph

483 Commits (master)

Author SHA1 Message Date
orwell96 2b21817b4f On_Joinplayer: fix train ID check for attachment update
Previously, statement was always false because train_id is no longer in the luaentity
2022-06-13 14:17:24 +02:00
orwell96 8beacdc508 Fix new wagon positioning when wheel positions are asymmetric, and remove leftover train.debug 2022-02-24 22:04:39 +01:00
orwell96 3cb21a80dc Wagons: Add two-pos wheel positioning logic for more realistic look of long wagons
Adds field "wheel_positions" in wagon definition
2022-02-09 23:06:02 +01:00
orwell96 ef8391a60d atc_reset(): Removed unused string parameter and also clear ATC autocouple flag (Cpl)
Fixes H#189 and H#190
2021-12-31 16:04:04 +01:00
Maverick2797 7db61e9890 Automatically group wagons and locomotives based on definition values
Based on the advtrains wiki groups:
  Type		Group			Classifier
- Locomotives:	group:at_loco		is_locomotive = true
- Controllable:	group:at_control	seat_groups.dstand
- Passengers:	group:at_pax		seat_groups.pass
- Freight:	group:at_freight	has_inventory = true
2021-12-29 21:17:34 +01:00
Y. Wang 5912f778e1 Fix speed sign allowing v>max_speed 2021-12-16 22:24:05 +01:00
ywang f27640ee27 Trivial fixup for train decoupling regression 2021-11-20 01:59:26 +01:00
orwell96 358bff47b2 Interlocking: Correct duplicate influence points semi-automatically
Searches and deletes duplicate influence points for the same signal when "Influence Point" formspec is opened.
2021-11-14 17:32:20 +01:00
Gabriel Pérez-Cerezo 3561a7bfa2 Add more unit tests, fix broken unit test 2021-11-09 21:56:41 +01:00
orwell96 45e18326e3 New-Ks: minor additions/corrections to ywang's work:
- Add sign for line speed 20 (else no way to return to max line speed once set)
- When no distant signal info available (default), Ks displays green light (2 sections free)
- Normal and wall signals again signal maximum speed (persistent restriction can be given via line speed nouw)
2021-11-08 22:52:28 +01:00
ywang 3f6cef7308 Add documentation on signal aspects 2021-11-07 19:01:45 +01:00
ywang 3c92fa597c Make train HUD check for existing speed restrictions 2021-11-07 14:06:50 +01:00
ywang be2f37a067 Support different types of speed restrictions; add documentation 2021-11-07 13:49:01 +01:00
orwell96 8a9f1389a5 On-Track Collision system: Fix train teleportation when using split_at_index() from LuaATC
Issue was that train thought it would collide with the newly added back portion although it was already long past this train. Added additional check that current train index is not further than the collision point.
2021-11-04 20:14:20 +01:00
orwell96 ae152bf5bb LuaATC: Add Mesecons LuaATC Controller (similar to Mesecons Luacontroller) 2021-11-02 23:15:16 +01:00
orwell96 4e80866ca6 Coupler types: Better output when there are no couplers on a wagon 2021-10-25 21:19:01 +02:00
orwell96 5f5d28af1b Coupling: Add concept of coupler types, allow coupling only when coupler types match 2021-10-25 21:08:42 +02:00
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 4989da3663 Disable position-based collision and coupling system for very short trains (such as single minecarts) to solve #155 2021-07-07 22:58:10 +02:00
orwell96 1f3a4c3bfc Rework train same-track collision system and deterministic coupling
- Adds a separate collision system for trains sharing a path
- Moved some coupling-related code to couple.lua and refactor it
- Handle coupling in a way that the initiating train always keeps its ID
- As a side effect, engine has its direction reversed after coupling
2021-07-07 22:42:14 +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 30f4e342fd Make the collision mode configurable
If the advtrains_forgiving_collision setting is set to true, then the
train only collides with nodes that do not have normal
drawtype. Otherwise the old behavior is restored. This change is being
made because there were users and mods relying on the old behavior,
such as the railroad_paraphernalia mod's track blocker.
2021-06-30 23:46:00 +02:00
orwell96 9b0ec771d7 Train-World collisions: Collide only with 'normal'-drawtype nodes.
As per discussion on the forum (https://forum.minetest.net/viewtopic.php?p=396745#p396745), changes the train-world collision logic to make trains only collide with nodes that are solid cubes.
This allows for more creative freedom, but shifts the responsibility of building realistic railways to the players.

In the future, a more sophisticated environment collision system might be invented, but this is low-priority and should be optional to save CPU.
2021-06-29 16:12:29 +02:00
orwell96 0efe7ef1f3 Entity Damage: Correct sign entity name
Reported by VanessaE
2021-06-29 16:01:10 +02:00
orwell96 e5b053c0d8 Trains splitting: retain important properties (door state, line, texts etc) 2021-05-22 19:42:15 +02:00
orwell96 e506086011 Serialization: strip trailing \r also in nodedb callback 2021-05-07 10:19:49 +02:00
orwell96 5aa700c3ab Deregister player from train on death in all cases (fixes #119) 2021-04-25 22:13:24 +02:00
orwell96 571a5cd19b Prevent splitting trains when they're off track (fixes #178) 2021-04-25 22:07:44 +02:00
orwell96 112e3ff255 Fix undeclared globals warnings (#176)
Reported by Vanessa Dannenberg
2021-04-25 21:54:51 +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 3dc6426e86 Remove sounds = default.sound_stone_defaults() as default is no longer a dependency 2021-04-04 19:48:35 +02:00
Blockhead 99e619a2e5 Make mesecons_switch a proper optional dependency (H#175) 2021-03-31 09:31:33 +02:00
hlqkj 5f2e40a08f Use mono font to ATC rail command fields 2021-03-22 11:06:18 +01:00
Blockhead 7e94650b8d Do not crash when operating signals without interlocking
The default set of signals were crashing when operated by right-clicking or
mesecons when advtrains_interlocking was not enabled.
2021-03-22 10:51:03 +01:00
orwell96 682ff59906 Replace deprecated depends.txt's by mod.conf and organize dependencies consistently, add modpack.conf 2021-03-13 11:13:13 +01:00
orwell96 b2d7bbb2c5 Signal influence points: Make sure to clear on removal of signal, clear orphaned when digging rail 2021-03-12 17:56:07 +01:00
orwell96 2dcf60dec6 Track can-dig check: also notify user when digging is not allowed 2021-03-12 17:30:50 +01:00
orwell96 30076f5ce3 Add some missing craft recipes
- LuaATC remains non-craftable for now (elevated privs necessary anyway)
- Some crafts altered from dario's proposal

Co-authored-by: W3RQ01 <dario23@linux-forks.de>
2021-02-19 18:46:03 +01:00
orwell96 0bffd6ca64 Make DTIME_LIMIT and SAVE_INTERVAL globally accessible 2021-02-15 19:41:13 +01:00
orwell96 737eb4987f LZB: Look ahead before movement, not after 2021-02-12 11:55:57 +01:00
orwell96 b65d99aa2c Don't try to invalidate_ahead when path has been regularily invalidated before 2021-02-10 21:41:05 +01:00
orwell96 0a9cb548d7 Prevent calling approach callbacks during routesetting
interlocking.set_route() was updating the signal aspect, which caused LZB's invalidate_ahead callback to run, although the route isn't yet fully set. Don't look ahead at this point, but instead in the next train step.
2021-02-10 20:55:20 +01:00
orwell96 96bb7d5e7e LZB: don't look ahead past red signal 2021-02-10 18:27:09 +01:00
orwell96 0859e50c6e Fix manual train control 2021-02-10 18:26:53 +01:00
orwell96 17e29a2511 Make anti-LZB-flicker system work after rebase onto hud redesign 2021-02-10 17:07:38 +01:00
orwell96 fad6f88bab Fix hud and trainlogic to work together 2021-02-10 16:45:29 +01:00
orwell96 556e0782f7 Replace deprecated object:getxxx()/setxxx() by get_xxx()/set_xxx() 2021-02-10 16:42:15 +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