Jump to content
metin2dev
ReFresh

Shadow system

Recommended Posts

Hey guys,

I saw on some server this shadow system improvement. I will be glad if someone make it, because it's useful for everyone :)

Where is difference? Here you can select which shadows you want to see. Shadows has 6 types:

0). None shadows

1). Only environment

2). Environment, character, objects

3). All shadows

4). Better all shadows

5). All shadows in the best quality

https://www.youtube.com/watch?v=TH8moT61mx0

PS: If someone gonna make it, don't forget to make a set text system (like in video, above in this topic is translation of it) to see which shadows are selected.

Thanks for answers!

Sincerely,

ReFresh

Share this post


Link to post
Share on other sites
18 minutes ago, ReFresh said:

@.T4Ump Yes, I know that, but I'm talking about python part. Python part don't work like code written in source.

Python part is commented // just uncomment lul

Share this post


Link to post
Share on other sites
bool CPythonBackground::SetShadowLevel(int eLevel)
{
    if (!m_pkMap)
        return false;

    if (m_eShadowLevel == eLevel)
        return true;

    CMapOutdoor& rkMap = GetMapOutdoorRef();

    m_eShadowLevel = eLevel;

    switch (m_eShadowLevel)
    {
    case SHADOW_NONE:
        rkMap.SetDrawShadow(false);
        rkMap.SetShadowTextureSize(512);
        break;

    case SHADOW_GROUND:
        rkMap.SetDrawShadow(true);
        rkMap.SetDrawCharacterShadow(false);
        rkMap.SetShadowTextureSize(1024);
        break;

    case SHADOW_GROUND_AND_SOLO:
        rkMap.SetDrawShadow(true);
        rkMap.SetDrawCharacterShadow(true);
        rkMap.SetShadowTextureSize(2048);
        break;

    case SHADOW_ALL:
        rkMap.SetDrawShadow(true);
        rkMap.SetDrawCharacterShadow(true);
        rkMap.SetShadowTextureSize(2048);
        break;

    case SHADOW_ALL_HIGH:
        rkMap.SetDrawShadow(true);
        rkMap.SetDrawCharacterShadow(true);
        rkMap.SetShadowTextureSize(4096);
        break;

    case SHADOW_ALL_MAX:
        rkMap.SetDrawShadow(true);
        rkMap.SetDrawCharacterShadow(true);
        rkMap.SetShadowTextureSize(4096);
        break;
    }

    return true;
}

 

Share this post


Link to post
Share on other sites

Hello,

You've already commented on this post, it's already in the client, you just have to change the resolution, fairly easy :

 

Share this post


Link to post
Share on other sites

@Galet Sure, I commented the post. Yeah now I know it that is in official client, but few years ago it wasn't here. Where I have to change resolution? I think you don't understand me, did you look at my video which I putted in my post? When you look right you will be able to see what is changed with 0-5 types of shadows. I need to do it like in video, if you know how to do it, I will be glad for your answer :)

- One problem is in python, because I can't set shadows to zero by moving with the slider. (This shadow setting is saved in metin2.cfg if you didn't know. Shadows can't be set to zero now here.)

Share this post


Link to post
Share on other sites

I completely understood and I think that you have everything available here. I have exactly the same system since some years and everything is working fine, I just can't go back to SHADOW_NONE but everything is the same as in the video

If you want to change the resolution :

rkMap.SetShadowTextureSize(RESOLUTION);

Share this post


Link to post
Share on other sites

@Galet  I tried to change resolution before, but I saw no changes. And yes the only problem is you can't go to zero like you wrote and that's the only problem and make set text function that let you know which shadows are selected like in video.

Share this post


Link to post
Share on other sites

PythonSystemModule.cpp

PyObject * systemSetShadowLevel(PyObject * poSelf, PyObject * poArgs)
{
    int level;

    if (!PyTuple_GetInteger(poArgs, 0, &level))
        return Py_BuildException();

    if (level >= 0) // This
        CPythonSystem::Instance().SetShadowLevel(level);

    return Py_BuildNone();
}

  • Thanks 1

Share this post


Link to post
Share on other sites

Someone know how to make a settext? like in this video?

https://www.youtube.com/watch?v=TH8moT61mx0

Share this post


Link to post
Share on other sites

 

(uiscript) systemoptiondialog.py :

After:

				{
					"name" : "shadow_bar",
					"type" : "sliderbar",

					"x" : 110,
					"y" : 210,
				},

Add:

				{
					"name" : "shadow_name",
					"type" : "text",
					
					"x" : 110,
					"y" : 225,
				},

(root) uisystemoption.py 

 def __Initialize(self):

Spoiler

 After:
        self.ctrlShadowQuality = 0

Add:
        self.ctrlShadowNameList = ("Shadow_None", "Shadow_Ground", "Shadow_Ground_and_Solo", "Shadow_All", "Shadow_All_High", "Shadow_All_Max")
 

 def __Load_BindObject(self):

Spoiler

After:
            self.ctrlShadowQuality = GetObject("shadow_bar")

Add:
            self.ctrlShadowName = GetObject("shadow_name")

def __Load(self):

Spoiler

After:

        self.ctrlShadowQuality.SetEvent(ui.__mem_func__(self.OnChangeShadowQuality))

Add:

        self.ctrlShadowName.SetText(self.ctrlShadowNameList[int(systemSetting.GetShadowLevel())])

def OnChangeShadowQuality(self):

Spoiler

 After:

       systemSetting.SetShadowLevel(int(pos / 0.2))

Add:
        self.ctrlShadowName.SetText(self.ctrlShadowNameList[int(pos / 0.2)])

 

  • Thanks 1

Share this post


Link to post
Share on other sites

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.

×