Learning recipe by reading note #2

Post » Tue Jun 19, 2012 10:20 pm

Hey guys!

I want a note make the player learn a recipe so i did the following:

- added a perk XY (blank, playable and hidden)
- added to the conditions of the recipe that you have to know perk XY
- added to the note:

Scriptname OnReadAddPerk extends ObjectReference
Perk Property XY Auto

event onRead()
Game.GetPlayer().AddPerk(XY)
endEvent

And i didn't learn the recipe. What went wrong?
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Tue Jun 19, 2012 7:25 pm

Did you learn the perk? add in a
Utility.Wait(1)debug.Messagebox("Did I learn the perk? " + Game.GetPlayer().HasPerk(XY))
User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am

Post » Wed Jun 20, 2012 5:26 am

Its false.

so why didn't Game.GetPlayer().AddPerk(XY) work?
User avatar
Ray
 
Posts: 3472
Joined: Tue Aug 07, 2007 10:17 am

Post » Wed Jun 20, 2012 8:09 am

Did you put conditions on the perk?
Did you set perk property XY to point to your perk?
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Tue Jun 19, 2012 7:25 pm

I was told I could leave the conditions of the perk blank.

What do i have to add?
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Wed Jun 20, 2012 3:36 am

You don't need to add any, I just wondered if maybe you had one that was coming out false when you tried to add the perk and stopping it from being added
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Tue Jun 19, 2012 7:30 pm

Just to be sure I repeat Xtynct's question: After compiling the script did you right click the script, select "edit properties" and apply you perk to property XY?? If you didn't that is the part you're missing. Apart from that I see no other possible point of failure (since you did not put conditions on the perk) as your script is correct.
User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Tue Jun 19, 2012 8:48 pm

Thanks a lot guys, my bad. Jason you were right, this was the part I forgot.
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm


Return to V - Skyrim