OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

Sleepping golems do not awake

Open Try opened this issue 3 years ago • 1 comments

изображение

Relevant script:

func void B_GolemRise()
{
	if((Npc_GetDistToNpc(self,hero) <= 700) && (Mob_HasItems("NW_GOLEMCHEST",ItSe_Golemchest_Mis) == 0))
	{
		AI_PlayAni(self,"T_RISE");
		self.noFocus = FALSE;
		self.name[0] = "Steingolem";
		self.flags = 0;
		AI_StartState(self,ZS_MM_Attack,0,"");
		self.bodyStateInterruptableOverride = FALSE;
		self.start_aistate = ZS_MM_AllScheduler;
		self.aivar[AIV_MM_RestStart] = OnlyRoutine;
	};
};

The animation "T_RISE" has "S_DEAD" as followup what is quite confusing.

Try avatar Jul 28 '22 16:07 Try

I used clearAiQueue in startState and set hnpc.senses=1 which made it work except the one frame dead animation. Interestingly AI_StartState(self,ZS_MM_Attack,0,""); doesn't do anything. Golem goes to normal state later and is then triggered by enemy perc. Vanilla has same behavior.

Another case where clearAiQueue helps is attacking wandering npc's in G1. Script wants to attack but it's blocked by some goto command.

thokkat avatar Jan 09 '24 21:01 thokkat

partially fixed by fccda5bec4afede9d31d90889eec4c99e80fc2d6

now golem eventually wakes up, but 'T_RISE` plays several times instead of one

Try avatar Apr 09 '24 20:04 Try

I used clearAiQueue in startState

Tested today on the golem - yes it works, ai-queue is no longer throttle. Still need to test much of the game, as change will affect all ai-scheduling :(

Try avatar Apr 09 '24 21:04 Try

Tested - works well; committed at 11cb3d8c

Try avatar Apr 14 '24 20:04 Try