vidalia Posted July 28, 2012 Share Posted July 28, 2012 I need some help in creating a custom spell which has a different effect based on the total number of enemies in the vicinity of the player - if the number of enemies is less than 3 it casts targeted style damage. However if the number of enemies exceeds 3 I want to cast an AOE style damage. To switch the effects i need to find the total number of enemies within a specified radius of the player. Is there a way to do so via papyrus? Any help in this regard would be appreciated. Link to comment Share on other sites More sharing options...
Spinner385 Posted July 29, 2012 Share Posted July 29, 2012 You could try the FindRandomActorFromRef function then test its return value for hostility. While keeping track of the form returned so not to count the same actor twice. Depending on the random is not the best idea though. FindClosestReferenceOfAnyTypeInListFromRef sounds promising but i think if you found one then removed it from the form list another of the same base type wouldn't be counted. If you could figure out how to eliminate actors (particular ref not base type) already found FindClosestActorFromRef would be a better choice. Beyond my knowledge though. Until you can get some better help the random actor thing should work but very inefficient. Link to comment Share on other sites More sharing options...
vidalia Posted July 31, 2012 Author Share Posted July 31, 2012 You could try the FindRandomActorFromRef function then test its return value for hostility. While keeping track of the form returned so not to count the same actor twice. Depending on the random is not the best idea though. FindClosestReferenceOfAnyTypeInListFromRef sounds promising but i think if you found one then removed it from the form list another of the same base type wouldn't be counted. If you could figure out how to eliminate actors (particular ref not base type) already found FindClosestActorFromRef would be a better choice. Beyond my knowledge though. Until you can get some better help the random actor thing should work but very inefficient. Thanks for the response. However I am currently working on a different approach - taking the idea from here http://www.creationkit.com/Dynamically_Attaching_Scripts. Basically create 2 spells - one that tags and counts enemies via a cloak archetype and another spell for the actual effect. Still working on resolving some issues with the state variables to make these spells work in tandem. Link to comment Share on other sites More sharing options...
Recommended Posts