Thread Tools Display Modes
07/17/14, 04:28 AM   #21
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by zgrssd View Post
I asume AreId64sEqual does som additional checks. The logic most be more complex then A ~= B, if they write an extra function for it.
I don't think it's more complex, but is required due the way Lua stores numbers http://lua-users.org/wiki/NumbersTutorial

Since numbers in Lua are double-precision floating-point (1 bit sign, 11 bits exponent, 52 bits mantisa), integers are only precise below 2^53. Try comparing (2^53 == 2^53+1) in Lua console, the answer is surprisingly "true". That's because binary representation of 2^53+1 is "1..(52x0)..1", but there is not enough room to store 53 bits in mantisa, and so it gets rounded to 2^53.
NB for the curious: 2^53+1 or "1..(52x0)..1" is 54 bits long, but I wrote there's no room for 53 bits. It's not a typo, the initial "1" bit is implied, not stored anywhere. It's part of the standard https://en.wikipedia.org/wiki/IEEE_floating_point

They probably return the 64-bit integer ID in Lua number, but that's not guaranteed to be a valid floating-point number (some bit combinations are simply invalid, and floating-point operations on such values, including comparison, might yield weird results). Those comparison functions are probably circumventing floating-point comparison, and do integer comparison in C instead. But it's just my guess
  Reply With Quote
08/04/14, 07:24 PM   #22
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
ArmorType & WeaponType Funciton Changes

It looks like with the addition of the new ways to get ArmorType & WeaponType from a link:
Lua Code:
  1. local lItemLink = GetItemLink(iBagId, iSlotId)
  2. local ArmorType = GetItemLinkArmorType(lItemLink)
  3. local WeaponType = GetItemLinkWeaponType(lItemLink)

They also changed the way the old functions worked:
Lua Code:
  1. -- These no longer work --
  2. local ArmorType = GetItemArmorType(lItemLink)
  3. local WeaponType = GetItemWeaponType(lItemLink)
They now take a bag & slot ID:
Lua Code:
  1. local ArmorType = GetItemArmorType(iBagId, iSlotId)
  2. local WeaponType = GetItemWeaponType(iBagId, iSlotId)
  Reply With Quote
08/04/14, 07:55 PM   #23
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by circonian View Post
It looks like with the addition of the new ways to get ArmorType & WeaponType from a link:
Lua Code:
  1. local lItemLink = GetItemLink(iBagId, iSlotId)
  2. local ArmorType = GetItemLinkArmorType(lItemLink)
  3. local WeaponType = GetItemLinkWeaponType(lItemLink)

They also changed the way the old functions worked:
Lua Code:
  1. -- These no longer work --
  2. local ArmorType = GetItemArmorType(lItemLink)
  3. local WeaponType = GetItemWeaponType(lItemLink)
They now take a bag & slot ID:
Lua Code:
  1. local ArmorType = GetItemArmorType(iBagId, iSlotId)
  2. local WeaponType = GetItemWeaponType(iBagId, iSlotId)
Yeah, you can find it in the ESOUIDocumentationP3.txt attached file to this topic:
http://forums.elderscrollsonline.com/discussion/119843/
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » PTS 1.3.0 API changes (100007 to 100008 diff)

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