Jump to content
Guest

[HowTo]Get different watertypes

Recommended Posts

Guest

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

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:

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;

//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

Share this post


Link to post
Just now, kimameixede said:

this it for what?

You can use different types of water in different kinds of maps. Example: Map1-Blue : Valkus-Red(Used as lava)...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

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.