stfwi / redstonepen

Minecraft mod adding a pen to draw Redstone tracks in all directions, a PLC for Redstone, and relays.
MIT License
15 stars 2 forks source link

"Voltage Injector" and "Resistor" #31

Open lukescott opened 9 months ago

lukescott commented 9 months ago

Looking for ways of making comparators more convenient to use, and more compact.

Voltage Injector - Basically like the Redstone torch, but instead of providing the full power level of 15, have a way to configure it from 1 to 15. This would be useful for sending a signal into the side of a comparator in subtract mode. It would be nice if you could inject directly into the comparator from the voltage injector (vs the Redstone torch needs at least 1 Redstone dust).

Resistor - Taking in a Redstone level, depending on the resistor configuration you can reduce a signal down to the desired level without having to use a bunch of blocks to stretch out the signal strength.

stfwi commented 9 months ago

Hi, I presume this is a question or feature request ;)

Actually, the mod may already have what you are looking for, the RLC (Redstone Logic Control). Documentation in this repository, the link is:

For the redstone resistor, make an RLC, let's say yellow (Y) is the input, and red (R) is the output. Use the code:

R = Y - 5

and press play. Then the output will be 5 less than the input. Values are automatically limited to the redstone range, so input 5,4,3,2,1 will all yield 0 at the output. You could also scale it like a single electrical resistor in a Ohm network, e.g. R = Y * 2/3.

For the comparator: Also possible with RLC:

R = Y.CO - G

will make a redstone signal on the red port that corresponds to the comparator override value (.CO) measured on the yellow port with the green port's redstone signal subtracted. (it's really that simple, no Bob Ross joke).

So, browse the RLC docs and examples. Alternatively I also made a rather unprofessional video for a few friends (https://youtu.be/af3GKqL524o) if that helps, but accent and no radio voice.

Tell me what you think. Cheer's, wilE

lukescott commented 9 months ago

Yep, you're right, that definitely does the trick! I was kind of hoping for something a little simpler and vanilla like that kind of looked like a striped resistor. Goal is to make a compact sorting system and avoid using 41 items as crossing lines shouldn't be a problem.

But the logic control definitely works:

Minecraft_ 1 20 4 - Singleplayer 12_22_2023 10_57_34 PM

Minecraft_ 1 20 4 - Singleplayer 12_22_2023 10_59_44 PM

I ended up doing:

D=IF(R.CO>1, 0, 1)

I also found this really cool IC mod that is similar to Tiny Blocks, but 2D:

https://github.com/replaceitem/integrated-circuit

I posted a few issues on their issue tracker. They are missing the D output, and there doesn't seem to be a way to take comparator output like you can with the Logic Control.

The Logic Control block is really cool, especially for advanced cases. But has more of a programmer feel than a Minecraft feel, if that makes sense? I plan to use both mods as they seem to work together well.

I get why they don't allow placement on the sides of blocks like you do as vanilla doesn't allow Redstone on the sides of blocks. But it would be a dream if they could detect Redstone Pen and allow that orientation.

stfwi commented 9 months ago

Aye, agreed. Combining RS mods is a thing (I personally always have multiple in a pack, e.g. Danny's tiny RS stuff, RS gates, my stuff, etc).

It's understandable that many modders stick to the lateral redstone setups. I loved the Redstone Paste (1.12.2 mod), which was discontinued unfortunately (hence this Redstone Pen mod now). And I know now that vanilla like redstone in all directions is quite a tricky thing to do - mainly as vanilla bugs are used as features, and because you can have up to three different redstone networks in one single block. That is maintenance intensive if something changes in MC.

About the RLC: Simple thing: I try to keep the amount of blocks of the mod minimalistic, many feature requests up to now would require very specific blocks, which are used in only few situations - but everyone would have to invest the memory and CPU for that. So, the RLC is a generic solution for that - and as I am not good with designing UIs, it's textual programming. The upside: If one can program the RLC, s:he also can principally program industrial PLCs ... for what it's worth ... ;)

Cheers, wile

stfwi commented 9 months ago

I forgot in the comment above: About the resistor CR: We leave it open for checking how many people have that specific application. A potential implementation would be probably in a similar design as a relay with a trimmer (potentiometer) handle or disc on top. Also need to check if someone has that already it another mod - duping/copying features of active mods would be not nice.

lukescott commented 8 months ago

The use-case I have in mind is fairly common - reducing the output of a comparator. For example, out having a particular output when an inventory is completely full. Because "full" is 15, and partially full is anywhere between 1 and 15, having an indicator for only when something is completely full takes a lot of space to bleed out the signal so it hits the light only when full. A resistor could reduce a 15 signal to 1, 2, 3, etc. to require less track.

The RLC can do this, but it is a bit technical and less vanilla like. It's a great option for complex cases, but less friendly to the non-software engineer types. (I am a software engineer type, but I'm thinking about users that are not).

A voltage injector would just be the opposite. Instead of using a repeater w/ a delay that sends 15, you could boost a signal to a lower amount. Probably less useful than the resistor.

stfwi commented 8 months ago

Hi, oky vote registered, ty for the input.