View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

Old August 4th, 2009, 03:05 PM
Quote:
Originally Posted by Lawful_g View Post
Alright, in another thread I mentioned that I was making a feat called Education that gives you a +2 to 2 chosen Knowledge skills. Since there is no way to have 2 selections on one feat, I have chosen to make several feats that will give you a +2 on one skill and let you choose the second skill to get the bonus.

In that thread I got distracted and forgot about the problem while getting others answered by the ever helpful mghel. I don't want to revive that thread, so I'll just bring it back up here. The extent that I have for scripts is:

~ Add 2 to our chosen skill
field[fChosen].chosen.field[Bonus].value += 2

~ Add 2 to the base skill
hero.childfound[kKnowHist].field[Bonus].value = hero.childfound[kKnowHist].field[Bonus].value + 2

~ Set our 'short name'
if (field[fChosen].ischosen <> 0) then
field[fShortName].text = "Education - History and " & field[fChosen].chosen.field[name].text
endif

When I select a skill, I get an error "Attempt to assign field value with no pick context".
There is no error when I compile the script in the editor, but the chosen skill is not gaining any bonus either.
Try putting your "~Add 2 to our chosen skill" section inside the same if statement that the shortname modification is in. If you get the error as soon as you add the feat, and not just once you select a skill, it's because the script runs as soon as the feat is added, and at that point, the user hasn't been given the chance to choose something for fChosen.
Mathias is online now   #8 Reply With Quote