GetWorkshopResourceObjects - ObjectReference

From the Fallout4 CreationKit Wiki
Revision as of 08:07, 19 June 2015 by imported>DarkruneDK (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Syntax[edit | edit source]

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

Parameters[edit | edit source]

  • 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[edit | edit source]

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

Examples[edit | edit source]

; 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)

See Also[edit | edit source]