diff options
author | orwell96 <orwell@bleipb.de> | 2018-05-17 11:16:04 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-06-14 17:39:42 +0200 |
commit | b420a719398fa0e342d5ee8547464179664ae6b9 (patch) | |
tree | 541999867946eea1dc94fe0c9930af67e39434e7 /advtrains/api_doc.txt | |
parent | caf2bda7bc02f0bbe6dbbeb415e7881158d143b9 (diff) | |
download | advtrains-b420a719398fa0e342d5ee8547464179664ae6b9.tar.gz advtrains-b420a719398fa0e342d5ee8547464179664ae6b9.tar.bz2 advtrains-b420a719398fa0e342d5ee8547464179664ae6b9.zip |
Implement a reverse path lookup for trains instead of an occupations window system
Diffstat (limited to 'advtrains/api_doc.txt')
-rw-r--r-- | advtrains/api_doc.txt | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt index e34b32a..3cb58e5 100644 --- a/advtrains/api_doc.txt +++ b/advtrains/api_doc.txt @@ -140,7 +140,7 @@ If you can't enter or leave a train because the doors are closed, holding the Sn Most modders will be satisfied with the built-in tracks. If cog railways, maglev trains and mine trains are added, it is necessary to understand the definition of tracks. Although the tracks API is there, explaining it would require more effort than me creating the wanted definitions myself. Contact me if you need to register your own rails using my registration functions. However, it is still possible to register single rails by understanding the node properties of rails. -minetest.register_node(nodename, { +minetest.register_node(nodename, { -- TODO this is outdated! ... usual node definition ... groups = { advtrains_track_<tracktype>=1 @@ -151,27 +151,27 @@ minetest.register_node(nodename, { connect1 = 0, connect2 = 8, ^- These values tell the direction (horizontal) the rail ends are pointing to. 0 means +Z, then rotation values increase clockwise. For a translation of directions to positions see helpers.lua. - rely1=0,
+ rely1=0, rely2=0, - ^- the Y height of the rail end 1/2. A value of >=1 means that the rail end points to the next y layer at rely-1
+ ^- the Y height of the rail end 1/2. A value of >=1 means that the rail end points to the next y layer at rely-1 railheight=0, ^- the height value of this rail that is saved in the path. usually the median of rely1 and rely2. - can_dig=function(pos)
- return not advtrains.get_train_at_pos(pos)
- end,
- after_dig_node=function(pos)
- advtrains.ndb.update(pos)
- end,
- after_place_node=function(pos)
- advtrains.ndb.update(pos)
+ can_dig=function(pos) + return not advtrains.get_train_at_pos(pos) + end, + after_dig_node=function(pos) + advtrains.ndb.update(pos) + end, + after_place_node=function(pos) + advtrains.ndb.update(pos) end, ^- the code in these 3 default minetest API functions is required for advtrains to work, however you can add your own code - advtrains = {
+ advtrains = { on_train_enter=function(pos, train_id) end ^- called when a train enters the rail on_train_leave=function(pos, train_id) end - ^- called when a train leaves the rail
+ ^- called when a train leaves the rail } }) |