Mod:Creation Kit/GetWorkshopResourceObjects - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Finds all references that are linked to the given Workshop reference that produce resources. Optionally, you can get a list of references that produce only a given resource. You can also optionally specify finding either objects with damaged resources, or objects with undamaged resources.

Syntax
ObjectReference[] Function GetWorkshopResourceObjects(ActorValue akAV = None, int aiOption=0) native

Parameters

 * akAV : If specified, a Resource-type Actor Value. Only linked references producing this resource will be added to the array. If None, all Resource-type actor values will be checked.
 * Default: None
 * aiOption: 0 for all resource-producing items, 1 for only damaged resource-producing items, 2 for only undamaged resource-producing items.
 * Default: 0 (all resource-producing items)

Return Value
An array of references producing either the given resource, or any resource.

Examples
ObjectReference[] foodProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(Food) ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(Food, 2) ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(aiOption=1)
 * Find all Food producers in the SanctuaryWorkshopRef workshop.
 * Find all producers of all resources in the SanctuaryWorkshopRef workshop.
 * Find all undamaged producers of Food in the SanctuaryWorkshopRef workshop.
 * Find all damaged producers of any resource in the SanctuaryWorkshopRef workshop.