• 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!

TFS 1.X+ problem in walls tfs 1.5 nekiro 7.72

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
879
Solutions
7
Reaction score
122
Location
Brazil
YouTube
caruniawikibr
the problem comes down to the player's position with the wall. depending on the position you can't take the items off the wall or light a lamp.
Post automatically merged:

one person told me it could be an isSightClear function, which would be something diagonal. Does anyone here know about this function?
 
Last edited:
the problem comes down to the player's position with the wall. depending on the position you can't take the items off the wall or light a lamp.
Post automatically merged:

one person told me it could be an isSightClear function, which would be something diagonal. Does anyone here know about this function?
i think the same gonna do a research the only codes related to sight is in map.cpp
 
creature.cpp
Linha 185: if (g_game.isSightClear(getPosition(), attackedCreature->getPosition(), true)) {
Linha 1604: if (fpp.clearSight && !g_game.isSightClear(testPos, targetPos, true)) {

game.cpp
Linha 3758: bool Game::isSightClear(const Position& fromPos, const Position& toPos, bool sameFloor /= false/) const
Linha 3760: return map.isSightClear(fromPos, toPos, sameFloor);
game.h
Linha 458: bool isSightClear(const Position& fromPos, const Position& toPos, bool sameFloor = false) const;

luascript.cpp
Linha 2124: registerMethod("Position", "isSightClear", LuaScriptInterface::luaPositionIsSightClear);
Linha 2124: registerMethod("Position", "isSightClear", LuaScriptInterface::luaPositionIsSightClear);
Linha 4903: int LuaScriptInterface::luaPositionIsSightClear(lua_State* L)
Linha 4905: // position:isSightClear(positionEx[, sameFloor = true])
Linha 4909: pushBoolean(L, g_game.isSightClear(position, positionEx, sameFloor));
luascrip.h
Linha 600: static int luaPositionIsSightClear(lua_State* L);
 
Last edited:
upup this is not in the main tfs repository does anybody knows is the bug was in there too and where could be the commit to fix it? pleasee
 
good I managed to find out the reason for the bug, but I didn't find out how to solve it.
It turns out that version 7.72 of Nekiro is a very difficult version to find compatible programs.
it happens that when I save it in the object builder I save it as 7.6 because the map editor and the item editor only exist in that version. version 7.72 doesn't exist at all, just for Nekiro. so for that reason the walls bugam.
If anyone knows how to fix this. I would appreciate it. pay for the service if necessary.
 
Last edited:
no, I believe it has to do with the source, because nekiro's new source doesn't have the hangables like the old sourcers. so I think this should influence, because the old editor item is different from the new one. I think the problem is there, but I don't know if anyone knows how to solve it
Post automatically merged:

I really wanted to know how to fix this, I've tried everything, I've changed the otb items, but it doesn't work, my xml and otb items were original from nekiro 7.72 and my sprites were taken from the original tibia on the tibiabr website. so I believe that the source would be the place to fix it
 
Last edited:
Has anyone had this error, managed to fix it? for me this error is a problem, because I am making several wall items, this would be a problem
 
Try to change this line
C++:
if (player->getPosition().y + 1 == tile->getPosition().y)

For this one
C++:
if ((player->getPosition().y + 1 || player->getPosition().y - 1) == tile->getPosition().y)

Compile, test it and let us know if it helps
I did that and the problem is 50% solved, now I can remove it from the wall, but I can't put it back

any ID, I'm testing it on a normal venore wall.


I believe you can solve the problem through these 2 scripts in game.cpp but I don't know how

Lua:
if (item->isHangable() && toCylinderTile->hasFlag(TILESTATE_SUPPORTS_HANGABLE)) {
        //destination supports hangable objects so need to move there first
        bool vertical = toCylinderTile->hasProperty(CONST_PROP_ISVERTICAL);
        if (vertical) {
        if (playerPos.x + 1 == mapToPos.x) {
        player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
        return;
    }
    } else { // horizontal
        if (playerPos.y + 1 == mapToPos.y) {
        player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
        return;
    }

Lua:
if (thing && thing->getItem()) {
        if (tile->hasProperty(CONST_PROP_ISVERTICAL)) {
            if ((player->getPosition().x + 1 || player->getPosition().x - 1) == tile->getPosition().x) {
                thing = nullptr;
            }
        } else { // horizontal
            if ((player->getPosition().y + 1 || player->getPosition().y - 1) == tile->getPosition().y) {
                thing = nullptr;
            }
        }
    }
Post automatically merged:

I can remove items diagonally, but I can't place them on the wall in these positions

Screenshot_1.pngScreenshot_2.png
 
Last edited:
C++:
            if (thing && thing->getItem()) {
                if (tile->hasProperty(CONST_PROP_ISVERTICAL)) {
                    if (player->getPosition().x + 1 == tile->getPosition().x) {
                        thing = nullptr;
                    }
                } else { // horizontal
                    if (player->getPosition().y + 1 == tile->getPosition().y) {
                        thing = nullptr;
                    }
                }
            }

C++:
    if (item->isHangable() && toCylinderTile->hasFlag(TILESTATE_SUPPORTS_HANGABLE)) {
        //destination supports hangable objects so need to move there first
        bool vertical = toCylinderTile->hasProperty(CONST_PROP_ISVERTICAL);
        if (vertical) {
            if (playerPos.x + 1 == mapToPos.x) {
                player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
                return;
            }
        } else { // horizontal
            if (playerPos.y + 1 == mapToPos.y) {
                player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
                return;
            }
        }

Send me your game.cpp
 
game
Post automatically merged:

if the problem is my otb item, I don't know how to fix it, I've tested several otb, usually bug my remers, this item otb i got it from nekiro 7.72
 

Attachments

Back
Top