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 2 von 2
  1. Beiträge anzeigen #1 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline

    G1 - mobsi get visual function

    Hello folks,
    I am struggling with figuring this one out - and I hope that someone can help me here.
    How can I get a visual information from ocMobInter object?
    For example this anvil below - what I am looking for is a function, which would give me back visual name: BSANVIL_OC.MDS
    [Bild: GM-Mobsi-visual.png]

    I've tried function below - this works with zcVob, but seems like it is returning only empty string for this ocMobInter:
    (ptr is pointer of anvil)
    Code:
        var zCVob vob; vob = _^ (ptr);
        if (vob.visual) {
            var zCObject visualObj; visualObj = _^(vob.visual);
            PrintScreen_Ext (visualObj.objectname, -1, _YPOS_MESSAGE_XPGAINED, "font_old_10_white.tga", _TIME_MESSAGE_XPGAINED);
        } else
        {
            PrintScreen_Ext ("!vob.visual", -1, _YPOS_MESSAGE_XPGAINED, "font_old_10_white.tga", _TIME_MESSAGE_XPGAINED);
        };

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

    G1/G2 Mob_GetVisualName, zCModel_GetVisualName, oCMob_GetModel

    Hello folks,
    Jesus - this caused me quite a headache - I tested so many ways ... and this is how I found a working solution:
    There is a function zCVob_GetVobInfo:
    Code:
    FUNC STRING zCVob_GetVobInfo (var int vobPtr)
    {
        //005D6AE0  .text     Debug data           ?GetVobInfo@zCVob@@QAE?AVzSTRING@@XZ
        const int zCVob__GetVobInfo_G1 = 6122208;
        
        //0x00602100 public: class zSTRING __thiscall zCVob::GetVobInfo(void)
        const int zCVob__GetVobInfo_G2 = 6299904;
    
        CALL_RetValIszString();
        CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetVobInfo_G1, zCVob__GetVobInfo_G2));
        return CALL_RetValAszstring ();
    };
    Which returns string with several details for zcVob. When called on this anvil this is what it returned:
    "ocMobInter, id: 1, name: BS_ANVIL, visual: zCModel, leafs: 1, refCtr: 6, sector"

    From "visual: zCModel" I hoped that I have to get zCModel of oCMob first of all to get to visual name itself.
    Then I searched through all oCMob functions and found oCMOB__GetModel (returns zCModel), then searched through all zCModel functions and found zCModel_GetVisualName.
    Long story short - when combined they give me finally name of visual for ocMobInter objects. So finally I can work on another useful hook - stay tuned
    Code:
    FUNC INT oCMob_GetModel (var int mobPtr)
    {
        if (!mobPtr) { return 0; };
        
        //0067AD00  .text     Debug data           ?GetModel@oCMOB@@UAEPAVzCModel@@XZ
        const int oCMOB__GetModel_G1 = 6794496;
        
        //0x0071BEE0 public: virtual class zCModel * __thiscall oCMOB::GetModel(void)
        const int oCMOB__GetModel_G2 = 7454432;
    
        CALL__thiscall (mobPtr, MEMINT_SwitchG1G2 (oCMOB__GetModel_G1, oCMOB__GetModel_G2));
        return CALL_RetValAsInt();
    };
    
    FUNC STRING zCModel_GetVisualName (var int modelPtr)
    {
        if (!modelPtr) { return ""; };
        
        //00563EF0  .text     Debug data           ?GetVisualName@zCModel@@UAE?AVzSTRING@@XZ
        const int zCModel__GetVisualName_G1 = 5652208;
        
        //0x0057DF60 public: virtual class zSTRING __thiscall zCModel::GetVisualName(void)
        const int zCModel__GetVisualName_G2 = 5758816;
    
        CALL_RetValIszString();
        CALL__thiscall (modelPtr, MEMINT_SwitchG1G2 (zCModel__GetVisualName_G1, zCModel__GetVisualName_G2));
        return CALL_RetValAszstring ();
    };
    
    FUNC STRING Mob_GetVisualName (var int mobPtr)
    {    
        return zCModel_GetVisualName (oCMob_GetModel (mobPtr));
    };

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