GPCracker 2,088 #218634 Posted September 30, 2014 Я что то не пойму , лорг даёт ошибку File "scripts/client/AreaDestructibles.py", line 956, но в файле всего 922 строки , это значит что Орион не до конца декомпелирует скрипт ?Трассировку полностью запости... Quote Share this post Link to post Short link Share on other sites
o-0-0-0 77 #218637 Posted September 30, 2014 Трассировку полностью запости... не хотелось бы вкладывать из запретных модов , я так полагаю тут таких не любят . Quote Share this post Link to post Short link Share on other sites
avsv 1 #219394 Posted October 3, 2014 так что насчёт маршала господа, подскажите как получить pyc-байткод? Quote Share this post Link to post Short link Share on other sites
fecell 125 #219454 Posted October 3, 2014 а что на счет маршала? import marshal, sys, os fileName, fileExtension = os.path.splitext(sys.argv[1]) f = open(sys.argv[1], 'rb') hdr = f.read(8) f.close() OldMarshalLoads = marshal.loads def NewMarshalLoads(instring): f = open('%_unmarshaled.pyc' % fileName, 'wb') f.write(hdr) f.write(instring) f.close() return OldMarshalLoads(instring) marshal.loads = NewMarshalLoads __import__(fileName) берешь и перехватываешь. Все элементарно, Ватсон ;) использовать, надеюсь понимаешь как.. c:\>python hookMarshal.py script.pyc Quote Share this post Link to post Short link Share on other sites
StranikS_Scan 4,210 #219458 Posted October 3, 2014 @fecell, это дорога в ад... теперь будут писать - у меня не работает, что делаю не так. 1 1 Quote Share this post Link to post Short link Share on other sites
MakcT40 331 #219459 Posted October 3, 2014 Теперь потребуют подробный туториал по написанию модов. С примерами по различным направлениям. Quote Share this post Link to post Short link Share on other sites
StranikS_Scan 4,210 #219460 Posted October 3, 2014 Теперь потребуют подробный туториал по написанию модов. С примерами по различным направлениям. Я кстати FAQ пишу по тихоньку надо будет запостить. Хочу туда еще примеров понаписать с бигворлдом. 7 Quote Share this post Link to post Short link Share on other sites
o-0-0-0 77 #219705 Posted October 4, 2014 (edited) Я кстати FAQ пишу по тихоньку надо будет запостить. Хочу туда еще примеров понаписать с бигворлдом. Ты ваще супер чел , пользуюсь от души твоими подсказками ! Респект ! Вига се я загнул ))) это меня дети научили StranikS_Scan я тебе про такий игнор ошибок говорил <<< Traceback (most recent call last): <<< File "<string>", line 10, in <module> <<< ValueError: bad marshal data (unknown type code) или <<< File "<string>", line 10, in <module> <<< File "", line 43, in zlib_decode <<< zlib.error: Error -3 while decompressing data: incorrect header check Мод работает но не компилируется маршал . Edited October 4, 2014 by o-0-0-0 Quote Share this post Link to post Short link Share on other sites
GPCracker 2,088 #219792 Posted October 4, 2014 Мод работает но не компилируется маршал .хммм... в pyc 4 байта magic, еще 4 timestamp, остальное - marshalled code object. Первая ошибка - неверный код типа замаршалленых данных - скорее всего неправильное начало взял.. или конец. Вторая - неверный заголовок - то же самое. Quote Share this post Link to post Short link Share on other sites
yaotzinv 145 #219802 Posted October 4, 2014 (edited) Really, dunno...sad part is when you do so, python log logs...nothing I think game isn't ready when we try to load them at the wrong time and thus crashes but why and when, can't say. All I know is to avoid this, you have to decorate the right function (can't recall the name exactly) and do not forget to decorate the one when you leave battle or your UI will stay here :) London, Capital of Great Britain London is the capital of Great Britain, its political, economic, and commercial centre. It is one of the largest cities in the world and the largest city in Europe. Its population is about 8 million.London is divided into several parts: the City, Westminster, the West End, and the East End.The heart of London is the City, its financial and business centre. Numerous banks, offices, and firms are situated there, including the Bank of England, the Stock Exchange, and the Old Bailey. Few people live here, but over a million people come to the City to work. There are some famous ancient buildings within the City. Perhaps the most striking of them is the St. Paul's Cathedral, the greatest of English churches. It was built in the 17th century by Sir Christopher Wren. The Tower of London was founded by Julius Caesar and in 1066 rebuilt by William the Conqueror. It was used as a fortress, a royal palace, and a prison. Now it is a museum.Westminster is the governmental part of London.Nearly all English kings and queens have been crowned in Westminster Abbey. Many outstanding statesmen, scientists, writers, poets, and painters are buried here: Newton, Darwin, Chaucer, Dickens, Tennyson, Kipling, etc.Across the road from Westminster Abbey is Westminster Palace, the seat of the British Parliament. The Clock Tower of the Houses of Parliament is famous for its big bell, known as "Big Ben". Buckingham Palace is the official residence of the Queen.The West End is the richest and most beautiful part of London. It is the symbol of wealth and luxury. The best hotels, shops, restaurants, clubs, and theatres are situated there.The Trafalgar Square is the geographical centre of London. It was named in memory of Admiral Nelson's victory in the battle of Trafalgar in 1805. The tall Nelson's Column stands in the middle of the square.On the north side of the Trafalgar Square is the National Portrait Gallery. Not far away is the British Museum — the biggest museum in London. It contains a priceless collection of ancient manuscripts, coins, sculptures, etc, and is also famous for its library. There are a lot of factories, workshops, and docks in the East End. Edited October 4, 2014 by yaotzinv Quote Share this post Link to post Short link Share on other sites
GPCracker 2,088 #219825 Posted October 4, 2014 London, Capital of Great BritainХм... видимо чуваку гугл транслейт не помогает... I understand it, and i have tried to call object creation in battle. Game crashes the same way. This shows, this is not a correct reason of client crashes. When i wrote AASMX first version, i have forgot to delete text object after battle, and it stood in hangar space, as i remember... Hangar is space too as battle map, but no physics initialized. It could be understood by reading python log (something like "loading space"). Game might not be ready while loading screen is shown. But we both think that game crashes when C module can't find something required. Maybe transmitter module is running not in correct variable namespace. I think, sys.modules difference check between scripts run as mod and script in Orion will give a part of answer.GUI.Text() может быть создан в ангаре. Инфа соточка.) Проверял. Когда цвета в AASMX фиксил) Альтернативный вариант: скриптовой мод-ресивер (файлик в папку с модами) и через поток в памяти передавать ему данные... Quote Share this post Link to post Short link Share on other sites
yaotzinv 145 #219849 Posted October 4, 2014 (edited) GPCracker прикольнутся решил вспомнил вот это =) Edited October 4, 2014 by yaotzinv 1 Quote Share this post Link to post Short link Share on other sites
o-0-0-0 77 #221114 Posted October 8, 2014 GPCracker прикольнутся решил вспомнил вот это =) yaotzinv ты когда изменение координат автоприцела сделаешь ? или уже никогда , хотя б захват бы сделал . Quote Share this post Link to post Short link Share on other sites
Tester 5 #221133 Posted October 8, 2014 (edited) StranikS_Scan, а сохранение редактором переменных запланировано или все же баг? Выполняем код: text = 'bla bla' print text Результат конечно же bla bla. Удаляем первую строку и выполняем: print text Вместо ожидаемой ошибки NameError: name 'text' is not defined, результат прежний: bla bla. Это конечно же не критично, просто стало интересно. Я так понимаю принцип работы основан на Python Shell. А вообще искреннее спасибо за проект. Edited October 8, 2014 by Tester Quote Share this post Link to post Short link Share on other sites
StranikS_Scan 4,210 #221157 Posted October 9, 2014 (edited) А вы команду на удаление переменной записали? del text print text Edited October 9, 2014 by StranikS_Scan 1 Quote Share this post Link to post Short link Share on other sites
o-0-0-0 77 #221706 Posted October 11, 2014 У меня есть мечта - Орион обновись Quote Share this post Link to post Short link Share on other sites
igr234 4 #221818 Posted October 11, 2014 Думаю что ожидаемые обновления (обфускация) появятся не скоро . Если вообще появятся . Надеюсь что ошибаюсь . Quote Share this post Link to post Short link Share on other sites
laa 0 #222270 Posted October 13, 2014 Спасибо автору, за удобный инструмент. В качестве пробного шара сделал скрипт, не позволяющий в бою открыть меню для аптечки или ремкоплекта, если нет поврежденного танкиста или модуля (многие наверно промахиваются мимо нужной кнопки..). Если подгружать в орион, все работает прекрасно. Собственно вопрос. Как теперь сделать, чтобы он работал как отдельно взятый мод? from gui.WindowsManager import g_windowsManager consumablesPanel = g_windowsManager.battleWindow.consumablesPanel _expandEquipmentSlot = consumablesPanel.expandEquipmentSlot def __expandEquipmentSlot(idx, tagName, entityStates): for k in entityStates: if entityStates[k] in ('destroyed', 'critical'): _expandEquipmentSlot(idx, tagName, entityStates) continue consumablesPanel.expandEquipmentSlot = __expandEquipmentSlot Quote Share this post Link to post Short link Share on other sites
GPCracker 2,088 #222324 Posted October 13, 2014 (edited) Как теперь сделать, чтобы он работал как отдельно взятый мод? #call original code first def new_<className>_<classMethod>(*args, **kwargs): result = old_<className>_<classMethod>(*args, **kwargs) <new code> return result #call hook code first def new_<className>_<classMethod>(*args, **kwargs): <new code> return old_<className>_<classMethod>(*args, **kwargs) #inject code from <module> import <class> old_<className>_<classMethod> = <class>.<classMethod> <class>.<classMethod> = new_<className>_<classMethod>Двойное подчеркивание перед именем переменных в питоне - служебный символ. Обозначает private свойство/метод класса. Для обозначения оригинала/хука лучше использовать префиксы типа old_/new_ или orig_/hook_. В твоем случае: def new_ConsumablesPanel_expandEquipmentSlot(self, idx, tagName, entityStates): if set(entityStates.values()) & set(['destroyed', 'critical']): old_ConsumablesPanel_expandEquipmentSlot(self, idx, tagName, entityStates) return from gui.Scaleform.Battle import ConsumablesPanel old_ConsumablesPanel_expandEquipmentSlot = ConsumablesPanel.expandEquipmentSlot ConsumablesPanel.expandEquipmentSlot = new_ConsumablesPanel_expandEquipmentSlot Компилируешь этот код в *.pyc и закидываешь в папку с модами (scripts/client/mods).CP.zip С ремкой норм работает. Edited October 13, 2014 by GPCracker 2 1 Quote Share this post Link to post Short link Share on other sites
laa 0 #222387 Posted October 14, 2014 Спасибо. Quote Share this post Link to post Short link Share on other sites