Jump to content
Alloder.pro  about Allods with love 😱
Search In
  • More options...
Find results that contain...
Find results in...

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Digest April

We talk about what was done and updated in the past month. We help keep abreast of events.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

Помогите пожалуйста


Guest Help
 Share

Recommended Posts

Здравствуйте! Хочу научиться создавать аддоны но что-то никак не получается читал эту тему http://ui9.ru/forum/develop/topic/922/t922-Как-сделать-свой-аддон , читал ModdingDocuments.zip , но что-то никак не могу понять.Прошу пожалуйста подсказать с чего начать,с lua немного знаком.Помогите плиз просто очень хочу научиться.

Взарание спасибо!

Link to comment
Share on other sites

Создаешь 2 файла:

-- AddonDesc.(UIAddon).xdb

Code:

<?xml version="1.0" encoding="UTF-8" ?>

<UIAddon>

<Name>  Название аддона  </Name>

<AutoStart>true</AutoStart>

<ScriptFileRefs>

<Item href="/Mods/SampleCommon/SampleAddonBase.lua" />

<Item href="init.lua" />

</ScriptFileRefs>

</UIAddon>

<Item href="/Mods/SampleCommon/SampleAddonBase.lua" /> - Это системный скрипт позволяющий вывести Логи в файл mods.txt

-- init.lua

Code:

--------------------------------------------------------------------------------

-- INITIALIZATION

--------------------------------------------------------------------------------

function Init()

--   Тут указывается код или функции которые выполняются при запуске аддона.  

end

--------------------------------------------------------------------------------

Init()

--------------------------------------------------------------------------------

Это минимальный аддон. Игра с ним запустится.

Для проверки можно в файл init.lua

написать так:

Code:

--------------------------------------------------------------------------------

-- INITIALIZATION

--------------------------------------------------------------------------------

function Init()

LogInfo("Аддон запущен")

end

--------------------------------------------------------------------------------

Init()

--------------------------------------------------------------------------------

Аддон с таким текстом выведет строчку в файле Mods.txt с текстом "Аддон запущен".

Остальное скорей всего придется с помощью проб и ошибок.

Link to comment
Share on other sites

Попробывал создать аддон ,чисто для интереса посмотреть чтонибудь у меня получится или нет,аддон заключался в следующем, чтоб когда перс находится около почты она автоматически открывалась.

Создал AddonDesc.(UIAddon).xdb

Code:
<?xml version="1.0" encoding="UTF-8" ?>

<UIAddon>

  <AutoStart>true</AutoStart>

  <Name>AutoOpenBox</Name>

  <ScriptFileRefs>

    <Item href="box.lua" />

  </ScriptFileRefs>

  

И создал box.lua

Code:
-- EVENT HANDLERS

if mailBox.IsInteracting() then

avatar.mailBox.Open()

end

-- INITIALIZATION

function Init()

function Open()

end

Init()

Но у меня ничего не вышло(((((. У меня вопрос я хоть чтонибудь правильно написал?

Link to comment
Share on other sites

Где ошибки понял попробывал исправить всеровно ни чего не получается подскажи плиз

Link to comment
Share on other sites

Вот код примера который сами разработчики предоставили

Code:

--------------------------------------------------------------------------------

-- GLOBALS

--------------------------------------------------------------------------------

-- Создаем глобальную переменную

Global( "passedTimeSec", 0 )

--------------------------------------------------------------------------------

-- EVENT HANDLERS

--------------------------------------------------------------------------------

-- Что делать при появлении события "EVENT_SECOND_TIMER" (Без события аддон делать нечего сам по себе не будет)

function OnEventSecondTimer( params )

passedTimeSec = passedTimeSec + 1

-- Выводим в mods.txt каждую секунду текст.

LogInfo( "passed time: ", passedTimeSec, " sec" )

end

--------------------------------------------------------------------------------

-- INITIALIZATION

--------------------------------------------------------------------------------

function Init()

-- Выводим в mods.txt информацию о том что аддон запущен

LogInfo( "Event registration sample, passed time: ", passedTimeSec, " sec" )

-- Регистрируем событие EVENT_SECOND_TIMER которое будет выполнять функцию OnEventSecondTimer

common.RegisterEventHandler( OnEventSecondTimer, "EVENT_SECOND_TIMER" ) 

end

--------------------------------------------------------------------------------

Init()

--------------------------------------------------------------------------------

Если уж тут нечего не понятно. То тут придется по темам полазить. То что есть вполне достаточно. Все события находятся в стандартной инструкции.

Link to comment
Share on other sites

Спасибо огромное Loss буду пробывать)))

Только я не пойму для того что я хочу создать надо EventMailBoxActivated или

EventMailBoxChanged

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use