#(MrCrash) Tag for check if a wall is connected to another wall

108 messages · Page 1 of 1 (latest)

grand shadow
#

Hi, i'm making a "item pipe" script using mud walls, i need to check if when i place a wall another wall is "connected" to any face of the placed wall

Pretty sure something exist for doing it but can't find it 🙂

Thank's for help !

civic fulcrumBOT
#

(MrCrash) Tag for check if a wall is connected to another wall

civic fulcrumBOT
#

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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

grand shadow
#

Okay i do something like this:

- if <context.location.attached.location.flag[ingepipe].sides>

#

now i need to return if he is attached to more than 1 sides

tranquil barn
#

!t sides

unkempt flameBOT
# tranquil barn !t sides

Returns the list of heights for a wall block, or connections for a redstone wire, in order North|East|South|West|Vertical.
For wall blocks: For n/e/s/w, can be "tall", "low", or "none". For vertical, can be "tall" or "none".
For redstone wires: For n/e/s/w, can be "none", "side", or "up". No vertical.

Group

properties

Returns

ListTag

Mechanism

MaterialTag.sides

tranquil barn
#

This could help if I understood you well

#

Oop, discord didn't showed that you actually send an another message with .sides here, sorry

grand shadow
#

np sometimes discor do weird things

thorny ether
#

!tag listtag size

unkempt flameBOT
# thorny ether !tag listtag size
Cannot Specify Searched Tag

Multiple possible tags: <ListTag.any>, <ListTag.get[<#>|...]>, <ListTag.sum>, <ListTag.last[(<#>)]>, <ListTag.size>, <ListTag.set[...|...].at[<#>]>, <ListTag.find[<element>]>, <ListTag.first[(<#>)]>, <ListTag.sort[<procedure>]>, <ListTag.filter[<tag>]>, <ListTag.filter_tag[<dynamic-boolean>]>, <ListTag.parse_tag[<parseable-value>]>, <ListTag.to_map[(<separator>)]>, <ListTag.insert[...|...].at[<#>]>, <ListTag.get[<#>].to[<#>]>, <ListTag.find_all[<element>]>, <ListTag.count[<element>]>, <ListTag.average>, <ListTag.lowest[(<tag>)]>, <ListTag.highest[(<tag>)]>, ...

thorny ether
#

!tag listtag.size

unkempt flameBOT
grand shadow
#

oh nice

#

it's exactly what i need here

#

so why isn't correct here? :

      - flag <context.location> ingepipe
      - flag server inge_pipe:->:<context.location>
      - if <context.location.attached.location.flag[ingepipe].sides.size> >= 2:
        - determine cancelled```
blazing radish
#

!t location.attached

unkempt flameBOT
blazing radish
#

LocationTag.attached is not a tag?

grand shadow
#

Sorry i don't understand what i miss ?

blazing radish
#

<context.location.attached.location.flag[ingepipe].sides.size>

grand shadow
#

oh

#

it's attached_to

#

my bad

blazing radish
#

I have no clue what this is supposed to be?

grand shadow
#

i do this because :

blazing radish
#

Is your block a gate?

grand shadow
#

nope, i read wrong the meta

blazing radish
#

You can't use that then

#

What block is your pipe?

grand shadow
#

yeah i understand this now

#

a mud wall

blazing radish
#

!t location.floodfill

unkempt flameBOT
#
Possible Confusion

Did you mean to search for locationtag.flood_fill?

unkempt flameBOT
# blazing radish !t location.floodfill

Returns the set of all blocks, starting at the given location,
that can be directly reached in a way that only travels through blocks of the same type as the starting block.
For example, if starting at an air block inside an enclosed building, this will return all air blocks inside the building (but none outside, and no non-air blocks).
As another example, if starting on a block of iron_ore in the ground, this will find all other blocks of iron ore that are part of the same vein.
This will not t...

Group

world

Returns

ListTag(LocationTag)

blazing radish
#

You could use that, to get all connecting walls

#

!t location.flood_fill.types

unkempt flameBOT
# blazing radish !t location.flood_fill.types

Returns the set of all blocks, starting at the given location,
that can be directly reached in a way that only travels through blocks that match the given LocationTag matcher.
This will not travel diagonally, only the 6 cardinal directions (N/E/S/W/Up/Down).
As this is potentially infinite for some block types (like air, stone, etc.) should there be any opening however small, a limit must be given.
The limit value can be: a CuboidTag, an EllipsoidTag, or an ElementTag(Decimal) to use as a radius...

Group

world

Returns

ListTag(LocationTag)

blazing radish
#

This takes matcher input

#

So you can use location matchers, such as block_flagged:<flag>, to only match your custom pipes

#

ie; if you look at a pipe and run
/ex narrate <player.cursor_on.flood_fill[1].types[block_flagged:ingepipe]>, it will output each pipe that directly connects to it, including the pipe you look at

grand shadow
#

That can be usefull to make a placing limit on the pipe, but idk if that help me for what i want to make at now

blazing radish
#

You want to check if your pipe is connected to another pipe

#

With the help of the tag above, you can do that

grand shadow
#

I want to do the pipe can't be separate on multiple ways , like when player try to place the pipe wall (surrounded in black on the png) that cancel the place event

grand shadow
#

ok i can't deal with it

#

so:

        - determine cancelled```
blazing radish
#

That can work ye

grand shadow
#

okay so i precise somethings:

      - flag <context.location> ingepipe
      - flag server inge_pipe:->:<context.location>
      - foreach <server.flag[inge_pipe]> as:checkpipe:
        - if <[checkpipe].flood_fill[1].types[block_flagged:ingepipe]> >= 3:
          - determine cancelled```
#

but don't working :/

blazing radish
#

Well you know the tools

#

Check your console

grand shadow
#

Okay i forgot the .size

#

so:

      - flag <context.location> ingepipe
      - flag server inge_pipe:->:<context.location>
      - if <context.location.flood_fill[1].types[block_flagged:ingepipe].size> >= 3:
        - determine cancelled```

look's okay but do weird thing
mild mauve
#

that behavior is consistent

#

it's not weird at all

#

>= 3 is probably just too big for whatever you're trying

blazing radish
#

Think about it logically

thorny ether
#

tell the rubber ducky how the script works

#

oh shit i interrupted ice

#

runs pls continue SCgrin

blazing radish
#

Check the connecting pipes for the amount of connecting pipes aswell

#

You want to check the amount of connecting pipes of the green block as well

blazing radish
grand shadow
#

so i need to check the last pipe placed before instead of the "context placed pipe"?

thorny ether
grand shadow
#

both?

thorny ether
#

the context location is part of the flood_fill

grand shadow
#

and what's about if i check foreach loction flagged? that would be working?

blazing radish
blazing radish
grand shadow
#

to precise i don't want to be allow to place the green block above the yellow one , supposed he is placed in last

blazing radish
grand shadow
#

so it's a check foreach flagged blocks, if he is connected to more than 3, i cancel?

blazing radish
#

if he is connected to more than 3, i cancel? two pipes, not three, but since flood_fill includes the block you're running flood_fill on, 3 in your if yes
foreach flagged blocks, not all flagged blocks no, in the scenario above only the yellow block and the top greenish one, when it's going to be placed

grand shadow
#

mmh yeah okay but if i don't use foreach flagged block how can i know above which block the player place the pipe?

blazing radish
#

The event provides the tag, you can use to get the block placed by the player

#

And the tag, we talked about several times, returns a list of locations of connecting pipes

#

So you have the tools you need, you just have to put it together

grand shadow
#

i'm lost lmao

#

np i'm going to paste all of this in google trad and trying to understand x)

somber horizonBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@grand shadow

grand shadow
#

i keep it open because i don't find how to do

#

i read again and again ^^

unique otter
#

!paste

unkempt flameBOT
grand shadow
somber horizonBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@grand shadow