Background for Fallout 4
Member of the ObjectReference script
boolfunctionAttachModToInventoryItem(FormakItem, ObjectModakMod)Native

Description

Wiki Description

Attach a mod to an item in this object's inventory.

Documentation Comment

Attach a mod to an inventory item in this reference's inventory


Caveats

CK Wiki - Notes

  • This doesn't do much error checking, so if you try to attach a mod to an item that already has the mod, it may silently fail
  • Currently there is a bug if you do this to an actor in combat; they will end up having no weapons drawn and won't attempt to draw any unless forced to do so.
  • Currently this function causes the object to reload its entire 3d if they had the item equipped that you modified. This might look strange if the player is watching.
  • This function currently won't work if the object it is called on has more than one of the item you request to modify.

Parameters

FormakItem

CK Wiki Description

a base form of the item we want to modify

ObjectModakMod

CK Wiki Description

a base form of the mod we want to add/attach to akItem


Examples

; attach a new arm armor mod to Bob's power armor
BobRef.AttachModToInventoryItem(PowerArmorObject, PowerArmorRightArmMod)

Auto-Generated Example

Form myForm__akItem
ObjectMod myObjectMod__akMod

bool returnedValue = myObjectReference__toCallFunctionOn.AttachModToInventoryItem(myForm__akItem, myObjectMod__akMod)

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.