Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bots run back to human after unpause lead order #91

Closed
4512369781 opened this issue May 16, 2024 · 1 comment
Closed

Bots run back to human after unpause lead order #91

4512369781 opened this issue May 16, 2024 · 1 comment
Assignees

Comments

@4512369781
Copy link

When "MovePos" exists, always refresh it.
If not do this, in "BotFinalizeCurrentOrder()" func, 'nextPos' may be equal to 'CurrentOrder.DestPos', and bots will not refresh the move command. In testing, bots often ran back to human, after a few secends they start lead order again.

::Left4Bots.AIFuncs.BotOnResume <- function ()
{
	L4B.Logger.Debug("[AI]" + self.GetPlayerName() + " [->]");
	if (L4B.Settings.pause_debug)
		Say(self, "[->]", false);
	
	if (MovePos)
		NeedMove = 2; // Refresh previous MOVE
	
	if (MoveType == AI_MOVE_TYPE.Order && CurrentOrder.OrderType == "lead")
	{
		if (CurrentOrder.DestPos)
		{
			// If we are executing a "lead" order and, during the pause, we moved ahead of the next position, the last MOVE will take us backwards. Better finalize the order to re-calc the next position from here
			BotFinalizeCurrentOrder();
		}

		if ((CurTime - L4B.LastLeadStartVocalize) >= L4B.Settings.lead_vocalize_interval)
		{
			L4B.SpeakRandomVocalize(self, L4B.VocalizerLeadStart, RandomFloat(0.4, 0.9));
			L4B.LastLeadStartVocalize = CurTime;
		}
	}
}
@smilz0
Copy link
Owner

smilz0 commented May 24, 2024

Thx

@smilz0 smilz0 closed this as completed in 74a587b Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants