Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Ergebnis 1 bis 5 von 5
  1. Beiträge anzeigen #1 Zitieren
    Warrior Avatar von Czudak
    Registriert seit
    Sep 2015
    Beiträge
    415
     
    Czudak ist offline

    An External Function Stopped Working

    Hi!

    Made a clean install of Gothic 2 Gold, previously erasing all entries for it (and derivatives like SystemPack and tools) from registry and/or disk. Then added those below as follows:

    1. Gothic 2 report version v2.6.0.0 rev2
    2. Gothic 2 PlayerKit v2.8
    3. Gothic 2 Systempack v1.7
    4. ModKit v2.6 + v2.6a patch.

    No Ikarus, LeGo or AST script packets/tools. I'm using GothicSourcer, but made a fresh install for it too.

    Now, the issue: the AI_PrintScreen external function stopped working all of a sudden. If it's called anywhere, it seemingly doesn't work, because nothing is displayed. I had to replace the spots with AI_PrintScreen with PrintScreen, but that's not convenient, because the latter fires right away if it's in a function, thus resulting in garbled messages and abused dialogues' flow.

    Apparently, the AI_PrintScreen function's syntax is like this:

    Code:
    func int AI_PrintScreen (var string s0, var int i1, var int i2, var string s3, var int i4)
    And it's identical to PrintScreen function's syntax:

    Code:
    func int PrintScreen (var string s0, var int i1, var int i2, var string s3, var int i4)
    But the first doesn't work and the other does.

    What gives? Did that happen to anyone while they were modding the game?
    Geändert von Czudak (15.06.2019 um 05:49 Uhr)

  2. Beiträge anzeigen #2 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    643
     
    N1kX ist offline
    Zitat Zitat von Czudak Beitrag anzeigen
    Hi!


    Apparently, the AI_PrintScreen function's syntax is like this:

    Code:
    func int AI_PrintScreen (var string s0, var int i1, var int i2, var string s3, var int i4)
    And it's identical to PrintScreen function's syntax:

    Code:
    func int PrintScreen (var string s0, var int i1, var int i2, var string s3, var int i4)
    But the first doesn't work and the other does.
    Hi. A little wrong, the function has the following form:
    Code:
    func int AI_PrintScreen(var string text, var int x, var int y, var string font, var int timeSec);
    For example, you can see how the output of information looks like that the hero found something by opening a clam.
    \Content\Items\IT_Addon_Shells.d
    Line 64
    Code:
    AI_PrintScreen(PRINT_NOTHINGTOGET02, -1, YPOS_ItemGiven, FONT_ScreenSmall, 2);
    Same with the second function:
    func int PrintScreen(var string text, var int x, var int y, var string font, var int timeSec);
    For an example:
    \Content\Story\Dialog_Mobsis\PrayShrine.d line 171
    Code:
    PrintScreen(Pray_Paladin1, -1, 33,FONT_ScreenSmall,3);

  3. Beiträge anzeigen #3 Zitieren
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist gerade online
    @Czudak: There was a similar error in LeGo in 2016 (see here), but you are absolutely sure that the scripts you are using are not based on LeGo, e.g. some mod that uses LeGo?

    An alternative approach: AI_PrintScreen is added to the AI-Queue (of the hero?). Do you have any scripts that may cause the AI-Queue to be cleared frequently? (Npc_ClearAIQueue)
    If you are using some version control (e.g. git), you can check at what time the error was first introduced.

    You could also temporarily go back to the original scripts and make sure AI_PrintScreen works with those to ensure the problem is not caused by something outside of the scripts.

    Zitat Zitat von N1kX Beitrag anzeigen
    Hi. A little wrong, the function has the following form:
    Code:
    func int AI_PrintScreen(var string text, var int x, var int y, var string font, var int timeSec);
    For example, you can see how the output of information looks like that the hero found something by opening a clam.
    \Content\Items\IT_Addon_Shells.d
    Line 64
    Code:
    AI_PrintScreen(PRINT_NOTHINGTOGET02, -1, YPOS_ItemGiven, FONT_ScreenSmall, 2);
    Same with the second function:

    For an example:
    \Content\Story\Dialog_Mobsis\PrayShrine.d line 171
    Code:
    PrintScreen(Pray_Paladin1, -1, 33,FONT_ScreenSmall,3);
    Where is the difference? The names of the arguments don't matter, only the types need to be right.

  4. Beiträge anzeigen #4 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    643
     
    N1kX ist offline
    To understand the essence of the problem, it is desirable to see an example of a user in which the output does not work.
    And so the arguments that ZenGin should not distort.

  5. Beiträge anzeigen #5 Zitieren
    Warrior Avatar von Czudak
    Registriert seit
    Sep 2015
    Beiträge
    415
     
    Czudak ist offline
    Zitat Zitat von Milky-Way Beitrag anzeigen
    @Czudak: There was a similar error in LeGo in 2016 (see here), but you are absolutely sure that the scripts you are using are not based on LeGo, e.g. some mod that uses LeGo?

    An alternative approach: AI_PrintScreen is added to the AI-Queue (of the hero?). Do you have any scripts that may cause the AI-Queue to be cleared frequently? (Npc_ClearAIQueue)
    If you are using some version control (e.g. git), you can check at what time the error was first introduced.

    You could also temporarily go back to the original scripts and make sure AI_PrintScreen works with those to ensure the problem is not caused by something outside of the scripts.



    Where is the difference? The names of the arguments don't matter, only the types need to be right.
    Zitat Zitat von N1kX Beitrag anzeigen
    Hi. A little wrong, the function has the following form:
    Code:
    func int AI_PrintScreen(var string text, var int x, var int y, var string font, var int timeSec);
    For example, you can see how the output of information looks like that the hero found something by opening a clam.
    \Content\Items\IT_Addon_Shells.d
    Line 64
    Code:
    AI_PrintScreen(PRINT_NOTHINGTOGET02, -1, YPOS_ItemGiven, FONT_ScreenSmall, 2);
    Same with the second function:

    For an example:
    \Content\Story\Dialog_Mobsis\PrayShrine.d line 171
    Code:
    PrintScreen(Pray_Paladin1, -1, 33,FONT_ScreenSmall,3);
    All right. To address y'all and your points in an orderly fashion:

    1. [N1kX] Your syntax is more detailed, but since I knew it to begin with, and I assumed the users checking this thread would be aware of it as well, I posted the general one (with integers and strings only).

    Anyway, my main concern with the AI_PrintScreen not working was the B_GiveInvItems function, which controls the flow of giving and receiving items (including gold). With the PrintScreen instead of AI_PrintScreen here, each instance of trading/exchanging items between the player and an NPC resulted in a gory, textual mess.

    2. [Milky-Way] I'm 100% positive there is no LeGo script packet among my installed tools anywhere. Also, I didn't add/expand upon any script that could mess with AI queues; everything was as vanilla as it could get, based on the clean scripts of the original Gothic 2 Gold.

    But you have a point: maybe it's time to use some sort of repository to track my changes to the scripts. I will look into that later.

    ---------------------------------

    The issue was fixed by replacing the "core" scripts (_INTERN\*.*, AI\*.*, and FAI\*.*) in my mod with the clean versions from here (Original English Gothic Scripts, Final Revision), as Milky-Way suggested.

    I used a diff-checker (WinMerge) to look up the differences, and the only ones were different cases (uppercase where lowercase was inserted and vice versa; and some occassional camelcase wedged in between). Maybe it's because a randomly botched compilation with the GothicSourcer?

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide