A tutorial on creating a custom blueprint to add additional attachmentSlots to an item
Summary
Created: Aug 01 2024 by Berdagon
Last documented edit: Aug 01 2024 by Berdagon
This guide will teach you how to create your own blueprint by extending a base game record. At the end, you will have an assault rifle with muzzle, scope, and four mod slots.
To learn more about records and flats, check How to YAML: Tweak modding basics -> Records and -> Flats. For the purpose of this guide, it's enough to say that Records can contain other records and flats, whereas flats can only contain values.
A Blueprint is a record of type gamedataItemBlueprint_Record with the following flat:
slot is a record of type gamedataAttachmentSlot_Record.
They have the following properties:
childElements is an array of records of type gamedataItemBlueprintElement_Record
prereqID is a record of type gamedataStatPrereq_Record
A blueprint can have 1 rootElement and each of the gamedataItemBlueprintElement_Record can have multiple other gamedataItemBlueprintElement_Record as children
In order for a slot to be usable in the game its parent slot has to already be filled.
How to make a custom Blueprint?
We are going to make a custom blueprint that has 4 weapon mod slots for the Power Assault Rifles
At first make a new .yaml file and name it Items.Base_Power_AR_SMG_LMG_4Mod_Blueprint (the naming is not important and you can name it whatever you want).
Now we need to define Items.Base_Power_AR_SMG_LMG_4Mod_Blueprint_rootElement we are going to use Items.Base_Power_AR_SMG_LMG_Blueprint_inline0 as a base for our rootElement and append two records for our 2 new Mod slots
Items.Base_Power_Assault_Rifle as its name suggest is the base for power assault rifles so by doing this all the power assault rifles should now have this blueprint
The tweak part of making the blueprint is now over and we can jump in the game and check the records
We are going to use Preset_Ajax_Pimp as you can see the modSlots are not being shown in the game
For this, we are going to need to do some scripting lets create a new .reds file in the script folder and name it AR_SMG_LMG_4Slot.reds
We need to wrap multiple functions to make this work, so at first we are going to add a function that has our AttachmentSlots in it