Skip to content

ZwerOxotnik/zk-lib

Repository files navigation

Screenshots | Addons | FAQ | Notice | Contributing | License


thumbnail

Release Star Discord
Patreon Buy me a coffee Fork

Changelog · Translations

Multipurpose mod with switchable addons

Also, supports auto-generated mods etc.

  • Customizable: each addon is switchable.
  • Universal: many libraries for various purposes.
  • Easy: doesn't require specific requirements.

Download the mod  ▶

Settings stage Data stage Control stage
ZKSettings - libary with new features for settings sound auto-handling + PUAN2 api "zk-lib" - remote interface of libs
"Static libs" "Static libs" "Static libs"
lazyAPI lazyAPI - Are you lazy to change/add/remove/check some prototypes in the data stage? Use this library then. Event listener (not important, currently)
simpleTiers
easyTemplates
SPD - Simple postdate data (WIP) event_handler_vZO - improved version of Factorio event_handler
fakes - creates fake entitites
sprite list - creates sprite list and zk-lib adds them (new)

3rd party libraries:

  • basexx - library for base2, base16, base32, base64, base85 decoding and encoding of data strings. (source)
local basexx = require(require("__zk-lib__/defines").modules.basexx)
local bitwise = require(require("__zk-lib__/defines").modules.bitwise)
local fun = require(require("__zk-lib__/defines").modules.fun)
--- or
require(require("__zk-lib__/defines").modules.fun)()
  • candran - a Lua dialect and simple preprocessor (source) (WARNING: this modified version has some bugs and some functions were removed due to technical limitations, please report in this repository if you have any issues with it)
local candran = require(require("__zk-lib__/defines").modules.candran)
  • LuLPeg - A port of LPeg 100% written in Lua. (source) (use with cautious)
local lpeg = require(require("__zk-lib__/defines").modules.lulpeg)
  • Luxtre is a fully portable dialect of Lua 5.2 which compiles back into native code, written entirely in native Lua. It adds helpful additions and changes to Lua's default syntax and enables useful macros and preprocessing. (documentation, source) (not fully tested, can't be used outside of control.lua parsing yet)
local luxtre = require(require("__zk-lib__/defines").modules.luxtre)
  • lal is the implementation of a Compiler for a Scheme like dialect of Lisp that compiles to Lua. (documentation, source) (expect bugs (I should fix some of them), can't be used outside of control.lua parsing yet) # FAIL LAL-Compiler (74 OF 82 OK, 82 of 82 were run)\
local lal = require(require("__zk-lib__/defines").modules.lal)
  • tl is compiler for Teal, a typed dialect of Lua. (tutorial, source) (not fully tested)
local tl = require(require("__zk-lib__/defines").modules.tl)
  • moonscript is a programmer friendly language that compiles into Lua. (source) (not fully tested)
local moonscript = require(require("__zk-lib__/defines").modules.moonscript)
  • std is collection of Lua libraries. (source) (not fully tested, some stuff were removed)
local std_modules = require("__zk-lib__/defines").modules.std
local init    = require(std_modules.init)
local _base   = require(std_modules._base)
local package = require(std_modules.package)
local debug   = require(std_modules.debug)
local string  = require(std_modules.string)
local table   = require(std_modules.string)
local math    = require(std_modules.math)
local vivid = require(require("__zk-lib__/defines").modules.vivid)
  • Penlight brings together a set of generally useful pure Lua modules. (source) (not tested, some stuff were removed)
compat = require("__zk-lib__/lualib/Penlight/lua/pl/compat")
warn "@on"
local PL_modules = require("__zk-lib__/defines").modules.penlight
require(PL_modules.init) -- Entry point for loading all PL libraries only on demand, into the global space
local import_into = require(PL_modules.import_into)
local compat      = require(PL_modules.compat)
local luabalanced = require(PL_modules.luabalanced)
local OrderedMap  = require(PL_modules.OrderedMap)
local MultiMap = require(PL_modules.MultiMap)
local template = require(PL_modules.template)
local operator = require(PL_modules.operator)
local stringio = require(PL_modules.stringio)
local array2d  = require(PL_modules.array2d)
local stringx  = require(PL_modules.stringx)
local permute  = require(PL_modules.permute)
local tablex   = require(PL_modules.tablex)
local config   = require(PL_modules.config)
local strict   = require(PL_modules.strict)
local pretty   = require(PL_modules.pretty)
local input    = require(PL_modules.input)
local class    = require(PL_modules.class)
local lexer    = require(PL_modules.lexer)
local types    = require(PL_modules.types)
local utils    = require(PL_modules.utils)
local lapp     = require(PL_modules.lapp)
local func     = require(PL_modules.func)
local data     = require(PL_modules.data)
local List     = require(PL_modules.List)
local test     = require(PL_modules.test)
local seq      = require(PL_modules.seq)
local sip      = require(PL_modules.sip)
local app      = require(PL_modules.app)
local Map      = require(PL_modules.Map)
local Set      = require(PL_modules.Set)
local url      = require(PL_modules.url)
local xml      = require(PL_modules.xml)
local comprehension = require(PL_modules.comprehension)
  • Allen is a Lua library which provides a set of utilities and helpers for strings operations.
    Allen can be considered as an extension of the built-in Lua string library. (source, documentation) (WARNING: messes around with some data, don't require it with moonscript)
local allen = require(require("__zk-lib__/defines").modules.allen)
local guard = require(require("__zk-lib__/defines").modules.guard)
  • Lua Class System (LCS) is a small library which offers a clean, minimalistic but powerful API for (Pseudo) Object Oriented programming style using Lua. (source)
local LCS = require(require("__zk-lib__/defines").modules.LCS)
  • luacheck is a static analyzer and a linter for Lua. Luacheck detects various issues such as usage of undefined global variables, unused variables and values, accessing uninitialized variables, unreachable code and more. Most aspects of checking are configurable: there are options for defining custom project-related globals, for selecting set of standard globals (version of Lua standard library), for filtering warnings by type and name of related variable, etc. The options can be used on the command line, put into a config or directly into checked files as Lua comments. (source, documentation)
local luacheck = require(require("__zk-lib__/defines").modules.luacheck)

If you're interested in switchable commands with filters and in basic examples for Factorio, check out https://github.com/ZwerOxotnik/factorio-example-mod

Screenshots

image1 image2

Addons

FAQ

Q: What the addons are?

A: Wrapped embedded code into this mod

Q: Are addons better than mods?

A: Addons have more convenient way of managment for players, but, unfortunately, mod devs can't use some features for addons, at this moment. So, if a mod has simple events, then it'll be nice to have the mod as an addon.

‼️ Important Links (Translations, Discord Support)

Installation Guide Translations Discord
📖 Installation Guide 📚 Help with translations 🦜 Discord

If you want to download from this source, then use commands below (requires git).

git clone --recurse-submodules -j8 https://github.com/ZwerOxotnik/zk-lib
cd zk-lib

Don't be afraid to contribute! We have many, many things you can do to help out. If you're trying to contribute but stuck, tag @ZwerOxotnik

Alternatively, join the Discord group and send a message there.

Please read the contributing file for other details on how to contribute.

Notice

This project contains work from multiple sources + addons.

Also, this project used Mod generator.
Some images were copied from the game "Factorio" and changed, please, read terms of service: https://www.factorio.com/terms-of-service.\ ./fonts/NerdFontsSymbolsOnly is licensed under the MIT licence. Original source: https://www.nerdfonts.com/font-downloads

Artwork

Type Artist Image License
Thumbnail ZwerOxotnik zweroxotnik logo All right are reserved

License

This project is copyright © 2018-2023 ZwerOxotnik <zweroxotnik@gmail.com>.

This project is licensed under the European Union Public License v. 1.2 only.