User Tools

Site Tools


dev:core:funref:register_platform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
dev:core:funref:register_platform [2019-06-30 20:42]
82.67.173.193 created
dev:core:funref:register_platform [2019-07-02 12:33]
82.67.173.193 changed bold to monospace
Line 1: Line 1:
-====== advtrains:register_platform ======+====== advtrains.register_platform ======
 //Registers an Advtrains platform node.// //Registers an Advtrains platform node.//
  
-//Note: this tutorial has been written for Advtrains 2.0.1 TSS and Minetest 5.1.0. Examples and practices described in this page don't take advantage of improvements introduced in later releases.//+//Note: this page has been written for Advtrains 2.0.1 TSS and Minetest 5.1.0. Examples and practices described in this page don't take advantage of improvements introduced in later releases.//
  
 ===== Syntax ===== ===== Syntax =====
Line 10: Line 10:
  
 ===== Extended description ===== ===== Extended description =====
-Allows the use of node **preset** as an Advtrains [[usage:nodes:platform|platform]].+Allows the use of node ''preset'' as an Advtrains [[usage:nodes:platform|platform]].
  
 ===== Parameters ===== ===== Parameters =====
-  * **modprefix** //(string)//: a string designating the name of the caller's mod. +  * ''modprefix'' //(string)//: a string designating the name of the caller's mod. 
-  * **preset** //(string)//: a node name which will be used as base for the platform.+  * ''preset'' //(string)//: a node name which will be used as base for the platform.
  
 ===== Errors and warnings ===== ===== Errors and warnings =====
-It gives a warning if the referenced node **preset** is nil, or has not been registered:+It gives a warning if the referenced node ''preset'' is nil, or has not been registered:
  
 > 2019-01-01 15:00:00: WARNING[Server]:  register_platform couldn't find preset node unknown:node > 2019-01-01 15:00:00: WARNING[Server]:  register_platform couldn't find preset node unknown:node
  
-A startup error is raised if **modprefix** is nil or does not designate a mod name.+A startup error is raised if ''modprefix'' is nil or does not designate a mod name.
  
 ===== How it works internally ===== ===== How it works internally =====
 This Lua function registers two nodes: a low and a high platform. The low platform is half height while the high one is full height. The function takes the texture used by the face at the top as a base for the all platform faces, but also adds a yellow line on the top, referenced by **advtrains_platform.png** in the code. This Lua function registers two nodes: a low and a high platform. The low platform is half height while the high one is full height. The function takes the texture used by the face at the top as a base for the all platform faces, but also adds a yellow line on the top, referenced by **advtrains_platform.png** in the code.
  
-Both platforms aren't blocking trains, because they belong to the [[reference:not_blocking_trains|not_blocking_trains]] group. As well, they are in the [[reference:platform|platform]] group (with value 1 for low platform, 2 for high one).+Both platforms aren't blocking trains, because they belong to the ''[[reference:not_blocking_trains|not_blocking_trains]]'' group. As well, they are in the ''[[reference:platform|platform]]'' group (with value 1 for low platform, 2 for high one).
  
 ===== In source code ===== ===== In source code =====
dev/core/funref/register_platform.txt · Last modified: 2020-01-22 10:53 by admin