Dreagar Posted September 11, 2012 Share Posted September 11, 2012 I'm working on a vampirism overhaul mod, and one of the targets/goals I've set myself is that NPCs can contract the new form of vampirism and feel it's effects, eg dying from lack of blood. The problem is that in order to do the whole vampire feeding thing, I have to use perks. And that prevents me from accessing the blood amounts stored in the vampirism MagicEffect script on the actor. (I've redone feeding, it works on a "blood level" system, as opposed to time, the variables for it being stored in the script instances for each vampire.) So, is it possible to get an instance of a MagicEffect from a given actor, knowing the base class for said effect?Thanks in advanced guys. Link to comment Share on other sites More sharing options...
Dreagar Posted September 12, 2012 Author Share Posted September 12, 2012 (edited) I really can't find an answer other than creating an array of all script instances and cycling through it to find the one for an NPC. There has to be a better way. Edited April 14, 2014 by Dreagar Link to comment Share on other sites More sharing options...
Dreagar Posted September 12, 2012 Author Share Posted September 12, 2012 (edited) At least give me a confirmed no, guys. This is an important issue and a few hours googling seems to show I'm a unique case. Edited April 14, 2014 by Dreagar Link to comment Share on other sites More sharing options...
Cipscis Posted September 12, 2012 Share Posted September 12, 2012 I don't think you can do that, no, but there are other methods you could use. For example, you could store the value via tokens (unplayable, therefore invisible, pieces of armour) in their inventory. Cipscis Link to comment Share on other sites More sharing options...
Dreagar Posted September 13, 2012 Author Share Posted September 13, 2012 (edited) I don't think you can do that, no, but there are other methods you could use. For example, you could store the value via tokens (unplayable, therefore invisible, pieces of armour) in their inventory. Cipscis Hmm, that might come in useful for another system, but sadly tokens can only hold so many values, so I'm sticking with a custom ArrayList system that script instances register themselves to, and are tracked from there. It should work as long as I don't need more than 128 vampire instances. Thanks for the help anyways!Also, could a mod lock or delete this? Edited April 14, 2014 by Dreagar Link to comment Share on other sites More sharing options...
Recommended Posts