lotrointerface.com
Search Downloads


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

Reply
Thread Tools Display Modes
  #1  
Unread 10-02-2011, 08:25 PM
KRc KRc is offline
The Wary
 
Join Date: Oct 2011
Posts: 3
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.

Is there any place where the new RoI lua been documented?
Reply With Quote
  #2  
Unread 10-02-2011, 10:13 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
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();
local party=localPlayer:GetParty();
if party~=nil then
  local memberIndex, member;
  for memberIndex=1,party:GetMemberCount() do
    member=party:GetMember(memberIndex);
    Turbine.Shell.WriteLine("Member("..memberIndex..") Name:"..member:GetName().." Class:"..member:GetClass())
  end
end

Last edited by Garan : 10-03-2011 at 08:30 AM.
Reply With Quote
  #3  
Unread 10-03-2011, 12:37 AM
MrJackdaw's Avatar
MrJackdaw MrJackdaw is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2009
Location: Lancaster, England
Posts: 249
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?
__________________
************************************************** ************************************************** **
"Our ideals may never be realised, But they indicate what we are trying to do." Dick Tahta
Reply With Quote
  #4  
Unread 10-03-2011, 07:29 AM
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 MrJackdaw
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?
I haven't played with the Party stuff at all yet. I imagine that since the PartyMember has the same exact Methods as Player, it is probably an extension of Player, so it probably inherits the same Event handlers.

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.

Last edited by Garan : 10-03-2011 at 09:04 AM.
Reply With Quote
  #5  
Unread 10-03-2011, 08:20 AM
KRc KRc is offline
The Wary
 
Join Date: Oct 2011
Posts: 3
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.*

Last edited by KRc : 10-05-2011 at 09:29 AM. Reason: typo mentioned got fixed
Reply With Quote
  #6  
Unread 10-03-2011, 08:44 AM
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 KRc
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.*

PS though, a little typo in your example: you need to change tmpIndex to memberIndex in the line:

Code:
Turbine.Shell.WriteLine("Member(".. tmpIndex ..") Name:"..member:GetName().." Class:"..member:GetClass())
Regardless, it worked great.
Thanks for catching the typo. It's a pain copying and pasting from my Interactive Debug window so I got lazy and retyped it.

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.
Reply With Quote
  #7  
Unread 10-03-2011, 09:14 AM
MrJackdaw's Avatar
MrJackdaw MrJackdaw is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2009
Location: Lancaster, England
Posts: 249
*Avoids temptation to start working on yet another plugin*

Damn you Garan, for giving me this info... *AGH!*


.
.
.
*Still tempted*
__________________
************************************************** ************************************************** **
"Our ideals may never be realised, But they indicate what we are trying to do." Dick Tahta
Reply With Quote
  #8  
Unread 10-03-2011, 10:36 AM
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 MrJackdaw
*Avoids temptation to start working on yet another plugin*

Damn you Garan, for giving me this info... *AGH!*


.
.
.
*Still tempted*
LOL Yeah, I know. I am suffering from Potential Plugin Syndrome (PPS) myself. So MANY possibilities, so little time. Despite the fact that I was disappointed that we can't equip items programatically, I am sort of relieved since it allowed me to put at least one of those many, many ideas back on the back burner.
Reply With Quote
  #9  
Unread 10-03-2011, 12:08 PM
KRc KRc is offline
The Wary
 
Join Date: Oct 2011
Posts: 3
Quote:
Originally Posted by MrJackdaw
*Still tempted*

You knew it was there...you know you want it... The party member stats — they taunt you!

Reply With Quote
  #10  
Unread 10-03-2011, 02:25 PM
Pengoros Pengoros is offline
The Unscathed
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 15
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.
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
Access to the map Fido Lua Programming Help (L) 4 08-10-2011 12:58 PM
Horizontal Party bars Greytail Interface Requests (L) 4 03-25-2011 10:51 AM
Getting Party member names Zyriel Interface Help (L) 4 01-20-2011 05:53 PM
DDO reduce party bar size medic4hire Interface Requests (D) 2 10-21-2010 08:42 PM
Helpful Info Cairenn Chit Chat 5 04-20-2007 11:24 AM


All times are GMT -5. The time now is 06:09 PM.


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