Difference between revisions of "CanProduceForWorkshop - ObjectReference"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Plplecuyer
 
imported>Qazaaq
m (added category)
 
Line 2: Line 2:
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:Non-Delayed Native Functions]]
[[Category:Non-Delayed Native Functions]]
[[Category:Workshop]]
'''Member of:''' [[ObjectReference Script]]
'''Member of:''' [[ObjectReference Script]]



Latest revision as of 22:31, 19 October 2016

Member of: ObjectReference Script

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

Syntax[edit | edit source]

bool Function CanProduceForWorkshop() native

Return Value[edit | edit source]

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

Examples[edit | edit source]

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

Notes[edit | edit source]

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