Textures

Results 1 to 4 of 4
  1. #1
    Apprentice CoockieMan is offline
    MemberRank
    Jun 2019 Join Date
    5Posts

    sad Textures

    Hello I found this tutorial on the yt and i have a question how can I edit with this textures.I know that I should put the code to the LoadTex function and I was trying to but something doesnt working and it doesnt change the texture for me.
    Can someone please help me and explaim me how i need to do it properly? :)



  2. #2
    Member Agnares is offline
    MemberRank
    Jun 2014 Join Date
    53Posts

    Re: Textures

    you must have correct texture ids
    you can accomplish this by decompiling your own textures using this simple script

    Add this on top of TachyonRes as new functions
    ////////////////////////////////////////////////////
    Code:
    //CREATE DIR
    void create_directory(char* Path){
        char DirName[256];
        char* p = Path;
        char* q = DirName;
    
    
        while (*p)
        {
            if (('\\' == *p) || ('/' == *p))
            {
                if (':' != *(p - 1))
                {
                    CreateDirectory(DirName, NULL);
                }
            }
            *q++ = *p++;
            *q = '\0';
        }
        CreateDirectory(DirName, NULL);
    }
    
    
    //EXIST DIR
    bool exist_directory(const string& dirName_in)
    {
        DWORD ftyp = GetFileAttributesA(dirName_in.c_str());
        if (ftyp == INVALID_FILE_ATTRIBUTES)
            return false;  //spatna cesta
    
    
        if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
            return true;   //existujici dir
    
    
        return false;    //neexistujuci dir
    }

    Add that to LoadTEX function above the pTRESDATA->insert(MAPRES::value_type........)
    /////////////////////////////////////////////////////////////////////////////////////////////////
    Code:
                
    string path = ".\\TESTXD\\" + strFILE;            
    CString csave = path.c_str();CString fsave;
    fsave.Format(csave + "\\%d.png", dwSize);
    if (!exist_directory(path))
    {
          char* file_t = new char[path.length() + 1];
          strcpy(file_t, path.c_str());
          create_directory(file_t);
    }
    pTEXSRC->SaveImageFile(fsave, D3DXIFF_PNG, pTEXSRC->GetTEX());
    and finally start the client and it should decompile correct textures to your folder that you picked
    Last edited by Agnares; 22-06-19 at 09:04 AM.

  3. #3
    Apprentice CoockieMan is offline
    MemberRank
    Jun 2019 Join Date
    5Posts

    Re: Textures

    Thanks for the function but instead of size i'v used Position and everything working perfectly :)
    So @Agnares I got two more question to you, have you already managed to change a specific texture for a specific item?
    Let's say for example I'v created a new item (sword, armor ect) with a visual from other item and I want to change only the texture of a new item without touching the old one :)

    And the second question: I saw in the Araz's sources a line of code which change the color of chakra's sfx and wondering if it is possible to do the same thing with sfx from a skill? :)

  4. #4
    Proficient Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    159Posts

    Re: Textures

    Quote Originally Posted by Agnares View Post
    a

    i added your second code above pTRES->insert( MAPRES::value_type( dwPOS, pTEX)); in LoadTEX but im getting this error:
    c:\Users\proxx\Desktop\source 4.4\TClient\TEngine\Engine Lib\TachyonRes.cpp(1362): error C2039: 'SaveImageFile' : is not a member of 'CT3DTexture'



Advertisement