Tip : How to check for number of sockets in cubemain.txt for cube recipes

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
Question
Posts: 87
Joined: Sat Nov 28, 2009 1:53 pm

Tip : How to check for number of sockets in cubemain.txt for cube recipes

Post by Question » Sun Sep 19, 2021 5:31 pm

Just discovered this by using op codes.

Reference : https://d2mods.info/forum/kb/viewarticle?a=284, appendix A

So for reference, lets say you want to check for an item with 2 sockets. In the op code, put "18", this will then fail the recipe if the "param" field does not equal the "value" field.

Op code = 18, param = 194 (the id of item_numsockets from itemstatcost.txt)

For output use "useitem,sock=3", this will produce the same item with 3 sockets. Unfortunately, the game cant add sockets, it only overwrites the number of sockets with whatever you use in the output field. So you are not adding +1 socket to an item with 2 socket, you are overwriting it with 3 sockets.

This would allow you to make incremental cube recipes to add sockets to an item one by one to get the exact number of slots you need to make runewords. The problem is that there is no way to tell what the max number of sockets your item can have because mods that display the max sockets do not display it once the item has at least 1 socket...if anyone has any suggestions on this, please let me know.

User avatar
Cypress
Junior Member
Paladin
Posts: 226
Joined: Fri Dec 01, 2017 2:08 am

Re: Tip : How to check for number of sockets in cubemain.txt for cube recipes

Post by Cypress » Tue Sep 21, 2021 8:53 pm

What is the purpose of knowing max sockets? Depending on your answer, I might have a clunky but functional solution.

Post Reply

Return to “General Mod Making”