kennY Posted May 4, 2019 Share Posted May 4, 2019 Буквально только начал разбираться в написании аддонов. Хотел для начала разобрать работу на примере аддонов из папки SampleAddons, скопировал от туда папку с аддоном SampleZoneAnnounce в data/Mods/Addons. В игре он есть, вроде, даже оказывает нагрузку на процесс игры, однако, он не работает у меня (не выводит ни каких сообщений о смене зоны). Тоже самое касается и SampleInit, который должен записывать в логи mods.txt сообщение, он этого не делает... В чем может быть проблема? Quote Link to comment Share on other sites More sharing options...
logg Posted May 4, 2019 Share Posted May 4, 2019 SampleInit выводит LogInfo в mods.txt. Цитата Теперь запись ошибок игровых дополнений в файлmods.txt отключена по умолчанию. Для её включения в файле /Personal/global.cfg найти параметр user_mods_log_enable и выставить ему значение 1 вместо 0. Второй аддон SampleZoneAnnounce должен и так работать. 1 Quote Link to comment Share on other sites More sharing options...
kennY Posted May 5, 2019 Author Share Posted May 5, 2019 9 часов назад, logg сказал: user_mods_log_enable и выставить ему значение 1 вместо 0 А можно узнать, где о подобном пишут в официальном мануале к API? Или это не от туда информация? Если нет, то от куда? А насчет SampleZoneAnnounce, после включения логов, он теперь в mods пишет Error while running the chunk [string "Mods/Addons/SampleZoneAnnounce/ScriptSampleZo..."]:27: attempt to call field 'GetCurrentZone' (a nil value) func: GetCurrentZone, field, line: -1, defined: C, line: -1, [C] func: ?, ?, line: 27, defined: Lua, line: 26, [string "Mods/Addons/SampleZoneAnnounce/ScriptSampleZo..."] Если я правильно понял, GetCurrentZone возвращает nil, а должен, видимо, информативные данные. Quote Link to comment Share on other sites More sharing options...
kennY Posted May 5, 2019 Author Share Posted May 5, 2019 Еще такой вопрос: во многих событиях указаны некие поля. Например, в документации к событию написано: EVENT_QUEST_SHARE_INVITATION Событие посылается, когда другой игрок хочет поделиться своим квестом с группой. -- поля shareId: ObjectId - уникальный идентификатор предложения Как обратится к этому полю shareId в обработчике? Через какой объект? Quote Link to comment Share on other sites More sharing options...
narinoa Posted May 5, 2019 Share Posted May 5, 2019 7 часов назад, kennY сказал: А можно узнать, где о подобном пишут в официальном мануале к API? Об этом там не пишут. Это писалось в одном из хотфиксов к игре, ближе к 10.0. 7 часов назад, kennY сказал: GetCurrentZone Был заменен в патче 5.0.2 на https://alloder.pro/md/LuaApi/FunctionCartographerGetCurrentZoneInfo.html К сожалению, никто не правил стандартные аддоны с изменениями апи. Quote Link to comment Share on other sites More sharing options...
logg Posted May 7, 2019 Share Posted May 7, 2019 05.05.2019 в 16:34, kennY сказал: Еще такой вопрос: во многих событиях указаны некие поля. Например, в документации к событию написано: EVENT_QUEST_SHARE_INVITATION Событие посылается, когда другой игрок хочет поделиться своим квестом с группой. -- поля shareId: ObjectId - уникальный идентификатор предложения Как обратится к этому полю shareId в обработчике? Через какой объект? function OnEventShare(p) if p.shareId then end end function Init() common.RegisterEventHandler( OnEventShare, "EVENT_QUEST_SHARE_INVITATION" ) end Init() Quote Link to comment Share on other sites More sharing options...
Lkledu Posted September 22, 2020 Share Posted September 22, 2020 i'm having a similar issue and instead create a new post, i prefer to use this. Neither mine or default addons create mods.txt inside Personal/Logs (or in another place). I installed my game by steam. I tried see if other addons could post logs and i installed event logger addon ( https://alloder.pro/files/file/633-event-logger/ ) but neither it create the mods.txt file (it showed the events that triggered in the chat window) Quote Link to comment Share on other sites More sharing options...
Lkledu Posted September 22, 2020 Share Posted September 22, 2020 У меня аналогичная проблема, и вместо этого я создаю новый пост, я предпочитаю использовать это. Ни мои, ни стандартные аддоны не создают mods.txt внутри Personal / Logs (или в другом месте). Я установил свою игру через steam. Я попытался посмотреть, могут ли другие надстройки публиковать журналы, и я установил надстройку регистратора событий ( https://alloder.pro/files/file/633-event-logger/ ), но не создал файл mods.txt (он показал события, которые срабатывает в окне чата) Quote Link to comment Share on other sites More sharing options...
самолет/Eksperyment Posted September 22, 2020 Share Posted September 22, 2020 9 hours ago, Lkledu said: i'm having a similar issue and instead create a new post, i prefer to use this. Neither mine or default addons create mods.txt inside Personal/Logs (or in another place). I installed my game by steam. I tried see if other addons could post logs and i installed event logger addon ( https://alloder.pro/files/file/633-event-logger/ ) but neither it create the mods.txt file (it showed the events that triggered in the chat window) You have to enable logs in global.cfg > user_mods_log_enable=1 1 Quote Link to comment Share on other sites More sharing options...
Lkledu Posted September 23, 2020 Share Posted September 23, 2020 15 hours ago, самолет/Eksperyment said: You have to enable logs in global.cfg> user_mods_log_enable = 1 thankyou . Sorry for flooding, i didn't see that Logg had posted before. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.