dagobaking Posted April 15, 2018 Share Posted April 15, 2018 I realize that I could make a long list of targeted Factions and iterate through a bunch of "IsInFaction" requests. But, I worry about the performance of that. Isn't there some way to efficiently get a list of the Factions that an Actor is in? Link to comment Share on other sites More sharing options...
shatsnazzle Posted April 16, 2018 Share Posted April 16, 2018 I saw this in the SKSE section, maybe F4SE has a similar function. https://www.creationkit.com/index.php?title=GetFactions_-_Actor Link to comment Share on other sites More sharing options...
FlashyJoer Posted April 16, 2018 Share Posted April 16, 2018 (edited) Off the top of my head, the only thing I can think of is to create a formlist of all of the usual factions and then run a While/Endwhile loop on it with a check in the middle that says... actually easier this way. FactionsFormList = a formlist in the CK with all of the factions you want to check against.PlayerFactions = a script level array of factions the player is in Int j = 0While (j < FactionsFormList.length) If PlayerREF.IsInFaction(FactionsFormList[j]) PlayerFactions.Add(FactionsFormList[j]) Endif J +=1EndWhile Of course, you'd need to define these in the script and also initialize the arrays, but thats easy enough... Edited April 16, 2018 by joerqc Link to comment Share on other sites More sharing options...
dagobaking Posted April 16, 2018 Author Share Posted April 16, 2018 I saw this in the SKSE section, maybe F4SE has a similar function. https://www.creationkit.com/index.php?title=GetFactions_-_Actor That would do it. I think I'll explore some options first. But, might be able to request it... Off the top of my head, the only thing I can think of is to create a formlist of all of the usual factions and then run a While/Endwhile loop on it with a check in the middle that says... actually easier this way. FactionsFormList = a formlist in the CK with all of the factions you want to check against.PlayerFactions = a script level array of factions the player is in Int j = 0While (j < FactionsFormList.length) If PlayerREF.IsInFaction(FactionsFormList[j]) PlayerFactions.Add(FactionsFormList[j]) Endif J +=1EndWhile Of course, you'd need to define these in the script and also initialize the arrays, but thats easy enough... Thank you. The trouble is that it's an operation that will likely have to be run quite a bit. So, I don't want to do a loop on 20 items to pull 2 items. It could add up to a performance issue. Link to comment Share on other sites More sharing options...
Reginald001 Posted April 16, 2018 Share Posted April 16, 2018 (edited) I've been looking into this as well. But it looks like all faction stuff is single instance based (e.g. check 1 faction for any one method or object) forcing you to reiterate.. The only 'set' or array based command I could find was IsFactionInCrimeGroup, but that still doesn't really help. I also couldn't find a faction event that you might be able to hook into. Using a refcollection might speed up the process though: https://www.creationkit.com/fallout4/index.php?title=RefCollectionAlias_Script What you could do is make a deferred routine, filling up your own array/version of the truth.You can do that by for instance, hooking into CA_NewLocation event, then checking for all factions (deferred in the background) so that this info is ready when you need it. Edited April 16, 2018 by Reginald001 Link to comment Share on other sites More sharing options...
Recommended Posts