Thread Tools Display Modes
09/11/16, 04:45 PM   #1
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
Post Itemlink crashes

EDIT: i'm at the lack of words. The game didn't crash because of invalid itemlinks. The game crashed because for some reason the 100000 values in the "for" loop were too many. When i split the loop in 5 separate loops for 20000 iterations each and introduced a delay of 50ms between the loops it stopped crashing.

Looks like now my question is what is happening and what's the best way to prevent it from happening?


-----------------------------------------------------------------------------------------------------------------------------------
Hi there.

I have a problem.

I'm trying to get a table of itemlinks of all the set items in the game

So i'm using a for loop going from 0 to 99999 and using this value as an itemId.

Lua Code:
  1. for itemId = 0, 99999 do
  2.        local link = "|H1:item:" .. itemId .. ":4:66:0:0:0:0:0:0:0:0:0:0:0:0:0:1:0:10000:0|h|h"
  3.        local hasSet, setName, numBonuses, numEquipped, maxEquipped = GetItemLinkSetInfo(link)
  4.        if hasSet then
  5.              --do somthing
  6.        end
  7. end


My problem is that for some values of itemId the game crashes on GetItemLinkSetInfo(link). Since it's REALLY hard to even find those itemId's when you need to restart the game each time, i'm asking for an advice.

I understand that it should be the game bug and, probabely if i knew the exact itemId that trigger it i could've just excluded them, but it's a pain to do it.

Is there any way to check the validity of the itemlink before using GetItemLinkSetInfo()? GetItemLinkName() does NOT crash for any itemId and i tried to use it to check if the name for the item link existed, but even after this check the client still kept crashing.

Any advice would be greatly appreciated.

Thank you.

Last edited by dorrino : 09/11/16 at 05:12 PM.
  Reply With Quote
09/11/16, 06:18 PM   #2
calia1120
 
calia1120's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 62
UESP has a lot of this data already - http://esoitem.uesp.net/viewlog.php - you may be able to get a lot of it from there.

Hope that helps.
  Reply With Quote
09/11/16, 06:28 PM   #3
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
Originally Posted by calia1120 View Post
UESP has a lot of this data already - http://esoitem.uesp.net/viewlog.php - you may be able to get a lot of it from there.

Hope that helps.
Thanks. I'm using uesp.net constantly. Best site it is there with api related stuff for eso.

My goal is much more complicated than just to know what sets are there.

I need to have itemlinks for each single set in the game.

Solved that problem though.
  Reply With Quote
11/21/16, 04:07 PM   #4
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
I've been having this same problem, except it isn't consistent at all. Sometimes it can handle it all without a problem and the next time I load the game, it fails in one second. I only have very light addons (MM aside), but I recently reduced my MM data immensely so even MM+what I'm doing should not be such a big deal (and as stated, it works sometimes). What method of delay did you use?
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Itemlink crashes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off