This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
dev:core:path [2020-04-14 12:48] orwell created |
dev:core:path [2020-04-28 20:27] orwell |
||
---|---|---|---|
Line 26: | Line 26: | ||
A train is moved by advancing its index. It is important to note that the train' | A train is moved by advancing its index. It is important to note that the train' | ||
+ | |||
+ | ===== Distances ===== | ||
+ | |||
+ | It is important to keep in mind that the index has little to no relation to actual distances in the cartesian space. Depending on the track orientation, | ||
+ | |||
+ | To calculate an index for a given starting index and a given distance, you can use '' | ||
+ | |||
+ | ===== In train table ===== | ||
+ | The following tables in the train table are handled by the path system: | ||
+ | < | ||
+ | -- path - path positions. ' | ||
+ | -- is the node this item corresponds to, however, this will change in the future. | ||
+ | -- path_node - (reserved) | ||
+ | -- path_cn | ||
+ | -- path_cp | ||
+ | -- When the day comes on that path!=node, these will only be set if this index represents a transition between rail nodes | ||
+ | -- path_dist - The total distance of this path element from path element 0 | ||
+ | -- path_dir | ||
+ | --Variables: | ||
+ | -- path_speed | ||
+ | -- - If 0, the train will stop 0.1 indices before this path item (definable by LZB_ZERO_APPROACH_DIST in trainlogic.lua) | ||
+ | -- path_ext_f/ | ||
+ | -- path_trk_f/ | ||
+ | -- path_req_f/ | ||
+ | </ | ||
+ | |||
===== Path generation ===== | ===== Path generation ===== | ||
+ | The path is generated on the fly, as path items are requested. | ||
+ | Every call to '' | ||