Skip to content

Procedural Tools | Slots can have Tags now - #3005

Open
Crepestrom wants to merge 33 commits into
PixelGuys:masterfrom
Crepestrom:procedural-tools-slot-tags
Open

Crepestrom wants to merge 33 commits into
PixelGuys:masterfrom
Crepestrom:procedural-tools-slot-tags

Conversation

@Crepestrom

@Crepestrom Crepestrom commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Defined along with a procedural tool you can define which tags a slot has

you can define a tool to have multiple tags in one slot
you define which slots each tag has in it

image

also adds a new modifier restriction (currently only used for branches)
on_top_of
if the thing is on top of a slot with a tag .head branches will have decreased durability

new modifier
image

modifier being applied

image

Crepestrom added 3 commits May 1, 2026 22:22
this really was a test case?
@Crepestrom Crepestrom changed the title Procedural Tool Slots can have Tags now Procedural Tools | Slots can have Tags now May 2, 2026
@Crepestrom

Copy link
Copy Markdown
Contributor Author

related issues #2603 #89

@Wunka Wunka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you have not linked it: https://discord.com/channels/443805812390100992/1103565202093506620/1499921286820921495
(where the idea came from)

this is an intersting change, but could not be the only way to do it...
Please create a corresponding issue with an explanation what the use case is.

Comment thread src/items.zig Resolved
Comment thread src/items.zig Resolved
Comment thread src/items.zig Resolved
Comment thread src/items.zig Resolved
@Wunka Wunka moved this to Low Priority in PRs to review May 2, 2026
@Argmaster

Copy link
Copy Markdown
Collaborator

Heh we are coming back to where we came from.
"The Tags, or There and Back Again"

@ikabod-kee ikabod-kee mentioned this pull request May 2, 2026
@IntegratedQuantum

Copy link
Copy Markdown
Member

Is there no better way to specify these? A boolean matrix seems kind of clunky and error prone.

@Crepestrom

Copy link
Copy Markdown
Contributor Author

sure i transitioned it into the format the optional/disabled has

@IntegratedQuantum

IntegratedQuantum commented May 3, 2026 •

Copy link
Copy Markdown
Member

Now that I think about it, optional and disable are also kind of tags, maybe it should all be defined in the same way?

Could you also go with the more compact .xyz = .{matrix} instead of .{.name = .xyz, .matrix = .{matrix}}

@Crepestrom

Copy link
Copy Markdown
Contributor Author

i will see if i can do that

@Crepestrom

Copy link
Copy Markdown
Contributor Author

though optional and disable being seperate can be fine since those define how the workbench is layed out while the tags only interact with properties

@IntegratedQuantum

Copy link
Copy Markdown
Member

Oh I absolutely want materials that can only be placed on fields with specific tags, which is pretty similar to what optional does.

@Crepestrom

Copy link
Copy Markdown
Contributor Author

i wont implement materials only being placed on certain tags yet but i see what you mean

@Crepestrom

Copy link
Copy Markdown
Contributor Author

i was not able to compress the form of the ZonObjects as you specified
and optional and disabled are outside the scope of this pr

@Crepestrom

Copy link
Copy Markdown
Contributor Author

if i were to modify disabled and optinal i would have to make the pr much bigger touching the workbench and inventory

@Wunka Wunka mentioned this pull request May 4, 2026
@IntegratedQuantum

Copy link
Copy Markdown
Member

i was not able to compress the form of the ZonObjects as you specified

It should be easy to do, you just need to iterate over the internal hashmap

@IntegratedQuantum IntegratedQuantum moved this from Low Priority to In review in PRs to review May 6, 2026
return result;
}

pub fn printTooltip(self: *const OnTopOf, outString: *main.List(u8)) void {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn printTooltip(self: *const OnTopOf, outString: *main.List(u8)) void {
pub fn printTooltip(self: *const OnTopOf, outString: *main.ListManaged(u8)) void {

we switched the default List in #3129 and #3152 . Thats where your error is coming from

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was changed i just didnt send a message about it a while ago

}

pub fn printTooltip(self: *const OnTopOf, outString: *main.ListManaged(u8)) void {
outString.print("on top of .{s}", .{self.tag.getName()});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on tops of? I didn't know you can put multiple items into one slot.
Please chooses a more descriptive name here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure what else to name it
if it is on top of a slot that has the tag its online

Comment thread src/items.zig Resolved
Comment thread src/items.zig Outdated
@@ -634,6 +642,7 @@ pub const ProceduralItemType = struct { // MARK: ProceduralItemType
tags: []main.Tag,
properties: []PropertyMatrix,
slotInfos: [25]SlotInfo,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this, they should now be accessed through tags

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swapped over to tags

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't changed, maybe you forgot to push your changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slot info no longer exists

Comment thread src/items.zig Resolved
Comment thread src/items.zig Outdated
var it = zon.object.iterator();
while (it.next()) |entry| {
if (std.mem.eql(u8, entry.key_ptr.*, "optional")) continue;
if (std.mem.eql(u8, entry.key_ptr.*, "disabled")) continue;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no reason not to make this information accessible to addons.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you provide more information
im not sure why it wouldnt be accessible by addons

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you should treat these like normal slot tags, so they can be accessed by addons (e.g. to add effects if you are in an optional slot, or next to x disabled slots)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure i dont mind that then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they have been changed to that

@Crepestrom

Copy link
Copy Markdown
Contributor Author

tagFeilds have been renamed to slotTags

Comment thread src/items.zig Outdated
}
pub fn slotInfos(self: ProceduralItemTypeIndex) *const [25]SlotInfo {
return &proceduralItemTypeList.items[@backingInt(self)].slotInfos;
pub fn slotTags(self: ProceduralItemTypeIndex) SlotTagContainer {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add a hasSlotTag function analogous to the other one you added? I don't see a benefit from having a seperate struct that is copied around for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has been removed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

4 participants