Commit Graph

620 Commits

Author SHA1 Message Date
Zefram 77b8f6514a Better mesecon-enabled doors
The mesecons_compatibility doors erred in making steel doors, which
are meant to be locked, openable by anyone using a mesecon signal.
They also didn't handle mirror-paired doors, and nastily duplicated
lots of the standard door code rather than using it and adding to it.
Replace mesecons_compatibility with a new system, in which standard
doors are left alone and new types of door are added that have mesecon
behaviour.  The new door types are each available in both wood and steel,
using the standard door textures.

The mesecon-operated doors open and close according to the mesecon
signal they receive: open when the signal is on and closed when off.
Unlike the old mesecons_compatibility doors, which only accepted the
signal to the bottom half, these accept the signal to either half of
the door.  A convenient kind of control therefore is a wall-mounted
button just above the doorway: the signal flows diagonally down to the
top half of the door.  The door cannot be operated manually.

The mesecon-signalling doors are opened and closed manually, and generate
a mesecon signal indicating whether they're open, on when open and off
when closed.  Thus opening the door can trigger automatic activity.
Pairing a mesecon-signalling door with a mesecon-operated door results
in a door pair where right-clicking on one door operates both.

By making use of the pairing behaviour built into the standard doors mod,
which is inherited by the mesecon doors, and placing doors from sideways
angles, it is possible to effectively get mesecon doors with the opposite
signal sense.  For example, a mesecon-signalling door that sends an on
signal when closed, turning the signal off when opened.
2014-05-04 16:47:47 +02:00
Zefram b64fea4f70 Don't allow non-inventory items as ingredients
Some mesecon wires (the turned-on nodes) that were
not_in_creative_inventory and should never appear in an actual inventory
were also mesecon_conductor_craftable.  This is liable to make a craft
guide show them as potential ingredients, due to the use of the group
in recipes.
2014-05-02 09:07:52 +02:00
Jeija a6916191aa Fix #140 once again 2014-04-30 14:44:47 +02:00
Zefram f1eaee2281 fix programming microcontroller through form
The handling of the "quit" pseudo-field meant that the microcontroller
couldn't be programmed with explicit code, only with the examples.
The "quit" can actually be ignored: what matters for programming the
controller is whether the "code" field was supplied.
2014-04-25 18:30:59 +02:00
Jeija 300abcb587 Fix #155 (option 2 used). Remove non-ActionQueue system. Enable overheat for more than 20 actions per second on lua- / microcontrollers and gates.
Fix a bug where a burnt luacontroller didn't have the correct pin-states as the burnt controller does not register any changes from outside.
2014-04-20 21:51:17 +02:00
Jeija 1f66687580 Fix bug that made delayers oscillate their input port
when powering off the delayer faster than the delay time.
Actually, delayers should have never worked since the ActionQueue update as
they always used the default rules for their output, which is obviously nonsense.
2014-03-23 09:28:22 +01:00
Jeija 1852e967a9 Send changesignals for placed receptors when not powered, make on_placenode code more readable
with comments. Also fixes a bug of lua- / microcontrollers not being updated when pushed by a
piston.
This could cause some bugs, even though I haven't found any while testing as it is a very core part of mesecons.
2014-03-21 21:31:34 +01:00
Jeija a9427d267b Merge pull request #141 from ShadowNinja/commandblock_textarea
Use a textarea for the commandblock to accept multiple commands
2014-03-20 21:02:43 +01:00
Jeija 2cab6aa5ef Merge pull request #134 from Novatux/master
Fix a few bugs that caused effectors not to turn off sometimes
2014-03-20 09:28:03 +01:00
Jeija 37405e5a06 Fix #146 2014-03-19 15:13:23 +01:00
Jeija 3d2cfeace8 Fix #83 (experimental)
Why did we actually put the update action in a queue again? Whatever issue it that was for, I couldn't reproduce it.
Propably the ActionQueue fixed that...?
2014-03-19 14:47:22 +01:00
Jeija df6829e553 Remove timer() from LuaController and make interrupt() use the ActionQueue so that it will keep working when restarting the server 2014-03-19 10:20:43 +01:00
Jeija 39a0e56c18 Improve and clean up luacontroller digiline_send on globalstep feature 2014-03-19 09:11:07 +01:00
Jeija b50721c701 Merge branch 'digiline-non-reentrant' of https://github.com/CiaranG/minetest-mod-mesecons into CiaranG-digiline-non-reentrant
Conflicts:
	mesecons_luacontroller/init.lua
2014-03-16 21:12:50 +01:00
Jeija 38ff900274 Merge pull request #152 from CiaranG/timer
Add timer() function/event (node timer based) to luacontroller
2014-03-16 21:05:49 +01:00
Ciaran Gultnieks 9eda62df7b Add timer() function/event (node timer based) to luacontroller
This adds a timer(<seconds>) function, which causes an event of type
"timer" to be fired after that many seconds has elapsed.

Because it's node timer based, it works properly across server restarts
and block unloading. Thus, simplest example, a blinky plant replacement
with a 10 second period:

if event.type == "program" then
  timer(10)
elseif event.type == "timer" then
  port.a = not port.a
  timer(10)
end
2014-03-11 22:50:48 +00:00
Anthony 8440d05e8c Merge pull request #151 from CiaranG/lua-formspec
Handle luacontroller formspec events correctly
2014-03-11 18:11:35 -04:00
Ciaran Gultnieks 5d3cba0bd4 Handle luacontroller formspec events correctly
Example of problem fixed by this: Edit lua code, press Execute. Now
(execute button has focus), hold down a key. Zillions of "program"
events are generated.
2014-03-11 17:54:56 +00:00
Ciaran Gultnieks 5002315ec9 Send digiline messages after luacontroller execution
In the same way as for port settings, this queues up digiline messages
sent during the luacontroller's execution, and sends them afterwards.
This solves many problems, but one example:

1. Send a message, and receive a reply from another device.
2. While handling the reply event (effectively a nested invocation
   on the same luacontroller) make a change to memory
3. Notice that the memory change has no effect, because after
   completion of the reply handling, it stores the memory, but then
   the original invocation completes and overwrites it with it's
   own earlier copy of the same memory.
2014-03-11 17:34:30 +00:00
Jeija a59f53d71a Merge pull request #148 from CiaranG/upper
Add missing string.upper to luacontroller
2014-02-16 14:33:35 +01:00
Ciaran Gultnieks c240d399fb Add missing string.upper to luacontroller 2014-02-16 13:28:07 +00:00
Jeija ee3797746f Fix #140 by adding a save button to the Player Detector 2014-01-19 14:12:34 +01:00
Jeija 8a71f51b26 Merge branch 'actionqueue'
This introduces the ActionQueue, a new kind of MESECONS_GLOBALSTEP.
Circuits using delayers will now resume when restarting the server.
Also, large circuits should automatically resume if parts of them are
in unloaded chunks.
Old circuits e.g. using gates will not resume when mesecons is updated,
which means you have to restart them once. But after that, it should work
just like it used to.
This will fix a lot of stuff but may also introduce some new bugs.
So please report them!
2014-01-19 13:59:22 +01:00
Jeija a632a8abc8 Fix delayers and disable resuming if not using MESECONS_GLOBALSTEP 2014-01-19 13:57:11 +01:00
Jeija a6bd955449 Merge pull request #144 from Novatux/gates-fix
Fix gates with serverstep code.
Let's give that a try.
2014-01-11 23:17:14 -08:00
Jeija 6c979a6ebb Merge pull request #142 from Novatux/actionqueue
Action Queue bugfixes by Novatux
2014-01-11 11:19:52 -08:00
Novatux fe50e87da1 Make receptor_on/off overwritable, fix a serious bug. 2014-01-11 20:12:22 +01:00
Jeija c8ef37f522 Actionqueue tweaks 2014-01-11 20:11:54 +01:00
Jeija 1a492feb7a Turnon/turnoff overwritable 2014-01-11 18:31:30 +01:00
ShadowNinja eea4dbbea8 Use a textarea for the commandblock to accept multiple commands 2014-01-11 12:15:01 -05:00
ShadowNinja cd30aed807 Fix #136 by always running commands as the placer 2014-01-11 11:42:23 -05:00
ShadowNinja 76b9198717 Revert "Remove command block until #136 is fixed"
This reverts commit 3f76b77001.
2014-01-11 11:42:23 -05:00
Jeija d066b91632 Fix infinite priority bug in mesecon:turnoff, thanks to Novatux 2014-01-11 16:48:25 +01:00
Jeija 1083539e9b Resume turnon/off calls as soon as area is loaded in case turnon/off calls end in unloaded territory 2014-01-11 16:46:27 +01:00
Jeija 6afded8284 Fix unloaded area in receptor_off, yet it was only fixed in receptor_on 2014-01-11 16:18:35 +01:00
Jeija ff5e315325 Fix ActionQueue delays 2014-01-11 15:36:30 +01:00
Jeija f1211f7dae Add ActionQueue priority system
This makes effectors nearer to the source of the action (the receptor) update first.

This defines behaviour for this piston circuit: http://i.imgur.com/9Pp2Mzb.png
And defines, that this memory circuit does not work from this direction: http://i.imgur.com/jJn0aFh.png
But it will work when using the switch from the other side: http://i.imgur.com/nvw0oZB.png

Only if two effectors have the same distance, there is nothing we can do about it, behaviour is not defined.
"Distance" is determined by the stack size of recursions in turnon / turnoff.
Priorities are between 0 (lowest) and 1 (highest).
2014-01-11 14:57:56 +01:00
Jeija 93fb489bdb Fix the bugs spotted by Novatux - thanks for spotting them 2014-01-11 08:57:21 +01:00
Novatux f1ae54ed12 Try to fix gateswith serverstep code. 2014-01-11 07:24:42 +01:00
Jeija 7517cc4af1 Add dummy mesecons_commandblock/init.lua as we keep the textures in that folder 2014-01-10 23:13:07 +01:00
Jeija c067e52714 Merge pull request #138 from ShadowNinja/split_textures
Move textures into their mods
2014-01-10 14:10:20 -08:00
Jeija 2d004b19ea First draft of some kind of Action Queue (just like the globalstep queue in to_update), but more flexible and also including delay functionality (mesecon_delayer).
The queue is also saved to a file, so that when restarting mesecons, delayers resume to the state they had when the game shut down. Needs testing.
2014-01-10 22:33:40 +01:00
ShadowNinja de6dd30745 Move textures into their mods 2014-01-10 13:13:02 -05:00
Jeija 3f76b77001 Remove command block until #136 is fixed 2014-01-09 17:39:59 +01:00
Novatux 5e02b3beef Fix a few bugs that caused effectors not to turn off sometimes (rules_link is evil!) 2014-01-05 13:51:09 +01:00
Jeija 39361fb719 Merge pull request #133 from Novatux/master
Use swap_node instead of add_node when replacing conductors.
2014-01-05 01:01:53 -08:00
Novatux 9c2a5c313c Use swap_node instead of add_node when replacing conductors. 2014-01-05 09:52:06 +01:00
Novatux fb417d45a7 Fix when there are several rules with different specials 2014-01-04 17:22:04 +01:00
Novatux b3f3692622 Fix crash if metarule not found 2014-01-04 16:51:52 +01:00
Novatux ae557d1cd4 Fixes with multi-conductors that have special connects 2014-01-04 15:52:52 +01:00