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 10 von 10
  1. #1
    Falugify
    Gast
     

    Den toten Goblins von den Waffen befreien [Bugfix]

    Ich habe einen kleinen Fix bauen wollen, damit tote Goblins nach dem Laden nicht erneut wieder ihre Waffen an der Hand halten.

    Das sieht folgendermaßen aus: Beim Tod soll der Fightmode zurückgesetzt bzw geändert wird, der in der npc instance anfangs festgelegt wird. Das stellte sich aber wohl als nicht so einfach heraus.

    Code:
    	if ((self.guild == GIL_GOBBO)
    	|| (self.guild == GIL_GOBBO_SKELETON)
    	|| (self.guild == GIL_SUMMONED_GOBBO_SKELETON))
    	{
    		Npc_SetToFightMode (self, FMODE_NONE); 
    	};
    Auch habe ich folgendes getestet: Npc_SetToFightMode (self, 0); und Npc_SetToFightMode (self, -1);

    Was ist nun das Problem? Es droppt ein unsichtbares Item beim Tod, welches sich auch aufheben lässt und als unsichtbaren Kasten im Inventar erscheint.

    Jemand eine Idee, wie man alternativ zur Lösung kommt, oder mache ich hier etwas falsch?

    Vielleicht kommt man gemeinsam auf eine Lösung und so haben dann auch gleich Andere einen netten Fix für ihre Mod

  2. Beiträge anzeigen #2
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    In this topic, you can download a fix for goblins and skeletons-goblin. I also attach the code for Union, maybe someone wants to transfer it to ikarus+lego, the point is to find and remove weapons from the right-hand slot.

    https://worldofplayers.ru/threads/13198/post-1050733
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    #include"UnionAfx.h"
    namespace Gothic_I_Classic {
    
    //********************************************************************
    // Reading NPC properties from the archive (for Г1)
    //********************************************************************
    //0x006A31E0 protected: virtual void __thiscall oCNpc::Unarchive(class zCArchiver &)
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
    static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006A31E0, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G1 ? IVK_AUTO : IVK_DISABLED);
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
    {
        // First we call the original function
        pNpc_Unarchive(_this, ar);
    
        // If _this is a dead Goblin
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            // take the pointer to the Goblin model
            zCModel* pModel = _this->GetModel();
    
            // if there is no pointer, then exit
            if (!pModel) return;
    
            // getting a pointer to the node of the right hand
            zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
            
            // if there is no pointer, then exit
            if (!pNodeInst)    return;
    
            // otherwise, we erase the node's visual
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    }
    
    
    }
    
    
    
    namespace Gothic_I_Addon {
    
    // 0x006D5AD0 protected: virtual void __thiscall oCNpc::Unarchive(class zCArchiver &)
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
    static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006D5AD0, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G1A ? IVK_AUTO : IVK_DISABLED);
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
    {
        pNpc_Unarchive(_this, ar);
    
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            zCModel* pModel = _this->GetModel();
            if (!pModel)
                return;
    
            zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
            if (!pNodeInst)
                return;
    
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    }
    
    
    }
    
    
    
    namespace Gothic_II_Classic {
    
    // 0x006E8790 protected: virtual void __thiscall oCNpc::Unarchive(class zCArchiver &)
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
    static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006E8790, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G2 ? IVK_AUTO : IVK_DISABLED);
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
    {
        pNpc_Unarchive(_this, ar);
    
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            zCModel* pModel = _this->GetModel();
    
            if (!pModel)
                return;
            
            // declaring an empty pointer to the node
            zCModelNodeInst* pNodeInst = NULL;
    
            // running through all the nodes of the model
            for(int i = 0; i < pModel->nodeList.GetNum(); i++)
            {
                // check the pointer to the node prototype, if it is OK, then continue
                if (pModel->nodeList[i]->protoNode)
                {
                    // retrieving the node name
                    string nodeName = pModel->nodeList[i]->protoNode->nodeName;
    
                    // if it is a right-hand node (the names are compared)
                    if (nodeName.Compare(NPC_NODE_RIGHTHAND))
                    {
                        // storing the pointer to the node
                        pNodeInst = pModel->nodeList[i];
    
                        // exiting the loop
                        break;
                    }
                }
            }
    
            // if the pointer to the right hand node is not found
            if (!pNodeInst)
                // exiting the function
                return;
            // otherwise, we erase the node's visual
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    }
    
    
    }
    
    
    
    namespace Gothic_II_Addon {
    
    // 0x00747230 protected: virtual void __thiscall oCNpc::Unarchive(class zCArchiver &)
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
    static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x00747230, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G2A ? IVK_AUTO : IVK_DISABLED);
    static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
    {
        pNpc_Unarchive(_this, ar);
        
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            zCModel* pModel = _this->GetModel();
            if (!pModel)
                return;
    
            zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
            if (!pNodeInst)
                return;
            
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    }
    
     }

  3. Beiträge anzeigen #3
    Ritter Avatar von Kirides
    Registriert seit
    Jul 2009
    Ort
    Norddeutschland
    Beiträge
    1.780
     
    Kirides ist offline
    Zitat Zitat von N1kX Beitrag anzeigen
    In this topic, you can download a fix for goblins and skeletons-goblin. I also attach the code for Union, maybe someone wants to transfer it to ikarus+lego, the point is to find and remove weapons from the right-hand slot.
    .....
    I translated this code to daedalus/Ikarus/LeGo

    But it only works AFTER the inital loading of the game. This is due to me not knowing how to run hooks earlier than Startup.d (Is there something that can be run on initial menu creation?)
    Also it is currently only for Gothic 2 NotR. You'd need to find the correct addresses for G1 and put them in place (i created the empty Constants for G1 which just need to point to the correct function, and remove guild-checks for non existing creatures in G1)

    Spoiler:(zum lesen bitte Text markieren)
    Code:
    /*
    pNpc_Unarchive(_this, ar);
        
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            zCModel* pModel = _this->GetModel();
            if (!pModel)
                return;
    
            zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
            if (!pNodeInst)
                return;
            
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    */
    
    
    func int oCNpc_GetModel(var int _this) {
        const int oCNpc__GetModel_G1 = 0; // 0
        const int oCNpc__GetModel_G2 = 7571232; // 0x00738720
    
        const int call = 0;
        if (CALL_Begin(call)) {
            CALL_PutRetValTo(_@(retVal));
            CALL__thiscall(_@(_this), MEMINT_SwitchG1G2(oCNpc__GetModel_G1, oCNpc__GetModel_G2));
            call = CALL_End();
        };
        var int retVal;
        return retVal;
    };
    
    
    /// Sucht eine Node eines zCModel.
    /// ____
    /// Gültige nodeName Werte:
    /// ```
    /// "ZS_RIGHTHAND", "ZS_LEFTHAND"
    /// "ZS_SWORD", "ZS_LONGSWORD"
    /// "ZS_BOW", "ZS_CROSSBOW"
    /// "ZS_SHIELD", "ZS_HELMET"
    /// "ZS_JAWS"
    /// ```
    func int zCModel_SearchNode(var int _this, var string nodeName) {
        const int zCModel__SearchNode_G1 = 0; // 0
        const int zCModel__SearchNode_G2 = 5758960; // 0x0057DFF0
    
        CALL_zStringPtrParam(nodeName);
        CALL__thiscall(_this, MEMINT_SwitchG1G2(zCModel__SearchNode_G1, zCModel__SearchNode_G2));
            
        var int retVal; retVal = CALL_RetValAsInt();
        return retVal;
    };
    
    func int zCModel_SetNodeVisual(var int _this, var int nodePtr, var int visualPtr, var int animated) {
        const int zCModel_SetNodeVisual_G1 = 0; // 0
        const int zCModel_SetNodeVisual_G2 = 5739168; // 0x005792A0
    
        const int call = 0;
        if (CALL_Begin(call)) {
            CALL_IntParam(_@(animated));
            CALL_IntParam(_@(visualPtr));
            CALL_IntParam(_@(nodePtr));
            CALL__thiscall(_@(_this), MEMINT_SwitchG1G2(zCModel_SetNodeVisual_G1, zCModel_SetNodeVisual_G2));
            call = CALL_End();
        };
        var int retVal;
        return retVal;
    };
    
    func void _Fix_GoblinClubs_NpcUnarchive_Hook() {
        var int _this; _this = EBP;
        if (!_this) { return; };
    
        var C_Npc _thisNpc; _thisNpc = _^(_this);
        if (
            !(_thisNpc.guild == GIL_GOBBO
            || _thisNpc.guild == GIL_GOBBO_SKELETON
            || _thisNpc.guild == GIL_SUMMONED_GOBBO_SKELETON )
        ) { return; };
        if (_thisNpc.attribute[ATR_HITPOINTS] != 0) { return; };
    
        var int pModel; pModel = oCNpc_GetModel(_this);
        if (!pModel) { return; };
    
        var int pNodeInst; pNodeInst = zCModel_SearchNode(pModel, "ZS_RIGHTHAND");
        if (!pNodeInst) { return; };
    
        zCModel_SetNodeVisual(pModel, pNodeInst, 0, FALSE);
    };
    
    func void Fix_GoblinClubs_Init() {
        const int oCNpc__Unarchive_End_G1 = 0;       // 0x0
        const int oCNpc__Unarchive_End_G2 = 7636622; // 0x0074868E
    
        const int once = TRUE;
        if (once) {
            HookEngineF(MEMINT_SwitchG1G2(oCNpc__Unarchive_End_G1, oCNpc__Unarchive_End_G2), 7, _Fix_GoblinClubs_NpcUnarchive_Hook);
            once = FALSE;
        };
    };





    EDIT:

    Es wäre deutlich leichter, beim Tod eines Goblins die aktive Waffe als "Nicht aktiv" zu kennzeichnen. (ACTIVE flag entfernen: oCItem.flags & ~(ITEM_ACTIVE_LEGO) ) das "könnte" auch funktionieren.
    Also über das Inventar gucken und allen items das Flag für ACTIVE entziehen.

    Ob das funktioniert ... müsste man prüfen
    Geändert von Kirides (03.08.2020 um 12:56 Uhr)

  4. #4
    Falugify
    Gast
     
    Zitat Zitat von Kirides Beitrag anzeigen
    I translated this code to daedalus/Ikarus/LeGo

    But it only works AFTER the inital loading of the game. This is due to me not knowing how to run hooks earlier than Startup.d (Is there something that can be run on initial menu creation?)
    Also it is currently only for Gothic 2 NotR. You'd need to find the correct addresses for G1 and put them in place (i created the empty Constants for G1 which just need to point to the correct function, and remove guild-checks for non existing creatures in G1)

    Spoiler:(zum lesen bitte Text markieren)
    Code:
    /*
    pNpc_Unarchive(_this, ar);
        
        if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
        {
            zCModel* pModel = _this->GetModel();
            if (!pModel)
                return;
    
            zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
            if (!pNodeInst)
                return;
            
            pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
        }
    */
    
    
    func int oCNpc_GetModel(var int _this) {
        const int oCNpc__GetModel_G1 = 0; // 0
        const int oCNpc__GetModel_G2 = 7571232; // 0x00738720
    
        const int call = 0;
        if (CALL_Begin(call)) {
            CALL_PutRetValTo(_@(retVal));
            CALL__thiscall(_@(_this), MEMINT_SwitchG1G2(oCNpc__GetModel_G1, oCNpc__GetModel_G2));
            call = CALL_End();
        };
        var int retVal;
        return retVal;
    };
    
    
    /// Sucht eine Node eines zCModel.
    /// ____
    /// Gültige nodeName Werte:
    /// ```
    /// "ZS_RIGHTHAND", "ZS_LEFTHAND"
    /// "ZS_SWORD", "ZS_LONGSWORD"
    /// "ZS_BOW", "ZS_CROSSBOW"
    /// "ZS_SHIELD", "ZS_HELMET"
    /// "ZS_JAWS"
    /// ```
    func int zCModel_SearchNode(var int _this, var string nodeName) {
        const int zCModel__SearchNode_G1 = 0; // 0
        const int zCModel__SearchNode_G2 = 5758960; // 0x0057DFF0
    
        CALL_zStringPtrParam(nodeName);
        CALL__thiscall(_this, MEMINT_SwitchG1G2(zCModel__SearchNode_G1, zCModel__SearchNode_G2));
            
        var int retVal; retVal = CALL_RetValAsInt();
        return retVal;
    };
    
    func int zCModel_SetNodeVisual(var int _this, var int nodePtr, var int visualPtr, var int animated) {
        const int zCModel_SetNodeVisual_G1 = 0; // 0
        const int zCModel_SetNodeVisual_G2 = 5739168; // 0x005792A0
    
        const int call = 0;
        if (CALL_Begin(call)) {
            CALL_IntParam(_@(animated));
            CALL_IntParam(_@(visualPtr));
            CALL_IntParam(_@(nodePtr));
            CALL__thiscall(_@(_this), MEMINT_SwitchG1G2(zCModel_SetNodeVisual_G1, zCModel_SetNodeVisual_G2));
            call = CALL_End();
        };
        var int retVal;
        return retVal;
    };
    
    func void _Fix_GoblinClubs_NpcUnarchive_Hook() {
        var int _this; _this = EBP;
        if (!_this) { return; };
    
        var C_Npc _thisNpc; _thisNpc = _^(_this);
        if (
            !(_thisNpc.guild == GIL_GOBBO
            || _thisNpc.guild == GIL_GOBBO_SKELETON
            || _thisNpc.guild == GIL_SUMMONED_GOBBO_SKELETON )
        ) { return; };
        if (_thisNpc.attribute[ATR_HITPOINTS] != 0) { return; };
    
        var int pModel; pModel = oCNpc_GetModel(_this);
        if (!pModel) { return; };
    
        var int pNodeInst; pNodeInst = zCModel_SearchNode(pModel, "ZS_RIGHTHAND");
        if (!pNodeInst) { return; };
    
        zCModel_SetNodeVisual(pModel, pNodeInst, 0, FALSE);
    };
    
    func void Fix_GoblinClubs_Init() {
        const int oCNpc__Unarchive_End_G1 = 0;       // 0x0
        const int oCNpc__Unarchive_End_G2 = 7636622; // 0x0074868E
    
        const int once = TRUE;
        if (once) {
            HookEngineF(MEMINT_SwitchG1G2(oCNpc__Unarchive_End_G1, oCNpc__Unarchive_End_G2), 7, _Fix_GoblinClubs_NpcUnarchive_Hook);
            once = FALSE;
        };
    };





    EDIT:

    Es wäre deutlich leichter, beim Tod eines Goblins die aktive Waffe als "Nicht aktiv" zu kennzeichnen. (ACTIVE flag entfernen: oCItem.flags & ~(ITEM_ACTIVE_LEGO) ) das "könnte" auch funktionieren.
    Also über das Inventar gucken und allen items das Flag für ACTIVE entziehen.

    Ob das funktioniert ... müsste man prüfen

    Warum const int once = TRUE;? Das wird von Gothic nicht erkannt.

    Code:
        var int once;
        if (once == FALSE) {
            HookEngineF(MEMINT_SwitchG1G2(oCNpc__Unarchive_End_G1, oCNpc__Unarchive_End_G2), 7, _Fix_GoblinClubs_NpcUnarchive_Hook);
            once = TRUE;
    Hab es so geändert, das scheint zu klappen. Und da das Problem mit dem Waffen auch erst nach dem laden auftritt, sollte das passen, oder?

    Eher so, keine var

    Code:
    	const int once = 1;
    	if (once)
    	{
    		HookEngineF(MEMINT_SwitchG1G2(oCNpc__Unarchive_End_G1, oCNpc__Unarchive_End_G2), 7, _Fix_GoblinClubs_NpcUnarchive_Hook);
    		once = 0;
    	};
    Geändert von Falugify (03.08.2020 um 13:17 Uhr)

  5. Beiträge anzeigen #5
    Ritter Avatar von Kirides
    Registriert seit
    Jul 2009
    Ort
    Norddeutschland
    Beiträge
    1.780
     
    Kirides ist offline
    Zitat Zitat von Falugify Beitrag anzeigen
    Warum const int once = TRUE;? Das wird von Gothic nicht erkannt.

    Code:
        var int once;
        if (once == FALSE) {
            HookEngineF(MEMINT_SwitchG1G2(oCNpc__Unarchive_End_G1, oCNpc__Unarchive_End_G2), 7, _Fix_GoblinClubs_NpcUnarchive_Hook);
            once = TRUE;
    Hab es so geändert, das scheint zu klappen. Und da das Problem mit dem Waffen auch erst nach dem laden auftritt, sollte das passen, oder?
    Interessant, ich benutze überall "const int once = TRUE;" für meine Hooks.
    Das ist, damit der Hook nur einmal in der session passiert und keine var im savegame landet. Keine ahnung was passiert, oder ob überhaupt irgendwas passiert, wenn man es mit einer var macht.

    Kannst ja auch einfach const int once = 1; machen, vielleicht ist in deinen Skripten "TRUE / FALSE" nicht als const sondern als var definiert :/

    Wenn du das spiel startest und neben einem Toten goblin stehst, hat er die Waffe in der hand. Wenn du jetzt neu-lädst, ist die waffe weg.

  6. #6
    Falugify
    Gast
     
    Zitat Zitat von Kirides Beitrag anzeigen
    Interessant, ich benutze überall "const int once = TRUE;" für meine Hooks.
    Das ist, damit der Hook nur einmal in der session passiert und keine var im savegame landet. Keine ahnung was passiert, oder ob überhaupt irgendwas passiert, wenn man es mit einer var macht.

    Wenn du das spiel startest und neben einem Toten goblin stehst, hat er die Waffe in der hand. Wenn du jetzt neu-lädst, ist die waffe weg.
    True - False? Funktioniert glaub ich nur mit 1 und 0, weil es eine const ist.

    Edit: Da waren wir wohl gleich schnell

    Genau, beim Spiel Starten und laden haben sie die Waffen, nach erneutem Laden verschwinden sie.
    Geändert von Falugify (03.08.2020 um 13:22 Uhr)

  7. Beiträge anzeigen #7
    Knight
    Registriert seit
    Aug 2009
    Ort
    Hessen
    Beiträge
    1.484
     
    Cryp18Struct ist offline
    Zitat Zitat von Kirides Beitrag anzeigen
    But it only works AFTER the inital loading of the game. This is due to me not knowing how to run hooks earlier than Startup.d (Is there something that can be run on initial menu creation?)
    InitPerceptions() is called in the main menu.
    See:
    https://forum.worldofplayers.de/foru...1#post25928840

  8. #8
    Falugify
    Gast
     
    Zitat Zitat von Cryp18Struct Beitrag anzeigen
    InitPerceptions() is called in the main menu.
    See:
    https://forum.worldofplayers.de/foru...1#post25928840
    Werde ich mir anschauen. Danke dir und Kirides

    An der Stelle bekomme ich eine Access Violation

    Code:
    =============================================== CALLSTACK : ==============================================================
    0023:00791B68 (0x00000235 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+520 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1369+12 byte(s)
    0023:00792504 (0x00000235 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792504 (0x00000375 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792504 (0x000006D0 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792504 (0x00000B28 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792504 (0x0000C50B 0x1DC349C8 0x00AB4118 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792504 (0x0008E267 0x00AB255C 0xFFFFFFFF 0x0082E6F0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
    0023:00792CBF (0x00AB40C0 0x00004776 0x16DF9990 0x00000000) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1551
    0023:0075E5CF (0x00000000 0x0135FCA8 0x0082E6F0 0x00000000) Gothic2.exe, oCNpc::InitStatics()+255 byte(s), P:\dev\g2addon\release\Gothic\_ulf\oNpc.cpp, line 15711+222 byte(s)
    0023:006C12C1 (0x00400000 0x002538BE 0x0135FECC 0xFFFDE000) Gothic2.exe, oCGame::Init()+609 byte(s), P:\dev\g2addon\release\Gothic\_ulf\oGame.cpp, line 754
    0023:0042533A (0x16BBDDD0 0x0082F0EC 0x00000000 0x001805A8) Gothic2.exe, CGameManager::Init()+1738 byte(s), P:\dev\g2addon\release\Gothic\_bert\oGameManager.cpp, line 566+147 byte(s)
    0023:00781882 (0x0000002C 0x001A86E8 0x00000016 0x00000000) Gothic2.exe, MainProg()+66 byte(s), P:\dev\g2addon\release\Gothic\_ulf\Phoenix.cpp, line 110
    0023:00503270 (0x00400000 0x00000000 0x002538BE 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
    0023:00502DFD (0x0135FED0 0x00000000 0x002538BE 0x00000001) Gothic2.exe, WinMain()+141 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1054+17 byte(s)
    0023:007D43F8 (0x00000004 0x0000FFFF 0x000000B8 0x00000000) Gothic2.exe, WinMainCRTStartup()+224 byte(s)

    Edit2: Ich habe MEM_InitAll(); noch davor gesetzt, jetzt gibt es erstmal keinen Absturz mehr.

    Edit3: Scheint jetzt wunderbar zu klappen, danke euch
    Geändert von Falugify (03.08.2020 um 19:16 Uhr)

  9. Beiträge anzeigen #9
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Falugify Beitrag anzeigen
    Warum const int once = TRUE;? Das wird von Gothic nicht erkannt.

    [...]

    Hab es so geändert, das scheint zu klappen. Und da das Problem mit dem Waffen auch erst nach dem laden auftritt, sollte das passen, oder?
    Das wird nicht funktionieren. So wird der Hook nur einmalig in der ersten Spielsession gesetzt, nach neu starten von Gothic aber dann nie wieder. Solche once-Konstrukte funktionieren nur mit Konstanten.



    Zitat Zitat von Kirides Beitrag anzeigen
    Interessant, ich benutze überall "const int once = TRUE;" für meine Hooks.
    Das ist, damit der Hook nur einmal in der session passiert und keine var im savegame landet.
    Mit einer Variable würde es nicht einmal pro Session sondern einmal pro Spielstand passieren, was wie oben beschrieben hinfällig ist.

    Das once-Konstrukt im Zusammenhang mit Hooks ist veraltet und nicht länger nötig. Hooks werden seit geraumer Zeit nur noch einmal gesetzt. Am besten solltest du es komplett weg lassen, das macht alles leserlicher.

  10. Beiträge anzeigen #10
    Ritter Avatar von Kirides
    Registriert seit
    Jul 2009
    Ort
    Norddeutschland
    Beiträge
    1.780
     
    Kirides ist offline
    Zitat Zitat von mud-freak Beitrag anzeigen
    Das wird nicht funktionieren. So wird der Hook nur einmalig in der ersten Spielsession gesetzt, nach neu starten von Gothic aber dann nie wieder. Solche once-Konstrukte funktionieren nur mit Konstanten.




    Mit einer Variable würde es nicht einmal pro Session sondern einmal pro Spielstand passieren, was wie oben beschrieben hinfällig ist.

    Das once-Konstrukt im Zusammenhang mit Hooks ist veraltet und nicht länger nötig. Hooks werden seit geraumer Zeit nur noch einmal gesetzt. Am besten solltest du es komplett weg lassen, das macht alles leserlicher.
    Naja in meinem fall sind in den Once abfragen immer auch weitere config auslese oder const-setz Dinge mit drin, welche nur einmal ausgeführt werden müssen.
    Aber gut zu wissen mit den Hooks

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