• 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+ Match character movement duration to diagonal movement cooldown.

kubiczi123

RoFT- First and last memb
Joined
Dec 30, 2011
Messages
77
Reaction score
2
Location
Poland
Hey. Im in search of improving the UX of player movement.
Currently the character moves diagonally very fast, then has to wait.
Is there a way to sync the character movement speed with the movement cooldown? (As in, you can walk right again after the diagonal movement animation is done)
Post automatically merged:

Alright nevermind...
Already found it.
client/src/creature.cpp
C++:
void Creature::updateWalk(const bool isPreWalking)
{
    const float walkTicksPerPixel = getStepDuration(true) / static_cast<float>(g_gameConfig.getSpriteSize());
    const int totalPixelsWalked = std::min<int>(m_walkTimer.ticksElapsed() / walkTicksPerPixel, g_gameConfig.getSpriteSize());
    // needed for paralyze effect
    m_walkedPixels = std::max<int>(m_walkedPixels, totalPixelsWalked);
    updateWalkAnimation();
    updateWalkOffset(m_walkedPixels);
    updateWalkingTile();
    if (m_walkedPixels == g_gameConfig.getSpriteSize()) {
        if (isPreWalking) resetWalkAnimationPhase(true);
        else terminateWalk();
    }
}

Simply change the "true" in getStepDuration() to "false".
C++:
uint16_t Creature::getStepDuration(bool ignoreDiagonal, Otc::Direction dir)
 
Back
Top