Go to Page... |
Compatibility: | Markarth (6.2.5) Stonethorn (6.1.5) Greymoor (6.0.5) |
Updated: | 01/27/21 12:56 AM |
Created: | 06/09/20 07:45 PM |
Monthly downloads: | 6,218 |
Total downloads: | 42,600 |
Favorites: | 15 |
MD5: | |
Categories: | Libraries, ESO Tools & Utilities |
[44955]="pauldron^p",[44956]="sabatons^p",
local name = LIB.GetRawItemName(langCode, id) if name then return ZO_CachedStrFormat("<<C:1>>", name) else return "NotFound. Lang Code ".. langCode .. " Id " .. id end
File Name |
Version |
Size |
Uploader |
Date |
1.0.12 |
8MB |
Shinntarou |
11/17/20 01:48 AM |
|
1.0.11 |
8MB |
Shinntarou |
11/03/20 03:37 AM |
|
1.0.10 |
8MB |
Shinntarou |
10/06/20 11:23 PM |
|
1.0.9 |
8MB |
Shinntarou |
09/21/20 07:41 PM |
|
1.0.8 |
8MB |
Shinntarou |
09/09/20 06:21 AM |
|
1.0.7 |
8MB |
Shinntarou |
08/24/20 03:17 PM |
|
1.0.6 |
8MB |
Shinntarou |
07/13/20 09:43 AM |
|
1.0.5 |
8MB |
Shinntarou |
06/29/20 05:31 PM |
|
1.0.4 |
8MB |
Shinntarou |
06/11/20 02:06 PM |
|
1.0.3 |
5MB |
Shinntarou |
06/10/20 04:34 AM |
|
1.0.1 |
5MB |
Shinntarou |
06/10/20 01:47 AM |
|
1.0.0 |
5MB |
06/09/20 07:45 PM |
![]() |
Comment Options |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
|
Thanks for creating this I created a patch for Pollox's Daily Quest Tracker and use this library to add the other languages quest names.
|
![]() |
![]() |
DarkPhalanx |
View Public Profile |
Send a private message to DarkPhalanx |
Find More Posts by DarkPhalanx |
Add DarkPhalanx to Your Buddy List |
![]() |
||
There is no real GC except /reloadui or setting variables explicitly to = nil
And I guess using _G or local is the same. Only access speed will differ if it would have to search the whole _G table for the desired sub tables and their subtables each time. So use speed up reference locals where possible. e.g. Lua Code:
Using the local pointer speedUpRefTab to the global table + subtable will be quicker here as else the _G, then _G.MyLibraryTable and then _G.MyLibraryTable.subTable would be searched on EACH round in the for ... do/in pairs loop. Same applies to filling the tables dynamically. _G.MyLibraryTable.subtable[1] = "test" will be not as quick as maybe speedUpRef[1] ="test". But: Depending on how speedUpRef was build, like 1 local speedUpRefBase and then another local speedUpRef = speedUpRefBase.subTable, it won't work properly in some cases! Check the Wiki: Everything is a table
Last edited by Baertram : 06/30/20 at 05:44 AM.
|
||
![]() |
![]() |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
![]() |
|
|
I don't know about actual mechanics of ESO's lua in this situation. just a little I expect that type of interpreter language will appropriately load and dispose local declared data like GC. most of user uses specific 1 or 2 lang code only.
that is reason why I fear that Lib has too big global array data. but, I'm newbie at LUA. |
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
||
Wasn't it the same before with the local variables and global functions? The data of all files was loaded right?
Else your lib wouldn't make sense ![]()
|
||
![]() |
![]() |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
![]() |
|
|
now, testing this code.
Code:
LibMultilingualName = LibMultilingualName or {} LibMultilingualName.GetRawItemName_Data = LibMultilingualName.GetRawItemName_Data or {} LibMultilingualName.GetRawItemName_Data["en"] = { [70]="Cured Kwama Leggings", [139]="Webspinner's Brace", [144]="Apprentice's Leggings", [148]="Scampstamper Sabatons", [219]="Sommelier's Gloves", IF the problem isn't matter, I will release it. now checking ESO's memory usage. |
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
|
Thank you for continuous advising, and I agree it's common and better idea in general. but, it's opposite to the initial concept of the library.
The library is impossible to rely on CVar "language.2" because of its concept. a user must pass specific one lang code and get one language's result each times. and ... the confusing raw file's structure is caused by the batchfile's convenience. I need re-generate raw files on ESO's update. Only I can do and I want to do is to solve function name's matter you pointed at.(GetRawSkillName_de ... gee, it's bad) foriegn friends who play ESO in other language(except EN, JA, DE, FR, RU) are increasing. the code will be cancer in near future. now I have tackled to remove the code like this. and , I want to adopt your teaching to the modifying. Code:
if langCode == LMN.CODE_ENGLISH then return LIB.GetRawQuestName_en(id) end if langCode == LMN.CODE_JAPANESE then return LIB.GetRawQuestName_jp(id) end if langCode == LMN.CODE_GERMAN then return LIB.GetRawQuestName_de(id) end if langCode == LMN.CODE_FRENCH then return LIB.GetRawQuestName_fr(id) end if langCode == LMN.CODE_RUSSIAN then return LIB.GetRawQuestName_ru(id) end |
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
Wouldn't it make more sense to define 1 function with the language code as parameter for the names in your lib?
e.g. current: LibMultilingualName.GetRawSkillName_de(index) New: LibMultilingualName.GetRawSkillName(index, lang) This way one would be able to just use the "same functions" and "syntax" for them to get the correct Strings AND one could even use 1 language variable like local lang = GetCVar("language.2") from ingame, istead of having to code several local skillName if lang == "de" then skillName = LibMultilingualName.GetRawSkillName_de(index) elseif lang == "en" then skillName = LibMultilingualName.GetRawSkillName_en(index) ... end Not to mention new languages that would be added :-( They would need an update of depending addons as well. To achieve this change your data files so that the table "local data = {" will close with } and after that lines you transfer it to the global addon's variable data like this: Lua Code:
And in your main file LibMultilingualData.lua create a function then for it: Lua Code:
Somethign like this would be way easier to use in addons, and more dynamically (imho)
Last edited by Baertram : 06/29/20 at 06:50 PM.
|
|
![]() |
![]() |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
![]() |
||
|
Thanks a lot. Yes, it is just I needed. I really need a good lib as a reference. And I'm sorry for leaving these things unfinished. Weapon, Armor, Pot, Poison... I'm sure to update my bad lib in near future. |
|
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
|
Your method of extracting item names corrupts some items like potions/poisons. Its names depends on CP:
ESSENCE OF CREEPING RAVAGE HEALTH DISTILLATE OF CREEPING RAVAGE HEALTH PANACEA OF CREEPING RAVAGE HEALTH etc. But your library contains "Creeping Ravage Health" and it will in tooltips etc. You should extract item names ingame and look into specific itemtypes. https://www.esoui.com/downloads/info...msFetcher.html it will help you |
![]() |
![]() |
zelenin |
View Public Profile |
Send a private message to zelenin |
Find More Posts by zelenin |
Add zelenin to Your Buddy List |
![]() |
||
|
Thank you very much! I'll check LibSets and so on. I need useful specification documents like you wrote. Just now I wanted to generate perfect Item name. > minifier Oh... previous version lib likes the big chunk of stone. after using LUA-minifier, it's perfectly safe! |
|
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
The benefit of tables is that if you dump the itemnames to the SavedVariables by scanning them with a debug function e.g. you can simply copy them over to your addon afterwards without having to alter or add "if ... end" functions around them.
You could use some function of the lib e.g. like Lua Code:
Not sure what the maximum itemId can be, I have assumed it's 300000 so maybe there are less or more. You could use the generated itemLink to check the item's type as well if you want to strip some of the items(like only include armor, weapons and jewelry) via API functions like GetItemLinkItemType. Caution: As scanning so many itemIds needs time I'd recommand using zo_callLater e.g. to make "packages of scanned data at a maximum of e.g. 10000 itemIds "at once" in each package. Like put the actual scan code into a local subfunction which you can call with a delay, increase the delay each scanned package by 250ms so the game client won't kick you for mesasge spam. Check the library LibSets, LibSets_Debug.lua for some code exaples as the sets get scanned -> function "scanAllSetData". You'd need to add the ## SavedVariables: tag to your txt file of the lib and add e.g. account wide SavedVariables to the library init functions where you could add this table then. This way you'd get the itemNames from the game client and provide API functions to obtain them. Maybe you could loose the included ESOExtractData then. And I'd also recommand minifying the files with a lua minifier, like this one: https://mothereff.in/lua-minifier This will shrink the filesize a lot and make loading "a bit faster" at least. btw: Thanks for the lib!
Last edited by Baertram : 06/10/20 at 03:42 AM.
|
|
![]() |
![]() |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
![]() |
||
|
in first edition, I once used LUA table. the reason was exactly what you pointed at. I thought... "5M memory each lang? ESO always loads those tables even for non-using languages? ... I try to change to IF mechanics and count on GC." but, It was confirmed that there is no big difference when I play. next version, Probably I will replace the bad code. thanks. |
|
![]() |
![]() |
Shinntarou |
View Public Profile |
Send a private message to Shinntarou |
Find More Posts by Shinntarou |
Add Shinntarou to Your Buddy List |
![]() |
|
You should change the language files to use tables instead. For example for the first few items:
local itemNames = { [70]= "jambières tannées en kwama^pf" , [139]= "sangle lombaire de la tisseuse^f" , [144]= "jambières de l'apprenti^pf" , [148]= "solerets de piétineur de galopins^pm" , [219]= "gants du sommelier^pm" , [238]= "chaussures^pf" , [251]= "hache de bataille^f" , [317]= "solerets de la garde du Lion de l'arbre du Wyrd^pm" , [471]= "bastion du dragon de la Sangrépine^m" , [479]= "culotte de porcher^f" , [521]= "chêne brut^ms" , [533]= "chêne poncé^ms" , [685]= "bâton de guérison de Gabrielle^m" , [793]= "lanières de peau brute^pf" , [794]= "peau brute^fs" , [800]= "lanières de peau superbe^f" , [802]= "érable brut^ms" , [803]= "érable poncé^ms" , [808]= "minerai de fer^m" , } Then, the actual function becomes this: function LibMultilingualName.GetItemName_fr(itemId) if itemNames[itemId] then return itemNames[itemId] end return "NotFound fr" end One benefit of this is that tables in Lua are hash tables, so it'll make the function run much faster - rather than doing thousands of comparisons it's just doing a table lookup Also, it's shorter and imo looks nicer |
|
![]() |
![]() |
Dolgubon |
View Public Profile |
Send a private message to Dolgubon |
Find More Posts by Dolgubon |
Add Dolgubon to Your Buddy List |
![]() |