CraftBook 3

CraftBook 3

139k Downloads

Block Replacer

LadyCailinBot opened this issue · 55 comments

commented

CRAFTBOOK-2244 - Reported by mk2233

[MC1228] - BLOCK-REPLACER

DESCRIPTION
http://www.djgemo.de/IC-Wiki/images/IO/1I1O.png

The MC1228 is a selfsearching blockreplacer. It starts to search and replace blocks (connected to the ICblock, even diagonal) whenever the input (the "clock") changes from low to high or vice versa.

SIGN PARAMETERS

Line 3: BlockIDOn[:SubID][-BlockIDOff[:SubID]] (Examples: 'wool:15-stone' or 'grass' or 'dirt-44:2')
Line 4: ticksBetweenReplacement:SearchMode(1 OR 3), Examples: '0' (immediate replace) or '3:1' (wait 3 ticks between replacment and use mode 1=CIRCLE) or '5:3' (wait 5 ticks between replacment and use mode 3=ALONG A PATH)

INPUTS

Clock

OUTPUTS

Clock

Edit: I've written a new ic number

commented

Comment by me4502

MC1220 is already taken, but I like the idea...

commented

Comment by mk2233

thx that you said this ^^ I have changed the ic name to another who isn't taken yet

commented

Comment by flash2over

Would help me, too. Nice idea! Please add that IC!

commented

Comment by me4502

So does it only change blocks directly touching it (including diagonal), or does it branch out and change every block in a radius?

commented

Comment by Silthus

It changes every block connected to it, also did work 3d.

commented

Comment by Silthus

Is this still needed or already added?
If not I will take a swing at it.

commented

Comment by me4502

It's still needed

commented

Comment by DeinGehirn

Please add this IC, you can see a Tutorial on Youtube ( http://p-mc.eu/replacer ). You can see, it doesn't replace anything instand, it replaced tick per tick on the Server (Looks better :) )
So please add this IC.
-Alex

commented

Comment by pmpmpm

http://wiki.sk89q.com/wiki/CraftBook/MC1228

Try MC1214 =p
Good idea though. May be of great use for some systems! (Replace slowly floor by lava, mwahaha)

commented

Comment by me4502

What are search modes circle and along path exactly?

commented

Comment by DeinGehirn

you can see the mode circle on YouTube ( http://p-mc.eu/replacer ). But i never used the along path mode because i dont know this mode exists^^

commented

Comment by me4502

The immediate mode is redundant, as the tick change could be just set to 0

commented

Comment by pmpmpm

From a CPU point of view, will it be heavy? If I replace an area of, for example, 15000 blocks? I know it may be a bit too soon to ask this, but if you have an idea of how it will work...

commented

Comment by me4502

15000 blocks won't work with the IC because I will limit it. The larger the area the more CPU intensive it will be.

commented

Comment by me4502

It will also be [MC1249]

commented

Comment by me4502

#1976 adds this IC.

commented

Comment by pmpmpm

Did you update the wiki? (I can do it if you want, though)
Edit: And does it support all modes?

commented

Comment by me4502

You can update the wiki if you wish. It only supports Circle so far

commented

Comment by me4502

1977 fixes a few bugs, it is really cool to play around with.

commented

Comment by pmpmpm

Hey, what about making it possible to replace blocks connected to an offset block? (Meaning, not only to the IC block, but to any block specified by an offset)

Edit: The problem is: Where to put the offset? Fourth line?

commented

Comment by me4502

Fourth line is already filled up. Sadly i don't think an offset is possible with this IC. You could make a fuse to the blocks you want to change though?

commented

Comment by pmpmpm

There's a problem. I tried:

[MC1249]
1:98
20:0

The sign just doesn't change at all, no message to me, nothing. Like for the MC1213, remember?
Posting screenshots...

Edit: About the fuse, err... Hard to use. What about an Y offset?

commented

Comment by me4502

That is incorrect syntax.

[MC1249]
1-98
20:0:0

commented

Comment by pmpmpm

Oh, okay. It's 4am here, that will be my excuse!

Still, the IC doesn't break itself =p

Edit: Lol, link a clock to this new IC with a 20 period for each of them, it's quite funny!

commented

Comment by me4502

I have fixed it not popping off.

commented

Comment by pmpmpm

Err, there's another problem I think...
On the screenshot the black, unconnected wool is affected by the IC too.

commented

Comment by me4502

Hmm.. That is weird. does that only happen if it is near the IC block?

commented

Comment by pmpmpm

It does it to any block separated of the changing line by only one block of air.

On the screenshot, all the blocks of the center change. The first one to change is the bottom one, the second ones are the one on the left and the one on the right, then it goes up.

Edit: Err... More testing done. It's akward. And hard to describe... Adjacent blocks seem to change only if a line of block is changing, bot not a block alone.

Edit again: Some bugs identified. First, on a line of blocks with a corner:

XXXXX...
X
X
X
...

If you trigger the MC1249 from one extreme of the line, the blocks will advance, but when arriving to the corner, the corner block is updated AFTER the block in diagonal of the block that's changing.

Second, an unconnected block put in a chess knight way will be influenced by the IC. It's really cool-looking, so here's a sugegstion:

What about adding a "block-range" to the IC, on the fourth-line? This block-range would determine the distance a block must be from an influenced block to be influenced too.

commented

Comment by me4502

Can you try this on build #1993.

commented

Comment by pmpmpm

Tried with build 2000 (sorry for being a bit late), still the same chess knight bug.

commented

Comment by me4502

Hmm.. I don't even understand how this is possible.

commented

Comment by pmpmpm

Is the replacement physic or non-physic?

commented

Comment by DeinGehirn

What r u mean? If you replaced some blocks to gravel/sand, they will falling on the ground. If you replace some blocks to a solid block, they will stay in the air.

commented

Comment by me4502

He meant will the blocks give a physics update. In the video they didn't, but I think I will

commented

Comment by pmpmpm

What about adding an option for that, on a config line of the sign? If I replace a wall of stone by glass, it'd be a shame to have all the torches fall.

commented

Comment by me4502

I guess, maybe on the last line where the mode was for FalseBook?

commented

Comment by pmpmpm

Yes, so it would be:

Line 4: ticksBetweenReplacement:SearchMode:Physic(TRUE(default)/FALSE)

commented

Comment by me4502

I may exclude search mode due to lack of knowledge about them

commented

Comment by pmpmpm

Well, the "Circle" one is pretty simple to understand. I think I'll do some search about this "Along a path" thing.

Edit: Ooookay, so it seems like NOBODY ON THE EARTH knows what this "Along a path" thing means! Great! I think I'll install FalseBook and see for myself...
Edit²: Inactive plugin. Super. I hope it will still work.

commented

Comment by me4502

The plugin won't work on 1.5, it's 1.4.6 IIRC

commented

Comment by pmpmpm

I was trying to make it work on 1.4.7, no success. I don't want to install another server, so let's forget this.

About those "replace modes", what about adding a random one? The IC would check which blocks it has to change, and then change them one by one randomly.

commented

Comment by me4502

Um... I guess so

commented

Comment by pmpmpm

So, for the search modes..?
0: Immediate
1: Circle
2: Random without connection (any block of the area to change can change at any time)
3: Random with connection (a block change randomly only if one block at least is connected to it)

Those 4 could have great uses... For example, the first to quickly change a room, the second would be amazing to create cool effects (glowstone!), the third to randomly change a floor to lava (yes, I want this one .), and the last to create realistic effects of break/corruption! (Changing grass to mycellium)

commented

Comment by pmpmpm

It only does it on a plane surface, by the way. It won't play chess vertically.

commented

Comment by me4502

err.. Even more weird. All locations are handled the same, with no special treatment.

commented

Comment by me4502

I believe I fixed this in latest build.

commented

Comment by pmpmpm

Everything's working well. Were the other modes added?

There's some weird behavior of this IC when playing with air (ID 0). First, in case of disposition error, it can generate quickly huge balls of material. Luckily a /cb reload stops the IC... (Good reflex I had there, almost destroyed my map ^.^')
Plus, in my circuit, sometimes the air-playing replacer doesn't work at all, sometimes it works only for a few blocks and then stops... On when I trigger it off, it sometimes does nothing (good), sometimes generate balls of material (less god).

That's how an idea came: What about adding an arrow (-> or <-) on the sign third line? For example:

3 -> 2: LIFE WHEN POWERED OFF! DIRT TO GRASS YEAH! (damn hippie)
3 <- 2: Death when powered ON! Grass to dirt! (better.)
1 -> 0: Stone turns to air when powered off (imagine this applied to a floor... above lava), but no big balls o'stone when triggered on.

commented

Comment by me4502

But with that, how does it get reversed? Your talking about a one way stone to air conversion

commented

Comment by pmpmpm

It doesn't get reversed with arrows. If implemented, then you'd have simply not to use arrows and use the traditionnal way.

commented

Comment by me4502

Oh, so like with set IC's.. Makes sense. I'll work on it soon

commented

Comment by pmpmpm

Thanks a lot!

But what about the random modes? /hide

commented

Comment by me4502

What's the current mode?

commented

Comment by pmpmpm

Circle. Or "ball" in 3D.

commented

Comment by me4502

I would probably call it 'path'. Not really circle as such. It follows the path, not expands in a sphere.

commented

Comment by pmpmpm

What, the implemented mode? The "0" mode?

Edit: Rather than kinda "flooding" here (which is already quite done), should I go on the IRC?