- Joined
- Sep 9, 2008
- Messages
- 1,947
- Reaction score
- 391
Have you ever wanted to change that annoying little penguin from this:
to say something like this?
Its very easy and requires very little effort if you know where to look and what you want displayed there.
First
Open the WndGuideSystem.cpp. No headers needed for this.
Find this function:
Change the code from this:
to this:
Ok. So that loads the model and the bones for the model. The model names can be found in the Model folder of your Server Files.
Now we need to change the animations otherwise you will see some pretty weird **** going on when it tries to move bones that aren't there.... Anyway. Still in the WndGuideSystem.cpp
find this function:
change the code from this:
to this:
Do not change the rest of the function as its not necessary and will break or crash the server.
Well, boys and girls, that concludes the end of the tut.....
Wait a minute.... I almost forgot.
Before you go rushing off to remake the infopang helper I should point out that you should set the scaling first. What is actually there is a small window big enough to show the model on screen. You can try and change the window size itself but I think its big enough. Anyway, still in the same file, find this line...
Change the last three floating decimals to whatever you want but no lower than 0.5f. Going too big will end up cropping the model making it look dumb. I went with the standard 1x scale. I would say no more than 3x but its up to you.
You don't need to use the model I did. It was merely an example.
Try this out. Remember to compile and let's see what you come up with.
To view the content, you need to sign in or register
to say something like this?
To view the content, you need to sign in or register
Its very easy and requires very little effort if you know where to look and what you want displayed there.
First
Open the WndGuideSystem.cpp. No headers needed for this.
Find this function:
Code:
CWndGuideSystem::ChangeModel
Change the code from this:
Code:
SAFE_DELETE(m_pModel);
m_pModel = new CModelObject;
m_pModel->InitDeviceObjects(g_Neuz.GetDevice());
if( m_pModel )
{
switch( nJob )
{
default:
case JOB_VAGRANT:
{
m_pModel->LoadBone( "Mvr_Guidepang.chr" );
m_pModel->LoadElement("Mvr_Guidepang.o3d", 0 );
}
break;
case JOB_KNIGHT:
case JOB_BLADE:
case JOB_MERCENARY:
{
m_pModel->LoadBone( "Mvr_McGuidepang.chr" );
m_pModel->LoadElement("Mvr_McGuidepang.o3d", 0 );
}
break;
case JOB_RINGMASTER:
case JOB_BILLPOSTER:
case JOB_ASSIST:
{
m_pModel->LoadBone( "Mvr_AsGuidepang.chr" );
m_pModel->LoadElement("Mvr_AsGuidepang.o3d", 0 );
}
break;
case JOB_PSYCHIKEEPER:
case JOB_ELEMENTOR:
case JOB_MAGICIAN:
{
m_pModel->LoadBone( "Mvr_MgGuidepang.chr" );
m_pModel->LoadElement("Mvr_MgGuidepang.o3d", 0 );
}
break;
case JOB_ACROBAT:
case JOB_RANGER:
case JOB_JESTER:
{
m_pModel->LoadBone( "Mvr_AcrGuidepang.chr" );
m_pModel->LoadElement("Mvr_AcrGuidepang.o3d", 0 );
}
break;
}
}
to this:
Code:
SAFE_DELETE(m_pModel);
m_pModel = new CModelObject;
m_pModel->InitDeviceObjects(g_Neuz.GetDevice());
if( m_pModel )
{
m_pModel->LoadBone( "Mvr_Glaphan.chr" );
m_pModel->LoadElement( "Mvr_Glaphan.o3d", 0 );
}
Ok. So that loads the model and the bones for the model. The model names can be found in the Model folder of your Server Files.
Now we need to change the animations otherwise you will see some pretty weird **** going on when it tries to move bones that aren't there.... Anyway. Still in the WndGuideSystem.cpp
find this function:
Code:
void CWndGuideSystem::SetAni(int nJob, int nAniKind)
change the code from this:
Code:
if( m_pModel == NULL )
return;
CString filename;
char* VagArry[3] = { "Mvr_Guidepang_Appear.ani", "Mvr_Guidepang_Default.ani", "Mvr_Guidepang_Disappear.ani" };
char* MerArry[3] = { "Mvr_McGuidepang_appear.ani", "Mvr_McGuidepang_default.ani", "Mvr_McGuidepang_Disappear.ani" };
char* AssArry[3] = { "Mvr_AsGuidepang_Appear.ani", "Mvr_AsGuidepang_Default.ani", "Mvr_AsGuidepang_Disappear.ani" };
char* MagArry[3] = { "Mvr_MgGuidepang_Appear.ani", "Mvr_MgGuidepang_Dafault.ani", "Mvr_MgGuidepang_DisAppear.ani" };
char* AcrArry[3] = { "Mvr_AcrGuidepang_Appear.ani", "Mvr_AcrGuidepang_Default.ani", "Mvr_AcrGuidepang_DisAppear.ani" };
switch( nJob )
{
default:
case JOB_VAGRANT:
{
filename = VagArry[nAniKind];
}
break;
case JOB_KNIGHT:
case JOB_BLADE:
case JOB_MERCENARY:
{
filename = MerArry[nAniKind];
}
break;
case JOB_RINGMASTER:
case JOB_BILLPOSTER:
case JOB_ASSIST:
{
filename = AssArry[nAniKind];
}
break;
case JOB_PSYCHIKEEPER:
case JOB_ELEMENTOR:
case JOB_MAGICIAN:
{
filename = MagArry[nAniKind];
}
break;
case JOB_ACROBAT:
case JOB_RANGER:
case JOB_JESTER:
{
filename = AcrArry[nAniKind];
}
break;
}
to this:
Code:
if( m_pModel == NULL )
return;
CString filename;
char* GlaphanArray[3] = { "Mvr_Glaphan_idle1.ani", "Mvr_Glaphan_groggy.ani", "Mvr_Glaphan_die1.ani" };
filename = GlaphanArray[nAniKind];
Do not change the rest of the function as its not necessary and will break or crash the server.
Well, boys and girls, that concludes the end of the tut.....
Wait a minute.... I almost forgot.
Before you go rushing off to remake the infopang helper I should point out that you should set the scaling first. What is actually there is a small window big enough to show the model on screen. You can try and change the window size itself but I think its big enough. Anyway, still in the same file, find this line...
Code:
D3DXMatrixScaling(&matScale, 2.8f, 2.8f, 2.8f);
Change the last three floating decimals to whatever you want but no lower than 0.5f. Going too big will end up cropping the model making it look dumb. I went with the standard 1x scale. I would say no more than 3x but its up to you.
You don't need to use the model I did. It was merely an example.
Try this out. Remember to compile and let's see what you come up with.

