Edit code for ABL's item resizing.

Status
Not open for further replies.
Joined
May 17, 2009
Messages
64
Reaction score
98
1. Check sure ur code have m_fScale property.
DxSkinPieceData.h

Code:
public:
    DWORD            m_dwRef;

    BOOL                m_bWorldObj;
    float                m_fScale;    [COLOR=#FF0000]<<<<<<<<[/COLOR]
    D3DXVECTOR3        m_vMax, m_vMin;

    float                m_fHeight;
    float                m_fRadius;

2. Check DxSkinPieceData::LOAD_Ver100 to get scale value from ABL file.
DxSkinPieceData.cpp

Code:
BOOL DxSkinPieceData::LOAD_Ver100( basestream &SFile, LPDIRECT3DDEVICEQ pd3dDevice )
{
    DWORD dwPieceSize;

    //SFile >> m_fScale;
    SFile >> dwPieceSize;
    if ( dwPieceSize > PIECE_SIZE )        return FALSE;

    //    Note : มถฐขต้ ทฮตๅ.
    //
    BOOL bExit;
    for ( DWORD i=0; i<dwPieceSize; ++i )
    {
        SFile >> bExit;
        if ( !bExit )
        {
            m_strPIECE[i].clear();
            continue;
        }

        SFile >> m_strPIECE[i];
    }

    //    Note : บปฦฤภฯ ภะฑโ.
    //
    SFile >> m_strSkeleton;

    //    Note :ฟกดฯธภฬผว ภะฑโ.
    //
    DWORD dwAniNum(0);
    SFile >> dwAniNum;

    m_vecANIFILE.clear();
    m_vecANIFILE.reserve ( dwAniNum );

    for ( DWORD i=0; i<dwAniNum; ++i )
    {
        //std::string strANIFILE;
        //SFile >> strANIFILE;

        // GForceFX 17-06-2013 Fix ABL read .cfg extension animation 
        std::string strTEMP ;
        SFile >> strTEMP ;

        CString strANIFILE;
        bool bCFG;
        bCFG = STRUTIL::ChangeExt ( strTEMP.c_str(), ".cfg", strANIFILE, ".x" );
        if ( !bCFG )
        {
            strANIFILE = strTEMP.c_str();
        }
        m_vecANIFILE.push_back ( strANIFILE.GetString() );
    }
              
        SFile >> m_fScale;     [COLOR=#FF0000]<<<<<<<<<<<<[/COLOR]

    BOOL bExist = FALSE;
    SFile >> bExist;
    if( bExist )    
    {
        SFile >> m_fHeight;
        SFile >> m_fRadius;
    }
    else            return TRUE;

    SFile >> m_dwBONE;

    if ( m_dwBONE > MAX_BONE ) return FALSE;

    for ( i=0; i < m_dwBONE ; ++i )
    {
        SFile >> m_fBONE1[i];
        SFile >> m_fBONE2[i];
        SFile >> m_fBONE3[i];
        SFile >> m_strBONE[i];
    }

    //    Note : นูฟ๎ตๅ นฺฝบ มคบธ ทฮตๅ.
    //

    BOOL bBoundBox(FALSE);
    SFile >> bBoundBox;
    if ( bBoundBox )
    {
        SFile >> m_vMax;
        SFile >> m_vMin;
    }
    else
    {
        m_vMax = D3DXVECTOR3(7.f,20.f,7.f);
        m_vMin = D3DXVECTOR3(-7.f,0.f,-7.f);
    }

    bExist = FALSE;
    SFile >> bExist;
    if( bExist )    SFile >> m_bWorldObj;
    else            return TRUE;

    // Note : ดวม
    SFile >> bExist;

    //CDebugSet::ToLogFile( "load version_0000 : %d asp okey" );

    return TRUE;
}

3. Edit render function like this.
DxSkinCharPiece.cpp

Code:
HRESULT DxSkinCharPiece::Render ( const LPDIRECT3DDEVICEQ pd3dDevice, const D3DXMATRIX &matRot, const BOOL bShadow, const BOOL bEff, const BOOL bReverse )
{
	if ( ISENDANIM() && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
	{
		SELECTANI( AN_GUARD_N , AN_SUB_NONE );
	}

	D3DXMATRIXA16	matLocalRot, matScale;
	D3DXMatrixIdentity( &matScale );
	matScale._11 = m_fScale;
	matScale._22 = m_fScale;
	matScale._33 = m_fScale;
	D3DXMatrixMultiply( &matLocalRot, &matScale, &matRot );     [COLOR="#FF0000"]<<<<<<< add this line (multiply scale to matLocalRot)[/COLOR]

	if ( !m_bAttackLocal && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
		D3DXMatrixRotationYawPitchRoll( &matScale, m_fRotX_F, m_fRotY_F, m_fRotZ_F );
	else
		D3DXMatrixRotationYawPitchRoll( &matScale, m_fRotX, m_fRotY, m_fRotZ );

	D3DXMatrixMultiply( &matLocalRot, &matScale, &matLocalRot );     [COLOR="#FF0000"]<<<<<<< edit this line (multiply position to matLocalRot again)[/COLOR]

	D3DXVECTOR3	vVelocity;
	if ( !m_bAttackLocal && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
		D3DXVec3TransformNormal ( &vVelocity, &m_vVelocityPiece_F, &matRot );
	else
		D3DXVec3TransformNormal ( &vVelocity, &m_vVelocityPiece, &matRot );

	matLocalRot._41 += vVelocity.x;
	matLocalRot._42 += vVelocity.y;
	matLocalRot._43 += vVelocity.z;

Lucky in dev. :):

GForceFX - Edit code for ABL's item resizing. - RaGEZONE Forums
 
------ Build started: Project: EngineLib, Configuration: Release Win32 ------

Compiling...
DxSkinPieceData.cpp
Meshs\DxSkinPieceData.cpp(350) : error C2653: 'STRUTIL' : is not a class or namespace name
Meshs\DxSkinPieceData.cpp(350) : error C3861: 'ChangeExt': identifier not found, even with argument-dependent lookup

Build log was saved at "file://C:\Users\ASND\Desktop\Ran Online Source Code\\_RBuildData\EngineLib\Release\BuildLog.htm"
EngineLib - 2 error(s), 0 warning(s)

DxSkinPieceData.cpp
Code:
BOOL DxSkinPieceData::LOAD_Ver100( basestream &SFile, LPDIRECT3DDEVICEQ pd3dDevice )
{
    DWORD dwPieceSize;

    //SFile >> m_fScale;
    SFile >> dwPieceSize;
    if ( dwPieceSize > PIECE_SIZE )        return FALSE;

    //    Note : 
    //
    BOOL bExit;
    for ( DWORD i=0; i<dwPieceSize; ++i )
    {
        SFile >> bExit;
        if ( !bExit )
        {
            m_strPIECE[i].clear();
            continue;
        }

        SFile >> m_strPIECE[i];
    }

    //    Note : 
    //
    SFile >> m_strSkeleton;

    //    Note :
    //
    DWORD dwAniNum(0);
    SFile >> dwAniNum;

    m_vecANIFILE.clear();
    m_vecANIFILE.reserve ( dwAniNum );

    for ( DWORD i=0; i<dwAniNum; ++i )
    {
        //std::string strANIFILE;
        //SFile >> strANIFILE;

        std::string strTEMP ;
        SFile >> strTEMP ;

        CString strANIFILE;
        bool bCFG;
        bCFG = STRUTIL::ChangeExt ( strTEMP.c_str(), ".cfg", strANIFILE, ".x" );
        if ( !bCFG )
        {
            strANIFILE = strTEMP.c_str();
        }
        m_vecANIFILE.push_back ( strANIFILE.GetString() );
    }
              
        SFile >> m_fScale;     

    BOOL bExist = FALSE;
    SFile >> bExist;
    if( bExist )    
    {
        SFile >> m_fHeight;
        SFile >> m_fRadius;
    }
    else            return TRUE;

    SFile >> m_dwBONE;

    if ( m_dwBONE > MAX_BONE ) return FALSE;

    for ( i=0; i < m_dwBONE ; ++i )
    {
        SFile >> m_fBONE1[i];
        SFile >> m_fBONE2[i];
        SFile >> m_fBONE3[i];
        SFile >> m_strBONE[i];
    }

    //    Note : 
    //

    BOOL bBoundBox(FALSE);
    SFile >> bBoundBox;
    if ( bBoundBox )
    {
        SFile >> m_vMax;
        SFile >> m_vMin;
    }
    else
    {
        m_vMax = D3DXVECTOR3(7.f,20.f,7.f);
        m_vMin = D3DXVECTOR3(-7.f,0.f,-7.f);
    }

    bExist = FALSE;
    SFile >> bExist;
    if( bExist )    SFile >> m_bWorldObj;
    else            return TRUE;

    // Note : 
    SFile >> bExist;

    //CDebugSet::ToLogFile( "load version_0000 : %d asp okey" );

    return TRUE;
}

:/:
 
Last edited:
same problem

c:\Je.Development\Source Codes\Ep8 Source Code\enginelib\Meshs\DxSkinPieceData.cpp(350): error C3861: 'ChangeExt': identifier not found, even with argument-dependent lookup
c:\Je.Development\Source Codes\Ep8 Source Code\enginelib\Meshs\DxSkinPieceData.cpp(350): error C2653: 'STRUTIL' : is not a class or namespace name
 
------ Build started: Project: EngineLib, Configuration: Release Win32 ------

Compiling...
DxSkinPieceData.cpp
Meshs\DxSkinPieceData.cpp(350) : error C2653: 'STRUTIL' : is not a class or namespace name
Meshs\DxSkinPieceData.cpp(350) : error C3861: 'ChangeExt': identifier not found, even with argument-dependent lookup

Build log was saved at "file://C:\Users\ASND\Desktop\Ran Online Source Code\\_RBuildData\EngineLib\Release\BuildLog.htm"
EngineLib - 2 error(s), 0 warning(s)

DxSkinPieceData.cpp
Code:
BOOL DxSkinPieceData::LOAD_Ver100( basestream &SFile, LPDIRECT3DDEVICEQ pd3dDevice )
{
    DWORD dwPieceSize;

    //SFile >> m_fScale;
    SFile >> dwPieceSize;
    if ( dwPieceSize > PIECE_SIZE )        return FALSE;

    //    Note : 
    //
    BOOL bExit;
    for ( DWORD i=0; i<dwPieceSize; ++i )
    {
        SFile >> bExit;
        if ( !bExit )
        {
            m_strPIECE[i].clear();
            continue;
        }

        SFile >> m_strPIECE[i];
    }

    //    Note : 
    //
    SFile >> m_strSkeleton;

    //    Note :
    //
    DWORD dwAniNum(0);
    SFile >> dwAniNum;

    m_vecANIFILE.clear();
    m_vecANIFILE.reserve ( dwAniNum );

    for ( DWORD i=0; i<dwAniNum; ++i )
    {
        //std::string strANIFILE;
        //SFile >> strANIFILE;

        std::string strTEMP ;
        SFile >> strTEMP ;

        CString strANIFILE;
        bool bCFG;
        bCFG = STRUTIL::ChangeExt ( strTEMP.c_str(), ".cfg", strANIFILE, ".x" );
        if ( !bCFG )
        {
            strANIFILE = strTEMP.c_str();
        }
        m_vecANIFILE.push_back ( strANIFILE.GetString() );
    }
              
        SFile >> m_fScale;     

    BOOL bExist = FALSE;
    SFile >> bExist;
    if( bExist )    
    {
        SFile >> m_fHeight;
        SFile >> m_fRadius;
    }
    else            return TRUE;

    SFile >> m_dwBONE;

    if ( m_dwBONE > MAX_BONE ) return FALSE;

    for ( i=0; i < m_dwBONE ; ++i )
    {
        SFile >> m_fBONE1[i];
        SFile >> m_fBONE2[i];
        SFile >> m_fBONE3[i];
        SFile >> m_strBONE[i];
    }

    //    Note : 
    //

    BOOL bBoundBox(FALSE);
    SFile >> bBoundBox;
    if ( bBoundBox )
    {
        SFile >> m_vMax;
        SFile >> m_vMin;
    }
    else
    {
        m_vMax = D3DXVECTOR3(7.f,20.f,7.f);
        m_vMin = D3DXVECTOR3(-7.f,0.f,-7.f);
    }

    bExist = FALSE;
    SFile >> bExist;
    if( bExist )    SFile >> m_bWorldObj;
    else            return TRUE;

    // Note : 
    SFile >> bExist;

    //CDebugSet::ToLogFile( "load version_0000 : %d asp okey" );

    return TRUE;
}

:/:

Sorry. :O:

add the string utility project at the head of file.

#include "../../EngineLib/Common/StringUtils.h"
 
okey just now compile all success...i need to know what the type of Bone Link/Item Char Type/ Weapon Slot Type?i trying for bow weapon...the result is weapon when safe mode small..and when attack mode no appear...just lil help GforceFx....
some ss:
Screenshot_1 - Edit code for ABL's item resizing. - RaGEZONE Forums Screenshot_2 - Edit code for ABL's item resizing. - RaGEZONE Forums Screenshot_3 - Edit code for ABL's item resizing. - RaGEZONE Forums
 
done i already know...set it to my old idea...put at bonelink 'GUM' SlotRhand and Rhand then adjust your possition box..that all...ur bow will appear when attack...im right Gforce?because i already try..its work...and bow going to big...just need to adjust position box...
 
Status
Not open for further replies.
Back