lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #11  
Unread 05-10-2012, 03:19 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Quote:
Originally Posted by RandomAugury
Can anyone help with the following questions?
(1) How can I find information on ItemInfo. I can't find this under Turbine.Gameplay which is where I expect to see it;
(2) How do you get the ItemInfo for an item? There doesn't seem to be a new method attached to the Item class to return it.
(3) I just noticed that there are Service and ServiceContainer classes - what are these for?
You have to create an instance of an ItemInfo to really see what it does. To get an instance, get an instance of any item from any source such as the backpack, shortcut, vault, equipped items, or shared storage. Then use the item:GetItemInfo() method to create an instance of ItemInfo. Now you can look through the instance's metatable for all the goodies available from ItemInfo. I don't use HereBeDragons. For exploring and debugging in Lua I use the Debug window built into MoorMap (just go to options and turn on debugging). I have a few other tools that I use but I've never published them and probably won't as their interfaces are quite rough and designed just for me to look things up quickly. Anyway, if you enter the following code and hit the Execute button it will create all of the objects and you can browse them in the window (the same sort of thing HereBeDragons does but that doesn't support interactive code or watching values).

Here's a quick sample of how to get an instance of an ItemInfo object:
Code:
localPlayer=Turbine.Gameplay.LocalPlayer:GetInstance();
backpack=localPlayer:GetBackpack();
testitem=backpack:GetItem(1);
iteminfo1=testitem:GetItemInfo();
be sure you have something in the first backpack slot for this example to work
Reply With Quote
  #12  
Unread 05-10-2012, 07:31 PM
RandomAugury RandomAugury is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Feb 2012
Posts: 5
Thanks for the response It makes perfect sense.

I did look at the class definition for Item and didn't see the GetItemInfo method on Item. I could have sworn it wasn't there!

Maybe its only there when you have an instance of the object.


Augury
Reply With Quote
Reply


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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Travel, Poi and other info from Update 6 to update your plugins with magill Lua Programming Help (L) 2 03-12-2012 09:07 PM
FYI - Update 6 is up on bullroarer - lots of Lua fixes magill Lua Programming Help (L) 5 03-05-2012 11:49 AM
ROI Update 1 Lua Changes/Fixes woal Lua Programming Help (L) 1 10-18-2011 06:07 PM
Lua update in ROI... Release notes magill Interface Requests (L) 0 09-26-2011 06:18 PM
Turbine.UI.Window behavior changing in next Lua update Digital_Utopia General Authoring Discussion (L) 7 10-27-2010 12:43 AM


All times are GMT -5. The time now is 05:44 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui