• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

OTClient Saved position of containers

Crystals

Member
Joined
Sep 28, 2024
Messages
58
Reaction score
10
Hello :) I'm trying to find where or how to set it so that open backpacks are saved after logging out. It's a small thing, but it makes me happy :D

Theforgottenserver 1.4.2
otclientv8
 
probably without changing the src
List of 'open containers' is kept in C++ (forgottenserver/src/player.h at 1.4 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.4/src/player.h#L1200)).
You can't reopen containers without C++ changes. This change (TFS 1.6) should be compatible with 1.4 code:
 
List of 'open containers' is kept in C++ (forgottenserver/src/player.h at 1.4 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.4/src/player.h#L1200)).
You can't reopen containers without C++ changes. This change (TFS 1.6) should be compatible with 1.4 code:
If a genius writes so, it must be so :D
 
List of 'open containers' is kept in C++ (forgottenserver/src/player.h at 1.4 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.4/src/player.h#L1200)).
You can't reopen containers without C++ changes. This change (TFS 1.6) should be compatible with 1.4 code:
Hmmm, I did it, but suddenly a lot of errors appeared when trying to compile such as...


Błąd C2679 dwuargumentowy "=": nie znaleziono żadnego operatora, który przyjmuje prawostronny operand typu "bool" (lub nie istnieje akceptowalna konwersja) theforgottenserver C:\Forgottenserver testy\Kopia SRC\04.10.2024\src\item.h 327

Błąd C2365 "ATTR_OPENCONTAINER": zmiana definicji; definicja poprzednia była "moduł wyliczający" theforgottenserver

Błąd C2679 dwuargumentowy "=": nie znaleziono żadnego operatora, który przyjmuje prawostronny operand typu "double" (lub nie istnieje akceptowalna konwersja) theforgottenserver C:\Forgottenserver testy\Kopia SRC\04.10.2024\src\item.h 318

Błąd C2365 "ATTR_OPENCONTAINER": zmiana definicji; definicja poprzednia była "moduł wyliczający" theforgottenserver C:\Forgottenserver testy\Kopia SRC\04.10.2024\src\item.h 96

Błąd C2679 dwuargumentowy "=": nie znaleziono żadnego operatora, który przyjmuje prawostronny operand typu "int64_t" (lub nie istnieje akceptowalna konwersja) theforgottenserver C:\Forgottenserver testy\Kopia SRC\04.10.2024\src\item.h 309
 
List of 'open containers' is kept in C++ (forgottenserver/src/player.h at 1.4 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.4/src/player.h#L1200)).
You can't reopen containers without C++ changes. This change (TFS 1.6) should be compatible with 1.4 code:
Hmmm i have one problem

"forgottenserver-1.4.2\src\iologindata.cpp(642,4): error C2065: "containers": undeclared identifier

LUA:
Database& db = Database::getInstance();
for (const auto& it : itemList) {
    int32_t pid = it.first;
    Item* item = it.second;
    ++runningId;

    if (Container* container = item->getContainer()) {
        if (container->getIntAttr(ITEM_ATTRIBUTE_OPENCONTAINER)) {
            container->setIntAttr(ITEM_ATTRIBUTE_OPENCONTAINER, 0);
        }

        if (!openContainers.empty()) {
            for (const auto& its : openContainers) {
                auto openContainer = its.second;
                auto opcontainer = openContainer.container;

                if (opcontainer == container) {
                    container->setIntAttr(ITEM_ATTRIBUTE_OPENCONTAINER, static_cast<int64_t>(its.first) + 1);
                    break;
                }
            }
        }

        containers.emplace_back(container, runningId);
    }


this: containers.emplace_back(container, runningId);
 
containers variable was defined in commit from 2021-09-18:
TFS 1.4.0 was released on same day (2021-09-18). Maybe it was added after official TFS 1.4.0 was released or maybe you are using "TFS 1.4" downgrade (ex. 8.6) version, which uses TFS 1.3 as base, not TFS 1.4.
Hmm Ok, I'll check it when I get home :)

i use this: Release The Forgotten Server 1.4.2 · otland/forgottenserver (https://github.com/otland/forgottenserver/releases/tag/v1.4.2)
Post automatically merged:
 
containers variable was defined in commit from 2021-09-18:
TFS 1.4.0 was released on same day (2021-09-18). Maybe it was added after official TFS 1.4.0 was released or maybe you are using "TFS 1.4" downgrade (ex. 8.6) version, which uses TFS 1.3 as base, not TFS 1.4.
Ok, what you wrote worked.


It just started giving me errors with "subContainer"
Post automatically merged:

ps. "}" I had it corrected in the file. But that wasn't what was causing the error 😁
 

Attachments

Hello wondering if anyone has solved this?
Im using tfs 1.4.2
otcv8

i made the changes @Gesior.pl wrote about:

started of with this one:

and then continued adding the rest:


was able to save and build TFS 1.4.2 with no errors, but when i start the server and otcv8 each time i login i get a placeholder bag:
picture for reference: Gyazo (https://gyazo.com/5fcbb9136bbfba9586a4f03fb2cc251b)

and in otcv8 terminal im getting this Error:
ERROR: ProtocolGame parse message exception (14294 bytes, 6260 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)


Any ideas?

Much appreciated!

Best regards,
Wusse
 
Hello wondering if anyone has solved this?
Im using tfs 1.4.2
otcv8

i made the changes @Gesior.pl wrote about:

started of with this one:

and then continued adding the rest:


was able to save and build TFS 1.4.2 with no errors, but when i start the server and otcv8 each time i login i get a placeholder bag:
picture for reference: Gyazo (https://gyazo.com/5fcbb9136bbfba9586a4f03fb2cc251b)

and in otcv8 terminal im getting this Error:
ERROR: ProtocolGame parse message exception (14294 bytes, 6260 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)


Any ideas?

Much appreciated!

Best regards,
Wusse
 

Similar threads

Back
Top