Trainskill Question

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Trainskill Question

Post by Echoplex »

Hello. Working on setting up a default Character. I am attempting to set athletics to the first notch but I think i'm doing it wrong. When the train skill is set to 1, it jumps to the first skill gained in athletics.

Code: Select all

function startparty()
	    for i = 2,4 do
        party.party:getChampion(i):setEnabled(false)
	party.party:getChampion(1):setName("Test")
	party.party:getChampion(1):setSex("female")
	party.party:getChampion(1):trainSkill("athletics",1,true)
	party.party:getChampion(1):setPortrait("mod_assets/textures/portraits/a_human_female_21.tga")
    end
end
The desired result would be 1/5 athletics. Not 3/5. Thanks for the look.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Trainskill Question

Post by minmay »

Everything inside that for loop runs 3 times. So you're training champion 1's athletics skill three times. (and also setting their name, portrait, etc three times)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Re: Trainskill Question *solved

Post by Echoplex »

Gotcha. Apparently I had that while removing the other party members. Fixed now, thanks!
Post Reply