2018-10-05 21:55:40 +02:00
|
|
|
# Tube Library 2 [tubelib2]
|
|
|
|
|
|
|
|
A library for mods which need connecting tubes / pipes / cables or similar.
|
|
|
|
|
2018-11-22 19:04:08 +01:00
|
|
|
![tubelib2](https://github.com/joe7575/tubelib2/blob/master/screenshot.png)
|
|
|
|
|
|
|
|
|
2018-10-05 22:52:51 +02:00
|
|
|
This mod is not useful for its own. It does not even have any nodes.
|
|
|
|
It only comes with a few test nodes to play around with the tubing algorithm.
|
|
|
|
|
2018-10-05 21:55:40 +02:00
|
|
|
Browse on: ![GitHub](https://github.com/joe7575/tubelib2)
|
|
|
|
|
|
|
|
Download: ![GitHub](https://github.com/joe7575/tubelib2/archive/master.zip)
|
|
|
|
|
|
|
|
|
2018-10-27 17:53:07 +02:00
|
|
|
## Description
|
|
|
|
|
|
|
|
Tubelib2 distinguished two kinds of nodes:
|
|
|
|
- primary nodes are tube like nodes (pipes, cables, ...)
|
|
|
|
- secondary nodes are all kind of nodes, which can be connected by means of primary nodes
|
|
|
|
|
|
|
|
Tubelib2 specific 6D directions (1 = North, 2 = East, 3 = South, 4 = West, 5 = Down, 6 = Up)
|
|
|
|
|
|
|
|
All 6D dirs are the view from the node to the outer side
|
|
|
|
Tubes are based on two node types, "angled" and "straight" tubes.
|
2018-11-11 10:32:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
+-------+
|
|
|
|
/ /| +-------+
|
|
|
|
/ / | / /|
|
|
|
|
/ / + / / |
|
|
|
|
/ / / +-------+ |
|
|
|
|
+-------+ / | | |
|
|
|
|
| | / | |/ |
|
|
|
|
| |/ +-------+| +
|
|
|
|
+-------+ | |/
|
|
|
|
+------+
|
|
|
|
|
|
|
|
|
2018-10-27 17:53:07 +02:00
|
|
|
All other nodes are build by means of axis/rotation variants based on param2
|
|
|
|
(paramtype2 == "facedir").
|
|
|
|
|
|
|
|
The 3 free MSB bits of param2 of tube nodes are used to store the number of connections (0..2).
|
|
|
|
|
2018-12-16 18:53:19 +01:00
|
|
|
The data of the peer head tube are stored in memory 'self.connCache'
|
2018-10-27 17:53:07 +02:00
|
|
|
|
2018-11-09 23:37:23 +01:00
|
|
|
Tubelib2 provides an update mechanism for connected "secondary" nodes. A callback function
|
2018-12-16 18:53:19 +01:00
|
|
|
func(node, pos, out_dir, peer_pos, peer_in_dir) will be called for every change on the connected tubes.
|
2018-10-27 17:53:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-05 21:55:40 +02:00
|
|
|
## Dependencies
|
|
|
|
default
|
2018-12-20 16:28:23 +01:00
|
|
|
optional: intllib
|
|
|
|
|
2018-10-05 21:55:40 +02:00
|
|
|
|
|
|
|
# License
|
2020-01-03 16:12:37 +01:00
|
|
|
Copyright (C) 2017-2020 Joachim Stolberg
|
2018-11-11 10:32:54 +01:00
|
|
|
Code: Licensed under the GNU LGPL version 2.1 or later.
|
|
|
|
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
|
2018-10-05 21:55:40 +02:00
|
|
|
Textures: CC0
|
|
|
|
|
2018-12-20 16:28:23 +01:00
|
|
|
|
2018-10-27 17:53:07 +02:00
|
|
|
## History
|
|
|
|
- 2018-10-20 v0.1 * Tested against hyperloop elevator.
|
|
|
|
- 2018-10-27 v0.2 * Tested against and enhanced for the hyperloop mod.
|
2018-10-28 18:45:07 +01:00
|
|
|
- 2018-10-27 v0.3 * Further improvements.
|
2018-11-09 23:37:23 +01:00
|
|
|
- 2018-11-09 v0.4 * on_update function for secondary nodes introduced
|
2018-12-16 18:53:19 +01:00
|
|
|
- 2018-12-16 v0.5 * meta data removed, memory cache added instead of
|
2018-12-20 16:28:23 +01:00
|
|
|
- 2018-12-20 v0.6 * intllib support added, max tube length bugfix
|
2019-01-06 00:17:01 +01:00
|
|
|
- 2019-01-06 v0.7 * API function replace_tube_line added, bug fixed
|
2019-01-11 21:52:21 +01:00
|
|
|
- 2019-01-11 v0.8 * dir_to_facedir bugfix
|
2019-02-09 11:04:42 +01:00
|
|
|
- 2019-02-09 v0.9 * storage.lua added, code partly restructured
|
2019-02-17 18:04:05 +01:00
|
|
|
- 2019-02-17 v1.0 * released
|
2019-03-02 19:36:12 +01:00
|
|
|
- 2019-03-02 v1.1 * API function 'switch_tube_line' added, secondary node placement bugfix
|
2019-04-18 21:04:46 +02:00
|
|
|
- 2019-04-18 v1.2 * 'force_to_use_tubes' added
|
2019-05-01 12:00:48 +02:00
|
|
|
- 2019-05-01 v1.3 * API function 'compatible_node' added
|
2019-06-16 23:21:41 +02:00
|
|
|
- 2019-05-09 v1.4 * Attribute 'tube_type' added
|
2019-07-12 23:25:20 +02:00
|
|
|
- 2019-07-12 v1.5 * internal handling of secondary nodes changed
|
2019-11-02 19:43:19 +01:00
|
|
|
- 2019-10-25 v1.6 * callback 'tubelib2_on_update2' added
|
2020-01-03 16:12:37 +01:00
|
|
|
- 2020-01-03 v1.7 * max_tube_length bugfix
|
2020-02-09 10:55:39 +01:00
|
|
|
- 2020-02-02 v1.8 * 'special nodes' as alternative to 'secondary nodes' introduced
|
2019-11-02 19:43:19 +01:00
|
|
|
|
|
|
|
|