Background for Fallout 4
Member of the ObjectReference script
voidfunctionSetMaterialSwap(MatSwapmSwap)Native

Description

Wiki Description

Sets the internal persistent Material Swap for this reference.

This function does not apply a visual update, you must use ObjectReference.ApplyMaterialSwap(...). This will make the game take care of setting the material swap when the game is loaded. ObjectReference.ApplyMaterialSwap(...) is a more greedy method of applying materials so the nif objects the game applies materials to may not match up with the ObjectReference.ApplyMaterialSwap(...) function. Behavior may not be as expected when applied to living references, Weapons, or Armor placed in the world.

Documentation Comment

Sets the internal persistent material swap
Adding persistent material swaps will increase save-size by a small amount
Setting this to None will remove persistence and free up save-space
This function does not apply a visual update, you must use ApplyMaterialSwap
This will make the game take care of setting the material swap when the game is loaded
ApplyMaterialSwap is a more greedy method of applying materials so the nif objects
the game applies materials to may not match up with the ApplyMaterialSwap function
Behavior may not be as expected when applied to living references, weapons, or armor placed in the world


Parameters

  1. MatSwapmSwap

    CK Wiki Description

    The Material Swap added to this reference.

    • Adding persistent material swaps will increase save-size by a small amount. Setting this to None will remove persistence and free up save-space.

Examples

weaponReference.SetMaterialSwap(myMaterialSwap)
Debug.Trace("Set the material swap to "+myMaterialSwap+" on the "+weaponReference+" reference.")

Auto-Generated Example

MatSwap myMatSwap__mSwap

myObjectReference__toCallFunctionOn.SetMaterialSwap(myMatSwap__mSwap)

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.