TheWhispers Posted November 6, 2019 Share Posted November 6, 2019 (edited) Consider this function:https://www.creationkit.com/index.php?title=FindClosestReferenceOfAnyTypeInListFromRef_-_Game I understand that this returns the closest ObjectReference of any type from within a FormList, using another ObjectReference as the center, and the last function parameter to use as a radius. My interpretation of the "any type" part means that I could for example: Made a FormList in CK Put a single random WorldObject within the FormList of type Tree - TREE Put a single random WorldObject within the FormList of type Furniture - FURNI could then autofill this FormList as a property in my script to call upon it in my script From then I could do: Game.FindClosestReferenceOfAnyTypeInListFromRef(MySpecialFormList, PlayerRef, 25.0) ;Yes I know this is 25 unit radius I could then expect the function to return the closest ObjectReference that matches one of the TYPES specified in the FormList, Is this correct? This is where everything gets fuzzy for me. My interpretation here is that I can just put a few single random objects of different TYPES that I want the function to pick up, since I don't care about what specific object, just that it matches the type of at least one of the Forms specified in the FormList. Can someone here shed some light on this papyrus function? When I tried testing this theory it just returns None, even if I'm as close to the ObjectReference in-game as I can be. Update: This function just simply will pick the closest ObjectReference, testing every Form in the FormList, regardless of it's type. Edited November 6, 2019 by TheWhispers Link to comment Share on other sites More sharing options...
TheWhispers Posted November 6, 2019 Author Share Posted November 6, 2019 Does anyone know if this function works on Base Objects of GRAS - Grass types? It doesn't seem like I can get a script to even acknowledge Grasses. Link to comment Share on other sites More sharing options...
doticu Posted November 7, 2019 Share Posted November 7, 2019 Consider this function:https://www.creationkit.com/index.php?title=FindClosestReferenceOfAnyTypeInListFromRef_-_Game I understand that this returns the closest ObjectReference of any type from within a FormList, using another ObjectReference as the center, and the last function parameter to use as a radius. My interpretation of the "any type" part means that I could for example: Made a FormList in CK Put a single random WorldObject within the FormList of type Tree - TREE Put a single random WorldObject within the FormList of type Furniture - FURNI could then autofill this FormList as a property in my script to call upon it in my script From then I could do: Game.FindClosestReferenceOfAnyTypeInListFromRef(MySpecialFormList, PlayerRef, 25.0) ;Yes I know this is 25 unit radius I could then expect the function to return the closest ObjectReference that matches one of the TYPES specified in the FormList, Is this correct? This is where everything gets fuzzy for me. My interpretation here is that I can just put a few single random objects of different TYPES that I want the function to pick up, since I don't care about what specific object, just that it matches the type of at least one of the Forms specified in the FormList. Can someone here shed some light on this papyrus function? When I tried testing this theory it just returns None, even if I'm as close to the ObjectReference in-game as I can be. Update: This function just simply will pick the closest ObjectReference, testing every Form in the FormList, regardless of it's type. Reading the description here, it seems to me that it basically takes a list of object bases (i.e. "types", "classes") and finds any of their object references (i.e. "objects", "instances") within the parameters. So just taking any random grass base and expecting it to find any grass reference in the game is not correct. It will only find instances of that particular grass. If you did want to find any grass reference, you would simply need to include all base grass objects in your list. Your function may not be picking up any grass even when right next to it, because that grass's base object is not in the specified list. Link to comment Share on other sites More sharing options...
TheWhispers Posted November 7, 2019 Author Share Posted November 7, 2019 Consider this function:https://www.creationkit.com/index.php?title=FindClosestReferenceOfAnyTypeInListFromRef_-_Game I understand that this returns the closest ObjectReference of any type from within a FormList, using another ObjectReference as the center, and the last function parameter to use as a radius. My interpretation of the "any type" part means that I could for example: Made a FormList in CK Put a single random WorldObject within the FormList of type Tree - TREE Put a single random WorldObject within the FormList of type Furniture - FURNI could then autofill this FormList as a property in my script to call upon it in my script From then I could do: Game.FindClosestReferenceOfAnyTypeInListFromRef(MySpecialFormList, PlayerRef, 25.0) ;Yes I know this is 25 unit radius I could then expect the function to return the closest ObjectReference that matches one of the TYPES specified in the FormList, Is this correct? This is where everything gets fuzzy for me. My interpretation here is that I can just put a few single random objects of different TYPES that I want the function to pick up, since I don't care about what specific object, just that it matches the type of at least one of the Forms specified in the FormList. Can someone here shed some light on this papyrus function? When I tried testing this theory it just returns None, even if I'm as close to the ObjectReference in-game as I can be. Update: This function just simply will pick the closest ObjectReference, testing every Form in the FormList, regardless of it's type. Reading the description here, it seems to me that it basically takes a list of object bases (i.e. "types", "classes") and finds any of their object references (i.e. "objects", "instances") within the parameters. So just taking any random grass base and expecting it to find any grass reference in the game is not correct. It will only find instances of that particular grass. If you did want to find any grass reference, you would simply need to include all base grass objects in your list. Your function may not be picking up any grass even when right next to it, because that grass's base object is not in the specified list. Thanks for helping me out man. I currently am using Skyrim Flora Overhaul. So I added every grass in the base game to my FormList within my own esp and also all of SFOs Grasses into the FormList. I'm gonna see if it works, I'm really hoping I can read grasses. Link to comment Share on other sites More sharing options...
doticu Posted November 7, 2019 Share Posted November 7, 2019 Thanks for helping me out man. I currently am using Skyrim Flora Overhaul. So I added every grass in the base game to my FormList within my own esp and also all of SFOs Grasses into the FormList. I'm gonna see if it works, I'm really hoping I can read grasses. Sure thing, I hope that helped you out. Do let us know! Link to comment Share on other sites More sharing options...
Evangela Posted November 10, 2019 Share Posted November 10, 2019 It goes through the list and returns the closest reference to the player from that list. Link to comment Share on other sites More sharing options...
Recommended Posts