AttachWire - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

F4SE Member of: ObjectReference Script
Requires F4SE version 0.3.2 or higher.

Attaches a BendableSpline base object between to other references.

Syntax[edit | edit source]

ObjectReference Function AttachWire(ObjectReference akRef, Form akSpline = None) Native

Parameters[edit | edit source]

  • akRef: Must not be None and must also not be the same as the caller (i.e. no wire to itself).
  • akSpline: Must be a BendableSpline object. If None is passed, it will use the default workshop wire (FormID 0001D971).

Return Value[edit | edit source]

  • The newly created wire ref in a disabled state, or None if no wire was attached.

Examples[edit | edit source]

; Attach a metal cable wire between the top of a radio tower to one of it's anchor points.
ObjectReference wireRef = RadioTowerTop.AttachWire(RadioTowerAnchor, MetalCableSpline)
; Enable the wire so we can see it.
wireRef.Enable()

Notes[edit | edit source]

  • The ref this is called on must linked to a workshop using the keyword WorkshopItemKeyword (FormID 00054BA6). All objects placed in workshop mode are linked to the workshop using this keyword. The calling ref must also not be another BendableSpline.
  • When created, the new ref is disabled, so you must enable it yourself. For convenience you can use CreateWire instead.

See Also[edit | edit source]