SKKmods Posted April 13, 2024 Share Posted April 13, 2024 I use a lot of quest conditional fils in object finder quests. Using IsInList > FormList to exclude base object forms works fine e.g. MiscObject, Weapon or ActorBase forms. If the FormList is of in game ObjectReferences, they seem to be ignored. Question: has anyone ever successfully used Condition.IsInList with a list of ObjectReferences ? The usecase: quest confitional fill finds all wordspace mapmarkers (GetIsId==Mapmarker that are enabled IsDisabed==0) fine. But needs to exclude a static list of those that are known to have EnableStateParents. There is no known condition or script function to dynamically detect an object has EnableStateParent. Therefore trying to use (IsInList==ListToExclude) but they are still included in the conditional quest fill. Link to comment Share on other sites More sharing options...
LarannKiar Posted April 14, 2024 Share Posted April 14, 2024 I was interested in it too so I checked the code.. In short, it doesn't seem so. Some technical details: - Editor added ("drag and dropped") Forms (including Object References) as well as script added BaseForms are directly held in the FormList's primary internal array (Form array). ( theList.AddForm(PiperRef.GetBaseObject()) would be added to this one for example ). - the Creation Kit flags drag and dropped references persistent so that the game can properly build the Form array during the initialization process - Script added references' RefIDs are held in a secondary array (RefID array). ( theList.AddForm(PiperRef) would be added to this one ). - The function that loops the arrays for the elements just searches the second one for a matching FormID, the first one for a matching Form ( IsInList is technically based on ( if FormList.Find(akForm) >= 0, then return 1.00 )) . - IsInList iterates the RefID array actually but it passes SubjectRef.GetBaseObject to the native Find function ( ) unlike Papyrus' HasForm and Find which passes the reference (thus, they work with references.. at least as long as they're referencable in Papyrus, i.e. loaded or unloaded but persistent) - so, if theFormList would contain "CompanionPiper" [0x2F1E], then it would return 1.00 for Run on: Subject == PiperRef [0x2F1F] - FormList.AddForm( some reference) doesn't cause persistence: - one cannot call theList.HasForm( some unloaded non-persistent reference) even if the FormList's RefID array contains the RefID - "even if the FormList's RefID array contains the RefID" ---> it does, RefIDs don't get cleared: - not even OnUnload, or after Delete() or MarkForDelete.. so the formID gets baked in (the save file...) - AddForm( some IsCreated reference ) could lead to unexpected behavior as the 0xFF RefID might get cleared and remapped (i.e. yesterday it belonged to a "Trader" actor reference from a Random Encounter quest, today it points to a "Vampiric Bloodbug" from another RE quest...). Notes: - IsInList can be called in the console - IsEnableParent, HasEnableParent, GetEnableParent and NumScriptAddedForms ( returns formIDArray.Length ) are in Garden of Eden SE if multiple dependency isn't an issue... - let me know if a function like ( Int[] Function GetScriptAddedFormsIDs(FormList akList) native global ) is of interest Link to comment Share on other sites More sharing options...
SKKmods Posted April 14, 2024 Author Share Posted April 14, 2024 Great core info as usual. In this case the map marker ObjectReferences are all persistent as the global finder quest can find them. The ObjectReferences to exclude are static CK drag n drops into the form list, verified in game with Debug.Trace iteration: SKK_TarkovQuestScript.GenerateEnableStateList 0 [Form < (0009B040)>].IsInList [FormList < (1C01477F)>] SKK_TarkovQuestScript.GenerateEnableStateList 1 [Form < (0010196C)>].IsInList [FormList < (1C01477F)>] SKK_TarkovQuestScript.GenerateEnableStateList 2 [ObjectReference < (0016349B)>].IsInList [FormList < (1C01477F)>] Unfortunatley console [ IsInList ] does not seem to return >> 1.0 for any form types in my games to validate. Appreciate the offer but I cant use any DLL injections Link to comment Share on other sites More sharing options...
Recommended Posts