The Item ID of your weapon is what makes it spawn correctly.
The main problem of this is that your modular frame (and nothing else) will spawn in Take and Hold without any attachments (which is bad).
Another interesting feature is having attachments pre-attached onto your receiver. This is done by using
Cityrobo's PreattachedAttachment
script (
more information in the tutorial doc). However, you can't simply use the script, as
every time you vault a weapon with different attachments it will spawn both the default ones you specify and the new
ones the user applied.
The way to correctly get these features working is Item ID duping:
- In your Unity assets tray where you can see your modular receiver, right-click and click
Show in Explorer
. - Copy the receiver prefab (the file with the
.prefab
extension), the Item ID, and the Item Spawner ID. - Create a new folder somewhere for your new duped items.
- Paste your copied prefabs, and rename them with the
_DUPE
suffix to make sure you don't confuse them with your originals. - In your duped prefab:
- Remove all pre-attached attachments you might have added.
- In your duped Item ID:
- Turn the
O Sple
value off. This disables the prefab this Item ID is pointing to from being spawned in Take and Hold. - Point the
Asset Name
to your new duped prefab. - Change the
Item ID
,Display Name
, andSpawned from Id
to another value. This could mean just adding "_Dupe" to the end.
- Turn the
- In your Item Spawner ID:
- Change the
Item ID
to what you called it in the last step. - If you want to hide this attachment-less receiver, turn
Is Displayed In Main Entry
andIs Unlocked By Default
to their off values (unchecked).
- Change the
- Finally the most important step, in your original prefab of your weapon:
- Set the
Object Wrapper
to your duped Item ID, not the original. Your original Item ID should still exist, and should still be set to your shown Item Spawner ID.
- Set the
This was a lot to take in, so there is also an infographic in hopes to clear some things up.
Thanks to Meat_Banano for contributing to the writing of this guide, and Jessica for discovering the idea behind it.