Commit Graph

839 Commits

Author SHA1 Message Date
orwell96 2d7640d424 Occupation system: store multiple indices for the same train, introduce reverse_lookup_sel() to select appropriate index out of multiple based on a heuristic 2023-06-24 14:37:52 +02:00
orwell96 283efc44ce Add function to get wagon in train from index
Can be used to determine which wagon is at a certain world position
Testing: use debugitems.lua
2023-05-27 12:09:10 +02:00
Maverick2797 bbe3856e35 Add craft recipes for the new ks speed indicators 2023-04-12 22:07:13 +02:00
Blockhead 793210f7c2 Make selection boxes of track nodes larger
This reduces the difficulty of having to point at the centre of the
correct track node, and hopefully does not prevent placing tracks in
more than a couple of cases.  Three-way turnouts on an angle may be
an exception but they may be worth it. User feedback is needed.
2023-04-12 21:52:34 +02:00
Y. Wang 4f241b06b1 Report coordinates of wagons with unregistered prototypes
Related issue: https://forum.minetest.net/viewtopic.php?p=414307#p414307
2023-04-12 21:32:32 +02:00
Maverick2797 3a6b1ca850 Add get_fc() and set_fc() commands
get_fc: returns a table of each wagon's FC codes
set_fc: set a table to overwrite the FC codes of a train's wagons
2023-03-17 20:03:12 +01:00
Maverick2797 82987b1a4f small security fixes in advtrains_luaautomation/
- fixed file permissions of advtrains_luaautomation/README.md (755->644)
 - fixed file permissions of advtrains_luaautomation/environment.lua (755->644)
 - prevented LuaATC section_occupancy() from having direct access to the interlocking section id occupancy table
 - simplify section_occupancy() logic
2023-03-17 19:57:43 +01:00
Maverick2797 cad4809b99 Add punchers name to ops panel punch event
event={type="punch", punch=true, name="foo"}
2023-03-12 17:24:27 +01:00
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
Antonia 744aee2cdd Minor change to README
45 degree platform design is not a sound
2022-03-03 00:12:43 +01: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 78e0c650e3 Load/Unload Track FC Integration
- Set a freight code in the track to whitelist only wagons with that FC as the current one

 - Set as # to disable the track

 - Set as a blank field (default) to allow all wagons to activate, irrespective of their FC
2021-12-29 21:21:37 +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
Maverick2797 23d524df71 Luaautomation: add section_occupancy()
Returns a table of train ids for the specified section.
Returns nil if the section id is not provided..
Returns false if the section id is invalid.
Returns an empty table if the section id is valid but empty of trains.
2021-12-29 21:16:32 +01:00
Y. Wang 5912f778e1 Fix speed sign allowing v>max_speed 2021-12-16 22:24:05 +01:00
1F616EMO 0b9441c289 Add C&C Servers into the testing server list, since we are using the latest commit 2021-11-26 12:33:28 +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 546ae49167 rewrite readme in markdown, add more information 2021-11-10 16:35:42 +01:00
Gabriel Pérez-Cerezo 02687c11ee Remove non-deterministic test 2021-11-10 11:48:27 +01:00
Gabriel Pérez-Cerezo 890369090e Activate serialize_lib unit tests 2021-11-10 11:39:54 +01:00
Gabriel Pérez-Cerezo 3561a7bfa2 Add more unit tests, fix broken unit test 2021-11-09 21:56:41 +01:00
Gabriel Pérez-Cerezo 9ec9db0ca9 configure build.yml to run the unit tests 2021-11-09 21:51:33 +01:00
Maverick2797 43c85ab8cf readme atc_set_ars_disable typo 2021-11-09 21:45:33 +01:00
Gabriel Pérez-Cerezo 00d12120b9 add sourcehut build file 2021-11-09 17:41:21 +01:00
Maverick2797 4cf9e5283b split_at_index where index=1
Splitting at index=1 results in multiple empty trains being created.
Can be prevented by an atc_speed > 0 check by the user, but easier just to return false and do nothing.
2021-11-08 22:58:23 +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 d46f4b9f67 Rework textures and models; add new signal signs 2021-11-07 13:49:01 +01:00
ywang be2f37a067 Support different types of speed restrictions; add documentation 2021-11-07 13:49:01 +01:00
ywang 2299470523 round speed limit if needed 2021-11-05 20:28:38 +01:00
ywang 8793c8bd48 make distant signal aspect dropdown labels consistent with the ones for the main aspect 2021-11-05 20:28:38 +01:00
ywang fb632f170a Do not allow adjusting Ks signals with trackworkers 2021-11-05 20:28:38 +01:00
ywang 44119ecbf5 Re-add Zs 3(v) indicators; swap green and yellow lights for realism 2021-11-05 20:28:38 +01:00
ywang e683401450 Use realistic Ra 10 signal sign 2021-11-05 20:28:38 +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 f046cfc2d3 LuaATC: remove accidental mesecons hard-dependency 2021-11-04 20:10:55 +01:00
orwell96 5e27bbdcfe LuaATC: Fix position of error label, use consistent name "LuaATC" instead of "LuaAutomation" 2021-11-02 23:22:30 +01:00
orwell96 ae152bf5bb LuaATC: Add Mesecons LuaATC Controller (similar to Mesecons Luacontroller) 2021-11-02 23:15:16 +01:00
orwell96 35d5106a21 LuaATC PCNaming: Allow naming active components using the tool 2021-11-02 23:14:28 +01:00
orwell96 75025b13ca Route Formspec: When cancelling route, disable ARS only temporarily, not permanently 2021-10-26 20:23:19 +02: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