Q1. Why is this bug happening?
A1. ReadyOrNot's BaseWeapon class uses hard class references instead of soft class references for attachment class reference. In other words, this bug occurs when the value of the attachment class reference pointer is assigned before the UClass static object of attachment is actually loaded. So, the attachment class reference pointer(TSubclassOf) randomly becomes nullptr at runtime. For example, theoretically speaking, if you have ReadyOrNot installed on your hdd, you are more likely to see this problem.
Q2. Why is this issue a “ReadyOrNot Bug”?
A2. Vanilla attachment classes are always loaded without any problems since they are all already cached (asset registry, etc.), but mod attachment classes are not. In other words, this may not be a bug in "ReadyOrNot's system", but I recently heard a ReadyOrNot community moderator say that ReadyOrNot was coded with modding in mind. Considering this, this is clearly a ReadyOrNot bug.
This mod doesnt work without the Data Asset generated by the modder. In other words, if the modders don't update their weapon mod to make this mod to work, then this mod won't work. However, if you want to use this mod for that weapon mod even when that weapon mod hasn't been updated, install the Example Data mod I uploaded in the Optional Files section.
If you think this mod is crashing you, read this : This mod validates all attachment classes on your computer at runtime, so if it finds an old(=wrong) attachment class there, it will intentionally raise an assertion error. This is the intended task literally.
All descriptions below are for modders only. So, Users do not need to read it.
[Description (For Modders)]
-> You need to generate data for this mod to work for your weapon mod.
1. Download the AttachmentMod data asset blueprint and place the files in the Unreal Editor.
2. Create an object asset(AttachmentMod data asset) based on that data asset blueprint in "/Content(Game)/Mods/AttachmentMod/"
3. Fill in the object asset as you wish, as shown in the screenshot on this mod page.
4. Cook object asset and include it in your mod pak. (*Don't cook assets located in /Content/Mods/AttachmentMod/Base/)
[Note (For Modders)]
The location of the attachment assets must be "/Content(Game)/Blueprints/Items/Attachments/"
However, it doesn't matter if there are subfolders inside Attachments folder.