Ir para conteúdo
Propaganda

Backpack saving when logout and login


Xaii

Posts Recomendados

Where can I do organization of saving backpacks after logging out and logging in?

When I open my backpack and log out and then log back in, my backpack disappears, cannot be saved.

Does anyone know why or know how to do this?

I use OTCv8 and TFS 1.2

PokeDash by Pota.

Editado por Xaii
Link para o comentário
Compartilhar em outros sites

9 horas atrás, gutinha disse:

Hi, have you seen this? 

This is the hidden content, please

Yep, i have this in my soruce. Still doesn't work.

Maybe problem is this because i don't have normal Inventory i have only backpack.

 

  if not inventoryWindow.forceOpen then
    inventoryButton = modules.client_topmenu.addRightGameToggleButton('inventoryButton', tr('Open backpack') .. ' (Ctrl+I)', '/images/topbuttons/inventory', toggle)
    inventoryButton:setOn(true)
  end


 

function toggle()
  local backpack = g_game.getLocalPlayer():getInventoryItem(InventorySlotBack)
  if backpack then
    g_game.use(backpack)
  end
end



 

  • Like 4
Link para o comentário
Compartilhar em outros sites

  • 2 semanas atrás...

In fact, this is not a bug, there is a column in the database called "save" this column by default is set to 0, it is responsible for identifying whether to save the character's containers or not, just change the value of this column to 1 and it will work.

Link para o comentário
Compartilhar em outros sites

@ darkwore

I think there is problem with Attributes, when i add attribute to save backpacks, my pokeballs are removed.

In this code  "local pokeName = ball:getSpecialAttribute("pokeName")"

It looks like these attributes are overwritten.
 

function Player:refreshPokemonBar(add, remove)
    local pokeballs = self:getPokeballs()
    local pokemonsTable = {}
    for i = 1, #pokeballs do
        local ball = pokeballs[i]
        local pokeName = ball:getSpecialAttribute("pokeName")
        if not pokeName then -- fix ball bug
            ball:remove()
            print("WARNING! Player " .. self:getName() .. " had one ball removed!")
        else
            if not isInArray(remove, pokeName) then
                table.insert(pokemonsTable, "," .. pokeName)
            end
        end
        
    end
    for i = 1, #add do
        table.insert(pokemonsTable, "," .. add[i])
    end
    table.insert(pokemonsTable, ",")
    self:sendExtendedOpcode(53, table.concat(pokemonsTable))
--    self:setSpecialStorage("pokes", pokeballs)
    return true
end



image.png.6c208e029a1757ce54bd970e856109a3.png

  • Like 2
Link para o comentário
Compartilhar em outros sites

I don't think it's a problem with attributes, this solution with the save column in the database has worked for several people I've shared it with, so I think your problem is something else.

9 horas atrás, Xaii disse:

@ darkwore

I think there is problem with Attributes, when i add attribute to save backpacks, my pokeballs are removed.

In this code  "local pokeName = ball:getSpecialAttribute("pokeName")"

It looks like these attributes are overwritten.
 

function Player:refreshPokemonBar(add, remove)
    local pokeballs = self:getPokeballs()
    local pokemonsTable = {}
    for i = 1, #pokeballs do
        local ball = pokeballs[i]
        local pokeName = ball:getSpecialAttribute("pokeName")
        if not pokeName then -- fix ball bug
            ball:remove()
            print("WARNING! Player " .. self:getName() .. " had one ball removed!")
        else
            if not isInArray(remove, pokeName) then
                table.insert(pokemonsTable, "," .. pokeName)
            end
        end
        
    end
    for i = 1, #add do
        table.insert(pokemonsTable, "," .. add[i])
    end
    table.insert(pokemonsTable, ",")
    self:sendExtendedOpcode(53, table.concat(pokemonsTable))
--    self:setSpecialStorage("pokes", pokeballs)
    return true
end



image.png.6c208e029a1757ce54bd970e856109a3.png

 

Link para o comentário
Compartilhar em outros sites

Em 18/08/2023 em 00:08, DarkWore disse:

I don't think it's a problem with attributes, this solution with the save column in the database has worked for several people I've shared it with, so I think your problem is something else.

 

Yep, that was a problem with attributes. I repaired this. "Save" In database is for save player, not backpacks.

There was a problem with Strings and Int, they were messing with each other.

Link para o comentário
Compartilhar em outros sites

Participe da Conversa

Você pode postar agora e se cadastrar mais tarde. Cadastre-se Agora para publicar com Sua Conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.

×
  • Criar Novo...