Jump to content

Shadow system


Go to solution Solved by TAUMP,

Recommended Posts

  • Active Member

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

  • Metin2 Dev 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium
  • Solution
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;
}

 


 

Link to comment
Share on other sites

  • Active Member

@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.)

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium

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);
Link to comment
Share on other sites

  • Active Member

@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.

I'll be always helpful! 👊 

Link to comment
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();
}

  • Love 1
Link to comment
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)])

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.