Exmortem
Community Developer
- Joined
- Mar 28, 2010
- Messages
- 799
I'm trying to sort through all my current party members, the goal is to eventually find heal targets.
That code works, but the issue is that I can't get current health from partyMember.CurrentHealthPercent, so I try to use partyMember.GameObject as Character ...
and it's throwing an object reference. In the past we could use party.GameObject.ToCharacter.CurrentHealthPercent but that was changed in the API. I don't know if this is an API error or if i'm doing something wrong. Obviously i'm in a party when i'm trying to run this code from the console.
Code:
foreach (PartyMember partyMember in PartyManager.Members)
{
Log(partyMember.Name);
}
That code works, but the issue is that I can't get current health from partyMember.CurrentHealthPercent, so I try to use partyMember.GameObject as Character ...
Code:
foreach (PartyMember partyMember in PartyManager.Members)
{
Log((partyMember.GameObject as Character).Name);
}
and it's throwing an object reference. In the past we could use party.GameObject.ToCharacter.CurrentHealthPercent but that was changed in the API. I don't know if this is an API error or if i'm doing something wrong. Obviously i'm in a party when i'm trying to run this code from the console.