Hey there, I've two questions and I hope someone has the time to give me a response. :smile: First of all, I would like to change the faction of various creatures via script (so I don't have to add the base records into my own mod), but "SetFactionRank" only accepts references, but no base records. Even if I save a base record into a reference variable it doesn't work. :sad: So is there any way to add creatures into a faction, but by using it's base record as reference? Second thing are the functions NameIncludes and CompareName. Both functions are present in OBSE (which is hilarious, as they do the same), but none of them is in NVSE or JIP available. :sad: Is there any equivalent for that command? It's very useful as for asking about a special part of a string for example. My current solution to add creatures to respective factions is to use GetFirstRef and GetNextRef and then using GetModelPath. This works pretty well so far, but I have to compare the whole model path. For example:
string_var strCreaModelPath
Ref CreaRef
[...]
Begin GameMode
Set CreaRef to GetFirstRef 43 1 0
While CreaRef != 0
Set iCompare to -2
Set strCreaModelPath to CreaRef.GetModelPath
Set iCompare to sv_compare "Creatures\Dog\Skeleton.nif", strCreaModelPath
if iCompare == 0
[... Set CreatureRef as part of a specific faction.]
Endif
Set CreaRef to GetNextRef
Loop
[...]
EndIt would be much easier to use NameIncludes for searching just for "Dog", instead of the whole path, even though it already works in that case either (I don't know if NameIncludes would have more performance impact than comparing the whole string with the expected model path. But one for sure: If I have one letter wrong in the comparison string, it won't work. So using "NameIncludes" would be much, much easier). However, I would prefer a function with which I easily can add new factions to a base record, without having the need of a reference, but direcly accessing the base record of said creature. Since I could spare that whole scanning for creature references nearby the player, which has a performance impact. :sad: Furthermore with the scanning, I've to check for special creatures by asking for the BaseObject and comparing the EditorID of the base object then, since not EVERY creature with the dog model should be added to the faction. Which is an additional impact on the performance in such a loop. :sad: I appreciate any help. :smile: Cheers