blacklionisd Posted December 20, 2012 Share Posted December 20, 2012 Hi, Since beginning of the week, I have worked with Creation Kit (for Skyrim).My target is to get a follower who gains perks and spell as the game (and player level) progresses. Essentially one part is some kind of "AutoPerk" for the follower, a bit like perks in Oblivion worked (and a plugin works I use for some time). So I created an actor, defined him as follower. (Almost) everything works well with one exception: it seems the engine does not let me add perks to an actor which is not the player.I currently use following function: int Function MPMPerk(Perk awPerk,string awPerkName) if !Self.HasPerk(awPerk) if(Self.AddPerk(awPerk)) if(MPMdebug) Debug.Notification("NPC gains "+awPerkName+" perk!") endif else if(MPMdebug) Debug.Notification("NPC failed to set "+awPerkName+" perk!") endif endif endif endFunction This one is called by an event (I use OnLocationChange). All suitable perks are defined as Properties an the function called with the specific perk and a string with it's name.MPMdebug is defined as boolean property and usually on true during my testing phase. E.G. MPMPerk(Rage,"Rage) should add the "Rage" perk from Skyrims Illusion tree.As it is, I get the "Failed" message every time the Actor is changing its location. The thing is: The whole thing does work for self.AddSpell ... (it is essentially another script with the same function but AddSpell than AddPerk and of course Spell - Defines). Does anyone has a clue? I really don't want to give the actor all perks at the beginning, as the actor will be overpowered in early level in that way... By the way: - Does anyone know how to get the actual name of a perk (or name of an actor) within Papyrus script as string?- Do I have to define Perks within the script (Perk property Rage auto for example) just to connect the outside of the script? Autofill does the trick however it seems a bit redundant... I have checked Google sources and Creation Kit wiki, but especially the last one does not really cover that aspect very much. Link to comment Share on other sites More sharing options...
DreamKingMods Posted December 20, 2012 Share Posted December 20, 2012 AddPerk only works for the player--the Creation Kit wiki page for it does say that it doesn't work for NPCs. And yes, to connect to perks, spells, etc., you need to use properties. The only way I can think of to do what you want is to create a bunch of custom perks, assign them all to the follower in their Actor record, and in each perk, add conditions to the entry point so that the perk is only effective when you want it to be. So for example you could create a "MPMRage" perk that does just what the vanilla "Rage" perk does, but is conditioned in its entry point to only be in effect when the caster's Illusion skill is >= 70. That, or don't use perks, but use spells instead to grant the same effects as the perks would. Link to comment Share on other sites More sharing options...
blacklionisd Posted December 20, 2012 Author Share Posted December 20, 2012 AddPerk only works for the player--the Creation Kit wiki page for it does say that it doesn't work for NPCs. And yes, to connect to perks, spells, etc., you need to use properties. The only way I can think of to do what you want is to create a bunch of custom perks, assign them all to the follower in their Actor record, and in each perk, add conditions to the entry point so that the perk is only effective when you want it to be. So for example you could create a "MPMRage" perk that does just what the vanilla "Rage" perk does, but is conditioned in its entry point to only be in effect when the caster's Illusion skill is >= 70. That, or don't use perks, but use spells instead to grant the same effects as the perks would. I must have been blind to oversee the note there. Thank you very much for the response!Both your options sound perfectly viable. Spells as "Abilities" would be scriptable (and therefore more generic than adding perks to each character).Thanks for your prompt help! Link to comment Share on other sites More sharing options...
Recommended Posts