Jump to content
×
×
  • Create New...

How To Get Different Watertypes


Recommended Posts

  • Bot

M2 Download Center

This is the hidden content, please
( Internal )

All what u need is just the Clientbinary-Source.
 
Fristly move to /gamelib/MapOutdoorWater.cpp.
There u edit the function:
 

Spoiler
void CMapOutdoor::LoadWaterTexture()
{
	UnloadWaterTexture();
	char buf[256];
	for (int i = 0; i < 30; ++i)
	{
		sprintf(buf, "d:/ymir Work/special/water/%02d.dds",  i+1);
		m_WaterInstances[i].SetImagePointer((CGraphicImage *) CResourceManager::Instance().GetResourcePointer(buf));
	}
}

to:

void CMapOutdoor::LoadWaterTexture()
{
	UnloadWaterTexture();
	char buf[256];
	for (int i = 0; i < 30; ++i)
	{
		sprintf(buf, "d:/ymir Work/special/water_%d/%02d.dds", GetWaterType(),  i+1);
		m_WaterInstances[i].SetImagePointer((CGraphicImage *) CResourceManager::Instance().GetResourcePointer(buf));
	}
}

 

Now move to /gamelib/MapOutdoorLoad.cpp and add in the bool CMapOutdoor::LoadSetting(const char * c_szFileName) function:

 

 

Under exceptions:

Spoiler
if (stTokenVectorMap.end() == stTokenVectorMap.find("watertype"))
	{
		TraceError("MapOutdoor::LoadSetting(c_szFileName=%s) - FIND 'watertype' - FAILED", c_szFileName);
		return false;
	}

BYTE WaterType = atoi(stTokenVectorMap["watertype"][0].c_str());
if (WaterType < 0 || WaterType > 4)
	{
		TraceError("MapOutdoor::LoadSetting(c_szFileName=%s) - WATERTYPE IS NOT GREATER THAN 0 OR LOWER THAN 4", c_szFileName);
		return false;
	}
SetWaterType(WaterType);

 

Now at last move to /gamelib/MapOutdoor.h

And add there under: WORD m_wPatchCount;

Spoiler
//Wasser Typen
BYTE m_bWaterType;
const BYTE GetWaterType() { return m_bWaterType; }
void SetWaterType(BYTE Type) { m_bWaterType = Type; }

 

 

Now u can use 5 different watertypes.
Just rename the water to water_0 and the new to water_1 upto 4.
Remeber u need to add in the setting.txt a line which contains the watertype.

(Exampel)

ScriptType	MapSetting

CellScale	200
HeightScale	0.500000

ViewRadius	128

MapSize	4	5
BasePosition	921600	204800
TextureSet	texturesetmetin2_C1.txt
Environment	C1.msenv
WaterType 0

GreetZz Raicon

  • Metin2 Dev 14
  • Love 1
  • Love 2
  • Good 3
  • Think 1

english_banner.gif

Link to comment
Share on other sites

  • 2 years later...
  • 4 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.