#(lantoaster) Creating a Schematic Mask

72 messages · Page 1 of 1 (latest)

weak verge
#

Good Evening,

As Denizen appears to not be able to Paste a Schematic with a "Not Solid" mask, I tried to create it myself, but apparently it hates me.

This is my Script:
https://paste.denizenscript.com/View/125846
And this is what it Errors out:
https://paste.denizenscript.com/View/125848

I´m pretty stumped, because it Errors out already where I try to define the Cuboid, it works when done in Chat individually, but not in the Script.

brazen wingBOT
#

(lantoaster) Creating a Schematic Mask

brazen wingBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

rancid moon
#

!debug

old patrolBOT
# rancid moon !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

rancid moon
#

@weak verge could you do us the favor and provide a proper debug

weak verge
rancid moon
old patrolBOT
# rancid moon !checklog https://paste.denizenscript.com/View/125865
Server Version

Paper version 1.21-109-5a5035b (MC: 1.21)

Plugin Version(s)

Denizen: 1.3.1-SNAPSHOT (build 7057-DEV) -- (:warning:Outdated build, behind by 8)
Depenizen: 2.1.1 (build 864) -- (Current build :white_check_mark:)

Checked For

@rancid moon

UUID Version

3 (:triangular_flag_on_post: Offline)

Java Version

21.0.4 :white_check_mark:

Possibly Relevant Plugin(s)

Multiverse-Core: 4.3.12 - Multi-world configuration plugins may affect NPCs in unexpected ways.

rancid moon
#

@hoary kernel cracked @weak verge

hoary kernelBOT
rancid moon
#

There are sevveral issues

#

First things first - define does not use a :

#

remove it and use a space SCgrin

#

secooondly, you're looking for a schematic called "Cherry_tree01" - but the thing is called Cherry_Tree01

#

You've added quotes for some reason

weak verge
#

Okey, that removes the Errors, but the Filter doesnt work

rancid moon
#

Can you provide another debug please

weak verge
rancid moon
#

Hm no errors on that

#

Then let's check the filter

#

You're getting the material of that location and then using .name to get the materials name

#

then you're checking if the name is solid

#

!t material.is_solid

old patrolBOT
rancid moon
#

Do you see the issue?

weak verge
#

Not Really, sadly. I added the name to it because thats what I do in the Other Script, and without it didnt do anything either

rancid moon
#

well, try removing the name and check again

#

The is_solid tag requires a MaterialTag but you fed in an ElementTag, which is literally just a string

weak verge
rancid moon
#

Could you narrate <[cuboid_area].blocks.parse[material]> in your script.

weak verge
#

That looks not bad.

#

Though it didnt narrate it, but probably just because its too much

#

Could I put that Tag into the Filter somehow?

rancid moon
#

Oh I know why

#

You are using old filter syntax on new filter_tag tag

#

You need to use either .filter[material.is_solid] or .filter_tag[<[filter_value].material.is_solid>]>

#

the latter is modern

weak verge
#

Cool, thanks. Now if I were to use it as mask for Pasting a Schematic, can I just give that Tag, or do I need to iterate through it to prevent duplicates?

#

btw, it now properly Iterates through the Solid Blocks

weak verge
#

It appears that I cannot just plug that list into the mask. And I got a error in thinking anyway, the mask needs to be for nonsolid.
As it appears that I have to create a list anyway, I got it to work a bit differently:

Thanks for the Help though, (I think I´ll never get through the Tag Syntax, its is so confusing for me, took me an hour just to get the damn list to work and Insert in the Loop, I wish it were as simple as Python)

Whoever has a similar Issue, and want a Dynamic Mask that masks to any NonSolid Block where it would be Placed, this is how I did it now:
https://paste.denizenscript.com/View/125885

(Though I dunno how long the Paste Lasts)
From my end this can be Closed now.

rancid moon
#

To give you a quick review of it, raw object notation as you do on line 15 is prune to error. Also you are using an old way that only exists for back compatibility by providing a list of materials. Todays usage is to work with material matchers. So you would want something like;

- define mask:|:air|oak_leaves|cherry_leaves
- define non_solids <[cuboid_area].blocks.parse[material].filter[is_solid.not]>
- ~schematic paste name:<[schem]> mask:<[mask].include[<[non_solids]>].deduplicate.separated_by[|]>

@weak verge

weak verge
#

Ahh cool. Thanks alot. I tinkered around until it worked, I Noticed that how I made the List did sometimes Error out. Its really hard to find out exactly how stuff works on the Wiki if you dont know how stuff works at all. 😄

rancid moon
#

!guide

old patrolBOT
weak verge
#

That looks waaaaay better then what I made.

rancid moon
#

There's a guide that explains all of it

weak verge
#

Yea, I read it, and reference it everytime I do something, but it doesnt click for me.

#

I´m probably just Lacking because I cant get the Tag Syntax in.

#

I just hope, with that i´m done with my WorldUpgrader now, and no other things creep up, and I can Focus on Actually making the World.

The Trees drove me Crazy.
First I tried the Tree Command Denizen has, but that cannot do Mangrove Trees at all, then I called WorldEdit, and Force a Tree with Forest, but then my Cherry Trees started Floating, and now I made them as Schematics.

rancid moon
#

First I tried the Tree Command Denizen has, but that cannot do Mangrove Trees at all
Oh?

#

This sounds like an reportable issue o:

weak verge
#

I didnt tinker much with it, dunno if I did it just wrong. My Script Checks the Chunk for Command Blocks and Replaces them with stuff.
So, it did change the CommandBlock to air and try to spawn a tree.
Cherry Trees did spawn some times, I made up for that with Numbers, but my Mangrove Swamp didnt have any Trees.

rancid moon
#

could be, just tried to spawn them and they work

weak verge
#

I now just do:
- modifyblock <[block]> air delayed
- execute as_server "/world <[ChunkWorld]>" silent
- execute as_server "/pos1 <[block].x>,<[block].y>,<[block].z>" silent
- execute as_server "/pos2 <[block].x>,<[block].y.sub[1]>,<[block].z>" silent
- execute as_server "/forest <[saplings.<[block_type]>]> 100" delayed
Works for Mangroves

#

And stupid me just got an Idea how I could´ve fixed Floating Trees, ... damn, I could´ve just moved the Command Blocks inside the Ground, and replace the Commandblock to Dirt

rancid moon
#

Would be cool if you could make a denizen thing out of it and post it on the forums :D

#

!t chunktag.surface_blocks

old patrolBOT
rancid moon
#

You could get the chunks surface blocks to make sure you're on the surface

weak verge
#

I watched it, its actually a Delay Problem, for some reason the Tree comes first, and modify air comes after that.

#

This is all so I can use a 1.16 WorldGen Plugin that might still take Ages to be Updated to a more Recent version

#

Still need to Adjust the Actual Biomes though.

#

However I´m not entirely certain now, if I do the Biome Adjustments in a different pass/script, or this one.
If I would do it in this one, I would need to learn how to Read/Parse Images, would be much easier to just do that in Python, but it would probably add around 50% Process Time, while I think the decrease in Performance Adding Biome Changes to the Entire Chunk would be much less, on the Other Hand, I could pass a List of Biome Cuboids to the Script, and add them there.

weak verge
#

Bump

I´m not Certain I can just append my Question here.

#

So, I wanted to Optimize my Script a bit, because its really really slow.
I thought I could use the Filter to Filter the Blocks from my Cuboid.

Would something like that work?

  • define blocks <[ProcessChunk].cuboid.blocks.parse[material].filter[is_inside[<[block_replacements].keys>]]>

If its better to Create a new Thread, I can do that though.
I tried asking ChatGPT, but he is really bad with Denizen. ^^

weak verge
#

NVM, this can be Closed.
I found out how it worked. Rather seperatly Filtering, there is a Function for that:

  • define blocks <[ProcessChunk].cuboid.blocks[<[check_list]>]>

Is how I do that now. Appears to properly work. Sadly, this wasnt the big Performance thing I was hoping for. :/

#

!close

#

!resolved