Metin2 Night / Day depending on the time of day

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Vanilla

Elite
Elite
Joined
Jan 28, 2019
Messages
839
Credits
1,190
Simple script that will automatically set you day / night in Metin2

We go to constInfo.py
we add it at the very top:

Python:
Expand Collapse Copy
ENVIRONMENT_EVENING="d:/ymir work/environment/evening.msenv"


night = 0
day = 0
We're going to game.py
We are looking for it
Python:
Expand Collapse Copy
class GameWindow(ui.ScriptWindow):
    def __init__(self, stream):

We add under:
Python:
Expand Collapse Copy
constInfo.night = 0
    constInfo.day = 0

We are looking now
Python:
Expand Collapse Copy
def OnUpdate(self):   
        app.UpdateGame()
We replace it with something like this:
Python:
Expand Collapse Copy
def OnUpdate(self):   
        self.day_night()
        app.UpdateGame()
We go to the bottom of the game.py file and add this code:
 
Thanks for this guide, thought it was something to do with lua but this proposal it's preferable! thanks!
 
I don't understand how some people here can write thank you even though the system is not complete and working? you have to adapt a lot? so where do your thanks come from?
 
Simple script that will automatically set you day / night in Metin2

We go to constInfo.py
we add it at the very top:

Python:
Expand Collapse Copy
ENVIRONMENT_EVENING="d:/ymir work/environment/evening.msenv"


night = 0
day = 0
We're going to game.py
We are looking for it
Python:
Expand Collapse Copy
class GameWindow(ui.ScriptWindow):
    def __init__(self, stream):

We add under:
Python:
Expand Collapse Copy
constInfo.night = 0
    constInfo.day = 0

We are looking now
Python:
Expand Collapse Copy
def OnUpdate(self):  
        app.UpdateGame()
We replace it with something like this:
Python:
Expand Collapse Copy
def OnUpdate(self):  
        self.day_night()
        app.UpdateGame()
We go to the bottom of the game.py file and add this code:
*** Hidden text: cannot be quoted. ***
ok it works
 
it doesn't work for me :(


1031 23:07:18691 :: Traceback (most recent call last):

1031 23:07:18691 :: File "game.py", line 1472, in OnUpdate

1031 23:07:18691 :: File "game.py", line 2216, in day_night

1031 23:07:18692 :: AttributeError
1031 23:07:18692 :: :
1031 23:07:18692 :: 'module' object has no attribute 'noc'
1031 23:07:18692 ::
 
*tried to add again the code, I don't receive any error in syserr but after selecting the character, the page loads and when it finishs it get stack in an infinite loop , still no error in syserr :/ any suggestion?
 
Simple script that will automatically set you day / night in Metin2

We go to constInfo.py
we add it at the very top:

Python:
Expand Collapse Copy
ENVIRONMENT_EVENING="d:/ymir work/environment/evening.msenv"


night = 0
day = 0
We're going to game.py
We are looking for it
Python:
Expand Collapse Copy
class GameWindow(ui.ScriptWindow):
    def __init__(self, stream):

We add under:
Python:
Expand Collapse Copy
constInfo.night = 0
    constInfo.day = 0

We are looking now
Python:
Expand Collapse Copy
def OnUpdate(self):  
        app.UpdateGame()
We replace it with something like this:
Python:
Expand Collapse Copy
def OnUpdate(self):  
        self.day_night()
        app.UpdateGame()
We go to the bottom of the game.py file and add this code:
*** Hidden text: cannot be quoted. ***
will give this a try now
 
*tried to add again the code, I don't receive any error in syserr but after selecting the character, the page loads and when it finishs it get stack in an infinite loop , still no error in syserr :/ any suggestion?
do you have getting it to work? i have the same error with "NOC Attribute" like you. I insert the code now 3 times.
 
Simple script that will automatically set you day / night in Metin2

We go to constInfo.py
we add it at the very top:

Python:
Expand Collapse Copy
ENVIRONMENT_EVENING="d:/ymir work/environment/evening.msenv"


night = 0
day = 0
We're going to game.py
We are looking for it
Python:
Expand Collapse Copy
class GameWindow(ui.ScriptWindow):
    def __init__(self, stream):

We add under:
Python:
Expand Collapse Copy
constInfo.night = 0
    constInfo.day = 0

We are looking now
Python:
Expand Collapse Copy
def OnUpdate(self):  
        app.UpdateGame()
We replace it with something like this:
Python:
Expand Collapse Copy
def OnUpdate(self):  
        self.day_night()
        app.UpdateGame()
We go to the bottom of the game.py file and add this code:
*** Hidden text: cannot be quoted. ***
Thank You fo Sharing brow
 
Back
Top