gothic-1-community-patch icon indicating copy to clipboard operation
gothic-1-community-patch copied to clipboard

SVM samples choked off on state change

Open AmProsius opened this issue 4 years ago • 2 comments

Describe the bug SVM samples might be choked off when the NPC changes their state.

Expected behavior SVM samples are no longer choked off when the NPC changes their state.

Additional context

//////////////////////////////////////////////////////////////////////////
//    DB_Say
//    ===========
//    Ein Ersatz für B_SayOverlay, das leider durch Bug #3046 beim
//    Zustandwechsel abgewürgt wird, und das ist praktisch immer
//    wenn diese Funktion aufgerufen wird...
//    es werden nur einige B_SayOverlay's ersetzt, manche funzen auch
//////////////////////////////////////////////////////////////////////////
func void DB_Say(var C_NPC slf, var C_Npc oth, var string text)
{
    B_SmartTurnToNpc(slf, oth);

    if ( (slf.voice > 0) && (slf.voice < 15) ) {
        AI_OutputSVM_Overlay(slf, oth, ConcatStrings("$", text)); // Mundbewegung + Textfenster
        Snd_Play3d(slf, ConcatStrings(ConcatStrings("SVM", IntToString(slf.voice)), text) ); // COOL! ;)
    };
};

AmProsius avatar Feb 17 '21 21:02 AmProsius

I suppose the fix can be something like this:

https://github.com/AmProsius/gothic-1-community-patch/blob/2775fbc70322594ed1d00c96717143f0c2af5af7/scriptbase/_work/Data/Scripts/Content/AI/AI_Intern/B_Functions.d#L129-L140

changed to

func void B_SayOverlay(var C_NPC slf, var C_Npc oth, var string text)
{
    var string pipe;

    pipe = ConcatStrings("B_SayOverlay: ", text);
    PrintDebugNpc       (PD_ZS_FRAME, pipe );

    B_SmartTurnToNpc    (slf, oth);

    if ( (slf.voice > 0) && (slf.voice < 15) ) {
        var string slicedText;

        AI_OutputSVM_Overlay(slf, oth, text);

        slicedText = Substring(text, 1); //AmProsius: Substring is a placeholder for a function that cuts the $ from text.
        Snd_Play3d(slf, ConcatStrings(ConcatStrings("SVM", IntToString(slf.voice)), slicedText) );
    };
};

AmProsius avatar Feb 18 '21 07:02 AmProsius

It may be much cleaner to compare the differences between Gothic 1 and Gothic 2 (where the problem does not seem to arise) and solve the problem (possibly on engine level) how it is done in Gothic 2.

szapp avatar May 13 '21 13:05 szapp