Navigation Menu

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

NPCs don't use doors properly #2

Closed
AmProsius opened this issue Dec 30, 2020 · 2 comments · Fixed by #72
Closed

NPCs don't use doors properly #2

AmProsius opened this issue Dec 30, 2020 · 2 comments · Fixed by #72
Labels
impl: hook script func This issue requires hooking script functions. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session. validation: validated This issue is still present even with Systempack/Union.
Milestone

Comments

@AmProsius
Copy link
Owner

AmProsius commented Dec 30, 2020

Describe the bug
NPCs close doors immediately after opening them and are thus not able to walk through them.

Expected behavior
NPCs now open closed doors properly and walk through them.

@catalinstoian
Copy link

catalinstoian commented Jan 9, 2021

func void B_MoveMob ()
// 5.5.00 Hier muß noch die Abfrage auf Türen rein, wenn sie fertig ist
{
PrintDebugNpc (PD_ZS_FRAME, "B_MoveMob");
//-------- nach blockierendem MOB suchen --------
var string door;
door=Npc_GetDetectedMob (self);
PrintDebugNpc (PD_ZS_CHECK, ConcatStrings("...mob: ", door ));
//-------- blockierendes MOB eine Türe --------
if (Hlp_StrCmp (door, "DOOR"))
{
PrintDebugNpc (PD_ZS_CHECK, "...mob is a door!");
if (self.aivar[AIV_MOVINGMOB] == 0) // versucht der NSC bereits die Tür zu öffnen?
{
PrintDebugNpc (PD_ZS_CHECK, "...Türe wurde noch NICHT versucht zu öffnen!");
self.aivar[AIV_MOVINGMOB] = 1;
Npc_ClearAIQueue(self); // bleib stehen
AI_UseMob (self, door, 1); // falls sie geschlossen ist -> öffnen
}
else
{
PrintDebugNpc (PD_ZS_CHECK, "...Türe wird schon versucht zu öffnen -> geht wohl nicht!");
Npc_PercDisable (self, PERC_MOVEMOB);
self.aivar[AIV_MOVINGMOB] = 0;
AI_StartState (self, ZS_WaitForPassage ,0, "");
};
};

changed to

func void B_MoveMob ()
{	
	var string door; door = Npc_GetDetectedMob(self);
	
	if (Hlp_StrCmp (door, "DOOR"))
	{
		if (Wld_GetMobState (self,door) == 0)
		{
			Npc_ClearAIQueue (self);
		
			AI_UseMob (self, door, 1);
			AI_UseMob (self, door, -1);	//NSC muss sich am Mobsi abmelden, da sonst die Tür wieder zu geht!
		};
	}
	else
	{
		return;
	};	
	AI_ContinueRoutine (self);
};

@szapp
Copy link
Collaborator

szapp commented Jan 16, 2021

@catalinstoian The differences to the original function are quite big (even when ignoring all the PrintDebugNpc calls). Is the usage of AIV_MOVINGMOB no longer required? Also ZS_WaitForPassage and PERC_MOVEMOB seem to be missing.

Can you elaborate how this fix works and why the above mentioned parts are no longer necessary?

@szapp szapp added the type: session fix The fix for this issues is persistent across a session. label Jan 18, 2021
szapp added a commit that referenced this issue Jan 19, 2021
AmProsius added a commit that referenced this issue Jan 21, 2021
@AmProsius AmProsius linked a pull request Jan 21, 2021 that will close this issue
v1.0.0 automation moved this from To Do to Done Jan 21, 2021
szapp added a commit that referenced this issue Jan 21, 2021
@AmProsius AmProsius added this to the v1.0.0 milestone Feb 13, 2021
@AmProsius AmProsius added provided fix This issue has a fix provided in the comments. validation: validated This issue is still present even with Systempack/Union. labels Mar 13, 2021
@szapp szapp added this to Hook Daedalus function in Fix templates Mar 15, 2021
@szapp szapp added the impl: hook script func This issue requires hooking script functions. label Mar 16, 2021
@szapp szapp moved this from Hook Daedalus function to NPC state in Fix templates Mar 16, 2021
@szapp szapp moved this from NPC state to NPC function in Fix templates Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impl: hook script func This issue requires hooking script functions. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session. validation: validated This issue is still present even with Systempack/Union.
Projects
Fix templates
Modify NPC function
v1.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants