Base Object Swapper v2.1.1
F4SE framework for swapping base objects and references, using config files.
Required
Address Library for F4SE Plugins
Baka Framework
Description
F4SE utility plugin that allows mod authors to swap base objects with others, using config files.
This is a port of Base Object Swapper from Skyrim Special Edition.
With this mod, you could…
assign different model variants to misc objects at random
and more!
Due to Fallout 4’s precombine system, swapping statics and static collections is not recommended.
How To Use
Distributed records should be written to an ini file containing the suffix “_SWAP”, in the Data folder (for example, MyMod_SWAP.ini).
They should follow this general format:
origBaseID|swapBaseID,swapBase2ID,swapBase3ID|transformOverrides|chance [References] origRefID|swapBaseID|transformOverrides|chance [Forms|LocationEDID,CellEDID,KeywordEDID,RegionEDID] origBaseID|swapBaseID|transformOverrides|chance
ID can be either formID or editorID of the object
ObjectFormID~ModName.esp OR ObjectEditorID
origBase is the base object you’re trying to replace (eg. all farmhouse statics).
origRef is the specific object reference you’re trying to replace (ie. a specific farmhouse in Riverwood).
swapBase is the replacement object you’re replacing it with (eg. your farmhouse static with new model).
Locational replacements
Location based form swaps
Requires location/cell editorID or keyword editorID (for location)
;this swaps all CoffeeCup01 misc objects in Diamond City for cracked variants
[Forms|DiamondCityLocation] CoffeeCup01|CoffeeCupCracked01;this swaps all coffee cups with cleaned variants in locations with LocTypeBar keyword
[Forms|LocTypeBar] CoffeeCup01|CoffeeCup01cleanProperty Overrides
Transforms
Change the position, rotation and scale of swapped objects
pos – position
rot – rotation
scale – scale
units must be in floats (20.0)
A/R suffixes for setting relative vs absolute transform. For position/rotation
posR(1.0,5.0,100.0) will set new position relative to reference base position
posA(300.0,100.0,200.0) will override reference base position
scale is multiplicative/absolute.
scale randomization is possible
scale(1.0/2.0) will multiply existing scale by 1.0 to 2.0
scaleA(100/200) will override reference scale
Record Flags
Set/clear record flags on references (flags/flagsC)
See https://en.uesp.net/wiki/Skyrim_Mod:Mod_File_Format#Records (same as FO4) for all possible record flags
flags(0x20000000) to set the Don’t Havok Settle flag
flagsC(0x20000000) to clear the Don’t Havok Settle flag
Leave as NONE if you don’t want property overrides
;swaps CoffeeCup01 misc items to cracked variants with relative position + random Z position of 50 to 100, and random scale between 1.0 and 1.50.
[Forms] CoffeeCup01|CoffeeCupCracked01|posR(10.0,5.0,50.0/100.0),scale(1.0/1.50)It is also possible to directly set a transform override without swapping objects. Requires [Transforms] or [Properties] section
[Transforms] origBaseID|transformOverrides|chanceorigRefID|transformOverrides|chance [Transforms|LocationEDID,CellEDID,KeywordEDID,RegionEDID] origBaseID|transformOverrides|chance
Affects swapped objects
[Transforms] Bowl_05_Silver|rotR(-90,0,0),scale(2.0)Chance
Randomly swap between multiple swap objects/percentage chance to not swap at all
chance (0 – 100)
Default is 100
S/R/L suffixes
chanceS(50) – fixed random chance (persists across game sessions; object refs will be always swapped or not)
chanceL(50) – fixed random chance based on location/original base ID (objects of the same type and location will always swap the same way)
chanceR(50) – chance is rerolled on each new game session (object ref may or may not be swapped each time you load the game)
Default is S
[Forms] ;Randomly swaps between Base1, Base2, Base3Base|Base1,Base2,Base3
;50% chance to swap to PenBlue
;25% chance to swap to PenRed
Pen01|PenBlue|NONE|chanceS(50)
Pen01|PenRed|NONE|chanceS(25)
;50% chance (rerolls each game session)
Pen01|PenBlue|NONE|chanceR(50)
Examples
[Forms]
;swap ash-trays with pens
0x0008e371~Fallout4.esm|0x000140d99~Fallout4.esm
;swap specific ash-tray reference with pen and scale it between 1.0 and 1.50
0x1234~Fallout4.esm|0x000140d99~Fallout4.esm|scale(1.0/1.50)
Check po3_BaseObjectSwapper.log in My Documents/My Games/Fallout4/F4SE, for more information about the process.
Installation
Install as normal with a mod manager.


