AttachMod - ObjectReference

From the Fallout4 CreationKit Wiki
Revision as of 13:18, 29 October 2015 by imported>Plplecuyer (→‎See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: ObjectReference Script


Attaches a mod to this object.


Syntax

Function AttachMod(ObjectMod akMod, int aiAttachIndex = 1) native

Parameters

  • akMod: the base form of a mod that we wish to add & attach to this reference
  • aiAttachIndex: OPTIONAL: the attach index to put akMod onto. For example, a robot that can take an arm mod in three different places can have this specified to specify which spot the arm mod should go to. Defaults to 1. Has no relevance and can safely be ignored for mods that can only go in one spot.

Return Value

True if it successfully attached the mod, false otherwise. Note that this is only going to check that the mod found an attach point to attach to; it will not check what type of mod it is or if it replaced another mod already on the reference.

Examples

; Attach a "RobotArmMod" onto the second slot it can go onto
myRobot.AttachMod(RobotArmMod, 2)

See Also