Can't add perks via scripts

Post » Sun Feb 10, 2013 4:26 am

Hi,

I'm trying to add perks to the player via scripts. I followed the example here: http://www.creationkit.com/AddPerk_-_Actor . My code is:

Scriptname aactPlayerAddPerks extends ReferenceAlias{Automatically adds several combat-related perks to the player}PlayerREF.AddPerk(aactWeightedBlows)Actor Property PlayerREF AutoPerk Property aactWeightedBlows Auto

This doesn't compile though. I keep getting this error: no viable alternative at input '.'
I also tried with Game.GetPlayer() instead of PlayerREF and I got the same error.

Any ideas on what I'm doing wrong?

Thanks in advance!
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Sun Feb 10, 2013 11:51 am

Yeah, you need to put code in an event or function. You can't just leave commands dangling like that.

Think of it like this, the script has to know when to fire your code, or it won't have any idea what's going on.

edit: You'll probably want the OnInit() event.
User avatar
Miss Hayley
 
Posts: 3414
Joined: Tue Jun 27, 2006 2:31 am


Return to V - Skyrim