• 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+ Walk Through GMs

pink_panther

Excellent OT User
Joined
Sep 10, 2016
Messages
1,162
Solutions
13
Reaction score
600
Location
Kazordoon
I use the Nostalrius distro, but am also looking at the latest TFS 1.5 in regards to walking through players.

What I want to is for players to be able to walk through GM characters, regardless of whether they are invisible/ghost or not.

Likewise, I want GM chars to be able to walk through creatures and players, regardless of whether they are invisible/ghost or not. Possibly even walls/unwalkable tiles, but this is less of concern.

Anyone have this done?
 
maybe that one will point You some
i found it here in other topic

go to src > game.cpp
change that
C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
to this
C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    if (player->getGroup()->access) {
        if (player->getDirection() == dir) {
            auto pos = player->getPosition();
            auto nextPos = getNextPosition(dir, pos);
            internalTeleport(player, nextPos, true);
        }
    }

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
hold CTRL and now you can walk where you want
 
maybe that one will point You some
i found it here in other topic

go to src > game.cpp
change that
C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
to this
C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    if (player->getGroup()->access) {
        if (player->getDirection() == dir) {
            auto pos = player->getPosition();
            auto nextPos = getNextPosition(dir, pos);
            internalTeleport(player, nextPos, true);
        }
    }

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
hold CTRL and now you can walk where you want
nice man, but i will just do the auto "teleport".
i'm looking for the walk through
 
nice man, but i will just do the auto "teleport".
i'm looking for the walk through
yea, i know
but with that, You dont have to type any :)
Post automatically merged:

btw - i think its just should be edited with some like

void Game::playerWalk(uint32_t playerId, Direction dir)
{
Player* player = getPlayerByID(playerId);
if (!god) {
return;

idk, im not a programmer - im learning still - but at this point i know nothing is impossible :)
 
yea, i know
but with that, You dont have to type any :)
i will use it while.. ty!!!
yea, i know
but with that, You dont have to type any :)
Post automatically merged:

btw - i think its just should be edited with some like

void Game::playerWalk(uint32_t playerId, Direction dir)
{
Player* player = getPlayerByID(playerId);
if (!god) {
return;

idk, im not a programmer - im learning still - but at this point i know nothing is impossible :)
thank you again.. I am also an inspiration to programming. I learn the codes by deduction.. but this one is hard haha
 
i will use it while.. ty!!!

thank you again.. I am also an inspiration to programming. I learn the codes by deduction.. but this one is hard haha
so I am...

i think that works like that:

C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    } // till here its tell You about action of holding CTRL (like to change direction of character, "dancing" etc)

    if (player->getGroup()->access) {
        if (player->getDirection() == dir) {
            auto pos = player->getPosition();
            auto nextPos = getNextPosition(dir, pos);
            internalTeleport(player, nextPos, true);
        }
    } // till here it tells You, that if GOD hold a CTRL it could goes thru anything (Teleport part) but PLAYER cant

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
 
so I am...

i think that works like that:

C++:
void Game::playerTurn(uint32_t playerId, Direction dir)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    } // till here its tell You about action of holding CTRL (like to change direction of character, "dancing" etc)

    if (player->getGroup()->access) {
        if (player->getDirection() == dir) {
            auto pos = player->getPosition();
            auto nextPos = getNextPosition(dir, pos);
            internalTeleport(player, nextPos, true);
        }
    } // till here it tells You, that if GOD hold a CTRL it could goes thru anything (Teleport part) but PLAYER cant

    player->resetIdleTime();
    internalCreatureTurn(player, dir);
}
yeah man, that one i got it, i'm looking for the "if in ghost mode, walk trough" part

edit: ctrl + dir working good here! đź‘Š
 
Last edited:
I use the Nostalrius distro, but am also looking at the latest TFS 1.5 in regards to walking through players.

What I want to is for players to be able to walk through GM characters, regardless of whether they are invisible/ghost or not.

Likewise, I want GM chars to be able to walk through creatures and players, regardless of whether they are invisible/ghost or not. Possibly even walls/unwalkable tiles, but this is less of concern.

Anyone have this done?
I know this is a topic from a year ago, but it still hasn't resolved walk through via invisible gm.

Solution:
In tile.cpp
C++:
const CreatureVector* creatures = getCreatures();
        if (const Player* player = creature->getPlayer()) {
            if (creatures && !creatures->empty() && !hasBitSet(FLAG_IGNOREBLOCKCREATURE, flags) && !player->isAccessPlayer()) {
                return RETURNVALUE_NOTPOSSIBLE;
            }
change to
C++:
const CreatureVector* creatures = getCreatures();
        if (const Player* player = creature->getPlayer()) {
            if (creatures && !creatures->empty() && !hasBitSet(FLAG_IGNOREBLOCKCREATURE, flags) && !player->isAccessPlayer()) {
                for (const Creature* tileCreature : *creatures) {
                    if (!tileCreature->isInGhostMode()) {
                        return RETURNVALUE_NOTENOUGHROOM;
                    }
                }
            }
This code does not debug the engine while the GM will follow the player.
 
I know this is a topic from a year ago, but it still hasn't resolved walk through via invisible gm.

Solution:
In tile.cpp
C++:
const CreatureVector* creatures = getCreatures();
        if (const Player* player = creature->getPlayer()) {
            if (creatures && !creatures->empty() && !hasBitSet(FLAG_IGNOREBLOCKCREATURE, flags) && !player->isAccessPlayer()) {
                return RETURNVALUE_NOTPOSSIBLE;
            }
change to
C++:
const CreatureVector* creatures = getCreatures();
        if (const Player* player = creature->getPlayer()) {
            if (creatures && !creatures->empty() && !hasBitSet(FLAG_IGNOREBLOCKCREATURE, flags) && !player->isAccessPlayer()) {
                for (const Creature* tileCreature : *creatures) {
                    if (!tileCreature->isInGhostMode()) {
                        return RETURNVALUE_NOTENOUGHROOM;
                    }
                }
            }
This code does not debug the engine while the GM will follow the player.
note: dont /goto player in ghost mode, and turn visible mode on inside the player.. it can bug ^^
 
Back
Top