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

Discussion in 'Support' started by Sleet, May 16, 2018.

  1. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    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
     
  2. Best Answer:
    Post #17 by RazorBlade, May 18, 2018
  3. Peonso

    Peonso 1337

    Joined:
    Jan 14, 2008
    Messages:
    1,386
    Likes Received:
    888
    Best Answers:
    20
    Right click on the door, go to proprieties, set an id.
     
  4. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    Which ID should I set for each door? The ID of the house?
     
  5. Peonso

    Peonso 1337

    Joined:
    Jan 14, 2008
    Messages:
    1,386
    Likes Received:
    888
    Best Answers:
    20
    Each house should have doors starting with id 1, if a house has 2 doors, one should be 1 and the other 2, etc.
     
  6. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    The Houses that have one door already have the doors with ID = 1...
     
  7. Peonso

    Peonso 1337

    Joined:
    Jan 14, 2008
    Messages:
    1,386
    Likes Received:
    888
    Best Answers:
    20
    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.
     
  8. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    Yes, it is.
     
  9. Mr Erimyth

    Mr Erimyth Member

    Joined:
    Apr 8, 2009
    Messages:
    146
    Likes Received:
    6
    Best Answers:
    0
    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
     
  10. Mr Erimyth

    Mr Erimyth Member

    Joined:
    Apr 8, 2009
    Messages:
    146
    Likes Received:
    6
    Best Answers:
    0
    [​IMG] View gif to more exemple ... Imgur
     
  11. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    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: May 16, 2018
  12. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    Refresh
     
  13. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    Refresh.
     
  14. bayview

    bayview Banned User

    Joined:
    Jan 25, 2018
    Messages:
    620
    Likes Received:
    310
    Best Answers:
    24
    Process of elimination... if it works on one and not the other then the issue is the source and not the map.
     
  15. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    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
    Code (C++):
    1. void House::updateDoorDescription() const
    2. {
    3.     std::ostringstream ss;
    4.     if (owner != 0) {
    5.         ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    6.     } else {
    7.         ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";
    8.  
    9.         const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE);
    10.         if (housePrice != -1) {
    11.             ss << " It costs " << (houseTiles.size() * housePrice) << " gold coins.";
    12.         }
    13.     }
    14.  
    15.     for (const auto& it : doorList) {
    16.         it->setSpecialDescription(ss.str());
    17.     }
    18. }
    And here's the one for the one that is working:

    house.cpp
    Code (C++):
    1. void House::updateDoorDescription() const
    2. {
    3.     std::ostringstream ss;
    4.     if (owner != 0) {
    5.         ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    6.     } else {
    7.         ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";
    8.  
    9.         const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE);
    10.         if (housePrice != -1) {
    11.             ss << " It costs " << (houseTiles.size() * housePrice) << " gold coins.";
    12.         }
    13.     }
    14.  
    15.     for (const auto& it : doorList) {
    16.         it->setSpecialDescription(ss.str());
    17.     }
    18. }
    Absolutely no difference!
     
    Last edited: May 18, 2018
  16. RazorBlade

    RazorBlade Retired Snek

    Joined:
    Nov 7, 2009
    Messages:
    2,028
    Likes Received:
    607
    Best Answers:
    1
    in global.lua you'll see a bunch of doors
    Code (Text):
    1.  
    2. verticalOpenDoors = {
    3.     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,
    4.     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,
    5.     7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9274, 9269, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10485, 10483,
    6.     10786, 12101, 12199, 19851, 19853, 19991, 19993, 20284, 20286, 17238, 13021, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997,
    7.     20290, 22825, 22827, 22829, 22831
    8. }
    9.  
    10. horizontalOpenDoors = {
    11.     1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118,
    12.     5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893,
    13.     6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285,
    14.     10470, 10472, 10476, 10474, 10777, 12094, 12190, 19842, 19844, 19982, 19984, 20275, 20277, 17236, 18209, 13023, 10781, 12096, 12196,
    15.     19846, 19986, 20279, 10783, 12098, 12194, 19848, 19988, 20281, 22816, 22818, 22820, 22822
    16. }
    17.  
    18. openSpecialDoors = {
    19.     1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133,
    20.     5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558,
    21.     9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10781, 12096, 12196, 19846, 19986, 20279,
    22.     10783, 12098, 12194, 19848, 19988, 20281, 10790, 12103, 12205, 19855, 19995, 20288, 10792, 12105, 12203, 19857, 19997, 20290
    23. }
    24.  
    25. questDoors = {
    26.     1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049,
    27.     8551, 8553, 9175,9177, 9277, 9279, 10278, 10280, 10475, 10484, 10782, 12097, 19847, 19987, 20280, 10791, 12104, 12204, 12195, 19856, 19996, 20289,
    28.     22821, 22830
    29. }
    30.  
    31. levelDoors = {
    32.     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,
    33.     9281, 9283, 10282, 10284, 10473, 10482, 10780, 10789, 10780, 12095, 12195, 19845, 19985, 20278, 10789, 12102, 12193, 12202, 19854, 19994, 20287
    34. }
    35.  
    ensure the door id is in the appropriate table. I believe this is all that needs to be adjusted.
     
  17. RazorBlade

    RazorBlade Retired Snek

    Joined:
    Nov 7, 2009
    Messages:
    2,028
    Likes Received:
    607
    Best Answers:
    1
    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 (Text):
    1.  
    2. for k, v in pairs(ti:getHouse():getDoors()) do
    3.                 print(k, v)
    4.             end
    5.  
    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 (Text):
    1.  
    2. void House::addDoor(Door* door)
    3. {
    4.     door->incrementReferenceCounter();
    5.     doorList.push_back(door);
    6.     door->setHouse(this);
    7.     updateDoorDescription();
    8. }
    9.  
    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: May 18, 2018
  18. RazorBlade

    RazorBlade Retired Snek

    Joined:
    Nov 7, 2009
    Messages:
    2,028
    Likes Received:
    607
    Best Answers:
    1
    Best Answer
    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.
     
    Sleet likes this.
  19. Sleet

    Sleet Member

    Joined:
    Sep 3, 2016
    Messages:
    102
    Likes Received:
    7
    Best Answers:
    2
    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 !
     

Share This Page

Loading...