Jump to content

How To Metin2 & Cython


Recommended Posts

  • Honorable Member

I have this errors:  http://pastebin.com/xXfn4G84

 

I use python22 on launcher and vs2008 , is needed 27 or work with 22?

 

cpp file: http://pastebin.com/t6M9t7Gh

PyMODINIT_FUNC doesn't exist in python2.2.

I've added this in the python<modulename>Manager.cpp:

#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC extern "C" __declspec(dllexport) void
#endif
Sadly, Cython doesn't work on py2.2 without refactoring itself.

HqxjajQ.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

  • Bronze

I think you forgot the .close() doesnt work with cython.

LoginWindow.__LoadScript.BindObject - <type 'exceptions.AttributeError'>:'pack_file' object has no attribute 'close'

Example:

file=open("aaa.txt","w")
file.write("heyy how are u?")
file.close()

and how to repair:

file=open("aaa.txt","w").write("hey i solve the bug")
Link to comment
Share on other sites

  • Premium

When i try to compile the binary i gote this error:

 

-C1083: Cannot open include file : 'Python.h':No such file or directory

 

EDIT 1 : I put in PythonrootlibManager.cpp : #include "../../extern/include/Python-2.2/Python.h" and in

ScriptLibStdAfx.h: #include "../../extern/include/Python-2.2/Python.h"
 
I did a little test now and i try to compile file colorinfo.py.When i try to compile the binary i recieve these errors :
 
Untitled.png
Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

 

When i try to compile the binary i gote this error:

 

-C1083: Cannot open include file : 'Python.h':No such file or directory

 

EDIT 1 : I put in PythonrootlibManager.cpp : #include "../../extern/include/Python-2.2/Python.h" and in

ScriptLibStdAfx.h: #include "../../extern/include/Python-2.2/Python.h"
 
I did a little test now and i try to compile file colorinfo.py.When i try to compile the binary i recieve these errors :
 
Untitled.png

 

install python 2.7 in binary

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium

 

 

When i try to compile the binary i gote this error:

 

-C1083: Cannot open include file : 'Python.h':No such file or directory

 

EDIT 1 : I put in PythonrootlibManager.cpp : #include "../../extern/include/Python-2.2/Python.h" and in

ScriptLibStdAfx.h: #include "../../extern/include/Python-2.2/Python.h"
 
I did a little test now and i try to compile file colorinfo.py.When i try to compile the binary i recieve these errors :
 
Untitled.png

 

install python 2.7 in binary

 

And how cand i do update python 2.2 to 2.7?

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Honorable Member
On 3/15/2015 at 11:45 AM, ѕeмa™ said:

I think you forgot the .close() doesnt work with cython.

LoginWindow.__LoadScript.BindObject - <type 'exceptions.AttributeError'>:'pack_file' object has no attribute 'close'
Example:
file=open("aaa.txt","w")
file.write("heyy how are u?")
file.close()
and how to repair:
file=open("aaa.txt","w").write("hey i solve the bug")

 

 

On 3/15/2015 at 3:59 PM, Lyrex said:

Well, open usually isn't the same as pack_open. I'm not sure if something related to this get's modified here.

open = python open, which has a close method

pack_open = metin2 open which doesn't

On the recent official roots, the "pack_open" is renamed as "open", and "open" as "old_open".

Post your old system.py (push it on pastebin/pastie).

 

 

Probably, your lib folder contains .pyc files compiled with py2.2. You should use the ones for 2.7.

This is the hidden content, please

  • Metin2 Dev 14
  • Good 1
  • Love 4
Link to comment
Share on other sites

On 3/16/2015 at 10:41 AM, martysama0134 said:

 

I think you forgot the .close() doesnt work with cython.

LoginWindow.__LoadScript.BindObject - <type 'exceptions.AttributeError'>:'pack_file' object has no attribute 'close'

Example:

file=open("aaa.txt","w")
file.write("heyy how are u?")
file.close()

and how to repair:

file=open("aaa.txt","w").write("hey i solve the bug")
 

 

On 3/15/2015 at 3:59 PM, Lyrex said:

Well, open usually isn't the same as pack_open. I'm not sure if something related to this get's modified here.

open = python open, which has a close method

pack_open = metin2 open which doesn't

On the recent official roots, the "pack_open" is renamed as "open", and "open" as "old_open".

Post your old system.py (push it on pastebin/pastie).

 

 

Probably, your lib folder contains .pyc files compiled with py2.2. You should use the ones for 2.7.

This is the hidden content, please

 

no work...

  • Metin2 Dev 3
  • Love 1
Link to comment
Share on other sites

Hi, how to fix error?

 

0316 11:29:30189 :: Traceback (most recent call last):
 
0316 11:29:30189 ::   File "networkModule.py", line 251, in networkModule.MainStream.SetGamePhase (networkModule.c:4681)
 
0316 11:29:30189 ::   File "networkModule.py", line 247, in networkModule.MainStream.SetGamePhase (networkModule.c:4592)
 
0316 11:29:30189 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "game.py", line 55, in init game (game.c:61609)
 
0316 11:29:30190 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "switchbot.py", line 13, in init switchbot (switchbot.c:40180)
 
0316 11:29:30190 ::   File "system.py", line 161, in system.__hybrid_import (system.c:3747)
 
0316 11:29:30190 :: ImportError
0316 11:29:30190 :: : 
0316 11:29:30190 :: No module named uitooltip
0316 11:29:30190 :: 
Link to comment
Share on other sites

 

Hi, how to fix error?

 

0316 11:29:30189 :: Traceback (most recent call last):
 
0316 11:29:30189 ::   File "networkModule.py", line 251, in networkModule.MainStream.SetGamePhase (networkModule.c:4681)
 
0316 11:29:30189 ::   File "networkModule.py", line 247, in networkModule.MainStream.SetGamePhase (networkModule.c:4592)
 
0316 11:29:30189 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "game.py", line 55, in init game (game.c:61609)
 
0316 11:29:30190 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "switchbot.py", line 13, in init switchbot (switchbot.c:40180)
 
0316 11:29:30190 ::   File "system.py", line 161, in system.__hybrid_import (system.c:3747)
 
0316 11:29:30190 :: ImportError
0316 11:29:30190 :: : 
0316 11:29:30190 :: No module named uitooltip
0316 11:29:30190 :: 

 

you no compiled uitooltip.py in c

Link to comment
Share on other sites

 

 

Hi, how to fix error?

 

0316 11:29:30189 :: Traceback (most recent call last):
 
0316 11:29:30189 ::   File "networkModule.py", line 251, in networkModule.MainStream.SetGamePhase (networkModule.c:4681)
 
0316 11:29:30189 ::   File "networkModule.py", line 247, in networkModule.MainStream.SetGamePhase (networkModule.c:4592)
 
0316 11:29:30189 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "game.py", line 55, in init game (game.c:61609)
 
0316 11:29:30190 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "switchbot.py", line 13, in init switchbot (switchbot.c:40180)
 
0316 11:29:30190 ::   File "system.py", line 161, in system.__hybrid_import (system.c:3747)
 
0316 11:29:30190 :: ImportError
0316 11:29:30190 :: : 
0316 11:29:30190 :: No module named uitooltip
0316 11:29:30190 :: 

 

you no compiled uitooltip.py in c

 

uitooltip.py compiled in c sucess

Link to comment
Share on other sites

 

Hi, how to fix error?

 

0316 11:29:30189 :: Traceback (most recent call last):
 
0316 11:29:30189 ::   File "networkModule.py", line 251, in networkModule.MainStream.SetGamePhase (networkModule.c:4681)
 
0316 11:29:30189 ::   File "networkModule.py", line 247, in networkModule.MainStream.SetGamePhase (networkModule.c:4592)
 
0316 11:29:30189 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "game.py", line 55, in init game (game.c:61609)
 
0316 11:29:30190 ::   File "system.py", line 139, in system.__hybrid_import (system.c:3409)
 
0316 11:29:30190 ::   File "switchbot.py", line 13, in init switchbot (switchbot.c:40180)
 
0316 11:29:30190 ::   File "system.py", line 161, in system.__hybrid_import (system.c:3747)
 
0316 11:29:30190 :: ImportError
0316 11:29:30190 :: : 
0316 11:29:30190 :: No module named uitooltip
0316 11:29:30190 :: 

 

 

use Brain.exe

  • Love 1
Link to comment
Share on other sites

  • Honorable Member

#UPDATED

What's New:

  • v2.0
    • The module's name check is now case-insensitive (colorInfo == colorinfo)
    • Added a new function rootlib/uiscriptlib.getList() to retrieve a tuple of all the available cythonized modules.
    • Now you can compile a uiscriptlib library from the uiscript*.py files! (implemented as __USE_EXTRA_CYTHON__)
    • Added a sample ui.py containing the code to run uiscriptlib.
Preview:

uc3Nymq.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 4
Link to comment
Share on other sites

  • Bronze

Errors

"No module named xxx" are of case sensitive.

Change uitooltip for uiToolTip.

not always true but this can fix it , i hade a simlar problem where i had to import the module like this :

	def __anything(self):
		from something import first
		if self.something.first_shown == 1:
			self.somthing.Hide()
		else:
			self.somthing.Show()

insted of importing at the begining of the file

Link to comment
Share on other sites

  • Premium
Link to comment
Share on other sites

  • Honorable Member

Replace "Ouvrez la Boite!" with something else, or put it in locale_game.txt. Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Love 2
Link to comment
Share on other sites

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.