Castra Prime


Fork of Castra, military planet, to fix balance issues.

Content
2 days ago
2.0 - 2.1
6.99K
Factorio: Space Age Icon Space Age Mod
Planets Logistics Combat Armor Enemies Environment Mining

b 2.1: Cannot serialise ttype=function

7 days ago

Just tried adding this to my current playthrough and getting this error on startup: "Cannot serialise ttype=function"
Any ideas?

7 days ago

same

6 days ago

I would love to fix this but I cannot reproduce it locally, either on creating a new game, adding Castra to an existing game, or opening an old save that already had Castra. I suspect that this is an interaction with another mod, but without knowing where to look it's hard for me to do anything about this. To be clear, this is an error you're experiencing when you try to load the game, right?

Some steps that may help me diagnose this:

  1. Can you provide a list of the mods you're currently using, or a copy of your save file? mod-list.json would work
  2. Game log from factorio-current.log?
  3. If you really have time disabling a few mods, seeing if the problem persists, and so on to try to narrow it down.

I'll continue to try to find the error.

6 days ago

+1

5 days ago

Seems like a incapability with Planet Vesta.
It stops working as soon as I enable Vesta as well.

5 days ago

I appreciate the hint toward Planet Vesta, but I've hit a bit of a wall there because I cannot get Vesta to load by itself (let alone with Castra). I've posted on that mod, but if anyone has a fix idea let me know (https://mods.factorio.com/mod/skewer_planet_vesta/discussion/6a9c777c6ad12f110f025443)

5 days ago

In the meantime this is what I'm going to try to use when I can get Vesta working. If anyone wants to try this locally, this code should be pasted into data-final-fixes.lua

-- Scan for illegal functions in data.raw (serialization bug)
local function scan_for_functions(tbl, path)
    path = path or "data.raw"
    if type(tbl) ~= "table" then return end

    for key, value in pairs(tbl) do
        local current_path = path .. "." .. tostring(key)
        if type(value) == "function" then
            log("==================================================")
            log("FOUND ILLEGAL FUNCTION IN DATA.RAW AT: " .. current_path)
            log("==================================================")
        elseif type(value) == "table" then
            -- Avoid infinite loops on self-referential tables
            if key ~= "__index" and key ~= "_G" then
                scan_for_functions(value, current_path)
            end
        end
    end
end

scan_for_functions(data.raw)

End of the file should work.

5 days ago

Added it to the file, (created a copy of the mod with version 0.9.1)
Heres the log:
https://pastebin.com/GKnsp1gM (wrong title set, whoops...)

Still same error Cannot serialise ttype=function, your function does not trigger that early, so no entry of illegal functions in log yet.

Here is a log WITHOUT Vesta (and shattered planet, since this has Vesta as requirement), with your function included:
Part 1: https://pastebin.com/1U3An0xq
Part 2: https://pastebin.com/dg79DN7D

5 days ago

This is really weird. I have resolved the purely Vesta issue I had, and now I can get it to load alongside Castra just fine. I will continue to investigate.

5 days ago

Again, I've had trouble reproducing this locally, but thanks to Nasbit we have a fix that hopefully solves the Vesta problem. There may still be conflicts with other mods, and if so hopefully can apply the same logic to fix them faster. Please let me know if you're still having issues or if this fixes things. Thanks! See v0.9.1

5 days ago

Can confirm this fixes issue on load with Vesta
Thanks!

New response