Add player perks with book script

Post » Mon Oct 20, 2014 3:05 am

I am working on a personal mod that includes a book to give the player a perk. I have found several forum posts of the same question, and cross-referenced the CK wiki. However, my script isn't working.

Here is the source:

Scriptname _dbbAlcBookScript extends ObjectReference  Perk property Alchemist00 autoPerk property Physician autoEvent OnRead()    Game.AdvanceSkill("Alchemy",10000000)    Game.GetPlayer().AddPerk(Alchemist00)    Game.GetPlayer().AddPerk(Physician)    debug.messagebox("TEXTTEXT")EndEvent

and here is a view of the properties window: http://i.imgur.com/mDUnhrh.png

When the player reads the book, the Alchemy skill is fully leveled, and the debug message appears, but the perks are not added. My test character is a brand new character that doesn't have any perks.

Edit: Also I wanted to mention that I know how to do this with a batch script but I would much rather do it through an in-game item.

I tried out the same script format on Enchanting and it worked exactly as expected. Then I tried tweaking the Alc script. I added all five ranks of Alchemst, Physician, and Benefactor. When I read the book in-game, only Benefactor was added to the character. It seems like something is fishy with the Alchemist and Physician perks.

User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Mon Oct 20, 2014 1:39 am

Does your character meet the required conditions for the perks, if there are any?

User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm

Post » Sun Oct 19, 2014 11:29 pm

There is no requirement for Alchemist00 - it is the very first alchemy perk.

However, I don't think the requirements matter for AddPerk, only for the player's perk choice. In this case, Benefactor is being added even though it depends on Physician, which is not added.
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm


Return to V - Skyrim