Page 1 of 1

Custom Toorum-like mode

Posted: Sat Apr 06, 2013 10:06 am
by LocalFire
I want to add a toorum like mode to my dungeons, so that if the first champions name is for example Evante, then the party is replaced by a custom characther called Evante
Heres my code for a custom characther

Code: Select all

for i=2,4 do party:getChampion(i):setEnabled(false) end
party:getChampion(1):setStat("dexterity", 16)
party:getChampion(1):setStat("willpower", 14)
party:getChampion(1):setName("Evante Morecari")
party:getChampion(1):setClass("Rogue")
party:getChampion(1):setPortrait("mod_assets/Evante.tga")
party:getChampion(1): trainSkill("assassination",50,true)
party:getChampion(1): trainSkill("daggers",10,true)
So how would I get it so that it checks the names of the champion and replaces them if they have the correct name?

Re: Custom Toorum-like mode

Posted: Sat Apr 06, 2013 11:07 am
by Komag
Champion:getName()
Returns the name of the champion.

Just run it at map start

And don't forget to inform players (in the game readme and dungeon description) that they shouldn't bother creating a carefully planned out party if they go this route, but just name the first character that name and quickly make all four "dummy" characters without regard to race, class, skills, etc

Re: Custom Toorum-like mode

Posted: Sat Apr 06, 2013 12:12 pm
by LocalFire

Code: Select all

function EvanteMode()
 
   
   local aname = ""
   
   for i=1,4 do
      
      aname = party:getChampion(i):getName()
      if aname == ("Evante") then
         

for i=2,4 do party:getChampion(i):setEnabled(false) end
party:getChampion(1):setStat("dexterity", 25)
party:getChampion(1):setStat("willpower", 14)
party:getChampion(1):setName("Evante Morecari")
party:getChampion(1):setClass("Rogue")
party:getChampion(1):setPortrait("mod_assets/Evante.tga")
party:getChampion(1): trainSkill("assassination",50,true)
party:getChampion(1): trainSkill("daggers",10,true)


end
end
end
So thats what I'm (trying) to use but it doesn't seem to work any suggestions?

Re: Custom Toorum-like mode

Posted: Sat Apr 06, 2013 1:06 pm
by LocalFire
Never mind got it to work, just had to remove the function part