-
Notifications
You must be signed in to change notification settings - Fork 37
Size
To edit an item's size, you need to call CraftDataHandler.SetItemSize()
, a method sitting in the SMLHelper.V2.Handlers
namespace
There are two overloads for this method
CraftDataHandler.SetItemSize([TechType] techType, [Vector2int] size);
CraftDataHandler.SetItemSize([TechType] techType, [int] x, [int] y);
-
[TechType] techType
is the item for which you want to modify the size. This can be both an existing and a custom item.
Example: TechType.CreepvineSeedCluster
-
[Vector2int] size
is the desired size of the item. This value contains an[int] x
value which refers to width and an[int] y
value which refers to height. You can also use the[int] x
and[int] y
values outside of theVector2int
, using the other overload
Example: new Vector2int(1, 1)
-
[int] x
is the desired width of the item
Example: 1
-
[int] y
is the desired height of the item
Example: 1
Using this knowledge, if we wanted to add make the Creepvine Seed Cluster take less space in the inventory, we could do this:
CraftDataHandler.SetItemSize(TechType.CreepvineSeedCluster, 1, 1);
or, this:
CraftDataHandler.SetItemSize(TechType.CreepvineSeedCluster, new Vector2int(1, 1));
Congratulations! You have successfully changed an item's size!
(By the way, there is a mod called Custom Item Sizes made by AlexejheroYTB which allows you to change the size of an item from the config.json
file. You can check it out here)
If there is something missing or ambiguous, please create an issue or contact us on the Subnautica Modding Discord using our tags:
- PrimeSonic:
@PrimeSonic#0667
- Metious:
@Metious#3682
Please note that some pages are under construction and the links to them will be enabled as they are completed
[Adding]
- Items/GameObjects using Asset Classes
- Asynchronous loading for ModPrefab
- [Custom Scanner Unlocks]
- Items/GameObjects to the Spawning System
- [Recipes to uncraftable items]
- [Custom Mouse Click Actions]
[Editing]
- Background Type
- Crafting Time
- Equipment Type
- Quick Slot Type
- Size in Inventory
- [Recipes for craftable items]
- Harvest Settings
- BioReactor Fuel Values
- [Scanning Count/Time]
- [Spawning (Where/How often/How many)]
[General Utilities]
- In-Game Options Menu
- Adding crafting recipes for other mods items
- Using items from other mods
- Texture/Sprite Utilities
- [Adding/Playing Audio]
- Config Files using Abstract Json Config class
- Custom Console Commands
- [Registering OnSave/OnQuit Actions]
[Language]