Page 1 of 1

Retaining Character Name?

Posted: Tue Mar 31, 2015 3:38 am
by Morse
Komag wrote:Post on-screen text with a character's name:

Code: Select all

local name1 = party:getChampion(1):getName()
hudPrint("You know "..name1..", you are an incredibly effective adventurer!")
This code works fine, but if you move the first character between the 4 slots, it takes the name of another character or a blank position (so it'll show up as New Character). How do you keep it consistent and keep the character's name even if you move it from slot to slot?

Re: Retaining Character Name?

Posted: Tue Mar 31, 2015 4:11 am
by minmay
Iterate through all 4 champions and use Champion:getOrdinal() until you find the one with ordinal number 1.

Re: Retaining Character Name?

Posted: Tue Mar 31, 2015 12:01 pm
by Morse
minmay wrote:Iterate through all 4 champions and use Champion:getOrdinal() until you find the one with ordinal number 1.
Thanks - but does this also allow me to do easter eggs based on names the player entered? Or is that even possible?

Edit: NVM, I found a way.