Page 1 of 1

Trainskill Question

Posted: Fri Feb 26, 2016 3:59 am
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.

Re: Trainskill Question

Posted: Fri Feb 26, 2016 4:31 am
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)

Re: Trainskill Question *solved

Posted: Fri Feb 26, 2016 5:23 am
by Echoplex
Gotcha. Apparently I had that while removing the other party members. Fixed now, thanks!