[Library 0.14+] Lifecycle events

Topics and discussion about specific mods
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[Library 0.14+] Lifecycle events

Post by aubergine18 »

A library that mods can use to trigger events when they create or destroy entities.

This is useful when you want to create/destroy entities that are external to your mod: other mods sometimes need to get notified, but the Lua API provides no standard way to do this (and the devs won't implement it).

This library module, that you can drop in to your mod easily, aims to fix that shortcoming by adding event-triggering alternatives to `LuaSurface.create_entity()` and `LuaEntity.destroy()`.

https://github.com/aubergine10/lifecycle-events

Need help with testing, and also help to flesh out the `can_destroy()` function.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Mods”