Big Data String Library


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

Internal
2 years ago
1.1
46.3K

b [moreinfo] Cutting off text

1 year, 9 days ago

Hello, I tried uploading a table containing all prototypes and some properties for each of them and it cut off an initial section. Do you know why this may be?

11 months ago

Hi, I'm afraid I can't help you without consolidating further details.
Can you provide a code snippet to reproduce the bug for me?

11 months ago
(updated 11 months ago)

In data.lua

local my_data = {}
for _, class in pairs(data.raw) do
    for _, prototype in pairs(class) do
        my_data[prototype.type .. "aaa" .. prototype.name] = prototype.name
    end
end
data:extend({"mymod-data", serpent.dump(my_data)})

In control.lua

ok, global.data = serpent.load(bigunpack("mymod-data"))
log(serpent.block(global.data))

I haven't tried the above piece of code in a standalone mod, but that is where I have isolated the issue to. Also, the table I saved is slightly different, but is essentially something for each prototype like above. I can try this in a standalone mod once I get the time, but wanted to make sure I gave you a timely response. The log then looks like this...

131.866 Script @__propertyrandomizer__/informatron.lua:10: "[string \"rticle-small\"]={num_steps=0,num_good_steps=0}...\"]:1: syntax error near '-'"

Notice how the "rticle" is cut off (it should be particle). I've done some other testing and the string is indeed cut off when manually inspected, so none of the earlier prototypes appear.

11 months ago

Also I believe I tested doing a serpent.dump and a serpent.load all in data stage and it worked, but I can go try again to confirm when I have time if you'd like.

10 months ago

Any thoughts on this?

New response