GrimGus Posted August 24, 2012 Share Posted August 24, 2012 ok basically the plan is once the player takes the base perk, say stealth, as he/she gets skill to 20 the script gives 2nd perk free. later at 40 it give 3rd ect. so i'm thinking the script should be attached to the perk itself. and this is what i have but it's not right. Scriptname aaPerkAgileScr extends Perk event OnStoryIncreaseSkill(lightarmor) if player.hasperk((AgileDefender00) == true) ++ player.hasperk((AgileDefender20) == false) if (player.GetBaseActorValue(lightArmor >= 20) player.addperk(agileDefender20) endif endif endevent basically: if player has base perk but not second, and player is eligible for second, then give player second perk. i think i can elseif the rest or just do them as second scripts if need be. thanks in advance,grim Link to comment Share on other sites More sharing options...
Woverdude Posted August 24, 2012 Share Posted August 24, 2012 I don't know whether it will work while attached to the perk, but I do see a number of errors with your script. First, rather than simply typing "player.function()" you have to use "Game.GetPlayer().function()". Also, Papyrus uses the syntax "&&" rather than "++" for the logical AND operator. Also, you need to declare the perks as Properties. Here is what the script would look like cleaned up: Scriptname aaPerkAgileScr extends Perk Perk Property AgileDefender00 auto Perk Property AgileDefender20 auto Event OnStoryIncreaseSkill(Lightarmor) if Game.GetPlayer().HasPerk((AgileDefender00) == true) && Game.GetPlayer().HasPerk((AgileDefender20) == false) if (Game.GetPlayer().GetBaseActorValue("LightArmor" >= 20) Game.GetPlayer().AddPerk(AgileDefender20) endif endif EndEvent Link to comment Share on other sites More sharing options...
GrimGus Posted August 25, 2012 Author Share Posted August 25, 2012 nice thank you. i thought about it being attached to the perk this morning. i agree i think i need to use an event object. thanks againgrim Link to comment Share on other sites More sharing options...
steve40 Posted August 27, 2012 Share Posted August 27, 2012 That simply won't work. The event "OnStoryIncreaseSkill" is part of the Quest script, so any script that uses that event must extend Quest, and it would have to be attached to a quest that is started by the Story Manager. "OnStoryIncreaseSkill: Event called when this quest is started via an increase level story manager event." The script should be something like this: Scriptname aaPerkAgileScr extends Quest Perk Property AgileDefender00 auto Perk Property AgileDefender20 auto Event OnStoryIncreaseSkill(string asSkill) Actor player = Game.GetPlayer() if asSkill == "LightArmor" && player.HasPerk(AgileDefender00) && !player.HasPerk(AgileDefender20) && player.GetBaseAV("LightArmor") >= 20 player.AddPerk(AgileDefender20) endif EndEvent Here is the link to the Creation Kit Wiki on how to set up the Story Manager to monitor for specific events. I have never used the SM myself, so I can't help you with that. Link to comment Share on other sites More sharing options...
GrimGus Posted August 27, 2012 Author Share Posted August 27, 2012 you are correct it did not work right in game. i've been trying a few different things that also have not work lol. i will try this next Steve40, and tyvm for the aid. Link to comment Share on other sites More sharing options...
Recommended Posts