Seattleite Posted July 30, 2016 Share Posted July 30, 2016 (edited) I need a script made for my overhaul mod to be fully ready for release. There's only one problem... I don't know papyrus. I don't even know where the button is in the CK to edit scripts, much less the new code. So, here's the code as it would have appeared in beth script (largely lifted from a F:NV script with the same purpose). SCN BasePerksScript ref currentactor ref numactors begin gamemode set numactors to getnumrefs 200 1 0 if(numactors > 0) set currentactor to getfirstref 200 1 0 label 10 if(currentactor) if(currentactor.isspelltarget BasePerksDone) else currentactor.addspell BasePerksDone currentactor.addperk Bladesman30 currentactor.addperk BoneBreaker30 currentactor.addperk HackAndSlash30 currentactor.addperk LimbSplitter30 currentactor.addperk SkullCrusher30 currentactor.addperk DeepWounds30 currentactor.addperk CriticalShot30 endif set currentactor to Broom01 set currentactor to getnextref set numactors to numactors - 1 if(numactors > 0) goto 10 endif endif endif end ; gamemode The purpose of this script is to distribute an ability and a set of perks to everything around the player, and the player themselves, in order to assure that these affects would always be present. Specifically, this is to ensure that blades and bows always have the ability to score crits, axes always have the ability to cause bleed and both maces and hammers have the ability to penetrate armour right from the beginning, making them meaningfully different from the start. It also distributes a meaningless ability that gives +0 carry weight to mark each target as having received the perks. So, can I get a script made in papyrus that will actually do this in Skyrim? All I need is the script, the mod is made already and everything else is all ready to go. Edited July 30, 2016 by Seattleite Link to comment Share on other sites More sharing options...
Fantafaust Posted July 30, 2016 Share Posted July 30, 2016 Ah, so you want a cloak spell that gives these perks.First you'll need to make a cloak spell, and instead of damage it uses a magic effect that runs a script that looks more like this: Event OnEffectStart(actor akTarget, actor akCaster) if !akTarget.HasSpell(BasePerksDone) akTarget.addspell BasePerksDone akTarget.addperk Bladesman30 akTarget.addperk BoneBreaker30 akTarget.addperk HackAndSlash30 akTarget.addperk LimbSplitter30 akTarget.addperk SkullCrusher30 akTarget.addperk DeepWounds30 akTarget.addperk CriticalShot30 EndIf EndEvent Link to comment Share on other sites More sharing options...
lofgren Posted July 30, 2016 Share Posted July 30, 2016 Unfortunately perks cannot be added to NPCs through scripts. Link to comment Share on other sites More sharing options...
Seattleite Posted July 30, 2016 Author Share Posted July 30, 2016 Ah, so you want a cloak spell that gives these perks. First you'll need to make a cloak spell, and instead of damage it uses a magic effect that runs a script that looks more like this: Event OnEffectStart(actor akTarget, actor akCaster) if !akTarget.HasSpell(BasePerksDone) akTarget.addspell BasePerksDone akTarget.addperk Bladesman30 akTarget.addperk BoneBreaker30 akTarget.addperk HackAndSlash30 akTarget.addperk LimbSplitter30 akTarget.addperk SkullCrusher30 akTarget.addperk DeepWounds30 akTarget.addperk CriticalShot30 EndIf EndEvent Well, originally it wasn't a cloak, it was a quest script, and the quest was in NV (and gave different spells and perks), and initiated immediately after leaving Doc Mitchell's house, serving no purpose but to continually apply that script and make sure everything had the spells and perks in question. I was hoping to do the same here, but I guess the cloak spell also works. Link to comment Share on other sites More sharing options...
Seattleite Posted July 30, 2016 Author Share Posted July 30, 2016 (edited) Starting 1 compile threads for 1 files...Compiling "BasePerksApplyScript"...<unknown>(0,0): Unable to find flags file: TESV_Papyrus_Flags.flgc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(1,40): missing ID at '\\r\\n'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(5,11): no viable alternative at input 'addspell'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(6,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(7,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(8,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(9,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(10,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(11,11): no viable alternative at input 'addperk'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\BasePerksApplyScript.psc(12,11): no viable alternative at input 'addperk'No output generated for BasePerksApplyScript.psc, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on BasePerksApplyScript.psc ...And now the creation kit doesn't work at all. f*** IT! Final version's the current version. Going to go get drunk and release the mod, in that order. Edited July 30, 2016 by Seattleite Link to comment Share on other sites More sharing options...
lofgren Posted July 30, 2016 Share Posted July 30, 2016 It doesn't matter if it won't compile because perks cannot be added to NPCs by script. Link to comment Share on other sites More sharing options...
Fantafaust Posted July 30, 2016 Share Posted July 30, 2016 It doesn't matter if it won't compile because perks cannot be added to NPCs by script.Dang, really? I guess I've never actually tried it before so I didn't know Link to comment Share on other sites More sharing options...
lofgren Posted July 30, 2016 Share Posted July 30, 2016 Unfortunately. The SKSE team looked into fixing it but either never figured it out or it was too much work. The only way to add perks to NPCs is to add them to the actor base in a plugin. That's why mods that add perks to NPCs use patcher programs. Link to comment Share on other sites More sharing options...
Seattleite Posted July 30, 2016 Author Share Posted July 30, 2016 You know, I could have assigned these perks to a spell effect and given that spell effect to the NPCs through the script, bypassing that little issue. Link to comment Share on other sites More sharing options...
lofgren Posted July 30, 2016 Share Posted July 30, 2016 Doesn't work either. Link to comment Share on other sites More sharing options...
Recommended Posts