No ItemGroup for Potions?

Discuss modding questions and implementation details.
Post Reply
x0nic
Posts: 1
Joined: Sat Jan 20, 2024 4:49 pm

No ItemGroup for Potions?

Post by x0nic »

Hey,
I am trying to add basic potions to the shop inventory of alchemists, which - if I am not mistaken - is generated here.
This function uses byte arrays from here which contain a set of paired numbers where the first describes the index of the ItemGroup and the second one the probability of its generation.
Please correct me if I am wrong.

Now my idea was to simply add the ItemGroup index of Potions + their probability to the byte array itemGroupsAlchemists in order to make it available for purchase.
However, Potions aren't listed in the ItemGroups definition?

3 questions arose:
1. What am I missing here?
2. How does buying potions work within the engine?
3. And where is the membership of specific items to an ItemGroup defined, anyway? I looked around here, but to no avail.

Obviously, I am both new to the game itself and C# coding/modding in general.
Thanks in advance for any help or hint to the right direction.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: No ItemGroup for Potions?

Post by Magicono43 »

Potions are actually just a "Glass Bottle" item with a specific potion recipe attached to it.

This method in one of my mods might be helpful as an example: https://github.com/magicono43/DFU-Mod_K ... ms.cs#L806

Post Reply