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

 

Seite 2 von 24 « Erste 123456913 ... Letzte »
Ergebnis 21 bis 40 von 468
  1. Beiträge anzeigen #21
    Kämpferin Avatar von Elkenelke
    Registriert seit
    Sep 2014
    Beiträge
    352
     
    Elkenelke ist offline
    Das besprochene Kompass-Material:

    Geht das so für Dich? Genommen habe ich beim Export 500 x 500 px (PNG mit Transe) um den Nullpunkt (um den der Nadelbereich sich ja drehen muß), Größe und Leinewandgröße ist ja änderbar - wenn das nicht 100% sauber wird mache ich Exporte in angesagten Größen. Bin mal gespannt.

    [Bild: f6bs-fc-5ea1.png]
    G_DX11_KOMPASS_A_[BACK]


    [Bild: f6bs-fd-7bcd.png]
    G_DX11_KOMPASS_A_[NADEL]


    [Bild: f6bs-fe-5737.png]
    G_DX11_KOMPASS_A_[ZIER]

  2. Beiträge anzeigen #22
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    hi, Gothic fans.

    maybe somebody knows how to change color of dialog choices? Alreday done for colouring of conversation dialogues. I am changing array view to 4 MEM_Game.array_view[4], but no results.

    Code:
    func void ChangeConversationColor ()
    {
        var zCView view; view = MEM_PtrToInst (MEM_Game.array_view[1]);
        var zCList list; list = MEM_PtrToInst (view.textLines_next);
        var zCList list2; list2 = _^(list.next);
        var zCViewText viewtext; viewtext = MEM_PtrToInst (list.data);
        Print (IntToString (viewtext.color));
    
     if (viewtext.color == -1)
        {
           viewtext.color = RGBA(210,255,255,255);//dialog Hero
        }
        else
        {
       // viewtext.color = RGBA(255,0,0,255);//dialog Hero
        };
        
        viewtext.colored = true;
        
    };

  3. Beiträge anzeigen #23
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    I looked into it, but it's a mess, really. As far as I know, they're not stored in the MEM_Game-arrays but are managed by a zCViewPrint-object (which is not documented). They aren't of type zCViewText, either - instead they're called zCViewText2 (who the fuck uses such a name in a release build?) which seems to have an additional integer at the start. I've attached sample-code to show you how to color the first choice, you should be able to expand on it easily.


    Code:
    class zCViewText2 {
    	var int unknown;
    	 /* zCViewText text; */
    		var int _vtbl;
    		
    		var int posx;
    		var int posy;
    		
    		var string text;	//zSTRING //Die Entscheidende Eigenschaft.
    		var int font;		//zCFont*
    		var int timer;		//zREAL //übrige Zeit für PrintScreen anzeigen die nur eine bestimmte Zeit dauern?
    		var int inPrintWin; //zBOOL //vermutlich für anzeigen mit "Print", die nach oben weggeschoben werden.
    
    		var int color;		//zCOLOR
    		var int timed;		//zBOOL
    		var int colored;	//zBOOL		//klingt interessant. Vielleicht kann man hiermit was anfangen.
    };
    
    func void colorOneChoice() {
    	var oCInformationManager manager; manager = _^(MEMINT_oCInformationManager_Address);
    	var int choiceView; choiceView = manager.DlgChoice;
    	var zCArray arr; arr = _^(choiceView+172);
    	var zCViewText2 txt; txt = _^(MEM_ReadIntArray(arr.array, 0));
    	txt.color = RGBA(255, 255, 0, 255);
    };

  4. Beiträge anzeigen #24
    Serima Avatar von Fisk2033
    Registriert seit
    Dec 2010
    Ort
    Dresden
    Beiträge
    5.803
     
    Fisk2033 ist offline
    Wird LeGo jetzt eig. noch "weiterentwickelt"?

  5. Beiträge anzeigen #25
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    @Bonne6: Es ist jetzt zwar schon ein wenig her, aber ich kann deinen Bug nicht reproduzieren - tritt er erst nach einiger Zeit auf? Ggf. wäre es super, wenn du mir Code bereitstellen könntest, der den Bug/Crash hervorruft.

    Zitat Zitat von Fisk2033 Beitrag anzeigen
    Wird LeGo jetzt eig. noch "weiterentwickelt"?
    Wenn du mir sagst, was noch fehlt und warum, dann vielleicht
    Momentan werde ich höchstens noch Fehler beheben, aber es wird eventuell in Zukunft ein weiteres (kleineres) Framework von mir geben.

  6. Beiträge anzeigen #26
    Serima Avatar von Fisk2033
    Registriert seit
    Dec 2010
    Ort
    Dresden
    Beiträge
    5.803
     
    Fisk2033 ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    Wenn du mir sagst, was noch fehlt und warum, dann vielleicht
    Momentan werde ich höchstens noch Fehler beheben, aber es wird eventuell in Zukunft ein weiteres (kleineres) Framework von mir geben.
    Du denkst wohl, dass ich das Moddertreffen 2013 vergessen habe?
    Das "rum-fliegen" Feature zum Beispiel

  7. Beiträge anzeigen #27
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von Fisk2033 Beitrag anzeigen
    Du denkst wohl, dass ich das Moddertreffen 2013 vergessen habe?
    Das "rum-fliegen" Feature zum Beispiel
    Das hat nichts mit LeGo zu tun und gehört dementsprechend auch nicht in das Paket Die Grundfunktionalität ist übrigens einfach (afaik nur movLock-Bitfeld setzen und dann einfach die Trafo ändern), den Arbeitsaufwand machen die "Edge-Cases" (levitieren darf nur aktiviert werden, wenn ich z.B. gerade kein Mob bediene) und das Finetuning der Einstellungen (Geschwindigkeit/Beschleunigung). Wobei man ersteres wohl größtenteils umgehen könnte, wenn man das nur per Zauber verfügbar macht.

    Auf jedenfall solltest du das selber implementieren können, wenn du wolltest

  8. Beiträge anzeigen #28
    Abenteurer Avatar von hatrez123
    Registriert seit
    Feb 2014
    Beiträge
    50
     
    hatrez123 ist offline
    Hi, Im working on LeGo Gothic 1.
    If it's not a problem, it'll be nice if you could help me.
    I don't know how to make trialoges work correctly.
    It behaves like a normal dialogue and it stucks after spoken conversations.
    All addresses all redirected ( expect cursor and this, what is showed below ).
    Probably the problem is here:
    Code:
    func void _DIAG_Patch() {
        const int oCNpc__StartDialogAniX = 7021070; // redirected
        const int oCNpc__StartDialogAniY = 7021077; // redirected
    
        const int address = 0;
        if(address) {
            return;
        };
    
        address = MEM_Alloc(19);
    
        MemoryProtectionOverride(oCNpc__StartDialogAniX, 5);
        MEM_WriteInt(oCNpc__StartDialogAniX + 0, 233);
        MEM_WriteInt(oCNpc__StartDialogAniX + 1, address-(oCNpc__StartDialogAniX+5));
    
        /*
            mov ecx, [_DIAG_Max]
            idiv ecx
            add ebx, [_DIAG_Min]
        */
    
        MEM_WriteByte(address+0,  139);
        MEM_WriteByte(address+1,  013); MEM_WriteInt(address+2, MEM_GetIntAddress(_DIAG_Max));
        MEM_WriteByte(address+6,  247);
        MEM_WriteByte(address+7,  249);
        MEM_WriteByte(address+8,  003);
        MEM_WriteByte(address+9,  021); MEM_WriteInt(address+10, MEM_GetIntAddress(_DIAG_Min));
        MEM_WriteByte(address+14, 233);
        MEM_WriteInt (address+15, oCNpc__StartDialogAniY-(address+19));
    };
    I dunno know how to fix it
    Geändert von hatrez123 (25.03.2015 um 15:28 Uhr)

  9. Beiträge anzeigen #29
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    @Lehona, danke schon fur deine Hilfe. Konnen Sie des Hatrez mit eine Trialoge helfen, bitte?

    Endschuldiguge fur mein schlecht Deutsch

    PS your example script makes a crash after new game/load game.
    Geändert von pawbuj (24.03.2015 um 21:24 Uhr)

  10. Beiträge anzeigen #30
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    So, does it get stuck if you don't apply those patches? The dialog gestures don't really have anything to do with it. However, you could show me your Trialog.d - I "recently" fixed a bug where you'd get stuck after a dialog (or trialog). Try to single out the point of failure, I can't really help if I can only guess.

    Zitat Zitat von pawbuj Beitrag anzeigen
    @Lehona, danke schon fur deine Hilfe. Konnen Sie des Hatrez mit eine Trialoge helfen, bitte?

    Endschuldiguge fur mein schlecht Deutsch

    PS your example script makes a crash after new game/load game.
    Just write in english if you're more comfortable doing that. And continue to kick me in the ass, because I'm a lazy bum

    Which script, exactly? I'm always happy to fix bugs if I know where they occur

  11. Beiträge anzeigen #31
    Abenteurer Avatar von hatrez123
    Registriert seit
    Feb 2014
    Beiträge
    50
     
    hatrez123 ist offline
    The dialog gestures don't really have anything to do with it.
    My bad
    So, does it get stuck if you don't apply those patches?
    It does.

    This is Trialog.d
    Code:
    /***********************************\
                  TRIALOGE
    \***********************************/
    
    //========================================
    // EquipWeapon von Sektenspinner
    //  Wer diese Funktion schon besitzt kann
    //  sie hier einfach auskommentieren
    //========================================
    /* EquipWeapon_TogglesEquip configure the behaviour
       when trying to equip an already equipped weapon:
        0: EquipWeapon will do nothing
        1: EquipWeapon will unequip this weapon
     */
    const int EquipWeapon_TogglesEquip = 1;
    
    func void EquipWeapon (var C_NPC slf, var int ItemInst) {
    
        if (!Npc_HasItems (slf, ItemInst)) {
            CreateInvItems (slf, ItemInst, 1);
        };
    
        if (!Npc_GetInvItem(slf, ItemInst)) {
            MEM_AssertFail("Unexpected behaviour in EquipWeapon.");
            return;
        };
    
        if ((item.mainflag == ITEM_KAT_NF) && (Npc_HasReadiedMeleeWeapon(slf)))
        || ((item.mainflag == ITEM_KAT_FF) && (Npc_HasReadiedRangedWeapon(slf))) {
            MEM_Warn ("EquipWeapon: Caller wants to equip a weapon while weapon of the same type is readied. Ignoring request.");
            return;
        };
    
        if (Npc_HasEquippedWeapon(slf))
        && (!EquipWeapon_TogglesEquip) {
            /* calling EquipWeapon would unequip the weapon. */
            MEM_Info ("EquipWeapon: This weapon is already equipped. Ignoring request.");
            return;
        };
    
        CALL_PtrParam(MEM_InstToPtr(item));
        CALL__thiscall(MEM_InstToPtr(slf), oCNpc__EquipWeapon);
    };
    
    //========================================
    // Hilfsfunktionen
    //========================================
    func int Npc_GetArmor(var c_npc slf) {
        if(!Npc_HasEquippedArmor(slf)) { return -1; };
        var c_item itm; itm = Npc_GetEquippedArmor(slf);
        return Hlp_GetInstanceID(itm);
    };
    func int Npc_GetMeleeWeapon(var c_npc slf) {
        if(!Npc_HasEquippedMeleeWeapon(slf)) { return 0; };
        var c_item itm; itm = Npc_GetEquippedMeleeWeapon(slf);
        return Hlp_GetInstanceID(itm);
    };
    func int Npc_GetRangedWeapon(var c_npc slf) {
        if(!Npc_HasEquippedRangedWeapon(slf)) { return 0; };
        var c_item itm; itm = Npc_GetEquippedRangedWeapon(slf);
        return Hlp_GetInstanceID(itm);
    };
    
    //========================================
    // Userkonstanten
    //========================================
    
    const int TRIA_MaxNPC = 256; // Wie viele Npcs nehmen maximal an einem Trialog teil?
    
    //========================================
    // Dialogkamera neu einstellen
    //========================================
    func void DiaCAM_Update() {
        // Diese Funktion wurde von Sektenspinner niedergeschrieben.
        if(InfoManager_HasFinished()) { return; };
        var int aiCam; aiCam = MEM_ReadInt(zCAICamera__current);
        CALL_IntParam(1);
        CALL__thiscall(aiCam, zCAICamera_StartDialogCam);
    };
    
    //========================================
    // Dialogkamera abschalten
    //========================================
    func void DiaCAM_Disable() {
        MemoryProtectionOverride(zCAICamera__StartDialogCam, 4);
        MEM_WriteInt(zCAICamera__StartDialogCam, 268436674); // retn 4
    };
    
    //========================================
    // Dialogkamera einschalten
    //========================================
    func void DiaCAM_Enable() {
        MemoryProtectionOverride(zCAICamera__StartDialogCam, 4);
        MEM_WriteInt(zCAICamera__StartDialogCam, 275316586);
    };
    
    
    //========================================
    // [intern] Variablen
    //========================================
    var int TRIA_NpcPtr[TRIA_MaxNPC]; // Sammlung aller Teilnehmer
    var int TRIA_Running;             // Läuft ein Trialog?
    var int TRIA_CPtr;                // Zähler für die Sammlung
    var int TRIA_Last;                // Der Npc der zuletzt gesprochen hat
    var int TRIA_Self;                // Pointer auf self
    var string TRIA_Camera;           // Läuft eine Kamerafahrt?
    
    func void ZS_TRIA() {};
    func int ZS_TRIA_Loop() { return LOOP_CONTINUE; };
    
    //========================================
    // Npcs aufeinander warten lassen
    //========================================
    func void TRIA_Wait() {
        AI_WaitTillEnd(hero, self);
        AI_WaitTillEnd(self, hero);
        AI_WaitTillEnd(hero, self);
    };
    
    //========================================
    // [intern] Visuals aktualisieren
    //========================================
    func void _TRIA_UpdateVisual(var c_npc slf, var int armor) {
        var oCNpc npc; npc = Hlp_GetNpc(slf);
        Mdl_SetVisualBody(slf, npc.body_visualName, (npc.bitfield[0]&oCNpc_bitfield0_body_TexVarNr)>>14, 0, npc.head_visualName, (npc.bitfield[1]&oCNpc_bitfield1_head_TexVarNr)>>16, 0, armor);
    };
    
    //========================================
    // Angelegte Waffe tauschen
    //========================================
    func void Npc_TradeItem(var c_npc slf, var int itm0, var int itm1) {
        if(itm0) {
            EquipWeapon(slf, itm0);
            Npc_RemoveInvItem(slf, itm0);
        };
        if(itm1) {
            CreateInvItem(slf, itm1);
            EquipWeapon(slf, itm1);
        };
    };
    
    //========================================
    // [intern] Npcs kopieren
    //========================================
    class _TRIA_fltWrapper {
        var float f0;
        var float f1;
        var float f2;
        var float f3;
    };
    
    func void _TRIA_Copy(var int n0, var int n1) {
        var c_npc np0; np0 = MEM_PtrToInst(n0);
        var c_npc np1; np1 = MEM_PtrToInst(n1);
        var int a0; a0 = Npc_GetArmor(np0);
        var int a1; a1 = Npc_GetArmor(np1);
        var _TRIA_fltWrapper fn0; fn0 = MEM_PtrToInst(n0+2032); 
        var _TRIA_fltWrapper fn1; fn1 = MEM_PtrToInst(n1+2032);
        MEM_SwapBytes(n0+60,   n1+60,   64);      // trafo
        MEM_SwapBytes(n0+260,  n1+260,  20); // name
        MEM_SwapBytes(n0+524,  n1+524,   4); // voice
        MEM_SwapBytes(n0+1948, n1+1948, 20);      // bitfield
        MEM_SwapBytes(n0+1972, n1+1972, 76);      // visuals
        MEM_SwapBytes(n0+228,  n1+228,  20);      //
        Mdl_SetModelScale(np0, fn0.f0, fn0.f1, fn0.f2);
        Mdl_SetModelScale(np1, fn1.f0, fn1.f1, fn1.f2);
        Mdl_SetModelFatness(np0, fn0.f3);
        Mdl_SetModelFatness(np1, fn1.f3);
        _TRIA_UpdateVisual(np0, a1);
        _TRIA_UpdateVisual(np1, a0);
        Npc_RemoveInvItem(np0, a0);
        Npc_RemoveInvItem(np1, a1);
        var int mw0; mw0 = Npc_GetMeleeWeapon(np0);
        var int rw0; rw0 = Npc_GetRangedWeapon(np0);
        var int mw1; mw1 = Npc_GetMeleeWeapon(np1);
        var int rw1; rw1 = Npc_GetRangedWeapon(np1);
        Npc_TradeItem(np0, mw0, mw1);
        Npc_TradeItem(np0, rw0, rw1);
        Npc_TradeItem(np1, mw1, mw0);
        Npc_TradeItem(np1, rw1, rw0);
    };
    
    //========================================
    // [intern] Kopieren.
    //========================================
    func void _TRIA_CopyNpc(var int slf) {
        if(slf == TRIA_Last) {
            return;
        };
        if(slf == TRIA_Self) {
            _TRIA_Copy(TRIA_Self, TRIA_Last);
        }
        else if(TRIA_Last == TRIA_Self) {
            _TRIA_Copy(TRIA_Self, slf);
        }
        else {
            _TRIA_Copy(TRIA_Self, TRIA_Last);
            _TRIA_Copy(TRIA_Self, slf);
        };
        TRIA_Last = slf;
    };
    
    //========================================
    // [intern] Npcs einstellen
    //========================================
    func void _TRIA_InitNPC(var c_npc slf) {
        Npc_ClearAIQueue(slf);
        AI_StandUp(slf);
        AI_StopLookAt(slf);
        AI_RemoveWeapon(slf);
        AI_TurnToNpc(slf, hero);
        AI_WaitTillEnd(hero, slf);
        AI_StartState(slf, ZS_TRIA, 0, "");
    };
    
    //========================================
    // Npc in das Gespräch einladen
    //========================================
    func void TRIA_Invite(var c_npc slf) {
        if(TRIA_Running) {
            MEM_Warn("TRIA_Invite: Der Trialog läuft bereits.");
            return;
        };
        if(TRIA_CPtr == TRIA_MaxNPC) {
            MEM_Error("TRIA_Invite: Zu viele Npcs. Erhöhe bitte TRIA_MaxNPC.");
            return;
        };
        if(Hlp_GetInstanceID(slf) == Hlp_GetInstanceID(hero)
        || Hlp_GetInstanceID(slf) == Hlp_GetInstanceID(self)) {
            MEM_Warn("TRIA_Invite: Der Held und/oder Self können nicht eingeladen werden. Sie sind bereits anwesend.");
            return;
        };
        if((Npc_GetDistToNpc(slf, hero) > truncf(MEM_ReadInt(SPAWN_INSERTRANGE_Address)))
        || (Npc_IsDead(slf))
        || (!Hlp_IsValidNpc(slf))) {
            MEM_Error(ConcatStrings("TRIA_Invite: Der Npc ist nicht in der KI-Glocke und/oder tot: ", slf.name));
            return;
        };
        MEM_WriteStatArr(TRIA_NpcPtr, TRIA_CPtr, MEM_InstToPtr(slf));
        TRIA_CPtr += 1;
    };
    
    //========================================
    // Trialog starten
    //========================================
    func void TRIA_Start() {
        if(TRIA_Running) {
            MEM_Warn("TRIA_Start: Es läuft bereits ein Trialog.");
            return;
        };
        var int i; i = 0;
        var int p; p = MEM_StackPos.position;
        if(i < TRIA_CPtr) {
            var c_npc slf; slf = MEM_PtrToInst(MEM_ReadStatArr(TRIA_NpcPtr, i));
            _TRIA_InitNpc(slf);
            i += 1;
            MEM_StackPos.position = p;
        };
    
        Npc_ClearAIQueue(self);
        Npc_ClearAIQueue(hero);
        Ai_Output(hero,self,"");
    
        var c_npc selfCopy; selfCopy = Hlp_GetNpc(self);
        self = MEM_NullToInst();
        TRIA_Invite(selfCopy);
        self = Hlp_GetNpc(selfCopy);
        TRIA_Wait();
        TRIA_Last = MEM_InstToPtr(self);
        TRIA_Self = TRIA_Last;
        TRIA_Running = 1;
    };
    
    //========================================
    // Alle Npcs aufeinander warten lassen
    //========================================
    func void TRIA_Barrier() {
        if(!TRIA_Running) {
            MEM_Warn("TRIA_Next: Kein Trialog gestartet.");
            return;
        };
        TRIA_Wait();
        var int i; i = !1;
        var int j; j = 0;
        var c_npc last; last = MEM_PtrToInst(MEM_ReadStatArr(TRIA_NpcPtr, TRIA_CPtr)); // Ist immer self, aber so ist es verständlicher
        var int p; p = MEM_StackPos.position;
        if(i < TRIA_CPtr) {
            var c_npc curr; curr = MEM_PtrToInst(MEM_ReadStatArr(TRIA_NpcPtr, i));
            AI_WaitTillEnd(curr, last);
            last = Hlp_GetNpc(curr);
            i += 1;
            MEM_StackPos.position = p;
        };
        if(!j) {
            j = 1; i = 0;
            MEM_StackPos.position = p;
        };
    };
    
    //========================================
    // Den nächsten Npc als "self" setzen
    //========================================
    func void TRIA_Next(var c_npc n0) {
        if(!TRIA_Running) {
            MEM_Warn("TRIA_Next: Kein Trialog gestartet.");
            return;
        };
        if(Hlp_GetInstanceID(n0) == Hlp_GetInstanceID(hero)) {
            MEM_Warn("TRIA_Next: 'hero' ist kein erlaubter Parameter für diese Funktion.");
            return;
        };
    
        var int i; i = 0;
        var int j; j = MEM_InstToPtr(n0);
        var int p; p = MEM_StackPos.position;
        if(i < TRIA_CPtr) {
            if(MEM_ReadStatArr(TRIA_NpcPtr, i) != j) {
                i += 1;
                MEM_StackPos.position = p;
            };
        };
        if(i == TRIA_CPtr) {
            MEM_Error(ConcatStrings("TRIA_Next: Der Npc ist nicht eingeladen worden: ", n0.name));
            return;
        };
    
        TRIA_Wait();
        AI_Function_I(hero, _TRIA_Next, j);
    };
    func void _TRIA_Next(var int n0) {
        _TRIA_CopyNpc(n0);
    };
    
    //========================================
    // Kamerafahrt starten
    //========================================
    func void TRIA_Cam(var string evt) {
        TRIA_Wait();
        if(!STR_Len(evt)) {
            if(!STR_Len(TRIA_Camera)) { return; };
            AI_Function_S(hero, _TRIA_Uncam, TRIA_Camera);
        }
        else {
            if(STR_Len(TRIA_Camera)) {
                AI_Function_S(hero, Wld_SendUntrigger, TRIA_Camera);
            };
            AI_Function_S(hero, _TRIA_Cam, evt);
        };
        TRIA_Camera = evt;
    };
    func void _TRIA_Cam(var string evt) {
        DiaCAM_Disable();
        Wld_SendTrigger(evt);
    };
    func void _TRIA_Uncam(var string evt) {
        DiaCAM_Enable();
        DiaCAM_Update();
        Wld_SendUntrigger(evt);
    };
    
    //========================================
    // Trialog abschließen
    //========================================
    func void TRIA_Finish() {
        if(!TRIA_Running) {
            MEM_Warn("TRIA_Finish: Kein Trialog gestartet.");
            return;
        };
        TRIA_Wait();
        TRIA_Cam("");
        AI_Function(hero, _TRIA_Finish);
    };
    func void _TRIA_Finish() {
        if(TRIA_Last != TRIA_Self) {
            _TRIA_Copy(TRIA_Self, TRIA_Last);
        };
        var int i; i = 0;
        var int p; p = MEM_StackPos.position;
        if(i < TRIA_CPtr-1) {
            var c_npc slf; slf = MEM_PtrToInst(MEM_ReadStatArr(TRIA_NpcPtr, i));
            AI_ContinueRoutine(slf);
            i += 1;
            MEM_StackPos.position = p;
        };
        TRIA_Running = 0;
        TRIA_CPtr = 0;
    };
    Geändert von hatrez123 (25.03.2015 um 10:52 Uhr)

  12. Beiträge anzeigen #32
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Try removing line 260 (NPC_ClearAIQueue(self)) and line 380 (AI_ContinueRoutine(slf)).

  13. Beiträge anzeigen #33
    Abenteurer Avatar von hatrez123
    Registriert seit
    Feb 2014
    Beiträge
    50
     
    hatrez123 ist offline
    Alright, it no longer stucks.
    Do you know what is the problem that it behaves like a normal dialogue?
    I was trying to search the problem.
    Code:
    func void _AI_FUNCTION_EVENT() {
        var string s0; var string s1;
        var int i0; var int i1; var int fnc;
        var int ptr; ptr = EBP+88;
        MEMINT_StackPushVar(ptr);
        var string AniName; AniName = MEMINT_PopString();
    
        if(!STR_StartsWith(AniName, "CALL ")) {
            return;
        };
    
        var string argc; argc = STR_Split(AniName, " ", 1);
        if (Hlp_StrCmp(argc, "I")) {
            i0 = STR_ToInt(STR_Split(AniName, " ", 2));
            fnc = STR_ToInt(STR_Split(AniName, " ", 3));
            MEM_PushIntParam(i0);
        }
        else if (Hlp_StrCmp(argc, "S")) {
            s0 = STR_Unescape(STR_Split(AniName, " ", 2));
            fnc = STR_ToInt(STR_Split(AniName, " ", 3));
            MEM_PushStringParam(s0);
        }
        else if (Hlp_StrCmp(argc, "II")) {
            i0 = STR_ToInt(STR_Split(AniName, " ", 2));
            i1 = STR_ToInt(STR_Split(AniName, " ", 3));
            fnc = STR_ToInt(STR_Split(AniName, " ", 4));
            MEM_PushIntParam(i0);
            MEM_PushIntParam(i1);
        }
        else if (Hlp_StrCmp(argc, "SS")) {
            s0 = STR_Unescape(STR_Split(AniName, " ", 2));
            s1 = STR_Unescape(STR_Split(AniName, " ", 3));
            fnc = STR_ToInt(STR_Split(AniName, " ", 4));
            MEM_PushStringParam(s0);
            MEM_PushStringParam(s1);
        }
        else if (Hlp_StrCmp(argc, "SI")) {
            s0 = STR_Unescape(STR_Split(AniName, " ", 2));
            i1 = STR_ToInt(STR_Split(AniName, " ", 3));
            fnc = STR_ToInt(STR_Split(AniName, " ", 4));
            MEM_PushStringParam(s0);
            MEM_PushIntParam(i1);
        }
        else if (Hlp_StrCmp(argc, "IS")) {
            i0 = STR_ToInt(STR_Split(AniName, " ", 2));
            s1 = STR_Unescape(STR_Split(AniName, " ", 3));
            fnc = STR_ToInt(STR_Split(AniName, " ", 4));
            MEM_PushIntParam(i0);
            MEM_PushStringParam(s1);
        }
        else {
            fnc = STR_ToInt(argc);
        };
        MEM_CallByID(fnc);
    };
    The red colored function causes crashes.
    [Bild: 29nw38j.png]
    Geändert von hatrez123 (25.03.2015 um 17:59 Uhr)

  14. Beiträge anzeigen #34
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    No, it doesn't cause the crash, as seen in the Callstack (unless the callstack is unrelated and it's just an error/warning). I've spoken with Gottfried and apparently he fucked up DIAG_Reset() is most likely causing the crash and shouldn't even work in the "original" version. For now you could try fixing the maximum length in _DIAG_SetAni to 17 (so check if ani.len is bigger than 17 instead of 15). He suggested upping it to 19, the maximum possible length, so try either of those and whether it fixes it.

    Give me an example for your trialogs and I can see if I can find anything.

  15. Beiträge anzeigen #35
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    @Lehona, here is zspy error screen of crash caused by appying ur example func coloronechoice using FF. post no #30. I am using G1.

    http://ifotos.pl/zobacz/spy-error_wehewns.jpg

    http://ifotos.pl/zobacz/spy-error_weheweq.jpg
    Geändert von pawbuj (25.03.2015 um 17:39 Uhr)

  16. Beiträge anzeigen #36
    Abenteurer Avatar von hatrez123
    Registriert seit
    Feb 2014
    Beiträge
    50
     
    hatrez123 ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    No, it doesn't cause the crash, as seen in the Callstack (unless the callstack is unrelated and it's just an error/warning). I've spoken with Gottfried and apparently he fucked up DIAG_Reset() is most likely causing the crash and shouldn't even work in the "original" version. For now you could try fixing the maximum length in _DIAG_SetAni to 17 (so check if ani.len is bigger than 17 instead of 15). He suggested upping it to 19, the maximum possible length, so try either of those and whether it fixes it.

    Give me an example for your trialogs and I can see if I can find anything.
    I've upped it to 17 and trialog works. It behaves like a trialog (expect camera and gestures but it's not important ).
    Thank you bro. You're awesome.

    There is another one problem.
    Function STR_IndexOf(MEM_GetCommandLine(), "-GAME:")+6 is cause of crash during saving the game, it's terrible.
    zCViewText2 txt; txt = _^(MEM_ReadIntArray(arr.array, 0));
    As far as I know, reading from position 0 causes crash in Gothic 1.
    Geändert von hatrez123 (25.03.2015 um 19:23 Uhr)

  17. Beiträge anzeigen #37
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Well, those functions are implemented in Ikarus, not in LeGo. What exactly makes it crash?

    Zitat Zitat von pawbuj Beitrag anzeigen
    @Lehona, here is zspy error screen of crash caused by appying ur example func coloronechoice using FF. post no #30. I am using G1.

    http://ifotos.pl/zobacz/spy-error_wehewns.jpg

    http://ifotos.pl/zobacz/spy-error_weheweq.jpg
    Well, I didn't know that and my offset (172) is probably only applicable to G2. You could also try reading from the second index (i.e. 1 instead of 0). All I know is that it works in G2.

  18. Beiträge anzeigen #38
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    Well, those functions are implemented in Ikarus, not in LeGo. What exactly makes it crash?



    Well, I didn't know that and my offset (172) is probably only applicable to G2. You could also try reading from the second index (i.e. 1 instead of 0). All I know is that it works in G2.
    it makes no change and still cause a crash.

  19. Beiträge anzeigen #39
    Abenteurer Avatar von hatrez123
    Registriert seit
    Feb 2014
    Beiträge
    50
     
    hatrez123 ist offline
    Well, those functions are implemented in Ikarus, not in LeGo. What exactly makes it crash?
    When saving the game, at the end, the game gets crash.
    Geändert von hatrez123 (26.03.2015 um 14:12 Uhr)

  20. Beiträge anzeigen #40
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von hatrez123 Beitrag anzeigen
    When saving the game, at the end, the game gets crash.
    That is not what I asked. Does it still crash when you comment out "STR_IndexOf(MEM_GetCommandLine(), "-GAME:")+6"? Does MEM_GetCommandLine() crash? Or STR_IndexOf()? Does it only crash during saving the game or would those functioncalls crash even when called "normally"?

Seite 2 von 24 « Erste 123456913 ... Letzte »

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