Перейти к содержанию

Дайджесты за январь-февраль

Обновления гайдов и аддонов

Январь Февраль

Мониторинг серверов и редактор аддонов

Представляем вам две легенды. То, о чем можно было только мечтать, стало реальностью.

Мониторинг серверов Редактор аддонов

Подсказки из игры на вашем сайте

Теперь вы можете отображать сведения о внутриигровых элементах простым наведением курсора мыши.

Подробнее

Апдейтер аддонов

Представляем вам программу для автообновления аддонов и делимся подробностями.

Подробнее Скачать

Code Help


Barut

Рекомендуемые сообщения

I have almost finished my addon but when I tried to add bars to display health of enemies my addon stopped working correctly. Can someone please help me?

EDITED: I'm done with my addon thanx for helping

Ссылка на комментарий
Поделиться на другие сайты

Your code breaker is the first pass which results in;

Code:
wtBars    :Show(false)

Seems like a database error attributed to changing a widget into a number by means of;

Code:
wtBars     = unitId

I might be horribly wrong, but that's what I can see just by glancing at the code.

Ссылка на комментарий
Поделиться на другие сайты

yes, wtBars = unitId is completly nonsence

BTW: how to understand error messages

Quote:

Error: addon Sniper: Error while running the chunk

Error: addon Sniper: [string "mods/addons/sniper/scripts/sniper.lua"] : 146 : attempt to index field `?' (a number value)

Error: addon Sniper: func: ?, ?, line: -1, defined: C, line: -1, [c]

Error: addon Sniper: func: CreatePlayerList, global, line: 146, defined: Lua, line: 131, [string "mods/addons/sniper/scripts/sniper.lua"]

Error: addon Sniper: func: TrackEnvironment, global, line: 119, defined: Lua, line: 52, [string "mods/addons/sniper/scripts/sniper.lua"]

-the bold part is the important part (the other part say only from the bottom to the top, which function has calles the function in which the error is found)

-the underlined part is the line number of the error: in your case it is 146 "wtBars :Show(false) end"

-the red part is the important part of the erroe msg, because it says you, what the error has caused: in your case the fact, that wtBars is a number value (because of the line 142 as you find by looking for a reason for it) and that it is impossible to call :Show(false) from a number

Ссылка на комментарий
Поделиться на другие сайты

Well, man, i've watched through your code and noticed totally useless strings:

if unitHPP < 60 then

unitKiller = unitHPP * 10

elseif unitHPP < 30 then

unitKiller = unitHPP * 30

elseif unitClass.className == "PRIEST" and unitHPP < 60 then

unitKiller = unitHPP * 20

elseif unitClass.className == "PRIEST" and unitHPP < 30 then

unitKiller = unitHPP * 40

elseif unitClass.className == "NECROMANCER" and unitHPP < 60 then

unitKiller = unitHPP * 15

elseif unitClass.className == "NECROMANCER" and unitHPP < 30 then

unitKiller = unitHPP * 35

end

As far as i know this is executed next way:

if unitHPP < 60 then

unitKiller = unitHPP * 10

elseif , e.g. if unitHPP is NOT < 60 and if unitHPP < 30 (Which is totally absurd, it can't be NOT LESS than 60 but LESS than 30)

then

unitKiller = unitHPP * 30

elseif unitClass.className == "PRIEST" and unitHPP < 60 then (Same, it can't be true if upper thing is false coz 1-st statement is false only if unitHPP is 60 or more)

Well, same for the rest of that part of the code.

I didn't inspect the whole code, it was just first sight.

BTW, Do you speak russian, or you just correct google using your native sense of slavik speech?

Ссылка на комментарий
Поделиться на другие сайты

Quote:
unitClass.className == "PRIEST" and unitHPP < 60

i don't know about priorities in lua, but this coulb be very well like this:
elseif unitClass.className == ("PRIEST" and unitHPP) < 60 then ...
Ссылка на комментарий
Поделиться на другие сайты

@Setras

I'm Serbian so I use my native sense of slavik to correct google translator :)

Does anyone know why ("class", "tip_orange") doesn't display proper color, are there certain colors that are allowed to be used for tip tag?

P.S. I edited the code now it's more optimized as it uses less elseif's which makes it run faster.

Ссылка на комментарий
Поделиться на другие сайты

Sure. Red(not sure really), Green, Blue, Purple, Orange, White, well one for each equipment colour(before 2.x). Ah, also grey i think.

THey also had aliases in ancient scripts (the uncompiled ones) like "Junk" for grey (but not tip_junk afaik) and "Epic" for violet and so on...

Well, violet or purple, i don't really remember them.

P.S.

Roses are red

Violets are blue

So what the f*ck is the colour "violet"?

Ссылка на комментарий
Поделиться на другие сайты

Well well well, STOP! There really should be one fopr ORANGE!

K, just search through old scripts for all this stuff. I'll do it in a minute or two.

Ссылка на комментарий
Поделиться на другие сайты

class = "tip_white"

class = "tip_green"

style = "tip_golden" - this is for orange i believe

style = "tip_blue"

Well there should be one for violet, again.

Ссылка на комментарий
Поделиться на другие сайты

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Восстановить форматирование

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...

Важная информация

Пользуясь сайтом, вы принимаете Условия использования