Custom Toorum-like mode

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Custom Toorum-like mode

Post 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?
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Custom Toorum-like mode

Post 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
Finished Dungeons - complete mods to play
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: Custom Toorum-like mode

Post 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?
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: Custom Toorum-like mode

Post by LocalFire »

Never mind got it to work, just had to remove the function part
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Post Reply