1

Topic: Hook releas?

Heelo,
so i am trying to change the hook time for normal hookable tiles, so it behaves like when you hook a player, where the hook releases after a certain time.
So what I did was just copying the code I found for the normal release with the player and removing all the parts where it mentions the player.

(bottom if is mine)
// release hook (max hook time is 1.25
        m_HookTick++;
        if(m_HookedPlayer != -1 && (m_HookTick > SERVER_TICK_SPEED+SERVER_TICK_SPEED/5 || !m_pWorld->m_apCharacters[m_HookedPlayer]))
        {
            m_HookedPlayer = -1;
            m_HookState = HOOK_RETRACTED;
            m_HookPos = m_Pos;
        }

        if(m_HookTick > SERVER_TICK_SPEED/3)
        {
            m_HookedPlayer = -1;
            m_HookState = HOOK_RETRACTED;
            m_HookPos = m_Pos;
        }

This works to some extent, but it introduces a strange bug, where when the player hooks on to a ledge sideways or directly under a tile, it waits around 5 seconds and then the frame jumps to the player's actual position on the ground.

Someone have an idea what could cause this?
Not really experienced with programming xD but is fun to dig through the code so far.

Hope yall have a nice day smile.

2

Re: Hook releas?

So you actually try to introduce some sort of "hook timer" for walls?

If so, I can tell you the problem.

It's caused by client-side prediction. As far as I am aware, the client only supports either 'wall is hookable' -> hook and unhook OR 'wall is not hookable' -> reject hooking.

Everything else will just mess with the client's expectation (prediction) of what should (or shouldn) happen. It is possible to cheat a lil bit on the prediction, but it won't ever work perfectly - especially with higher latencies (50+ ms).
It would be possible to do if you introduce new hookable tiles and/or a custom client (which is fine for testing and playing with stuff, but such mods never get famous).

I hope my answer fulfilled your questioning wink