How to access the party info now available?
I can't seem to get a list of party members in a fellowship. I can get the number of members and info about the leader (such as the name), but nothing about the non-leader members of the group. How does it work?
It's driving me crazy. :confused: Is there any place where the new RoI lua been documented? |
Once you get the Party, you simply call GetMember() to get a PartyMember object which has the same methods as the Player object:
GetName() RegisterForClickHandling() GetBaseMaxMorale() GetBaseMaxPower() GetEffects() GetLevel() GetMaxMorale() GetMaxPower() GetMorale() GetPower() GetAlignment() GetClass() GetParty() GetRace() GetReadyState() IsLinkDead() IsVoiceEnabled() for example, the routine below will list the party member names and class codes. Code:
local localPlayer=Turbine.Gameplay.LocalPlayer:GetInstance(); |
I didn't know you could get the effects on the party - this makes a huge difference. Buff helpers could now be a clear reality, with a whole heap of effort that is. Can you also register for when a party members buffs change?
|
Quote:
EDIT: I did get to test it with PowerChanged() and the event fired properly (each member had to have a separate event handler). I'm not sure how you would go about managing adding and removing the event handlers unless there is a Party:MemberJoined() event or something. Unfortunately, possible Events are a lot harder to locate than Methods - Lua provides the names of the Methods in each objects' metatable. |
Thank you so much! I'd gone so far down meandering roads I doubt I could have come back to anything so simple by myself. What a relief.
*Wipes brow and gets on with things.* |
Quote:
I accidentally made a slightly misleading statement earlier, while PartyMember has the same methods as Player, it isn't because it inherits from Player, more likely it inherits from Actor. If you want to see the Methods and Events that are likely available on the PartyMember, you should probably look at the Actor object in the Turbine Lua API docs. |
*Avoids temptation to start working on yet another plugin*
Damn you Garan, for giving me this info... *AGH!* :) *Still tempted*. . . |
Quote:
|
Quote:
You knew it was there...you know you want it... The party member stats — they taunt you! :D |
I've been waiting on the docs to see if there is an event for party member joined/left. Otherwise the only alternative is to poll the fellowship every so often which seems suboptimal.
|
All times are GMT -5. The time now is 12:10 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI