Page 71 of 78

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Mon Apr 10, 2017 15:29
by ThomasMonroe
i never thought about a switch case, *faceslap*
even though i knew it was there *another faceslap*

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Mon Apr 10, 2017 15:49
by Desour
Hybrid Dog wrote:You could implement switch-case in luacontroller.
AFAIK lua has no switch-case. It hasn't even labels, so it would make no sense. But you can make your own switch-case.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 11, 2017 22:11
by ThomasMonroe
duh that why i never thought of it

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Sun Apr 23, 2017 00:31
by v-rob
I found some interesting ideas for mesecons. I know my earlier ideas were bad, but these ones, I hope, are better.

The first things would be an SCR and an SCS.

Image

The SCR (Silicon Controlled Rectifier) is like a diode, except for power to go through it, it needs a shock of power from the gate. When power goes through the gate, the gate doesn't need power anymore, and the SCR will act like a diode until the main power turns off.

The SCS (Silicon Controlled Switch) is the same, except it has another gate called the anode gate. This turns off the power in the same way as the gate turns it on.

A third gate could be made with only the anode gate and no normal gate, and power would always get through until turned off with the anode gate. As far as I know, this doesn't actually exist, so I can't show an abbreviation.

An interesting thing about these logic gates is that they can have multiple gates and anode gates.

Manually made gates
SCR: Image
SCS: Image
Nameless Gate: Image

An LED would be useful. It would be a diode and a flow sensor in one, plus the fact that it can come in many colors. A small lightbulb would be another good flow sensor, and it wouldn't have a diode built in. The main difference between these and lightstones would be that power could flow through the lightbulb and the LED as opposed to just stopping like the lightstones.

A useful thing would be a switch plant. The plant would have two ports for producing power and would act similarly to a blinky plant. It would switch from each port every three seconds. This could be made with two blinky plants, but it is extremely annoying to have to synchronize them properly. Delayers don't work for this, since they take time to turn off.

I would like a capacitor similar to this:

Image

The capacitor would be charged through one wire, and once it is charged, the light in the corner would turn green, and power could be released by turning on another wire, by clicking on it with the mouse, or automatically. I don't really know how this would be done. Different capacitors could hold different amounts of power, like one second, three seconds, five seconds, ten seconds, a minute, etc.

There are solar panels, but what if there was a lunar panel that makes electricity at night? You could make one with a solar panel and a not gate, torch, or an xor gate, but those aren't compact. A lunar panel could be red or something and crafted like this:

[--, --, --]
[solar_panel, mesecon_torch, mesecon]
[--, --, --]

A different craft could be used. That one is just a sample of what it could be.

Lastly, I would like a photoresistor. When it has light, it lets power through. When it is dark, it doesn't. Similar to the solar panel, I would like an inverted one. It could have a similar craft and be called a photoconductor.

I hope some of these things can be implemented into mesecons.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Sun Apr 23, 2017 05:32
by ABJ
How about replacing logic gates with transistors?

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Sun Apr 23, 2017 20:31
by v-rob
ABJ wrote:How about replacing logic gates with transistors?
Transistors should be made, but logic gates should still be kept. They save space.

I forgot something. There is a logic gate not included in mesecons: XNOR. The XNOR logic gate powers its output if both inputs are powered or not powered. If only one is powered, then the output is not powered. Its symbol looks like XOR, but it has a circle at the end, like the NOT gate.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 09:19
by ABJ
You mean if both inputs are same?

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 09:41
by Linuxdirk
v-rob wrote:There is a logic gate not included in mesecons: XNOR. The XNOR logic gate powers its output if both inputs are powered or not powered. If only one is powered, then the output is not powered. Its symbol looks like XOR, but it has a circle at the end, like the NOT gate.
https://en.wikipedia.org/wiki/XNOR_gate#Alternatives

:)

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 13:46
by v-rob
Oh... I never thought of that. Then again, the XNOR gate would save space, just like how the OR can be two diodes but they made a gate anyway. Interesting though. I'll keep that in mind if the XNOR isn't put in mesecons.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 14:04
by ABJ
That is why I said transistors.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 14:07
by Linuxdirk
v-rob wrote:Oh... I never thought of that. Then again, the XNOR gate would save space, just like how the OR can be two diodes but they made a gate anyway. Interesting though. I'll keep that in mind if the XNOR isn't put in mesecons.
Actually you can build all logic gates using NAND gates only. So all gates except NAND gates are just space savers.

But I'm a little torn about this. Either only use the most common gates. (In the end XNOR isn't that wide spread.) Or implement XNOR (It's the only logic gate missing from the standard logic gates)

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Tue Apr 25, 2017 16:36
by Desour
@v-rob: We don't need a XNOR gate, just use a fpga.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed Apr 26, 2017 03:01
by v-rob
Seeing as no one will make it, I made the XNOR gate. Anyone who wants to can just copy this into the logic gates' init.lua, or someone could actually put this into the main mod.

Code: Select all

register_gate("xnor", 2, function (val1, val2) return not (val1 or val2) or (val1 and val2) end,
	{{"mesecons:mesecon", "", ""},
	 {"mesecons_materials:silicon", "mesecons:mesecon", "mesecons_torch:mesecon_torch_on"},
	 {"mesecons:mesecon", "", ""}},
	"XNOR Gate")
Make a different craft if you want. I don't really care. Also, the symbol is nearly impossible with the space provided in the texture, so make your own.

I did suggest other things, so I would like your input on those, too. I can't program the transistors I had an idea for (I just guessed on the XNOR until I got lucky), and I would really like to have them, along with most of the rest of my ideas.

By the way, I made an orange and a purple lightstone. Put this at the bottom of the lightstones' init.lua if you want them.

Code: Select all

mesecon.lightstone_add("purple", "dye:violet", "jeija_lightstone_purple_off.png", "jeija_lightstone_purple_on.png")
mesecon.lightstone_add("orange", "dye:orange", "jeija_lightstone_orange_off.png", "jeija_lightstone_orange_on.png")
Full rainbow now! :)

Textures are attached.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed Apr 26, 2017 12:40
by Desour
@v-rob: The forum is the wrong page for this, go to the github mesecons repository.
Btw, there were already discussions for more lightstones.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed Apr 26, 2017 13:16
by JoshMars
DS-minetest wrote:@v-rob: The forum is the wrong page for this, go to the github mesecons repository.
Btw, there were already discussions for more lightstones.
Sometimes it's nice to put little additions into the forum because they're not likely to be pulled, don't merit a whole new branch, and fit nicely here for anyone else who is interested.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed Apr 26, 2017 22:53
by v-rob
Sorry if I shouldn't have done that. I just want people's input on my ideas, so I put the XNOR code there to stop the argument over it. Could some people just give me their honest opinions on my ideas? If it matters that much just for this to be on GitHub, tell me. Thanks.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Mon May 08, 2017 06:59
by ratmix
Is there a way to perform an action if 'x' number of players is detected? For example, I would like to teleport players to a PvP area if there are 4 or more in a waiting room. There are many other applications I need this for and would greatly expand our possibilities.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Mon May 08, 2017 10:49
by blackjack
ratmix wrote:Is there a way to perform an action if 'x' number of players is detected? For example, I would like to teleport players to a PvP area if there are 4 or more in a waiting room. There are many other applications I need this for and would greatly expand our possibilities.
We did just, what you asked for using pressure plates.
In our world, we port 2 players to the PvP arena as soon as both went onto the plate.
Can also be done with 4 easily ...

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Mon May 08, 2017 19:41
by ratmix
We did just, what you asked for using pressure plates.
In our world, we port 2 players to the PvP arena as soon as both went onto the plate.
Can also be done with 4 easily ...
Thanks @blackjack
The only problem is that two or more players can stand on the same pressure plate so the solution may fail. Also I need to evacuate & reset the pvp area when only 1 player is left, so the entire pvp area and player's building blocks would have to be made from pressure plates.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 09:25
by blackjack
ratmix wrote:Also I need to evacuate & reset the pvp area when only 1 player is left
We did it like in 'Mad Max - Beyond Thunderdome"
< Two men enter, one man leave > :D

From each pressure plate, just one player (the nearest) will be ported. So two will enter the PvP arena. One will respawn, the other has to leave through the one and only exit gate.

Before entering the arena, everyone has to empty his / her inventory.
Then all players will get the same equipment, tools, weapons (on our server).

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 10:45
by bosapara
I made the Music Building Machine using lua controllers, noteblocks, digiline lcd display and etc

24 notes, 2 octaves

In the memory at the moment at least 6 melodies

Here you can see the screen and video

https://www.youtube.com/watch?v=EZDCdbw9WDQ

Image

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 12:33
by Desour
@bosapara: Nice! I thought, something like that would lag too much.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 13:19
by bosapara
DS-minetest wrote:@bosapara: Nice! I thought, something like that would lag too much.
Thanx you very much.

I was helped by really great coder.

Soon will be completed "Drum & Piano" machine, it is 31 sounds type

Here you can see preview of 1.0 and 1.1 version of this building
1.0 https://www.youtube.com/watch?v=8InNIsEqxT8
1.1 https://www.youtube.com/watch?v=5r6u5llpFMI

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 15:56
by Desour
I've tried to build something similar:
Image
screenshot_20170510_174509.png
screenshot_20170510_174509.png (62.38 KiB) Viewed 1294 times
It doesn't work as good as your machine. Perhaps the reason for that is lag. Also how did you make the music, did you write it in code?

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesec

Posted: Wed May 10, 2017 16:20
by bosapara
DS-minetest wrote:Also how did you make the music, did you write it in code?
Yes, any sound was decoded as an example note "c" of 1th octave = "a", "c#" = "b" and etc