Im making a mod that allows the player to use certain spells depending on what they have equipped. for example if you have a 1 handed weapon and an empty hand you will be given access to certain powers. if you change to having a 2 handed weapon you will be excluded from using the 1 hand/ empty hand powers but will have access to a separate set of powers exclusively for 2 handed weapons. I already figured out a way to do this but Im not sure its ideal. What i did was create a lesser power, that, when activated grants the effects i want. in the effect list i set conditions that use GetEquippedItemType. this does work as expected but im wondering is there a better way to do this?
How to make spells that are only available depending on equipped weapon type?
Posted 12 August 2020 - 10:27 PM
Posted 13 August 2020 - 08:24 AM
I probably would have gone the route you have gone too. If it works... go with it
What other ways were you thinking about?
Posted 13 August 2020 - 09:18 AM
I was thinking of using perks, but the thing is I really have no idea how perks work. ive seen some tutorials on perks but theyre all related to adding stuff to skill trees. i dont want to modify the skill trees at all.
Posted 13 August 2020 - 10:16 AM
Pretty sure you can do this as a perk. There are conditions for weapons, perk owner and target.
Take a look at crFalmerPoison. Double click the perk entry and you'll see the spell and the condition that the weapon being used must have weapon material Falmer or FalmerHoned
Your conditions will work here just like the way you did it, but probably in the perk owner tab.
Posted 13 August 2020 - 05:50 PM
Posted 13 August 2020 - 06:16 PM
OK it looks like perks are gonna allow me to do everything I want to do. the question is how do I actually add perks to the player without using skill trees? if possible i'd like to leave the skill tree completely untouched
Posted 13 August 2020 - 06:54 PM
Can use a quest script and then Game.GetPlayer().AddPerk() in Event OnInit()
I think a non scripted was is to add an ability that can apply a perk.
Edited by Rasikko, 13 August 2020 - 06:56 PM.
Posted 14 August 2020 - 11:19 AM
I think the idea of using the 'Perk To Apply' in a magic effect is a really good one. It's certainly used in vanilla, so it works. I just did a bit of digging around and this is exactly how 'Sinderion's Serendipity' works, as an example for the OP. (Search NN01 in spells, magic effects and perks to see how it's done). The ability spell uses the magic effect and the 'Perk To Apply' in that is the actual perk to make twice as many potions with a 25% chance.
Posted 14 August 2020 - 05:25 PM
Ok that really eliminates the need for a script at all, since you can just use a quest that adds the ability from the alias. I'll be sticking to that from now on when adding perks.
Edited by Rasikko, 14 August 2020 - 05:25 PM.
Posted 14 August 2020 - 07:02 PM
I wouldn't have thought of looking if you hadn't suggested adding a perk from an ability.
It's certainly what I'll be doing now.