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 26 von 27 « Erste ... 1519222324252627 Letzte »
Ergebnis 501 bis 520 von 538
  1. Beiträge anzeigen #501 Zitieren
    Apprentice Avatar von Auronen
    Registriert seit
    Dec 2020
    Beiträge
    25
     
    Auronen ist offline
    I rewrote it using handles again and it still crashes.

    First I thought I might have a bug during the init functions of this thing I am writing, but it looks like it is crashing sooner.

    Crash report:
    I hope I got everything important
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    [i] 1501:26 Info:  0 Q:     Ikarus log functions now print in colour with prefix 'Q:'.[i] 1501:26 Info:  0 Q:     LeGo 2.8.0 wird initialisiert.
    [i] 1501:26 Info:  0 Q:     Flags: PRINTS HOOKENGINE AI_FUNCTION FRAMEFUNCTIONS CURSOR RANDOM SAVES PERMMEM ANIM8 VIEW INTERFACE BUTTONS TIMER EVENTHANDLER GAMESTATE CONSOLECOMMANDS RENDER DRAW3D
    [i] 1501:26 Info:  0 Q:     Locals: Install at CREATE
    [i] 1501:26 Info:  0 Q:             Offset is 11
    [i] 1501:26 Info:  0 Q:     === PermMem::UnArchive ===
    [i] 1501:26 Info:  0 Q:     Reset ALL the handles!
    [i] 1501:26 Info:  0 Q:     Resetting done.
    [i] 1501:26 Info:  0 Q:     Locals: Install at _PM_SAVESTRUCT_DELETEARR
    [i] 1501:26 Info:  0 Q:             Offset is 11
    [i] 1501:26 Info:  0 Q:     Locals: Install at _PM_LOAD
    [i] 1501:26 Info:  0 Q:             Offset is 23
    [i] 1501:26 Info:  0 Q:     Locals: Install at _PM_CLASSTOINST_AUTO
    [i] 1501:26 Info:  0 Q:             Offset is 11
    [f] 1501:26 Fault: 0 Q:     [start of stacktrace]
    [f] 1501:26 Fault: 0 Q:             MEM_READINT_()                                                 +   13 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_OBJECTTYPE(-1)                                             +   16 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_READCLASS()                                                +  130 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_READCLASS()                                                +  292 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_READCLASS()                                                +  292 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_READCLASS()                                                +  292 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_READSAVESTRUCT()                                           +  488 bytes
    [f] 1501:26 Fault: 0 Q:             _PM_UNARCHIVE()                                                +  405 bytes
    [f] 1501:26 Fault: 0 Q:             _BR_LOADGAME()                                                 +   80 bytes
    [f] 1501:26 Fault: 0 Q:             LEGO_INITALWAYS(55541095)                                      +  215 bytes
    [f] 1501:26 Fault: 0 Q:             LEGO_INIT(55146853)                                            +  163 bytes
    [f] 1501:26 Fault: 0 Q:             INIT_GLOBAL()                                                  +   98 bytes
    [f] 1501:26 Fault: 0 Q:     [end of stacktrace]
    [f] 1501:26 Fault: 0 Q:     Exception handler was invoked. Ikarus tried to print a Daedalus-Stacktrace to zSpy. Gothic will now crash and probably give you a stacktrace of its own.
    [i] 1501:26 Info:  5 X:     Vid_SetScreenMode: No changes ... .... <zRndD3D_Vid.cpp,#559>
    [i] 1501:26 Info:  5 X:     Vid_SetScreenMode: No changes ... .... <zRndD3D_Vid.cpp,#559>
    [i] 1501:29 Info:  5 X:     EmergencyExit: Releasing all DirectX-Objects ... .... <zRndD3D_Render.cpp,#283>
    [i] 1501:29 Info:  5 X:     EmergencyExit: D3DXUninitialize done .... <zRndD3D_Render.cpp,#301>
    [w] 1501:29 Warn:  0 X:     [RND3D-Destructor]: Can't uninitialize D3DX Utility Library ! Error: D3DXERR_D3DXNOTSTARTEDYET .... <zRndD3D.h,#127>
    [i] 1501:29 Info:  5 X:     [RND3D-Destructor]: D3DXUninitialize done .... <zRndD3D_Render.cpp,#309>
    [w] 1501:29 Warn:  0 ==    ===================================== UNHANDLED EXCEPTION OCCURED ====================================================== .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 ==    ============================================ CRASH INFOS: ============================================================== .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 Go    thic II - 2.6 (fix), Parser Version: 50 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 Us    er:  Auronen,  CPUType: 586,  Mem: 0 MB total, 0 MB free .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 St    artup Options: .... <zWin32.cpp,#2976>
    [w] 1501:29 Warn:  0 -g    ame:chuquell.ini -zreparse -zwindow -znomusic -znosound -zlog:5,s
    
    
     .... <zWin32.cpp,#2977>
    [w] 1501:29 Warn:  0 ==    ============================================= CALLSTACK : ============================================================== .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:0079249D (0x00000375 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2877 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1405+40 byte(s) .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x00000375 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000E118 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000FB4A 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000FB4A 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000FB4A 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000FB4A 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0000FDCE 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x00010567 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x0001FB81 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x00021BC0 0x1729F7E8 0x00AB4118 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792504 (0x00021FF0 0x0000537F 0x0082E6F0 0x06234250) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:00792CBF (0x00AB40C0 0x0000537F 0x008319DC 0x05B34728) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1551 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:006C20BF (0x00000000 0x00000001 0x0135FAA0 0x00000000) Gothic2.exe, oCGame::CallScriptInit()+351 byte(s), P:\dev\g2addon\release\Gothic\_ulf\oGame.cpp, line 886 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:006C6D9F (0xFFFFFFFF 0x00000001 0x0082E6F0 0x0135FC54) Gothic2.exe, oCGame::LoadSavegame()+1487 byte(s), P:\dev\g2addon\release\Gothic\_ulf\oGame.cpp, line 2274 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:591308ED (0x00000000 0x006C1C5E 0x0599F3C8 0x0042A282) SHW32.DLL, UnionCore::CUnion::DefineCRTVersion()+3613 byte(s) .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:007E8E48 (0x0044FFF0 0x00423E50 0x00423F90 0x00450000) Gothic2.exe, SetFileAttributesA()+21124 byte(s) .... <zError.cpp,#474>
    [i] 1501:29 Warn:  0 00    23:00424010 (0x005ABDD0 0x0076FB80 0x005ABB30 0x0076FBE0) Gothic2.exe, oCGameInfo::Init, P:\dev\g2addon\release\Gothic\_bert\oGameInfo.cpp, line 67 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:005AB940 (0x005ABDD0 0x005ABE30 0x005ABB30 0x00426C90) Gothic2.exe, zCObjectFactory::CreateZFile, P:\dev\g2addon\release\ZenGin\_dieter\zObject.cpp, line 784 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 00    23:005AB940 (0x004DB910 0x004DDC20 0x004DCCD0 0x004DC1C0) Gothic2.exe, zCObjectFactory::CreateZFile, P:\dev\g2addon\release\ZenGin\_dieter\zObject.cpp, line 784 .... <zError.cpp,#474>
    [w] 1501:29 Warn:  0 ==    ===================================== UNHANDLED EXCEPTION OCCURED ====================================================== .... <zError.cpp,#474>


    Here is my complete code:
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    /* AF_Tooltips*
    * Authors: Auronen & Fawkes
    * Version: 0.01 alpha
    *
    * Description:
    *         This package allows you to show a tooltips, that
    *         explain your new amazing innovative features.
    * 
    * Features:
    *        - show tooltip & hide tooltip
    *        - custom position per tooltip
    *        - timed "ShowOnce" feature - if you view a tooltip for more than 5s (customisable) it will not show again 
    *        
    *        
    * How to get it running:        
    *         1. Define your tooltips in a Init function (at the end of this file)
    *         2. Call AFTT_Show and AFTT_Hide where needed
    *         3. Call your init function in your Startup.d file
    * 
    * 
    * "API"
    *     Creates the tooltip
    *                
    *
    *         int AFTT_Create (var string tt_text, var int background)
    *            Creates tooltip at the default position (defined by AFTT_posx and AFTT_posy) 
    *                tt_text - text of the tooltip
    *                background - render background texture? TRUE/FALSE 
    *                return - tooltip handle
    *
    *      int AFTT_CreatePos (var string tt_text, var int x, var int y, var int background) 
    *            Creates tooltip with the top left corner defined by x and y
    *                tt_text - text of the tooltip
    *                x - horizontal position (virtual coordinates)
    *                y - vertical position (virtual coordinates)
    *                background - render background texture? TRUE/FALSE 
    *                return - tooltip handle
    *
    *      int AFTT_CreatePosPxl (var string tt_text, var int x, var int y, var int background) 
    *            Same as AFTT_CreatePos but with pixel coordinates
    *      
    *
    *
    *
     
    *      int AFTT_CreateCenter (var string tt_text, var int background) 
    *          Creates tooltip in the center of the screen
    *                tt_text - text of the tooltip
    *                background - render background texture? TRUE/FALSE 
    *                return - tooltip handle
    *      
    *      int AFTT_CreatePosCenter (var string tt_text, var int x, var int y, var int background) 
    *          Creates tooltip with the center defined by x and y
    *                tt_text - text of the tooltip
    *                x - horizontal position (virtual coordinates)
    *                y - vertical position (virtual coordinates)
    *                background - render background texture? TRUE/FALSE 
    *                return - tooltip handle
    *      
    *      int AFTT_CreatePosCenterPxl (var string tt_text, var int x, var int y, var int background) 
    *          Same as AFTT_CreatePosCenter but with pixel coordinates
    *      
    *      
    *      
    *  Shows the tooltip   
    *      AFTT_Show(var int hndl) - shows the tooltip
    *    Hides the tooltip
    *      AFTT_Hide(var int hndl) - hides the tooltip  
    * 
    */
    
    
    /* TODO:
    *    [x] fade-in and -out animations
    *    [x] timed - checks if the tooltip was shown for long enough time
    *    [x] custom position per tooltip
    *    [x] background
    */
    
    
    //========================================
    // Getters for positions
    //========================================
    func int ViewPtr_GetPosX(var int ptr) {
        var zCView v; v = _^(ptr);
        return v.vposx; 
    };
    
    func int ViewPtr_GetPosXPxl(var int ptr) {
        var zCView v; v = _^(ptr);
        return v.pposx; 
    };
    
    func int View_GetPosX(var int hndl) {
        return ViewPtr_GetPosX(getPtr(hndl));
    };
    func int View_GetPosXPxl(var int hndl) {
        return ViewPtr_GetPosXPxl(getPtr(hndl));
    };
    
    func int ViewPtr_GetPosY(var int ptr) {
        var zCView v; v = _^(ptr);
        return v.vposy; 
    };
    
    func int ViewPtr_GetPosYPxl(var int ptr) {
        var zCView v; v = _^(ptr);
        return v.pposy; 
    };
    
    func int View_GetPosY(var int hndl) {
        return ViewPtr_GetPosY(getPtr(hndl));
    };
    func int View_GetPosYPxl(var int hndl) {
        return ViewPtr_GetPosYPxl(getPtr(hndl));
    };
    
    
    func void ViewPtr_MoveToX(var int ptr, var int x) 
    {
        ViewPtr_MoveTo(ptr, x, ViewPtr_GetPosY(ptr));
    };
    func void ViewPtr_MoveToY(var int ptr, var int y) 
    {
        ViewPtr_MoveTo(ptr, ViewPtr_GetPosX(ptr), y);
    };
    
    func void View_MoveToX(var int hndl, var int x) 
    {
        ViewPtr_MoveTo(getPtr(hndl), x, ViewPtr_GetPosY(getPtr(hndl)));
    };
    func void View_MoveToY(var int hndl, var int y) 
    {
        ViewPtr_MoveTo(getPtr(hndl), ViewPtr_GetPosX(getPtr(hndl)), y);
    };
    
    
    //========================================
    // Constants
    //========================================
    
    const int AFTT_ShowOnce             = 0;
    const int AFTooltip_seconds         = 5;
    
    const int AFTT_posx                 = 100; // 512 if you are showing FPS
    const int AFTT_posy                 = 100;
    const int AFTT_moveAniOffset         = 256;
    
    const int AFTT_FadeOutTime             = 500;
    
    const string AFTT_font_text         = "FONT_OLD_10_WHITE.TGA";
    const string AFTT_BgTexture         = "INV_BACK_STEAL.TGA";
    
    const string AFTT_nl_separator         = "~";
    
    const int AFTT_GlobalHndl            = 0;
    
    //========================================
    // Tooltip class
    //========================================
    class AFTooltip 
    {
        var int viewHndl;    // view handle
        var int shown;      // was the tooltip already shown?
        var int time;       // saves the time, on tooltip show
    };
    
    instance AFTooltip@(AFTooltip);
    
    //========================================
    // Archiver function
    //========================================
    
    func void AFTooltip_Archiver(var AFTooltip this)
    {
        PM_SaveInt        ("viewHndl"    , this.viewHndl    );
        PM_SaveInt         ("shown"    , this.shown    );
        // time doesn't have to be saved
    };
    
    //========================================
    // Unarchiver function
    //========================================
    
    func void AFTooltip_Unarchiver(var AFTooltip this)
    {
        if (PM_Exists("viewHndl"    ))        { this.viewHndl     = PM_Load    ("viewHndl"    ); };
        if (PM_Exists("shown"        ))        { this.shown        = PM_Load    ("shown"    ); };
    };
    
    //========================================
    // Deletes the tooltip object
    //========================================
    func void AFTooltip_Delete(var AFTooltip ttip) 
    { 
        if (Hlp_IsValidHandle(ttip.viewHndl)) 
        { 
            View_DeleteText(ttip.viewHndl);
            View_Delete(ttip.viewHndl);
        };
    };
    
    //========================================
    // This function allows me to recalculate
    // the width to use in the "sub views"
    // so that I can use the same margin value I 
    // used to calculate the size of the main view 
    // to position the text-lines
    // value - input value
    // size - "size" of the space where we are defining the value
    // newSize - is the size (in the same axis) of the new view
    //========================================
    func int ratio(var int value, var int size, var int newSize)
    {
        Print_GetScreenSize();
        var int ratio; ratio = mulf(divf(mkf(size), mkf(newSize)), mkf(value));
        return roundf(ratio);
    };
    
    //========================================
    // Creates an instance of the tooltip object
    // tt_text - text of the tooltip
    //========================================
    func int _AFTT_Create (var string tt_text, var int x, var int y, var int background, var int center) 
    {
        var int tooltip; tooltip = new(AFTooltip@);
        var AFTooltip ttip; ttip = get(tooltip);
        
        Print_GetScreenSize();
        
        var int numLines; numLines = STR_SplitCount(tt_text, AFTT_nl_separator);
        var string line;
        
        /*
        +--------------------------------------------------------------------------+
        |                  .                <top margin>              .                      |
        |..........................................................................|
        |               .              <text margin top>              .                  |
        |               .                -Font height-             .                  |
        |               .            <text margin bottom>          .                  |
        | <left margin> .              <text margin top>              . <right margin>   |
        |               .                -Font height-             .                  |
        |               .            <text margin bottom>          .                  |
        |..........................................................................|
        |                  .                <bottom margin>              .                      |
        +--------------------------------------------------------------------------+
        */
    
        const int leftM         = 50;
        const int rightM         = leftM;
        const int topM             = 50;
        const int bottomM         = topM;
        const int topTextM         = 50;
        const int bottomTextM     = 50;
        
        var int lineWidth;
        var int lineHeight;
        // get the longest line
        lineWidth = Print_ToVirtual(Print_LongestLineLengthExt(tt_text, AFTT_font_text, AFTT_nl_separator), PS_X);
        // get font height
        lineHeight = Print_GetFontHeight(AFTT_font_text);
        
        if (!center)
        {
            ttip.viewHndl = View_Create    (    x,
                                                y, 
                                                x + lineWidth + leftM + rightM,
                                                y + numLines * (Print_ToVirtual(lineHeight, PS_X) + topTextM + bottomTextM) + bottomM + topM);
        }
        else
        {
            ttip.viewHndl = View_CreateCenter    (    x,
                                                    y, 
                                                    x + lineWidth + leftM + rightM,
                                                    y + numLines * (Print_ToVirtual(lineHeight, PS_X) + topTextM + bottomTextM) + bottomM + topM);
    
        };
    
        if (background)
        {
            View_SetTexture(ttip.viewHndl, AFTT_BgTexture);
        };
        
        View_AddText (    ttip.viewHndl,
                            ratio(leftM, PS_VMax , lineWidth + leftM + rightM),
                            ratio(topM, PS_VMax , numLines * (Print_ToVirtual(lineHeight, PS_X) + topTextM + bottomTextM) + bottomM + topM),
                            tt_text,
                            AFTT_font_text);
    
        View_SetAlphaAll(ttip.viewHndl, 0);
        
        return tooltip+0;
    };
    
    //========================================
    // Creates a tooltip - top left corner coordinates
    //========================================
    func int AFTT_Create (var string tt_text, var int background) 
    {                                               
        return _AFTT_Create(tt_text, AFTT_posx, AFTT_posy, background, 0);
    };
    
    func int AFTT_CreatePos (var string tt_text, var int x, var int y, var int background) 
    {
        return _AFTT_Create(tt_text, x, y, background, 0);
    };
    
    func int AFTT_CreatePosPxl (var string tt_text, var int x, var int y, var int background) 
    {
        return _AFTT_Create(tt_text, Print_ToVirtual(x, PS_X), Print_ToVirtual(y, PS_Y), background, 0);
    };
    
    //========================================
    // Creates a tooltip - center coordinates
    //========================================
    func int AFTT_CreateCenter (var string tt_text, var int background) 
    {                                               
        return _AFTT_Create(tt_text, PS_VMax/2, PS_VMax/2, background, 1);
    };
    
    func int AFTT_CreatePosCenter (var string tt_text, var int x, var int y, var int background) 
    {
        return _AFTT_Create(tt_text, x, y, background, 1);
    };
    
    func int AFTT_CreatePosCenterPxl (var string tt_text, var int x, var int y, var int background) 
    {
        return _AFTT_Create(tt_text, Print_ToVirtual(x, PS_X), Print_ToVirtual(y, PS_Y), background, 1);
    };
    
    //========================================
    // Show the tooltip
    //========================================
    func void AFTT_Show(var int hndl) 
    {
        var AFTooltip ttip; ttip = get(hndl);
        
        // update time
        ttip.time = Timer();
        PV("ttip.time", ttip.time);
        PV("ttip.shown", ttip.shown);
        PV("AFTT_ShowOnce", AFTT_ShowOnce);
        if (ttip.shown == 1 && AFTT_ShowOnce == 1 ) { return; };
        
        View_Open(ttip.viewHndl);
        
        var int Anim8_motion;
        var int Anim8_alpha;
        PV("View_GetPosY(ttip.viewHndl)", View_GetPosY(ttip.viewHndl));
        Anim8_motion = Anim8_NewExt(View_GetPosY(ttip.viewHndl) + AFTT_moveAniOffset, View_MoveToY, ttip.viewHndl, false);
        Anim8(Anim8_motion, View_GetPosY(ttip.viewHndl), AFTT_FadeOutTime, A8_SlowStart);
        
        Anim8_alpha = Anim8_NewExt(0, View_SetAlphaAll, ttip.viewHndl, false);
        Anim8(Anim8_alpha, 255, AFTT_FadeOutTime, A8_SlowStart);
        
        Anim8_RemoveIfEmpty    (Anim8_motion, true);
        Anim8_RemoveIfEmpty    (Anim8_alpha, true);
    };
    
    func void AFTT_onRemove()
    {
        View_Close(AFTT_GlobalHndl);
    };
    
    //========================================
    // Hides the tooltip
    //========================================
    func void AFTT_Hide(var int hndl) 
    {
        var AFTooltip ttip; ttip = get(hndl);
        AFTT_GlobalHndl = ttip.viewHndl;
        
        if (ttip.shown == 1 && AFTT_ShowOnce == 1 ) { return; };
        
        if (AFTT_ShowOnce)
        {
            var int elapsedTime; elapsedTime = Timer();
            if ( (elapsedTime - ttip.time) >= (AFTooltip_seconds * 1000) )
            {
                ttip.shown = 1;
            };
        };
        
        var int Anim8_motion;
        var int Anim8_alpha;
        PV("View_GetPosY(ttip.viewHndl)", View_GetPosY(ttip.viewHndl));
        Anim8_motion = Anim8_NewExt(View_GetPosY(ttip.viewHndl), View_MoveToY, ttip.viewHndl, false);
        Anim8(Anim8_motion, View_GetPosY(ttip.viewHndl) + AFTT_moveAniOffset, AFTT_FadeOutTime, A8_SlowStart);
        
        Anim8_alpha = Anim8_NewExt(255, View_SetAlphaAll, ttip.viewHndl, false);
        Anim8(Anim8_alpha, 0, AFTT_FadeOutTime, A8_SlowStart);
    
        Anim8_CallOnRemove(Anim8_alpha, AFTT_onRemove);
        
        Anim8_RemoveIfEmpty    (Anim8_motion, true);
        Anim8_RemoveIfEmpty    (Anim8_alpha, true);    
    };


    And here is my init function I call after Ikarus and LeGo init functions.
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    const int SLEEP_TT     = 0;
    func void AFTT_Init()
    {
        // Loads the setting from an ini file
    //    AFTT_ShowOnce = STR_ToInt( MEM_GetGothOpt("AF_Tooltips", "ShowOnce"));
        
        const int once = 0;
        if (!once) {
            // Bed
            
            if (!SLEEP_TT)
            {        
                SLEEP_TT = AFTT_Create("You can use bed to sleep.~Choose the hour you wake up using arrow keys or A/D.~Use PageUp/PageDown or Q/E to choose time in 6 hour increments.", TRUE);
            };
        // -----> Here you can add more tooltips
    
            once = 1;
        }; };


    I don't quite understand how exactly PermMem works Not sure if I am supposed to save the PermMem handle like I would save an int, I haven't found anything about this particular use case (saving PM handles) on the wiki.

    Auronen

  2. Beiträge anzeigen #502 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Handles are simply integers and do not need special consideration (in fact, you don't need archive/unarchive functions at all in your case, because you're only storing "primitive" types, i.e. integers). Your code looks correct, but the crash report shows that you're right - there seems to be a problem during unarchiving. It doesn't even get to your code, though, it's still trying to read the save file. Can you post the corresponding save file? It's the SCRPTSAVE.SAV in the savegame folder, a simple text file.

    How are you testing your changes? Did you create a proper mod (with a custom .ini.file)? I think we support all modes by now, but that might be another source of error.

  3. Beiträge anzeigen #503 Zitieren
    Apprentice Avatar von Auronen
    Registriert seit
    Dec 2020
    Beiträge
    25
     
    Auronen ist offline
    Oh, so primitive types get stored automatically? That's amazing!
    Yes, I have my testing mod with its own ini file.

    I make changes, I compile the game and then check, if the view shows up and properly closes, then I check the number of handles (if there are no bugs, that might be multiplaying instances) and then save the game and load -> then it crashes (crashes even if I close the game and then try to load it, after launching again).

    SCRIPTSAVE.SAV contents:
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    PermMem::v2
    
    HNDL:1
    ZCARRAY:LCEVENT
    {
        HANDLER0=s_RENDER_RESTOREPOINTER_LISTENER
    }
    
    
    HNDL:3
    FFITEM:FFITEM@
    {
        LOOP=sBUTTONS_DO
        NEXT=i19729
    }
    
    
    HNDL:4
    FFITEM:FFITEM@
    {
        LOOP=s_ANIM8_FFLOOP
        NEXT=i17100
        GAMETIME=i1
    }
    
    
    HNDL:5
    ZCARRAY:LCEVENT
    {
    }
    
    
    HNDL:6
    ZCLIST:ZCLIST@
    {
        DATA=i0
        NEXT=pNULL
    }
    
    
    HNDL:7
    AFTOOLTIP:AFTOOLTIP@
    {
        VIEWHNDL=i8
        SHOWN=i0
    }
    
    
    HNDL:8
    ZCVIEW:ZCVIEW@
    {
        _VTBL=i8643340
        _ZCINPUTCALLBACK_VTBL=i8643332
        M_BFILLZ=i0
        NEXT=i379960200
        VIEWID=i2
        FLAGS=i512
        INTFLAGS=i1
        ONDESK=i0
        ALPHAFUNC=i2
        COLOR=i100663295
        ALPHA=i0
        CHILDS_COMPARE=i0
        CHILDS_COUNT=i0
        CHILDS_LAST=i0
        CHILDS_WURZEL=i0
        OWNER=i0
        BACKTEX=sINV_BACK_STEAL.TGA
        VPOSX=i100
        VPOSY=i356
        VSIZEX=i4395
        VSIZEY=i746
        PPOSX=i16
        PPOSY=i31
        PSIZEX=i687
        PSIZEY=i66
        FONT=sFONT_OLD_10_WHITE.TGA
        FONTCOLOR=i100663295
        PX1=i50
        PY1=i50
        PX2=i8142
        PY2=i8142
        WINX=i50
        WINY=i50
        TEXTLINES=pZCLIST__ZCVIEWTEXT
        {
            ZCVIEWPTR=pZCVIEWTEXT
            {
                VTBL=i8643396
                POSX=i93
                POSY=i550
                TEXT=sYou can use bed to sleep.
                FONTNAME=sFONT_OLD_10_WHITE.TGA
                TIMER=i0
                INPRINTWIN=i0
                COLOR=i16777215
                TIMED=i0
                COLORED=i1
            }
            NEXT=pZCLIST__ZCVIEWTEXT
            {
                ZCVIEWPTR=pZCVIEWTEXT
                {
                    VTBL=i8643396
                    POSX=i93
                    POSY=i2784
                    TEXT=s
                                    Choose the hour you wake up using arrow keys or A/D.
                    FONTNAME=sFONT_OLD_10_WHITE.TGA
                    TIMER=i0
                    INPRINTWIN=i0
                    COLOR=i16777215
                    TIMED=i0
                    COLORED=i1
                }
                NEXT=pZCLIST__ZCVIEWTEXT
                {
                    ZCVIEWPTR=pZCVIEWTEXT
                    {
                        VTBL=i8643396
                        POSX=i93
                        POSY=i5018
                        TEXT=s
                                    Use PageUp/PageDown or Q/E to choose time in 6 hour increments.
                        FONTNAME=sFONT_OLD_10_WHITE.TGA
                        TIMER=i0
                        INPRINTWIN=i0
                        COLOR=i16777215
                        TIMED=i0
                        COLORED=i1
                    }
                    NEXT=pNULL
                }
            }
        }
        SCROLLMAXTIME=i0
        SCROLLTIMER=i0
        FXOPEN=i0
        FXCLOSE=i0
        TIMEDIALOG=i0
        TIMEOPEN=i0
        TIMECLOSE=i0
        SPEEDOPEN=i994352038
        SPEEDCLOSE=i994352038
        ISOPEN=i0
        ISCLOSED=i1
        CONTINUEOPEN=i0
        CONTINUECLOSE=i0
        REMOVEONCLOSE=i0
        RESIZEONOPEN=i0
        MAXTEXTLENGTH=i0
        TEXTMAXLENGTH=s
        POSCURRENT_0=aINT:2
        [
            0=i1098907648
            1=i1106771968
        ]
        POSCURRENT_1=aINT:2
        [
            0=i1143980032
            1=i1120010240
        ]
        POSOPENCLOSE_0=aINT:2
        [
            0=i0
            1=i0
        ]
        POSOPENCLOSE_1=aINT:2
        [
            0=i0
            1=i0
        ]
    }
    
    
    HNDL:9
    HT_ARRAY:HT@
    {
        LENGTH=i284
        ELEMENTS=i3
        0=pZCARRAY
        {
            LENGTH=i2
            ARRAY=aINT:2
            [
                0=i17985
                1=i18
            ]
        }
        POS0=i4
        1=pZCARRAY
        {
            LENGTH=i2
            ARRAY=aINT:2
            [
                0=i18757
                1=i15
            ]
        }
        POS1=i45
        2=pZCARRAY
        {
            LENGTH=i2
            ARRAY=aINT:2
            [
                0=i17658
                1=i12
            ]
        }
        POS2=i70
        SUBARRAYS=i3
    }
    
    
    HNDL:10
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i410851576
            1=i410851895
        ]
    }
    
    
    HNDL:11
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i3
        ARRAY=aINT:3
        [
            0=i0
            1=i0
            2=i0
        ]
    }
    
    
    HNDL:12
    AFDAMAGE:AFDAMAGE@
    {
        DAMAGEHNDL=i13
        ARMOURHNDL=i14
    }
    
    
    HNDL:13
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i10
            1=i20
        ]
    }
    
    
    HNDL:14
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i0
            1=i0
        ]
    }
    
    
    HNDL:15
    AFDAMAGE:AFDAMAGE@
    {
        DAMAGEHNDL=i16
        ARMOURHNDL=i17
    }
    
    
    HNDL:16
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i0
            1=i0
        ]
    }
    
    
    HNDL:17
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i15
            1=i25
        ]
    }
    
    
    HNDL:18
    AFDAMAGE:AFDAMAGE@
    {
        DAMAGEHNDL=i19
        ARMOURHNDL=i20
    }
    
    
    HNDL:19
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i9
            1=i22
        ]
    }
    
    
    HNDL:20
    ZCARRAY:ZCARRAY@
    {
        LENGTH=i2
        ARRAY=aINT:2
        [
            0=i0
            1=i0
        ]
    }
    
    
    HNDL:21
    FFITEM:FFITEM@
    {
        LOOP=sFF_GDRPC
        NEXT=i20210
        DELAY=i5000
    }
    
    
    PermMem::End


    There are also some other handles, as you may see, but I tested all of them (by turning them off - they are my other featuers I am working on) and only these tooltip ones are crashing.

    Thank you, for your time

    Auronen

  4. Beiträge anzeigen #504 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    There are linebreaks in the save file, which really should not be there. You're using ~ as a line seperator (as you should), but that shouldn't insert newlines into the string
    I'm currently at work, but maybe I can think about the problem more later. For now you could confirm that it works if you use single-line tooltips (you could simply delete the newlines from the tooltips in the savefile as well).

  5. Beiträge anzeigen #505 Zitieren
    Apprentice Avatar von Auronen
    Registriert seit
    Dec 2020
    Beiträge
    25
     
    Auronen ist offline
    Yes, that was it! It was my bad, in my local version there was a white character (probably missclick, I made in my text editor) at the end of the string.

    Thank you, meybe we could add a string function, that strips strings off white non-printable characters?

    But thank you very much, everything works really nice

    Auronen

  6. Beiträge anzeigen #506 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    I have to raise the Milky-way message about talent. With the new version of Lego, some players lose the pointer to the NPC, because of which the stack overflows and crashes.

    https://forum.worldofplayers.de/foru...1#post26740686

    Code:
    [f] 03:11 Fault: 0 Q:     [start of stacktrace][f] 03:11 Fault: 0 Q:             MEMINT_HANDLEERROR(2, 'MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.') +   62 bytes
    [f] 03:11 Fault: 0 Q:             MEM_WARN('MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.') +   21 bytes
    [f] 03:11 Fault: 0 Q:             MEM_PTRTOINST(706017644)                                       +   77 bytes
    [f] 03:11 Fault: 0 Q:             MEM_ARRAYWRITE(0, 2, 1)                                        +   28 bytes
    [f] 03:11 Fault: 0 Q:             TAL_SETVALUE((instance)1717866344, 2, 1)                       +  133 bytes
    [f] 03:11 Fault: 0 Q:             B_INITNPCGLOBALS()                                             +   60 bytes
    [f] 03:11 Fault: 0 Q:             B_ENTER_LOAWORLD()                                             +    5 bytes
    [f] 03:11 Fault: 0 Q:             B_LOA_KAPITELWECHSEL(2, 1)                                     +  350 bytes
    [f] 03:11 Fault: 0 Q:             DIA_AM_K2_SQ_EXPEDITION_HAMILKAR_QUEST_KAP2_INFO()             +  295 bytes
    [f] 03:11 Fault: 0 Q:     [end of stacktrace]
    [w] 03:11 Warn:  0 Q:     MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.
    [i] 03:11 Info:  2 U:    PAR: Adressing an empty Instance : ZCARRAY.NUMINARRAY .... <zParser_Symbol.cpp,#365>
    Modification of Legend of Ahssun, only Russian translation.

    Interestingly, Ninja and any patch that uses Lego fixes this bug (example with Itemlocator).

    lego 2.8.0, ikarus 1.2.2
    Geändert von N1kX (27.10.2021 um 13:36 Uhr)

  7. Beiträge anzeigen #507 Zitieren
    Ritter Avatar von Kirides
    Registriert seit
    Jul 2009
    Ort
    Norddeutschland
    Beiträge
    1.780
     
    Kirides ist offline
    Zitat Zitat von N1kX Beitrag anzeigen
    I have to raise the Milky-way message about talent. With the new version of Lego, some players lose the pointer to the NPC, because of which the stack overflows and crashes.

    https://forum.worldofplayers.de/foru...1#post26740686

    Code:
    [f] 03:11 Fault: 0 Q:     [start of stacktrace][f] 03:11 Fault: 0 Q:             MEMINT_HANDLEERROR(2, 'MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.') +   62 bytes
    [f] 03:11 Fault: 0 Q:             MEM_WARN('MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.') +   21 bytes
    [f] 03:11 Fault: 0 Q:             MEM_PTRTOINST(706017644)                                       +   77 bytes
    [f] 03:11 Fault: 0 Q:             MEM_ARRAYWRITE(0, 2, 1)                                        +   28 bytes
    [f] 03:11 Fault: 0 Q:             TAL_SETVALUE((instance)1717866344, 2, 1)                       +  133 bytes
    [f] 03:11 Fault: 0 Q:             B_INITNPCGLOBALS()                                             +   60 bytes
    [f] 03:11 Fault: 0 Q:             B_ENTER_LOAWORLD()                                             +    5 bytes
    [f] 03:11 Fault: 0 Q:             B_LOA_KAPITELWECHSEL(2, 1)                                     +  350 bytes
    [f] 03:11 Fault: 0 Q:             DIA_AM_K2_SQ_EXPEDITION_HAMILKAR_QUEST_KAP2_INFO()             +  295 bytes
    [f] 03:11 Fault: 0 Q:     [end of stacktrace]
    [w] 03:11 Warn:  0 Q:     MEM_PtrToInst: ptr is NULL. Use MEM_NullToInst if that's what you want.
    [i] 03:11 Info:  2 U:    PAR: Adressing an empty Instance : ZCARRAY.NUMINARRAY .... <zParser_Symbol.cpp,#365>
    Modification of Legend of Ahssun, only Russian translation.

    Interestingly, Ninja and any patch that uses Lego fixes this bug.

    lego 2.8.0, ikarus 1.2.2
    There were many changes and fixes to LeGo and Ikarus since the release of some mods.

    Ninja always provides the latest LeGo and Ikarus (if a patch requests both features)

    if e.g. LoA uses LeGo 2.4.0 and there were issues with the old code, you would not be able to reproduce it with the current code.
    That's why every single request with issues regarding LeGo / Ikarus should always be prefaced with the affected version of each.

    I for myself know that there were few issues in LeGo regarding Talents and Buffs, which were fixed with the latest versions.

  8. Beiträge anzeigen #508 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    Zitat Zitat von Kirides Beitrag anzeigen
    There were many changes and fixes to LeGo and Ikarus since the release of some mods.

    Ninja always provides the latest LeGo and Ikarus (if a patch requests both features)

    if e.g. LoA uses LeGo 2.4.0 and there were issues with the old code, you would not be able to reproduce it with the current code.
    That's why every single request with issues regarding LeGo / Ikarus should always be prefaced with the affected version of each.

    I for myself know that there were few issues in LeGo regarding Talents and Buffs, which were fixed with the latest versions.
    I understood that. But the change in the dev version is not as unaffected. The difference between the 2.8.0 and dev versions is in two scripts that do not relate to this problem in any way.

    https://imgur.com/dAktp3d

    https://imgur.com/NS7jhpG

    https://imgur.com/m7OHtGf

    Of course, I will rebuild with the dev version and check a little later.


    Edit. Compile with dev version ikarus+Lego helped.
    Geändert von N1kX (27.10.2021 um 15:45 Uhr)

  9. Beiträge anzeigen #509 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    Noticed an oddity when using AI_Function
    Sometimes the dialog ends incorrectly, which is why hero still has aivar[AIV_INVINCIBLE] 1
    for example, such a dialog. (From the mods Arholos)
    Code:
    
    func void racius_ultrasecretnotevenpossible_damage() 
    {
        B_MagicHurtNpc(hero, none_13361_racius, 9999);
    };
    
    
    instance dia_13361_racius_exit(C_INFO)
    {
        npc = None_13361_Racius;
        nr = 999;
        condition = dia_13361_racius_exit_condition;
        information = dia_13361_racius_exit_info;
        permanent = TRUE;
        description = DIALOG_ENDE;
    };
    
    
    func int dia_13361_racius_exit_condition() 
    {
        return TRUE;
    };
    
    
    func void dia_13361_racius_exit_info() 
    {
        AI_StopProcessInfos(self);
    };
    
    
    instance dia_13361_racius_ultrasecretnotevenpossible(C_INFO)
    {
        npc = None_13361_Racius;
        nr = 1;
        condition = dia_13361_racius_ultrasecretnotevenpossible_condition;
        information = dia_13361_racius_ultrasecretnotevenpossible_info;
        permanent = FALSE;
        important = TRUE;
    };
    
    
    func int dia_13361_racius_ultrasecretnotevenpossible_condition() 
    {
        if (Npc_IsInState(self, zs_talk)) {
            return TRUE;
        };
    };
    
    
    func void dia_13361_racius_ultrasecretnotevenpossible_info() 
    {
        B_Say(self, other, "$DEAD");
        B_Say(other, self, "$MARVIN_ITSVERYSTRANGE");
        AI_Wait(other, 1.00);
        ai_function(other, racius_ultrasecretnotevenpossible_damage);
        AI_StopProcessInfos(self);
    };
    If you remove the ai_function call, the dialog will end correctly.

    Also, substituting a function from the new version of Lego _AI_FUNCTION_EVENT, where there is a backup, does not help.

    But I agree that the dialogue is written a little crookedly.

    I changed the order a bit, which I think is safer. Of course, you can reset aivar, but it seems to me that this is not the way out.
    Code:
    func void racius_ultrasecretnotevenpossible_damage() {
    	//B_MagicHurtNpc(hero, none_13361_racius, 9999);
    	Npc_ChangeAttribute(none_13361_racius, ATR_HITPOINTS, -none_13361_racius.attribute[ATR_HITPOINTS_MAX]);
    };
    
    
    func void dia_13361_racius_ultrasecretnotevenpossible_info() 
    {
    	B_Say(self, other, "$DEAD");
    	B_Say(other, self, "$MARVIN_ITSVERYSTRANGE");
    	AI_WaitTillEnd(self, other);
    	AI_StopProcessInfos(self);
    	ai_function(self, racius_ultrasecretnotevenpossible_damage);
    };
    If anything, you can substitute functions through zparserextender for your personal checks.

  10. Beiträge anzeigen #510 Zitieren
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.204
     
    Milky-Way ist offline
    If I remember correctly, weird things happen in general when ending a dialog before self has had any ai_output commands - so that might be what's going on here as well? There are some funny workarounds, like an ai_output that is not capitalized because it will then be ignored in some way but it will still make the ending of the dialog work properly.

  11. Beiträge anzeigen #511 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    If you're interested, the bug looks like this. Maybe of course it is possible to write a script better, I have an idea only to start death after n-time

    Before
    https://youtu.be/Kh0895v9h5c

    Code:
    func void AI_racius_ultrasecretnotevenpossible_damage(){
        FF_ApplyOnceExt(racius_ultrasecretnotevenpossible_damage,1000,-1);
    };
    
    
    func void racius_ultrasecretnotevenpossible_damage()
    {
        //B_MagicHurtNpc(hero, none_13361_racius, 9999);
        AI_PlayAni(none_13361_racius, "T_LGUARD_2_STAND");
        Npc_ChangeAttribute(none_13361_racius, ATR_HITPOINTS, -none_13361_racius.attribute[ATR_HITPOINTS_MAX]);
        FF_Remove(racius_ultrasecretnotevenpossible_damage);
    };
    
    
    func void dia_13361_racius_ultrasecretnotevenpossible_info()
    {
        B_Say(self, other, "$DEAD");
        B_Say(other, self, "$MARVIN_ITSVERYSTRANGE");
        /*AI_Wait(other, 1.00);
        ai_function(other, racius_ultrasecretnotevenpossible_damage);
        AI_StopProcessInfos(self);*/
        AI_WaitTillEnd(self, other);
        AI_StopProcessInfos(self);
        //Lego function
        ai_function(self, AI_RACIUS_ULTRASECRETNOTEVENPOSSIBLE_DAMAGE);
       
        //Union Function
        //AI_CallScript("AI_RACIUS_ULTRASECRETNOTEVENPOSSIBLE_DAMAGE", self, other);
    };
    After
    https://youtu.be/zOSPIYgIFuY

  12. Beiträge anzeigen #512 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline
    When player is in dialogue with an NPC - NPC has ZS state ZS_Talk.
    ZS_Talk_Loop takes care of aivar[AIV_INVINCIBLE] - it is in this loop where variable is set to FALSE for both player (other) and NPC (self) when dialogue is ended.


    If you kill NPC before closing dialogue (before InfoManager_HasFinished) then NPC's state will change to ZS_Dead - and this piece of code will not be executed:
    Code:
    func int ZS_Talk_Loop () {
        if (InfoManager_HasFinished())
        && (zsTalkBugfix == TRUE) {
            self.aivar[AIV_INVINCIBLE] = FALSE;
            other.aivar[AIV_INVINCIBLE] = FALSE;


    This is not caused by AI_Function - it is more you breaking dialogue logic by killing NPC before exiting dialogue properly.


    Maybe a better solution would be to create frame-function that would be checking whether dialogue has ended and would kill NPC only afterwards.

  13. Homepage besuchen Beiträge anzeigen #513 Zitieren
    Team Velen
    Registriert seit
    Aug 2015
    Beiträge
    952
     
    Bloodfly91 ist offline
    Ich möchte dem Spieler eine Textur anzeigen. Diese soll sich genau in der Bildschirmmitte befinden. Dafür dürfte sich dann wohl die LeGo-Funktion View_CreateCenter eignen. Aber irgendwie krieg ich das nicht hin. Ich hab jetzt schon so viel mit den Werten probiert, aber die Textur sitzt immer woanders, nur nicht dort, wo ich sie eigentlich haben will. Auch kriege ich es nicht hin, dass sie ihre Originalgröße, 300x300, verwendet. Ich bin mir sicher, dass für letzteres die beiden hinteren Werte verantwortlich sind, aber die ist dennoch immer verzogen. Ich fühle mich gerade ziemlich doof, dass ich so was simples nicht hinbekomme, aber kann mir jemand sagen, wie ich das mache und mir das ggf. auch noch mal etwas genauer erklären, mit diesen ganzen View_Create Werten?

  14. Beiträge anzeigen #514 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Ist die Dokumentation da an irgendeiner Stelle unklar? Verstehst du, was virtuelle Koordinaten sind? Die Kurzerklärung: Bei virtuellen Koordinaten tut man so, als wäre der Bildschirm des Spielers genau 8192x8192 Pixel groß. Die Mitte des Bildschirms befindet sich dann also immer an den Koordinaten (4096, 4096). Falls du die Größe der Textur nicht skalieren möchtest (das bedeutet aber auch, dass wenn der Spieler eine höhere Auflösung benutzt sie kleiner erscheint), kannst du die wirklichen Pixel in virtuelle Pixel umrechnen mit Print_ToVirtual, also z.B.
    Code:
    virtual_width = Print_ToVirtual(300, PS_X);

  15. Homepage besuchen Beiträge anzeigen #515 Zitieren
    Team Velen
    Registriert seit
    Aug 2015
    Beiträge
    952
     
    Bloodfly91 ist offline
    Super, danke Lehona. Das hat schon gereicht, ich hab es nun hinbekommen. Das große Problem dabei war tatsächlich, dass ich nicht wusste, was virtuelle Koordinaten sind.

    Zitat Zitat von Lehona Beitrag anzeigen
    Ist die Dokumentation da an irgendeiner Stelle unklar? Verstehst du, was virtuelle Koordinaten sind? Die Kurzerklärung: Bei virtuellen Koordinaten tut man so, als wäre der Bildschirm des Spielers genau 8192x8192 Pixel groß. Die Mitte des Bildschirms befindet sich dann also immer an den Koordinaten (4096, 4096). Falls du die Größe der Textur nicht skalieren möchtest (das bedeutet aber auch, dass wenn der Spieler eine höhere Auflösung benutzt sie kleiner erscheint), kannst du die wirklichen Pixel in virtuelle Pixel umrechnen mit Print_ToVirtual, also z.B.
    Code:
    virtual_width = Print_ToVirtual(300, PS_X);

  16. Beiträge anzeigen #516 Zitieren
    Ehrengarde Avatar von neocromicon
    Registriert seit
    Jan 2019
    Beiträge
    2.478
     
    neocromicon ist offline
    Moin moin,

    ich benutze für Tagebuch Einträge, XP, Item Übergabe usw. PrintS_Ext. Den Text wurde ich gerne mittig, relativ weit unten ausgeben.
    Das Problem was nun kommt ist, das er sich am ersten Buchstaben orientiert und nicht am "mittigsten" Buchstaben im Text, daher kann ich den Text natürlich nie mittig ausrichten, sondern immer nur Linksbündig.

    Hat dafür jemand eine Lösung? Danke.
    Geändert von neocromicon (07.10.2022 um 11:51 Uhr)

  17. Homepage besuchen Beiträge anzeigen #517 Zitieren
    General Avatar von Dada
    Registriert seit
    Jan 2007
    Ort
    Krefeld
    Beiträge
    3.729
     
    Dada ist offline
    Sollte als Positionsausgabe nicht -1 ausreichen?
    Bei mir ist es bspw. so gelöst:

    Code:
    p.tv_Text = Print_Ext(-1, 700, txt, "FONT_OLD_10_WHITE.TGA", color, -1);
    Der Text wird relativ weit oben ausgegeben und tatsächlich mittig.

  18. Beiträge anzeigen #518 Zitieren
    Ehrengarde Avatar von neocromicon
    Registriert seit
    Jan 2019
    Beiträge
    2.478
     
    neocromicon ist offline
    Hahaha ja.... geht sogar noch einfacher mit:
    Code:
    const int textStX = -1;
    const int textStY = 6144;
    
    Mit -1 hätte ich auch selbst drauf kommen können, naja manchmal sieht man den Wald vor lauter Bäumen net mehr Danke dir!

  19. Beiträge anzeigen #519 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Ansonsten bietet LeGo auch die Möglichkeit an, das selber zu berechnen, mittels Print_GetStringWidth und ein bisschen Zahlengeschubse (die genaue Formel überlasse ich mal dem geneigten Leser ). Falls es mal irgendwo anders als in der Mitte nicht-linksbündig sein soll.

  20. Beiträge anzeigen #520 Zitieren
    Veteran Avatar von N1kX
    Registriert seit
    Aug 2018
    Ort
    Serov
    Beiträge
    640
     
    N1kX ist offline
    In the modification of Arholos, there is a problem with using item_helper_inst - there this instance can get itself an armor and put it on - which is why the armor model breaks. it is necessary in itm_getptr to prohibit the creation of armor at item_helper_inst
    or make sure that this assistant does not equip anything.

    https://imgur.com/YDxpZYi
    Geändert von N1kX (07.10.2022 um 18:25 Uhr)

Seite 26 von 27 « Erste ... 1519222324252627 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