Jump to content

Attack Commands don't get issued until attack animation starts


rezecib
  • Pending

In single-player, followers will acquire your target as soon as you begin targeting an enemy (e.g. clicking/ctrl+clicking, or pressing F near an enemy). In DST, however, they don't acquire your target until you start the animation. This is a significant problem for characters that rely on followers (Maxwell, Wendy, Webber).

The issue seems to be that in single-player, the ATTACK commands are instant, which means their function gets run as soon as the bufferedaction gets pushed. Due to architecture changes in DST, ATTACK actions don't work when instant. However, this can be fixed by checking the action type in LocoMotor:PushAction():

	if bufferedaction.action == ACTIONS.ATTACK then
		bufferedaction.doer.components.combat:SetTarget(bufferedaction.target)
	end

Seeing as this function already has a couple of special cases for particular actions, it doesn't seem unreasonable to put it here, although perhaps there is a better place to put it.

This fix works for both clients without movement prediction and hosts, and only requires the change in the server-side locomotor component.

For clients with movement prediction, the neatest way I could find to do it was to add a new RPC that gets sent from LocoMotor:PreviewAction, using the same logic:

	if bufferedaction.action == ACTIONS.ATTACK then
		SendRPCToServer(RPC.SetTarget, bufferedaction.target)
	end

The handler for it is:

    SetTarget = function(player, target)
		if player then
			player.components.combat:SetTarget(target)
		end
    end,

 


Steps to Reproduce
Have followers (Abigail, spiders, shadow duelists), and ctrl+F near a butterfly. The followers don't go after the butterfly until you start the attack animation. With the fix, they target as soon as your character starts moving toward the target.
  • Like 2



User Feedback




Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...