PDA

View Full Version : UPdate 7 - LUA Changes


magill
05-04-2012, 02:40 PM
From the first release notes: (Reformatted slightly for reading, hopefully my chances are correct as the original text is not clear)

Lua

Added GetInCombatMoraleRegeneration method, InCombatMoraleRegeneration Changed event to FreePeopleAttributes.
Added GetInCombatPowerRegeneration method, InCombatPowerRegeneration Changed event to FreePeopleAttributes.
Added GetOutOfCombatMoraleRegeneration method, OutOfCombatMoraleRegeneration Changed event to FreePeopleAttributes.
Added GetOutOfCombatPowerRegeneration method, OutOfCombatPowerRegeneration Changed event to FreePeopleAttributes.


Added Bank, Vault, and SharedStorage classes.

These class provide access to a player's Vault and SharedStoraged with the following methods and events:
IsAvailable, Getcount, GetCapacity, GetChestCount, GetChestName, GetItem, PerformShortcutDrop, IsAvailableChanged,
CountChanged, CapacityChanged, ItemsRefreshed, ItemAdded, ItemRemoved, ItemMoved, ChestNameChanged.

The Vault and SharedStorage classes behave similarly to the in game UIs with regards to access.
The data can only be accessed after talking to a banker and remaining within range. While away from a banker the classes will return default values for their methods.

Added ItemInfo. This class is the new container for common item information.

With this shift, the following methods are being deprecated in Item: GetCategory, GetQuality, GetDurability, GetUnderlayImageID, GetBackgroundImageID, GetShadowImageID, GetIconImageID, GetMaxStackSize, IsMagic.

Deprecated methods will be removed in a future version so update your plugins!

celtictoad13
05-04-2012, 04:00 PM
You overlooked one thing w/ respect to bag storage:

By player request

Increased bag space!
Players have long requested additional bag space for their characters. We appreciate that storage is always at a premium and more space is always better. It’s also a very complicated thing to make happen. Engineering requirements, server performance, and database space all have to be considered. We’ve looked at the request from every angle and we’re very happy to report that a sixth inventory bag will be made available as part of the Riders of Rohan pre-purchase.

Update 7 will include the User Interface changes required to make this happen. So, while you may see new inventory buttons on your toolbar, the bag itself is not currently available. More details on how to acquire it will be coming very soon.

The last part of this is of importance.

Garan
05-04-2012, 09:17 PM
The Vault and SharedStorage objects sent me into sugar shock like a kid that ate wayyyyy too much candy for easter :)

So far I've only verified the classes exist and the IsAvailable method and IsAvailableChanged event seem to work properly. Once I get over my jubilation of finally having access to the Vault and SharedStorage objects I'll get around to actually working with them :)

The new ItemInfo has two additional methods, :IsUnique() and :GetNameWithQuantity(). The IsUnique() method is fairly self-explanatory. I'm not sure what the GetNameWithQuantity is supposed to return but it currently just returns the name - I'm hoping when it is fully implemented that it might return the name and total quantity for all items of its type which would be nice if multiple stacks exist. Unfortunately they didn't add any mechanism for retrieving the item Data value, but we can still hope. This seems to be a step in the right direction.

Unfortunately they did not add a :PerformShortcutDrop() to the EquippedItems object :( but it does exist for the Vault and SharedStorage so perhaps there is still hope that they will go back and change that.

magill
05-05-2012, 04:51 PM
One wonders if Update 7 will also only be in beta for a few short days (Friday to Monday) as was 6.1.

Vinny
05-06-2012, 05:56 AM
Well, the maint. window is rather long for a routine reboot, so I wouldn't be surprised if update 7 does go live. I've been busy adding the new content to my plugins so that I'll mostly be ready.

Vinny
05-06-2012, 06:40 AM
I'm not sure what the GetNameWithQuantity is supposed to return but it currently just returns the name
The difference is that GetName return the singular version of the name and GetNameWithQuantity returns the plural version of the name. This makes it easier to match names when you have stacks.

bjoberludde
05-06-2012, 03:30 PM
As a spaceaholic I'm really looking forward to plugins that can show me what my chars are holding in their inventories, both bags and vault! Will make my life so much easier :)

RandomAugury
05-09-2012, 04:38 AM
Could someone please post a list of the new API class and methods? I'd like to start thinking about plugin enhancements related to the bank, shared storage etc but I don't have information on the areas.

I know I can go into bullroarer and dump out information from objects, but that's pretty fiddly and not convenient if I am somewhere like work and want to do a sneaky bit of planning ;)

Not only that but I think that there are lots of people who'd like to have access to a consolidated set of documentation.

How does the documentation for the API get maintained? Where should I look? I might be missing an FAQ or something. I saw that there is a documentation upload somewhere but it dates back to last year.

Thanks in advance,

Augury

RandomAugury
05-09-2012, 05:23 AM
I'm using the HereBeDragons plugin on bullroarer (great plugin btw :) to try and look at some of the new things coming.

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?


Cheers,

Augury

magill
05-10-2012, 07:49 AM
How does the documentation for the API get maintained? Where should I look? I might be missing an FAQ or something. I saw that there is a documentation upload somewhere but it dates back to last year.


The Lua support from Turbine is an "unsupported" situation. Also known as, "Oh, and by the way..."

The Developer Narrel posts updates to both the skinning packs and the Lua API, "when he has time."

While the Skinning Packs were updated for Update 6, the API file was not.

So, the most current API documentation is Narrel's post here:

http://www.lotrointerface.com/downloads/info621-IsengardLuaAPIDocumentation.html

And, yes, it was posted 10-19-2011.

We are extremely fortunate the Narrel manages to squeeze as much updating into any given release as he does -- since that's not his main job at Turbine.

One hoped that with the "publicizing" of the interface by including the Plugin Manager on the character generation page, we would see significantly more visible support from Turbine -- but, at least so far, that has not been the case.

The issue is similar with data.lotor.com support.

What support we have is great. What we want is more!

Sigh.

BTW: The above comments are intended as thank-yous to those Developers who do manage to "find the time" to enhance both features.

Garan
05-10-2012, 03:19 PM
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:

localPlayer=Turbine.Gameplay.LocalPlayer:GetInstan ce();
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

RandomAugury
05-10-2012, 07:31 PM
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