We introduce a simple helper mod to transfer data as string through data lifecycle from data stage into control stage.
This mod generates an item prototype definition with the data string chunked into localised_description
.
The maximal possible string length is 10 * 20 ^ (20 + 1) ≈ 2 × 10²⁸
.
Usage example
in data.lua:
local bigpack = require("__big-data-string__.pack")
local encode = tostring -- for example
local function set_my_data(name, data)
return bigpack(name, encode(data))
end
-- use it like this
data:extend{set_my_data(name, data)}
in control.lua:
local bigunpack = require("__big-data-string__.unpack")
local decode = tonumber -- for example
local function get_my_data(name)
return decode(bigunpack(name))
end
-- use it like this
if get_my_data(name) == 42 then fun(...) end
Compatibility
We haven't discover any incompatibilities with other mods to date. Please report on the mod page discussion if any incompatibilities are discovered.
Works with multiplayer.
Documentation
- read the «Changelog» for more details
- discuss with us on the «Discussion» page
License
The mod ‹Big Data String Libary› was made by dodo.the.last and published under The Unlicense.
Notes
The information on this mod page represents the state of the current release and might be updated without prior notification or public announcement. Please refer to the «Documentation» section of this page for details.