CanProduceForWorkshop - ObjectReference

From Creation Kit
Jump to: navigation, search

Member of: ObjectReference Script

Indicates whether or not the reference can currently produce resources for its Workshop.


bool Function CanProduceForWorkshop() native

Return Value

True if the reference can produce resources, false if not.


; Can MyMutFruit currently produce resources?
bool bcanProduce = MyMutFruit.CanProduceForWorkshop()


CanProduceForWorkshop is true by default. The following will cause a reference to NOT be able to produce:

  • An object requires power (has the WorkshopCanBePowered keyword), but is not powered.
  • An object is destroyed.
  • An object requires an actor (has the WorkshopWorkObject keyword), but has no actor assigned (meaning it is not owned by an actor), OR the assigned actor is wounded (actor value WorkshopActorWounded > 0) or dead.

This is only valid if the workshop is currently loaded. Calling this on unloaded objects or an unloaded workshop will produce invalid results.

See Also