[Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat Jan 05, 2013 10:18

Hmm... seems like that won't work then.

sapier wrote:I've found a hacky way to work this around by specifying a empty table to mesecon node variable being modified later depending on mesecon present or not ... don't know if its legit to modify a node definition while game is running but atm it seems to work.

Still in prior versions of mesecons this could be done with as less as 3 lines of code :-(


BTW your way *is* legit, even if you already called register_node on the "nodedef". You can modify the tables as long as the game is not started yet. minetest.register_node() just puts the nodedef in a list, and the engine actually creates the nodes *after* loading *all* the other mods.
Ergo, this is valid code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local nodedef = {
    -- your props here
}
minetest.register_node("foomod:barnode", nodedef)

-- ...
-- Some more code here
-- ...

if (somehow_found_mesecons) then
    nodedef.groups.mesecons = 1
end



BTW I'm not very familiar with the new API. Sowwy.
Last edited by kaeza on Sat Jan 05, 2013 10:21, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jan 05, 2013 11:56

sapier wrote:
kaeza wrote:
sapier wrote:It's not possible to create a mod with "optional" mesecon support anymore.
Node registrations have to be on load so in any case you need to have mesecon loaded prior to your mod.

Knowing if mesecon is installed or not won't help as you can't register your nodes.

This WAS possible in prior mesecon versions!

How about this?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local mesecons_path = minetest.get_modpath("mesecons_foobar")
if (mesecons_path) then
    dofile(mesecons_path.."/init.lua")
    -- add your mesecon registration calls here
end


This will only work if your mod happens to be loaded AFTER mesecons as you need to use "mesecon.status.on/off" in your node registrations.

EDIT1:
" -- add your mesecon registration calls here" fails as there are no function calls anymore you need to specify mesecon data on register_node ...

I've found a hacky way to work this around by specifying a empty table to mesecon node variable being modified later depending on mesecon present or not ... don't know if its legit to modify a node definition while game is running but atm it seems to work.

Still in prior versions of mesecons this could be done with as less as 3 lines of code :-(

You dont have to use mesecon.status.*, you can just use "on" and "off".
The new API allows flexible requirement of mesecons because you dont have to call mesecon:register_*. Putting it in the node definition allows every mod define the mesecons functionality without depending on mesecons.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sat Jan 05, 2013 12:12

That's totally wrong, sapier. The new Mesecons API was made in order to allow optional dependencies, see this Issue here: https://github.com/Jeija/minetest-mod-mesecons/issues/54
You can now soft-depend on mesecons without stupid workarounds.
Unfortunately, you cannot use mesecon.state.on/off, but use "on" or "off" instead, you also cannot use preset rules (mesecon.rules.default/flat/...), but you can define that on your own ones.
Last edited by Jeija on Sat Jan 05, 2013 12:25, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Jan 05, 2013 20:15

PilzAdam wrote:You dont have to use mesecon.status.*, you can just use "on" and "off".
The new API allows flexible requirement of mesecons because you dont have to call mesecon:register_*. Putting it in the node definition allows every mod define the mesecons functionality without depending on mesecons.


@jeija ... putting this information to mesecon page is crucial!
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sat Jan 05, 2013 21:26

Maybe you need to delete your cache, because I added that at the very top a while ago.
Redstone for minetest: Mesecons (mesecons.net)
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 06, 2013 02:05

Hmm .. I do have to appologize I haven't seen it.

I wouldn't have searched for this information in subtitle either, but I assume thats my fault.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Sun Jan 06, 2013 18:51

Maybe it's silly question... is there a way to download older versions of Mesecons?
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Sun Jan 06, 2013 22:12

Ragnarok wrote:Maybe it's silly question... is there a way to download older versions of Mesecons?

Not a silly question at all. However I can't answer this as I don't know myself.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Mon Jan 07, 2013 15:54

If you want to have old versions, just use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
git reset --hard <commit id>
on the repo.

(This is a list of very old versions available for download:
https://github.com/Jeija/minetest-mod-mesecons/issues/64#issuecomment-11616810)
Last edited by Jeija on Mon Jan 07, 2013 15:54, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

rarkenin
Member
 
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Mon Jan 07, 2013 23:40

IS it possible to have wireless interactivity between mesecon circuits? Like per-chunk radio, with selectable frequencies? Or map-wide radio, assuming the sending and receiving chunks are both active?
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Tue Jan 08, 2013 16:45

Wireless stuff is on my to-do list, but there are other things that are more important for mesecons.
Redstone for minetest: Mesecons (mesecons.net)
 

Spots
Member
 
Posts: 124
Joined: Tue Jul 24, 2012 12:12

by Spots » Tue Jan 15, 2013 17:20

i'm slow and not very go at figuring things out easy ,is there a way to make something out of mesecons like a timer switch so you can set a time limit for it to turn on and off at intervals and not use the blinky plant?
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Tue Jan 15, 2013 19:14

A delayer may be useful to that end. If not that, then use a microcontroller.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

Spots
Member
 
Posts: 124
Joined: Tue Jul 24, 2012 12:12

by Spots » Tue Jan 15, 2013 20:30

yea not too sharp on that end ,cant figure out how to program the microcontroller
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Tue Jan 15, 2013 21:10

You don't necessarily need a microcontroller, though it is often more compact to do so. A bunch of delayers in a loop will also work as a clock. To start it, simply turn the starting one on and off again really fast. Here's a simulation:

Image
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

Spots
Member
 
Posts: 124
Joined: Tue Jul 24, 2012 12:12

by Spots » Tue Jan 15, 2013 22:28

got ya worked like a champ thanks tons
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Tue Jan 15, 2013 22:36

Temperest wrote:You don't necessarily need a microcontroller, though it is often more compact to do so. A bunch of delayers in a loop will also work as a clock. To start it, simply turn the starting one on and off again really fast. Here's a simulation:

Image

what program is this. is it this one http://forum.minetest.net/viewtopic.php?id=1172
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
LionLAD
Member
 
Posts: 307
Joined: Wed Jul 11, 2012 21:50

by LionLAD » Thu Jan 17, 2013 23:37

Hello Jeija i have taken my time to make you this...
COMMAND_BLOCK OFF
Image

COMMAND_BLOCK ON
Image

if you wish to use theas textures here is the download:
http://www.mediafire.com/?23um4efq784qk06

(mater of fact any one who wan't to use them can... i prefer them over the regular command_block textures but that is a mater of who/what you are)
In game names:LAD,captainLAD,LionLAD
This is a signature virus. Add me to your signature so that I can multiply.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sat Jan 19, 2013 11:10

Redstone for minetest: Mesecons (mesecons.net)
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sat Jan 19, 2013 23:34

The future plans of mesecons

You may have already seen the 1.5 Redstone Update in Minecraft Snapshot 13w01a: http://www.youtube.com/watch?v=AeHBqNvFYgc
First of all congrats to Mojang for finally being able to imitate a piston-moveable block ;).
Secondly, it seems like Minecraft Redstone goes somewhat in a different direction than mesecons.
So I guess it is time to decide on we're gonna do.

1) Adapt to Redstone and introduce signal levels, repeaters, comparators and so on.
+ Easier for Minecraft players to understand mesecons;
This also allows a "Daylight Detector Blocks" with signal strength
- This is a huge change and does not really seem realistic
Modern circuit design is more like mesecons, not like redstone --> change would be less realistic

2) Stay the way that Mesecons is right now
+ More realistic, use an established system, more user-friendly for new players imo
- We cannot make use of signal strenght, detect time etc. <--- disadvantage!
Minecraft users are not familiar with this system

The current system mostly has advantages, however, there is a significant disadvantage: We cannot use signal level and therefore cannot process analogue signals.

Another Mod: Digilines

This is my proposal to work around this:
I coded a mod called "digilines" that adds some kind of data bus system. You can use it to transmit all kind of data, light levels, integer and string values, weight,...

This is a video of it as a data bus in action:
Image

You can download the new digilines from here:
https://github.com/Jeija/minetest-mod-digilines/

The policy of digilines:
I'm only going to support a very minimal core of digilines, that include the wires and the transmission functions as well as the implementation for the luacontroller, nothing else.

You may ask me for help or code for other nodes, but it will be your job to maintain these items. They will also be included in digilines.
An official release of digilines as a seperate mod is planned in a few days maybe.
It still needs at least a light detector, maybe a node name detector.

I'm interested in your opinions!
Last edited by Jeija on Sat Jan 19, 2013 23:37, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Sun Jan 20, 2013 00:39

Thanks for the update!

As we discussed earlier, I'm all in favor of option #2. Therefore, digilines is super exciting to me. It's now a part of my default MT install.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sun Jan 20, 2013 01:08

Go with option number 2, but find a way to fix those limitations if you can. It would also be a good idea to try to improve compatibility with mods that rely on mesecons (like technic and bobblocks) since the newest version of it is not compatible with them.

Digilines does have the potential to add functionality to this mod.
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

by addi » Sun Jan 20, 2013 03:03

Number 2

i prever a daylignt / time sensor like the real life.

signal strengh (analog technology) is today just outdated!



a time switch (Zeitschaltuhr)

binary: the user (placer) configure 2 times and between that times the block swithes on
digital: i havnt see that in real but may clock that make a digital signal


light sensor

binary: the placer configure a minimum light and when its over the block swithes from off to on
digital: a digital light sensor that translate the light into a digital value

the digital technics needs also some digital/binary swither too

a compare block that compares 2 digital value and set on or off

a move block it moves a digital signal from input to output if it on

a threshold trigger(schwellwertschalter) if the digital signal between 2 configurable values it switches on

a digital addition ++

digital subtraction --

digital multiplication **

digital division //


and important a counter block that counts the on/off swithes of a binary wire

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all

------- binary wire

======= digital wire
      __________________________________
      |                                |
------| input (cout up or down)        |
      |                                |==============output (counter value)
      |                                |
------| input (count)                  |
      |                                |
      |                                |
------| input (reset)                  |
      |                                |
      |________________________________|


...


dammed of that stupid minecrafters!

minetest shuld go his own way!
and mesecons shuld not = redstone!
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sun Jan 20, 2013 05:12

The digilines mod sounds very promising! That would add something I miss - a way to handle transmission of data without having to do circuit design on a very low level and fighting with too many parallel lines.

Maybe the signal level is a way of dealing with technical limitations: If the signal decays automaticly, there is less to worry about if the player builds large circuits since the player is disencouraged from building them or forced to spend more time on it.

So please go with option 2 and write that mod :-) If a delay is needed that could still be done through lua functionality for special nodes.
A list of my mods can be found here.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 20, 2013 06:06

@addi: Everything you mentioned apart from the light sensor exists!
You can process digital signals using the luacontroller, do whatever you want: addition, multiplications, comparations, ...
The only thing that digilines misses is inputs and outputs, these are yet still binary (mesecons).
I'm not sure on how to deal with input/outputs for digilines. We could say that we don't really want them but use different channels instead, but I may also add them if you want me to (the functionality is there, just not used by the luacontroller yet).

In case s.o. needs it: I wrote a debugger mod for digilines, it allows you to send messages and it prints received transmissions. When you place it, the input of that block is on the left, the output on the right.

The compatibility with other mods that use mesecons is the mod owners responsibility. I announced the API change a long time before it actually took place, and that change was basically there to improve depending stuff, so compatibility.

And a display for messages like thexyz's signs would also be nice in case s.b. wants to adopt that item.
Last edited by Jeija on Sun Jan 20, 2013 06:09, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sun Jan 20, 2013 06:13

Suggestion: frames, that can be pushed by pistons and make all connected frames and nodes move with them.

EDIT: time detection could be possible, storing it in several lines.
Last edited by Nore on Sun Jan 20, 2013 06:43, edited 1 time in total.
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 20, 2013 07:16

Check that digiline multiplayer out!
Image
Redstone for minetest: Mesecons (mesecons.net)
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sun Jan 20, 2013 07:21

Why are the loops prohibited in the lua controller?
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

by Jeija » Sun Jan 20, 2013 07:52

Because of endless loops that could crash the server. Use interrupt(time, id) instead, it calls the whole code after a certain time again with event.iid = id.
Or just call a function from itself, also kind of a loop.
Last edited by Jeija on Sun Jan 20, 2013 07:53, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sun Jan 20, 2013 07:55

Could you make a tutorial for the lua controller?
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: Bing [Bot] and 4 guests

cron