Jump to content
Korean Random

Немного про среду для разработки модов


aks1983

Recommended Posts

03.08.2016 в 20:02, spoter сказал:

Кстати ещё полезно в клиенте включить debug_level = 'DEV' и положить скрипты в /res/scripts/wot

 

А можно чуть подробнее, как включить Verbose-вывод в консоль? Я так понимаю, это даст больше логов)

 

И что за папка scripts/wot?

UPD: разобрался, нужно debug_utils.py перекомпилировать, выставив RELEASE = 1 (имитация dev-окружения)

Edited by Nik7
Link to comment
Short link
Share on other sites

  • 9 months later...
  • 2 years later...
  • 8 months later...
On 8/3/2016 at 10:22 AM, spoter said:

Hello, I’ll tell you a little about the tools that I use:

 

For development I use JetBrains PyCharm IDE

post-6927-0-15688900-1470235996_thumb.png

 

This is a full-fledged IDE, I parse the client sources using pjOrion+ uncompyle6

The main thing is that the file names are in the correct case so that the auto-import of modules works normally.

post-6927-0-54072400-1470236042_thumb.png

 

The tank client has a built-in remote debug, configured by default for Pycharm, but no one forbids connecting to it from another IDE

just drop the contents of the  pycharm-debug.egg archive from the pycharm distribution into the folder  \World_of_Tanks\ res_mods\<version> \scripts\common\pydev\pycharm\ pydev

and enter it into your script

import bwpydevd

bwpydevd.startDebug()

the main thing is to make sure that the scripts are identical

post-6927-0-86666100-1470236093_thumb.png

 

The built-in code inspector alt+shift+i is very helpful in the work , which will tell you how to correctly format the pep8 code, where there are errors (with details) and give other recommendations, and can also reformat the code and optimize imports upon request, again in accordance with the recommendations of pep8, for which I especially love it.

post-6927-0-33054200-1470236062_thumb.png

 

After the code is written, tested and debugged in the client, I literally upload the code to GitHub in a couple of clicks

post-6927-0-43518600-1470236107_thumb.png

 

Choosing an IDE is a matter of taste, for example, a friend of mine codes in Visual Studio and also uses the built-in debug, only with a distribution from his IDE.

And another friend uses Eclipse

 

Good luck everyone )

 

when importing bwpydevd, i always get:
 

i have tried pydev version 2.8.0, which states its for python versions 2 (0.9.22.0.1 is python 2.7 afaik) and i have tried the .egg file that comes with my pycharm professional version. nothing works. however, if i try to do this manually through the debug server mod (github), i just get a "cannot import module _ctypes" :/

 

when changing to bwpydevd.startDebug('pycharm'), simply nothing is printing in the console, and still no connection. yes all my ports and ips are correct.

 

any way to try to solve this? i'm using the most recent version of PyCharm Professional. what version of pydevd should i try using?

 

Edit: Seems to be the issue was inside of bwpydevd.py appending to sys.path only the relative path of the egg contents and not the absolute. I fixed this and now I receive this:
 

2024-02-28 12:09:38.342: ERROR: 0.00s - Debugger warning: The os.path.realpath.__code__.co_filename (scripts/common/Lib/ntpath.py)
2024-02-28 12:09:38.342: ERROR: 0.00s - is not absolute, which may make the debugger miss breakpoints.
2024-02-28 12:09:38.342: ERROR: 0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
2024-02-28 12:09:38.352: ERROR: Traceback (most recent call last):
2024-02-28 12:09:38.352: ERROR:   File "bwpydevd.py", line 97, in startPyDevD
2024-02-28 12:09:38.352: ERROR:   File "C:/Users/user/Desktop/wot-offline-server-git/0.9.22.0.1_#788/res_mods/0.9.22.0.1/scripts/common/pydev/pycharm/pydev\pydevd.py", line 46, in <module>
2024-02-28 12:09:38.353: ERROR:     from _pydevd_bundle import pydevd_utils
2024-02-28 12:09:38.353: ERROR:   File "C:/Users/user/Desktop/wot-offline-server-git/0.9.22.0.1_#788/res_mods/0.9.22.0.1/scripts/common/pydev/pycharm/pydev\_pydevd_bundle\pydevd_utils.py", line 9, in <module>
2024-02-28 12:09:38.353: ERROR:     import ctypes
2024-02-28 12:09:38.353: ERROR:   File "C:\Python27\lib\ctypes\__init__.py", line 7, in <module>
2024-02-28 12:09:38.353: ERROR:     from _ctypes import Union, Structure, Array
2024-02-28 12:09:38.353: ERROR: ImportError: No module named _ctypes
2024-02-28 12:09:38.353: ERROR: bwpydevd.py(104) : startPyDevD: Failed to load pydevd: ImportError('No module named _ctypes',)

My version of 2.7 is the most recent, from April 20th, 2020. What could be causing this? How to fix?

Edited by blueferret
  • Upvote 1
Link to comment
Short link
Share on other sites

  • 1 year later...

Какая рабочая версия pyCharm т.е. pydevd-pycharm.egg?

 

Я запустил это на кастылях, исправили в вызове pydevd.py  хочет какой то параметр inspect_double_underscore - которого я ни нашел ни в одной из версий.

и pydevd_process_net_command.py - тоже закостылял, сервер поднялся, но толку мало, сыпет ошибки.

 

Кажется что нужен какой то вариант pydevd от самой лесты/вг?

 

 

2025-03-28 09:26:01.210: ERROR: -------------------------------------------------------------------------------
2025-03-28 09:26:01.210: ERROR: pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)
2025-03-28 09:26:01.210: ERROR: pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints.
2025-03-28 09:26:01.210: ERROR: pydev debugger: Related bug: http://bugs.python.org/issue1666807
2025-03-28 09:26:01.210: ERROR: -------------------------------------------------------------------------------
2025-03-28 09:26:01.331: ERROR: warning: Debugger speedups using cython not found. Run '"C:\Games\Tanki\win64\Tanki.exe" "scripts/common/pydev/pycharm/pydev\setup_cython.py" build_ext --inplace' to build.
2025-03-28 09:26:01.389: INFO: startPyDevD: PyDevD connecting to localhost:5678
2025-03-28 09:26:01.395: ERROR: Traceback (most recent call last):
2025-03-28 09:26:01.395: ERROR:   File "pydevd_process_net_command", line 484, in process_net_command
2025-03-28 09:26:01.397: ERROR: ValueError: invalid literal for int() with base 10: 'None'
2025-03-28 09:26:01.497: ERROR: pydev debugger: Unable to find real location for: pydevd
2025-03-28 09:26:01.502: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/threading.py
2025-03-28 09:26:01.507: ERROR: pydev debugger: Unable to find real location for: pydev_monkey
2025-03-28 09:26:01.512: ERROR: pydev debugger: Unable to find real location for: pydevd_additional_thread_info_regular
2025-03-28 09:26:01.517: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/atexit.py
2025-03-28 09:26:01.522: ERROR: pydev debugger: Unable to find real location for: pydevd_comm
2025-03-28 09:26:01.531: ERROR: pydev debugger: Unable to find real location for: scripts/common/bwpydevd.py
2025-03-28 09:26:01.538: ERROR: pydev debugger: Unable to find real location for: .\res\scripts\client\gui\mods\mod_sava.py
2025-03-28 09:26:01.538: ERROR: pydev debugger: Unable to find real location for: pydevd_vm_type
2025-03-28 09:26:01.544: ERROR: pydev debugger: Unable to find real location for: pydevd_io
2025-03-28 09:26:01.554: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/importlib/__init__.py
2025-03-28 09:26:01.558: ERROR: pydev debugger: Unable to find real location for: pydevd_tracing
2025-03-28 09:26:01.560: ERROR: pydev debugger: Unable to find real location for: scripts/client/gui/mods/__init__.py
2025-03-28 09:26:01.565: ERROR: pydev debugger: Unable to find real location for: scripts/common/debug_utils.py
2025-03-28 09:26:01.568: ERROR: pydev debugger: Unable to find real location for: D:\Projects\_wg\OpenWG.WoT.Common\~output\wotmod\res\mods\xfw_packages\openwg_pypi_urllib3\python_libraries\urllib3\packages\six.py
2025-03-28 09:26:01.573: ERROR: pydev debugger: Unable to find real location for: python/gui/mods/mod_net_openwg_fix_crosshairs.py
2025-03-28 09:26:01.578: ERROR: pydev debugger: Unable to find real location for: mod_xp_mastery
2025-03-28 09:26:01.674: ERROR: pydev debugger: Unable to find real location for: <string>
2025-03-28 09:26:01.705: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/logging/__init__.py
2025-03-28 09:26:01.709: ERROR: pydev debugger: Unable to find real location for: scripts/common/BWLogging.py
2025-03-28 09:26:01.714: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/genericpath.py
2025-03-28 09:26:01.719: ERROR: pydev debugger: Unable to find real location for: scripts/common/wg_async.py
2025-03-28 09:26:01.724: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/functools.py
2025-03-28 09:26:01.729: ERROR: pydev debugger: Unable to find real location for: scripts/common/Event.py
2025-03-28 09:26:01.734: ERROR: pydev debugger: Unable to find real location for: scripts/client/gui/shared/event_bus.py
2025-03-28 09:26:01.739: ERROR: pydev debugger: Unable to find real location for: scripts/client/gui/Scaleform/framework/__init__.py
2025-03-28 09:26:01.743: ERROR: pydev debugger: Unable to find real location for: scripts/client/gui/Scaleform/framework/factories.py
2025-03-28 09:26:01.749: ERROR: pydev debugger: Unable to find real location for: scripts/client_common/shared_utils/__init__.py
2025-03-28 09:26:01.753: ERROR: pydev debugger: Unable to find real location for: python/gui/mods/mod_battle_results_replays_fix.py
2025-03-28 09:26:01.758: ERROR: pydev debugger: Unable to find real location for: scripts/client/messenger/proto/events.py
2025-03-28 09:26:01.764: ERROR: pydev debugger: Unable to find real location for: controller
2025-03-28 09:26:01.768: ERROR: pydev debugger: Unable to find real location for: __init__
2025-03-28 09:26:01.773: ERROR: pydev debugger: Unable to find real location for: sounds
2025-03-28 09:26:01.778: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/xml/dom/minidom.py
2025-03-28 09:26:01.786: ERROR: pydev debugger: Unable to find real location for: scripts/common/Lib/xml/dom/expatbuilder.py
2025-03-28 09:26:01.793: ERROR: pydev debugger: Unable to find real location for: E:\Source\python_dll_copy\out\2.7.18\Python-2.7.18\Modules\pyexpat.c
2025-03-28 09:26:01.819: ERROR: pydev debugger: Unable to find real location for: utils
2025-03-28 09:26:01.824: ERROR: pydev debugger: Unable to find real location for: localization
2025-03-28 09:26:01.829: ERROR: pydev debugger: Unable to find real location for: python/gui/modsListApi/__init__.py
2025-03-28 09:26:01.833: ERROR: pydev debugger: Unable to find real location for: python/gui/modsListApi/controller.py
2025-03-28 09:26:01.838: ERROR: pydev debugger: Unable to find real location for: python/gui/modsListApi/data.py
....
....

 

@blueferret To avoid the error with _ctypes, I took pydevd-pycharm.egg from PyCharm 2016.1.5 and do:
 

/mnt/c/Games/Tanki/res_mods/1.33.0.0/scripts/common/pydev/pycharm/pydev$ python2 -m compileall .

 

28.02.2024 в 21:37, blueferret сказал:

Edit: Seems to be the issue was inside of bwpydevd.py appending to sys.path only the relative path of the egg contents and not the absolute. I fixed this and now I receive this

 

What exactly did you do?

Edited by suineg
Link to comment
Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...