GetWorkshopResourceObjects - ObjectReference
Member of: 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.
SyntaxEdit
ObjectReference[] Function GetWorkshopResourceObjects(ActorValue akAV = None, int aiOption=0) native
ParametersEdit
- 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 ValueEdit
An array of references producing either the given resource, or any resource.
ExamplesEdit
; Find all Food producers in the SanctuaryWorkshopRef workshop.
ObjectReference[] foodProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(Food)
; Find all producers of all resources in the SanctuaryWorkshopRef workshop.
ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects()
; Find all undamaged producers of Food in the SanctuaryWorkshopRef workshop.
ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(Food, 2)
; Find all damaged producers of any resource in the SanctuaryWorkshopRef workshop.
ObjectReference[] resourceProducers = SanctuaryWorkshopRef.GetWorkshopResourceObjects(aiOption=1)