This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dev:core:funref:register_platform [2019-06-30 20:45] 82.67.173.193 replaced tutorial with page |
dev:core:funref:register_platform [2019-10-02 16:48] 82.67.173.193 created example |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== advtrains:register_platform ====== | + | ====== advtrains.register_platform ====== |
//Registers an Advtrains platform node.// | //Registers an Advtrains platform node.// | ||
Line 10: | Line 10: | ||
===== Extended description ===== | ===== Extended description ===== | ||
- | Allows the use of node **preset** as an Advtrains [[usage: | + | Allows the use of node '' |
===== Parameters ===== | ===== Parameters ===== | ||
- | * **modprefix** // | + | * '' |
- | * **preset** // | + | * '' |
===== 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 '' |
> 2019-01-01 15:00:00: WARNING[Server]: | > 2019-01-01 15:00:00: WARNING[Server]: | ||
- | A startup error is raised if **modprefix** is nil or does not designate a mod name. | + | A startup error is raised if '' |
===== 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: | + | Both platforms aren't blocking trains, because they belong to the '' |
+ | |||
+ | ===== Example ===== | ||
+ | <code lua> | ||
+ | -- Create a brick platform | ||
+ | advtrains.register_platform(" | ||
+ | </ | ||
===== In source code ===== | ===== In source code ===== |