Ir para conteúdo
Propaganda

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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/
Compartilhar em outros sites

  • Administrador

Hi, have you seen this? 

This is the hidden content, please

  • Like 9
  • Thanks 1
  • Haha 1
  • Sad 1
Link para o comentário
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-246
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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-261
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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-323
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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-324
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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-334
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
https://tibiadevs.com/forums/topic/49-backpack-saving-when-logout-and-login/#findComment-367
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora
×
  • Criar Novo...