Find (Procedure)

From the CreationKit Wiki
Jump to navigation Jump to search

Behavior

Description:
Allows an actor to mentally search a location for a specified object or type of object.

  • The actor will do a mental search at the specified Location.
    • If the actor finds valid objects, it will fill the object list with those objects.

The procedure completes:
This procedure does NOT complete. (Usually paired with a simultaneous Wait Procedure)

Parameters

  • SearchLocation (Location): Specifies a location (usually a reference + radius) to mentally search.
  • TargetSelector (TargetSelector): Specifies what the actor should be looking for. This could be a specific reference, a specific type of base object, or something more general like "food", a "weapon" or "ammo."
  • ObjectList (ObjectList): This list is ***populated*** when the Find procedure is successful. It is a list of all things that the Find procedure found. This can later be used by another procedure, such as "Acquire" in order to pick up the object that was found in the search location. (Usually this is hooked up to private data and fed to a "target" parameter of another procedure like Acquire, Eat, Sit, etc.)
  • SearchOwnerInventory (Bool): Can the actor find things he has in his own inventory. (Usually true)
  • RandomizeList (Bool): Found things are deterministically found. This randomizes the object list.

                             

Notes

  • Does this procedure have a defined ending?
    • Yes, when the actor has found something that matches an object defined by the Target Selector. If the procedure doesn't find anything, it will not end on its own. (You would want to pair this procedure with a Wait or some other procedure in a simultaneous branch.)
  • How many objects will this procedure find?
    • It should fill the Object List with all of the valid objects that exist in the location.
  • Will the procedure find references/items that the actor does not own?
    • It will skip any owned furniture that the actor does not own. It will include owned items that the actor does not own, but will flag them internally as requiring stealing. Other procedures will automatically take that data into account -- for instance, Acquire has an "Allow Stealing" parameter.
  • Does this procedure cause the actor to do any physical behavior?
    • No, the procedure is purely mental. It is only there to populate the object list.
  • Does the actor have to be at the search location?
    • No.
  • Does the search location have to be in the loaded area?
    • No, but if the search location is unloaded, the procedure will most likely find nothing and keep running (periodically rechecking).
    • The procedure can still find objects within unloaded Cells if they are persistent. This will apply to references that are referenced by a Package, Quest, or anything else that is persisted.

See Also

  • ??? None.