SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Factorio

Big Data String Library

DBy dodo.the.last

Store up to 2 × 10²⁸ chars long strings during data stage and read them during control stage

Description

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


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.

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.