This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
dev:proposals:door_indexes [2023-01-17 13:44] evictionbot Evict 56independent |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Door Indexes ====== | ||
- | Add a system of choosing which doors to open on a train. | ||
- | ===== Situation and problems ===== | ||
- | Currently, all doors change on a train when given a command to change door state, but this may not be the intended behaviour in a short station. | ||
- | |||
- | For a real-life example of needing to choose doors, take the [[https:// | ||
- | |||
- | - Suffer serious injury by contact to track surface | ||
- | - Be electrocuted by contact with the third rail | ||
- | - By killed by a passing trains | ||
- | - File a lawsuit for any of the reasons above. | ||
- | |||
- | ===== Solution ===== | ||
- | The problem above is very serious and could lead to a lawsuit causing a Minetest server to be taken down for not caring for its players. As such, 56i proposes door indexes. A simple addition to an ATC command can help prevent needless death. | ||
- | |||
- | When writing a door command, optionally an index can be added, which has two units: Carriages (C) or metres (D). The index and unit go side by side. | ||
- | |||
- | Take for example the command '' | ||
- | |||
- | Keeping a door command on its own ('' | ||
- | |||
- | The carriage index is similar to the distance index, but acts upon carriage numbers, opening doors until a specific carriage down the train. | ||
- | |||
- | ===== Station Tracks ===== | ||
- | Station tracks are tightly linked to this proposal. Station tracks often control the doors, and it is prudent to modify them. | ||
- | |||
- | Station tracks issue an ATC command to open the doors, but check the number of platform nodes opposite of the track direction and use that as the distance index to act upon. The command is '' | ||
- | |||
- | ===== Possible Implementation ===== | ||
- | Here is one possible algorithm for the door index: | ||
- | |||
- | - Begin at the front of the train | ||
- | - Repeat this: | ||
- | - Measure the length of a model and add it to variable x | ||
- | - If x surpasses the door index, stop counting | ||
- | - Measure the amount of times this happened in y | ||
- | - Open doors until y carriage index | ||
- | |||
- | This relies on a carriage index algorithm existing, but this should be relatively simple to implement by copying some code and writing some others, given that trains need to count their carriages for the '' | ||
- | |||
- | ==== 2022-08-07t16: | ||
- | |||
- | Advtrains has the functions and tools required to implement the position lookups you describe. The main issue (and also the reason why we don't have doors opening on both sides) is how the door opening/ | ||
- | |||
- | 3D models can include animations that are indexed by " | ||
- | * Open left doors (with right doors closed) | ||
- | * Open right doors (with left doors closed) | ||
- | * Close left doors (with right doors closed) | ||
- | * Close right doors (with left doors closed) | ||
- | |||
- | To implement your proposal, we would need more animation definitions for all the individual doors opening and closing. In the best case, we combine this with both-sides door opening. If someone can come up with a good way to solve this (e.g. an animation auto-generator, | ||
- | |||
- | On the other hand, limiting the door opening on a per-wagon basis would be no major issue to implement. | ||
- | |||
- | === 56independent. 2022-08-07t20: | ||
- | Maybe an overhang carriage opens its doors under carriage index mode, and a carriage refuses to open its doors under distance index mode. | ||
- | |||
- | However, my [[http:// |