TFS 1.X+ House door doesn't show house price or name

Joined
Sep 3, 2016
Messages
102
Best answers
2
Likes
7
#1
Hello guys, I'm having a bit of an issue here.

When I click on the house door, it just says it's a normal door. However, I can buy the house and leave the house.

Here's what's on RME:

Screenshot

Here's what appears on the Tibia 11 client:

Screenshot
 

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,448
Best answers
22
Likes
922
#2
Hello guys, I'm having a bit of an issue here.

When I click on the house door, it just says it's a normal door. However, I can buy the house and leave the house.

Here's what's on RME:

Screenshot

Here's what appears on the Tibia 11 client:

Screenshot
Right click on the door, go to proprieties, set an id.
 

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,448
Best answers
22
Likes
922
#6
The Houses that have one door already have the doors with ID = 1...
The door tile itself is marked as a house tile? Else I don't know, those are two common mistakes that create that sort of error.
 
Joined
Apr 8, 2009
Messages
152
Best answers
0
Likes
6
Location
Texas
#8
Select house. With the Tile house go to the door of the house. Uncheck the floor as house and re-mark over the door, you will notice that in the door property the DoorID will be with a number above 0. this means that the door has been detected and is working
 
Joined
Sep 3, 2016
Messages
102
Best answers
2
Likes
7
#10
They already have ID 1...
According to you, they should be detected by now, but the door still doesn't show the house name and the rent price...

Edit:

And the weird thing is that you can buy the houses if you stay in front of the door...

If I use the same map on different servers, I get different results. Maybe the problem is in the source?
 
Last edited:

bayview

Banned User
Joined
Jan 25, 2018
Messages
612
Best answers
25
Likes
285
#13
If I use the same map on different servers, I get different results. Maybe the problem is in the source?
Process of elimination... if it works on one and not the other then the issue is the source and not the map.
 
Joined
Sep 3, 2016
Messages
102
Best answers
2
Likes
7
#14
Yeah, but I can't seem to find where the problem is... I think I looked at almost all the files related to houses and I found nothing...

Any insights on where the problem might be? (the file that is causing the problem?)

Here's the house code from the server that is not working:

house.cpp
C++:
void House::updateDoorDescription() const
{
    std::ostringstream ss;
    if (owner != 0) {
        ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    } else {
        ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";

        const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " gold coins.";
        }
    }

    for (const auto& it : doorList) {
        it->setSpecialDescription(ss.str());
    }
}
And here's the one for the one that is working:

house.cpp
C++:
void House::updateDoorDescription() const
{
    std::ostringstream ss;
    if (owner != 0) {
        ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    } else {
        ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";

        const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " gold coins.";
        }
    }

    for (const auto& it : doorList) {
        it->setSpecialDescription(ss.str());
    }
}
Absolutely no difference!
 
Last edited:

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,030
Best answers
1
Likes
587
Location
Canada
#15
in global.lua you'll see a bunch of doors
Code:
verticalOpenDoors = {
    1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131,
    5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044,
    7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9274, 9269, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10485, 10483,
    10786, 12101, 12199, 19851, 19853, 19991, 19993, 20284, 20286, 17238, 13021, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997,
    20290, 22825, 22827, 22829, 22831
}

horizontalOpenDoors = {
    1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118,
    5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893,
    6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285,
    10470, 10472, 10476, 10474, 10777, 12094, 12190, 19842, 19844, 19982, 19984, 20275, 20277, 17236, 18209, 13023, 10781, 12096, 12196,
    19846, 19986, 20279, 10783, 12098, 12194, 19848, 19988, 20281, 22816, 22818, 22820, 22822
}

openSpecialDoors = {
    1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133,
    5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558,
    9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10781, 12096, 12196, 19846, 19986, 20279,
    10783, 12098, 12194, 19848, 19988, 20281, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997, 20290
}

questDoors = {
    1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049,
    8551, 8553, 9175,9177, 9277, 9279, 10278, 10280, 10475, 10484, 10782, 12097, 19847, 19987, 20280, 10791, 12104, 12204, 12195, 19856, 19996, 20289,
    22821, 22830
}

levelDoors = {
    1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130, 5292, 5294, 6206, 6208, 6263, 6265, 6896, 6905, 7038, 7047, 8555, 8557,9179, 9181,
    9281, 9283, 10282, 10284, 10473, 10482, 10780, 10789, 10780, 12095, 12195, 19845, 19985, 20278, 10789, 12102, 12193, 12202, 19854, 19994, 20287
}
ensure the door id is in the appropriate table. I believe this is all that needs to be adjusted.
 

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,030
Best answers
1
Likes
587
Location
Canada
#16
in global.lua you'll see a bunch of doors
Code:
verticalOpenDoors = {
    1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131,
    5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044,
    7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9274, 9269, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10485, 10483,
    10786, 12101, 12199, 19851, 19853, 19991, 19993, 20284, 20286, 17238, 13021, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997,
    20290, 22825, 22827, 22829, 22831
}

horizontalOpenDoors = {
    1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118,
    5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893,
    6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285,
    10470, 10472, 10476, 10474, 10777, 12094, 12190, 19842, 19844, 19982, 19984, 20275, 20277, 17236, 18209, 13023, 10781, 12096, 12196,
    19846, 19986, 20279, 10783, 12098, 12194, 19848, 19988, 20281, 22816, 22818, 22820, 22822
}

openSpecialDoors = {
    1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133,
    5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558,
    9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10781, 12096, 12196, 19846, 19986, 20279,
    10783, 12098, 12194, 19848, 19988, 20281, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997, 20290
}

questDoors = {
    1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049,
    8551, 8553, 9175,9177, 9277, 9279, 10278, 10280, 10475, 10484, 10782, 12097, 19847, 19987, 20280, 10791, 12104, 12204, 12195, 19856, 19996, 20289,
    22821, 22830
}

levelDoors = {
    1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130, 5292, 5294, 6206, 6208, 6263, 6265, 6896, 6905, 7038, 7047, 8555, 8557,9179, 9181,
    9281, 9283, 10282, 10284, 10473, 10482, 10780, 10789, 10780, 12095, 12195, 19845, 19985, 20278, 10789, 12102, 12193, 12202, 19854, 19994, 20287
}
ensure the door id is in the appropriate table. I believe this is all that needs to be adjusted.
edit: did some testing. this doesn't fix it. tried a number of other things as well. doesn't fix it. it could be something in items.otb but I don't have an item editor handy so I can't look in there.
1219 is a working door. it appears in 0 places in the source code, and it appears in the same places I've placed 22817, and has the same items.xml attributes. that narrows it down. it must be items.otb or something else external.

update:
I did
Code:
for k, v in pairs(ti:getHouse():getDoors()) do
                print(k, v)
            end
in an onLook. it printed nothing. but ti:getHouse():getId() returns the correct house id. in addition, thing:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) returns false on these doors, but on a working door returns true. for one reason or another, these doors are not receiving a special description, and houses don't see them as being doors. likely the former is a result of the latter.

more update:
Code:
void House::addDoor(Door* door)
{
    door->incrementReferenceCounter();
    doorList.push_back(door);
    door->setHouse(this);
    updateDoorDescription();
}
this function is where doors get added to the doorList. this function is called only in HouseTile::updateHouse() which is only called in HouseTile::addThing() and HouseTile::internalAddThing(), neither of which appear to be called anywhere in the source according to "Find all references"
I'm at a loss. I remember in older versions, adding the ids to the door table was enough. that doesn't seem to be the case anymore.
 
Last edited:

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,030
Best answers
1
Likes
587
Location
Canada
#17
edit: did some testing. this doesn't fix it. tried a number of other things as well. doesn't fix it. it could be something in items.otb but I don't have an item editor handy so I can't look in there.
1219 is a working door. it appears in 0 places in the source code, and it appears in the same places I've placed 22817, and has the same items.xml attributes. that narrows it down. it must be items.otb or something else external.

update:
I did
Code:
for k, v in pairs(ti:getHouse():getDoors()) do
                print(k, v)
            end
in an onLook. it printed nothing. but ti:getHouse():getId() returns the correct house id. in addition, thing:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) returns false on these doors, but on a working door returns true. for one reason or another, these doors are not receiving a special description, and houses don't see them as being doors. likely the former is a result of the latter.

more update:
Code:
void House::addDoor(Door* door)
{
    door->incrementReferenceCounter();
    doorList.push_back(door);
    door->setHouse(this);
    updateDoorDescription();
}
this function is where doors get added to the doorList. this function is called only in HouseTile::updateHouse() which is only called in HouseTile::addThing() and HouseTile::internalAddThing(), neither of which appear to be called anywhere in the source according to "Find all references"
I'm at a loss. I remember in older versions, adding the ids to the door table was enough. that doesn't seem to be the case anymore.
final edit:
<item fromid="22814" toid="22831" article="a" name="door" >
<attribute key="type" value="door" />
</item>
that + having a door id set in RME. that's all it fuckin was. good grief.
 
Joined
Sep 3, 2016
Messages
102
Best answers
2
Likes
7
#18
Oh my god, this is so ridiculous...

I thought it would be so obvious that I didn't even bother looking at items.xml

Thanks a lot @RazorBlade !
 
Top