TDrew Posted August 1, 2012 Share Posted August 1, 2012 Okay, so the deal is this: I want this script to give the player this perk I made called 'boneperk' when they equip an item... I have been trying for hours and no luck though. Here is my script: Scriptname BonePerkScript extends ObjectReference Event OnEquipped(Actor akActor) akActor.AddPerk(BonePerk) Debug.Notification("Bone Harvesting Enabled") EndEvent Event OnUnEquipped(Actor akActor) akActor.RemovePerk(BonePerk) Debug.Notification("Bone Harvesting Disabled") EndEvent Perk property BonePerk auto Ive tested it every way I can think to... the perk itself functions if I add it via console, the script compiles properly and displays the text notification whenever the item its attached to is equipped or unequipped... I just cant figure out why the script wont give the perk to the player! Im a complete scripting noob, so please, If you've got any ideas about what is going wrong please let me know. Link to comment Share on other sites More sharing options...
Lucasistheman Posted August 1, 2012 Share Posted August 1, 2012 try to call akActor the player or simply remove akActor and change to Game.GetPlayer() Link to comment Share on other sites More sharing options...
TDrew Posted August 1, 2012 Author Share Posted August 1, 2012 try to call akActor the player or simply remove akActor and change to Game.GetPlayer() I just tried this: Scriptname BonePerkScript extends ObjectReference Event OnEquipped(Actor akActor) akActor == Game.GetPlayer() Game.GetPlayer().AddPerk(BonePerk) Debug.Notification("Bone Harvesting Enabled") EndEvent Event OnUnEquipped(Actor akActor) akActor == Game.GetPlayer() Game.GetPlayer().RemovePerk(BonePerk) Debug.Notification("Bone Harvesting Disabled") EndEvent Perk property BonePerk auto ...no change. Link to comment Share on other sites More sharing options...
Lucasistheman Posted August 1, 2012 Share Posted August 1, 2012 Scriptname BonePerkScript extends ObjectReference Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().AddPerk(BonePerk) Debug.Notification("Bone Harvesting Enabled") endif EndEvent Event OnUnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().RemovePerk(BonePerk) Debug.Notification("Bone Harvesting Disabled") endif EndEvent Perk property BonePerk auto try that Link to comment Share on other sites More sharing options...
Korodic Posted August 1, 2012 Share Posted August 1, 2012 Your original script is best and should work. Did you give "boneperk" a value in the properties window of the objectg you are applying this script to? Do you get any errors? If so then what and what does it say? Link to comment Share on other sites More sharing options...
TDrew Posted August 2, 2012 Author Share Posted August 2, 2012 Ive tried 'if' arguments; it doesnt help. Korodic you are right, my original script looks correct, I should not have to define akActor as the player, according to everything I have read akActor will always be assumed to be the player by default. Okay, so boneperk didnt have a property value assigned, and I assigned it to 'boneperk' the perk. Still nothing. I get no errors, like I said, the script compiles just fine. It has to be something else entirely... what am I missing? Link to comment Share on other sites More sharing options...
steve40 Posted August 2, 2012 Share Posted August 2, 2012 After you assigned the perk to the property, did you remember to save your mod before testing it again? Link to comment Share on other sites More sharing options...
TDrew Posted August 2, 2012 Author Share Posted August 2, 2012 Yes, I have been modding long enough to be wary of that particular mistake. Anyway, dont bother trying to come up with a solution, I just figured out a work-around that doesnt involve scripts. This little foray into Papyrus has been frustrating and unproductive; Im not going to waste another second on scripting now or in the future. Link to comment Share on other sites More sharing options...
Spinner385 Posted August 2, 2012 Share Posted August 2, 2012 Welcome to the wonderful world of papyrus. Where half the functions are broken and you must take three lefts for a right. Link to comment Share on other sites More sharing options...
Recommended Posts