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 17 von 17
  1. Beiträge anzeigen #1 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline

    PC_Hero Untertitel sowie bei NPCs

    Ist es möglich, dass die Untertitel vom PC_Hero, wie bei den Gesprächspartner NPCs, mit gelben Text und Namen angezeigt werden?


    Ich möchte ermöglichen, dass man dem Helden einen Namen geben kann, das wird in diesem Thread erläutert: https://forum.worldofplayers.de/foru...harakter-wahl?

    Cool wäre es dann halt noch, wenn man den Namen auch in den Dialogen sieht und nicht nur zB im Charaktermenü.

  2. Beiträge anzeigen #2 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.473
     
    lali ist offline
    Ich hätte eine ähnliche Frage: Ich würde gern den gelben Farbton bei den NPC-Dialogen abschalten.
    Phoenix Dev | Website | Discord

  3. Beiträge anzeigen #3 Zitieren
    Provinzheld
    Registriert seit
    Mar 2010
    Ort
    Berlin
    Beiträge
    201
     
    withmorten ist offline
    Gelben Farbton abschalten kann ich dir sagen :D Das andere geht auch.

    In oCNpc::EV_PlaySound (0x007584F0), wird bei 0x007650CB + 1 der offset für NPC_COLOR_TALK_PC (was ne zCOLOR 0xFFFFFFFF ARGB ist) gepushed. Der offset ist 0x00AB1FDC. Das ist für Dialoge vom Helden. Der call von zCView::DialogMessageCXY() ist hier bei 0x00758ABD

    Bei 0x00758B1D + 1 wird der offset für NPC_COLOR_TALK_NPC (was ne zCOLOR 0xFFFFFF00 ARGB ist) *gepushed. Der offset ist 0x00AB1E90. Das ist für Dialoge von NPcs. Der call von gleicher Funktion ist hier bei 0x00758B2F.

    Bei Dialogen für den Helden wird als erstes Argument (also das direkt nach dem this pointer für den thiscall) ein leerer zSTRING übergeben. Bei Dialogen für NPCs wird von "this" über GetName() der Name geholt und übergeben.

    Ich kenne mich mit Ikarus/Lego quasi gar nicht aus, aber in C++ würde ich das so anstellen dass ich DialogMessageCXY() bei z.B. für den Helden hooke mit einer eigenen Funktion mit gleichem prototypen, in der die originale Funktion aufrufe, und mir davor den Namen von oCNpc::player hole und dann den und die Farbe die ich will übergebe statt den originalen Daten.

    Der Prototyp der Funktion ist:

    void __thiscall zCView::DialogMessageCXY(zCView *this, const zSTRING *strNPC, const zSTRING *strMessage, float fTime, struct zCOLOR *col)

    bzw.

    void __thiscall zCView::DialogMessageCXY(class zSTRING const &, class zSTRING const &, float, struct zCOLOR &)

    Hoffe das hilft weiter.

    Farbe austauschen sollte natürlich simpler sein. Da tauscht man einfach den offset aus der gepushed wird. Falls hier irgendwas grob falsch ist, bitte schnell bescheid sagen :D
    Geändert von withmorten (01.04.2019 um 05:14 Uhr)

  4. Beiträge anzeigen #4 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Ich möchte das Thema nochmal hervorholen.

    Danke erstmal an withmorten! Leider kann ich noch nichts mit der vorgeschlagen Lösung anfangen.

    Könnte mir bitte jemand das nochmal laienhafter gestalten.

  5. Beiträge anzeigen #5 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.473
     
    lali ist offline
    Ist vielleicht nicht deine favorisierte Lösung, aber im SystemPack kannst du in der .ini diese ganzen Farben einfach einstellen. Farbtonbeispiele sind im russischen SystemPack Thread auf wog.ru. Aber wenn einfach die Spielerdialoge gelb sein sollen wie bei den NPCs, kannst du ja einfach den schon gegebenen Farbcode in der .ini auch an der anderen Stelle eintragen.
    Phoenix Dev | Website | Discord

  6. Beiträge anzeigen #6 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline

    G1 Colorful conversations

    Hi Moe,
    After several trial-errors with function which Withmorten suggested - hook below is able to change color of both 'noise' + 'standard' dialogs and gives you possibility to add Hero's name into conversation. In code below just for demonstration purposes I used green color for noise dialogs, red color for player dialog and blue for npc dialog.
    Also added small feature if you put h@ and color in hex code at the beginning of your dialog, you can change color dynamically with dialogs.
    Code:
    const int zCView__DialogMessageCXY_G1 = 7337648;
    //006FF6B0  .text     Debug data           ?DialogMessageCXY@zCView@@QAEXABVzSTRING@@0MAAUzCOLOR@@@Z
    
    const int zCView__DialogMessageCXY_G2 = 8032832;
    //0x007A9240 public: void __thiscall zCView::DialogMessageCXY(class zSTRING const &,class zSTRING const &,float,struct zCOLOR &)
    
    FUNC VOID _HOOK_DIALOGMESSAGECXY ()
    {
        /*
        enum oTGameDialogView
        {
        GAME_VIEW_SCREEN        ,
        GAME_VIEW_CONVERSATION  ,       
        GAME_VIEW_AMBIENT       ,       
        GAME_VIEW_CINEMA        ,       
        GAME_VIEW_CHOICE        ,
        GAME_VIEW_NOISE         ,
        GAME_VIEW_MAX
        }*/ 
        const int cGAME_VIEW_CONVERSATION = 1;
        const int cGAME_VIEW_NOISE = 5;
        
        var int color;
        
        var string npcName;
        npcName = MEM_ReadString (MEM_ReadInt (ESP + 4));
        
        var string dlgText;
        dlgText = MEM_ReadString (MEM_ReadInt (ESP + 8));
        
        //Dialog conversation
        if (ECX == MEM_Game.array_view [cGAME_VIEW_CONVERSATION])
        {
            //Change color - different for hero, different for NPC
            if (STR_Len (npcName) == 0) //hero's name is empty string
            {
                //hero
                color = RGBA (255, 0, 0, 255);    //RED
                
                //Update hero's name
                MEM_WriteString (MEM_ReadInt (ESP + 4), "Hero");
            } else
            {
                //NPC
                color = RGBA (0, 0, 255, 255);    //BLUE
            };
        } else
        //Noise conversation
        if (ECX == MEM_Game.array_view [cGAME_VIEW_NOISE])
        {
            //Change color to green
            color = RGBA (0, 255, 0, 255);        //GREEN
        };
    
        //Change color - extract color from dialog
        //h@FF8000 Orange text
        if (STR_StartsWith (dlgText, "h@"))
        {
            var int len;
            var int index;
            
            var string newColor;
            
            len = STR_Len (dlgText);
            len -= 2;
            
            dlgText = STR_SubStr (dlgText, 2, len);
            index = STR_IndexOf (dlgText, " ");
            
            if (index > 0)
            {
                len = STR_Len (dlgText) - 1;
                
                newColor = STR_Prefix (dlgText, index);
                dlgText = STR_SubStr (dlgText, index + 1, len);
                
                color = HEX2RGBA (newColor);
                
                //Update dialog
                MEM_WriteString (MEM_ReadInt (ESP + 8), dlgText);
            };
        };
        
        MEM_WriteInt (MEM_ReadInt (ESP + 16), color);
    };
    
    //Not sure if this works with G2A - tested with G1 only
    HookEngine (MEMINT_SwitchG1G2 (zCView__DialogMessageCXY_G1, zCView__DialogMessageCXY_G2), 6, "_HOOK_DIALOGMESSAGECXY");

    In video I didn't update hero's name - but it was working when I tested it after recording
    [Video]

    Orange dialog with Diego:
    Code:
    INSTANCE DIA_Diego_Colored_Dialog (C_Info)
    {
        npc        = PC_Thief;
        nr        = 1;
        condition    = DIA_Diego_Colored_Dialog_Condition;
        information    = DIA_Diego_Colored_Dialog_Info;
        permanent    = TRUE;
        description    = "Orange dialog text";
    };
    
    FUNC INT DIA_Diego_Colored_Dialog_Condition ()
    {
        return TRUE;
    };
    
    FUNC VOID DIA_Diego_Colored_Dialog_Info ()
    {
        AI_Output (self, other, "DIA_Diego_Colored_Dialog_Info_15_00");    //h@FF8000 Orange text
    };

    HEX2RGBA function can be found here:
    https://forum.worldofplayers.de/foru...light=HEX2RGBA

    edit: obviously - both LeGo and Ikarus packages are required.

  7. Beiträge anzeigen #7 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Thanks F a w k e s!

    I get Syntax Error at line hookengine….


  8. Beiträge anzeigen #8 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline

    Note

    Zitat Zitat von Moe Beitrag anzeigen
    Thanks F a w k e s!

    I get Syntax Error at line hookengine….

    Ah, put that line into your Init_Global function it should look somehow like this:
    Code:
    func void Init_Global ()
    {
    ...
    LeGo_Init ...
    ...
    
    const int once = 0;
    
    if (!once) {
    HookEngine (MEMINT_SwitchG1G2 (zCView__DialogMessageCXY_G1, zCView__DialogMessageCXY_G2), 6, "_HOOK_DIALOGMESSAGECXY");
    once = 1;
    };
    };

  9. Beiträge anzeigen #9 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Super works like a charm.

  10. Beiträge anzeigen #10 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    How is it possible to change the font color of dialoge choices to yellow for example?

  11. Beiträge anzeigen #11 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline

  12. Beiträge anzeigen #12 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Zitat Zitat von F a w k e s Beitrag anzeigen
    Be careful - this can't be used with dialog choices (Info_AddChoice...)

    So it's not possible to simply change the font color of every dialog choice including addchoices to yellow?

  13. Beiträge anzeigen #13 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline
    Whole solution is able to work with dialog choices - you can use it to change dialog choices

    Sorry for confusion - when I mentioned in the code that you can't use it to get dialog choices I was referring to these 2 functions only --> oCInfoManager_GetInfo, oCInfoManager_GetInfoUnimportant - these will not return dialog choice ptr.

    If you read further down in the code, there is a bit in the middle where script recognizes dialog mode and figures out whether it needs to work with dialog instance, or dialog choice:
    Code:
    ...
    //'Standard' dialog options
    if (MEM_InformationMan.Mode == cINFO_MGR_MODE_INFO)
    {
        infoPtr = oCInfoManager_GetInfoUnimportant (slf, her, i);
    } else
    
    
    //Choices - have to be extracted from oCInfo.listChoices_next
    //MEM_InformationMan.Info is a pointer to oCInfo
    if (MEM_InformationMan.Mode == cINFO_MGR_MODE_CHOICE)
    {
        infoPtr = MEM_InformationMan.Info;
    };
    ...
    This solution allows you to change both color & font dynamically for every single dialog/dialog choice separately.

    What are you trying to achieve - do you want to change dialog color of all dialogs just to yellow color?
    Geändert von F a w k e s (27.08.2020 um 10:25 Uhr)

  14. Beiträge anzeigen #14 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Zitat Zitat von F a w k e s Beitrag anzeigen
    What are you trying to achieve - do you want to change dialog color of all dialogs just to yellow color?

    Yes.

  15. Beiträge anzeigen #15 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline
    Ah ok in that case you can still use this solution and keep its features still available, just replace in the middle of the code this piece:
    Code:
    var string dlgColor; dlgColor = "";
    var string dlgColorSelected; dlgColorSelected = "";
    With this below:
    Code:
    var string dlgColor; dlgColor = "FFFF99"; //G1 standard dialog grey color C8C8C8
    var string dlgColorSelected; dlgColorSelected = "FFFF33"; //White color FFFFFF
    This basically defines default color of selected and 'greyed' out dialogs, I have used FFFF99 - light yellow and yellow FFFF33 to test how it looks.
    Dialog instance:
    [Bild: Gohic-Dialog-Colors-dialog-instance.png]
    Dialog choices:
    [Bild: Gothic-Dialog-Colors-dialog-choices.png]

  16. Beiträge anzeigen #16 Zitieren
    banned
    Registriert seit
    Jan 2009
    Ort
    Oberösterreich
    Beiträge
    2.393
     
    Moe ist offline
    Perfect! Thousand thanks!

  17. Beiträge anzeigen #17 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    Zitat Zitat von Moe Beitrag anzeigen
    Be careful - this can't be used with dialog choices (Info_AddChoice...)

    So it's not possible to simply change the font color of every dialog choice including addchoices to yellow?
    Is not easiest way to change that from systempack.ini ??

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