Commit Graph

224 Commits

Author SHA1 Message Date
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
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 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
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
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
Novatux d5b39951a4 Fix bugs with multi-rules conductors (like crossing) that have param2 2014-01-04 14:15:41 +01:00
Uberi 16b4b79c51 Update code to standards of Minetest 0.4.8. 2013-11-30 22:13:00 -05:00
Uberi b4654cedb7 Compat shim for minetest.swap_node, lightstone conducts from the bottom. 2013-11-30 21:23:58 -05:00
Vanessa Ezekowitz f46bc329de Use minetest.swap_node() instead of mesecons' version, Minor code changes
here and there to facilitate this.
2013-11-30 20:34:55 -05:00
khonkhortisan 913e355a71 Merge pull request #112 from khonkhortisan/multi_rules
Multi rules
Merged for near-future textures to be merged cleanly.
2013-08-27 22:22:30 -07:00
Anthony Zhang 96011bc718 Audit code for possible nil value indexing with unregistered nodes. 2013-06-22 15:43:58 -04:00
khonkhortisan 885899cbaf Crossover 2013-06-20 09:30:26 -07:00
khonkhortisan 4f2604e01b mesecon:rules_link nil return rule
Fixes https://github.com/Jeija/minetest-mod-mesecons/issues/108
2013-06-10 18:29:40 -07:00
Novatux afad592783 Change mesecons signals so that they update effectors only after a globalstep, configurable to be on/off 2013-06-05 15:37:55 -04:00
Novatux edc10dac47 Add an ABM function which resets heat to 0, since gates/controllers won't be cooled normally if they are moved (piston, etc...) during the cooling delay. 2013-06-05 06:45:19 +02:00
RealBadAngel 255e363b04 Fix all crafting recipes to use modern style 2013-04-28 12:40:08 +02:00
Anthony Zhang 10bacdd7f4 Update selection boxes to make building easier. 2013-04-20 11:25:12 -04:00
Anthony Zhang 3b1afb1783 Fix invalid node name if node was changed in after_place_node callback (fixes #93). 2013-04-14 13:54:33 -04:00
Jeija 57e1547515 Make pistons and movestones move objects (push only yet) 2013-04-02 11:57:28 +02:00
Anthony Zhang 5f9e655c13 Add MOVESTONE_MAXIMUM_PUSH setting. 2013-03-15 19:53:09 -04:00
Jeija 10ea3c971b Merge branch 'master' into luacontroller 2013-02-11 08:03:08 +01:00
Anthony Zhang 5b5e919683 Make load times faster by avoiding inventorycube and wielditem creation in technical blocks such as active wires and various piston orientations. 2013-02-08 14:36:20 -05:00
Jeija ef087f2bb6 Fix Bug: Wrong usage of action_on/action_off instead of action_change 2013-01-19 23:37:03 +01:00
Jeija 841bc70b97 Fix a bug that occured when using a receptor placed directly next to a
gate.
We need to call a changesignal even if the gate/other effector is still
connected to a power source in a way.
2013-01-09 16:56:25 +01:00
Jeija ec07fc27d7 Merge branch 'nextgen'
Conflicts:
	mesecons/wires.lua
2012-12-31 18:32:46 +01:00
Vanessa Ezekowitz 5921f6d46c made tweaks to the way mese is converted to mesecons. If old mese paradigm is
in use, one default:mese crafts to 18 mesecons wires.  If new paradigm is in
use, cook one mese crystal fragment to get 2 wires, or cook one mese crystal to
get 18, or cook one mese block to get 162.  Avoids conflict with new default
recipe that crafts 9 crystals from one mese block.
2012-12-28 16:51:11 -05:00
Jeija 7e231b99a6 Make nr in rules rotation local in order not to pullute the holy global namespace 2012-12-28 07:33:16 +01:00
Jeija ac0fb91139 Minor cleanup of mesecno torch and add another rule to it (behind above) 2012-12-27 10:50:20 +01:00
Jeija 7fe4947056 Bugfix foes for pistons, delayyrs, gates and microcontrollers. Rework delayers. 2012-12-27 09:28:04 +01:00
Jeija d91e0b66cb Re-write pistons from scratch, propably fixes a lot of bugs and doesn't cause too many new ones. 2012-12-26 22:54:28 +01:00
Jeija 973a9c650f Add new crafting recipe for mesecons: Cook a mese crystal 2012-12-21 16:19:38 +01:00
Jeija 313b9adcd5 Should fix this bug: bit.ly/XEy94j 2012-12-18 15:59:23 +01:00
Jeija 5fb5df446c Bugfix, use param2 for conductors when turning them on/off 2012-12-15 21:23:38 +01:00
Jeija c0d3bd2abb Include experimental vertical wires (needs textures) 2012-12-13 18:42:45 +01:00
Jeija 23bebfc054 Merge branch 'master' into nextgen
Conflicts:
	mesecons/internal.lua
	mesecons/wires.lua
	mesecons_pistons/init.lua
2012-12-21 16:22:25 +01:00
Jeija 9019a4aff7 Bugfix, wires sometimes turned off for no reason 2012-12-21 16:04:19 +01:00
Jeija 6b1bfe6391 Add rule-name system. Every input rule can now have a name, that could help e.g. the microcontroller to know where a signal comes from. 2012-12-19 17:34:05 +01:00
Jeija 2c4a46a557 Minor cleanup, use addPosRule 2012-12-16 16:29:03 +01:00
Jeija c76c274cc0 Remove mesecons:updatenode 2012-12-16 12:00:11 +01:00
Jeija a1852204fb Cleanup and improve piston code 2012-12-16 11:58:43 +01:00
Jeija 18731cbc8a Bugfix, param2 for conductors 2012-12-15 21:21:54 +01:00
Jeija 44dc1a128c Upload cleaned up mesecons to nextgen branch 2012-12-15 18:45:51 +01:00
Jeija 659060ddcd Fix a bug that occured when placing an effector next to a receptor 2012-12-11 19:54:53 +01:00
Jeija de46729b97 Merge branch 'mesecons_in_nodedef'
Conflicts:
	mesecons/internal.lua
2012-12-11 19:49:55 +01:00
Jeija 192b9eca4f Fix crash when digging unknown nodes 2012-12-10 21:14:03 +01:00
Jeija e9f2beb2c6 Slightly change wire look (may be reverted?) 2012-12-10 20:39:12 +01:00
Jeija 5904abbd79 Port gates (finally) 2012-12-10 19:46:24 +01:00
Jeija 961b955f2d Port door, fix button/lever bug, new visual style for receiver 2012-12-09 13:28:32 +01:00
Jeija b37bdbf55c Port a lot more (basically everything apart from gates, pistons and extrawire crossing) to the new nodedef system. There are some problems with wall button and wall lever (in the way they visually connect to wires) 2012-12-09 00:42:30 +01:00
Jeija cf6080f723 Port more blocks to nodedef system: object detector, extrawires, water turbine, insulated wire 2012-12-08 22:28:46 +01:00
Jeija 00e071b695 Cleanup, make and use util.lua, port command block and delayer to nodedef 2012-12-08 21:56:09 +01:00
Jeija 8578fd89c8 Port lightstones (as reference for effectors) + blinky plant to the new nodedef system 2012-12-08 19:02:34 +01:00
Jeija 472650f099 Finish new mesecon-in-nodedef for conductors and receptors. Make wires and switch use it for reference. 2012-12-08 17:50:25 +01:00
Jeija f28cf0af03 Fix major bug that often occured when using gates (caused by commit 64d109b) 2012-12-08 16:08:16 +01:00
Jeija e0aa5b1d3d New branch: Move mesecon to node definition instead of functions like register_conductor; first steps: move everything to legacy 2012-12-08 14:14:04 +01:00
PilzAdam 4a8e20b68e Speed update of pressureplates up by using node_timers 2012-12-07 15:52:52 +01:00
Jeija 7542dd4da0 Fix a bug (in some cases the output rules of a receptor weren't respected, bug introduced by commit before, 64d109b31b) 2012-12-03 18:59:34 +01:00
Anthony Zhang 64d109b31b `mesecon:updatenode()` was written to work only with conductors, though in several places it was used on recepters and effectors. This issue, reported by simion314, is fixed in this commit by explicitly checking for the type of mesecon node being updated. 2012-12-01 18:34:05 -05:00
Jeija f959c16763 Fix Microcontroller bug (discovered by Fenris) and some others that propably noone found 2012-09-08 15:10:31 +02:00
Jeija 4ae7bc9aa6 Use sunlight_propagates = true for some more nodes 2012-09-07 15:59:49 +02:00
Jeija 3928d54d0c Implement mesecon:register_receptor(onstate, offstate, rules, get_rules) and make add_receptor_node(_off) deprecated 2012-09-06 09:53:30 +02:00
Jeija 7e7e1de725 Code cleanup 2012-09-05 23:52:09 +02:00
Vanessa Ezekowitz bca93e8287 minor tweak to vertical mesecons wire stubs to help with z-fighting objects
above them
2012-08-21 14:19:28 -04:00
Jeija 15fa38b848 Switch from tile_images to tiles = {...} 2012-08-20 10:12:10 +02:00
Jeija 863ef26b63 Make isolated wires depend on facedir, rename them to 'insulated' 2012-08-17 11:59:06 +02:00
Jeija 78fdedc880 Add conductor rules, add demo isolated mesecons to proof that it works 2012-08-16 21:24:06 +02:00
Jeija 6214dbf66e Remove Temperest setting as it is an extension now 2012-08-15 11:11:13 +02:00
Jeija c58882b0c6 Bugfix: Check if receptor node is powered from somewhere before turning it off in mesecons:turnoff 2012-08-13 22:42:45 +02:00
Jeija 9396ce8940 Re-enable backwards compatibility (sorry for disabling) 2012-08-13 21:51:41 +02:00
Jeija 00ce2540c2 New effector system, effectors have to be registered with mesecon:register_effector(onstate, offstate, rules, function get_rules) rules and function get_rules are optional. You don't have to specify both onstate and offstate (required for e.g. removestone) 2012-08-13 20:17:45 +02:00
Jeija 24c50571f7 Make mesecons only connect to input and output ports (e.g. of the delayer) 2012-08-13 16:49:14 +02:00
Jeija b197d29bef Code cleanup, little bugfix (some conductors placed next to receptors didn't turn on) 2012-08-13 13:12:19 +02:00
Jeija 987de2c7d5 Merge pull request #23 from VanessaE/master
solar panel doesn't actually need a side texture.
2012-08-13 03:08:12 -07:00
Jeija cf6106ce43 Code cleanup - remove internal_api.lua (now internal.lua) 2012-08-13 12:05:37 +02:00
Jeija 955b8254dd Code cleanup 2012-08-13 12:03:36 +02:00
Jeija b8ba13a17a Code cleanup 2012-08-13 11:58:04 +02:00
Vanessa Ezekowitz b78b540653 reworked textures for mesecons wires, added a new one for each of on/off
states, to allow wires without junction bumps to be textured differently.
2012-08-13 05:54:14 -04:00
Jeija c20a4b3a89 Minimal speedup by not checking some nodes twice for receptors 2012-08-13 09:37:55 +02:00
Jeija c8c2fd32da Code cleanup and ond more extremely small speedup 2012-08-13 08:50:10 +02:00
Vanessa Ezekowitz 68342c79d5 Made X <-> Z bends not produce junction bump (only appears on T-junctions,
crossings, etc)
2012-08-12 22:31:35 -04:00
Vanessa Ezekowitz 6d499ae971 Slimmed down wire junctions a bit. 2012-08-12 22:28:45 -04:00
Jeija fc74976f9c Further (small) speed improvement, shrink code & more comments on it 2012-08-12 23:02:38 +02:00
Jeija 3ea68a6eae Fix mesecon delayer bugs and other non-functional changes 2012-08-12 21:28:53 +02:00
Jeija 9829abc74d HUGE speed improvement 2012-08-12 10:57:00 +02:00
Vanessa Ezekowitz d950f0d169 Merge branch 'master' of github.com:Jeija/minetest-mod-mesecons 2012-08-11 17:52:11 -04:00
Vanessa Ezekowitz d2aeeb3e94 Reverted back to old mesecons wire image for inventory 2012-08-11 17:51:36 -04:00
Jeija 8b62511615 Add some wires to mesecon_conductor_craftable group 2012-08-11 23:45:51 +02:00
Jeija 1f6e1fa7ab Mesecons only connect to blocks with group mesecon > 1 2012-08-11 23:39:28 +02:00
Jeija 6b1941a380 Add new nodebox style wires. Can be activated by setting NEW_STYLE_WIRES to true (in mesecons/settings.lua) 2012-08-11 22:58:00 +02:00
Jeija 8fa6894953 Consistency improvement and remove dead code 2012-08-10 18:58:21 +02:00
Jeija ef740353ef Add first experimental version of a (programmable) microcontroller 2012-08-08 13:26:32 +02:00
sfan5 13538d56d9 Fix mesecon:updatenode for the last Time... 2012-08-08 12:39:33 +02:00
sfan5 f4782df445 Finally fix mesecon:updatenode 2012-08-08 12:31:00 +02:00
sfan5 6b5c789204 Fix Typo in mesecon:nodeupdate 2012-08-08 12:27:45 +02:00
sfan5 dd1921c03a Add mesecon:nodeupdate Function 2012-08-08 12:16:28 +02:00
Kotolegokot 70841d8c8e not_in_creative_inventory 2012-08-01 15:58:19 +06:00
Anthony Zhang 9736b0f61e Nodebox piston pushers! Fix a few piston bugs such as pistons pushing pistons, pistons pushing blocks into pushers causing blocks to get deleted, and many more. As a side effect, players can no longer simply walk through piston pushers. Additionally, pistons will only remove their own pushers, and not those of neighboring pistons as well. Remove ENABLE_PISTON_ANIMATION option (not compatible with nodebox piston pushers). 2012-07-20 16:27:43 -04:00
Anthony Zhang 64a452da24 Fix piston duplication bug, simplify piston handling, limit piston push distance to 15 blocks. Remove deprecated object:get_entity_name() call, and some obselete settings. 2012-07-18 23:38:59 -04:00
Whiskers75 - 28bca749be AND block works! (YIPPEE!!!) See WHISKERS75_README. 2012-06-21 18:54:35 +01:00
Jeija 3ed865d94d Fix Bug: Mesecons cannot be digged due to a collisionbox failure 2012-06-20 19:26:07 +02:00
Anthony Zhang 4200757ba3 Remove deprecated API functions "register_on_placenode" and "register_on_dignode" where possible. 2012-06-04 22:20:04 -04:00
Anthony Zhang c6e42c7be7 Re-add missing flag. 2012-05-15 16:49:24 -04:00
Anthony Zhang 51453bb6c2 Made mesecons diggable 2012-04-24 17:28:14 -04:00
Jeija 029ad8be33 Add documentation for conductors 2012-04-22 07:55:57 +02:00
Jeija 84cc0264ca Remove useless debug output 2012-04-22 07:49:40 +02:00
Jeija 11b5ef8c94 Add new conductor system 2012-04-22 07:48:45 +02:00
Jeija d9a605511d Remove dedicated meselamp stuff 2012-03-29 22:14:14 +02:00
Jeija ce87414f6b Add mesecons delayer 2012-03-29 22:11:17 +02:00
Jeija d069275d09 Rules + Receptor system rework 2012-03-29 21:06:48 +02:00
Jeija d54d148595 Add reference for new rules system 2012-03-29 11:53:11 +02:00
Jeija 8e0b2a2b11 Simplify rules System 2012-03-29 11:35:23 +02:00
Anthony Zhang 3018128b4b Update nodes for compatibility with digging time groups. 2012-03-22 17:52:11 -04:00
Jeija 36ae0cc1a5 Upload after major code reorganization - Version 0.6 DEV - Split mesecons mod into several modules - [BUGGY?] 2012-03-05 19:21:26 +01:00