WalkerInShadows Posted January 7, 2023 Share Posted January 7, 2023 I want to know if it's possible to add perks by drinking a potion (magic effect). Here's the script I've got: Scriptname AlchemyRedoneAddPerkAlch00 extends ActiveMagicEffect Perk property Alchemist00AlchemyRedone auto Event OnEffectStart(Actor akTarget, Actor akCaster) Game.GetPlayer().AddPerk(Alchemist00AlchemyRedone) EndEvent But it won't compile. Did I do something wrong, or does it just not work? If the latter, what are ways to add perks? I've also got another question: I've successfully written a script to add perks by reading a book. I've got four different perks, each of which requires the previous one; is there a way to put them all into the same script, like: Scriptname AlchemyRedoneAddPerkExp extends ObjectReference Perk property Experimenter30AlchemyRedone auto Perk property Experimenter50AlchemyRedone auto Perk property Experimenter70AlchemyRedone auto Perk property Experimenter90AlchemyRedone auto Bool Exp30 = False Bool Exp50 = False Bool Exp70 = False Bool Exp90 = False Event OnRead() Game.GetPlayer().AddPerk() EndEvent FunctionAddPerk() if Exp30 = False Game.GetPlayer().AddPerk(Experimenter30AlchemyRedone) Exp30 = True elseif Exp50 = False Game.GetPlayer().AddPerk(Experimenter50AlchemyRedone) Exp50 = True elseif Exp70 = False Game.GetPlayer().AddPerk(Experimenter70AlchemyRedone) Exp70 = True elseif Exp90 = False Game.GetPlayer().AddPerk(Experimenter90AlchemyRedone) Exp90 = True endif EndFunction Link to comment Share on other sites More sharing options...
7531Leonidas Posted January 8, 2023 Share Posted January 8, 2023 There is currently a mod that gives you perk points for eating its dragon hearts, that might have the system you seek. I also saw a mod that did something similar with another mechanic, didn't pay much attention, sorry. Might give you a place to ask. Link to comment Share on other sites More sharing options...
Tlam99 Posted January 8, 2023 Share Posted January 8, 2023 If you look at your scripts you find the answer.You mod an objectreference, not a magical effect.Use onmagicaleffectapply, this attaches to objectreference. Link to comment Share on other sites More sharing options...
scorrp10 Posted January 8, 2023 Share Posted January 8, 2023 In your first script, what error do you get when it does not compile? I would do it this way:Scriptname AlchemyRedoneAddPerkAlch00 extends ActiveMagicEffect Perk property Alchemist00AlchemyRedone auto Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.AddPerk(Alchemist00AlchemyRedone)EndEventBut generally, your way ought to work. Link to comment Share on other sites More sharing options...
WalkerInShadows Posted January 10, 2023 Author Share Posted January 10, 2023 (edited) There is currently a mod that gives you perk points for eating its dragon hearts, that might have the system you seek. I also saw a mod that did something similar with another mechanic, didn't pay much attention, sorry. Might give you a place to ask.You mean this one? I couldn't find any for dragon hearts. In your first script, what error do you get when it does not compile? I would do it this way:Scriptname AlchemyRedoneAddPerkAlch00 extends ActiveMagicEffect Perk property Alchemist00AlchemyRedone auto Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.AddPerk(Alchemist00AlchemyRedone)EndEventBut generally, your way ought to work. I couldn't figure out how to find the errors. I'm familiar with Oblivion scripting, but I'm wrapping my head around Skryim. (Edit: I should note that I'm using SSEScript for this; it's easier than using the CK.) Thanks, I'll try that. Edited January 10, 2023 by WalkerInShadows Link to comment Share on other sites More sharing options...
scorrp10 Posted January 10, 2023 Share Posted January 10, 2023 I am using CK SSE, with the bug fixes and multi-master patch. Makes it real fast and very stable. Gameplay menu - Papyrusa script manager - and I can filter through any scripts, right-click and choose 'Compile' and it immediately tells me if there are errors and what they are. I use Netbeans for actual script editing, and double-clicking a script in manager opens it in Netbeans. Also, when attaching scripts to forms, makes it real easy to inspect and assign properties. I am not familiar with SSEScript, but I find CK workflow real easy. Link to comment Share on other sites More sharing options...
7531Leonidas Posted January 11, 2023 Share Posted January 11, 2023 Sorry, the mod I use is Daken's Yummy Dragon Hearts ( https://www.nexusmods.com/skyrimspecialedition/mods/57940 ), which itself was similar to a mod from Bethesda. The dragon souls to perks mod may well have been the other one I saw, I did not pay much attention, as I was already getting what I wanted from the Dragon Hearts mod. Link to comment Share on other sites More sharing options...
WalkerInShadows Posted January 11, 2023 Author Share Posted January 11, 2023 (edited) Sorry, the mod I use is Daken's Yummy Dragon Hearts ( https://www.nexusmods.com/skyrimspecialedition/mods/57940 ), which itself was similar to a mod from Bethesda. The dragon souls to perks mod may well have been the other one I saw, I did not pay much attention, as I was already getting what I wanted from the Dragon Hearts mod.There are several mods that do that, but they're all perk points, not actual perks. Unfortunately, SSE Script doesn't read scripts without the source, and none of them have script source. I am using CK SSE, with the bug fixes and multi-master patch. Makes it real fast and very stable. Gameplay menu - Papyrusa script manager - and I can filter through any scripts, right-click and choose 'Compile' and it immediately tells me if there are errors and what they are. I use Netbeans for actual script editing, and double-clicking a script in manager opens it in Netbeans. Also, when attaching scripts to forms, makes it real easy to inspect and assign properties. I am not familiar with SSEScript, but I find CK workflow real easy. I can't figure out how to create/edit scripts in the CK, or I'd just use that. :sad: (Edit: n/m, I'm an idiot. It's in the same place as the Oblivion CS. I don't know how I missed it. Aaaand, it still doesn't work - it says it can't find the psc files, even though they're there. I even tried copying to the Souce folder. I hate the CK.) Edit: I also tried your version of the script, but it didn't work either. I even tried using OnMagicalEffectApply. No dice. Edited January 11, 2023 by WalkerInShadows Link to comment Share on other sites More sharing options...
scorrp10 Posted January 11, 2023 Share Posted January 11, 2023 In Skyrim SE, CK looks for source code files (.psc) in Data/Source/Scripts, and compiled scripts (.pex) go to Data/Scripts. I think in LE, source was expected in Data/Scripts/Source. Many mods out there still tend to place their source that way.Be sure to unzip Scripts.zip in your Data - it will populate a lot of library scripts in Source/scripts.If doing anything MCM-related, you will also need to download source code libraries for SkyUI at their github: https://github.com/schlangster/skyui Link to comment Share on other sites More sharing options...
WalkerInShadows Posted January 12, 2023 Author Share Posted January 12, 2023 (edited) Yeah, I think it's because I'm converting an LE mod. I ended up just creating a new script, and it seems to have worked - it didn't throw any errors. Yay! As for this script... well, I've still got issues. I know I'm doing something wrong, but I'm not quite sure what, and the CK won't tell me. Scriptname AlchemyRedoneAddPerkExp extends ObjectReference Perk property Experimenter30AlchemyRedone auto Perk property Experimenter50AlchemyRedone auto Perk property Experimenter70AlchemyRedone auto Perk property Experimenter90AlchemyRedone auto Bool Exp30 = False Bool Exp50 = False Bool Exp70 = False Bool Exp90 = False Event OnRead() Game.GetPlayer().AddPerk() EndEvent FunctionAddPerk() if Exp30 = False Game.GetPlayer().AddPerk(Experimenter30AlchemyRedone) Exp30 = True elseif Exp50 = False Game.GetPlayer().AddPerk(Experimenter50AlchemyRedone) Exp50 = True elseif Exp70 = False Game.GetPlayer().AddPerk(Experimenter70AlchemyRedone) Exp70 = True elseif Exp90 = False Game.GetPlayer().AddPerk(Experimenter90AlchemyRedone) Exp90 = True endif EndFunction Edited January 12, 2023 by WalkerInShadows Link to comment Share on other sites More sharing options...
Recommended Posts