rkkn Posted May 30, 2021 Share Posted May 30, 2021 I only see ways to dispel spells. How does one go about removing potion effects? It'd be a lot easier if I could just remove magic effects directly, but I don't see a way to do that either. No way that I see to gain access to the ActiveMagicEffects on an actor in order to use ActiveMagicEffect.Dispel() Link to comment Share on other sites More sharing options...
xkkmEl Posted May 30, 2021 Share Posted May 30, 2021 I don't see any way to achieve this for vanilla effects either, but you can make it work for scripted effects, by modifying the script. You can have the script detect the termination condition and dispel itself, or self-register in some global property or array that can be accessed by your termination code. Prolly not what you are looking for... Link to comment Share on other sites More sharing options...
rkkn Posted May 30, 2021 Author Share Posted May 30, 2021 (edited) yeah, I'm trying to make this generic, so that it works on all potions that meet the criteria, whether they're vanilla or added by someone else's mod. (I'm not actually adding any potions myself) well, what I'm actually trying to do is block the use of a category of potions for a time. I thought I'd do that by detecting the use in an OnObjectEquipped event and then refunding the item and then removing the effects it applied. seemed simple enough, but the latter part seems strangely impossible for how simple a task it is Edited May 30, 2021 by rkkn Link to comment Share on other sites More sharing options...
xkkmEl Posted May 31, 2021 Share Posted May 31, 2021 There are undocumented functions within SKSE. You might find something if you look through the C++ source code. Link to comment Share on other sites More sharing options...
rkkn Posted June 1, 2021 Author Share Posted June 1, 2021 There are undocumented functions within SKSE. You might find something if you look through the C++ source code.Oh! I had no idea.So there are. It's not compiled by default, but GetNumActiveEffects and GetNthActiveEffect are in there.I wonder why they are excluded. I hope they aren't bugged. Link to comment Share on other sites More sharing options...
xkkmEl Posted June 2, 2021 Share Posted June 2, 2021 I bumped into undocumented SKSE function when investigating vendor faction data. In that case, many of the functions were broken because of poor assumptions in the data format (endianness) and cut&paste omissions. If the functions are broken, it may not be all that hard to fix them. Good luck, and please share if you have success!! Link to comment Share on other sites More sharing options...
Recommended Posts