Jump to content

Adding perks via potions/spells


Recommended Posts

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

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)
EndEvent

But generally, your way ought to work.

Link to comment
Share on other sites

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)

EndEvent

But 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 by WalkerInShadows
Link to comment
Share on other sites

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

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 by WalkerInShadows
Link to comment
Share on other sites

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

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 by WalkerInShadows
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...