Page 3 of 3

Re: [Script] SetDefaultParty (SDP)

Posted: Mon Feb 18, 2013 12:13 am
by pulpum
why have I not read this thread earlier???? :evil:

Thank you! :P

Re: [Script] SetDefaultParty (SDP)

Posted: Sat Feb 23, 2013 1:43 am
by tymur
So, another question :)

How I can prevent party members change slot?

or

How I can add party member to free slot?

The actual problem is: I have two party members (1 and 3), if player change their slots (for example move 3 to 2), and I try add party member 2 (by "party:getChampion(2):setEnabled(true)") nothing happens.

Thank for your help.

Re: [Script] SetDefaultParty (SDP)

Posted: Wed Feb 27, 2013 12:14 pm
by tymur
tymur wrote:So, another question :)

How I can prevent party members change slot?

or

How I can add party member to free slot?

The actual problem is: I have two party members (1 and 3), if player change their slots (for example move 3 to 2), and I try add party member 2 (by "party:getChampion(2):setEnabled(true)") nothing happens.

Thank for your help.
So, after few days without any response, I contacted Mahric and he send me solution, there is for everyone, its quite simple, but 100% functional.

Code: Select all

function getChamp(o)
   for i = 1,4 do
      if party:getChampion(i):getOrdinal() == o then
         return party:getChampion(i)
      end
   end
   return nil
end
Paste this code in script object and than you can use simple getChamp(3):setEnabled(true) for unlock champion who has originally in slot 3 (in this case) and appear him in first free slot.
Very simple and very effective. Once more many thanks to Mahric.