Page 1 of 1

[API] Register poles and lamps (modpack) [streetlights]

Posted: Sun May 20, 2018 06:12
by Linuxdirk

Register streetlight poles and lamps via an API

The API provides two functions that allow registering conductive poles as well as lamps. The API registers them with all the necessary functionality for conducting the Mesecons signal. The two other mods in the modpack are examples on how to use the API.

Most basic setup: Mesecons signal into the receiver, from there into a pole, from the pole to the lamp.

For using the API all you need to do is depend on it and register anything you want. Or simply get the modpack as a whole since it contains two more mods that utilize the API to register a basic set of lamps and poles.

Image Image
Left: All lamps are toggleable; Right: Some poles are disguised as other nodes

For connecting the Mesecons signal to the poles a receiver is used as shown in the first screenshot. To craft the receiver you just need some stone and other material.

Enough for seven lamps.

The receiver is provided by the API and does not need to be registered manually.

Obtaining the modpack

Info: Only streetlights_api is needed for registering own lamps and poles!
Depends (API): default, mesecons, mesecons_extrawires
Depends (poles): streetlights_api, walls?
Depends (lamps): streetlights_api
License (all): GPLv3 or later,
Download: Latest version (always compatible with latest non-dev Minetest version)
… or better use Git:

Re: [API] Register poles and lamps (modpack) [streetlights]

Posted: Sun May 20, 2018 12:58
by LegoLogger
This is Awesome! Thank you for this API!

Re: [API] Register poles and lamps (modpack) [streetlights]

Posted: Sun May 20, 2018 13:13
by Phoenixflo44
Good job. +10000000000000000000000000000000000000000000000

Re: [API] Register poles and lamps (modpack) [streetlights]

Posted: Sat Oct 19, 2019 02:03
by Linuxdirk
API (and reference implementation) are fully compatible with Minetest 5.1+.

No changes are needed and no updates are planned so far.

Re: [API] Register poles and lamps (modpack) [streetlights]

Posted: Wed Apr 08, 2020 21:16
by Linuxdirk
Everything is fully compatible with Minetest 5.2.x and a properly flagged release was added to the CDB and will be rolled out soon.