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

How do you make insta push?

Lopaskurwa

Well-Known Member
Joined
Oct 6, 2017
Messages
936
Solutions
2
Reaction score
57
TFS 1.2 So now if you push players when you stand next to him it takes some time until he get pushed but its fine i dont mind it but when you want to push player in pvp it would be great to have a function when you are away from player and you push him your character runs to him and it pushes him instantly because now it doesnt it still takes some time until he get pushed. Its kinda hard to explain what i mean
Post automatically merged:

TFS 1.2 So now if you push players when you stand next to him it takes some time until he get pushed but its fine i dont mind it but when you want to push player in pvp it would be great to have a function when you are away from player and you push him your character runs to him and it pushes him instantly because now it doesnt it still takes some time until he get pushed. Its kinda hard to explain what i mean
Basically exact this stuff when you are away it pushes insta with 0 delay
 
Last edited:
Solution
You'll have to edit the delay in your game.cpp find this
C++:
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)
{
    if (!player->canDoAction()) {
        uint32_t delay = player->getNextActionTime();
        SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,
            this, player->getID(), movingCreature->getID(), movingCreatureOrigPos, toTile->getPosition()));
        player->setNextActionTask(task);
        return;
    }

    player->setNextActionTask(nullptr);

    if (!Position::areInRange<1, 1, 0>(movingCreatureOrigPos, player->getPosition())) {
        //need to walk to the creature first before moving it...
You'll have to edit the delay in your game.cpp find this
C++:
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)
{
    if (!player->canDoAction()) {
        uint32_t delay = player->getNextActionTime();
        SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,
            this, player->getID(), movingCreature->getID(), movingCreatureOrigPos, toTile->getPosition()));
        player->setNextActionTask(task);
        return;
    }

    player->setNextActionTask(nullptr);

    if (!Position::areInRange<1, 1, 0>(movingCreatureOrigPos, player->getPosition())) {
        //need to walk to the creature first before moving it
        std::forward_list<Direction> listDir;
        if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true)) {
            g_dispatcher.addTask(createTask(std::bind(&Game::playerAutoWalk,
                                            this, player->getID(), listDir)));
            SchedulerTask* task = createSchedulerTask(1500, std::bind(&Game::playerMoveCreatureByID, this,
                player->getID(), movingCreature->getID(), movingCreatureOrigPos, toTile->getPosition()));
            player->setNextWalkActionTask(task);
        } else {
            player->sendCancelMessage(RETURNVALUE_THEREISNOWAY);
        }
        return;
    }
1500 = 1.5 second, You'll have to change yours to 0 for instant push without any delay
 
Solution
Back
Top