Block Replacer
LadyCailinBot opened this issue · 55 comments
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
Comment by mk2233
thx that you said this ^^ I have changed the ic name to another who isn't taken yet
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?
Comment by Silthus
It changes every block connected to it, also did work 3d.
Comment by Silthus
Is this still needed or already added?
If not I will take a swing at it.
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
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)
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^^
Comment by me4502
The immediate mode is redundant, as the tick change could be just set to 0
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...
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.
Comment by pmpmpm
Did you update the wiki? (I can do it if you want, though)
Edit: And does it support all modes?
Comment by me4502
You can update the wiki if you wish. It only supports Circle so far
Comment by me4502
1977 fixes a few bugs, it is really cool to play around with.
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?
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?
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?
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!
Comment by pmpmpm
Err, there's another problem I think...
On the screenshot the black, unconnected wool is affected by the IC too.
Comment by me4502
Hmm.. That is weird. does that only happen if it is near the IC block?
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.
Comment by pmpmpm
Tried with build 2000 (sorry for being a bit late), still the same chess knight bug.
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.
Comment by me4502
He meant will the blocks give a physics update. In the video they didn't, but I think I will
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.
Comment by me4502
I guess, maybe on the last line where the mode was for FalseBook?
Comment by pmpmpm
Yes, so it would be:
Line 4: ticksBetweenReplacement:SearchMode:Physic(TRUE(default)/FALSE)
Comment by me4502
I may exclude search mode due to lack of knowledge about them
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.
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.
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)
Comment by pmpmpm
It only does it on a plane surface, by the way. It won't play chess vertically.
Comment by me4502
err.. Even more weird. All locations are handled the same, with no special treatment.
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.
Comment by me4502
But with that, how does it get reversed? Your talking about a one way stone to air conversion
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.
Comment by me4502
Oh, so like with set IC's.. Makes sense. I'll work on it soon
Comment by me4502
I would probably call it 'path'. Not really circle as such. It follows the path, not expands in a sphere.