Skip to content

Remember pallet attributes in objectstorage #8

@depuits

Description

@depuits

Currently pallets will forget all attributes related to the mod when placed in object storage. So far I was able to look in the PlaceableObjectStorage specialization in which I've found that the serialization happens by a lookup to ABSTRACT_OBJECTS_BY_CLASS_NAME. But here I am unable to find the implementation of these abstract classes and where they get the properties to save.

local abstractObjectClass = PlaceableObjectStorage.ABSTRACT_OBJECTS_BY_CLASS_NAME[ClassUtil.getClassNameByObject(object)]
    if abstractObjectClass ~= nil then
        local abstractObject = abstractObjectClass.new()
        abstractObject:addToStorage(self, object, loadedFromSavegame)
        self:addAbstactObjectToObjectStorage(abstractObject)
    end

I was able to implement this for bales using saveBaleAttributesToXMLFile but I don't know if something similar exists for the vehicles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions