Background for Fallout 4
Member of the ObjectReference script
boolfunctionAttachMod(ObjectModakMod, intaiAttachIndex=0)Native

Description

Wiki Description

Attaches a mod to this object.

Documentation Comment

Attach a mod to this reference


Caveats

CK Wiki - Notes

Changing an armor item's mods causes it to be silently unequipped and re-equipped.


Parameters

ObjectModakMod

CK Wiki Description

the base form of a mod that we wish to add & attach to this reference

intaiAttachIndex=0

CK Wiki Description

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.


Examples

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

Auto-Generated Example

ObjectMod myObjectMod__akMod
int myInt__aiAttachIndex

bool returnedValue = myObjectReference__toCallFunctionOn.AttachMod(myObjectMod__akMod, myInt__aiAttachIndex)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.