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

New program for writers

We turn from quantity to quality and tell you how we will supplement the Allods Team program with rewards in rubles.

More

The new Updater

Let us to introduce the new addon updater software and to share the details

Read more

Alloder 2.0

We have started the process of project evolve, and this relates not only, and not even primarily of the site's view

Read more

Code Help


Barut
 Share

Recommended Posts

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.

Link to comment
Share on other sites

Guest Carnifex

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 ...
Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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"?

Link to comment
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.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use