[Script] SetDefaultParty (SDP)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
pulpum
Posts: 155
Joined: Wed Apr 18, 2012 1:23 am
Location: bordeaux, france

Re: [Script] SetDefaultParty (SDP)

Post by pulpum »

why have I not read this thread earlier???? :evil:

Thank you! :P
ad&d / ff / d&d
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post 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.
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post 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.
Post Reply