OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

LHiver Mod: warning messages at start

Open Try opened this issue 4 months ago • 4 comments

LHiver Mod recognizes new game as outdated save, and print following message:

Image

Routine directly responsible for printing:

func void B_MOD_VERSION() {
  if (VERSION_CHECK_13 == FALSE) {
    AI_PRINTSCREEN("Achtung!", -1, 11, FONT_SCREENBRIGHTLARGE, 7);
    AI_PRINTSCREEN("Alter Spielstand geladen", -1, 14, FONT_SCREENBRIGHTLARGE, 8);
    AI_PRINTSCREEN("damit die Mod richtig funktioniert", -1, 17, FONT_SCREENBRIGHTLARGE, 9);
    AI_PRINTSCREEN("Start", -1, 20, FONT_SCREENBRIGHTLARGE, 10);
    AI_PRINTSCREEN("Neues Spiel!", -1, 23, FONT_SCREENBRIGHTLARGE, 11);
  };
};

B_MOD_VERSION is called at the end of INIT_* function, such as INIT_NEWWORLD.

Here VERSION_CHECK_13 is false, due to been not yet initialized. VERSION_CHECK_13 will be set to true later by DIA_XARDAS_HELLO_INFO dialog.

It appears, that mod expects dialog to run ahead of INIT_* calls.

Try avatar Oct 26 '25 15:10 Try

Added 'help_wanted', as there is no way for me to verify, if original game indeed runs dialogs ahead of INIT_* calls. Such check also suggest, that mod expects INIT_* to run after game is loaded.

Try avatar Oct 26 '25 15:10 Try

I tried to make a log of script functions called directly by the vanilla game. There init function is called before the dialog function.

6505 INIT_GLOBAL
6505 INIT_NEWWORLD
7077 ZS_MM_ALLSCHEDULER
7078 B_REFRESHATINSERT
7078 ZS_MM_ALLSCHEDULER
7078 B_REFRESHATINSERT
7082 ZS_MM_ALLSCHEDULER
7082 B_REFRESHATINSERT
7083 ZS_MM_ALLSCHEDULER
7083 B_REFRESHATINSERT
7083 ZS_MM_ALLSCHEDULER
7084 B_REFRESHATINSERT
7085 ZS_STAND_ARMSCROSSED
7086 B_REFRESHATINSERT
7094 B_ASSESSPORTALCOLLISION
8003 B_ASSESSPLAYER
8007 DIA_XARDAS_HELLO_CONDITION
9551 ZS_MM_RTN_ROAM
9552 ZS_MM_RTN_ROAM
9552 ZS_MM_RTN_REST
9552 ZS_MM_RTN_REST
9553 ZS_MM_RTN_REST
9553 ZS_TALK
....
9735 ZS_MM_RTN_REST_LOOP
9735 ZS_TALK_LOOP
9735 DIA_XARDAS_HELLO_CONDITION
9735 DIA_XARDAS_RITUALINNOSEYEREPAIRIMPORTANT_CONDITION
9736 DIA_XARDAS_HELLO_CONDITION
9736 DIA_XARDAS_HELLO_CONDITION
9736 DIA_XARDAS_HELLO_INFO

In fact B_MOD_VERSION is indeed called but nothing is printed. Switch to ZS_Talk could clear the queue before print is done.

scriptcalls.log

thokkat avatar Oct 28 '25 22:10 thokkat

Thanks for detailed logs, @thokkat !

Switch to ZS_Talk could clear the queue before print is done.

ZS_Talk is not "legal" state for the player, according to isPlayerEnabledState. AFAIK only npc,that you are talking to should be in such state. Another thing to note: ai_printscreen doesn't have npc as a parameter, so maybe it meant for some kind of global queue? Since it's only logging, engine need to clear this global queue on the first tick.

Try avatar Oct 30 '25 20:10 Try

AFAIK only npc,that you are talking to should be in such state.

Ahh somehow I was thinking this is going to Xardas queue :D.

it meant for some kind of global queue?

Here someone is suggesting it goes to hero queue.

clear this global queue on the first tick

I added other functions to test (both queue and instant) but nothing worked. zspy log says hero is created afterwards.

-4-	25:27 Info:  3 U:       GAM: Startup-Script finished. .... <oGame.cpp,#866>
-4-	25:27 Info:  3 U:       GAM: Calling Init-Script ... .... <oGame.cpp,#888>
.....
-3-	25:27 Warn:  0 C:       SCRIPT: last parser func-name: INIT_NEWWORLD .... <oGameExternal.cpp,#262>
-3-	25:27 Warn:  0 C:       SCRIPT: AI_GotoWP(): illegal param: "INIT_NEWWORLD.HERO" is NULL. .... <oGameExternal.cpp,#252>
-3-	25:27 Warn:  0 C:       SCRIPT: last parser func-name: INIT_NEWWORLD .... <oGameExternal.cpp,#262>
-3-	25:27 Warn:  0 C:       SCRIPT: Npc_CreateInvItem(): illegal param: "HERO" is NULL. .... <oGameExternal.cpp,#252>
-3-	25:27 Warn:  0 C:       SCRIPT: last parser func-name: INIT_NEWWORLD .... <oGameExternal.cpp,#262>
-3-	25:27 Warn:  0 C:       SCRIPT: AI_EquipBestMeleeWeapon(): illegal param: "INIT_NEWWORLD.HERO" is NULL. .... <oGameExternal.cpp,#252>
-3-	25:27 Warn:  0 C:       SCRIPT: last parser func-name: INIT_NEWWORLD .... <oGameExternal.cpp,#262>
-3-	25:27 Warn:  0 C:       SCRIPT: EquipItem(): illegal param: "HERO" is NULL. .... <oGameExternal.cpp,#252>
-3-	25:27 Warn:  0 C:       SCRIPT: last parser func-name: INIT_NEWWORLD .... <oGameExternal.cpp,#262>
-4-	25:27 Info: 10 U:       (oCWorld::CreateVob) 11471 .... <oWorld.cpp,#315>
-4-	25:27 Info:  9 U:       NPC: Loading Script-NPC  .... <oNpc.cpp,#1624>
-4-	25:27 Info:  7 U:       NPC: NPC - Instance : PC_HERO .... <oNpc.cpp,#1627>
-4-	25:27 Info:  8 C:       MAG: constructed magbook .... <oMagic.cpp,#249>
-4-	25:27 Info:  9 U:       NPC: Finished Script-NPC. .... <oNpc.cpp,#1703>
-4-	25:27 Info:  3 U:       GAM: Init-Script finished. .... <oGame.cpp,#892>
-4-	25:27 Info:  3 B:     ---------- 92% ---------- .... <zViewProgressbar.cpp,#142>
-4-	25:27 Info:  9 B:     (oCGame::EnterWorld) .... <oGame.cpp,#3011>
-4-	25:27 Info:  3 B:     ---------- 93% ---------- .... <zViewProgressbar.cpp,#142>
-4-	25:27 Info: 10 U:     (oCWorld::CreateVob) PC_HERO .... <oWorld.cpp,#307>
-4-	25:27 Info: 10 U:     (oCWorld::CreateVob) 11471 .... <oWorld.cpp,#315>
-4-	25:27 Info:  9 U:     NPC: Loading Script-NPC  .... <oNpc.cpp,#1624>
-4-	25:27 Info:  7 U:     NPC: NPC - Instance : PC_HERO .... <oNpc.cpp,#1627>
-4-	25:27 Info:  8 C:     MAG: constructed magbook .... <oMagic.cpp,#249>
-4-	25:27 Info:  9 U:     NPC: Finished Script-NPC. .... <oNpc.cpp,#1703>

thokkat avatar Nov 02 '25 13:11 thokkat