Jump to content

Populating MCM AddMenuOptionST with player spells and lesser powers


Recommended Posts

Hi all,

 

I have a mod I made for myself and I fill the AddMenuOptionST() function menu options by equipping spells or weapons and entering the MCM and use GetEquippedSpell() or GetEquippedWeapon() - that's the only method I found when I was making that mod.

 

I am making a new mod now and would love a way to populate a menu option list with all of the spells and lesser powers that a player currently has for use in the MCM AddMenuOptionST() function, but am unaware of another method that would allow for this.

 

Is there something (papyrus extender maybe?) that allows for this without having to go in and out of the MCM? Filling a list of 30 spells can take over 20 times going in and out of the MCM (if some are master spells) and is SO tedious, I would love to save players the anguish - any help would be appreciated!

 

-IA710

 

EDIT: Clarified methods used in current mod

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Hi IsharaMeradin!

 

I believe I remember playing with those when I built the other mod but it missed some spells for some reason - I'll put a function together and try it tonight.

 

Ahhh, looking at the links you provide and it says it leaves out Race spells... I'll play with it and let you know...

 

Thank you so much!

 

-IA710

Link to comment
Share on other sites

Hi!

 

So I started playing with it and realized quickly why I used the method I used in the other mod - here is the function I'm playing with, my issue is how do i dynamically create a SPELL array?

 

SKSE doesn't seem to have a function for it in Utility.pex, and evidently according to my compile errors and the creation kit wiki I can't cast an array AT ALL, anyways, this is what I have... am thinking maybe something other than SKSE allows for dynamically creating large Spell arrays?

 

 

  Reveal hidden contents

 

 

Thank you!!!

 

-IA710

Link to comment
Share on other sites

Hi!

 

Using a Formlist was a good idea, as usual, thank you Ishara.

 

Was poking around in Papyrus Extender and found a function to return all spells in the game from every mod,

 

It has the same issue as GetNthSpell in that it returns spells associated with perks and such.

 

I wish that there was a return cast type function for spells, this would make PO3's solution work for me.

 

There is a mod called Spellcraft Functions SKSE64 that has a function GetSpellCastType() that should work, but it has an SKSE plugin and I don't think that the author is going to update it, although it's open source and the source is on github, I just don't know C.

 

The Papyrus Extender function is PO3_SKSEFunctions.GetAllSpells(abIsPlayable = true) - the abisPlayable filters it to only spells that can be learned from a spell tome.

 

I'm testing using it like this, but it's VERY slow as it's going through every spell in the game + mods.

 

 

  Reveal hidden contents

 

Which ALMOST works right, but it leaves out spells that are added via a quest or some other method.

 

The way I do it with Spellcraft Functions SKSE64 is:

 

 

  Reveal hidden contents

 

 

This works perfectly and is SO much faster. Unfortunately I have no idea if Spellcraft Functions SKSE64 is still being updated :(

 

Really at this point I just need a way to check the cast type of a spell (constant, concentration or Fire and Forget) because then I could ditch the constant spells and keep the rest and just use Papyrus Extender.

 

Any ideas? I'm running out of options and haven't learned papyrus well enough to start trying to learn C on top of it LOL.

 

Thank you Ishara!

 

-IA710

Link to comment
Share on other sites

You could shift the work out of the game. It would be possible to write a script for SSEEdit which would scan all active plugins for spells and assign the ones you want to a designated formlist. Just don't ask me to write such a thing. I do have a similar script (it assigns various items and workstations to formlists) for one of my mods but it was written with a lot of help.

 

Upside is that it will make your mod faster in-game.

 

Downside is that the user would need to run it on their own load order.

 

I do not know C (or any variant) thus cannot help you with regards to the SKSE DLL.

Link to comment
Share on other sites

I have thought of that, and I'm not bad with SSEEdit, I've edited scripts successfully before. You are talking about your Inventory Management mod I'm guessing? I remember you've had me look at it before and I saw that you had a patcher with it, yours is doing a bit more than I would want but that is an option. Limits the audience a bit though.

 

Ugh. I'm reaching out to Yeebb to see if they are interested in either updating Spellcraft Functions SKSE64 or if maybe they are willing, or know someone who is, who could hold my hand and I'll take it over, there are too many functions in that mod that put the fun back in functions to loose it - it's based on Grimy tools/plugin from oldrim.

 

I may just have to go back to the "equip spells enter MCM" method, but after seeing how Spellcraft works I WANT it LOL.

 

Thank you again Ishara. Maybe I won't publish this one. I have a lot of work to do on it regardless, maybe I'll make it with Spellcraft and force myself to learn C LOL. There are some Synthesis patchers I would love to write, so maybe I need to move in that direction. Hmm.

 

The other mpd that I have been working on is below that uses the equip method, it's an auto cast mod based heavily on Smart Cast - I'd be interested in your thoughts on it if you have time to look it over (it's a bit large, at one point I had to start compiling in Notepad++, sorry):

 

 

  Reveal hidden contents

 

 

It runs very fast right now, but any optimizations that you notice would be appreciated, especially on the cast loop.

 

Take care Ishara, and thank you!

 

-IA710

Link to comment
Share on other sites

  • 3 weeks later...

I hate threads that end with no answer, so I've been plugging away at this.

 

The best solution I could come up with was a referencealias script using the game reload event and the OnSpellLearned event added by Papyrus Script Extender. I did this a number of different ways, and probably re-invented the wheel, so be kind. I'm posting the one that requires SKSE, Papyrus Script Extender, and PapyrusUtil, but I did this using JContainers too, but it wasn't the fastest in my testing (but it's JMap feature was so easy to use, it typically took 50% longer than PapyrusUtil, and was faster than using formlists).

 

Any suggestions are welcome.

 

 

  Reveal hidden contents

 

 

It takes about 30 seconds for the big function to run on game reload, but the spell learned event is almost instant.

 

Thank you all!

 

-IA710

Link to comment
Share on other sites

I know a few tricks to get niche things done but ADD is high so if you are stuck on something just clarify A) The point of the mod and B) The exact roadblock that is interfering with a goal

 

With MCM mods its handy to set options with FormIDs as String. If state is interacted with, and its a spell state, you can do GetFormEx of that State as Int as Spell. Stuff like that can cut down massive swarms of script bulkage. Just depends what you are specifically aiming to accomplish

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...