Jump to content

How exactly does FindClosestReferenceOfAnyTypeInListFromRef - Game work?


TheWhispers

Recommended Posts

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:

 

  1. Made a FormList in CK
  2. Put a single random WorldObject within the FormList of type Tree - TREE
  3. Put a single random WorldObject within the FormList of type Furniture - FURN

I 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 by TheWhispers
Link to comment
Share on other sites

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:

 

  1. Made a FormList in CK
  2. Put a single random WorldObject within the FormList of type Tree - TREE
  3. Put a single random WorldObject within the FormList of type Furniture - FURN

I 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

 

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:

 

  1. Made a FormList in CK
  2. Put a single random WorldObject within the FormList of type Tree - TREE
  3. Put a single random WorldObject within the FormList of type Furniture - FURN

I 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

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...