We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,466

    Quickslots from Items

    I'm struggling to make sense of creating a shortcut for a quickslot through passing an item. According to the documentation:

    Code:
    function Shortcut:Shortcut(item);
    
    Parameters: item Type: Item
    The item to create the shortcut from. 
    Remarks: Initializes a new shortcut.
    From what I understand, I should be able to create a shortcut for an item ( backpack/equipment:GetItem() ) and then assign it to a quickslot. However at the moment when I do this, the quickslot is empty as if nothing has been assigned. Is this a bug? Or am I doing something wrong?

    Code:
    local item = Player:GetEquipment():GetItem(1);
    cItemInspect:SetShortcut(Turbine.UI.Lotro.Shortcut(item));
    Code I'm using is a variation of the above (using a loop to get each item). The item is returning correctly, have tested it with item:GetName(). Just doesn't seem to be working in the quickslot.

    Any help would be appreciated Thanks
    Galuhad | Narvelan
    Lore Breakers of Eldar

  2. #2
    Join Date
    Mar 2007
    Posts
    1,339
    As far as I know, that's a documentation error. The Shortcut object has never actually accepted an item as a parameter to the constructor. The closest we could do is to pass the item type and an itemID, not an actual item. That is part of the reason we have been asking for years to be able to obtain an itemID either from an item or from an itemInfo structure so that we could programmatically recreate items for controls.

  3. #3
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,466
    Quote Originally Posted by Garan View Post
    As far as I know, that's a documentation error. The Shortcut object has never actually accepted an item as a parameter to the constructor. The closest we could do is to pass the item type and an itemID, not an actual item. That is part of the reason we have been asking for years to be able to obtain an itemID either from an item or from an itemInfo structure so that we could programmatically recreate items for controls.
    Oh I'll have to try and be more creative with something else instead.
    Thanks as always Garan.
    Galuhad | Narvelan
    Lore Breakers of Eldar

  4. #4
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,466
    Ok I'm out of ideas.

    With items that are equipped, I can use the API functions to get the instance of each item in the various slots, but to actually look those up in the Tulkas database and get the relevant stats I need the item's ID. Otherwise the information returned by GetItemInfo() is useless for what I need. In this case, what should be the most direct way, and easiest/least time consuming for the player is unfortunately no good. I can always look-up by the item name, but that is not guaranteed to return the correct result because of items with matching names. If item:GetItemInfo() returned the item ID as part of it's output then everything would become a lot simpler.

    The second option is to have quickslots that would be assigned these equipped items instead (automatically using shortcut:SetShortcut(item) ). But unfortunately this doesn't work (bug?) and there's no way to create a shortcut using an item instance. The only way to create a shortcut for an item, is by using the item ID - the one thing I don't have.

    The third option is to again use quickslots, but instead just allow the user to drag-drop the equipped items and hope that the shortcut:GetData() works, but of course, once equipped this no longer returns the item ID and instead gives us something that is, unfortunately, undecipherable and of no known use for plugin development.

    I know that no one is really looking after the Lua APIs anymore, and things are very tight in terms of the game development. However the code already exists for the function GetItemInfo() - which can return a number of things in relation to the item. It shouldn't take someone 5 minutes to make a code adjustment to include the item ID in the returned results. Please.
    Galuhad | Narvelan
    Lore Breakers of Eldar

  5. #5
    I would dearly love for time to be put into LUA to help with items. There is so much that can be done, but is just out of reach because of limitations with the system as it stands
    [charsig=http://lotrosigs.level3.turbine.com/0420800000006abda/01006/signature.png]Kamindra[/charsig]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload