diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4c8f05f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "techage"] + path = techage + url = https://git.luanti.ru/MTSR/techage diff --git a/techage b/techage new file mode 160000 index 0000000..ce8b08d --- /dev/null +++ b/techage @@ -0,0 +1 @@ +Subproject commit ce8b08d2d7937a46e643da1eb745a8ac6bf4598f diff --git a/techage/.test/sink.lua b/techage/.test/sink.lua deleted file mode 100644 index 7d0c33a..0000000 --- a/techage/.test/sink.lua +++ /dev/null @@ -1,112 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - Demo for a electrical power consuming node - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local PWR_NEEDED = 5 -local CYCLE_TIME = 2 - -local Cable = techage.ElectricCable ---local Cable = techage.Axle -local power = networks.power - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - if not nvm.running and power.power_available(pos, Cable) then - nvm.running = true - swap_node(pos, "techage:sink_on") - M(pos):set_string("infotext", "on") - minetest.get_node_timer(pos):start(CYCLE_TIME) - else - nvm.running = false - swap_node(pos, "techage:sink") - M(pos):set_string("infotext", "off") - minetest.get_node_timer(pos):stop() - end -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("infotext", "off") - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:sink", { - description = "Sink", - tiles = {'techage_electric_button.png^[colorize:#000000:50'}, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - swap_node(pos, "techage:sink_on") - M(pos):set_string("infotext", "on") - end - return true - end, - on_rightclick = on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype = "light", - light_source = 0, - paramtype2 = "facedir", - groups = {choppy = 2, cracky = 2, crumbly = 2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:sink_on", { - description = "Sink", - tiles = {'techage_electric_button.png'}, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - swap_node(pos, "techage:sink") - M(pos):set_string("infotext", "off") - end - return true - end, - on_rightclick = on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype = "light", - light_source = minetest.LIGHT_MAX, - paramtype2 = "facedir", - diggable = false, - drop = "", - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:sink", "techage:sink_on"}, Cable, "con") diff --git a/techage/.test/testblock.lua b/techage/.test/testblock.lua deleted file mode 100644 index 7a78cf6..0000000 --- a/techage/.test/testblock.lua +++ /dev/null @@ -1,43 +0,0 @@ -local M = minetest.get_meta - -minetest.register_node("techage:testblock", { - description = "Testblock", - tiles = { - "techage_top_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - nvm.test_val = 1 - M(pos):set_int("test_val", 1) - M(pos):set_string("infotext", "Value = " .. 1) - end, -}) - -minetest.register_lbm({ - label = "Update testblock", - name = "techage:update_testblock", - - nodenames = { - "techage:testblock", - }, - - run_at_every_load = true, - - action = function(pos, node) - local nvm = techage.get_nvm(pos) - if M(pos):get_int("test_val") == nvm.test_val then - nvm.test_val = nvm.test_val + 1 - M(pos):set_int("test_val", nvm.test_val) - M(pos):set_string("infotext", "Value = " .. nvm.test_val) - else - minetest.log("error", "[techage] Memory error at " .. minetest.pos_to_string(pos)) - M(pos):set_string("infotext", "Error") - end - end, -}) - diff --git a/techage/LICENSE.txt b/techage/LICENSE.txt deleted file mode 100644 index a5be540..0000000 --- a/techage/LICENSE.txt +++ /dev/null @@ -1,662 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - TechAge, a mod to go through 5 tech ages in search of wealth and power. - Copyright (C) 2019-2023 Joachim Stolberg - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. - diff --git a/techage/README.md b/techage/README.md deleted file mode 100644 index d43c666..0000000 --- a/techage/README.md +++ /dev/null @@ -1,408 +0,0 @@ -# Tech Age [techage] (Minetest 5.4+) - -Tech Age, a mod to go through 5 tech ages in search of wealth and power. - -![screenshot](https://github.com/joe7575/techage/blob/master/screenshot.png) - - -Important facts: -- techage is not backwards compatible and cannot be installed on a server together with TechPack -- techage is significantly more extensive, since additional mods are integrated -- techage represents 5 technological ages: - - Iron Age (TA1) - simple tools like coal pile, coal burner, gravel sieve, hammer for getting ores and making goods - - Steam Age (TA2) - Simple machines that are powered by steam engines and drive axles - - Oil Age (TA3) - More modern machines that are powered by electricity. - - Present (TA4) - Electricity from renewable energy sources such as sun and wind. - - Future (TA5) - Machines to overcome space and time, new sources of energy and other achievements. -- Since the levels build on each other, all ages have to be run through one after the other - -In contrast to TechPack, the resources are more limited and it is much more difficult to pass all levels. -(no endless ore generation by means of cobble generators) - -**Techage blocks store information outside of the block. This is for performance reasons. -If you move, place, or remove blocks with any tool, at best, only the information is lost. -In the worst case, the server crashes.** - -[Manuals](https://github.com/joe7575/techage/wiki) - - -### License -Copyright (C) 2019-2023 Joachim Stolberg -Code: Licensed under the GNU AGPL version 3 or later. See LICENSE.txt -Textures: CC BY-SA 3.0 - -The TA1 mill sound is from https://freesound.org/people/JustinBW/sounds/70200/ -The TA1 watermill sound is from https://freesound.org/people/bmoreno/sounds/164182/ - -Many thanks to Thomas-S, niklp09, and others for their contributions - - -### Dependencies -Required: default, doors, bucket, stairs, screwdriver, basic_materials, tubelib2, networks, minecart, lcdlib, safer_lua, doclib -Recommended: signs_bot, hyperloop, compost, techpack_stairway, autobahn -Optional: unified_inventory, wielded_light, unifieddyes, lua-mashal, lsqlite3, moreores, ethereal, mesecon - - -The mods `default`, `doors`, `bucket`, `stairs`, and `screwdriver` are part of Minetest Game. - -`basic_materials` will be found here: https://content.minetest.net/ - -The following mods in the newest version have to be downloaded directly from GitHub: -* [tubelib2](https://github.com/joe7575/tubelib2) -* [networks](https://github.com/joe7575/networks) -* [minecart](https://github.com/joe7575/minecart) -* [lcdlib](https://github.com/joe7575/lcdlib) -* [safer_lua](https://github.com/joe7575/safer_lua) -* [doclib](https://github.com/joe7575/doclib) - -It is highly recommended that you install the following mods, too: - -* [signs_bot](https://github.com/joe7575/signs_bot): For many automation tasks in TA3/TA4 like farming, mining, and item transportation -* [hyperloop](https://github.com/joe7575/Minetest-Hyperloop): Used as passenger transportation system in TA4 -* [compost](https://github.com/joe7575/compost): The garden soil is needed for the TA4 LED Grow Light based flower bed -* [techpack_stairway](https://github.com/joe7575/techpack_stairway): Ladders, stairways, and bridges for your machines -* [autobahn](https://github.com/joe7575/autobahn): Street blocks and slopes with stripes for faster traveling -* [ta4_jetpack](https://github.com/joe7575/ta4_jetpack): A Jetpack with hydrogen as fuel and TA4 recipe - -More recommended Techage related mods by other authors: - -* [ta4_addons](https://github.com/Thomas--S/ta4_addons) from Thomas--S: A Touchscreen for the Lua controller -* [ts_vehicles](https://github.com/Thomas--S/ts_vehicles) from Thomas--S: A mod to provide cars and other vehicles for Minetest. -* [ta_apiary](https://gitlab.com/lesya_minetest_mods/ta_apiary) from Olesya Sibidanova: TechAge Machines for beekeeping - -For large servers with many players, the following packages are recommended: - -* lua-mashal for faster serialization/deserialization of data -* lsqlite3 for storing node and network data - -The packages have to be installed via [luarocks](https://luarocks.org/): - - luarocks --lua-version 5.1 install lsqlite3 - luarocks --lua-version 5.1 install lua-marshal - -To enable these `unsafe` packages, add 'techage' and 'lua-marshal' -to the list of trusted mods in `minetest.conf`: - - secure.trusted_mods = techage,lua-marshal - -and add the following line to your `world.mt` or `minetest.conf`: - - techage_use_sqlite = true - -Available worlds will be converted to 'lsqlite3', but there is no way back, so: - -**Never disable 'lsqlite3' for a world that has already been used!** - -### History - -**2023-11-05 V1.18** - -- Add TA2 clutch -- TA5 Generator: Add generator menu -- TA4 Injector: Allow rotation with a screwdriver -- Escape equal sign in german translation (Niklp09) -- Autocrafter: Add Beduino command interface -- Autocrafter: Add flush command -- Fix converter stores mesecon signals (Niklp09) -- TA1 Gravel Sieve: Use proper player creative check (Niklp09) -- TA4 Chest: Add storesize command -- Improve Assembly Tool -- Furnace: Fix burn time issue -- Allow further types of cobblestone for the coalburner -- Fix water mill river water bug (alwayshopeless) -- Improve manual -- Further improvements - -**2023-08-25 V1.17** - -- Add support for doclib / remove techage internal doc support - **The mod doclib is a new hard depenency !** -- Fix LICENCSE file bug -- Add beduino support for TA3 repeater (realmicu) -- Add inv_name_prefix to `techage.register_consumer` (debiankaios) -- Add generator menu to TA5 generator (fusion reactor) -- Adapt mod to the new lcdlib mod -- Fix some bugs - -**2023-06-30 V1.16** - -- Add TA4 node detector -- Add wrench menu to TA3 button -- Add arrows to the pump bottom and allow to turn the pump with the Techage Screwdriver -- Fix bug with configurred TA4 chest and TA5 teleport tubes -- Add gaze sensor -- Many bugfixes and improvements - -**2023-05-05 V1.15** - -- Allow energy storage with up to 13x13x13 concrete blocks -- Allow registration of other buckets -- Add hyperloop chest only if the hyperloop mod is available -- Add missing 'minetest.formspec_escape' #131 -- Fix bug "Trouble with flycontroller #130" -- Add optional dependency on farming mod (orwell96) -- Fix forceload formspec receiver (Niklp09) - -**2023-04-16 V1.14** - -- Add file "api.md" -- Add API function `register_ore_for_gravelsieve` -- Add support for the game Asuna -- Merge pull request #124 from Niklp09/drops -- Fix keep node number issue -- Fix manual issue #123 - -**2023-04-10 V1.13** - -- Add "Teleport mode" to the ta5 fly controller - -**2023-04-01 V1.12** - -- Improve Transformer: - - add wrench menu for 'max. power passed through' - - Increase max. power passed through from 100 to 300 ku -- Improve Electricmeter: - - add wrench menu for 'max. power passed through' and 'power countdown' 2458 - - add commands to read the countdown value (Lua and Beduino controller) -- Improve TA3 Mesecons Converter: - - fix overload bug - - fix missing dominant 'on' issue -- Add version command to TA3/TA4 Terminal -- TA5 Hyperloop Chest: Disable inventory access on client side due to minetest core issues - -**2023-03-05 V1.11** - -- Reduce the number of necessary exp points for TA5 Hyperloop Chest, - TA5 Hyperloop Tank, and TA5 AI Chip II -- Fix possible kernel crashes with TA5 Hyperloop Chest and autocrafter -- Rework doorcontroller (menu changed) -- Increase tank cart storage size to 200 units -- Fix several paramtype/use_texture_alpha issues -- Add command 'load' to the TA4 power terminal -- Add beduino tank commands -- Fix power consumption bug for a stopped collider -- Fix electrolyzer formspec bug -- Add Rack and pinion node -- Expand ta4 sequencer wrench menu -- Accept mincart carts for the move controller -- movecontroller: Allow to move objects 'without' a move block -- Add empty_spool as fab output -- Fix doser goes blocked bug - -**2023-02-04 V1.10** -- Improve flycontroller -- Remove handover for movecontroller -- Rename "techage:signal_lamp" to "techage:color_lamp" -- Rename "techage:signal_lamp2" to "techage:color_lamp2" -- Add countdown mode to TA4 Detector -- Adapt to new beduino and minecart versions -- Improve manuals -- flycontroller/movecontroller: Allow moving blocks through unloaded areas -- playerdetector: Add wrench menu to configure search radius -- Default furnace: Don't use items filled from the top as fuel -- Many further improvements and bug fixes from joe7575 and Niklp09 - -**2022-09-03 V1.09** -- Change the way items are pushed -- Add "Flow Limiter" mode to TA4 pump and TA4 pusher - -**2022-06-06 V1.08** -- Native support for the mod Beduino added - -**2022-01-22 V1.07** -- TA5 fusion reactor added - -**2022-01-03 V1.06** -- TA5 teleport blocks added -- Many improvements - -**2021-12-25 V1.05** -- Support for the mod i3 added (thanks to ghaydn) -- TA5 enabled -- Many improvements - -**2021-12-12 V1.04** -- TA4 Collider added (experimental) -- move, turn, sound, and fly blocks added -- TA5 (future) introduced (TA4 is now the "present") - -**2021-10-24 V1.03** -- Add TA4 Sequencer for time controlled command sequences -- Add TA4 Move Controller for moving blocks -- Add techage command counting function to be able to limit the amount of commands/min. -- Pull request #67: Add switch mode for 4x Button (by realmicu) -- Pull request #69: Add option to keep assignment for TA4 Tank (by Thomas-S) - -**2021-09-18 V1.02** -- TA4 Chest: Fix items disappearing (PR #64 by Thomas--S) -- Add support for colored cables (PR #63 by Thomas--S) - -**2021-08-16 V1.01** -- Allow singleplayer to place lava on y>0. -- Logic block: allow to use output numbers for the expression -- Pull request #60: Allow to pause the sequencer with a TechAge command (by Thomas-S) -- Pull request #61: Allow sharing the button based on protection (by Thomas-S) -- Pull request #62: Allow picking TA3 Tiny Generator with fuel (by realmicu) -- Add TA1 watermill -- Fix TA4 LED Grow Light bug -- Fix grinder recipe bu - -**2021-07-23 V1.00** -- Change the way, power distribution works -- Add TA2 storage system -- Add TA4 Isolation Transformer -- Add TA4 Electric Meter -- Add new power terminal -- Many improvements on power producing/consuming nodes -- See Construction Board for some hints on moving to v1 - -**2021-05-14 V0.26** -- Add concentrator tubes -- Add ta4 cable wall entry -- Pull request #57: Distributor improvements (from Thomas-S) -- Add new power terminal commands -- Add new door controller -- Add laser beam nodes for energy transfer -- Add TA4 recycle machine -- Many improvements and bug fixes - -**2020-11-01 V0.25** -- Pull request #37: Trowel: Add protection support (from Thomas-S) -- Pull request #38: Charcoal Pile: Ignore "ignore" nodes (from Thomas-S) -- Autocrafter: Add register function for uncraftable items -- Fix bug: Tubes do not recognize when TA2 nodes are added/removed -- TA4 chest/tank: Add 'public' checkbox to allow public access -- Add nodes TA2 Power Generator and TA3 Electric Motor - -**2020-10-20 V0.24** -- Pull request #27: Liquid Tanks: Add protection support (from Thomas-S) -- Pull request #28: Quarry: Improve digging behaviour (from Thomas-S) -- Pull request #29: Distributor: Keep metadata (from Thomas-S) -- Pull request #30: TA4: Add Liquid Filter (from Thomas-S) -- Pull request #31: Fix chest crash (from Thomas-S) -- Pull request #32: Fix Filter Sink Bug (from Thomas-S) -- Pull request #33: Add TA4 High Performance Distributor (from Thomas-S) -- Pull request #34: Add TA4 High Performance Distributor to Hopper (from Thomas-S) -- Pull request #35: Fixed Gravel Sieve bug (from CosmicConveyor) -- Fix doorcontroller and ta4 doser bugs -- Add check for wind turbine areas -- Fix translation errors -- QSG: Add power consumptions and fix manual bug -- Add load command to the controller battery -- TA4 silo: Add load command -- silo/tank: Add second return value for load command -- Liquid Pumps: Fix issue with undetected pipe connection gaps -- Shrink PGN files -- Fix ta4 chest bugs -- Fix ta4 chest and ta3 firebox issues -- Remove repairkit recipe -- Switched to AGPL license -- API added for ingame manual - -**2020-09-13 V0.23** -- Pull request #26: Digtron Battery: Fix duplication bug (from Thomas-S) -- Improve ta4 sensor box -- Firebox: Add check for free space when placing the node -- Lua controller: Add 'get_gametime' function -- Pull request #27: Liquid Tanks: Add protection support (from Thomas-S) -- Fix pump issue (silo source items can disappear) -- Pull request #28: Quarry: Improve digging behaviour (from Thomas-S) -- Pull request #28: Battery: Store battery load as metadata (from Thomas-S) -- Pull request #29: Distributor: Keep item metadata (from Thomas-S) - -**2020-08-08 V0.22** -- Pull request #25: Growlight: Improve flower registration (from Thomas-S) -- Add tube support for digtron chests and protector:chest - -**2020-08-08 V0.21** -- Pull request #18: Add a simple Digtron battery (from Thomas-S) -- Pull request #23: Lua Controller: Fix $item_description() documentation and translation (from Thomas-S) -- Pull request #24: Distributor: improve fairness by using random spread (from realmicu) -- Bugfix: TA1 meridian hammer did not glow (from realmicu) -- Bugfix: power.power_available() did not check the network state - -**2020-07-31 V0.20** -- Pull request #21: Lua Controller: Allow to get itemstring and description of 8x2000 chest contents (from Thomas-S) -- Pull request #22: Trowel: Prevent hidden nodes from being dug (from Thomas-S) -- Improvement: TA3 Power Terminal: Outputs max needed power in addition -- Bugfix: Quarry: Shall not dig Techage Light Blocks - -**2020-07-24 V0.19** -- Pull request #19: Refactor ICTA to use functions instead of loadstring (from Thomas-S) -- State command added for cart-, node-, and player detectors - -**2020-07-21 V0.18** -- Pull request #13: Use Monospace Font for Code-Related Formspecs (from Thomas-S) -- Pull request #14: Don't allow to put items with meta or wear information into the 8x2000 chest (from Thomas-S) -- Pull request #15: Blackhole: Add support for liquids (from Thomas-S) -- Pull request #16: ICTA Controller: Add support for valves by adding on/off states (from Thomas-S) -- Bugfix: Digging Redstone gives an 'unknown block' -- ICTA Controller: Escape quotation marks for text outputs - -**2020-07-16 V0.17** -- TA4 Reactor recipe bugfix -- TA3 furnace power bugfix (response to the pull request #12 from Thomas-S) -- Manual bugfix (Thomas-S) -- Charcoal pile doesn't start smoking after beeing unloaded (issue #9 from Skamiz) - -**2020-07-06 V0.16** -- Oil cracking/hydrogenation recipes added -- Ethereal growlight bugfix -- Charcoal pile bugfix (issue #9) Thanks to Skamiz -- Quarry bugfix (pull request #10) Thanks to programmerjake - -**2020-07-02 V0.15** -- pipe valve added -- growlight bugfix -- further textures to gate/door blocks added -- cement recipe bugfix -- manual improvements - -**2020-06-29 V0.14** -- quarry sound bugfix -- grinder bugfix -- ore probability calculation changed -- lua-marshal deactivated (due to weird server crashes) -- alternative cement recipe added -- aluminum output increased -- reboiler cycle time increased to 16 s (from 6) -- many manual improvements - -**2020-06-19 V0.13** -- Mesecons Converter added - -**2020-06-17 V0.12** -- Ethereal support added -- manual correction -- tin ingot recipe bugfix - -**2020-06-14 V0.11** -- cart commands added for both controllers -- support for moreores added - -**2020-06-04 V0.10** -- minor changes and bugfixes - -**2020-05-31 V0.09** -- TA4 tubes upgraded, manuals updated - -**2020-05-22 V0.08** -- Support for 'lua-marshal' and 'lsqlite3' added - -**2020-04-26 V0.07** -- English translation added - -**2020-04-24 V0.06** -- TA4 injector added - -**2020-03-14 V0.05** -- TA4 Lua controller added - -**2020-02-29 V0.04** -- TA4 ICTA controller added - -**2019-09-28 V0.02** -- TA3 finished - -**2019-06-16 V0.01** -- First upload diff --git a/techage/_config.yml b/techage/_config.yml deleted file mode 100644 index b849713..0000000 --- a/techage/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-leap-day \ No newline at end of file diff --git a/techage/api.md b/techage/api.md deleted file mode 100644 index b48a349..0000000 --- a/techage/api.md +++ /dev/null @@ -1,225 +0,0 @@ -# Techage API Functions - -Techage API function to adapt/prepare techage for other mods/games. - - - -## Move/Fly Controller - -Register node names for nodes allowed to be moved by fly/move controllers. - -This is only necessary for undiggable/intelligent nodes with one of the following attributes: - -- ```drop = ""``` -- ```diggable = false``` -- ```after_dig_node ~= nil``` - -```lua -techage.register_simple_nodes(node_names, is_valid) -``` - -- `is_valid = true` - Add node to the list of simple nodes -- `is_valid = false` - Remove node from the list of simple nodes - -Example: - -```lua -techage.register_simple_nodes({"techage:power_lineS"}, true) -``` - -For door nodes used as sliding doors by means of the move controller, call in addition: - -```lua -techage.flylib.protect_door_from_being_opened(node_name) -``` - - - -## TA1 Hammer - -Register stone/gravel name pair for the hammer blow: - -```lua -techage.register_stone_gravel_pair(stone_name, gravel_name) -``` - -Example: - -```lua -techage.register_stone_gravel_pair("default:stone", "default:gravel") -``` - - - -## TA1 Melting Pot - -Register a pot recipe: - -```lua -techage.ironage_register_recipe(recipe) -``` - -Examples: - -```lua -techage.ironage_register_recipe({ - output = "default:obsidian", - recipe = {"default:cobble"}, - heat = 10, -- Corresponds to the tower height - time = 8, -- Cooking time in seconds -}) -techage.ironage_register_recipe({ - output = "default:bronze_ingot 4", - recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"}, - heat = 4, -- Corresponds to the tower height - time = 8, -- Cooking time in seconds -}) -``` - - - -## TA2/TA3/TA4 Autocrafter - -Register any nodes/items that should not be crafted via the autocrafter. - -```lua -techage.register_uncraftable_items(item_name) -``` - - - -## TA2/TA3/TA4 Gravel Sieve - -Change the probability of ores or register new ores for sieving. - -```lua -techage.register_ore_for_gravelsieve(ore_name, probability) -``` - -Example: - -```lua -techage.register_ore_for_gravelsieve("default:iron_lump", 30) -``` - -Default values for MTG are: - -```lua --- higher value means less frequent occurrence -techage:baborium_lump 100000 -- hardly ever -default:mese_crystal 548 -- every 548th time -default:gold_lump 439 -default:tin_lump 60 -default:diamond 843 -default:copper_lump 145 -default:coal_lump 11 -default:iron_lump 15 -``` - - - -## TA2/TA3/TA4 Gravel Rinser - -Add a rinser recipe. - -```lua -techage.add_rinser_recipe(recipe) -``` - -Example: - -```lua -techage.add_rinser_recipe({input = "techage:sieved_gravel", output = "techage:usmium_nuggets", probability = 30}) -``` - - - -## TA2/TA3/TA4 Grinder - -Add a grinder recipe. - -```lua -techage.add_grinder_recipe(recipe, ta1_permitted) -``` - -Examples: - -```lua -echage.add_grinder_recipe({input = "default:cobble", output = "default:gravel"}) -techage.add_grinder_recipe({input = "default:sandstone", output = "default:sand 4"}) -``` - - - -## TA3/TA4 Electronic Fab, TA4 Doser - -Add recipes to an electronic fab or doser (chemical reactor): - - -```lua -techage.recipes.add(rtype, recipe) -``` - -`rtype` is one of: `ta2_electronic_fab` , `ta4_doser` - -A recipe look like: - -``` -{ - output = " ", -- units = 1..n - waste = " ", -- units = 1..n - input = { -- up to 4 items - " ", - " ", - }, -} -``` - -Examples: - -```lua -techage.recipes.add("ta2_electronic_fab", { - output = "techage:vacuum_tube 2", - waste = "basic_materials:empty_spool 1", - input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"} -}) - -techage.recipes.add("ta4_doser", { - output = "techage:naphtha 1", - input = { - "techage:fueloil 1", - }, - catalyst = "techage:gibbsite_powder", -}) -``` - - - -## TA3 Furnace - -Register recipe: - -```lua -techage.furnace.register_recipe(recipe) -``` - -Example: - -```lua -techage.furnace.register_recipe({ - output = "default:bronze_ingot 4", - recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"}, - time = 2, -- in seconds -}) -``` - - - -## Assembly Tool - -Disable a block from being removed by the assembly tool: - -```lua -techage.disable_block_for_assembly_tool(block_name) -``` - diff --git a/techage/basic_machines/autocrafter.lua b/techage/basic_machines/autocrafter.lua deleted file mode 100644 index dd34a16..0000000 --- a/techage/basic_machines/autocrafter.lua +++ /dev/null @@ -1,556 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - The autocrafter is derived from pipeworks: - Copyright (C) 2004 Sam Hocevar WTFPL - - TA2/TA3/TA4 Autocrafter - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local S = techage.S - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 - -local UncraftableItems = {} - --- Add all nodes/items which should not be crafted with the autocrafter -function techage.register_uncraftable_items(item_name) - UncraftableItems[item_name] = true -end - -local function formspec(self, pos, nvm) - return "size[8,9.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;recipe;0,0;3,3;]".. - "image[2.9,1;1,1;techage_form_arrow.png]".. - "image[3.8,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "list[context;output;3.8,1;1,1;]".. - "image_button[3.8,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.8,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;src;0,3.2;8,2;]".. - "list[context;dst;5,0;3,3;]".. - "list[current_player;main;0,5.4;8,4;]" .. - "listring[current_player;main]".. - "listring[context;src]" .. - "listring[current_player;main]".. - "listring[context;dst]" .. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 5.4) -end - -local function count_index(invlist) - local index = {} - for _, stack in pairs(invlist) do - if not stack:is_empty() then - local stack_name = stack:get_name() - index[stack_name] = (index[stack_name] or 0) + stack:get_count() - end - end - return index -end - -local function flush_input_inventory(pos) - local inv = M(pos):get_inventory() - if not inv:is_empty("src") then - for idx = 1, 16 do - local stack = inv:get_stack("src", idx) - if not inv:room_for_item("dst", stack) then - return false - end - inv:add_item("dst", stack) - inv:set_stack("src", idx, nil) - end - end - return true -end - --- caches some recipe data -local autocrafterCache = {} - -local function get_craft(pos, inventory, hash) - hash = hash or minetest.hash_node_position(pos) - local craft = autocrafterCache[hash] - if not craft then - local recipe = inventory:get_list("recipe") - local output, decremented_input = minetest.get_craft_result( - {method = "normal", width = 3, items = recipe}) - - -- check if registered item - if UncraftableItems[output.item:get_name()] then - output.item = ItemStack() - end - - craft = {recipe = recipe, consumption = count_index(recipe), - output = output, decremented_input = decremented_input} - autocrafterCache[hash] = craft - end - return craft -end - -local function autocraft(pos, crd, nvm, inv) - local craft = get_craft(pos, inv) - if not craft then - crd.State:idle(pos, nvm) - return - end - local output_item = craft.output.item - if output_item:get_name() == "" then - crd.State:idle(pos, nvm) - return - end - - -- check if we have enough room in dst - if not inv:room_for_item("dst", output_item) then - crd.State:blocked(pos, nvm) - return - end - local consumption = craft.consumption - local inv_index = count_index(inv:get_list("src")) - -- check if we have enough material available - for itemname, number in pairs(consumption) do - if (not inv_index[itemname]) or inv_index[itemname] < number then - crd.State:idle(pos, nvm) - return - end - end - -- consume material - for itemname, number in pairs(consumption) do - for i = 1, number do -- We have to do that since remove_item does not work if count > stack_max - inv:remove_item("src", ItemStack(itemname)) - end - end - - -- craft the result into the dst inventory and add any "replacements" as well - inv:add_item("dst", output_item) - for i = 1, 9 do - inv:add_item("dst", craft.decremented_input.items[i]) - end - - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) -end - - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - autocraft(pos, crd, nvm, inv) -end - --- note, that this function assumes allready being updated to virtual items --- and doesn't handle recipes with stacksizes > 1 -local function after_recipe_change(pos, inventory) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - -- if we emptied the grid, there's no point in keeping it running or cached - if inventory:is_empty("recipe") then - autocrafterCache[minetest.hash_node_position(pos)] = nil - inventory:set_stack("output", 1, "") - crd.State:stop(pos, nvm) - return - end - local recipe = inventory:get_list("recipe") - - local hash = minetest.hash_node_position(pos) - local craft = autocrafterCache[hash] - - if craft then - -- check if it changed - local cached_recipe = craft.recipe - for i = 1, 9 do - if recipe[i]:get_name() ~= cached_recipe[i]:get_name() then - autocrafterCache[hash] = nil -- invalidate recipe - craft = nil - break - end - end - end - - craft = craft or get_craft(pos, inventory, hash) - local output_item = craft.output.item - inventory:set_stack("output", 1, output_item) - crd.State:stop(pos, nvm) -end - --- clean out unknown items and groups, which would be handled like unknown items in the crafting grid --- if minetest supports query by group one day, this might replace them --- with a canonical version instead -local function normalize(item_list) - for i = 1, #item_list do - local name = item_list[i] - if not minetest.registered_items[name] then - item_list[i] = "" - end - end - return item_list -end - -local function get_input_from_recipeblock(pos, number, idx) - local own_num = M(pos):get_string("node_number") - local owner = M(pos):get_string("owner") - if techage.check_numbers(number, owner) then - local input = techage.send_single(own_num, number, "input", idx) - if input and type(input) == "string" then - return input - end - end -end - -local function on_output_change(pos, inventory, stack) - if not stack then - inventory:set_list("output", {}) - inventory:set_list("recipe", {}) - else - local input = minetest.get_craft_recipe(stack:get_name()) - if not input.items or input.type ~= "normal" then return end - local items, width = normalize(input.items), input.width - local item_idx, width_idx = 1, 1 - for i = 1, 9 do - if width_idx <= width then - inventory:set_stack("recipe", i, items[item_idx]) - item_idx = item_idx + 1 - else - inventory:set_stack("recipe", i, ItemStack("")) - end - width_idx = (width_idx < 3) and (width_idx + 1) or 1 - end - -- we'll set the output slot in after_recipe_change to the actual result of the new recipe - end - after_recipe_change(pos, inventory) -end - -local function determine_recipe_items(pos, input) - local num, idx - - if input and type(input) == "string" then -- Lua controller - -- Test if "." input - num, idx = unpack(string.split(input, ".", false, 1)) - elseif input and type(input) == "table" then -- Beduino - num = tostring(input[1] * 65536 + input[2]) - idx = tostring(input[3]) - end - - if num and idx then - input = get_input_from_recipeblock(pos, num, idx) - if input then - -- ",,..." input - local items = string.split(input, ",", true, 8) - if items and type(items) == "table" and next(items) then - return items - end - end - end -end - -local function on_new_recipe(pos, input) - local items = determine_recipe_items(pos, input) - local inv = M(pos):get_inventory() - if items then - for i = 1, 9 do - inv:set_stack("recipe", i, items[i]) - end - else - inv:set_list("recipe", {}) - end - local hash = minetest.hash_node_position(pos) - autocrafterCache[hash] = nil - local craft = get_craft(pos, inv, hash) - if craft.output and craft.output.item then - inv:set_stack("output", 1, craft.output.item) - else - inv:set_stack("output", 1, nil) - end -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if listname == "output" then - return 0 - end - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local inv = M(pos):get_inventory() - if listname == "recipe" then - stack:set_count(1) - inv:set_stack(listname, index, stack) - after_recipe_change(pos, inv) - return 0 - elseif listname == "output" then - on_output_change(pos, inv, stack) - return 0 - elseif listname == "src" then - CRD(pos).State:start_if_standby(pos) - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if listname == "output" then - return 0 - end - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end --- upgrade_autocrafter(pos) - local inv = minetest.get_meta(pos):get_inventory() - if listname == "recipe" then - inv:set_stack(listname, index, ItemStack("")) - after_recipe_change(pos, inv) - return 0 - elseif listname == "output" then - on_output_change(pos, inv, nil) - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if from_list == "output" or "to_list" == "output" then - return 0 - end - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local inv = minetest.get_meta(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - - if to_list == "output" then - on_output_change(pos, inv, stack) - return 0 - elseif from_list == "output" then - on_output_change(pos, inv, nil) - if to_list ~= "recipe" then - return 0 - end -- else fall through to recipe list handling - end - - if from_list == "recipe" or to_list == "recipe" then - if from_list == "recipe" then - inv:set_stack(from_list, from_index, ItemStack("")) - end - if to_list == "recipe" then - stack:set_count(1) - inv:set_stack(to_list, to_index, stack) - end - after_recipe_change(pos, inv) - return 0 - end - - return count -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_appl_autocrafter.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_autocrafter.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_autocrafter.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_filling4_ta#.png^techage_appl_autocrafter4.png^techage_frame4_ta#_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - { - name = "techage_filling4_ta#.png^techage_appl_autocrafter4.png^techage_frame4_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, - { - name = "techage_filling4_ta#.png^techage_appl_autocrafter4.png^techage_frame4_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, -} - -local INFO = [[Commands: 'state', 'recipe']] - -local tubing = { - on_inv_request = function(pos, in_dir, access_type) - if access_type == "push" then - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - return meta:get_inventory(), "src" - end - end - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack, idx) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - --CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "src", stack, idx) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "recipe" and CRD(pos).stage == 4 then - if payload and payload ~= "" then - on_new_recipe(pos, payload) - return true - else - local inv = M(pos):get_inventory() - return inv:get_stack("output", 1):get_name() - end - elseif topic == "flush" and CRD(pos).stage == 4 then - return flush_input_inventory(pos) - elseif topic == "info" and CRD(pos).stage == 4 then - return INFO - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 10 and CRD(pos).stage == 4 then - on_new_recipe(pos, payload) - return 1, "" - elseif topic == 11 and CRD(pos).stage == 4 then - if flush_input_inventory(pos) then - return 1, "" - else - return 0, "" - end - end - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("autocrafter", S("Autocrafter"), tiles, { - drawtype = "normal", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size("src", 2*8) - inv:set_size("recipe", 3*3) - inv:set_size("dst", 3*3) - inv:set_size("output", 1) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,2,4}, - power_consumption = {0,4,6,9}, - }, - {false, true, true, true}) -- TA2/TA3/TA4 - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:diamond", "group:wood"}, - {"techage:tubeS", "basic_materials:gear_steel", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:diamond", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:diamond", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -local Cable = techage.ElectricCable -local power = networks.power - -techage.register_node_for_v1_transition({"techage:ta3_autocrafter_pas", "techage:ta4_autocrafter_pas"}, function(pos, node) - power.update_network(pos, nil, Cable) -end) diff --git a/techage/basic_machines/blackhole.lua b/techage/basic_machines/blackhole.lua deleted file mode 100644 index 3f397c0..0000000 --- a/techage/basic_machines/blackhole.lua +++ /dev/null @@ -1,89 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - All items and liquids disappear. - -]]-- - -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local function take_liquid(pos, indir, name, amount) - return 0, name -end - -local function put_liquid(pos, indir, name, amount) - return 0 -end - -local function peek_liquid(pos, indir) - return nil -end - -minetest.register_node("techage:blackhole", { - description = S("TechAge Black Hole"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png^techage_appl_hole_pipe.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png^techage_appl_inp.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_blackhole.png", - }, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - meta:set_int("push_dir", techage.side_to_indir("L", node.param2)) - meta:set_string("infotext", S("TechAge Black Hole (let items and liquids disappear)")) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - end, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:blackhole", - recipe = { - {"group:wood", "", "group:wood"}, - {"techage:tubeS", "default:coal_lump", "techage:ta3_pipeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -techage.register_node({"techage:blackhole"}, { - on_pull_item = nil, -- not needed - on_unpull_item = nil, -- not needed - - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir then - return true - end - end, -}) - -liquid.register_nodes({"techage:blackhole"}, - Pipe, "tank", {"R"}, { - capa = 9999999, - peek = peek_liquid, - put = put_liquid, - take = take_liquid, - } -) diff --git a/techage/basic_machines/chest.lua b/techage/basic_machines/chest.lua deleted file mode 100644 index ed7b58d..0000000 --- a/techage/basic_machines/chest.lua +++ /dev/null @@ -1,463 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Chest - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local TA4_INV_SIZE = 50 - -local MP = minetest.get_modpath(minetest.get_current_modname()) -local mConf = dofile(MP.."/basis/conf_inv.lua") - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function formspec2() - return "size[9,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0.5,0;8,4;]".. - "list[current_player;main;0.5,4.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:chest_ta2", { - description = S("TA2 Protected Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_front_ta3.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 32) - end, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec2()) - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA2 Protected Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -local function formspec3() - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0,0;10,4;]".. - "list[current_player;main;1,4.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:chest_ta3", { - description = S("TA3 Protected Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_chest_back_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_chest_front_ta3.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 40) - end, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local number = techage.add_node(pos, "techage:chest_ta3") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec3()) - meta:set_string("infotext", S("TA3 Protected Chest").." "..number) - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA3 Protected Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:chest_ta2", "techage:chest_ta3"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num, item_name) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_inv_state(inv, "main") - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return 0, {techage.get_inv_state_num(inv, "main")} - else - return 2, "" - end - end, -}) - - -local function formspec4(pos) - return "size[10,9]".. - "tabheader[0,0;tab;"..S("Inventory,Pre-Assignment,Config")..";1;;true]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0,0;10,5;]".. - mConf.preassigned_stacks(pos, 10, 5).. - "list[current_player;main;1,5.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function formspec4_pre(pos) - return "size[10,9]".. - "tabheader[0,0;tab;"..S("Inventory,Pre-Assignment,Config")..";2;;true]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;conf;0,0;10,5;]".. - "list[current_player;main;1,5.3;8,4;]".. - "listring[context;conf]".. - "listring[current_player;main]" -end - -local function formspec4_cfg(pos) - local meta = minetest.get_meta(pos) - local label = meta:get_string("label") or "" - local public = dump((meta:get_int("public") or 0) == 1) - return "size[10,5]".. - "tabheader[0,0;tab;"..S("Inventory,Pre-Assignment,Config")..";3;;true]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,1;9,1;label;"..S("Node label:")..";"..label.."]" .. - "checkbox[1,2;public;"..S("Allow public access to the chest")..";"..public.."]".. - "button_exit[3.5,4;3,1;exit;"..S("Save").."]" -end - -local function ta4_allow_metadata_inventory_put(pos, listname, index, stack, player) - local public = M(pos):get_int("public") == 1 - if not public and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - if listname == "main" then - return stack:get_count() - else - return mConf.allow_conf_inv_put(pos, listname, index, stack, player) - end -end - -local function ta4_allow_metadata_inventory_take(pos, listname, index, stack, player) - local public = M(pos):get_int("public") == 1 - if not public and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - if listname == "main" then - return stack:get_count() - else - return mConf.allow_conf_inv_take(pos, listname, index, stack, player) - end -end - -local function ta4_allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local public = M(pos):get_int("public") == 1 - if not public and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - if from_list == "main" then - return count - else - return mConf.allow_conf_inv_move(pos, from_list, from_index, to_list, to_index, count, player) - end -end - -minetest.register_node("techage:chest_ta4", { - description = S("TA4 Protected Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_front_ta4.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 50) - inv:set_size('conf', 50) - end, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local number = techage.add_node(pos, "techage:chest_ta4") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec4(pos)) - meta:set_string("infotext", S("TA4 Protected Chest").." "..number) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - local mem = techage.get_mem(pos) - if fields.tab == "1" then - mem.filter = nil - meta:set_string("formspec", formspec4(pos)) - elseif fields.tab == "2" then - meta:set_string("formspec", formspec4_pre(pos)) - elseif fields.tab == "3" then - meta:set_string("formspec", formspec4_cfg(pos)) - elseif fields.quit == "true" then - mem.filter = nil - end - if fields.public then - meta:set_int("public", fields.public == "true" and 1 or 0) - end - if fields.exit then - local number = meta:get_string("node_number") - if fields.label ~= "" then - meta:set_string("infotext", minetest.formspec_escape(fields.label).." #"..number) - else - meta:set_string("infotext", S("TA4 Protected Chest").." "..number) - end - meta:set_string("label", fields.label) - meta:set_string("formspec", formspec4_cfg(pos)) - end - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA4 Protected Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = ta4_allow_metadata_inventory_put, - allow_metadata_inventory_take = ta4_allow_metadata_inventory_take, - allow_metadata_inventory_move = ta4_allow_metadata_inventory_move, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -techage.register_node({"techage:chest_ta4"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num, item_name) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local mem = techage.get_mem(pos) - - mem.filter = mem.filter or mConf.item_filter(pos, TA4_INV_SIZE) - mem.chest_configured = mem.chest_configured or not inv:is_empty("conf") - - if inv:is_empty("main") then - return nil - end - - if item_name then - if mem.filter[item_name] or not mem.chest_configured then - local taken = inv:remove_item("main", {name = item_name, count = num}) - if taken:get_count() > 0 then - return taken - end - end - else -- no item given - if mem.chest_configured then - return mConf.take_item(pos, inv, "main", num, mem.filter["unconfigured"]) - else - return techage.get_items(pos, inv, "main", num) - end - end - end, - on_push_item = function(pos, in_dir, item, idx) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local mem = techage.get_mem(pos) - - mem.filter = mem.filter or mConf.item_filter(pos, TA4_INV_SIZE) - mem.chest_configured = mem.chest_configured or not inv:is_empty("conf") - - if mem.chest_configured then - local name = item:get_name() - local stacks = mem.filter[name] or mem.filter["unconfigured"] - return mConf.put_items(pos, inv, "main", item, stacks, idx) - else - return techage.put_items(inv, "main", item, idx) - end - end, - on_unpull_item = function(pos, in_dir, item) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local mem = techage.get_mem(pos) - - mem.filter = mem.filter or mConf.item_filter(pos, TA4_INV_SIZE) - mem.chest_configured = mem.chest_configured or not inv:is_empty("conf") - - if mem.chest_configured then - local name = item:get_name() - local stacks = mem.filter[name] or mem.filter["unconfigured"] - return mConf.put_items(pos, inv, "main", item, stacks) - else - return techage.put_items(inv, "main", item) - end - end, - - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_inv_state(inv, "main") - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return 0, {techage.get_inv_state_num(inv, "main")} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta2", - recipe = {"default:chest", "techage:tubeS", "techage:iron_ingot"} -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta2", - recipe = {"default:chest_locked", "techage:tubeS", "techage:iron_ingot"} -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta2", - recipe = {"protector:chest", "techage:tubeS", "techage:iron_ingot"} -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta3", - recipe = {"techage:chest_ta2", "default:chest"} -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta4", - recipe = {"techage:chest_ta3", "default:chest"} -}) diff --git a/techage/basic_machines/concentrator.lua b/techage/basic_machines/concentrator.lua deleted file mode 100644 index 8dcb8c2..0000000 --- a/techage/basic_machines/concentrator.lua +++ /dev/null @@ -1,154 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tube Concentrator - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Tube = techage.Tube - -local size = 2/8 -local Boxes = { - {{-size, -size, size, size, size, 0.5 }}, -- z+ - {{-size, -size, -size, 0.5, size, size}}, -- x+ - {{-size, -size, -0.5, size, size, size}}, -- z- - {{-0.5, -size, -size, size, size, size}}, -- x- - {{-size, -0.5, -size, size, size, size}}, -- y- - {{-size, -size, -size, size, 0.5, size}}, -- y+ -} - -local names = networks.register_junction("techage:concentrator", 2/8, Boxes, Tube, { - description = S("Tube Concentrator"), - tiles = { - "techage_tube_junction.png^techage_appl_arrow2.png^[transformR270", - "techage_tube_junction.png^techage_appl_arrow2.png^[transformR270", - "techage_tube_junction.png^techage_tube_hole.png", - "techage_tube_junction.png", - "techage_tube_junction.png^techage_appl_arrow2.png^[transformR90", - "techage_tube_junction.png^techage_appl_arrow2.png^[transformR270", - }, - paramtype2 = "facedir", -- important! - use_texture_alpha = techage.CLIP, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, techage_trowel = 1}, - sounds = default.node_sound_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local node = minetest.get_node(pos) - local name = "techage:concentrator"..networks.junction_type(pos, Tube, "R", node.param2) - minetest.swap_node(pos, {name = name, param2 = node.param2}) - M(pos):set_int("push_dir", techage.side_to_outdir("R", node.param2)) - Tube:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - local name = "techage:concentrator"..networks.junction_type(pos, Tube, "R", node.param2) - minetest.swap_node(pos, {name = name, param2 = node.param2}) - end, - ta_rotate_node = function(pos, node, new_param2) - Tube:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Tube:after_place_node(pos) - M(pos):set_int("push_dir", techage.side_to_outdir("R", new_param2)) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_node(pos) - end, -}, 27) - -for _, name in ipairs(names) do - Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"}) -end - -techage.register_node(names, { - on_push_item = function(pos, in_dir, stack) - local push_dir = M(pos):get_int("push_dir") - if networks.Flip[push_dir] ~= in_dir then - return techage.safe_push_items(pos, push_dir, stack) - else - return stack - end - end, - is_pusher = true, -- is a pulling/pushing node -}) - -names = networks.register_junction("techage:ta4_concentrator", 2/8, Boxes, Tube, { - description = S("TA4 Tube Concentrator"), - tiles = { - "techage_tubeta4_junction.png^techage_appl_arrow2.png^[transformR270", - "techage_tubeta4_junction.png^techage_appl_arrow2.png^[transformR270", - "techage_tubeta4_junction.png^techage_tube_hole.png", - "techage_tubeta4_junction.png", - "techage_tubeta4_junction.png^techage_appl_arrow2.png^[transformR90", - "techage_tubeta4_junction.png^techage_appl_arrow2.png^[transformR270", - }, - paramtype2 = "facedir", -- important! - use_texture_alpha = techage.CLIP, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, techage_trowel = 1}, - sounds = default.node_sound_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local node = minetest.get_node(pos) - local name = "techage:ta4_concentrator"..networks.junction_type(pos, Tube, "R", node.param2) - minetest.swap_node(pos, {name = name, param2 = node.param2}) - M(pos):set_int("push_dir", techage.side_to_outdir("R", node.param2)) - Tube:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - local name = "techage:ta4_concentrator"..networks.junction_type(pos, Tube, "R", node.param2) - minetest.swap_node(pos, {name = name, param2 = node.param2}) - end, - ta_rotate_node = function(pos, node, new_param2) - Tube:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Tube:after_place_node(pos) - M(pos):set_int("push_dir", techage.side_to_outdir("R", new_param2)) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_node(pos) - end, -}, 27) - -for _, name in ipairs(names) do - Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"}) -end - -techage.register_node(names, { - on_push_item = function(pos, in_dir, stack) - local push_dir = M(pos):get_int("push_dir") - if networks.Flip[push_dir] ~= in_dir then - return techage.safe_push_items(pos, push_dir, stack) - else - return stack - end - end, - is_pusher = true, -- is a pulling/pushing node -}) - - -minetest.register_craft({ - output = "techage:concentrator27", - recipe = { - {"", "techage:tubeS", ""}, - {"techage:tubeS", "", "techage:tubeS"}, - {"", "techage:tubeS", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_concentrator27", - recipe = { - {"", "techage:ta4_tubeS", ""}, - {"techage:ta4_tubeS", "", "techage:ta4_tubeS"}, - {"", "techage:ta4_tubeS", ""}, - }, -}) diff --git a/techage/basic_machines/consumer.lua b/techage/basic_machines/consumer.lua deleted file mode 100644 index f27836a..0000000 --- a/techage/basic_machines/consumer.lua +++ /dev/null @@ -1,314 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Consumer node basis functionality. - It handles: - - up to 4 stages of nodes (TA2/TA3/TA4/TA5) - - power consumption - - node state handling - - registration of passive and active nodes - - Tube connections are on left and right side (from left to right) - - Power connection are on front and back side (front or back) -]]-- - --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local P = minetest.string_to_pos -local M = minetest.get_meta - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end -local CRDN = function(node) return (minetest.registered_nodes[node.name] or {}).consumer end - -local Tube = techage.Tube -local power = networks.power -local liquid = networks.liquid -local CYCLE_TIME = 2 - -local function get_keys(tbl) - local keys = {} - for k,v in pairs(tbl) do - keys[#keys + 1] = k - end - return keys -end - -local function has_power(pos, nvm, state) - local crd = CRD(pos) - return power.power_available(pos, crd.power_netw) -end - -local function start_node(pos, nvm, state) -end - -local function stop_node(pos, nvm, state) -end - -local function node_timer_pas(pos, elapsed) - local crd = CRD(pos) - local nvm = techage.get_nvm(pos) - - -- handle power consumption - if crd.power_netw and techage.needs_power(nvm) then - local consumed = power.consume_power(pos, crd.power_netw, nil, crd.power_consumption) - if consumed == crd.power_consumption then - crd.State:start(pos, nvm) - end - end - - -- call the node timer routine - if techage.is_operational(nvm) then - nvm.node_timer_call_cyle = (nvm.node_timer_call_cyle or 0) + 1 - if nvm.node_timer_call_cyle >= crd.call_cycle then - crd.node_timer(pos, crd.cycle_time) - nvm.node_timer_call_cyle = 0 - end - end - return crd.State:is_active(nvm) -end - -local function node_timer_act(pos, elapsed) - local crd = CRD(pos) - local nvm = techage.get_nvm(pos) - - -- handle power consumption - if crd.power_netw and techage.needs_power(nvm) then - local consumed = power.consume_power(pos, crd.power_netw, nil, crd.power_consumption) - if consumed < crd.power_consumption then - crd.State:nopower(pos, nvm) - end - end - - -- call the node timer routine - if techage.is_operational(nvm) then - nvm.node_timer_call_cyle = (nvm.node_timer_call_cyle or 0) + 1 - if nvm.node_timer_call_cyle >= crd.call_cycle then - crd.node_timer(pos, crd.cycle_time) - nvm.node_timer_call_cyle = 0 - end - end - return crd.State:is_active(nvm) -end - -local function prepare_tiles(tiles, stage, power_png) - local tbl = {} - for _,item in ipairs(tiles) do - if type(item) == "string" then - tbl[#tbl+1] = item:gsub("#", stage):gsub("{power}", power_png):gsub("@@", '#') - else - local temp = table.copy(item) - temp.name = temp.name:gsub("#", stage):gsub("{power}", power_png):gsub("@@", '#') - tbl[#tbl+1] = temp - end - end - return tbl -end - --- 'validStates' is optional and can be used to e.g. enable --- only one TA2 node {false, true, false, false} -function techage.register_consumer(base_name, inv_name, tiles, tNode, validStates, node_name_prefix, inv_name_prefix) - local names = {} - validStates = validStates or {true, true, true, true} - - node_name_prefix = node_name_prefix or "techage:ta" - if inv_name_prefix then - inv_name_prefix = inv_name_prefix.." " - else - inv_name_prefix = "" - end - - for stage = 2,5 do - local name_pas = node_name_prefix..stage.."_"..base_name.."_pas" - local name_act = node_name_prefix..stage.."_"..base_name.."_act" - local name_inv = inv_name_prefix.."TA"..stage.." "..inv_name - names[#names+1] = name_pas - - if validStates[stage] then - local power_network - local power_png = 'techage_axle_clutch.png' - local power_used = tNode.power_consumption ~= nil - local sides - -- power needed? - if power_used then - if stage > 2 then - power_network = techage.ElectricCable - power_png = 'techage_appl_hole_electric.png' - sides = get_keys(tNode.power_sides or {F=1, B=1, U=1, D=1}) - else - power_network = techage.Axle - power_png = 'techage_axle_clutch.png' - sides = get_keys(tNode.power_sides or {F=1, B=1, U=1, D=1}) - end - end - - local tState = techage.NodeStates:new({ - node_name_passive = name_pas, - node_name_active = name_act, - infotext_name = name_inv, - cycle_time = CYCLE_TIME, - standby_ticks = tNode.standby_ticks, - formspec_func = tNode.formspec, - on_state_change = tNode.on_state_change, - can_start = tNode.can_start, - quick_start = tNode.quick_start, - has_power = tNode.has_power or power_used and has_power or nil, - start_node = power_used and start_node or nil, - stop_node = power_used and stop_node or nil, - }) - - local tConsumer = { - stage = stage, - State = tState, - -- number of items to be processed per cycle - num_items = tNode.num_items and tNode.num_items[stage], - power_consumption = power_used and - tNode.power_consumption[stage] or 0, - node_timer = tNode.node_timer, - cycle_time = tNode.cycle_time, - call_cycle = tNode.cycle_time / 2, - power_netw = power_network, - } - - local after_place_node = function(pos, placer, itemstack, pointed_thing) - local crd = CRD(pos) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local node = minetest.get_node(pos) - meta:set_int("push_dir", techage.side_to_indir("L", node.param2)) - meta:set_int("pull_dir", techage.side_to_indir("R", node.param2)) - meta:set_string("owner", placer:get_player_name()) - -- Delete existing node number. Needed for Digtron compatibility. - if (meta:contains("node_number")) then - meta:set_string("node_number", "") - end - local number = techage.add_node(pos, name_pas, stage == 2) - if crd.power_netw then - crd.power_netw:after_place_node(pos) - end - if tNode.after_place_node then - tNode.after_place_node(pos, placer, itemstack, pointed_thing) - end - crd.State:node_init(pos, nvm, number) - end - - local after_dig_node = function(pos, oldnode, oldmetadata, digger) - if tNode.after_dig_node then - tNode.after_dig_node(pos, oldnode, oldmetadata, digger) - end - local crd = CRDN(oldnode) - if crd.power_netw then - crd.power_netw:after_dig_node(pos) - end - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end - - tNode.groups.not_in_creative_inventory = 0 - - local def_pas = { - description = name_inv, - tiles = prepare_tiles(tiles.pas, stage, power_png), - consumer = tConsumer, - drawtype = tNode.drawtype, - node_box = tNode.node_box, - selection_box = tNode.selection_box, - - can_dig = tNode.can_dig, - on_rotate = tNode.on_rotate or screwdriver.disallow, - on_timer = node_timer_pas, - on_receive_fields = tNode.on_receive_fields, - on_rightclick = tNode.on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - preserve_metadata = tNode.preserve_metadata, - allow_metadata_inventory_put = tNode.allow_metadata_inventory_put, - allow_metadata_inventory_move = tNode.allow_metadata_inventory_move, - allow_metadata_inventory_take = tNode.allow_metadata_inventory_take, - on_metadata_inventory_move = tNode.on_metadata_inventory_move, - on_metadata_inventory_put = tNode.on_metadata_inventory_put, - on_metadata_inventory_take = tNode.on_metadata_inventory_take, - ta_rotate_node = tNode.ta_rotate_node, - ta3_formspec = stage == 3 and tNode.ta3_formspec, - ta4_formspec = stage == 4 and tNode.ta4_formspec, - - paramtype = tNode.paramtype, - paramtype2 = "facedir", - drop = tNode.drop, - groups = table.copy(tNode.groups), - is_ground_content = false, - sounds = tNode.sounds, - } - - -- Copy custom properties (starting with an underscore) - for k,v in pairs(tNode) do - if string.sub(k, 1, 1) == "_" then - def_pas[k] = v - end - end - - minetest.register_node(name_pas, def_pas) - - tNode.groups.not_in_creative_inventory = 1 - - local def_act = { - description = name_inv, - tiles = prepare_tiles(tiles.act, stage, power_png), - consumer = tConsumer, - drawtype = tNode.drawtype, - node_box = tNode.node_box, - selection_box = tNode.selection_box, - - on_rotate = tNode.on_rotate or screwdriver.disallow, - on_timer = node_timer_act, - on_receive_fields = tNode.on_receive_fields, - on_rightclick = tNode.on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = tNode.allow_metadata_inventory_put, - allow_metadata_inventory_move = tNode.allow_metadata_inventory_move, - allow_metadata_inventory_take = tNode.allow_metadata_inventory_take, - on_metadata_inventory_move = tNode.on_metadata_inventory_move, - on_metadata_inventory_put = tNode.on_metadata_inventory_put, - on_metadata_inventory_take = tNode.on_metadata_inventory_take, - ta_rotate_node = tNode.ta_rotate_node, - ta3_formspec = stage == 3 and tNode.ta3_formspec, - ta4_formspec = stage == 4 and tNode.ta4_formspec, - - paramtype = tNode.paramtype, - paramtype2 = "facedir", - drop = "", - diggable = false, - groups = table.copy(tNode.groups), - is_ground_content = false, - sounds = tNode.sounds, - } - - -- Copy custom properties (starting with an underscore) - for k,v in pairs(tNode) do - if string.sub(k, 1, 1) == "_" then - def_act[k] = v - end - end - - minetest.register_node(name_act, def_act) - - if power_used then - power.register_nodes({name_pas, name_act}, power_network, "con", sides) - end - techage.register_node({name_pas, name_act}, tNode.tubing) - - if tNode.tube_sides then - Tube:set_valid_sides(name_pas, get_keys(tNode.tube_sides)) - Tube:set_valid_sides(name_act, get_keys(tNode.tube_sides)) - end - end - end - return names[1], names[2], names[3], names[4] -end diff --git a/techage/basic_machines/distributor.lua b/techage/basic_machines/distributor.lua deleted file mode 100644 index fc644a1..0000000 --- a/techage/basic_machines/distributor.lua +++ /dev/null @@ -1,683 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Distributor - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local N = minetest.get_node --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end -local Tube = techage.Tube - -local S = techage.S - -local SRC_INV_SIZE = 8 - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 -local FILTER_ITEM_LIMIT_PER_STACK = 12 -local FILTER_ITEM_LIMIT = 36 - -local INFO = [[Turn port on/off or read its state: command = 'port', payload = red/green/blue/yellow{=on/off}]] - - ---local Side2Color = {B="red", L="green", F="blue", R="yellow"} -local SlotColors = {"red", "green", "blue", "yellow"} -local SlotNumbers = {red = 1, green = 2, blue = 3, yellow = 4} -local Num2Ascii = {"B", "L", "F", "R"} -local FilterCache = {} -- local cache for filter settings - -local function filter_settings(pos) - local meta = M(pos) - local param2 = techage.get_node_lvm(pos).param2 - local inv = meta:get_inventory() - local filter = minetest.deserialize(meta:get_string("filter")) or {false,false,false,false} - local ItemFilter = {} -- { = {dir,...}] - local OpenPorts = {} -- {dir, ...} - local counter = 0 -- counts total item number in filter configuration - - -- collect all filter settings - for idx,slot in ipairs(SlotColors) do - if filter[idx] == true then - local side = Num2Ascii[idx] - local out_dir = techage.side_to_outdir(side, param2) - if inv:is_empty(slot) then - table.insert(OpenPorts, out_dir) - else - for idx2,stack in ipairs(inv:get_list(slot)) do - local name = stack:get_name() - if name ~= "" then - if not ItemFilter[name] then - ItemFilter[name] = {} - end - for _ = 1, math.min(FILTER_ITEM_LIMIT_PER_STACK, stack:get_count()) do - if counter > FILTER_ITEM_LIMIT then - break - end - table.insert(ItemFilter[name], out_dir) - counter = counter + 1 - end - end - end - end - end - end - - FilterCache[minetest.hash_node_position(pos)] = { - ItemFilter = ItemFilter, - OpenPorts = OpenPorts, - } -end - --- Return filter table and list of open ports. --- (see test data) -local function get_filter_settings(pos) --- local ItemFilter = { --- ["default:dirt"] = {1,2}, --- ["default:cobble"] = {4}, --- } --- local OpenPorts = {3} --- return ItemFilter, OpenPorts - - local hash = minetest.hash_node_position(pos) - if FilterCache[hash] == nil then - filter_settings(pos) - end - return FilterCache[hash].ItemFilter, FilterCache[hash].OpenPorts -end - -local function blocking_checkbox(pos, filter, is_hp) - local cnt = 0 - local _, open_ports = get_filter_settings(pos) - local fs_pos = is_hp and "0.25,5" or "3,3.9" - for _,val in ipairs(filter) do - if val then cnt = cnt + 1 end - end - if cnt > 1 and #open_ports > 0 then - local blocking = M(pos):get_int("blocking") == 1 and "true" or "false" - return "checkbox["..fs_pos..";blocking;"..S("blocking mode")..";"..blocking.."]".. - "tooltip["..fs_pos..";1,1;"..S("Block configured items for open ports")..";#0C3D32;#FFFFFF]" - else - M(pos):set_int("blocking", 0) -- disable blocking - end - return "" -end - -local function formspec(self, pos, nvm) - local filter = minetest.deserialize(M(pos):get_string("filter")) or {false,false,false,false} - local is_hp = nvm.high_performance == true - local blocking = blocking_checkbox(pos, filter, is_hp) - - if is_hp then - return "size[10.5,9.5]".. - "box[0.25,-0.1;9.6,1.1;#005500]".. - "label[0.6,0.2;"..S("Input").."]".. - "list[context;src;1.75,0;8,1;]".. - blocking.. - "image_button[0.25,5.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. - "tooltip[0.25,5.8;1,1;"..self:get_state_tooltip(nvm).."]".. - "checkbox[0.25,1.2;filter1;On;"..dump(filter[1]).."]".. - "checkbox[0.25,2.2;filter2;On;"..dump(filter[2]).."]".. - "checkbox[0.25,3.2;filter3;On;"..dump(filter[3]).."]".. - "checkbox[0.25,4.2;filter4;On;"..dump(filter[4]).."]".. - "image[1.25,1.2;0.3,1;techage_inv_red.png]".. - "image[1.25,2.2;0.3,1;techage_inv_green.png]".. - "image[1.25,3.2;0.3,1;techage_inv_blue.png]".. - "image[1.25,4.2;0.3,1;techage_inv_yellow.png]".. - "list[context;red;1.75,1.2;8,1;]".. - "list[context;green;1.75,2.2;8,1;]".. - "list[context;blue;1.75,3.2;8,1;]".. - "list[context;yellow;1.75,4.2;8,1;]".. - "list[current_player;main;1.75,5.8;8,4;]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(1.75,5.8) - else - return "size[10.5,8.5]".. - "list[context;src;0,0;2,4;]".. - blocking.. - "image[2,1.5;1,1;techage_form_arrow.png]".. - "image_button[0,4.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. - "tooltip[0,4.8;1,1;"..self:get_state_tooltip(nvm).."]".. - "checkbox[3,0;filter1;On;"..dump(filter[1]).."]".. - "checkbox[3,1;filter2;On;"..dump(filter[2]).."]".. - "checkbox[3,2;filter3;On;"..dump(filter[3]).."]".. - "checkbox[3,3;filter4;On;"..dump(filter[4]).."]".. - "image[4,0;0.3,1;techage_inv_red.png]".. - "image[4,1;0.3,1;techage_inv_green.png]".. - "image[4,2;0.3,1;techage_inv_blue.png]".. - "image[4,3;0.3,1;techage_inv_yellow.png]".. - "list[context;red;4.5,0;6,1;]".. - "list[context;green;4.5,1;6,1;]".. - "list[context;blue;4.5,2;6,1;]".. - "list[context;yellow;4.5,3;6,1;]".. - "list[current_player;main;1.25,4.8;8,4;]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(1.25,4.8) - end -end - -local function get_total_filter_items_number(pos, except_listname, except_index) - local inv = M(pos):get_inventory() - local total = 0 - for _, listname in ipairs(SlotColors) do - local list = inv:get_list(listname) - for idx, stack in ipairs(list) do - if not (listname == except_listname and idx == except_index) then - total = total + stack:get_count() - end - end - end - return total -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - CRD(pos).State:start_if_standby(pos) - return stack:get_count() - else - stack:add_item(list[index]) - local max_items_to_limit = FILTER_ITEM_LIMIT - get_total_filter_items_number(pos, listname, index) - stack:set_count(math.min(FILTER_ITEM_LIMIT_PER_STACK, stack:get_count(), max_items_to_limit)) - inv:set_stack(listname, index, stack) - return 0 - end - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - return stack:get_count() - else - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - list[index]:take_item(stack:get_count()) - inv:set_stack(listname, index, list[index]) - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local inv = minetest.get_meta(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - - if from_list == "src" and to_list ~= "src" then - stack:add_item(inv:get_stack(to_list, to_index)) - local max_items_to_limit = FILTER_ITEM_LIMIT - get_total_filter_items_number(pos, to_list, to_index) - stack:set_count(math.min(FILTER_ITEM_LIMIT_PER_STACK, stack:get_count(), max_items_to_limit)) - inv:set_stack(to_list, to_index, stack) - return 0 - elseif from_list ~= "src" and to_list == "src" then - inv:set_stack(from_list, from_index, nil) - return 0 - elseif from_list ~= "src" and to_list ~= "src" then - return math.min(stack:get_count(), FILTER_ITEM_LIMIT_PER_STACK - inv:get_stack(to_list, to_index):get_count()) - else - return stack:get_count() - end -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - local is_ta4_tube = true - for dir = 1,4 do - for i, pos, node in Tube:get_tube_line(pos, dir) do - is_ta4_tube = is_ta4_tube and techage.TA4tubes[node.name] - end - end - - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - if CRD(pos).stage == 4 and not is_ta4_tube then - nvm.num_items = crd.num_items / 2 - else - nvm.num_items = crd.num_items - end -end - -local function shuffle(list) - for i = #list, 2, -1 do - local j = math.random(i) - list[i], list[j] = list[j], list[i] - end - return list -end - -local function push_item(pos, base_filter, itemstack, num_items, nvm) - local filter = shuffle(table.copy(base_filter)) - local idx = 1 - local num_pushed = 0 - local num_ports = #filter - local amount = math.floor(math.max((num_items + 1) / num_ports, 1)) - local num_of_trials = 0 - while num_pushed < num_items and num_of_trials <= 8 do - num_of_trials = num_of_trials + 1 - local push_dir = filter[idx] - local num_to_push = math.min(amount, num_items - num_pushed) - local leftover = techage.push_items(pos, push_dir, itemstack:peek_item(num_to_push)) - local pushed - if not leftover then - pushed = 0 - elseif leftover ~= true then - pushed = num_to_push - leftover:get_count() - else -- leftover == true - pushed = num_to_push - end - num_pushed = num_pushed + pushed - nvm.port_counter[push_dir] = (nvm.port_counter[push_dir] or 0) + pushed - -- filter start offset - idx = idx + 1 - if idx > num_ports then - idx = 1 - end - end - return num_pushed -end - --- move items to output slots -local function distributing(pos, inv, crd, nvm) - local item_filter, open_ports = get_filter_settings(pos) - local sum_num_pushed = 0 - local num_pushed = 0 - local blocking_mode = M(pos):get_int("blocking") == 1 - - -- start searching after last position - local offs = nvm.last_index or 1 - - for i = 1, SRC_INV_SIZE do - local idx = ((i + offs - 1) % 8) + 1 - local stack = inv:get_stack("src", idx) - local item_name = stack:get_name() - local num_items = stack:get_count() - local num_to_push = math.min((nvm.num_items or crd.num_items) - sum_num_pushed, num_items) - local stack_to_push = stack:peek_item(num_to_push) - local filter = item_filter[item_name] - num_pushed = 0 - - if filter and #filter > 0 then - -- Push items based on filter - num_pushed = push_item(pos, filter, stack_to_push, num_to_push, nvm) - elseif blocking_mode and #open_ports > 0 then - -- Push items based on open ports - num_pushed = push_item(pos, open_ports, stack_to_push, num_to_push, nvm) - end - if not blocking_mode and num_pushed == 0 and #open_ports > 0 then - -- Push items based on open ports - num_pushed = push_item(pos, open_ports, stack_to_push, num_to_push, nvm) - end - - sum_num_pushed = sum_num_pushed + num_pushed - stack:take_item(num_pushed) - inv:set_stack("src", idx, stack) - if sum_num_pushed >= (nvm.num_items or crd.num_items) then - nvm.last_index = idx - break - end - end - - if sum_num_pushed == 0 then - crd.State:blocked(pos, nvm) - else - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end -end - --- move items to the output slots -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.port_counter = nvm.port_counter or {} - local crd = CRD(pos) - local inv = M(pos):get_inventory() - if not inv:is_empty("src") then - distributing(pos, inv, crd, nvm) - else - crd.State:idle(pos, nvm) - end - return crd.State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local meta = M(pos) - local crd = CRD(pos) - local filter = minetest.deserialize(meta:get_string("filter")) or {false,false,false,false} - if fields.filter1 ~= nil then - filter[1] = fields.filter1 == "true" - elseif fields.filter2 ~= nil then - filter[2] = fields.filter2 == "true" - elseif fields.filter3 ~= nil then - filter[3] = fields.filter3 == "true" - elseif fields.filter4 ~= nil then - filter[4] = fields.filter4 == "true" - elseif fields.blocking ~= nil then - meta:set_int("blocking", fields.blocking == "true" and 1 or 0) - end - meta:set_string("filter", minetest.serialize(filter)) - - filter_settings(pos) - - local nvm = techage.get_nvm(pos) - if fields.state_button ~= nil then - crd.State:state_button_event(pos, nvm, fields) - else - meta:set_string("formspec", formspec(crd.State, pos, nvm)) - end -end - --- techage command to turn on/off filter channels -local function change_filter_settings(pos, slot, val) - local meta = M(pos) - local filter = minetest.deserialize(meta:get_string("filter")) or {false,false,false,false} - local num = SlotNumbers[slot] or 1 - if num >= 1 and num <= 4 then - filter[num] = val == "on" - end - meta:set_string("filter", minetest.serialize(filter)) - - local hash = minetest.hash_node_position(pos) - FilterCache[hash] = nil - - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - return true -end - --- techage command to read filter channel status (on/off) -local function read_filter_settings(pos, slot) - local filter = minetest.deserialize(M(pos):get_string("filter")) or {false,false,false,false} - return filter[SlotNumbers[slot]] and "on" or "off" -end - -local function get_payload_values(payload) - local color - local idx = 0 - local items = {ItemStack(""), ItemStack(""), ItemStack(""), ItemStack(""), ItemStack(""), ItemStack("")} - for s in payload:gmatch("[^%s]+") do --- white spaces - if not color then - if SlotNumbers[s] then - color = s - else - return "red", {} - end - else - idx = idx + 1 - if idx <= 6 then - items[idx] = ItemStack(s) - end - end - end - return color, items -end - -local function str_of_inv_items(pos, color) - color = SlotColors[color] or color - if SlotNumbers[color] then - local inv = M(pos):get_inventory() - local t = {} - for idx = 1, 6 do - local item = inv:get_stack(color, idx) - if item:get_count() > 0 then - t[#t + 1] = item:get_name() - end - end - return table.concat(t, " ") - end - return "" -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("src") -end - -local get_tiles = function(is_hp) - local variant = is_hp and "_hp" or "" - local tiles = {} - -- '#' will be replaced by the stage number - -- '{power}' will be replaced by the power PNG - tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_appl_distri.png^techage_frame_ta#_top"..variant..".png^techage_appl_color_top.png", - "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png", - } - tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_filling4_ta#.png^techage_appl_distri4.png^techage_frame4_ta#_top"..variant..".png^techage_appl_color_top4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png", - "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png", - } - return tiles -end - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "src", num) - end, - on_push_item = function(pos, in_dir, stack) - CRD(pos).State:start_if_standby(pos) - local inv = M(pos):get_inventory() - return techage.put_items(inv, "src", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local inv = M(pos):get_inventory() - return techage.put_items(inv, "src", stack) - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "info" then - return INFO - elseif topic == "port" then - -- "red"/"green"/"blue"/"yellow" = "on"/"off" - local slot, val = techage.ident_value(payload) - if val == "" then - return read_filter_settings(pos, slot) - else - return change_filter_settings(pos, slot, val) - end - elseif topic == "config" then - local color, items = get_payload_values(payload) - local inv = M(pos):get_inventory() - for idx,item in ipairs(items) do - inv:set_stack(color, idx, item) - end - local hash = minetest.hash_node_position(pos) - FilterCache[hash] = nil - return true - elseif topic == "get" then - return str_of_inv_items(pos, payload) - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 4 then - local slot = SlotColors[payload[1]] - local state = payload[2] == 1 and "on" or "off" - change_filter_settings(pos, slot, state) - return 0 - elseif topic == 67 then - local color, items = get_payload_values(payload) - local inv = M(pos):get_inventory() - for idx,item in ipairs(items) do - inv:set_stack(color, idx, item) - end - local hash = minetest.hash_node_position(pos) - FilterCache[hash] = nil - return 0 - else - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 148 then - return 0, str_of_inv_items(pos, payload[1]) - else - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local def = { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local meta = M(pos) - local filter = {false,false,false,false} - meta:set_string("filter", minetest.serialize(filter)) - local inv = meta:get_inventory() - inv:set_size('src', 8) - inv:set_size('yellow', 6) - inv:set_size('green', 6) - inv:set_size('red', 6) - inv:set_size('blue', 6) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - tubelib2_on_update2 = tubelib2_on_update2, - - on_metadata_inventory_move = function(pos, from_list, from_index, to_list) - if from_list ~= "src" or to_list ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - on_metadata_inventory_put = function(pos, listname) - if listname ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - on_metadata_inventory_take = function(pos, listname) - if listname ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,4,12,24}, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer( - "distributor", - S("Distributor"), - get_tiles(false), - def -) - -local hp_def = table.copy(def) - -hp_def.after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.high_performance = true - local filter = {false,false,false,false} - meta:set_string("filter", minetest.serialize(filter)) - local inv = meta:get_inventory() - inv:set_size('src', 8) - inv:set_size('yellow', 8) - inv:set_size('green', 8) - inv:set_size('red', 8) - inv:set_size('blue', 8) -end -hp_def.num_items = {0,0,0,36} - -local _, _, node_name_ta4_hp = techage.register_consumer( - "high_performance_distributor", S("High Performance Distributor"), - get_tiles(true), - hp_def, - {false, false, false, true} -) - -minetest.register_craft({ - output = node_name_ta2.." 2", - recipe = { - {"group:wood", "techage:iron_ingot", "group:wood"}, - {"techage:tubeS", "default:mese_crystal", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "techage:iron_ingot", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "techage:iron_ingot", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - - -minetest.register_craft({ - output = node_name_ta4_hp, - recipe = { - {node_name_ta4, "default:copper_ingot"}, - {"default:mese_crystal_fragment", node_name_ta4}, - }, -}) diff --git a/techage/basic_machines/electronic_fab.lua b/techage/basic_machines/electronic_fab.lua deleted file mode 100644 index a668880..0000000 --- a/techage/basic_machines/electronic_fab.lua +++ /dev/null @@ -1,314 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Electronic Fab - -]]-- - --- for lazy programmers -local M = minetest.get_meta --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local S = techage.S -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 6 - -local recipes = techage.recipes - -local RecipeType = { - [2] = "ta2_electronic_fab", - [3] = "ta3_electronic_fab", - [4] = "ta4_electronic_fab", -} - -local function formspec(self, pos, nvm) - local rtype = RecipeType[CRD(pos).stage] - local owner = M(pos):get_string("owner") - return "size[8.4,8.4]".. - "list[context;src;0,0;2,4;]".. - recipes.formspec(2.2, 0, rtype, nvm, owner).. - "list[context;dst;6.4,0;2,4;]".. - "image_button[3.7,3.3;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.7,3.3;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[current_player;main;0.2,4.5;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0.2, 4.5) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local crd = CRD(pos) - if listname == "src" then - crd.State:start_if_standby(pos) - return stack:get_count() - end - return 0 -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function get_original_waste(inv, waste) - -- Waste has meta data, so we need to find the original waste item - for i = 1, 8 do - local stack = inv:get_stack("src", i) - if stack:get_count() == 1 then - if stack:get_name() == waste:get_name() then - return stack - end - end - end - return waste -end - -local function making(pos, crd, nvm, inv) - local owner = M(pos):get_string("owner") - local rtype = RecipeType[crd.stage] - local recipe = recipes.get(nvm, rtype, owner) - local output = ItemStack(recipe.output.name .. " " .. recipe.output.num) - local waste = recipe.waste and ItemStack(recipe.waste.name .. " " .. recipe.waste.num) - if inv:room_for_item("dst", output) and (not waste or inv:room_for_item("dst", waste)) then - for _,item in ipairs(recipe.input) do - local input = ItemStack(item.name.." "..item.num) - if not inv:contains_item("src", input) then - crd.State:idle(pos, nvm) - return - end - end - -- For some recipes, an item customized via metadata is used as a copy template. - -- This allows specially programmed items such as ROM chips to be produced. - -- The metadata of the copy template must be passed to the on_production function. - -- At the same time, the metadata of the copy template must not be lost when moving - -- as 'waste' to the output inventory. - local idef = minetest.registered_items[recipe.output.name] - if waste and idef and idef.on_production then - waste = get_original_waste(inv, waste) - local metadata = waste:get_meta():to_table().fields or {} - output = idef.on_production(output, metadata) - end - for _,item in ipairs(recipe.input) do - local input = ItemStack(item.name.." "..item.num) - inv:remove_item("src", input) - end - inv:add_item("dst", output) - if waste then - inv:add_item("dst", waste) - end - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return - end - crd.State:idle(pos, nvm) -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - if inv then - making(pos, crd, nvm, inv) - end -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - - if not nvm.running then - recipes.on_receive_fields(pos, formname, fields, player) - end - - crd.State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local tiles = {} --- '#' will be replaced by the stage number -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_electronic_fab.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_electronic_fab.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - { - name = "techage_filling4_ta#.png^techage_appl_electronic_fab4.png^techage_frame4_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, - { - name = "techage_filling4_ta#.png^techage_appl_electronic_fab4.png^techage_frame4_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, -} - -local tubing = { - on_inv_request = function(pos, in_dir, access_type) - if access_type == "push" then - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - return meta:get_inventory(), "src" - end - end - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack, idx) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - --CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "src", stack, idx) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("electronic_fab", S("Electronic Fab"), tiles, { - drawtype = "normal", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size("src", 8) - inv:set_size("dst", 8) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - power_consumption = {0,8,12,12}, - }, - {false, true, true, true}) -- TA2/TA3/TA4 - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:diamond", "group:wood"}, - {"techage:tubeS", "basic_materials:gear_steel", "techage:tubeS"}, - {"group:wood", "default:steel_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:diamond", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:diamond", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -techage.recipes.register_craft_type("ta2_electronic_fab", { - description = S("TA2 Ele Fab"), - icon = 'techage_filling_ta2.png^techage_appl_electronic_fab.png^techage_frame_ta2.png', - width = 2, - height = 2, -}) -techage.recipes.register_craft_type("ta3_electronic_fab", { - description = S("TA3 Ele Fab"), - icon = 'techage_filling_ta3.png^techage_appl_electronic_fab.png^techage_frame_ta3.png', - width = 2, - height = 2, -}) -techage.recipes.register_craft_type("ta4_electronic_fab", { - description = S("TA4 Ele Fab"), - icon = 'techage_filling_ta4.png^techage_appl_electronic_fab.png^techage_frame_ta4.png', - width = 2, - height = 2, -}) diff --git a/techage/basic_machines/forceload.lua b/techage/basic_machines/forceload.lua deleted file mode 100644 index f095f8c..0000000 --- a/techage/basic_machines/forceload.lua +++ /dev/null @@ -1,340 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Forceload block - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S = techage.S - -local function calc_area(pos) - local xpos = (math.floor(pos.x / 16) * 16) - local ypos = (math.floor(pos.y / 16) * 16) - local zpos = (math.floor(pos.z / 16) * 16) - local pos1 = {x=xpos, y=ypos, z=zpos} - local pos2 = {x=xpos+15, y=ypos+15, z=zpos+15} - return pos1, pos2 -end - -local function in_list(list, x) - local pos1 = calc_area(x) - for _,v in ipairs(list) do - local pos2 = calc_area(v) - if vector.equals(pos1, pos2) then return true end - end - return false -end - -local function remove_list_elem(list, x) - local n = nil - for idx, v in ipairs(list) do - if vector.equals(v, x) then - n = idx - break - end - end - if n then - table.remove(list, n) - end - return list -end - -local function chat(player, text) - minetest.chat_send_player(player:get_player_name(), "[Techage] "..text) -end - -local function postload_area(pos) - minetest.log("warning", "[FLB] area "..P2S(pos).." not loaded!") - if not minetest.forceload_block(pos, true) then - minetest.after(60, postload_area, pos) - end -end - -local function add_pos(pos, player) - local meta = player:get_meta() - local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} - if not in_list(lPos, pos) and (#lPos < techage.max_num_forceload_blocks or - minetest.global_exists("creative") and creative.is_enabled_for and - creative.is_enabled_for(player:get_player_name())) then - lPos[#lPos+1] = pos - local meta = player:get_meta() - meta:set_string("techage_forceload_blocks", minetest.serialize(lPos)) - return true - end - return false -end - -local function del_pos(pos, player) - local meta = player:get_meta() - local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} - lPos = remove_list_elem(lPos, pos) - if next(lPos) then - meta:set_string("techage_forceload_blocks", minetest.serialize(lPos)) - else - meta:set_string("techage_forceload_blocks", "") - end -end - -local function get_pos_list(player) - local meta = player:get_meta() - return minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} -end - -local function set_pos_list(player, lPos) - local meta = player:get_meta() - if next(lPos) then - meta:set_string("techage_forceload_blocks", minetest.serialize(lPos)) - else - meta:set_string("techage_forceload_blocks", "") - end -end - -local function show_flbs(pos, name, range) - local pos1 = {x=pos.x-range, y=pos.y-range, z=pos.z-range} - local pos2 = {x=pos.x+range, y=pos.y+range, z=pos.z+range} - for _,npos in ipairs(minetest.find_nodes_in_area(pos1, pos2, {"techage:forceload", "techage:forceloadtile"})) do - local _pos1, _pos2 = calc_area(npos) - local owner = M(npos):get_string("owner") - techage.mark_region(name, _pos1, _pos2, owner .. " " .. P2S(npos)) - end -end - -local function get_data(pos, player) - local pos1, pos2 = calc_area(pos) - local meta = player:get_meta() - local num = #minetest.deserialize(meta:get_string("techage_forceload_blocks")) or 0 - local max = techage.max_num_forceload_blocks - return pos1, pos2, num, max -end - -local function formspec(name) - local player = minetest.get_player_by_name(name) - if player then - local lPos = get_pos_list(player) - local tRes = {} - tRes[#tRes+1] = "#" - tRes[#tRes+1] = S("Block at pos") - tRes[#tRes+1] = S("Area from") - tRes[#tRes+1] = S("Area to") - tRes[#tRes+1] = S("Status") - for idx,pos in ipairs(lPos) do - local pos1, pos2 = calc_area(pos) - tRes[#tRes+1] = idx - tRes[#tRes+1] = minetest.formspec_escape(P2S(pos)) - tRes[#tRes+1] = minetest.formspec_escape(P2S(pos1)) - tRes[#tRes+1] = minetest.formspec_escape(P2S(pos2)) - tRes[#tRes+1] = minetest.forceload_block(pos, true) and 'Loaded' or 'Unloaded' - end - return "size[9,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[0,0;"..S("List of your Forceload Blocks:").."]".. - "tablecolumns[text,width=1.8;text,width=12;text,width=12;text,width=12;text,width=12]".. - "table[0,0.6;8.8,8.4;output;"..table.concat(tRes, ",")..";1]" - end -end - -local function on_place(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end - return minetest.rotate_and_place(itemstack, placer, pointed_thing) -end - -local function after_place_node(pos, placer, itemstack) - if add_pos(pos, placer) then - minetest.forceload_block(pos, true) - local pos1, pos2, num, max = get_data(pos, placer) - M(pos):set_string("infotext", "Area "..P2S(pos1).." to "..P2S(pos2).." "..S("loaded").."!\n".. - S("Punch the block to make the area visible.")) - chat(placer, "Area ("..num.."/"..max..") "..P2S(pos1).." to "..P2S(pos2).." "..S("loaded").."!") - techage.mark_region(placer:get_player_name(), pos1, pos2) - M(pos):set_string("owner", placer:get_player_name()) - else - chat(placer, S("Area already loaded or max. number of Forceload Blocks reached!")) - minetest.remove_node(pos) - return itemstack - end -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - local player = minetest.get_player_by_name(oldmetadata.fields.owner) - if player then - del_pos(pos, player) - end - minetest.forceload_free_block(pos, true) - techage.unmark_region(oldmetadata.fields.owner) -end - -local function on_rightclick(pos, node, clicker, itemstack, pointed_thing) - local owner = M(pos):get_string("owner") - local name = clicker:get_player_name() - if name == owner or minetest.check_player_privs(name, "server") then - local s = formspec(owner) - if s then - minetest.show_formspec(name, "techage:forceload", s) - end - end -end - -local function on_punch(pos, node, puncher, pointed_thing) - local pos1, pos2 = calc_area(pos) - techage.switch_region(puncher:get_player_name(), pos1, pos2) -end - -minetest.register_node("techage:forceload", { - description = S("Techage Forceload Block"), - tiles = { - -- up, down, right, left, back, front - 'techage_filling_ta2.png^techage_frame_ta2_top.png', - 'techage_filling_ta2.png^techage_frame_ta2_top.png', - { - name = "techage_filling_ta2.png^techage_frame_ta2_top.png^techage_appl_forceload.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_rightclick = on_rightclick, - on_punch = on_punch, - - paramtype = "light", - sunlight_propagates = true, - use_texture_alpha = techage.CLIP, - groups = {choppy=2, cracky=2, crumbly=2, - digtron_protected = 1, - not_in_creative_inventory = techage.max_num_forceload_blocks == 0 and 1 or 0}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:forceloadtile", { - description = S("Techage Forceload Tile"), - tiles = { - -- up, down, right, left, back, front - { - name = "techage_filling_ta2.png^techage_frame_ta2_top.png^techage_appl_forceload.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.5, - }, - }, - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - --{-5/16, -7/16, -5/16, 5/16, -5/16, 5/16}, - {-4/16, -8/16, -4/16, 4/16, -15/32, 4/16}, - }, - }, - - on_place = on_place, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_rightclick = on_rightclick, - on_punch = on_punch, - - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - groups = {choppy=2, cracky=2, crumbly=2, - not_in_creative_inventory = techage.max_num_forceload_blocks == 0 and 1 or 0}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -if techage.max_num_forceload_blocks > 0 then - minetest.register_craft({ - output = "techage:forceload", - recipe = { - {"group:wood", "", "group:wood"}, - {"default:mese_crystal_fragment", "techage:usmium_nuggets", "default:mese_crystal_fragment"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, - }) - minetest.register_craft({ - type = "shapeless", - output = "techage:forceloadtile", - recipe = {"techage:forceload"}, - }) - minetest.register_craft({ - type = "shapeless", - output = "techage:forceload", - recipe = {"techage:forceloadtile"}, - }) -end - -minetest.register_on_joinplayer(function(player) - local lPos = {} - for _,pos in ipairs(get_pos_list(player)) do - local node = techage.get_node_lvm(pos) - if node.name == "techage:forceload" or node.name == "techage:forceloadtile" then - if not minetest.forceload_block(pos, true) then - minetest.after(60, postload_area, pos) - end - lPos[#lPos+1] = pos - end - end - set_pos_list(player, lPos) -end) - -minetest.register_on_leaveplayer(function(player) - for _,pos in ipairs(get_pos_list(player)) do - minetest.forceload_free_block(pos, true) - end -end) - - -minetest.register_chatcommand("forceload", { - params = "", - description = S("Show all forceload blocks in a 64x64x64 range"), - func = function(name, param) - local player = minetest.get_player_by_name(name) - if player then - local pos = player:get_pos() - pos = vector.round(pos) - show_flbs(pos, name, 64) - end - end, -}) - -minetest.register_chatcommand("forceload_verify", { - params = "", - description = "Checks each forceload block and returns a count of active/placed blocks", - func = function(name, param) - local player = minetest.get_player_by_name(name) - if player then - local loaded = {} - local wanted = get_pos_list(player) - for _,pos in ipairs(wanted) do - if minetest.forceload_block(pos, true) then - loaded[#loaded+1] = pos - end - end - minetest.chat_send_player(name, "Found "..#loaded.." out of ".. #wanted .. " force loads") - end - end, -}) diff --git a/techage/basic_machines/foreign_nodes.lua b/techage/basic_machines/foreign_nodes.lua deleted file mode 100644 index 9d909c7..0000000 --- a/techage/basic_machines/foreign_nodes.lua +++ /dev/null @@ -1,159 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tube support for default chests and furnace - -]]-- - -local OwnerCache = { -} - --- Check if the chest is in the protected area of the owner -local function is_owner(pos, meta) - local owner = meta:get_string("owner") - local key = minetest.hash_node_position(pos) - -- If successfull, store info in cache - if OwnerCache[key] ~= owner then - if not minetest.is_protected(pos, owner) then - OwnerCache[key] = owner - end - end - return OwnerCache[key] == owner -end - - -techage.register_node({"default:chest", "default:chest_open"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) - -techage.register_node({"default:chest_locked", "default:chest_locked_open"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - if is_owner(pos, meta) then - return meta:get_inventory(), "main" - end - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if is_owner(pos, meta) then - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) - -techage.register_node({"shop:shop"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - if is_owner(pos, meta) then - if access_type == "push" then - return meta:get_inventory(), "stock" - elseif access_type == "pull" then - return meta:get_inventory(), "register" - end - end - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if is_owner(pos, meta) then - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "register", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "stock", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "register", stack) - end, -}) - -techage.register_node({"default:furnace", "default:furnace_active"}, { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "dst", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - minetest.get_node_timer(pos):start(1.0) - if in_dir == 5 then - return techage.put_items(inv, "src", stack) - elseif minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then - return techage.put_items(inv, "fuel", stack) - else - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "dst", stack) - end, -}) - -techage.register_node({"mobs:beehive"}, { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "beehive", num) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "beehive", stack) - end, -}) - -techage.register_node({"xdecor:hive"}, { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "honey", num) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "honey", stack) - end, -}) diff --git a/techage/basic_machines/gravelrinser.lua b/techage/basic_machines/gravelrinser.lua deleted file mode 100644 index 4b9d3e4..0000000 --- a/techage/basic_machines/gravelrinser.lua +++ /dev/null @@ -1,341 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Gravel Rinser, washing sieved gravel to find more ores - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 - -local Probability = {} - -local function formspec(self, pos, nvm) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;3,3;]".. - "item_image[0,0;1,1;default:gravel]".. - "image[0,0;1,1;techage_form_mask.png]".. - "image[3.5,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;dst;5,0;3,3;]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - CRD(pos).State:start_if_standby(pos) - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - - -local function get_water_level(pos) - local node = techage.get_node_lvm(pos) - if minetest.get_item_group(node.name, "water") > 0 then - local ndef = minetest.registered_nodes[node.name] - if ndef and ndef.liquidtype == "flowing" then - return node.param2 - end - end - return 99 -end - -local function determine_water_dir(pos) - local lvl = get_water_level(pos) - if lvl > get_water_level({x=pos.x+1, y=pos.y, z=pos.z}) then - return 2 - end - if lvl > get_water_level({x=pos.x-1, y=pos.y, z=pos.z}) then - return 4 - end - if lvl > get_water_level({x=pos.x, y=pos.y, z=pos.z+1}) then - return 1 - end - if lvl > get_water_level({x=pos.x, y=pos.y, z=pos.z-1}) then - return 3 - end - return 0 -end - -local function set_velocity(obj, pos, vel) - if obj then - obj:set_acceleration({x = 0, y = 0, z = 0}) - local p = obj:get_pos() - if p then - obj:set_pos({x=p.x, y=p.y-0.3, z=p.z}) - obj:set_velocity(vel) - end - end -end - -local function add_object(pos, name) - local dir = determine_water_dir(pos) - if dir > 0 then - local obj = minetest.add_item(pos, ItemStack(name)) - local vel = vector.multiply(tubelib2.Dir6dToVector[dir], 0.3) - minetest.after(0.3, set_velocity, obj, pos, vel) - end -end - -local function get_random_gravel_ore() - for ore, probability in pairs(Probability) do - if math.random(probability) == 1 then - return ore - end - end -end - -local function remove_objects(pos) - for _, object in pairs(minetest.get_objects_inside_radius(pos, 1)) do - local lua_entity = object:get_luaentity() - if not object:is_player() and lua_entity and lua_entity.name == "__builtin:item" then - object:remove() - end - end -end - -local function washing(pos, crd, nvm, inv) - -- for testing purposes - if inv:contains_item("src", ItemStack("default:stick")) then - add_object({x=pos.x, y=pos.y+1, z=pos.z}, "default:stick") - inv:remove_item("src", ItemStack("default:stick")) - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return - end - - local src = ItemStack("techage:sieved_gravel") - local dst = ItemStack("default:sand") - if inv:contains_item("src", src) then - if not inv:room_for_item("dst", dst) then - crd.State:blocked(pos, nvm) - return - end - local ore = get_random_gravel_ore() - if ore then - add_object({x=pos.x, y=pos.y+1, z=pos.z}, ore) - end - inv:add_item("dst", dst) - inv:remove_item("src", src) - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return - else - crd.State:idle(pos, nvm) - return - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - washing(pos, crd, nvm, inv) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_appl_rinser_top.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_rinser.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_rinser.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_appl_rinser4_top.png^techage_frame4_ta#_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_rinser.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_rinser.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - -- CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - remove_objects({x=pos.x, y=pos.y+1, z=pos.z}) - CRD(pos).State:on_node_load(pos) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("rinser", S("Gravel Rinser"), tiles, { - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 8/16, -6/16}, - {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-6/16, -8/16, -6/16, 6/16, 6/16, 6/16}, - {-6/16, 6/16, -1/16, 6/16, 8/16, 1/16}, - {-1/16, 6/16, -6/16, 1/16, 8/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size('src', 9) - inv:set_size('dst', 9) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - power_consumption = {0,3,3,3}, - tube_sides = {L=1, R=1, U=1}, - }, - {false, true, true, false}) -- TA2/TA3 - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:mese_crystal", "group:wood"}, - {"techage:tubeS", "techage:sieve", "techage:tubeS"}, - {"group:wood", "default:tin_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - - -techage.recipes.register_craft_type("rinsing", { - description = S("Rinsing"), - icon = "techage_appl_rinser_top.png^techage_frame_ta2_top.png", - width = 2, - height = 2, -}) - -function techage.add_rinser_recipe(recipe) - Probability[recipe.output] = recipe.probability - recipe.items = {recipe.input} - recipe.type = "rinsing" - techage.recipes.register_craft(recipe) -end - -techage.add_rinser_recipe({input="techage:sieved_gravel", output="techage:usmium_nuggets", probability=30}) -techage.add_rinser_recipe({input="techage:sieved_gravel", output="default:copper_lump", probability=15}) diff --git a/techage/basic_machines/gravelsieve.lua b/techage/basic_machines/gravelsieve.lua deleted file mode 100644 index 4bbe0ac..0000000 --- a/techage/basic_machines/gravelsieve.lua +++ /dev/null @@ -1,287 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Gravel Sieve, sieving gravel to find ores - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 - -local get_random_gravel_ore = techage.gravelsieve_get_random_gravel_ore -local get_random_basalt_ore = techage.gravelsieve_get_random_basalt_ore - - -local function formspec(self, pos, nvm) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;3,3;]".. - "item_image[0,0;1,1;default:gravel]".. - "image[0,0;1,1;techage_form_mask.png]".. - "image[3.5,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;dst;5,0;3,3;]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - CRD(pos).State:start_if_standby(pos) - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local inv = M(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function sieving(pos, crd, nvm, inv) - local src, dst - for i = 1, crd.num_items do - if inv:contains_item("src", ItemStack("techage:basalt_gravel")) then - dst, src = get_random_basalt_ore(), ItemStack("techage:basalt_gravel") - elseif inv:contains_item("src", ItemStack("default:gravel")) then - dst, src = get_random_gravel_ore(), ItemStack("default:gravel") - else - crd.State:idle(pos, nvm) - return - end - if not inv:room_for_item("dst", dst) then - crd.State:idle(pos, nvm) - return - end - inv:add_item("dst", dst) - inv:remove_item("src", src) - end - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - sieving(pos, crd, nvm, inv) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_appl_sieve_top.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_sieve.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_sieve.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_appl_sieve4_top.png^techage_frame4_ta#_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_sieve.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_sieve.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("gravelsieve", S("Gravel Sieve"), tiles, { - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 8/16, -6/16}, - {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-6/16, -8/16, -6/16, 6/16, 4/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size('src', 9) - inv:set_size('dst', 9) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,2,4}, - power_consumption = {0,3,4,5}, - tube_sides = {L=1, R=1, U=1}, - }) - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:mese_crystal", "group:wood"}, - {"techage:tubeS", "techage:sieve", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -techage.recipes.register_craft_type("ta2_gravelsieve", { - description = S("TA2 Gravel Sieve"), - icon = 'techage_sieve_sieve_ta1.png', - width = 1, - height = 1, -}) -techage.recipes.register_craft_type("ta3_gravelsieve", { - description = S("TA3 Gravel Sieve"), - icon = 'techage_filling_ta3.png^techage_appl_sieve.png^techage_frame_ta3.png', - width = 1, - height = 1, -}) -techage.recipes.register_craft_type("ta4_gravelsieve", { - description = S("TA4 Gravel Sieve"), - icon = 'techage_filling_ta4.png^techage_appl_sieve.png^techage_frame_ta4.png', - width = 1, - height = 1, -}) -techage.recipes.register_craft({ - output = "techage:sieved_basalt_gravel", - items = {"techage:basalt_gravel"}, - type = "ta2_gravelsieve", -}) -techage.recipes.register_craft({ - output = "techage:sieved_basalt_gravel", - items = {"techage:basalt_gravel"}, - type = "ta3_gravelsieve", -}) -techage.recipes.register_craft({ - output = "techage:sieved_basalt_gravel", - items = {"techage:basalt_gravel"}, - type = "ta4_gravelsieve", -}) diff --git a/techage/basic_machines/grinder.lua b/techage/basic_machines/grinder.lua deleted file mode 100644 index 4d390f4..0000000 --- a/techage/basic_machines/grinder.lua +++ /dev/null @@ -1,435 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Grinder, grinding Cobble/Basalt to Gravel - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer or {} end - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 - --- Grinder recipes TA1 -local RecipesTa1 = {} --- Grinder recipes TA2 - TA4 -local Recipes = {} - -local function formspec(self, pos, nvm) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;3,3;]".. - "item_image[0,0;1,1;default:cobble]".. - "image[0,0;1,1;techage_form_mask.png]".. - "image[3.5,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "image_button[3.5,2;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;dst;5,0;3,3;]".. - "item_image[5,0;1,1;default:gravel]".. - "image[5,0;1,1;techage_form_mask.png]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - local state = CRD(pos).State - if state then - state:start_if_standby(pos) - end - end - return stack:get_count() -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local inv = M(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - --- Grinder normaly handles 'num_items' per cycle. 'num_items' is node stage dependent. --- But if 'inp_num' > 1 (wheat recipes), use 'inp_num' and produce one output item. -local function src_to_dst(src_stack, idx, src_name, num_items, inp_num, inv, dst_name) - if inp_num > 1 then - local input = ItemStack(src_name) - input:set_count(inp_num) - local output = ItemStack(dst_name) - if inv:contains_item("src", input) and inv:room_for_item("dst", output) then - inv:remove_item("src", input) - inv:add_item("dst", output) - return true - end - else - local taken = src_stack:take_item(num_items) - local output = ItemStack(dst_name) - output:set_count(output:get_count() * taken:get_count()) - if inv:room_for_item("dst", output) then - inv:set_stack("src", idx, src_stack) - inv:add_item("dst", output) - return true - end - end - return false -end - -local function grinding(pos, crd, nvm, inv) - local blocked = false -- idle - for idx,stack in ipairs(inv:get_list("src")) do - if not stack:is_empty() then - local name = stack:get_name() - if Recipes[name] then - local recipe = Recipes[name] - if src_to_dst(stack, idx, name, crd.num_items, recipe.inp_num, inv, recipe.output) then - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return - else - blocked = true - end - else - crd.State:fault(pos, nvm) - return - end - end - end - if blocked then - crd.State:blocked(pos, nvm) - else - crd.State:idle(pos, nvm) - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - grinding(pos, crd, nvm, inv) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_appl_grinder.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_grinder2.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_grinder2.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_appl_grinder4.png^techage_frame4_ta#_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_grinder2.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_grinder2.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - --CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("grinder", S("Grinder"), tiles, { - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 8/16, -6/16}, - {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-6/16, -8/16, -6/16, 6/16, 6/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size('src', 9) - inv:set_size('dst', 9) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,2,4}, - power_consumption = {0,4,6,9}, - tube_sides = {L=1, R=1, U=1}, - }) - -------------------------------------------------------------------------------- --- TA1 Mill (watermill) -------------------------------------------------------------------------------- -local formspecStr = "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;1,1;1,1;]".. - "item_image[1,1;1,1;farming:wheat]".. - "image[1,1;1,1;techage_form_mask.png]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "list[context;dst;6,1;1,1;]".. - "item_image[6,1;1,1;farming:flour]".. - "image[6,1;1,1;techage_form_mask.png]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) - -local function node_timer(pos, elapsed) - if techage.ta1_mill_has_power(pos, 2) then - local inv = M(pos):get_inventory() - local stack = inv:get_stack("src", 1) - if not stack:is_empty() then - local name = stack:get_name() - if RecipesTa1[name] then - local recipe = RecipesTa1[name] - src_to_dst(stack, 1, name, 1, recipe.inp_num, inv, recipe.output) - end - end - end - return true -end - -minetest.register_node("techage:ta1_mill_base", { - description = S("TA1 Mill Base"), - tiles = { - "techage_mill_base.png", - "default_stone_brick.png", - }, - after_place_node = function(pos, placer) - M(pos):set_string("formspec", formspecStr) - local inv = M(pos):get_inventory() - inv:set_size('src', 1) - inv:set_size('dst', 1) - minetest.get_node_timer(pos):start(4) - end, - can_dig = can_dig, - on_timer = node_timer, - allow_metadata_inventory_put = allow_metadata_inventory_take, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, -}) - -techage.register_node({"techage:ta1_mill_base"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(4) - end, -}) - -minetest.register_craft({ - output = "techage:ta1_mill_base", - recipe = { - {"default:stonebrick", "", "default:stonebrick"}, - {"", "techage:iron_ingot", ""}, - {"default:stonebrick", "", "default:stonebrick"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:mese_crystal", "group:wood"}, - {"techage:tubeS", "techage:hammer_steel", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -techage.recipes.register_craft_type("grinding", { - description = S("Grinding"), - icon = 'techage_appl_grinder.png', - width = 2, - height = 2, -}) -techage.recipes.register_craft_type("milling", { - description = S("Milling"), - icon = 'techage_mill_inv.png', - width = 2, - height = 2, -}) - -function techage.add_grinder_recipe(recipe, ta1_permitted) - local name, num = unpack(string.split(recipe.input, " ", false, 1)) - if minetest.registered_items[name] then - if ta1_permitted then - RecipesTa1[name] = {input = name,inp_num = tonumber(num) or 1, output = recipe.output} - - recipe.items = {recipe.input} - recipe.type = "milling" - techage.recipes.register_craft(table.copy(recipe)) - end - - Recipes[name] = {input = name,inp_num = tonumber(num) or 1, output = recipe.output} - - recipe.items = {recipe.input} - recipe.type = "grinding" - techage.recipes.register_craft(recipe) - end -end - - -techage.add_grinder_recipe({input="default:cobble", output="default:gravel"}) -techage.add_grinder_recipe({input="default:desert_cobble", output="default:gravel"}) -techage.add_grinder_recipe({input="default:mossycobble", output="default:gravel"}) -techage.add_grinder_recipe({input="default:gravel", output="default:sand"}) -techage.add_grinder_recipe({input="techage:sieved_gravel", output="default:sand"}) -techage.add_grinder_recipe({input="default:coral_skeleton", output="default:silver_sand"}) - -if minetest.global_exists("skytest") then - techage.add_grinder_recipe({input="default:desert_sand", output="skytest:dust"}) - techage.add_grinder_recipe({input="default:silver_sand", output="skytest:dust"}) - techage.add_grinder_recipe({input="default:sand", output="skytest:dust"}) -else - techage.add_grinder_recipe({input="default:desert_sand", output="default:clay"}) - techage.add_grinder_recipe({input="default:silver_sand", output="default:clay"}) - techage.add_grinder_recipe({input="default:sand", output="default:clay"}) -end - -techage.add_grinder_recipe({input="default:sandstone", output="default:sand 4"}) -techage.add_grinder_recipe({input="default:desert_sandstone", output="default:desert_sand 4"}) -techage.add_grinder_recipe({input="default:silver_sandstone", output="default:silver_sand 4"}) - -techage.add_grinder_recipe({input="default:tree", output="default:leaves 8"}) -techage.add_grinder_recipe({input="default:jungletree", output="default:jungleleaves 8"}) -techage.add_grinder_recipe({input="default:pine_tree", output="default:pine_needles 8"}) -techage.add_grinder_recipe({input="default:acacia_tree", output="default:acacia_leaves 8"}) -techage.add_grinder_recipe({input="default:aspen_tree", output="default:aspen_leaves 8"}) - -if minetest.global_exists("farming") then - techage.add_grinder_recipe({input="farming:wheat 3", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:seed_wheat 6", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:barley 3", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:seed_barley 6", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:rye 3", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:seed_rye 6", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:rice 3", output="farming:rice_flour"}, true) - techage.add_grinder_recipe({input="farming:seed_rice 6", output="farming:rice_flour"}, true) - techage.add_grinder_recipe({input="farming:oat 3", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:seed_oat 6", output="farming:flour"}, true) - techage.add_grinder_recipe({input="farming:seed_cotton 3", output="basic_materials:oil_extract"}, true) -end diff --git a/techage/basic_machines/itemsource.lua b/techage/basic_machines/itemsource.lua deleted file mode 100644 index cb93602..0000000 --- a/techage/basic_machines/itemsource.lua +++ /dev/null @@ -1,106 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Item Source Block -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 30 - -local function formspec() - return "size[8,7.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;3.5,0.8;1,1;]".. - "list[current_player;main;0,3.5;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - return stack:get_count() -end - -minetest.register_node("techage:itemsource", { - description = "Techage Item Source", - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_outp.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_nodedetector.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_nodedetector.png^techage_frame_ta3.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local node = minetest.get_node(pos) - meta:set_int("push_dir", techage.side_to_outdir("R", node.param2)) - local inv = meta:get_inventory() - inv:set_size('main', 1) - minetest.get_node_timer(pos):start(CYCLE_TIME) - meta:set_string("infotext", "Techage Item Source") - meta:set_string("formspec", formspec()) - end, - - on_timer = function(pos, elapsed) - local meta = M(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack('main', 1) - if stack:get_count() > 0 then - local push_dir = meta:get_int("push_dir") - local leftover = techage.push_items(pos, push_dir, stack) - local pushed - if not leftover then - pushed = 0 - elseif leftover ~= true then - pushed = stack:get_count() - leftover:get_count() - else -- leftover == true - pushed = stack:get_count() - end - meta:set_int("counter", pushed) - meta:set_string("infotext", "Techage Item Source: "..pushed) - end - return true - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - is_ground_content = false, - drop = "", - groups = {crumbly = 3, cracky = 3, snappy = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -techage.register_node({"techage:itemsource"}, { - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/basic_machines/liquidsampler.lua b/techage/basic_machines/liquidsampler.lua deleted file mode 100644 index 1218822..0000000 --- a/techage/basic_machines/liquidsampler.lua +++ /dev/null @@ -1,228 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3 Bucket based Liquid Sampler - -]]-- - --- for lazy programmers -local M = minetest.get_meta --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local S = techage.S - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 3 -local CYCLE_TIME = 8 - -local function formspec(self, pos, nvm) - return "size[9,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;1,4;]".. - "image[0,0;1,1;bucket.png]".. - "image[1,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[1,1.5;1,1;techage_form_arrow.png]".. - "image_button[1,3;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[1,3;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;dst;2,0;7,4;]".. - "list[current_player;main;0.5,4.5;8,4;]".. - "listring[current_player;main]".. - "listring[context;src]" .. - "listring[current_player;main]".. - "listring[context;dst]" .. - "listring[current_player;main]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - CRD(pos).State:start_if_standby(pos) - end - return stack:get_count() -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local inv = M(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function is_water(pos) - local node = minetest.get_node(pos) - local liquiddef = bucket.liquids[node.name] - if liquiddef ~= nil and liquiddef.itemname ~= nil and node.name == liquiddef.source then - return true - end -end - -local function can_start(pos, nvm, state) - local water_pos = minetest.string_to_pos(M(pos):get_string("water_pos")) - if not is_water(water_pos) then - return S("no usable water") - end - return true -end - -local function sample_liquid(pos, crd, nvm, inv) - if inv:room_for_item("dst", {name = "bucket:bucket_water"}) and - inv:contains_item("src", {name = "bucket:bucket_empty"}) then - inv:remove_item("src", {name = "bucket:bucket_empty"}) - inv:add_item("dst", {name = "bucket:bucket_water"}) - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - else - crd.State:idle(pos, nvm) - end -end - -local function keep_running(pos, elapsed) - --if tubelib.data_not_corrupted(pos) then - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - sample_liquid(pos, crd, nvm, inv) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^{power}^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_liquidsampler.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_liquidsampler.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^{power}^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - { - name = "techage_filling4_ta#.png^techage_liquidsampler4.png^techage_frame4_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1.0, - }, - }, - "techage_filling_ta#.png^techage_appl_liquidsampler.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, -} - -local node_name_ta2, node_name_ta3, _ = - techage.register_consumer("liquidsampler", S("Liquid Sampler"), tiles, { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - can_start = can_start, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size("src", 4) - inv:set_size("dst", 28) - local water_pos = techage.get_pos(pos, "B") - M(pos):set_string("water_pos", minetest.pos_to_string(water_pos)) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,2,4}, - power_consumption = {0,3,5,8}, - power_sides = {U=1}, - }, - {false, true, true, false}) -- TA2/A3 - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:mese_crystal", "group:wood"}, - {"techage:tubeS", "bucket:bucket_empty", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) diff --git a/techage/basic_machines/mods_support.lua b/techage/basic_machines/mods_support.lua deleted file mode 100644 index 1508479..0000000 --- a/techage/basic_machines/mods_support.lua +++ /dev/null @@ -1,131 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tube support for digtron and protector chests - -]]-- - - --- for lazy programmers -local M = minetest.get_meta - -local CacheForFuelNodeNames = {} - -local function is_fuel(stack) - local name = stack:get_name() - if CacheForFuelNodeNames[name] then - return true - end - if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then - CacheForFuelNodeNames[name] = true - end - return CacheForFuelNodeNames[name] -end - ------------------------------------------------------------------------------- --- digtron ------------------------------------------------------------------------------- - -techage.register_node({"digtron:inventory"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) - -techage.register_node({"digtron:fuelstore"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "fuel" - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "fuel", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "fuel", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "fuel", stack) - end, -}) - -techage.register_node({"digtron:combined_storage"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, side, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - minetest.get_node_timer(pos):start(1.0) - if is_fuel(stack) then - return techage.put_items(inv, "fuel", stack) - else - return techage.put_items(inv, "main", stack) - end - end, - on_unpull_item = function(pos, side, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) - ------------------------------------------------------------------------------- --- protector ------------------------------------------------------------------------------- - -techage.register_node({"protector:chest"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) diff --git a/techage/basic_machines/pusher.lua b/techage/basic_machines/pusher.lua deleted file mode 100644 index 4f2c3fb..0000000 --- a/techage/basic_machines/pusher.lua +++ /dev/null @@ -1,438 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3/TA4 Pusher - Nodes for push/pull operation of StackItems from chests or other - inventory/server nodes to tubes or other inventory/server nodes. - - +--------+ - / /| - +--------+ | - IN (L) -->| |X--> OUT (R) - | PUSHER | + - | |/ - +--------+ - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end -local Tube = techage.Tube - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 - -local WRENCH_MENU = { - { - type = "number", - name = "limit", - label = S("Number of items"), - tooltip = S("Number of items that are allowed to be pushed"), - default = "0", - }, -} - -local function ta4_formspec(self, pos, nvm) - if CRD(pos).stage == 4 then -- TA4 node? - return "size[8,7.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize("#000000", S("Pusher")).."]".. - techage.question_mark_help(7.5, S("Optionally configure\nthe pusher with one item")).. - techage.wrench_image(7.4, -0.05) .. - "list[context;main;3.5,0.8;1,1;]".. - "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[current_player;main;0,3.5;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" - end -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local nvm = techage.get_nvm(pos) - if CRD(pos).State:get_state(nvm) ~= techage.STOPPED then - return 0 - end - - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - if list[index]:get_count() == 0 then - stack:set_count(1) - inv:set_stack(listname, index, stack) - return 0 - end - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local nvm = techage.get_nvm(pos) - if CRD(pos).State:get_state(nvm) ~= techage.STOPPED then - return 0 - end - - local inv = M(pos):get_inventory() - inv:set_stack(listname, index, nil) - return 0 -end - -local function set_limit(pos, nvm, val) - val = tonumber(val) or 0 - if val > 0 then - nvm.limit = val - nvm.num_items = 0 - M(pos):set_int("limit", val) - else - nvm.limit = nil - nvm.num_items = nil - M(pos):set_string("limit", "") - end -end - --- Function returns the number of pushed items -local function push(pos, crd, meta, nvm, pull_dir, push_dir, num) - local items = techage.pull_items(pos, pull_dir, num, nvm.item_name) - if items ~= nil then - local taken = items:get_count() - local leftover = techage.push_items(pos, push_dir, items) - if not leftover then - -- place item back - techage.unpull_items(pos, pull_dir, items) - crd.State:blocked(pos, nvm) - return 0 - elseif leftover ~= true then - -- place item back - taken = taken - leftover:get_count() - techage.unpull_items(pos, pull_dir, leftover) - crd.State:blocked(pos, nvm) - return taken - end - return taken - end - crd.State:idle(pos, nvm) - return 0 -end - -local function pushing(pos, crd, meta, nvm) - local pull_dir = meta:get_int("pull_dir") - local push_dir = meta:get_int("push_dir") - - if not nvm.limit then - local num = nvm.item_count or nvm.num_items or crd.num_items - num = push(pos, crd, meta, nvm, pull_dir, push_dir, num) - if num > 0 then - if nvm.item_count then - nvm.item_count = nvm.item_count - num - if nvm.item_count <= 0 then - crd.State:stop(pos, nvm) - nvm.item_count = nil - end - end - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - elseif nvm.num_items < nvm.limit then - local num = math.min(crd.num_items, nvm.limit - nvm.num_items) - num = push(pos, crd, meta, nvm, pull_dir, push_dir, num) - if num > 0 then - nvm.num_items = nvm.num_items + num - if nvm.num_items >= nvm.limit then - crd.State:stop(pos, nvm) - else - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - end - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - pushing(pos, crd, M(pos), nvm) - crd.State:is_active(nvm) -end - -local function on_rightclick(pos, node, clicker) - if CRD(pos).stage ~= 4 then -- Not TA4 node? - local nvm = techage.get_nvm(pos) - if not minetest.is_protected(pos, clicker:get_player_name()) then - if CRD(pos).State:get_state(nvm) == techage.STOPPED then - CRD(pos).State:start(pos, nvm) - else - CRD(pos).State:stop(pos, nvm) - end - end - end -end - -local function on_receive_fields(pos, formname, fields, player) - if CRD(pos).stage == 4 then -- TA4 node? - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", ta4_formspec(CRD(pos).State, pos, nvm)) - end -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - local pull_dir = M(pos):get_int("pull_dir") - local push_dir = M(pos):get_int("push_dir") - local is_ta4_tube = true - - for i, pos, node in Tube:get_tube_line(pos, pull_dir) do - is_ta4_tube = is_ta4_tube and techage.TA4tubes[node.name] - end - for i, pos, node in Tube:get_tube_line(pos, push_dir) do - is_ta4_tube = is_ta4_tube and techage.TA4tubes[node.name] - end - - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - if CRD(pos).stage == 4 and not is_ta4_tube then - nvm.num_items = crd.num_items / 2 - else - nvm.num_items = crd.num_items - end -end - -local function can_start(pos, nvm, state) - if CRD(pos).stage == 4 then -- TA4 node? - local inv = M(pos):get_inventory() - local name = inv:get_stack("main", 1):get_name() - if name ~= "" then - nvm.item_name = name - else - nvm.item_name = nil - end - else - nvm.item_name = nil - end - return true -end - -local function ta_after_formspec(pos, fields, playername) - local nvm = techage.get_nvm(pos) - set_limit(pos, nvm, fields.limit) -end - -local function on_state_change(pos, old_state, new_state) - if old_state == techage.STOPPED and new_state == techage.RUNNING then - local nvm = techage.get_nvm(pos) - set_limit(pos, nvm, M(pos):get_int("limit")) - end -end - -local function config_item(pos, payload) - if type(payload) == "string" then - if payload == "" then - local inv = M(pos):get_inventory() - inv:set_stack("main", 1, nil) - return 0 - else - local name, count = unpack(payload:split(" ")) - if name and (minetest.registered_nodes[name] or minetest.registered_items[name] - or minetest.registered_craftitems[name]) then - count = tonumber(count) or 1 - local inv = M(pos):get_inventory() - inv:set_stack("main", 1, {name = name, count = 1}) - return count - end - end - end - return 0 -end - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#_bottom.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_appl_pusher.png^[transformR180]^techage_frame_ta#.png", - "techage_appl_pusher.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#_bottom.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - { - name = "techage_appl_pusher14.png^[transformR180]^techage_frame14_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_appl_pusher14.png^techage_frame14_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, -} - -local tubing = { - -- push item through the pusher in opposit direction - on_push_item = function(pos, in_dir, stack) - return in_dir == M(pos):get_int("pull_dir") and techage.safe_push_items(pos, in_dir, stack) - end, - is_pusher = true, -- is a pulling/pushing node - - on_recv_message = function(pos, src, topic, payload) - if topic == "pull" then -- Deprecated command, use config/limit/start instead - local nvm = techage.get_nvm(pos) - CRD(pos).State:stop(pos, nvm) - nvm.item_count = math.min(config_item(pos, payload), 12) - nvm.rmt_num = src - CRD(pos).State:start(pos, nvm) - return true - elseif topic == "config" then -- Set item type - local nvm = techage.get_nvm(pos) - CRD(pos).State:stop(pos, nvm) - config_item(pos, payload) - return true - elseif topic == "limit" then -- Set push limit - local nvm = techage.get_nvm(pos) - CRD(pos).State:stop(pos, nvm) - set_limit(pos, nvm, payload) - return true - elseif topic == "count" then -- Get number of push items - local nvm = techage.get_nvm(pos) - return nvm.num_items or 0 - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 65 then -- Set item type - local nvm = techage.get_nvm(pos) - CRD(pos).State:stop(pos, nvm) - config_item(pos, payload) - return 0 - elseif topic == 68 or topic == 20 then -- Set push limit - local nvm = techage.get_nvm(pos) - CRD(pos).State:stop(pos, nvm) - set_limit(pos, nvm, payload[1]) - return 0 - else - local nvm = techage.get_nvm(pos) - if nvm.limit then - nvm.num_items = 0 - end - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 150 then -- Get number of pushed items - local nvm = techage.get_nvm(pos) - return 0, {nvm.num_items or 0} - else - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("pusher", S("Pusher"), tiles, { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = ta4_formspec, - tubing = tubing, - can_start = can_start, - on_state_change = on_state_change, - after_place_node = function(pos, placer) - local meta = M(pos) - local node = minetest.get_node(pos) - meta:set_int("pull_dir", techage.side_to_outdir("L", node.param2)) - meta:set_int("push_dir", techage.side_to_outdir("R", node.param2)) - if CRD(pos).stage == 4 then -- TA4 node? - local inv = M(pos):get_inventory() - inv:set_size('main', 1) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", ta4_formspec(CRD(pos).State, pos, nvm)) - end - end, - ta_rotate_node = function(pos, node, new_param2) - Tube:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Tube:after_place_node(pos) - local meta = M(pos) - meta:set_int("pull_dir", techage.side_to_outdir("L", new_param2)) - meta:set_int("push_dir", techage.side_to_outdir("R", new_param2)) - end, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - node_timer = keep_running, - on_rotate = screwdriver.disallow, - tubelib2_on_update2 = tubelib2_on_update2, - ta4_formspec = WRENCH_MENU, - ta_after_formspec = ta_after_formspec, - - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - num_items = {0,2,6,12}, - tube_sides = {L=1, R=1}, - }) - -minetest.register_craft({ - output = node_name_ta2.." 2", - recipe = { - {"group:wood", "wool:dark_green", "group:wood"}, - {"techage:tubeS", "default:mese_crystal", "techage:tubeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "techage:iron_ingot", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "techage:iron_ingot", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) diff --git a/techage/basic_machines/quarry.lua b/techage/basic_machines/quarry.lua deleted file mode 100644 index 41df119..0000000 --- a/techage/basic_machines/quarry.lua +++ /dev/null @@ -1,457 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Quarry machine to dig stones and other ground blocks. - - The Quarry digs a hole (default) 5x5 blocks large and up to 80 blocks deep. - It starts at the given level (0 is same level as the quarry block, - 1 is one level higher and so on)) and goes down to the given depth number. - It digs one block every 4 seconds. - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local S = techage.S - -local CYCLE_TIME = 4 -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 4 - -local Side2Facedir = {F=0, R=1, B=2, L=3, D=4, U=5} -local Depth2Idx = {[1]=1 ,[2]=2, [3]=3, [5]=4, [7]=5, [10]=6, [15]=7, [20]=8, [25]=9, [40]=10, [60]=11, [80]=12} -local Holesize2Idx = {["3x3"] = 1, ["5x5"] = 2, ["7x7"] = 3, ["9x9"] = 4, ["11x11"] = 5} -local Holesize2Diameter = {["3x3"] = 3, ["5x5"] = 5, ["7x7"] = 7, ["9x9"] = 9, ["11x11"] = 11} -local Level2Idx = {[2]=1, [1]=2, [0]=3, [-1]=4, [-2]=5, [-3]=6, - [-5]=7, [-10]=8, [-15]=9, [-20]=10} - -local function formspec(self, pos, nvm) - local tooltip = S("Start level = 0\nmeans the same level\nas the quarry is placed") - local level_idx = Level2Idx[nvm.start_level or 1] or 2 - local depth_idx = Depth2Idx[nvm.quarry_depth or 1] or 1 - local hsize_idx = Holesize2Idx[nvm.hole_size or "5x5"] or 2 - local level = nvm.level or "-" - local hsize_list = "5x5" - if CRD(pos).stage == 4 then - hsize_list = "3x3,5x5,7x7,9x9,11x11" - elseif CRD(pos).stage == 3 then - hsize_list = "3x3,5x5,7x7" - end - local depth_list = "1,2,3,5,7,10,15,20,25,40,60,80" - if CRD(pos).stage == 3 then - depth_list = "1,2,3,5,7,10,15,20,25,40" - elseif CRD(pos).stage == 2 then - depth_list = "1,2,3,5,7,10,15,20" - end - - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3.5,-0.1;"..minetest.colorize( "#000000", S("Quarry")).."]".. - techage.question_mark_help(8, tooltip).. - "dropdown[0,0.8;1.5;level;2,1,0,-1,-2,-3,-5,-10,-15,-20;"..level_idx.."]".. - "label[1.6,0.9;"..S("Start level").."]".. - "dropdown[0,1.8;1.5;depth;"..depth_list..";"..depth_idx.."]".. - "label[1.6,1.9;"..S("Digging depth").." ("..level..")]".. - "dropdown[0,2.8;1.5;hole_size;"..hsize_list..";"..hsize_idx.."]".. - "label[1.6,2.9;"..S("Hole size").."]".. - "list[context;main;5,0.8;3,3;]".. - "image[4,0.8;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image_button[4,2.8;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[4,2.8;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[current_player;main;0,4.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_quarry", { - pos = pos, - gain = 1.5, - max_hear_distance = 15, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function on_node_state_change(pos, old_state, new_state) - local mem = techage.get_mem(pos) - local owner = M(pos):get_string("owner") - mem.co = nil - techage.unmark_position(owner) - if new_state == techage.RUNNING then - play_sound(pos) - else - stop_sound(pos) - end -end - -local function get_pos(pos, facedir, side, steps) - facedir = (facedir + Side2Facedir[side]) % 4 - local dir = vector.multiply(minetest.facedir_to_dir(facedir), steps or 1) - return vector.add(pos, dir) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - - -local function get_quarry_pos(pos, xoffs, zoffs) - return {x = pos.x + xoffs - 1, y = pos.y, z = pos.z + zoffs - 1} -end - --- pos is the quarry pos -local function get_corner_positions(pos, facedir, hole_diameter) - local _pos = get_pos(pos, facedir, "L") - local pos1 = get_pos(_pos, facedir, "F", math.floor((hole_diameter - 1) / 2)) - local pos2 = get_pos(_pos, facedir, "B", math.floor((hole_diameter - 1) / 2)) - pos2 = get_pos(pos2, facedir, "L", hole_diameter - 1) - if pos1.x > pos2.x then pos1.x, pos2.x = pos2.x, pos1.x end - if pos1.y > pos2.y then pos1.y, pos2.y = pos2.y, pos1.y end - if pos1.z > pos2.z then pos1.z, pos2.z = pos2.z, pos1.z end - return pos1, pos2 -end - -local function is_air_level(pos1, pos2, hole_diameter) - return #minetest.find_nodes_in_area(pos1, pos2, {"air"}) == hole_diameter * hole_diameter -end - -local function mark_area(pos1, pos2, owner) - pos1.y = pos1.y + 0.2 - techage.mark_cube(owner, pos1, pos2, "quarry", "#FF0000", 20) - pos1.y = pos1.y - 0.2 -end - -local function quarry_task(pos, crd, nvm) - nvm.start_level = nvm.start_level or 0 - nvm.quarry_depth = nvm.quarry_depth or 1 - nvm.hole_diameter = nvm.hole_diameter or 5 - local y_first = pos.y + nvm.start_level - local y_last = y_first - nvm.quarry_depth + 1 - local facedir = minetest.get_node(pos).param2 - local owner = M(pos):get_string("owner") - local fake_player = techage.Fake_player:new() - fake_player.get_pos = function (...) - return pos - end - fake_player.get_inventory = function(...) - return M(pos):get_inventory() - end - - local add_to_inv = function(itemstacks) - local at_least_one_added = false - local inv = M(pos):get_inventory() - if #itemstacks == 0 then - return true - end - for _,stack in ipairs(itemstacks) do - if inv:room_for_item("main", stack) then - inv:add_item("main", stack) - at_least_one_added = true - elseif at_least_one_added then - minetest.add_item({x=pos.x,y=pos.y+1,z=pos.z}, stack) - end - end - return at_least_one_added - end - - local pos1, pos2 = get_corner_positions(pos, facedir, nvm.hole_diameter) - nvm.level = 1 - for y_curr = y_first, y_last, -1 do - pos1.y = y_curr - pos2.y = y_curr - - -- Restarting the server can detach the coroutine data. - -- Therefore, read nvm again. - nvm = techage.get_nvm(pos) - nvm.level = y_first - y_curr - - if minetest.is_area_protected(pos1, pos2, owner, 5) then - crd.State:fault(pos, nvm, S("area is protected")) - return - end - - if not is_air_level(pos1, pos2, nvm.hole_diameter) then - mark_area(pos1, pos2, owner) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - coroutine.yield() - - for zoffs = 1, nvm.hole_diameter do - for xoffs = 1, nvm.hole_diameter do - local qpos = get_quarry_pos(pos1, xoffs, zoffs) - local dig_state = techage.dig_like_player(qpos, fake_player, add_to_inv) - - if dig_state == techage.dig_states.INV_FULL then - crd.State:blocked(pos, nvm, S("inventory full")) - coroutine.yield() - elseif dig_state == techage.dig_states.DUG then - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - coroutine.yield() - end - end - end - techage.unmark_position(owner) - end - end - crd.State:stop(pos, nvm, S("finished")) -end - -local function keep_running(pos, elapsed) - local mem = techage.get_mem(pos) - if not mem.co then - mem.co = coroutine.create(quarry_task) - end - - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local _, err = coroutine.resume(mem.co, pos, crd, nvm) - if err then - minetest.log("error", "[TA4 Quarry Coroutine Error] at pos " .. minetest.pos_to_string(pos) .. " " .. err) - end - - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) - end - if nvm.techage_state ~= techage.RUNNING then - stop_sound(pos) - end -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("main") -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - - if fields.depth then - if tonumber(fields.depth) ~= nvm.quarry_depth then - nvm.quarry_depth = tonumber(fields.depth) - if CRD(pos).stage == 2 then - nvm.quarry_depth = math.min(nvm.quarry_depth, 20) - elseif CRD(pos).stage == 3 then - nvm.quarry_depth = math.min(nvm.quarry_depth, 40) - end - mem.co = nil - CRD(pos).State:stop(pos, nvm) - end - end - - if fields.level then - if tonumber(fields.level) ~= nvm.start_level then - nvm.start_level = tonumber(fields.level) - mem.co = nil - CRD(pos).State:stop(pos, nvm) - end - end - - if fields.hole_size then - if CRD(pos).stage == 4 then - if fields.hole_size ~= nvm.hole_size then - nvm.hole_size = fields.hole_size - nvm.hole_diameter = Holesize2Diameter[fields.hole_size or "5x5"] or 5 - mem.co = nil - CRD(pos).State:stop(pos, nvm) - end - elseif CRD(pos).stage == 3 then - if fields.hole_size ~= nvm.hole_size then - nvm.hole_size = fields.hole_size - nvm.hole_diameter = Holesize2Diameter[fields.hole_size or "7x7"] or 7 - mem.co = nil - CRD(pos).State:stop(pos, nvm) - end - else - nvm.hole_size = "5x5" - nvm.hole_diameter = 5 - end - end - - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local tiles = {} --- '#' will be replaced by the stage number -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_quarry_left.png", - "techage_filling_ta#.png^techage_appl_quarry.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_quarry.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - { - name = "techage_frame14_ta#.png^techage_quarry_left14.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - "techage_filling_ta#.png^techage_appl_quarry.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_quarry.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "main", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - --CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "main", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "main", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "depth" then - local nvm = techage.get_nvm(pos) - return nvm.level or 0 - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 133 then -- Quarry Depth - local nvm = techage.get_nvm(pos) - return 0, {nvm.level or 0} - else - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - local nvm = techage.get_nvm(pos) - if nvm.techage_state == techage.RUNNING then - stop_sound(pos) - play_sound(pos) - end - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("quarry", S("Quarry"), tiles, { - drawtype = "normal", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - on_state_change = on_node_state_change, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - local nvm = techage.get_nvm(pos) - inv:set_size('main', 9) - M(pos):set_string("owner", placer:get_player_name()) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - power_consumption = {0,10,12,14}, - } -) - -minetest.register_craft({ - output = node_name_ta2, - recipe = { - {"group:wood", "default:mese_crystal", "group:wood"}, - {"techage:tubeS", "default:pick_diamond", "techage:iron_ingot"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta2, ""}, - {"", "techage:vacuum_tube", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:mese_crystal", ""}, - {"", node_name_ta3, ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) diff --git a/techage/basic_machines/recipeblock.lua b/techage/basic_machines/recipeblock.lua deleted file mode 100644 index 37f39b4..0000000 --- a/techage/basic_machines/recipeblock.lua +++ /dev/null @@ -1,243 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Recipe Block for the TA4 Autocrafter -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local MAX_RECIPE = 10 - -local function recipes_formspec(x, y, idx) - return "container[" .. x .. "," .. y .. "]" .. - "background[0,0;8,3.2;techage_form_grey.png]" .. - "list[context;input;0.1,0.1;3,3;]" .. - "image[3,1.1;1,1;techage_form_arrow.png]" .. - "list[context;output;3.9,1.1;1,1;]" .. - "button[5.5,1.1;1,1;priv;<<]" .. - "button[6.5,1.1;1,1;next;>>]" .. - "label[5.5,0.5;"..S("Recipe") .. ": " .. idx .. "/" .. MAX_RECIPE .. "]" .. - "container_end[]" -end - -local function formspec(pos, nvm) - return "size[8,7.4]".. - recipes_formspec(0, 0, nvm.recipe_idx or 1) .. - "list[current_player;main;0,3.6;8,4;]" .. - "listring[current_player;main]".. - "listring[context;src]" .. - "listring[current_player;main]".. - "listring[context;dst]" .. - "listring[current_player;main]" -end - -local function determine_new_input(pos, inv) - local output = inv:get_stack("output", 1):get_name() - if output and output ~= "" then - local recipe = minetest.get_craft_recipe(output) - if recipe.items and recipe.type == "normal" then - for i = 1, 9 do - local name = recipe.items[i] - if name then - if minetest.registered_items[name] then - inv:set_stack("input", i, name) - end - end - end - inv:set_stack("output", 1, recipe.output) - end - else - for i = 1, 9 do - inv:set_stack("input", i, nil) - end - end -end - -local function determine_new_output(pos, inv) - local items = {} - for i = 1, 9 do - items[i] = inv:get_stack("input", i):get_name() - end - local input = { - method = "normal", - width = 3, - items = items, - } - local output, _ = minetest.get_craft_result(input) - inv:set_stack("output", 1, output.item) -end - -local function get_recipe(inv) - local items = {} - local last_idx = 0 - for i = 1, 9 do - local name = inv:get_stack("input", i):get_name() - if name ~= "" then - last_idx = i - end - items[i] = name - end - local input = table.concat(items, ",", 1, last_idx) - local stack = inv:get_stack("output", 1) - return { - input = input, - output = stack:get_name() .. " " .. stack:get_count() - } -end - -local function after_recipe_change(pos, inv, listname) - if listname == "input" then - determine_new_output(pos, inv) - else - determine_new_input(pos, inv) - end - local nvm = techage.get_nvm(pos) - nvm.recipes = nvm.recipes or {} - nvm.recipes[nvm.recipe_idx or 1] = get_recipe(inv) -end - -local function update_inventor(pos, inv, idx) - local nvm = techage.get_nvm(pos) - nvm.recipes = nvm.recipes or {} - local recipe = nvm.recipes[idx] - if recipe then - local items = string.split(recipe.input, ",", true) - for i = 1, 9 do - inv:set_stack("input", i, items[i] or "") - end - inv:set_stack("output", 1, recipe.output) - else - for i = 1, 9 do - inv:set_stack("input", i, nil) - end - inv:set_stack("output", 1, nil) - end -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - stack:set_count(1) - inv:set_stack(listname, index, stack) - after_recipe_change(pos, inv, listname) - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local inv = M(pos):get_inventory() - inv:set_stack(listname, index, nil) - after_recipe_change(pos, inv, listname) - return 0 -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local inv = M(pos):get_inventory() - if from_list == to_list then - minetest.after(0.1, after_recipe_change, pos, inv, from_list) - return 1 - end - return 0 -end - -minetest.register_node("techage:ta4_recipeblock", { - description = S("TA4 Recipe Block"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_recipeblock.png", - }, - - on_construct = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('input', 9) - inv:set_size('output', 1) - end, - - after_place_node = function(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta4_chest") - M(pos):set_string("owner", placer:get_player_name()) - M(pos):set_string("node_number", number) - M(pos):set_string("formspec", formspec(pos, nvm)) - M(pos):set_string("infotext", S("TA4 Recipe Block") .. " " .. number) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - nvm.recipe_idx = nvm.recipe_idx or 1 - if fields.next == ">>" then - nvm.recipe_idx = techage.in_range(nvm.recipe_idx + 1, 1, MAX_RECIPE) - elseif fields.priv == "<<" then - nvm.recipe_idx = techage.in_range(nvm.recipe_idx - 1, 1, MAX_RECIPE) - end - local inv = M(pos):get_inventory() - update_inventor(pos, inv, nvm.recipe_idx or 1) - M(pos):set_string("formspec", formspec(pos, nvm)) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - allow_metadata_inventory_move = allow_metadata_inventory_move, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:ta4_recipeblock"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "input" and payload and payload ~= "" then - nvm.recipes = nvm.recipes or {} - local recipe = nvm.recipes[tonumber(payload) or 1] - if recipe then - return recipe.input - end - else - return "unsupported" - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_recipeblock", - recipe = { - {"techage:ta4_carbon_fiber", "dye:blue", "techage:aluminum"}, - {"", "basic_materials:ic", ""}, - {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, - }, -}) diff --git a/techage/basic_machines/recycler.lua b/techage/basic_machines/recycler.lua deleted file mode 100644 index 1879d9e..0000000 --- a/techage/basic_machines/recycler.lua +++ /dev/null @@ -1,358 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Recycler, recycling techage machines - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 8 - -local Recipes = {} - -local SpecialItems = { - ["techage:sieved_gravel"] = "default:sand", - ["basic_materials:heating_element"] = "default:copper_ingot", - ["techage:ta4_wlanchip"] = "", - ["techage:basalt_cobble"] = "default:sand", - ["default:stone"] = "techage:sieved_gravel", - ["default:wood"] = "default:stick 5", - ["basic_materials:concrete_block"] = "techage:sieved_gravel", - ["dye:green"] = "", - ["dye:red"] = "", - ["dye:white"] = "", - ["dye:blue"] = "", - ["dye:brown"] = "", - ["dye:cyan"] = "", - ["dye:yellow"] = "", - ["dye:grey"] = "", - ["dye:orange"] = "", - ["dye:black"] = "", - ["techage:basalt_glass_thin"] = "", - ["group:stone"] = "techage:sieved_gravel", - --["basic_materials:plastic_sheet"] = "", - ["group:wood"] = "default:stick 5", - ["techage:basalt_glass"] = "", - ["default:junglewood"] = "default:stick 5", - ["techage:ta4_silicon_wafer"] = "", - ["default:cobble"] = "techage:sieved_gravel", - ["default:pick_diamond"] = "default:stick", - ["techage:hammer_steel"] = "default:stick", - ["default:paper"] = "", - ["stairs:slab_basalt_glass2"] = "", - ["techage:basalt_stone"] = "techage:sieved_gravel", - ["techage:ta4_ramchip"] = "", - ["protector:chest"] = "default:chest", - ["techage:ta4_rotor_blade"] = "", - ["techage:ta4_carbon_fiber"] = "", - ["techage:ta4_round_ceramic"] = "", - ["techage:ta4_furnace_ceramic"] = "", - ["techage:ta5_aichip"] = "", - ["techage:ta4_leds"] = "", -} - -local function formspec(self, pos, nvm) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;3,3;]".. - --"item_image[0,0;1,1;default:cobble]".. - "image[0,0;1,1;techage_form_mask.png]".. - "image[3.5,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "image_button[3.5,2;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[context;dst;5,0;3,3;]".. - --"item_image[5,0;1,1;default:gravel]".. - "image[5,0;1,1;techage_form_mask.png]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - CRD(pos).State:start_if_standby(pos) - end - return stack:get_count() -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local inv = M(pos):get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function cook_reverse(stack, inv, idx, recipe) - -- check space - for _,item in ipairs(recipe.items) do - if not inv:room_for_item("dst", item) then - return false - end - end - -- take item - inv:remove_item("src", ItemStack(recipe.output)) - -- add items - for _,item in ipairs(recipe.items) do - inv:add_item("dst", item) - end - return true -end - -local function get_recipe(stack) - local name = stack:get_name() - local recipe = Recipes[name] - if recipe then - if stack:get_count() >= ItemStack(recipe.output):get_count() then - return recipe - end - end -end - -local function recycling(pos, crd, nvm, inv) - for idx,stack in ipairs(inv:get_list("src")) do - local recipe = not stack:is_empty() and get_recipe(stack) - if recipe then - if cook_reverse(stack, inv, idx, recipe) then - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - else - crd.State:blocked(pos, nvm) - end - return - end - end - crd.State:idle(pos, nvm) -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - recycling(pos, crd, nvm, inv) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_appl_grinder.png^[colorize:@@000000:100^techage_frame_ta#_top.png", - --"techage_appl_grinder.png^techage_frame_ta#_top.png^[multiply:#FF0000", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_recycler.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_recycler.png^techage_frame_ta#.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - name = "techage_appl_grinder4.png^[colorize:@@000000:100^techage_frame4_ta#_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_recycler.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_recycler.png^techage_frame_ta#.png", -} - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - --CRD(pos).State:start_if_standby(pos) -- would need power! - return techage.put_items(inv, "src", stack) - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local _, _, node_name_ta4 = - techage.register_consumer("recycler", S("Recycler"), tiles, { - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 8/16, -6/16}, - {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-6/16, -8/16, -6/16, 6/16, 6/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size('src', 9) - inv:set_size('dst', 9) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,0,0,1}, - power_consumption = {0,0,0,16}, - }, - {false, false, false, true}) -- TA4 only - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "default:mese_crystal", ""}, - {"", "techage:ta4_grinder_pas", ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -------------------------------------------------------------------------------- --- Prepare recipes -------------------------------------------------------------------------------- --- Nodes from mods that can be recycled -local ModNames = { - techage = true, - hyperloop = true, -} - -local function get_item_list(inputs) - local lst = {} - for _,input in pairs(inputs or {}) do - if SpecialItems[input] then - input = SpecialItems[input] - end - if input and input ~= "" then - if minetest.registered_nodes[input] or minetest.registered_items[input] then - table.insert(lst, input) - end - end - end - return lst -end - -local function get_special_recipe(name) - if SpecialItems[name] then - return { - output = name, - items = {SpecialItems[name]} - } - end -end - -local function collect_recipes() - local add = function(name, ndef) - local _, _, mod, _ = string.find(name, "([%w_]+):([%w_]+)") - local recipe = get_special_recipe(name) or - techage.recipes.get_recipe(name) or - minetest.get_craft_recipe(name) - local items = get_item_list(recipe.items) - - if ModNames[mod] - and ndef.groups.not_in_creative_inventory ~= 1 - and not ndef.tool_capabilities - and recipe.output - and next(items) then - local s = table.concat(items, ", ") - --print(string.format("%-36s {%s}", recipe.output, s)) - Recipes[name] = {output = recipe.output, items = items} - end - end - - for name, ndef in pairs(minetest.registered_nodes) do - add(name, ndef) - end - for name, ndef in pairs(minetest.registered_items) do - add(name, ndef) - end -end - -minetest.after(2, collect_recipes) diff --git a/techage/basic_machines/source.lua b/techage/basic_machines/source.lua deleted file mode 100644 index 0c12fb8..0000000 --- a/techage/basic_machines/source.lua +++ /dev/null @@ -1,265 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2/TA3 Power Test Source - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Axle = techage.Axle ---local Pipe = techage.SteamPipe -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local STANDBY_TICKS = 4 -local CYCLE_TIME = 2 -local PWR_PERF = 100 - -local function formspec(self, pos, nvm) - return techage.generator_formspec(self, pos, nvm, S("Power Source"), nvm.provided, PWR_PERF) -end - --- Axles texture animation -local function switch_axles(pos, on) - local outdir = M(pos):get_int("outdir") - Axle:switch_tube_line(pos, outdir, on and "on" or "off") -end - -local function start_node2(pos, nvm, state) - nvm.running = true - nvm.provided = 0 - local outdir = M(pos):get_int("outdir") - switch_axles(pos, true) - power.start_storage_calc(pos, Axle, outdir) -end - -local function stop_node2(pos, nvm, state) - nvm.running = false - nvm.provided = 0 - nvm.load = 0 - local outdir = M(pos):get_int("outdir") - switch_axles(pos, false) - power.start_storage_calc(pos, Axle, outdir) -end - -local function start_node3(pos, nvm, state) - local meta = M(pos) - nvm.running = true - nvm.provided = 0 - techage.evaluate_charge_termination(nvm, meta) - local outdir = meta:get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local function stop_node3(pos, nvm, state) - nvm.running = false - nvm.provided = 0 - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local State2 = techage.NodeStates:new({ - node_name_passive = "techage:t2_source", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - start_node = start_node2, - stop_node = stop_node2, -}) - -local State3 = techage.NodeStates:new({ - node_name_passive = "techage:t4_source", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - start_node = start_node3, - stop_node = stop_node3, -}) - -local function node_timer2(pos, elapsed) - --print("node_timer2") - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Axle, outdir, PWR_PERF, tp1, tp2) - nvm.load = power.get_storage_load(pos, Axle, outdir, PWR_PERF) - if techage.is_activeformspec(pos) then - meta:set_string("formspec", formspec(State2, pos, nvm)) - end - return true -end - -local function node_timer3(pos, elapsed) - --print("node_timer4") - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local outdir = M(pos):get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) - nvm.load = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - if techage.is_activeformspec(pos) then - meta:set_string("formspec", formspec(State3, pos, nvm)) - end - return true -end - -local function on_receive_fields2(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State2:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State2, pos, nvm)) -end - -local function on_receive_fields3(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State3:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State3, pos, nvm)) -end - -local function on_rightclick2(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State2, pos, nvm)) -end - -local function on_rightclick3(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State3, pos, nvm)) -end - -local function after_place_node2(pos) - local nvm = techage.get_nvm(pos) - State2:node_init(pos, nvm, "") - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State2, pos, nvm)) - Axle:after_place_node(pos) -end - -local function after_place_node3(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:t4_source") - State3:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State3, pos, nvm)) - Cable:after_place_node(pos) -end - -local function after_dig_node2(pos, oldnode) - Axle:after_dig_node(pos) - techage.del_mem(pos) -end - -local function after_dig_node3(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if nvm.running then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -minetest.register_node("techage:t2_source", { - description = S("Axle Power Source"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2_top.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_axle_clutch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_source.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_source.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_source.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - on_receive_fields = on_receive_fields2, - on_rightclick = on_rightclick2, - on_timer = node_timer2, - after_place_node = after_place_node2, - after_dig_node = after_dig_node2, - get_generator_data = get_generator_data, -}) - -minetest.register_node("techage:t4_source", { - description = S("Ele Power Source"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_source.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_source.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_source.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - on_receive_fields = on_receive_fields3, - on_rightclick = on_rightclick3, - on_timer = node_timer3, - after_place_node = after_place_node3, - after_dig_node = after_dig_node3, - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta3", PWR_PERF), -}) - -power.register_nodes({"techage:t2_source"}, Axle, "gen", {"R"}) -power.register_nodes({"techage:t4_source"}, Cable, "gen", {"R"}) - -techage.register_node({"techage:t4_source"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "delivered" then - return nvm.provided or 0 - else - return State3:on_receive_message(pos, topic, payload) - end - end, -}) - -control.register_nodes({"techage:t4_source"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("Ele Power Source"), - number = meta:get_string("node_number") or "", - running = nvm.running or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) diff --git a/techage/basic_machines/ta4_chest.lua b/techage/basic_machines/ta4_chest.lua deleted file mode 100644 index 5e115cb..0000000 --- a/techage/basic_machines/ta4_chest.lua +++ /dev/null @@ -1,715 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 8x2000 Chest - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta -local S = techage.S - -local DESCRIPTION = S("TA4 8x2000 Chest") -local STACK_SIZE = 2000 - -local function gen_stack(inv, idx) - inv[idx] = {name = "", count = 0} - return inv[idx] -end - -local function gen_inv(nvm) - nvm.inventory = {} - for i = 1,8 do - gen_stack(nvm.inventory, i) - end - return nvm.inventory -end - -local function repair_inv(nvm) - nvm.inventory = nvm.inventory or {} - for i = 1,8 do - local item = nvm.inventory[i] - if not item or type(item) ~= "table" - or not item.name or type(item.name) ~= "string" or item.name == "" - or not item.count or type(item.count) ~= "number" or item.count < 1 - then - gen_stack(nvm.inventory, i) - end - end -end - -local function get_stack(nvm, idx) - nvm.inventory = nvm.inventory or {} - return nvm.inventory[idx] or gen_stack(nvm.inventory, idx) -end - -local function get_count(nvm, idx) - nvm.inventory = nvm.inventory or {} - if idx and idx > 0 then - return nvm.inventory[idx] and nvm.inventory[idx].count or 0 - else - local count = 0 - for _,item in ipairs(nvm.inventory) do - count = count + item.count or 0 - end - return count - end -end - -local function get_itemstring(nvm, idx) - if idx and idx > 0 then - nvm.inventory = nvm.inventory or {} - return nvm.inventory[idx] and nvm.inventory[idx].name or "" - end - return "" -end - -local function inv_empty(nvm) - for _,item in ipairs(nvm.inventory or {}) do - if item.count and item.count > 0 then - return false - end - end - return true -end - -local function inv_state(nvm) - local num = 0 - for _,item in ipairs(nvm.inventory or {}) do - if item.count and item.count > 0 then - num = num + 1 - end - end - if num == 0 then return "empty" end - if num == 8 then return "full" end - return "loaded" -end - -local function inv_state_num(nvm) - local num = 0 - for _,item in ipairs(nvm.inventory or {}) do - if item.count and item.count > 0 then - num = num + 1 - end - end - if num == 0 then return 0 end - if num == 8 then return 2 end - return 1 -end - -local function max_stacksize(item_name) - -- It is sufficient to use minetest.registered_items as all registration - -- functions (node, craftitems, tools) add the definitions there. - local ndef = minetest.registered_items[item_name] - -- Return 1 as fallback so that slots with unknown items can be emptied. - return ndef and ndef.stack_max or 1 -end - -local function get_stacksize(pos) - local size = M(pos):get_int("stacksize") - if size == 0 then - return STACK_SIZE - end - return size -end - --- Returns a boolean that indicates if an itemstack and nvmstack can be combined. --- The second return value is a string describing the reason. --- This function guarantees not to modify any of both stacks. -local function doesItemStackMatchNvmStack(itemstack, nvmstack) - if itemstack:get_count() == 0 or nvmstack.count == 0 then - return true, "Empty stack" - end - if nvmstack.name and nvmstack.name ~= "" and nvmstack.name ~= itemstack:get_name() then - return false, "Mismatching names" - end - - -- The following seems to be the most reliable approach to compare meta. - local nvm_meta = ItemStack():get_meta() - nvm_meta:from_table(minetest.deserialize(nvmstack.meta or "")) - if not nvm_meta:equals(itemstack:get_meta()) then - return false, "Mismatching meta" - end - if (nvmstack.wear or 0) ~= itemstack:get_wear() then - return false, "Mismatching wear" - end - return true, "Stacks match" -end - - --- Generic function for adding items to the 8x2000 Chest --- This function guarantees not to modify the itemstack. --- The number of items that were added to the chest is returned. -local function add_to_chest(pos, input_stack, idx) - local nvm = techage.get_nvm(pos) - local nvm_stack = get_stack(nvm, idx) - if input_stack:get_count() == 0 then - return 0 - end - if not doesItemStackMatchNvmStack(input_stack, nvm_stack) then - return 0 - end - local count = math.min(input_stack:get_count(), get_stacksize(pos) - (nvm_stack.count or 0)) - if nvm_stack.count == 0 then - nvm_stack.name = input_stack:get_name() - nvm_stack.meta = minetest.serialize(input_stack:get_meta():to_table()) - nvm_stack.wear = input_stack:get_wear() - end - nvm_stack.count = nvm_stack.count + count - return count -end - -local function stackOrNil(stack) - if stack and stack.get_count and stack:get_count() > 0 then - return stack - end - return nil -end - --- Generic function for taking items from the 8x2000 Chest --- output_stack is directly modified; but nil can also be supplied. --- The resulting output_stack is returned from the function. --- keep_assignment indicates if the meta information for this function should be considered (manual vs. tubes). -local function take_from_chest(pos, idx, output_stack, max_total_count, keep_assignment) - local nvm = techage.get_nvm(pos) - local nvm_stack = get_stack(nvm, idx) - output_stack = output_stack or ItemStack() - local assignment_count = keep_assignment and M(pos):get_int("assignment") == 1 and 1 or 0 - local count = math.min(nvm_stack.count - assignment_count, max_stacksize(nvm_stack.name) - output_stack:get_count()) - if max_total_count then - count = math.min(count, max_total_count - output_stack:get_count()) - end - if count < 1 then - return stackOrNil(output_stack) - end - if not doesItemStackMatchNvmStack(output_stack, nvm_stack) then - return stackOrNil(output_stack) - end - output_stack:add_item(ItemStack({ - name = nvm_stack.name, - count = count, - wear = nvm_stack.wear, - })) - output_stack:get_meta():from_table(minetest.deserialize(nvm_stack.meta or "")) - nvm_stack.count = nvm_stack.count - count - if nvm_stack.count == 0 then - gen_stack(nvm.inventory or {}, idx) - end - return stackOrNil(output_stack) -end - --- Function for adding items to the 8x2000 Chest via automation, e.g. pushers -local function tube_add_to_chest(pos, input_stack) - local nvm = techage.get_nvm(pos) - nvm.inventory = nvm.inventory or {} - - for idx = 1,8 do - input_stack:take_item(add_to_chest(pos, input_stack, idx)) - end - - if input_stack:get_count() > 0 then - return input_stack -- Not all items were added to chest - else - return true -- All items were added - end -end - --- Function for taking items from the 8x2000 Chest via automation, e.g. pushers -local function tube_take_from_chest(pos, item_name, count) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - nvm.inventory = nvm.inventory or {} - mem.startpos = mem.startpos or 1 - local prio = M(pos):get_int("priority") == 1 - local startpos = prio and 8 or mem.startpos - local endpos = prio and 1 or mem.startpos + 8 - local step = prio and -1 or 1 - local itemstack = ItemStack() - for idx = startpos,endpos,step do - idx = ((idx - 1) % 8) + 1 - local nvmstack = get_stack(nvm, idx) - if not item_name or item_name == nvmstack.name then - take_from_chest(pos, idx, itemstack, count - itemstack:get_count(), true) - if itemstack:get_count() == count then - mem.startpos = idx + 1 - return itemstack - end - end - mem.startpos = idx + 1 - end - return stackOrNil(itemstack) -end - --- Function for manually adding items to the 8x2000 Chest via the formspec -local function inv_add_to_chest(pos, idx) - local inv = M(pos):get_inventory() - local inv_stack = inv:get_stack("main", idx) - local count = add_to_chest(pos, inv_stack, idx) - inv_stack:set_count(inv_stack:get_count() - count) - inv:set_stack("main", idx, inv_stack) -end - --- Function for manually taking items from the 8x2000 Chest via the formspec -local function inv_take_from_chest(pos, idx) - local inv = M(pos):get_inventory() - local inv_stack = inv:get_stack("main", idx) - if inv_stack:get_count() > 0 then - return - end - local output_stack = take_from_chest(pos, idx) - if output_stack then - inv:set_stack("main", idx, output_stack) - end -end - -local function formspec_container(x, y, nvm, inv) - local tbl = {"container["..x..","..y.."]"} - for i = 1,8 do - local xpos = i - 1 - tbl[#tbl+1] = "box["..(xpos - 0.03)..",0;0.86,0.9;#808080]" - local stack = get_stack(nvm, i) - if stack.name ~= "" then - local itemstack = ItemStack({ - name = stack.name, - count = stack.count, - wear = stack.wear, - }) - local stack_meta_table = (minetest.deserialize(stack.meta) or {}).fields or {} - for _, key in ipairs({"description", "short_description", "color", "palette_index"}) do - if stack_meta_table[key] then - itemstack:get_meta():set_string(key, stack_meta_table[key]) - end - end - local itemname = itemstack:to_string() - --tbl[#tbl+1] = "item_image["..xpos..",1;1,1;"..itemname.."]" - tbl[#tbl+1] = techage.item_image(xpos, 0, itemname, stack.count) - end - if inv:get_stack("main", i):get_count() == 0 then - tbl[#tbl+1] = "image_button["..xpos..",1;1,1;techage_form_get_arrow.png;get"..i..";]" - else - tbl[#tbl+1] = "image_button["..xpos..",1;1,1;techage_form_add_arrow.png;add"..i..";]" - end - end - tbl[#tbl+1] = "list[context;main;0,2;8,1;]" - tbl[#tbl+1] = "container_end[]" - return table.concat(tbl, "") -end - -local function formspec(pos) - local nvm = techage.get_nvm(pos) - local inv = M(pos):get_inventory() - local size = get_stacksize(pos) - local assignment = M(pos):get_int("assignment") == 1 and "true" or "false" - local priority = M(pos):get_int("priority") == 1 and "true" or "false" - return "size[8,8.3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - formspec_container(0, 0, nvm, inv).. - "button[0,3.5;3,1;unlock;"..S("Unlock").."]".. - "tooltip[0,3.5;3,1;"..S("Unlock connected chest\nif all slots are below 2000")..";#0C3D32;#FFFFFF]".. - "label[0,3;"..S("Size")..": 8x"..size.."]".. - "checkbox[4,3;assignment;"..S("keep assignment")..";"..assignment.."]".. - "tooltip[4,3;2,0.6;"..S("Never completely empty the slots\nwith the pusher to keep the item assignment")..";#0C3D32;#FFFFFF]".. - "checkbox[4,3.6;priority;"..S("right to left")..";"..priority.."]".. - "tooltip[4,3.6;2,0.6;"..S("Empty the slots always \nfrom right to left")..";#0C3D32;#FFFFFF]".. - "list[current_player;main;0,4.6;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function count_number_of_chests(pos) - local node = techage.get_node_lvm(pos) - local dir = techage.side_to_outdir("B", node.param2) - local pos1 = tubelib2.get_pos(pos, dir) - local param2 = node.param2 - local cnt = 1 - while cnt < 50 do - node = techage.get_node_lvm(pos1) - if node.name ~= "techage:ta4_chest_dummy" then - break - end - local meta = M(pos1) - if meta:contains("param2") and meta:get_int("param2") ~= param2 then - break - end - pos1 = tubelib2.get_pos(pos1, dir) - cnt = cnt + 1 - end - M(pos):set_int("stacksize", STACK_SIZE * cnt) -end - -local function dummy_chest_behind(pos, node) - local dir = techage.side_to_outdir("B", node.param2) - local pos1 = tubelib2.get_pos(pos, dir) - node = techage.get_node_lvm(pos1) - return node.name == "techage:ta4_chest_dummy" -end - -local function part_of_a_chain(pos, node) - local dir = techage.side_to_outdir("F", node.param2) - local pos1 = tubelib2.get_pos(pos, dir) - node = techage.get_node_lvm(pos1) - return node.name == "techage:ta4_chest_dummy" or node.name == "techage:ta4_chest" -end - -local function search_chest_in_front(pos, node) - local dir = techage.side_to_outdir("F", node.param2) - local pos1 = tubelib2.get_pos(pos, dir) - local param2 = node.param2 - local cnt = 1 - while cnt < 50 do - node = techage.get_node_lvm(pos1) - if node.name ~= "techage:ta4_chest_dummy" then - break - end - local meta = M(pos1) - if meta:contains("param2") and meta:get_int("param2") ~= param2 then - break - end - pos1 = tubelib2.get_pos(pos1, dir) - cnt = cnt + 1 - end - if node.name == "techage:ta4_chest" and node.param2 == param2 then - minetest.after(1, count_number_of_chests, pos1) - local nvm = techage.get_nvm(pos) - nvm.front_chest_pos = pos1 - return true - end - return false -end - -local function get_front_chest_pos(pos) - local nvm = techage.get_nvm(pos) - if nvm.front_chest_pos then - return nvm.front_chest_pos - end - - local node = techage.get_node_lvm(pos) - if search_chest_in_front(pos, node) then - return nvm.front_chest_pos - end - - return pos -end - -local function convert_to_chest_again(pos, node, player) - local dir = techage.side_to_outdir("B", node.param2) - local pos1 = tubelib2.get_pos(pos, dir) - local node1 = techage.get_node_lvm(pos1) - if minetest.is_protected(pos1, player:get_player_name()) then - return - end - if node1.name == "techage:ta4_chest_dummy" then - node1.name = "techage:ta4_chest" - minetest.swap_node(pos1, node1) - --M(pos1):set_int("disabled", 1) - local nvm = techage.get_nvm(pos1) - gen_inv(nvm) - local number = techage.add_node(pos1, "techage:ta4_chest") - M(pos1):set_string("owner", player:get_player_name()) - M(pos1):set_string("formspec", formspec(pos1)) - M(pos1):set_string("infotext", DESCRIPTION.." "..number) - end -end - -local function unlock_chests(pos, player) - local nvm = techage.get_nvm(pos) - for idx = 1,8 do - if get_count(nvm, idx) > STACK_SIZE then return end - end - local node = techage.get_node_lvm(pos) - convert_to_chest_again(pos, node, player) - M(pos):set_int("stacksize", STACK_SIZE) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return count -end - -local function on_metadata_inventory_put(pos, listname, index, stack, player) - M(pos):set_string("formspec", formspec(pos)) - techage.set_activeformspec(pos, player) -end - -local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - M(pos):set_string("formspec", formspec(pos)) - techage.set_activeformspec(pos, player) -end - -local function on_metadata_inventory_take(pos, listname, index, stack, player) - M(pos):set_string("formspec", formspec(pos)) - techage.set_activeformspec(pos, player) -end - -local function on_rightclick(pos, node, clicker) - if M(pos):get_int("disabled") ~= 1 then - local nvm = techage.get_nvm(pos) - repair_inv(nvm) - M(pos):set_string("formspec", formspec(pos)) - techage.set_activeformspec(pos, clicker) - end -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - for i = 1,8 do - if fields["get"..i] ~= nil then - inv_take_from_chest(pos, i) - break - elseif fields["add"..i] ~= nil then - inv_add_to_chest(pos, i) - break - end - end - if fields.unlock then - unlock_chests(pos, player) - end - if fields.assignment then - M(pos):set_int("assignment", fields.assignment == "true" and 1 or 0) - end - if fields.priority then - M(pos):set_int("priority", fields.priority == "true" and 1 or 0) - end - - M(pos):set_string("formspec", formspec(pos)) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - local nvm = techage.get_nvm(pos) - return inv:is_empty("main") and inv_empty(nvm) -end - -local function on_rotate(pos, node, user, mode, new_param2) - if get_stacksize(pos) == STACK_SIZE then - return screwdriver.rotate_simple(pos, node, user, mode, new_param2) - else - return screwdriver.disallow(pos, node, user, mode, new_param2) - end -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - convert_to_chest_again(pos, oldnode, digger) -end - -minetest.register_node("techage:ta4_chest", { - description = DESCRIPTION, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_front_ta4.png^techage_appl_warehouse.png", - }, - - on_construct = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('main', 8) - end, - - after_place_node = function(pos, placer) - local node = minetest.get_node(pos) - if dummy_chest_behind(pos, node) then - minetest.remove_node(pos) - return true - end - if search_chest_in_front(pos, node) then - node.name = "techage:ta4_chest_dummy" - minetest.swap_node(pos, node) - M(pos):set_int("param2", node.param2) - else - local nvm = techage.get_nvm(pos) - gen_inv(nvm) - local number = techage.add_node(pos, "techage:ta4_chest") - M(pos):set_string("owner", placer:get_player_name()) - M(pos):set_string("formspec", formspec(pos)) - M(pos):set_string("infotext", DESCRIPTION.." "..number) - end - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, DESCRIPTION) - end, - - on_rotate = on_rotate, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - on_metadata_inventory_put = on_metadata_inventory_put, - on_metadata_inventory_move = on_metadata_inventory_move, - on_metadata_inventory_take = on_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_chest_dummy", { - description = DESCRIPTION, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_front_ta4.png^techage_appl_warehouse.png", - }, - - on_rightclick = function(pos, node, clicker) - end, - paramtype2 = "facedir", - diggable = false, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -techage.register_node({"techage:ta4_chest"}, { - on_pull_item = function(pos, in_dir, num, item_name) - local res = tube_take_from_chest(pos, item_name, num) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return res - end, - on_push_item = function(pos, in_dir, stack) - local res = tube_add_to_chest(pos, stack) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return res - end, - on_unpull_item = function(pos, in_dir, stack) - local res = tube_add_to_chest(pos, stack) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return res - end, - - on_recv_message = function(pos, src, topic, payload) - if topic == "count" then - local nvm = techage.get_nvm(pos) - return get_count(nvm, tonumber(payload or 0) or 0) - elseif topic == "itemstring" then - local nvm = techage.get_nvm(pos) - return get_itemstring(nvm, tonumber(payload or 0) or 0) - elseif topic == "storesize" then - return get_stacksize(pos) - elseif topic == "state" then - local nvm = techage.get_nvm(pos) - return inv_state(nvm) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 140 and payload[1] == 1 then -- Inventory Item Count - local nvm = techage.get_nvm(pos) - return 0, {get_count(nvm, tonumber(payload[2] or 0) or 0)} - elseif topic == 140 and payload[1] == 2 then -- Inventory Item Name - local nvm = techage.get_nvm(pos) - return 0, get_itemstring(nvm, tonumber(payload[2] or 0) or 0) - elseif topic == 140 and payload[1] == 3 then -- storesize - return 0, {get_stacksize(pos)} - elseif topic == 131 then -- Chest State - local nvm = techage.get_nvm(pos) - return 0, {inv_state_num(nvm)} - else - return 2, "" - end - end, -}) - -techage.register_node({"techage:ta4_chest_dummy"}, { - on_pull_item = function(pos, in_dir, num, item_name) - local fc_pos = get_front_chest_pos(pos) - local res = tube_take_from_chest(fc_pos, item_name, num) - if techage.is_activeformspec(fc_pos) then - M(fc_pos):set_string("formspec", formspec(fc_pos)) - end - return res - end, - on_push_item = function(pos, in_dir, stack) - local fc_pos = get_front_chest_pos(pos) - local res = tube_add_to_chest(fc_pos, stack) - if techage.is_activeformspec(fc_pos) then - M(fc_pos):set_string("formspec", formspec(fc_pos)) - end - return res - end, - on_unpull_item = function(pos, in_dir, stack) - local fc_pos = get_front_chest_pos(pos) - local res = tube_add_to_chest(fc_pos, stack) - if techage.is_activeformspec(fc_pos) then - M(fc_pos):set_string("formspec", formspec(fc_pos)) - end - return res - end -}) - -minetest.register_lbm({ - label = "Repair Dummy Chests", - name = "techage:chest_dummy", - nodenames = {"techage:ta4_chest_dummy"}, - run_at_every_load = true, - action = function(pos, node) - if not part_of_a_chain(pos, node) then - minetest.swap_node(pos, {name = "techage:ta4_chest", param2 = node.param2}) - end - end, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta4_chest", - recipe = {"techage:chest_ta4"} -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta4", - recipe = {"techage:ta4_chest"} -}) diff --git a/techage/basic_machines/ta4_injector.lua b/techage/basic_machines/ta4_injector.lua deleted file mode 100644 index e6a7eac..0000000 --- a/techage/basic_machines/ta4_injector.lua +++ /dev/null @@ -1,331 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Injector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end -local tooltip = S("Switch to pull mode \nto pull items out of inventory slots \naccording the injector configuration") -local Tube = techage.Tube - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 3 -local CYCLE_TIME = 4 - -local function formspec(self, pos, nvm) - local pull_mode = dump(nvm.pull_mode or false) - return "size[8,7.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize("#000000", S("Injector")).."]".. - techage.question_mark_help(8, S("Configure up to 8 items \nto be pushed by the injector")).. - "list[context;filter;0,0.8;8,1;]".. - "image_button[2,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "checkbox[3.5,1.9;pull_mode;"..S("pull mode")..";"..pull_mode.."]".. - "tooltip[3.5,1.9;2,0.8;"..tooltip..";#0C3D32;#FFFFFF]".. - "list[current_player;main;0,3.5;8,4;]".. - "listring[context;filter]".. - "listring[current_player;main]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local nvm = techage.get_nvm(pos) - if CRD(pos).State:get_state(nvm) ~= techage.STOPPED then - return 0 - end - - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - local cdr = CRD(pos) - if list[index]:get_count() < cdr.num_items then - local num = math.min(cdr.num_items - list[index]:get_count(), stack:get_count()) + list[index]:get_count() - stack:set_count(num) - inv:set_stack(listname, index, stack) - return 0 - end - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local nvm = techage.get_nvm(pos) - if CRD(pos).State:get_state(nvm) ~= techage.STOPPED then - return 0 - end - - local inv = M(pos):get_inventory() - inv:set_stack(listname, index, nil) - return 0 -end - -local function pull_items(pos, out_dir, idx, name, num) - local inv, listname = techage.get_inv_access(pos, out_dir, "pull") - if inv and listname then - if idx and idx ~= 0 then - local stack = inv:get_stack(listname, idx) - if stack and not stack:is_empty() and stack:get_name() == name then - local taken = stack:take_item(num) - inv:set_stack(listname, idx, stack) - return (taken:get_count() > 0) and taken or nil - end - else - local taken = inv:remove_item(listname, {name = name, count = num}) - return (taken:get_count() > 0) and taken or nil - end - else - return techage.pull_items(pos, out_dir, num, name) - end -end - -local function push_items(pos, out_dir, idx, items) - local inv, listname, callafter, dpos = techage.get_inv_access(pos, out_dir, "push") - if inv and listname then - if idx and idx ~= 0 then - local stack = inv:get_stack(listname, idx) - if stack:item_fits(items) then - stack:add_item(items) - inv:set_stack(listname, idx, stack) - if callafter then - callafter(dpos) - end - return true - end - else - if inv:room_for_item(listname, items) then - inv:add_item(listname, items) - if callafter then - callafter(dpos) - end - return true - end - end - return false - else - local taken = items:get_count() - local leftover = techage.push_items(pos, out_dir, items, idx) - if not leftover or leftover == false then - return false -- No items placed - elseif leftover ~= true then - -- One or more items placed? - if leftover:get_count() < taken then - -- place the rest back - local pull_dir = M(pos):get_int("pull_dir") - techage.unpull_items(pos, pull_dir, leftover) - return true -- Some items placed - end - return false -- No items placed - end - return true -- All items placed - end -end - -local function unpull_items(pos, out_dir, idx, items) - local inv, listname = techage.get_inv_access(pos, out_dir, "unpull") - if inv and listname then - if idx and idx ~= 0 then - local stack = inv:get_stack(listname, idx) - stack:add_item(items) - inv:set_stack(listname, idx, stack) - else - inv:add_item(listname, items) - end - else - techage.unpull_items(pos, out_dir, items) - end -end - -local function pushing(pos, crd, meta, nvm) - local pull_dir = meta:get_int("pull_dir") - local push_dir = meta:get_int("push_dir") - local inv = M(pos):get_inventory() - local filter = inv:get_list("filter") - local pushed = false - local pulled = false - - for idx, item in ipairs(filter) do - local name = item:get_name() - local num = math.min(item:get_count(), crd.num_items) - if name ~= "" and num > 0 then - local items = pull_items(pos, pull_dir, nvm.pull_mode and idx, name, num) - if items ~= nil then - pulled = true - if push_items(pos, push_dir, not nvm.pull_mode and idx, items) then - pushed = true - else -- place item back - unpull_items(pos, pull_dir, nvm.pull_mode and idx, items) - pulled = false - end - end - end - end - - if not pulled then - crd.State:idle(pos, nvm) - elseif not pushed then - crd.State:blocked(pos, nvm) - else - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - pushing(pos, crd, M(pos), nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - if fields.pull_mode then - nvm.pull_mode = fields.pull_mode == "true" - end - CRD(pos).State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) -end - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_appl_pusher.png^[transformR180]^techage_frame_ta#.png^techage_appl_injector.png", - "techage_appl_pusher.png^techage_frame_ta#.png^techage_appl_injector.png", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_arrow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - { - name = "techage_appl_pusher14.png^[transformR180]^techage_frame14_ta#.png^techage_appl_injector14.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_appl_pusher14.png^techage_frame14_ta#.png^techage_appl_injector14.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, -} - -local tubing = { - -- push item through the injector in opposit direction - on_push_item = function(pos, in_dir, stack) - return in_dir == M(pos):get_int("pull_dir") and techage.safe_push_items(pos, in_dir, stack) - end, - is_pusher = true, -- is a pulling/pushing node - - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos) - CRD(pos).State:on_node_load(pos) - end, -} - -local _, node_name_ta3, node_name_ta4 = - techage.register_consumer("injector", S("Injector"), tiles, { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - quick_start = node_timer, - after_place_node = function(pos, placer) - local meta = M(pos) - local node = minetest.get_node(pos) - meta:set_int("pull_dir", techage.side_to_outdir("L", node.param2)) - meta:set_int("push_dir", techage.side_to_outdir("R", node.param2)) - local inv = M(pos):get_inventory() - inv:set_size('filter', 8) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end, - ta_rotate_node = function(pos, node, new_param2) - local nvm = techage.get_nvm(pos) - if CRD(pos).State:get_state(nvm) == techage.STOPPED then - Tube:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Tube:after_place_node(pos) - local meta = M(pos) - meta:set_int("pull_dir", techage.side_to_outdir("L", new_param2)) - meta:set_int("push_dir", techage.side_to_outdir("R", new_param2)) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - allow_metadata_inventory_move = function() return 0 end, - on_receive_fields = on_receive_fields, - node_timer = node_timer, - on_rotate = screwdriver.disallow, - - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - num_items = {0,0,1,4}, - }, {false, false, true, true}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "default:steel_ingot", ""}, - {"", "techage:ta3_pusher_pas", ""}, - {"", "basic_materials:ic", ""}, - }, -}) - -minetest.register_craft({ - output = node_name_ta4, - recipe = { - {"", "techage:aluminum", ""}, - {"", "techage:ta4_pusher_pas", ""}, - {"", "basic_materials:ic", ""}, - }, -}) diff --git a/techage/basic_machines/ta5_chest.lua b/techage/basic_machines/ta5_chest.lua deleted file mode 100644 index d5c7046..0000000 --- a/techage/basic_machines/ta5_chest.lua +++ /dev/null @@ -1,248 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Hyperloop Chest - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local TA4_INV_SIZE = 32 -local EX_POINTS = 15 - -local hyperloop = techage.hyperloop -local remote_pos = techage.hyperloop.remote_pos -local shared_inv = techage.shared_inv -local menu = techage.menu - -local function formspec(pos) - local ndef = minetest.registered_nodes["techage:ta5_hl_chest"] - local status = M(pos):get_string("conn_status") - if hyperloop.is_server(pos) then - local title = ndef.description .. " " .. status - return "size[8,9]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "list[context;main;0,1;8,4;]".. - "list[current_player;main;0,5.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" - elseif hyperloop.is_client(pos) then - local title = ndef.description .. " " .. status - return "size[8,9]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "label[0.2,2;Inventory access on this node is disabled\ndue to minetest engine issues!]" .. - "list[current_player;main;0,5.3;8,4;]" - else - return menu.generate_formspec(pos, ndef, hyperloop.SUBMENU) - end -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if techage.hyperloop.is_client(pos) then - return 0 - end - shared_inv.before_inv_access(pos, listname) - local inv = minetest.get_inventory({type="node", pos=pos}) - if inv and inv:room_for_item(listname, stack) then - return stack:get_count() - end - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if techage.hyperloop.is_client(pos) then - return 0 - end - shared_inv.before_inv_access(pos, listname) - local inv = minetest.get_inventory({type="node", pos=pos}) - if inv and inv:contains_item(listname, stack) then - return stack:get_count() - end - return 0 -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if shared_inv.before_inv_access(pos, "main") then - return 0 - end - if techage.hyperloop.is_client(pos) then - return 0 - end - return count -end - -minetest.register_node("techage:ta5_hl_chest", { - description = S("TA5 Hyperloop Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_chest_back_ta4.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_chest_front_ta4.png", - }, - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 32) - local number = techage.add_node(pos, "techage:ta5_hl_chest") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec(pos)) - meta:set_string("infotext", S("TA5 Hyperloop Chest").." "..number) - hyperloop.after_place_node(pos, placer, "chest") - end, - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if techage.get_expoints(player) >= EX_POINTS then - if techage.menu.eval_input(pos, hyperloop.SUBMENU, fields) then - hyperloop.after_formspec(pos, fields) - shared_inv.on_rightclick(pos, player, "main") - M(pos):set_string("formspec", formspec(pos)) - end - end - end, - on_timer = shared_inv.node_timer, - on_rightclick = function(pos, node, clicker) - shared_inv.on_rightclick(pos, clicker, "main") - M(pos):set_string("formspec", formspec(pos)) - end, - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - shared_inv.before_inv_access(pos, "main") - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - hyperloop.after_dig_node(pos, oldnode, oldmetadata, digger) - techage.del_mem(pos) - end, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - allow_metadata_inventory_move = allow_metadata_inventory_move, - on_metadata_inventory_put = shared_inv.after_inv_access, - on_metadata_inventory_take = shared_inv.after_inv_access, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -techage.register_node({"techage:ta5_hl_chest"}, { - on_inv_request = function(pos, in_dir, access_type) - pos = remote_pos(pos) - if pos then - local meta = minetest.get_meta(pos) - if meta then - return meta:get_inventory(), "main" - end - end - end, - on_pull_item = function(pos, in_dir, num, item_name) - pos = remote_pos(pos) - if pos then - local meta = minetest.get_meta(pos) - if meta then - local inv = meta:get_inventory() - if inv then - return techage.get_items(pos, inv, "main", num) - end - end - end - return false - end, - on_push_item = function(pos, in_dir, stack) - if techage.hyperloop.is_paired(pos) then - pos = remote_pos(pos) - if pos then - local meta = minetest.get_meta(pos) - if meta then - local inv = meta:get_inventory() - if inv then - return techage.put_items(inv, "main", stack) - end - end - end - end - return false - end, - on_unpull_item = function(pos, in_dir, stack) - pos = remote_pos(pos) - if pos then - local meta = minetest.get_meta(pos) - if meta then - local inv = meta:get_inventory() - if inv then - return techage.put_items(inv, "main", stack) - end - end - end - return false - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = minetest.get_meta(pos) - if meta then - local inv = meta:get_inventory() - if inv then - return techage.get_inv_state(inv, "main") - end - end - return "error" - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- Chest State - local meta = minetest.get_meta(pos) - if meta then - local inv = meta:get_inventory() - if inv then - return 0, {techage.get_inv_state_num(inv, "main")} - end - end - else - return 2, "" - end - end, -}) - - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta5_hl_chest", - recipe = {"techage:chest_ta4", "techage:ta5_aichip"} -}) - -minetest.register_on_mods_loaded(function() - if not minetest.global_exists("hyperloop") then - minetest.clear_craft({output = "techage:ta5_hl_chest"}) - end -end) diff --git a/techage/basis/assemble.lua b/techage/basis/assemble.lua deleted file mode 100644 index 8763d2d..0000000 --- a/techage/basis/assemble.lua +++ /dev/null @@ -1,242 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Assemble routines - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -techage.assemble = {} - -local Face2Dir = {[0]= - {x=0, y=0, z=1}, - {x=1, y=0, z=0}, - {x=0, y=0, z=-1}, - {x=-1, y=0, z=0}, - {x=0, y=-1, z=0}, - {x=0, y=1, z=0} -} - --- Determine the destination position based on the base position, --- param2, and a route table like : {0,3} --- 0 = forward, 1 = right, 2 = backward, 3 = left -local function dest_pos(pos, param2, route, y_offs) - local p2 = param2 - local pos1 = {x=pos.x, y=pos.y+y_offs, z=pos.z} - for _,dir in ipairs(route) do - p2 = (param2 + dir) % 4 - pos1 = vector.add(pos1, Face2Dir[p2]) - end - return pos1, p2 -end - - --- timer based function -local function build(pos, param2, AssemblyPlan, idx) - local item = AssemblyPlan[idx] - if item ~= nil then - local y, path, fd_offs, node_name = item[1], item[2], item[3], item[4] - local pos1 = dest_pos(pos, param2, path, y) - minetest.add_node(pos1, {name=node_name, param2=(param2 + fd_offs) % 4}) - minetest.after(0.5, build, pos, param2, AssemblyPlan, idx+1) - else - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - end -end - --- timer based function -local function remove(pos, param2, AssemblyPlan, idx) - local item = AssemblyPlan[idx] - if item ~= nil then - local y, path = item[1], item[2] - local pos1 = dest_pos(pos, param2, path, y) - minetest.remove_node(pos1) - minetest.after(0.5, remove, pos, param2, AssemblyPlan, idx-1) - else - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - end -end - -local function check_space(pos, param2, AssemblyPlan, player_name) - for _,item in ipairs(AssemblyPlan) do - local y, path, node_name = item[1], item[2], item[4] - local pos1 = dest_pos(pos, param2, path, y) - if minetest.is_protected(pos1, player_name) then - minetest.chat_send_player(player_name, S("[TA] Area is protected!")) - return false - end - - local node = techage.get_node_lvm(pos1) - local ndef = minetest.registered_nodes[node.name] - if not ndef or not ndef.buildable_to and node.name ~= node_name then - minetest.chat_send_player(player_name, S("[TA] Not enough space!")) - return false - end - end - return true -end - - --- Two important flags: --- 1) nvm.assemble_locked is true while the object is being assembled/disassembled --- 2) nvm.assemble_build is true if the object is assembled -function techage.assemble.build(pos, AssemblyPlan, player_name) - -- check protection - if minetest.is_protected(pos, player_name) then - return - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked then - return - end - local node = minetest.get_node(pos) - if check_space(pos, node.param2, AssemblyPlan, player_name) then - nvm.assemble_locked = true - build(pos, node.param2, AssemblyPlan, 1) - nvm.assemble_build = true - end -end - -function techage.assemble.remove(pos, AssemblyPlan, player_name) - -- check protection - if minetest.is_protected(pos, player_name) then - return - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked then - return - end - local node = minetest.get_node(pos) - nvm.assemble_locked = true - remove(pos, node.param2, AssemblyPlan, #AssemblyPlan) - nvm.assemble_build = false -end - --------------------------------------------------------------------------------- --- Assembly functions based on nodes from node inventory --------------------------------------------------------------------------------- -local function play_sound(pos, sound) - minetest.sound_play(sound, { - pos = pos, - gain = 1, - max_hear_distance = 10, - }) -end - -local function build_inv(pos, inv, param2, AssemblyPlan, player_name, idx) - local item = AssemblyPlan[idx] - if item ~= nil then - local y, path, fd_offs, node_name = item[1], item[2], item[3], item[4] - local pos1 = dest_pos(pos, param2, path, y) - if not minetest.is_protected(pos1, player_name) then - local node = minetest.get_node(pos1) - if techage.is_air_like(node.name) then - local stack = inv:remove_item("src", ItemStack(node_name)) - if stack:get_count() == 1 then - minetest.add_node(pos1, {name=node_name, param2=(param2 + fd_offs) % 4}) - play_sound(pos, "default_place_node_hard") - local ndef = minetest.registered_nodes[node_name] - if ndef and ndef.after_place_node then - local placer = minetest.get_player_by_name(player_name) - ndef.after_place_node(pos1, placer, ItemStack(node_name)) - end - end - end - end - minetest.after(0.5, build_inv, pos, inv, param2, AssemblyPlan, player_name, idx + 1) - else - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - end -end - -local function remove_inv(pos, inv, param2, AssemblyPlan, player_name, idx) - local item = AssemblyPlan[idx] - if item ~= nil then - local y, path, fd_offs, node_name = item[1], item[2], item[3], item[4] - local pos1 = dest_pos(pos, param2, path, y) - if not minetest.is_protected(pos1, player_name) then - local stack = ItemStack(node_name) - if inv:room_for_item("src", stack) then - local node = minetest.get_node(pos1) - if node.name == node_name then - local meta = M(pos1):to_table() - minetest.remove_node(pos1) - inv:add_item("src", stack) - play_sound(pos, "default_dig_cracky") - local ndef = minetest.registered_nodes[node_name] - if ndef and ndef.after_dig_node then - local digger = minetest.get_player_by_name(player_name) - ndef.after_dig_node(pos1, node, meta, digger) - end - end - end - end - minetest.after(0.5, remove_inv, pos, inv, param2, AssemblyPlan, player_name, idx - 1) - else - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - end -end - -function techage.assemble.build_inv(pos, inv, AssemblyPlan, player_name) - -- check protection - if minetest.is_protected(pos, player_name) then - return - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked then - return - end - local node = minetest.get_node(pos) - nvm.assemble_locked = true - build_inv(pos, inv, node.param2, AssemblyPlan, player_name, 1) -end - -function techage.assemble.remove_inv(pos, inv, AssemblyPlan, player_name) - -- check protection - if minetest.is_protected(pos, player_name) then - return - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked then - return - end - local node = minetest.get_node(pos) - nvm.assemble_locked = true - remove_inv(pos, inv, node.param2, AssemblyPlan, player_name, #AssemblyPlan) -end - -function techage.assemble.count_items(AssemblyPlan) - local t = {} - for _, item in ipairs(AssemblyPlan) do - local node_name = item[4] - local ndef = minetest.registered_nodes[node_name] - local name = ndef.description - if not t[name] then - t[name] = 1 - else - t[name] = t[name] + 1 - end - end - return t -end - --- Determine the destination position based on the given route --- param2, and a route table like : {0,3} --- 0 = forward, 1 = right, 2 = backward, 3 = left --- techage.assemble.get_pos(pos, param2, route, y_offs) -techage.assemble.get_pos = dest_pos diff --git a/techage/basis/boiler_lib.lua b/techage/basis/boiler_lib.lua deleted file mode 100644 index e1202fe..0000000 --- a/techage/basis/boiler_lib.lua +++ /dev/null @@ -1,150 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Boiler common functions - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local HEAT_STEP = 10 -local MAX_WATER = 10 -local BLOCKING_TIME = 0.3 -- 300ms - -techage.boiler = {} - -local IsWater = { - ["bucket:bucket_river_water"] = "bucket:bucket_empty", -} - -local IsBucket = {} - -local function node_description(name) - name = string.split(name, " ")[1] - local ndef = minetest.registered_nodes[name] or minetest.registered_items[name] or minetest.registered_craftitems[name] - if ndef and ndef.description then - return minetest.formspec_escape(ndef.description) - end - return "" -end - -local function item_image(x, y, itemname) - return "box["..x..","..y..";0.85,0.9;#808080]".. - "item_image["..x..","..y..";1,1;"..itemname.."]" -end - -function techage.boiler.formspec(pos, nvm) - local title = S("Water Boiler") - local temp = nvm.temperature or 20 - local ratio = nvm.power_ratio or 0 - local tooltip = S("To add water punch\nthe boiler\nwith a water bucket") - return "size[5,3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;4.8,0.5;#c6e8ff]".. - "label[1.5,-0.1;"..minetest.colorize("#000000", title).."]".. - item_image(1, 1.5, "default:water_source "..(nvm.num_water or 0)).. - "tooltip[1,1.5;1,1;"..tooltip..";#0C3D32;#FFFFFF]".. - "image[3,1.0;1,2;techage_form_temp_bg.png^[lowpart:".. - temp..":techage_form_temp_fg.png]".. - "tooltip[3,1;1,2;"..S("water temperature")..";#0C3D32;#FFFFFF]" -end - -function techage.boiler.water_temperature(pos, nvm) - nvm.temperature = nvm.temperature or 20 - nvm.num_water = nvm.num_water or 0 - nvm.water_level = nvm.water_level or 0 - if nvm.fire_trigger then - nvm.temperature = math.min(nvm.temperature + HEAT_STEP, 100) - else - nvm.temperature = math.max(nvm.temperature - HEAT_STEP, 20) - end - nvm.fire_trigger = false - - if nvm.water_level == 0 then - if nvm.num_water > 0 then - nvm.num_water = nvm.num_water - 1 - nvm.water_level = 100 - else - nvm.temperature = 20 - end - end - return nvm.temperature -end - -function techage.boiler.on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", techage.boiler.formspec(pos, nvm)) -end - -function techage.boiler.can_dig(pos, player) - local nvm = techage.get_nvm(pos) - nvm.num_water = nvm.num_water or 0 - return nvm.num_water == 0 -end - -local function space_in_inventory(wielded_item, item_count, puncher) - -- check if holding more than 1 empty container - if item_count > 1 then - local inv = puncher:get_inventory() - local item = ItemStack({name=wielded_item, count = item_count - 1}) - if inv:room_for_item("main", item) then - inv:add_item("main", item) - return true - end - return false - end - return true -end - -function techage.boiler.on_punch(pos, node, puncher, pointed_thing) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.blocking_time = mem.blocking_time or 0 - if mem.blocking_time > techage.SystemTime then - return - end - - nvm.num_water = nvm.num_water or 0 - local wielded_item = puncher:get_wielded_item():get_name() - local item_count = puncher:get_wielded_item():get_count() - if IsWater[wielded_item] and nvm.num_water < MAX_WATER then - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - nvm.num_water = nvm.num_water + 1 - puncher:set_wielded_item(ItemStack(IsWater[wielded_item])) - M(pos):set_string("formspec", techage.boiler.formspec(pos, nvm)) - elseif IsBucket[wielded_item] and nvm.num_water > 0 then - if item_count > 1 then - local inv = puncher:get_inventory() - local item = ItemStack(IsBucket[wielded_item]) - if inv:room_for_item("main", item) then - inv:add_item("main", item) - puncher:set_wielded_item({name=wielded_item, count = item_count - 1}) - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - nvm.num_water = nvm.num_water - 1 - end - else - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - nvm.num_water = nvm.num_water - 1 - puncher:set_wielded_item(ItemStack(IsBucket[wielded_item])) - end - M(pos):set_string("formspec", techage.boiler.formspec(pos, nvm)) - end -end - -function techage.register_water_bucket(empty_bucket, full_bucket) - IsWater[full_bucket] = empty_bucket - IsBucket[empty_bucket] = full_bucket -end diff --git a/techage/basis/command.lua b/techage/basis/command.lua deleted file mode 100644 index edc8af3..0000000 --- a/techage/basis/command.lua +++ /dev/null @@ -1,691 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Basis functions for inter-node communication - -]]-- - ---- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end ---local P = minetest.string_to_pos ---local M = minetest.get_meta -local has_mesecons = minetest.global_exists("mesecon") - -local NodeInfoCache = {} -local NumbersToBeRecycled = {} -local MP = minetest.get_modpath("techage") -local techage_use_sqlite = minetest.settings:get_bool('techage_use_sqlite', false) - --- Localize functions to avoid table lookups (better performance) -local string_split = string.split -local NodeDef = techage.NodeDef -local Tube = techage.Tube -local is_cart_available = minecart.is_nodecart_available -local techage_counting_hit = techage.counting_hit -local tubelib2_side_to_dir = tubelib2.side_to_dir - -------------------------------------------------------------------- --- Database -------------------------------------------------------------------- -local backend -if techage_use_sqlite then - backend = dofile(MP .. "/basis/numbers_sqlite.lua") -else - backend = dofile(MP .. "/basis/numbers_storage.lua") -end - -local function update_nodeinfo(number) - local pos = backend.get_nodepos(number) - if pos then - NodeInfoCache[number] = {pos = pos, name = techage.get_node_lvm(pos).name} - return NodeInfoCache[number] - end -end - -local function delete_nodeinfo_entry(number) - if number and NodeInfoCache[number] then - number = next(NodeInfoCache, number) - if number then - NodeInfoCache[number] = nil - end - else - number = next(NodeInfoCache, nil) - end - return number -end - --- Keep the cache size small by deleting entries randomly -local function keep_small(number) - number = delete_nodeinfo_entry(number) - minetest.after(10, keep_small, number) -end - -keep_small() - -minetest.after(2, backend.delete_invalid_entries, NodeDef) - -------------------------------------------------------------------- --- Local helper functions -------------------------------------------------------------------- -local function in_list(list, x) - for _, v in ipairs(list) do - if v == x then return true end - end - return false -end - --- Determine position related node number for addressing purposes -local function get_number(pos, new) - local meta = minetest.get_meta(pos) - if meta:contains("node_number") then - return meta:get_string("node_number") - end - -- generate new number - if new then - local num = backend.add_nodepos(pos) - meta:set_string("node_number", num) - return num - end -end - -local function not_protected(pos, placer_name, clicker_name) - local meta = minetest.get_meta(pos) - if meta then - if placer_name and not minetest.is_protected(pos, placer_name) then - if clicker_name == nil or placer_name == clicker_name then - return true - end - if not minetest.is_protected(pos, clicker_name) then - return true - end - end - end - return false -end - -local function register_lbm(name, nodenames) - minetest.register_lbm({ - label = "[TechAge] Node update", - name = name.."update", - nodenames = nodenames, - run_at_every_load = true, - action = function(pos, node) - if NodeDef[node.name] and NodeDef[node.name].on_node_load then - NodeDef[node.name].on_node_load(pos, node) - end - end - }) -end - -local SideToDir = {B=1, R=2, F=3, L=4, D=5, U=6} - -local function side_to_dir(side, param2) - return tubelib2_side_to_dir(side, param2) -end - -techage.side_to_outdir = side_to_dir - -function techage.side_to_indir(side, param2) - return tubelib2.Turn180Deg[side_to_dir(side, param2)] -end - -local function get_next_node(pos, out_dir) - local res, npos, node = Tube:compatible_node(pos, out_dir) - local in_dir = tubelib2.Turn180Deg[out_dir] - return res, npos, in_dir, node.name -end - -local function get_dest_node(pos, out_dir) - local spos, in_dir = Tube:get_connected_node_pos(pos, out_dir) - local _,node = Tube:get_node(spos) - return spos, in_dir, node.name -end - -local function item_handling_node(name) - local node_def = name and NodeDef[name] - if node_def then - return node_def.on_pull_item or node_def.on_push_item or node_def.is_pusher - end -end - -local function is_air_like(name) - local ndef = minetest.registered_nodes[name] - if ndef and ndef.buildable_to then - return true - end - return false -end - -techage.SystemTime = 0 -minetest.register_globalstep(function(dtime) - techage.SystemTime = techage.SystemTime + dtime -end) - --- used by TA1 hammer: dug_node[player_name] = pos -techage.dug_node = {} -minetest.register_on_dignode(function(pos, oldnode, digger) - if not digger then return end - -- store the position of the dug block for tools like the TA1 hammer - techage.dug_node[digger:get_player_name()] = pos -end) - -------------------------------------------------------------------- --- API helper functions -------------------------------------------------------------------- - --- Check if both strings are the same or one string starts with the other string. -function techage.string_compare(s1, s2) - if s1 and s2 then - local minLength = math.min(#s1, #s2) - return string.sub(s1, 1, minLength) == string.sub(s2, 1, minLength) - end -end - --- Function returns { pos, name } for the node referenced by number -function techage.get_node_info(dest_num) - return NodeInfoCache[dest_num] or update_nodeinfo(dest_num) -end - --- Function returns the node number from the given position or --- nil, if no node number for this position is assigned. -function techage.get_node_number(pos) - return get_number(pos) -end - -function techage.get_pos(pos, side) - local node = techage.get_node_lvm(pos) - local dir = nil - if node.name ~= "air" and node.name ~= "ignore" then - dir = side_to_dir(side, node.param2) - end - return tubelib2.get_pos(pos, dir) -end - --- Function is used for available nodes with lost numbers, only. -function techage.get_new_number(pos, name) - -- store position - return get_number(pos, true) -end - --- extract ident and value from strings like "ident=value" -function techage.ident_value(s) - local ident, value = unpack(string.split(s, "=", true, 1)) - return (ident or ""):trim(), (value or ""):trim() -end - -------------------------------------------------------------------- --- Node construction/destruction functions -------------------------------------------------------------------- - --- Add node to the techage lists. --- Function determines and returns the node position number, --- needed for message communication. --- If TA2 node, return '-' instead of a real number, because --- TA2 nodes should not support number based commands. -function techage.add_node(pos, name, is_ta2) - if item_handling_node(name) then - Tube:after_place_node(pos) - end - if is_ta2 then - return "-" - end - local key = minetest.hash_node_position(pos) - local num = NumbersToBeRecycled[key] - if num then - NodeInfoCache[num] = nil - backend.set_nodepos(num, pos) - NumbersToBeRecycled[key] = nil - return num - end - return get_number(pos, true) -end - --- Function removes the node from the techage lists. -function techage.remove_node(pos, oldnode, oldmetadata) - local number = oldmetadata and oldmetadata.fields and (oldmetadata.fields.node_number or oldmetadata.fields.number) - number = number or get_number(pos) - if number and tonumber(number) then - local key = minetest.hash_node_position(pos) - NumbersToBeRecycled[key] = number - NodeInfoCache[number] = nil - end - if oldnode and item_handling_node(oldnode.name) then - Tube:after_dig_node(pos) - end -end - --- Repairs the node number after it was erased by `backend.delete_invalid_entries` -function techage.repair_number(pos) - local number = techage.get_node_number(pos) - if number then - backend.set_nodepos(number, pos) - end -end - --- Like techage.add_node, but use the old number again -function techage.unpack_node(pos, name, number) - if item_handling_node(name) then - Tube:after_place_node(pos) - end - local key = minetest.hash_node_position(pos) - NumbersToBeRecycled[key] = nil - if number then - backend.set_nodepos(number, pos) - end -end - --- Like techage.remove_node but don't store the number for this position -function techage.pack_node(pos, oldnode, number) - if number then - NodeInfoCache[number] = nil - end - if oldnode and item_handling_node(oldnode.name) then - Tube:after_dig_node(pos) - end -end - -------------------------------------------------------------------- --- Used by the assembly tool -------------------------------------------------------------------- -function techage.pre_add_node(pos, number) - local key = minetest.hash_node_position(pos) - NumbersToBeRecycled[key] = number -end - -function techage.post_remove_node(pos) - local key = minetest.hash_node_position(pos) - NumbersToBeRecycled[key] = nil -end - -------------------------------------------------------------------- --- Node register function -------------------------------------------------------------------- - --- Register node for techage communication --- Call this function only at load time! --- Param names: List of node names like {"techage:pusher_off", "techage:pusher_on"} --- Param node_definition: A table according to: --- { --- on_inv_request = func(pos, in_dir, access_type) --- on_pull_item = func(pos, in_dir, num, (opt.) item_name), --- on_push_item = func(pos, in_dir, item), --- on_unpull_item = func(pos, in_dir, item), --- on_recv_message = func(pos, src, topic, payload), --- on_node_load = func(pos), -- LBM function --- on_transfer = func(pos, in_dir, topic, payload), --- } -function techage.register_node(names, node_definition) - -- store facedir table for all known node names - for _,n in ipairs(names) do - NodeDef[n] = node_definition - end - if node_definition.on_pull_item or node_definition.on_push_item or - node_definition.is_pusher then - Tube:add_secondary_node_names(names) - - for _,n in ipairs(names) do - techage.KnownNodes[n] = true - end - end - -- register LBM - if node_definition.on_node_load then - register_lbm(names[1], names) - end - - -- register mvps stopper - if has_mesecons then - for _, name in ipairs(names) do - mesecon.register_mvps_stopper(name) - end - end -end - -------------------------------------------------------------------- --- Send message functions -------------------------------------------------------------------- - -function techage.not_protected(number, placer_name, clicker_name) - local ninfo = NodeInfoCache[number] or update_nodeinfo(number) - if ninfo and ninfo.pos then - return not_protected(ninfo.pos, placer_name, clicker_name) - end - return false -end - --- Check the given number value. --- Returns true if the number is valid, point to real node and --- and the node is not protected for the given player_name. -function techage.check_number(number, placer_name) - if number then - if not techage.not_protected(number, placer_name, nil) then - return false - end - return true - end - return false -end - --- Check the given list of numbers. --- Returns true if number(s) is/are valid, point to real nodes and --- and the nodes are not protected for the given player_name. -function techage.check_numbers(numbers, placer_name) - if numbers then - for _,num in ipairs(string_split(numbers, " ")) do - if not techage.not_protected(num, placer_name, nil) then - return false - end - end - return true - end - return false -end - -function techage.send_multi(src, numbers, topic, payload) - --print("send_multi", src, numbers, topic) - for _,num in ipairs(string_split(numbers, " ")) do - local ninfo = NodeInfoCache[num] or update_nodeinfo(num) - if ninfo and ninfo.name and ninfo.pos then - local ndef = NodeDef[ninfo.name] - if ndef and ndef.on_recv_message then - techage_counting_hit() - ndef.on_recv_message(ninfo.pos, src, topic, payload) - end - end - end -end - -function techage.send_single(src, number, topic, payload) - --print("send_single", src, number, topic) - local ninfo = NodeInfoCache[number] or update_nodeinfo(number) - if ninfo and ninfo.name and ninfo.pos then - local ndef = NodeDef[ninfo.name] - if ndef and ndef.on_recv_message then - techage_counting_hit() - return ndef.on_recv_message(ninfo.pos, src, topic, payload) - end - end - return false -end - --- The destination node location is either: --- A) a destination position, specified by pos --- B) a neighbor position, specified by caller pos/outdir, or pos/side --- C) a tubelib2 network connection, specified by caller pos/outdir, or pos/side --- outdir is one of: 1..6 --- side is one of: "B", "R", "F", "L", "D", "U" --- network is a tuebelib2 network instance --- opt: nodenames is a table of valid the callee node names -function techage.transfer(pos, outdir, topic, payload, network, nodenames) - -- determine out-dir - if outdir and type(outdir) == "string" then - local param2 = techage.get_node_lvm(pos).param2 - outdir = side_to_dir(outdir, param2) - end - -- determine destination pos - local dpos, indir - if network then - dpos, indir = network:get_connected_node_pos(pos, outdir) - else - dpos, indir = tubelib2.get_pos(pos, outdir), outdir - end - -- check node name - local name = techage.get_node_lvm(dpos).name - if nodenames and not in_list(nodenames, name) then - return false - end - -- call "on_transfer" - local ndef = NodeDef[name] - if ndef and ndef.on_transfer then - return ndef.on_transfer(dpos, indir, topic, payload) - end - return false -end - -------------------------------------------------------------------- --- Beduino functions (see "bep-005_ta_cmnd.md") -------------------------------------------------------------------- -function techage.beduino_send_cmnd(src, number, topic, payload) - --print("beduino_send_cmnd", src, number, topic) - local ninfo = NodeInfoCache[number] or update_nodeinfo(number) - if ninfo and ninfo.name and ninfo.pos then - local ndef = NodeDef[ninfo.name] - if ndef and ndef.on_beduino_receive_cmnd then - techage_counting_hit() - return ndef.on_beduino_receive_cmnd(ninfo.pos, src, topic, payload or {}) - end - end - return 1, "" -end - -function techage.beduino_request_data(src, number, topic, payload) - --print("beduino_request_data", src, number, topic) - local ninfo = NodeInfoCache[number] or update_nodeinfo(number) - if ninfo and ninfo.name and ninfo.pos then - local ndef = NodeDef[ninfo.name] - if ndef and ndef.on_beduino_request_data then - techage_counting_hit() - return ndef.on_beduino_request_data(ninfo.pos, src, topic, payload or {}) - end - end - return 1, "" -end - -------------------------------------------------------------------- --- Client side Push/Pull item functions -------------------------------------------------------------------- - -function techage.get_inv_access(pos, out_dir, access_type) - local npos, in_dir, name = get_dest_node(pos, out_dir) - if npos and NodeDef[name] and NodeDef[name].on_inv_request then - return NodeDef[name].on_inv_request(npos, in_dir, access_type) - end -end - -function techage.pull_items(pos, out_dir, num, item_name) - local npos, in_dir, name = get_dest_node(pos, out_dir) - if npos and NodeDef[name] and NodeDef[name].on_pull_item then - return NodeDef[name].on_pull_item(npos, in_dir, num, item_name) - end -end - -function techage.push_items(pos, out_dir, stack, idx) - local npos, in_dir, name = get_dest_node(pos, out_dir) - if npos and NodeDef[name] and NodeDef[name].on_push_item then - return NodeDef[name].on_push_item(npos, in_dir, stack, idx) - elseif is_air_like(name) or is_cart_available(npos) then - minetest.add_item(npos, stack) - return true - end - return stack -end - --- Check for recursion and too long distances -local start_pos -function techage.safe_push_items(pos, out_dir, stack, idx) - local mem = techage.get_mem(pos) - if not mem.pushing then - if not start_pos then - start_pos = pos - mem.pushing = true - local res = techage.push_items(pos, out_dir, stack, idx) - mem.pushing = nil - start_pos = nil - return res - else - local npos, in_dir, name = get_dest_node(pos, out_dir) - if vector.distance(start_pos, npos) < (Tube.max_tube_length or 100) then - mem.pushing = true - local res = techage.push_items(pos, out_dir, stack, idx) - mem.pushing = nil - return res - end - end - end - return stack -end - -function techage.unpull_items(pos, out_dir, stack) - local npos, in_dir, name = get_dest_node(pos, out_dir) - if npos and NodeDef[name] and NodeDef[name].on_unpull_item then - return NodeDef[name].on_unpull_item(npos, in_dir, stack) - end - return false -end - -------------------------------------------------------------------- --- Server side helper functions -------------------------------------------------------------------- - --- Get the given number of items from the inv. The position within the list --- is incremented each time so that different item stacks will be considered. --- Returns nil if ItemList is empty. -function techage.get_items(pos, inv, listname, num) - if inv:is_empty(listname) then - return nil - end - local size = inv:get_size(listname) - local mem = techage.get_mem(pos) - mem.ta_startpos = mem.ta_startpos or 0 - for idx = mem.ta_startpos, mem.ta_startpos+size do - idx = (idx % size) + 1 - local items = inv:get_stack(listname, idx) - if items:get_count() > 0 then - local taken = items:take_item(num) - inv:set_stack(listname, idx, items) - mem.ta_startpos = idx - return taken - end - end - return nil -end - --- Put the given stack into the given ItemList/inventory. --- Function returns: --- - true, if all items are moved --- - false, if no item is moved --- - leftover, if less than all items are moved --- (true/false is the legacy mode and can't be removed) -function techage.put_items(inv, listname, item, idx) - local leftover - if idx and inv and idx <= inv:get_size(listname) then - local stack = inv:get_stack(listname, idx) - leftover = stack:add_item(item) - inv:set_stack(listname, idx, stack) - elseif inv then - leftover = inv:add_item(listname, item) - else - return false - end - - local cnt = leftover:get_count() - if cnt == item:get_count() then - return false - elseif cnt == 0 then - return true - else - return leftover - end - -end - --- Return "full", "loaded", or "empty" depending --- on the inventory load. --- Full is returned, when no empty stack is available. -function techage.get_inv_state(inv, listname) - local state - if inv:is_empty(listname) then - state = "empty" - else - local list = inv:get_list(listname) - state = "full" - for _, item in ipairs(list) do - if item:is_empty() then - return "loaded" - end - end - end - return state -end - --- Beduino variant -function techage.get_inv_state_num(inv, listname) - local state - if inv:is_empty(listname) then - state = 0 - else - local list = inv:get_list(listname) - state = 2 - for _, item in ipairs(list) do - if item:is_empty() then - return 1 - end - end - end - return state -end - -minetest.register_chatcommand("ta_send", { - description = minetest.formspec_escape( - "Send a techage command to the block with the number given: /ta_send []"), - func = function(name, param) - local num, cmnd, payload = param:match('^([0-9]+)%s+(%w+)%s*(.*)$') - - if num and cmnd then - if techage.not_protected(num, name) then - local resp = techage.send_single("0", num, cmnd, payload) - if type(resp) == "string" then - return true, resp - else - return true, dump(resp) - end - else - return false, "Destination block is protected" - end - end - return false, "Syntax: /ta_send []" - end -}) - -minetest.register_chatcommand("expoints", { - privs = { - server = true - }, - func = function(name, param) - local player_name, points = param:match("^(%S+)%s*(%d*)$") - if player_name then - local player = minetest.get_player_by_name(player_name) - if player then - if points and points ~= "" then - if techage.set_expoints(player, tonumber(points)) then - return true, "The player "..player_name.." now has "..points.." experience points." - end - else - points = techage.get_expoints(player) - return true, "The player "..player_name.." has "..points.." experience points." - end - else - return false, "Unknown player "..player_name - end - end - return false, "Syntax error! Syntax: /expoints []" - end -}) - -minetest.register_chatcommand("my_expoints", { - func = function(name, param) - local player = minetest.get_player_by_name(name) - if player then - local points = techage.get_expoints(player) - if points then - return true, "You have "..points.." experience points." - end - end - end -}) diff --git a/techage/basis/conf_inv.lua b/techage/basis/conf_inv.lua deleted file mode 100644 index d738a69..0000000 --- a/techage/basis/conf_inv.lua +++ /dev/null @@ -1,118 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Configured inventory lib - Assuming the inventory has the name "conf" - Otherwise the name has to be provided as argument - -]]-- - -local StackName = ... or "conf" - --- for lazy programmers -local M = minetest.get_meta - -local inv_lib = {} - -function inv_lib.preassigned_stacks(pos, xsize, ysize) - local inv = M(pos):get_inventory() - local tbl = {} - for idx = 1, xsize * ysize do - local item_name = inv:get_stack(StackName, idx):get_name() - if item_name ~= "" then - local x = (idx - 1) % xsize - local y = math.floor((idx - 1) / xsize) - tbl[#tbl+1] = "item_image["..x..","..y..";1,1;"..item_name.."]" - end - end - return table.concat(tbl, "") -end - -function inv_lib.item_filter(pos, size) - local inv = M(pos):get_inventory() - local filter = {} - for idx = 1, size do - local item_name = inv:get_stack(StackName, idx):get_name() - if item_name == "" then item_name = "unconfigured" end - if not filter[item_name] then - filter[item_name] = {} - end - table.insert(filter[item_name], idx) - end - return filter -end - -function inv_lib.allow_conf_inv_put(pos, listname, index, stack, player) - local inv = M(pos):get_inventory() - local list = inv:get_list(listname) - - if list[index]:get_count() == 0 then - stack:set_count(1) - inv:set_stack(listname, index, stack) - return 0 - end - return 0 -end - -function inv_lib.allow_conf_inv_take(pos, listname, index, stack, player) - local inv = M(pos):get_inventory() - inv:set_stack(listname, index, nil) - return 0 -end - -function inv_lib.allow_conf_inv_move(pos, from_list, from_index, to_list, to_index, count, player) - local inv = minetest.get_meta(pos):get_inventory() - local stack = inv:get_stack(to_list, to_index) - - if stack:get_count() == 0 then - return 1 - else - return 0 - end -end - -function inv_lib.put_items(pos, inv, listname, item, stacks, idx) - local name = item:get_name() - local count = item:get_count() - for _, i in ipairs(stacks or {}) do - if not idx or idx == i then - local stack = inv:get_stack(listname, i) - local leftover = stack:add_item({name = name, count = count}) - count = leftover:get_count() - inv:set_stack(listname, i, stack) - if count == 0 then - return true - end - end - end - if count > 0 then - return ItemStack({name = name, count = count}) - end - return false -end - -function inv_lib.take_item(pos, inv, listname, num, stacks) - local mem = techage.get_mem(pos) - mem.ta_startpos = mem.ta_startpos or 1 - local size = #(stacks or {}) - for i = 1, size do - local idx = stacks[((i + mem.ta_startpos) % size) + 1] - local stack = inv:get_stack(listname, idx) - local taken = stack:take_item(num) - if taken:get_count() > 0 then - inv:set_stack(listname, idx, stack) - mem.ta_startpos = mem.ta_startpos + i - return taken - end - end -end - - -return inv_lib diff --git a/techage/basis/counting.lua b/techage/basis/counting.lua deleted file mode 100644 index dd00a5e..0000000 --- a/techage/basis/counting.lua +++ /dev/null @@ -1,71 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Count techage commands player related - -]]-- - -local PlayerName -local PlayerPoints = {} -local LastPlayerPoints = {} -local S = techage.S - -local MAX_POINTS = tonumber(minetest.settings:get("techage_command_limit")) or 1200 - -function techage.counting_start(player_name) - PlayerName = player_name - PlayerPoints[PlayerName] = PlayerPoints[PlayerName] or 0 -end - -function techage.counting_stop() - PlayerName = nil -end - -function techage.counting_hit() - if PlayerName then - PlayerPoints[PlayerName] = PlayerPoints[PlayerName] + 1 - end -end - -function techage.counting_add(player_name, points) - PlayerPoints[player_name] = (PlayerPoints[player_name] or 0) + points -end - -local function output() - for name, val in pairs(PlayerPoints) do - if val > MAX_POINTS then - local obj = minetest.get_player_by_name(name) - if obj then - minetest.chat_send_player(name, - S("[techage] The limit for 'number of commands per minute' has been exceeded.") .. - " " .. string.format(MAX_POINTS .. " " .. S("is allowed. Current value is") .. " " .. val)); - minetest.log("action", "[techage] " .. name .. - " exceeds the limit for commands per minute. value = " .. val) - local factor = 100 / (obj:get_armor_groups().fleshy or 100) - obj:punch(obj, 1.0, {full_punch_interval=1.0, damage_groups = {fleshy=factor * 5}}) - end - end - end - LastPlayerPoints = table.copy(PlayerPoints) - PlayerPoints = {} - minetest.after(60, output) -end - -minetest.after(60, output) - - -minetest.register_chatcommand("ta_limit", { - description = "Get your current techage command limit value", - func = function(name) - local num = LastPlayerPoints[name] or 0 - return true, S("Your current value is") .. " " .. num .. " " .. S("per minute") .. ". " .. - MAX_POINTS .. " " .. S("is allowed") - end -}) diff --git a/techage/basis/fake_player.lua b/techage/basis/fake_player.lua deleted file mode 100644 index 3526762..0000000 --- a/techage/basis/fake_player.lua +++ /dev/null @@ -1,117 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - Copyright (C) 2020 Thomas S. - - AGPL v3 - See LICENSE.txt for more information - - Fake Player - -]]-- - --- Map method names to their return values -local methods = { - get_pos = { x = 0, y = 0, z = 0 }, - set_pos = nil, - moveto = nil, - punch = nil, - right_click = nil, - get_hp = 20, - set_hp = nil, - get_inventory = nil, - get_wield_list = "", - get_wield_index = 0, - get_wielded_item = ItemStack(), - set_wielded_item = true, - set_armor_groups = nil, - get_armor_groups = {}, - set_animation = nil, - get_animation = {}, - set_animation_frame_speed = nil, - set_attach = nil, - get_attach = nil, - set_detach = nil, - get_bone_position = {}, - set_properties = nil, - get_properties = {}, - is_player = false, - get_nametag_attributes = {}, - set_nametag_attributes = nil, - get_player_name = "", - get_player_velocity = nil, - add_player_velocity = nil, - get_look_dir = vector.new(0, 0, 1), - get_look_vertical = 0, - get_look_horizontal = 0, - set_look_vertical = nil, - set_look_horizontal = nil, - get_look_pitch = 0, - get_look_yaw = 0, - set_look_pitch = nil, - set_look_yaw = nil, - get_breath = 10, - set_breath = nil, - set_fov = nil, - get_fov = 0, - set_attribute = nil, - get_attribute = nil, - get_meta = nil, - set_inventory_formspec = nil, - get_inventory_formspec = "", - set_formspec_prepend = nil, - get_formspec_prepend = "", - get_player_control = {}, - get_player_control_bits = 0, - set_physics_override = nil, - get_physics_override = {}, - hud_add = 0, - hud_remove = nil, - hud_change = nil, - hud_get = {}, - hud_set_flags = nil, - hud_get_flags = {}, - hud_set_hotbar_itemcount = nil, - hud_get_hotbar_itemcount = 8, - hud_set_hotbar_image = nil, - hud_get_hotbar_image = "", - hud_set_hotbar_selected_image = nil, - hud_get_hotbar_selected_image = "", - set_sky = nil, - get_sky = {}, - get_sky_color = {}, - set_sun = nil, - get_sun = {}, - set_moon = nil, - get_moon = {}, - set_stars = nil, - get_stars = {}, - set_clouds = nil, - get_clouds = {}, - override_day_night_ratio = nil, - get_day_night_ratio = nil, - set_local_animation = nil, - get_local_animation = {}, - set_eye_offset = nil, - get_eye_offset = {}, - send_mapblock = nil, -} - -techage.Fake_player = {} -techage.Fake_player.__index = techage.Fake_player - -function techage.Fake_player:new() - local fake_player = {} - setmetatable(fake_player, techage.Fake_player) - return fake_player -end - - -for method_name, return_value in pairs(methods) do - techage.Fake_player[method_name] = function(self, ...) - return return_value - end -end diff --git a/techage/basis/firebox_lib.lua b/techage/basis/firebox_lib.lua deleted file mode 100644 index 8d8e5e7..0000000 --- a/techage/basis/firebox_lib.lua +++ /dev/null @@ -1,150 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Firebox basic functions - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -techage.firebox = {} - -techage.firebox.Burntime = { - ["techage:charcoal"] = 1, -- will be replaced by burntime - ["default:coal_lump"] = 1, - ["default:coalblock"] = 1, - ["techage:oil_source"] = 1, - ["techage:gas"] = 1, - ["techage:gasoline"] = 1, - ["techage:naphtha"] = 1, - ["techage:fueloil"] = 1, -} - -techage.firebox.ValidOilFuels = { - ["techage:gasoline"] = 1, -- category - ["techage:naphtha"] = 2, - ["techage:fueloil"] = 3, - ["techage:oil_source"] = 4, -} - - -local function determine_burntimes() - for k,_ in pairs(techage.firebox.Burntime)do - local fuel,_ = minetest.get_craft_result({method = "fuel", width = 1, items = {k}}) - techage.firebox.Burntime[k] = fuel.time - end -end -minetest.register_on_mods_loaded(determine_burntimes) - -function techage.firebox.formspec(nvm) - local fuel_percent = 0 - if nvm.running then - fuel_percent = ((nvm.burn_cycles or 1) * 100) / (nvm.burn_cycles_total or 1) - end - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize( "#000000", S("Firebox")).."]".. - "list[current_name;fuel;3,1;1,1;]".. - "image[4,1;1,1;default_furnace_fire_bg.png^[lowpart:".. - fuel_percent..":default_furnace_fire_fg.png]".. - "list[current_player;main;0,2.3;8,4;]".. - "listring[current_name;fuel]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 2.3) -end - -function techage.firebox.can_dig(pos, player) - local inv = M(pos):get_inventory() - return inv:is_empty("fuel") -end - -function techage.firebox.allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if techage.firebox.Burntime[stack:get_name()] then - return stack:get_count() - end - return 0 -end - -function techage.firebox.allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -function techage.firebox.on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", techage.firebox.formspec(nvm)) -end - -function techage.firebox.swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -function techage.firebox.get_fuel(pos) - local inv = M(pos):get_inventory() - local items = inv:get_stack("fuel", 1) - if items:get_count() > 0 then - local taken = items:take_item(1) - inv:set_stack("fuel", 1, items) - return taken - end -end - -function techage.firebox.has_fuel(pos) - local inv = M(pos):get_inventory() - local items = inv:get_stack("fuel", 1) - return items:get_count() > 0 -end - -function techage.firebox.is_free_position(pos, player_name) - local pos2 = techage.get_pos(pos, 'F') - if minetest.is_protected(pos2, player_name) then - minetest.chat_send_player(player_name, S("[TA] Area is protected!")) - return false - end - local node = techage.get_node_lvm(pos2) - local ndef = minetest.registered_nodes[node.name] - if not ndef or not ndef.buildable_to then - minetest.chat_send_player(player_name, S("[TA] Not enough space!")) - return false - end - return true -end - -function techage.firebox.set_firehole(pos, on) - local param2 = techage.get_node_lvm(pos).param2 - local pos2 = techage.get_pos(pos, 'F') - if on == true then - minetest.swap_node(pos2, {name="techage:coalfirehole_on", param2 = param2}) - elseif on == false then - minetest.swap_node(pos2, {name="techage:coalfirehole", param2 = param2}) - else - local node = techage.get_node_lvm(pos2) - if node.name == "techage:coalfirehole" or node.name == "techage:coalfirehole_on" then - minetest.swap_node(pos2, {name="air"}) - end - end -end diff --git a/techage/basis/fly_lib.lua b/techage/basis/fly_lib.lua deleted file mode 100644 index b3babb6..0000000 --- a/techage/basis/fly_lib.lua +++ /dev/null @@ -1,955 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Block fly/move library - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local S = techage.S - -local flylib = {} - -local function lvect_add_vec(lvect1, offs) - if not lvect1 or not offs then return end - - local lvect2 = {} - for _, v in ipairs(lvect1) do - lvect2[#lvect2 + 1] = vector.add(v, offs) - end - return lvect2 -end - --- yaw in radiant -local function rotate(v, yaw) - local sinyaw = math.sin(yaw) - local cosyaw = math.cos(yaw) - return {x = v.x * cosyaw - v.z * sinyaw, y = v.y, z = v.x * sinyaw + v.z * cosyaw} -end - --- playername is needed for carts, to attach the player to the cart entity -local function set_node(item, playername) - local dest_pos = item.dest_pos - local name = item.name or "air" - local param2 = item.param2 or 0 - local nvm = techage.get_nvm(item.base_pos) - local node = techage.get_node_lvm(dest_pos) - local ndef1 = minetest.registered_nodes[name] - local ndef2 = minetest.registered_nodes[node.name] - - nvm.running = false - M(item.base_pos):set_string("status", S("Stopped")) - if ndef1 and ndef2 then - if minecart.is_cart(name) and (minecart.is_rail(dest_pos, node.name) or minecart.is_cart(name)) then - local player = playername and minetest.get_player_by_name(playername) - minecart.place_and_start_cart(dest_pos, {name = name, param2 = param2}, item.cartdef, player) - return - elseif ndef2.buildable_to then - local meta = M(dest_pos) - if name ~= "techage:moveblock" then - minetest.set_node(dest_pos, {name=name, param2=param2}) - meta:from_table(item.metadata or {}) - meta:set_string("ta_move_block", "") - meta:set_int("ta_door_locked", 1) - end - return - end - local meta = M(dest_pos) - if not meta:contains("ta_move_block") then - meta:set_string("ta_move_block", minetest.serialize({name=name, param2=param2})) - return - end - elseif ndef1 then - if name ~= "techage:moveblock" then - minetest.add_item(dest_pos, ItemStack(name)) - end - end -end - -------------------------------------------------------------------------------- --- Entity monitoring -------------------------------------------------------------------------------- -local queue = {} -local first = 0 -local last = -1 - -local function push(item) - last = last + 1 - queue[last] = item -end - -local function pop() - if first > last then return end - local item = queue[first] - queue[first] = nil -- to allow garbage collection - first = first + 1 - return item -end - -local function monitoring() - local num = last - first + 1 - for _ = 1, num do - local item = pop() - if item.ttl >= techage.SystemTime then - -- still valud - push(item) - elseif item.ttl ~= 0 then - set_node(item) - end - end - minetest.after(1, monitoring) -end -minetest.after(1, monitoring) - -minetest.register_on_shutdown(function() - local num = last - first + 1 - for _ = 1, num do - local item = pop() - if item.ttl ~= 0 then - set_node(item) - end - end -end) - -local function monitoring_add_entity(item) - item.ttl = techage.SystemTime + 1 - push(item) -end - -local function monitoring_del_entity(item) - -- Mark as timed out - item.ttl = 0 -end - -local function monitoring_trigger_entity(item) - item.ttl = techage.SystemTime + 1 -end - -------------------------------------------------------------------------------- --- to_path function for the fly/move path -------------------------------------------------------------------------------- - -local function strsplit(text) - text = text:gsub("\r\n", "\n") - text = text:gsub("\r", "\n") - return string.split(text, "\n", true) -end - -local function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) -end - -function flylib.distance(v) - return math.abs(v.x) + math.abs(v.y) + math.abs(v.z) -end - -function flylib.to_vector(s, max_dist) - local x,y,z = unpack(string.split(s, ",")) - x = tonumber(x) or 0 - y = tonumber(y) or 0 - z = tonumber(z) or 0 - if x and y and z then - if not max_dist or (math.abs(x) + math.abs(y) + math.abs(z)) <= max_dist then - return {x = x, y = y, z = z} - end - end -end - -function flylib.to_path(s, max_dist) - local tPath - local dist = 0 - - for _, line in ipairs(strsplit(s or "")) do - line = trim(line) - line = string.split(line, "--", true, 1)[1] or "" - if line ~= "" then - local v = flylib.to_vector(line) - if v then - dist = dist + flylib.distance(v) - if not max_dist or dist <= max_dist then - tPath = tPath or {} - tPath[#tPath + 1] = v - else - return tPath, S("Error: Max. length of the flight route exceeded by @1 blocks !!", dist - max_dist) - end - else - return tPath, S("Error: Invalid path !!") - end - end - end - return tPath -end - -local function next_path_pos(pos, lpath, idx) - local offs = lpath[idx] - if offs then - return vector.add(pos, offs) - end -end - -local function reverse_path(lpath) - local lres = {} - for i = #lpath, 1, -1 do - lres[#lres + 1] = vector.multiply(lpath[i], -1) - end - return lres -end - -local function dest_offset(lpath) - local offs = {x=0, y=0, z=0} - for i = 1,#lpath do - offs = vector.add(offs, lpath[i]) - end - return offs -end - -------------------------------------------------------------------------------- --- Protect the doors from being opened by hand -------------------------------------------------------------------------------- -local function new_on_rightclick(old_on_rightclick) - return function(pos, node, clicker, itemstack, pointed_thing) - if M(pos):contains("ta_door_locked") then - return itemstack - end - if old_on_rightclick then - return old_on_rightclick(pos, node, clicker, itemstack, pointed_thing) - else - return itemstack - end - end -end - -function flylib.protect_door_from_being_opened(name) - -- Change on_rightclick function. - local ndef = minetest.registered_nodes[name] - if ndef then - local old_on_rightclick = ndef.on_rightclick - minetest.override_item(ndef.name, { - on_rightclick = new_on_rightclick(old_on_rightclick) - }) - end -end - -------------------------------------------------------------------------------- --- Entity / Move / Attach / Detach -------------------------------------------------------------------------------- -local MIN_SPEED = 0.4 -local MAX_SPEED = 8 -local CORNER_SPEED = 4 - -local function calc_speed(v) - return math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z) -end - --- Only the ID ist stored, not the object -local function get_object_id(object) - for id, entity in pairs(minetest.luaentities) do - if entity.object == object then - return id - end - end -end - --- determine exact position of attached entities -local function obj_pos(obj) - local _, _, pos = obj:get_attach() - if pos then - pos = vector.divide(pos, 29) - return vector.add(obj:get_pos(), pos) - end -end - --- Check access conflicts with other mods -local function lock_player(player) - local meta = player:get_meta() - if meta:get_int("player_physics_locked") == 0 then - meta:set_int("player_physics_locked", 1) - meta:set_string("player_physics_locked_by", "ta_flylib") - return true - end - return false -end - -local function unlock_player(player) - local meta = player:get_meta() - if meta:get_int("player_physics_locked") == 1 then - if meta:get_string("player_physics_locked_by") == "ta_flylib" then - meta:set_int("player_physics_locked", 0) - meta:set_string("player_physics_locked_by", "") - return true - end - end - return false -end - -local function detach_player(player) - local pos = obj_pos(player) - if pos then - player:set_detach() - player:set_properties({visual_size = {x=1, y=1}}) - player:set_pos(pos) - end - -- TODO: move to save position -end - --- Attach player/mob to given parent object (block) -local function attach_single_object(parent, obj, distance) - local self = parent:get_luaentity() - local res = obj:get_attach() - if not res then -- not already attached - local yaw - if obj:is_player() then - yaw = obj:get_look_horizontal() - else - yaw = obj:get_rotation().y - end - -- store for later use - local offs = table.copy(distance) - -- Calc entity rotation, which is relative to the parent's rotation - local rot = parent:get_rotation() - if self.param2 >= 20 then - distance = rotate(distance, 2 * math.pi - rot.y) - distance.y = -distance.y - distance.x = -distance.x - rot.y = rot.y - yaw - elseif self.param2 < 4 then - distance = rotate(distance, 2 * math.pi - rot.y) - rot.y = rot.y - yaw - end - distance = vector.multiply(distance, 29) - obj:set_attach(parent, "", distance, vector.multiply(rot, 180 / math.pi)) - obj:set_properties({visual_size = {x=2.9, y=2.9}}) - if obj:is_player() then - if lock_player(obj) then - table.insert(self.players, {name = obj:get_player_name(), offs = offs}) - end - else - table.insert(self.entities, {objID = get_object_id(obj), offs = offs}) - end - end -end - --- Attach all objects around to the parent object --- offs is the search/attach position offset --- distance (optional) is the attach distance to the center of the entity -local function attach_objects(pos, offs, parent, yoffs, distance) - local pos1 = vector.add(pos, offs) - for _, obj in pairs(minetest.get_objects_inside_radius(pos1, 0.9)) do - -- keep relative object position - distance = distance or vector.subtract(obj:get_pos(), pos) - local entity = obj:get_luaentity() - if entity then - local mod = entity.name:gmatch("(.-):")() - if techage.RegisteredMobsMods[mod] then - distance.y = distance.y + yoffs - attach_single_object(parent, obj, distance) - end - elseif obj:is_player() then - attach_single_object(parent, obj, distance) - end - end -end - --- Detach all attached objects from the parent object -local function detach_objects(pos, self) - for _, item in ipairs(self.entities or {}) do - local entity = minetest.luaentities[item.objID] - if entity then - local obj = entity.object - obj:set_detach() - obj:set_properties({visual_size = {x=1, y=1}}) - local pos1 = vector.add(pos, item.offs) - pos1.y = pos1.y - (self.yoffs or 0) - obj:set_pos(pos1) - end - end - for _, item in ipairs(self.players or {}) do - local obj = minetest.get_player_by_name(item.name) - if obj then - obj:set_detach() - obj:set_properties({visual_size = {x=1, y=1}}) - local pos1 = vector.add(pos, item.offs) - pos1.y = pos1.y + 0.1 - obj:set_pos(pos1) - unlock_player(obj) - end - end - self.entities = {} - self.players = {} -end - -local function entity_to_node(pos, obj) - local self = obj:get_luaentity() - if self and self.item then - local playername = self.players and self.players[1] and self.players[1].name - detach_objects(pos, self) - monitoring_del_entity(self.item) - minetest.after(0.1, obj.remove, obj) - set_node(self.item, playername) - end -end - --- Create a node entitiy. --- * base_pos is controller block related --- * start_pos and dest_pos are entity positions -local function node_to_entity(base_pos, start_pos, dest_pos) - local meta = M(start_pos) - local node, metadata, cartdef - - node = techage.get_node_lvm(start_pos) - if minecart.is_cart(node.name) then - cartdef = minecart.remove_cart(start_pos) - elseif meta:contains("ta_move_block") then - -- Move-block stored as metadata - node = minetest.deserialize(meta:get_string("ta_move_block")) - metadata = {} - meta:set_string("ta_move_block", "") - meta:set_string("ta_block_locked", "true") - elseif not meta:contains("ta_block_locked") then - -- Block with other metadata - node = techage.get_node_lvm(start_pos) - metadata = meta:to_table() - minetest.after(0.1, minetest.remove_node, start_pos) - else - return - end - local obj = minetest.add_entity(start_pos, "techage:move_item") - if obj then - local self = obj:get_luaentity() - local rot = techage.facedir_to_rotation(node.param2) - obj:set_rotation(rot) - obj:set_properties({wield_item=node.name}) - obj:set_armor_groups({immortal=1}) - - -- To be able to revert to node - self.param2 = node.param2 - self.item = { - name = node.name, - param2 = node.param2, - metadata = metadata or {}, - dest_pos = dest_pos, - base_pos = base_pos, - cartdef = cartdef, - } - monitoring_add_entity(self.item) - - -- Prepare for attachments - self.players = {} - self.entities = {} - -- Prepare for path walk - self.path_idx = 1 - return obj, self.item.cartdef ~= nil - end -end - --- move block direction -local function determine_dir(pos1, pos2) - local vdist = vector.subtract(pos2, pos1) - local ndist = vector.length(vdist) - if ndist > 0 then - return vector.divide(vdist, ndist) - end - return {x=0, y=0, z=0} -end - -local function move_entity(obj, next_pos, dir, is_corner) - local self = obj:get_luaentity() - self.next_pos = next_pos - self.dir = dir - if is_corner then - local vel = vector.multiply(dir, math.min(CORNER_SPEED, self.max_speed)) - obj:set_velocity(vel) - end - local acc = vector.multiply(dir, self.max_speed / 2) - obj:set_acceleration(acc) -end - -local function moveon_entity(obj, self, pos1) - local pos2 = next_path_pos(pos1, self.lmove, self.path_idx) - if pos2 then - self.path_idx = self.path_idx + 1 - local dir = determine_dir(pos1, pos2) - move_entity(obj, pos2, dir, true) - return true - end -end - -minetest.register_entity("techage:move_item", { - initial_properties = { - pointable = true, - makes_footstep_sound = true, - static_save = false, - collide_with_objects = false, - physical = false, - visual = "wielditem", - wield_item = "default:dirt", - visual_size = {x=0.67, y=0.67, z=0.67}, - selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - }, - - on_step = function(self, dtime, moveresult) - local stop_obj = function(obj, self) - local next_pos = self.next_pos - obj:move_to(self.next_pos, true) - obj:set_acceleration({x=0, y=0, z=0}) - obj:set_velocity({x=0, y=0, z=0}) - self.next_pos = nil - self.old_dist = nil - return next_pos - end - - if self.next_pos then - local obj = self.object - local pos = obj:get_pos() - local dist = vector.distance(pos, self.next_pos) - local speed = calc_speed(obj:get_velocity()) - self.old_dist = self.old_dist or dist - - if self.lmove and self.lmove[self.path_idx] then - local min_dist = math.min(1, self.max_speed / 8) - if dist < min_dist or dist > self.old_dist then - -- change of direction - local next_pos = stop_obj(obj, self) - if not moveon_entity(obj, self, next_pos) then - minetest.after(0.5, entity_to_node, next_pos, obj) - end - return - end - elseif dist < 0.05 or dist > self.old_dist then - -- Landing - local next_pos = stop_obj(obj, self) - local dest_pos = self.item.dest_pos or next_pos - minetest.after(0.5, entity_to_node, dest_pos, obj) - return - end - - self.old_dist = dist - - -- Braking or limit max speed - if speed > (dist * 2) or speed > self.max_speed then - speed = math.min(speed, math.max(dist * 2, MIN_SPEED)) - local vel = vector.multiply(self.dir,speed) - obj:set_velocity(vel) - obj:set_acceleration({x=0, y=0, z=0}) - end - - monitoring_trigger_entity(self.item) - end - end, -}) - -local function is_valid_dest(pos) - local node = techage.get_node_lvm(pos) - if techage.is_air_like(node.name) then - return true - end - if minecart.is_rail(pos, node.name) or minecart.is_cart(node.name) then - return true - end - if not M(pos):contains("ta_move_block") then - return true - end - return false -end - -local function is_simple_node(pos) - local node = techage.get_node_lvm(pos) - if not minecart.is_rail(pos, node.name) then - local ndef = minetest.registered_nodes[node.name] - return node.name ~= "air" and techage.can_dig_node(node.name, ndef) or minecart.is_cart(node.name) - end -end - --- Move node from 'pos1' to the destination, calculated by means of 'lmove' --- * pos and meta are controller block related --- * lmove is the movement as a list of `moves` --- * height is move block height as value between 0 and 1 and used to calculate the offset --- for the attached object (player). -local function move_node(pos, meta, pos1, lmove, max_speed, height) - local pos2 = next_path_pos(pos1, lmove, 1) - local offs = dest_offset(lmove) - local dest_pos = vector.add(pos1, offs) - -- optional for non-player objects - local yoffs = meta:get_float("offset") - - if pos2 then - local dir = determine_dir(pos1, pos2) - local obj, is_cart = node_to_entity(pos, pos1, dest_pos) - - if obj then - if is_cart then - attach_objects(pos1, 0, obj, yoffs, {x = 0, y = -0.4, z = 0}) - else - local offs = {x=0, y=height or 1, z=0} - attach_objects(pos1, offs, obj, yoffs) - if dir.y == 0 then - if (dir.x ~= 0 and dir.z == 0) or (dir.x == 0 and dir.z ~= 0) then - attach_objects(pos1, dir, obj, yoffs) - end - end - end - local self = obj:get_luaentity() - self.path_idx = 2 - self.lmove = lmove - self.max_speed = max_speed - self.yoffs = yoffs - move_entity(obj, pos2, dir) - return true - else - return false - end - end -end - --- --- Default Move Mode --- - --- Move the nodes from nvm.lpos1 to nvm.lpos2 --- * nvm.lpos1 is a list of nodes --- * lmove is the movement as a list of `moves` --- * pos, meta, and nvm are controller block related ---- height is move block height as value between 0 and 1 and used to calculate the offset --- for the attached object (player). -local function multi_move_nodes(pos, meta, nvm, lmove, max_speed, height, move2to1) - local owner = meta:get_string("owner") - techage.counting_add(owner, #lmove, #nvm.lpos1 * #lmove) - - for idx = 1, #nvm.lpos1 do - local pos1 = nvm.lpos1[idx] - local pos2 = nvm.lpos2[idx] - --print("multi_move_nodes", idx, P2S(pos1), P2S(pos2)) - - if move2to1 then - pos1, pos2 = pos2, pos1 - end - - if not minetest.is_protected(pos1, owner) and not minetest.is_protected(pos2, owner) then - if is_simple_node(pos1) and is_valid_dest(pos2) then - if move_node(pos, meta, pos1, lmove, max_speed, height) == false then - meta:set_string("status", S("No valid node at the start position")) - return false - end - else - if not is_simple_node(pos1) then - meta:set_string("status", S("No valid node at the start position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid node at the start position") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("No valid destination position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid destination position") .. " at " .. P2S(pos2)) - end - return false - end - else - if minetest.is_protected(pos1, owner) then - meta:set_string("status", S("Start position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Start position is protected") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("Destination position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Destination position is protected") .. " at " .. P2S(pos2)) - end - return false - end - end - meta:set_string("status", S("Running")) - return true -end - --- Move the nodes from lpos1 to lpos2. --- * lpos1 is a list of nodes --- * lpos2 = lpos1 + move --- * pos and meta are controller block related --- * height is move block height as value between 0 and 1 and used to calculate the offset --- for the attached object (player). -local function move_nodes(pos, meta, lpos1, move, max_speed, height) - local owner = meta:get_string("owner") - lpos1 = lpos1 or {} - techage.counting_add(owner, #lpos1) - - local lpos2 = {} - for idx = 1, #lpos1 do - - local pos1 = lpos1[idx] - local pos2 = vector.add(lpos1[idx], move) - lpos2[idx] = pos2 - - if not minetest.is_protected(pos1, owner) and not minetest.is_protected(pos2, owner) then - if is_simple_node(pos1) and is_valid_dest(pos2) then - move_node(pos, meta, pos1, {move}, max_speed, height) - else - if not is_simple_node(pos1) then - meta:set_string("status", S("No valid node at the start position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid node at the start position") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("No valid destination position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid destination position") .. " at " .. P2S(pos2)) - end - return false, lpos1 - end - else - if minetest.is_protected(pos1, owner) then - meta:set_string("status", S("Start position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Start position is protected") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("Destination position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Destination position is protected") .. " at " .. P2S(pos2)) - end - return false, lpos1 - end - end - - meta:set_string("status", S("Running")) - return true, lpos2 -end - --- --- Teleport Mode --- -local function is_player_available(lpos1) - if #lpos1 == 1 then - for _, obj in pairs(minetest.get_objects_inside_radius(lpos1[1], 0.9)) do - if obj:is_player() then - return true - end - end - end -end - -local function teleport(base_pos, pos1, pos2, meta, owner, lmove, max_speed) - if not minetest.is_protected(pos1, owner) and not minetest.is_protected(pos2, owner) then - local node1 = techage.get_node_lvm(pos1) - local node2 = techage.get_node_lvm(pos2) - if techage.is_air_like(node1.name) and techage.is_air_like(node2.name) then - minetest.swap_node(pos1, {name = "techage:moveblock", param2 = 0}) - if move_node(base_pos, meta, pos1, lmove, max_speed, 0) == false then - meta:set_string("status", S("No valid start position")) - return false - end - else - if not techage.is_air_like(node1.name) then - meta:set_string("status", S("No valid start position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid start position") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("No valid destination position")) - minetest.chat_send_player(owner, " [techage] " .. S("No valid destination position") .. " at " .. P2S(pos2)) - end - return false - end - else - if minetest.is_protected(pos1, owner) then - meta:set_string("status", S("Start position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Start position is protected") .. " at " .. P2S(pos1)) - else - meta:set_string("status", S("Destination position is protected")) - minetest.chat_send_player(owner, " [techage] " .. S("Destination position is protected") .. " at " .. P2S(pos2)) - end - return false - end - meta:set_string("status", S("Running")) - return true -end - --- Move the player from nvm.lpos1 to nvm.lpos2 --- * nvm.lpos1 is a list of length one(!) with the not to be moved block below the player --- * lmove is the movement as a list of `moves` --- * pos, meta, and nvm are controller block related -local function multi_teleport_player(base_pos, meta, nvm, lmove, max_speed, move2to1) - local owner = meta:get_string("owner") - techage.counting_add(owner, #lmove, #nvm.lpos1 * #lmove) - - local pos1 = vector.add(nvm.lpos1[1], {x=0, y=1, z=0}) - local pos2 = vector.add(nvm.lpos2[1], {x=0, y=1, z=0}) - - if move2to1 then - pos1, pos2 = pos2, pos1 - end - - return teleport(base_pos, pos1, pos2, meta, owner, lmove, max_speed) -end - --- Move the player from lpos1 to lpos2. --- * lpos1 is a list of length one(!) with the not to be moved block below the player --- * lpos2 = lpos1 + move --- * pos and meta are controller block related -local function teleport_player(base_pos, meta, lpos1, move, max_speed) - local owner = meta:get_string("owner") - lpos1 = lpos1 or {} - techage.counting_add(owner, #lpos1) - - local pos1 = vector.add(lpos1[1], {x=0, y=1, z=0}) - local pos2 = vector.add(pos1, move) - - return teleport(base_pos, pos1, pos2, meta, owner, {move}, max_speed), nil -end - --------------------------------------------------------------------------------------- --- API --------------------------------------------------------------------------------------- - --- move2to1 is the direction and is true for 'from pos2 to pos1' --- Move path and other data is stored as meta data of pos -function flylib.move_to_other_pos(pos, move2to1) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local lmove, err = flylib.to_path(meta:get_string("path")) or {} - local max_speed = meta:contains("max_speed") and meta:get_int("max_speed") or MAX_SPEED - local height = meta:contains("height") and meta:get_float("height") or 1 - local teleport_mode = meta:get_string("teleport_mode") == "enable" - - if err or nvm.running then return false end - - height = techage.in_range(height, 0, 1) - max_speed = techage.in_range(max_speed, MIN_SPEED, MAX_SPEED) - nvm.lpos1 = nvm.lpos1 or {} - - local offs = dest_offset(lmove) - if move2to1 then - lmove = reverse_path(lmove) - end - -- calc destination positions - nvm.lpos2 = lvect_add_vec(nvm.lpos1, offs) - local lpos = move2to1 and nvm.lpos2 or nvm.lpos1 - - if teleport_mode and is_player_available(lpos) then - nvm.running = multi_teleport_player(pos, meta, nvm, lmove, max_speed, move2to1) - elseif not teleport_mode then - nvm.running = multi_move_nodes(pos, meta, nvm, lmove, max_speed, height, move2to1) - end - nvm.moveBA = nvm.running and not move2to1 - return nvm.running -end - --- `move` the movement as a vector -function flylib.move_to(pos, move) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local height = techage.in_range(meta:contains("height") and meta:get_float("height") or 1, 0, 1) - local max_speed = meta:contains("max_speed") and meta:get_int("max_speed") or MAX_SPEED - local teleport_mode = meta:get_string("teleport_mode") == "enable" - - if nvm.running then return false end - - -- TODO: Not working so far. There is no known 'nvm.lastpos' as start pos. - --if teleport_mode and is_player_available(nvm.lpos1) then - -- nvm.running, nvm.lastpos = teleport_player(pos, meta, nvm.lastpos or nvm.lpos1, move, max_speed) - --elseif not teleport_mode then - nvm.running, nvm.lastpos = move_nodes(pos, meta, nvm.lastpos or nvm.lpos1, move, max_speed, height) - --end - return nvm.running -end - -function flylib.reset_move(pos) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local height = techage.in_range(meta:contains("height") and meta:get_float("height") or 1, 0, 1) - local max_speed = meta:contains("max_speed") and meta:get_int("max_speed") or MAX_SPEED - - if nvm.running then return false end - if meta:get_string("teleport_mode") == "enable" then return false end - - if nvm.lpos1 and nvm.lpos1[1] then - local move = vector.subtract(nvm.lpos1[1], (nvm.lastpos or nvm.lpos1)[1]) - - nvm.running, nvm.lastpos = move_nodes(pos, meta, nvm.lastpos or nvm.lpos1, move, max_speed, height) - return nvm.running - end - return false -end - --- pos is the controller block pos --- lpos is a list of node positions to be moved --- rot is one of "l", "r", "2l", "2r" -function flylib.rotate_nodes(pos, lpos, rot) - local meta = M(pos) - local owner = meta:get_string("owner") - -- cpos is the center pos - local cpos = meta:contains("center") and flylib.to_vector(meta:get_string("center")) - local lpos2 = techage.rotate_around_center(lpos, rot, cpos) - local param2 - local nodes2 = {} - - techage.counting_add(owner, #lpos * 2) - - for i, pos1 in ipairs(lpos) do - local node = techage.get_node_lvm(pos1) - if rot == "l" then - param2 = techage.param2_turn_right(node.param2) - elseif rot == "r" then - param2 = techage.param2_turn_left(node.param2) - else - param2 = techage.param2_turn_right(techage.param2_turn_right(node.param2)) - end - if not minetest.is_protected(pos1, owner) and is_simple_node(pos1) then - minetest.remove_node(pos1) - nodes2[#nodes2 + 1] = {pos = lpos2[i], name = node.name, param2 = param2} - end - end - for _,item in ipairs(nodes2) do - if not minetest.is_protected(item.pos, owner) and is_valid_dest(item.pos) then - minetest.add_node(item.pos, {name = item.name, param2 = item.param2}) - end - end - return lpos2 -end - -function flylib.exchange_node(pos, name, param2) - local meta = M(pos) - local move_block - - -- consider stored "objects" - if meta:contains("ta_move_block") then - move_block = meta:get_string("ta_move_block") - end - - minetest.swap_node(pos, {name = name, param2 = param2}) - - if move_block then - meta:set_string("ta_move_block", move_block) - end -end - -function flylib.remove_node(pos) - local meta = M(pos) - local move_block - - -- consider stored "objects" - if meta:contains("ta_move_block") then - move_block = meta:get_string("ta_move_block") - end - - minetest.remove_node(pos) - - if move_block then - local node = minetest.deserialize(move_block) - minetest.add_node(pos, node) - meta:set_string("ta_move_block", "") - end -end - -minetest.register_on_joinplayer(function(player) - unlock_player(player) -end) - -minetest.register_on_leaveplayer(function(player) - if unlock_player(player) then - detach_player(player) - end -end) - -minetest.register_on_dieplayer(function(player) - if unlock_player(player) then - detach_player(player) - end -end) - -techage.flylib = flylib diff --git a/techage/basis/formspec_update.lua b/techage/basis/formspec_update.lua deleted file mode 100644 index 9696c2f..0000000 --- a/techage/basis/formspec_update.lua +++ /dev/null @@ -1,52 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Keep only one formspec active per player - -]]-- - -local P2S = minetest.pos_to_string - -local ActiveFormspecs = {} -local ActivePlayer = {} - - -function techage.is_activeformspec(pos) - return ActiveFormspecs[P2S(pos)] -end - -function techage.set_activeformspec(pos, player) - local name = player and player:get_player_name() - if name then - if ActivePlayer[name] then - ActiveFormspecs[ActivePlayer[name]] = nil - end - ActivePlayer[name] = P2S(pos) - ActiveFormspecs[P2S(pos)] = true - end -end - -function techage.reset_activeformspec(pos, player) - local name = player and player:get_player_name() - if name then - if ActivePlayer[name] then - ActiveFormspecs[ActivePlayer[name]] = nil - ActivePlayer[name] = nil - end - end -end - -minetest.register_on_leaveplayer(function(player) - local name = player:get_player_name() - if ActivePlayer[name] then - ActiveFormspecs[ActivePlayer[name]] = nil - ActivePlayer[name] = nil - end -end) diff --git a/techage/basis/fuel_lib.lua b/techage/basis/fuel_lib.lua deleted file mode 100644 index 0a60d3b..0000000 --- a/techage/basis/fuel_lib.lua +++ /dev/null @@ -1,197 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Oil fuel burning lib - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local ValidOilFuels = techage.firebox.ValidOilFuels -local Burntime = techage.firebox.Burntime - -techage.fuel = {} - -local CAPACITY = 50 -local BLOCKING_TIME = 0.3 -- 300ms - -techage.fuel.CAPACITY = CAPACITY - --- fuel burning categories (equal or better than...) -techage.fuel.BT_BITUMEN = 5 -techage.fuel.BT_OIL = 4 -techage.fuel.BT_FUELOIL = 3 -techage.fuel.BT_NAPHTHA = 2 -techage.fuel.BT_GASOLINE = 1 - - -function techage.fuel.fuel_container(x, y, nvm) - local itemname = "" - if nvm.liquid and nvm.liquid.name and nvm.liquid.amount and nvm.liquid.amount > 0 then - itemname = nvm.liquid.name.." "..nvm.liquid.amount - end - local fuel_percent = 0 - if nvm.running or techage.is_running(nvm) then - fuel_percent = ((nvm.burn_cycles or 1) * 100) / (nvm.burn_cycles_total or 1) - end - return "container["..x..","..y.."]".. - "box[0,0;1.05,2.1;#000000]".. - "image[0.1,0.1;1,1;default_furnace_fire_bg.png^[lowpart:".. - fuel_percent..":default_furnace_fire_fg.png]".. - techage.item_image(0.1, 1.1, itemname).. - "container_end[]" -end - -local function help(x, y) - local tooltip = S("To add fuel punch\nthis block\nwith a fuel container") - return "label["..x..","..y..";"..minetest.colorize("#000000", minetest.formspec_escape("[?]")).."]".. - "tooltip["..x..","..y..";0.5,0.5;"..tooltip..";#0C3D32;#FFFFFF]" -end - -function techage.fuel.formspec(nvm) - local title = S("Fuel Menu") - return "size[4,3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;3.8,0.5;#c6e8ff]".. - "label[1,-0.1;"..minetest.colorize("#000000", title).."]".. - help(3.4, -0.1).. - techage.fuel.fuel_container(1.5, 1, nvm) -end - -function techage.fuel.can_dig(pos, player) - if not player or minetest.is_protected(pos, player:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - local inv = M(pos):get_inventory() - return not inv or inv:is_empty("fuel") and nvm.liquid.amount == 0 -end - -function techage.fuel.on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", techage.fuel.formspec(nvm)) -end - --- name is the fuel item name -function techage.fuel.burntime(name) - if ValidOilFuels[name] then - return Burntime[name] or 0.01 -- not zero ! - end - return 0.01 -- not zero ! -end - --- equal or better than the given category (see 'techage.fuel.BT_BITUMEN,...') -function techage.fuel.valid_fuel(name, category) - return ValidOilFuels[name] and ValidOilFuels[name] <= category -end - -function techage.fuel.on_punch(pos, node, puncher, pointed_thing) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.blocking_time = mem.blocking_time or 0 - if mem.blocking_time > techage.SystemTime then - return - end - - local wielded_item = puncher:get_wielded_item():get_name() - local item_count = puncher:get_wielded_item():get_count() - local new_item = techage.liquid.fill_on_punch(nvm, wielded_item, item_count, puncher) - if new_item then - puncher:set_wielded_item(new_item) - M(pos):set_string("formspec", techage.fuel.formspec(pos, nvm)) - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - return - end - - local ldef = techage.liquid.get_liquid_def(wielded_item) - if ldef and ValidOilFuels[ldef.inv_item] then - local lqd = (minetest.registered_nodes[node.name] or {}).liquid - if not lqd.fuel_cat or ValidOilFuels[ldef.inv_item] <= lqd.fuel_cat then - local new_item = techage.liquid.empty_on_punch(pos, nvm, wielded_item, item_count) - if new_item then - puncher:set_wielded_item(new_item) - M(pos):set_string("formspec", techage.fuel.formspec(pos, nvm)) - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - end - end - end -end - -function techage.fuel.get_fuel(nvm) - if nvm.liquid and nvm.liquid.name and nvm.liquid.amount then - if nvm.liquid.amount > 0 then - nvm.liquid.amount = nvm.liquid.amount - 1 - return nvm.liquid.name - end - nvm.liquid.name = nil - end - return nil -end - -function techage.fuel.has_fuel(nvm) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - return nvm.liquid.amount > 0 -end - -function techage.fuel.get_fuel_amount(nvm) - if nvm.liquid and nvm.liquid.amount then - return nvm.liquid.amount - end - return 0 -end - -function techage.fuel.get_liquid_table(valid_fuel, capacity, start_firebox) - return { - capa = capacity, - fuel_cat = valid_fuel, - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - if techage.fuel.valid_fuel(name, valid_fuel) then - local nvm = techage.get_nvm(pos) - local res = liquid.srv_put(nvm, name, amount, capacity) - start_firebox(pos, nvm) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.fuel.formspec(nvm)) - end - return res - end - return amount - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.fuel.formspec(nvm)) - end - return amount, name - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, capacity) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.fuel.formspec(nvm)) - end - return leftover - end - } -end diff --git a/techage/basis/gravel_lib.lua b/techage/basis/gravel_lib.lua deleted file mode 100644 index 5afb383..0000000 --- a/techage/basis/gravel_lib.lua +++ /dev/null @@ -1,102 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Gravel Sieve basis functions - -]]-- - --- Increase the probability over the natural occurrence -local PROBABILITY_FACTOR = 2 - --- Ore probability table (1/n) -local ore_probability = { -} - -local ProbabilityCorrections = { - ["default:tin_lump"] = 0.3, -- extensively used - ["default:coal_lump"] = 0.2, -- extensively used - ["default:iron_lump"] = 0.5, -- extensively used - ["techage:baborium_lump"] = 99999, -- mining required -} - --- collect all registered ores and calculate the probability -local function add_ores() - for _,item in pairs(minetest.registered_ores) do - if not ore_probability[item.ore] and minetest.registered_nodes[item.ore] then - local drop = minetest.registered_nodes[item.ore].drop - if type(drop) == "string" - and drop ~= item.ore - and drop ~= "" - and item.ore_type == "scatter" - and item.wherein == "default:stone" - and item.clust_scarcity ~= nil and item.clust_scarcity > 0 - and item.clust_num_ores ~= nil and item.clust_num_ores > 0 - and item.y_max ~= nil and item.y_min ~= nil then - local factor = 0.5 - if item.y_max < -250 then - factor = -250 / item.y_max - end - local probability = (techage.ore_rarity / PROBABILITY_FACTOR) * item.clust_scarcity / - (item.clust_num_ores * factor) - -- lower value means higher probability - ore_probability[drop] = math.min(ore_probability[drop] or 100000, probability) - end - end - end - -- some corrections - for key, correction in pairs(ProbabilityCorrections) do - if ore_probability[key] then - ore_probability[key] = ore_probability[key] * correction - -- consider upper and lower level - ore_probability[key] = techage.in_range(ore_probability[key], 10, 100000) - end - end - local overall_probability = 0.0 - for name,probability in pairs(ore_probability) do - minetest.log("info", string.format("[techage] %-32s %u", name, probability)) - overall_probability = overall_probability + 1.0/probability - end - minetest.log("info", string.format("[techage] Overall probability %g", overall_probability)) -end - -minetest.register_on_mods_loaded(add_ores) - --- --- Change the probability of ores or register new ores for sieving --- -function techage.register_ore_for_gravelsieve(ore_name, probability) - ore_probability[ore_name] = probability -end - --- determine ore based on the calculated probability -function techage.gravelsieve_get_random_gravel_ore() - for ore, probability in pairs(ore_probability) do - if math.random(probability) == 1 then - return ItemStack(ore) - end - end - if math.random(2) == 1 then - return ItemStack("default:gravel") - else - return ItemStack("techage:sieved_gravel") - end -end - -function techage.gravelsieve_get_random_basalt_ore() - if math.random(40) == 1 then - return ItemStack("default:coal_lump") - elseif math.random(40) == 1 then - return ItemStack("default:iron_lump") - elseif math.random(2) == 1 then - return ItemStack("techage:basalt_gravel") - else - return ItemStack("techage:sieved_basalt_gravel") - end -end diff --git a/techage/basis/hyperloop.lua b/techage/basis/hyperloop.lua deleted file mode 100644 index 32e7b0a..0000000 --- a/techage/basis/hyperloop.lua +++ /dev/null @@ -1,240 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - For chests and tanks with hyperloop support - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local N = techage.get_node_lvm -local S = techage.S - --- Will be initialized when mods are loaded -local Stations = nil -local Tube = nil -local HYPERLOOP = nil - -techage.hyperloop = {} - ---[[ - - tStations["(x,y,z)"] = { - conn = {dir = "(200,0,20)", ...}, - name = , -- chest/tank - owner = "singleplayer", - conn_name = , - single = true/nil, - } - -]]-- - -minetest.register_on_mods_loaded(function() - if minetest.global_exists("hyperloop") then - Stations = hyperloop.Stations - Tube = hyperloop.Tube - HYPERLOOP = true - Tube:add_secondary_node_names({"techage:ta5_hl_chest", "techage:ta5_hl_tank"}) - end -end) - -local function get_remote_pos(pos, rmt_name) - local owner = M(pos):get_string("owner") - for key,item in pairs(Stations:get_node_table(pos)) do - if item.owner == owner and item.conn_name == rmt_name then - return S2P(key) - end - end -end - -local function get_free_server_list(pos, owner) - if Stations and Stations.get_node_table then - local tbl = {M(pos):get_string("remote_name")} - for key,item in pairs(Stations:get_node_table(pos) or {}) do - if item.single and item.owner == owner then - if M(pos):get_string("node_type") == M(S2P(key)):get_string("node_type") then - tbl[#tbl+1] = item.conn_name - end - end - end - tbl[#tbl+1] = "" - return tbl - end - return {} -end - -local function on_lose_connection(pos, node_type) - local name = techage.get_node_lvm(pos).name - local ndef = minetest.registered_nodes[name] - if ndef and ndef.on_lose_connection then - ndef.on_lose_connection(pos, node_type) - end -end - -local function on_dropdown(pos) - if pos then - local owner = M(pos):get_string("owner") - return table.concat(get_free_server_list(pos, owner), ",") or "" - end - return "" -end - -local function update_node_data(pos, state, conn_name, remote_name, rmt_pos) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if state == "server_connected" then - Stations:update(pos, {conn_name=conn_name, single="nil"}) - meta:set_string("status", "server") - meta:set_string("conn_name", conn_name) - meta:set_string("remote_name", "") - meta:set_string("conn_status", S("connected to") .. " " .. P2S(rmt_pos)) - nvm.rmt_pos = rmt_pos - elseif state == "client_connected" then - Stations:update(pos, {conn_name="nil", single="nil"}) - meta:set_string("status", "client") - meta:set_string("conn_name", "") - meta:set_string("remote_name", remote_name) - meta:set_string("conn_status", S("connected to") .. " " .. P2S(rmt_pos)) - nvm.rmt_pos = rmt_pos - elseif state == "server_not_connected" then - Stations:update(pos, {conn_name=conn_name, single=true}) - meta:set_string("status", "server") - meta:set_string("conn_name", conn_name) - meta:set_string("remote_name", "") - meta:set_string("conn_status", S("not connected")) - nvm.rmt_pos = nil - on_lose_connection(pos, "server") - elseif state == "client_not_connected" then - Stations:update(pos, {conn_name="nil", single=nil}) - meta:set_string("status", "not connected") - meta:set_string("conn_name", "") - meta:set_string("remote_name", "") - meta:set_string("conn_status", S("not connected")) - nvm.rmt_pos = nil - on_lose_connection(pos, "client") - end -end - -techage.hyperloop.SUBMENU = { - { - type = "label", - label = S("Enter a block name or select an existing one"), - tooltip = "", - name = "l1", - }, - { - type = "ascii", - name = "conn_name", - label = S("Block name"), - tooltip = S("Connection name for this block"), - default = "", - }, - { - type = "dropdown", - choices = "", - on_dropdown = on_dropdown, - name = "remote_name", - label = S("Remote name"), - tooltip = S("Connection name of the remote block"), - }, -} - -function techage.hyperloop.is_client(pos) - if HYPERLOOP then - local nvm = techage.get_nvm(pos) - if Stations:get(nvm.rmt_pos) then - if M(pos):get_string("status") == "client" then - return true - end - end - end -end - -function techage.hyperloop.is_server(pos) - if HYPERLOOP then - if M(pos):get_string("status") == "server" then - return true - end - end -end - -function techage.hyperloop.is_paired(pos) - if HYPERLOOP then - local nvm = techage.get_nvm(pos) - if Stations:get(nvm.rmt_pos) then - if M(pos):get_string("status") ~= "not connected" then - return true - end - end - end -end - -function techage.hyperloop.remote_pos(pos) - if HYPERLOOP then - local nvm = techage.get_nvm(pos) - if Stations:get(nvm.rmt_pos) then - if M(pos):contains("remote_name") then - return nvm.rmt_pos or pos - end - end - end - return pos -end - -function techage.hyperloop.after_place_node(pos, placer, node_type) - if HYPERLOOP then - Stations:set(pos, node_type, {owner=placer:get_player_name()}) - M(pos):set_string("node_type", node_type) - Tube:after_place_node(pos) - end -end - -function techage.hyperloop.after_dig_node(pos, oldnode, oldmetadata, digger) - if HYPERLOOP then - local conn_name = oldmetadata.fields.conn_name - local remote_name = oldmetadata.fields.remote_name - local loc_pos, rmt_pos = pos, techage.get_nvm(pos).rmt_pos - - -- Close connections - if remote_name and rmt_pos then -- Connected client - update_node_data(rmt_pos, "server_not_connected", remote_name, "") - elseif conn_name and rmt_pos then -- Connected server - update_node_data(rmt_pos, "client_not_connected", "", conn_name) - end - - Tube:after_dig_node(pos) - Stations:delete(pos) - end -end - -function techage.hyperloop.after_formspec(pos, fields) - if HYPERLOOP and fields.save or fields.key_enter_field then - local meta = M(pos) - local conn_name = meta:get_string("conn_name") - local remote_name = meta:get_string("remote_name") - local status = meta:contains("status") and meta:get_string("status") or "not connected" - local loc_pos, rmt_pos = pos, techage.get_nvm(pos).rmt_pos - - if status == "not connected" then - if fields.remote_name ~= "" then -- Client - local rmt_pos = get_remote_pos(pos, fields.remote_name) - if rmt_pos then - update_node_data(loc_pos, "client_connected", "", fields.remote_name, rmt_pos) - update_node_data(rmt_pos, "server_connected", fields.remote_name, "", loc_pos) - end - elseif fields.conn_name ~= "" then -- Server - update_node_data(loc_pos, "server_not_connected", fields.conn_name, "") - end - end - end -end diff --git a/techage/basis/laser_lib.lua b/techage/basis/laser_lib.lua deleted file mode 100644 index 135fe61..0000000 --- a/techage/basis/laser_lib.lua +++ /dev/null @@ -1,146 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - Laser basis functions - -]]-- - -local Entities = {} -local SIZES = {1, 2, 3, 6, 12, 24, 48} -- for laser entities -local GAP_MIN = 1 -- between 2 blocks -local GAP_MAX = 2 * 48 -- between 2 blocks - --- Return the area (pos1,pos2) for a destination node -local function get_pos_range(pos, dir) - local pos1 = vector.add(pos, vector.multiply(dir, GAP_MIN + 1)) -- min - local pos2 = vector.add(pos, vector.multiply(dir, GAP_MAX + 1)) -- max - return pos1, pos2 -end - --- Return first pos after start pos and the destination pos -local function get_positions(pos, mem, dir) - local pos1 = vector.add(pos, dir) -- start pos - local _, pos2 = get_pos_range(pos, dir) -- last pos - local _, pos3 = minetest.line_of_sight(pos1, pos2) - pos3 = pos3 or pos2 -- destination node pos - if not mem.peer_node_pos or not vector.equals(pos3, mem.peer_node_pos) then - mem.peer_node_pos = pos3 - local dist = vector.distance(pos1, pos3) - if dist > GAP_MIN and dist <= GAP_MAX then - return true, pos1, pos3 -- new values - else - return false -- invalid values - end - end - return true -- no new values -end - --- return for both laser entities the pos and length -local function get_laser_length_and_pos(pos1, pos2, dir) - local dist = vector.distance(pos1, pos2) - - for _, size in ipairs(SIZES) do - if dist <= (size * 2) then - pos1 = vector.add (pos1, vector.multiply(dir, (size / 2) - 0.5)) - pos2 = vector.subtract(pos2, vector.multiply(dir, (size / 2) + 0.5)) - return size, pos1, pos2 - end - end -end - -local function del_laser(pos) - local key = minetest.hash_node_position(pos) - local items = Entities[key] - if items then - local laser1, laser2 = items[1], items[2] - laser1:remove() - laser2:remove() - Entities[key] = nil - end - return key -end - -local function add_laser(pos, pos1, pos2, size, param2) - local key = del_laser(pos) - - local laser1 = minetest.add_entity(pos1, "techage:laser" .. size) - if laser1 then - local yaw = math.pi / 2 * (param2 + 1) - laser1:set_rotation({x = 0, y = yaw, z = 0}) - end - - local laser2 = minetest.add_entity(pos2, "techage:laser" .. size) - if laser2 then - param2 = (param2 + 2) % 4 -- flip dir - local yaw = math.pi / 2 * (param2 + 1) - laser2:set_rotation({x = 0, y = yaw, z = 0}) - end - - Entities[key] = {laser1, laser2} -end - -for _, size in ipairs(SIZES) do - minetest.register_entity("techage:laser" .. size, { - initial_properties = { - visual = "cube", - textures = { - "techage_laser.png", - "techage_laser.png", - "techage_laser.png", - "techage_laser.png", - "techage_laser.png", - "techage_laser.png", - }, - use_texture_alpha = true, - physical = false, - collide_with_objects = false, - pointable = false, - static_save = false, - visual_size = {x = size, y = 0.05, z = 0.05}, - glow = 14, - shaded = true, - }, - }) -end - -------------------------------------------------------------------------------- --- API functions -------------------------------------------------------------------------------- --- if force is not true, do not redraw the laser if nothing has changed -function techage.renew_laser(pos, force) - local mem = techage.get_mem(pos) - if force then - mem.peer_node_pos = nil - mem.param2 = nil - end - mem.param2 = mem.param2 or minetest.get_node(pos).param2 - local dir = minetest.facedir_to_dir(mem.param2) - local res, pos1, pos2 = get_positions(pos, mem, dir) - if pos1 then - local size, pos3, pos4 = get_laser_length_and_pos(pos1, pos2, dir) - if size then - add_laser(pos, pos3, pos4, size, mem.param2) - return res, pos1, pos2 - end - end - return res -end - -function techage.add_laser(pos, pos1, pos2) - local dir = vector.direction(pos1, pos2) - local param2 = minetest.dir_to_facedir(dir) - local size, pos3, pos4 = get_laser_length_and_pos(pos1, pos2, dir) - if size then - add_laser(pos, pos3, pos4, size, param2) - end -end - --- techage.del_laser(pos) -techage.del_laser = del_laser diff --git a/techage/basis/legacy.lua b/techage/basis/legacy.lua deleted file mode 100644 index 18d25a1..0000000 --- a/techage/basis/legacy.lua +++ /dev/null @@ -1,25 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - For the transition from v0.26 to v1.0 - -]]-- - -function techage.register_node_for_v1_transition(nodenames, on_node_load) - minetest.register_lbm({ - label = "[TechAge] V1 transition", - name = nodenames[1].."transition", - nodenames = nodenames, - run_at_every_load = false, - action = function(pos, node) - on_node_load(pos, node) - end - }) -end diff --git a/techage/basis/lib.lua b/techage/basis/lib.lua deleted file mode 100644 index 7eb89b8..0000000 --- a/techage/basis/lib.lua +++ /dev/null @@ -1,633 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Helper functions - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - --- Input data to generate the Param2ToDir table -local Input = { - 8,9,10,11, -- 1 - 16,17,18,19, -- 2 - 4,5,6,7, -- 3 - 12,13,14,15, -- 4 - 0,1,2,3, -- 5 - 20,21,22,23, -- 6 -} - --- Input data to turn a "facedir" block to the right/left -local ROTATION = { - {5,14,11,16}, -- x+ - {7,12,9,18}, -- x- - {0,1,2,3}, -- y+ - {22,21,20,23}, -- y- - {6,15,8,17}, -- z+ - {4,13,10,19}, -- z- -} - -local FACEDIR_TO_ROT = {[0] = - {x=0.000000, y=0.000000, z=0.000000}, - {x=0.000000, y=4.712389, z=0.000000}, - {x=0.000000, y=3.141593, z=0.000000}, - {x=0.000000, y=1.570796, z=0.000000}, - {x=4.712389, y=0.000000, z=0.000000}, - {x=3.141593, y=1.570796, z=1.570796}, - {x=1.570796, y=4.712389, z=4.712389}, - {x=3.141593, y=4.712389, z=4.712389}, - {x=1.570796, y=0.000000, z=0.000000}, - {x=0.000000, y=4.712389, z=1.570796}, - {x=4.712389, y=1.570796, z=4.712389}, - {x=0.000000, y=1.570796, z=4.712389}, - {x=0.000000, y=0.000000, z=1.570796}, - {x=4.712389, y=0.000000, z=1.570796}, - {x=0.000000, y=3.141593, z=4.712389}, - {x=1.570796, y=3.141593, z=4.712389}, - {x=0.000000, y=0.000000, z=4.712389}, - {x=1.570796, y=0.000000, z=4.712389}, - {x=0.000000, y=3.141593, z=1.570796}, - {x=4.712389, y=0.000000, z=4.712389}, - {x=0.000000, y=0.000000, z=3.141593}, - {x=0.000000, y=1.570796, z=3.141593}, - {x=0.000000, y=3.141593, z=3.141593}, - {x=0.000000, y=4.712389, z=3.141593}, -} - -local RotationViaYAxis = {} - -for _,row in ipairs(ROTATION) do - for i = 1,4 do - local val = row[i] - local left = row[i == 1 and 4 or i - 1] - local right = row[i == 4 and 1 or i + 1] - RotationViaYAxis[val] = {left, right} - end -end - -function techage.facedir_to_rotation(facedir) - return FACEDIR_TO_ROT[facedir] or FACEDIR_TO_ROT[0] -end - -function techage.param2_turn_left(param2) - return (RotationViaYAxis[param2] or RotationViaYAxis[0])[2] -end - -function techage.param2_turn_right(param2) - return (RotationViaYAxis[param2] or RotationViaYAxis[0])[1] -end - --- Roll a block in north direction (south is vice versa) -local RollNorth = { - {0,4,22,8}, - {1,5,23,9}, - {2,6,20,10}, - {3,7,21,11}, - {12,13,14,15}, - {16,19,18,17}, -} --- Roll a block in east direction (west is vice versa) -local RollEast = { - {0,12,20,16}, - {1,13,21,17}, - {2,14,22,18}, - {3,15,23,19}, - {4,7,6,5}, - {8,9,10,11}, -} - --- Generate a table for all facedir and param2 values: --- TurnUp[facedir][param2] = new_param2 -local TurnUp = {[0] = {}, {}, {}, {}} - -for i = 1,6 do - for j = 1,4 do - local idx = RollNorth[i][j] - TurnUp[0][idx] = RollNorth[i][j == 4 and 1 or j + 1] -- north - TurnUp[2][idx] = RollNorth[i][j == 1 and 4 or j - 1] -- south - - idx = RollEast[i][j] - TurnUp[1][idx] = RollEast[i][j == 4 and 1 or j + 1] -- east - TurnUp[3][idx] = RollEast[i][j == 1 and 4 or j - 1] -- west - end -end - --- facedir is from the players (0..3) --- param2 is from the node (0..23) -function techage.param2_turn_up(facedir, param2) - return TurnUp[facedir % 4][param2 % 24] -end - - -------------------------------------------------------------------------------- --- Rotate nodes around the center -------------------------------------------------------------------------------- -function techage.positions_center(lpos) - local c = {x=0, y=0, z=0} - for _,v in ipairs(lpos) do - c = vector.add(c, v) - end - c = vector.divide(c, #lpos) - c = vector.round(c) - c.y = 0 - return c -end - -function techage.rotate_around_axis(v, c, turn) - local dx, dz = v.x - c.x, v.z - c.z - if turn == "l" then - return { - x = c.x - dz, - y = v.y, - z = c.z + dx, - } - elseif turn == "r" then - return { - x = c.x + dz, - y = v.y, - z = c.z - dx, - } - elseif turn == "" then - return v - else -- turn 180 degree - return { - x = c.x - dx, - y = v.y, - z = c.z - dz, - } - end -end - --- Function returns a list ẃith the new node positions --- turn is one of "l", "r", "2l", "2r" --- cpos is the center pos (optional) -function techage.rotate_around_center(nodes1, turn, cpos) - cpos = cpos or techage.positions_center(nodes1) - local nodes2 = {} - for _,pos in ipairs(nodes1) do - nodes2[#nodes2 + 1] = techage.rotate_around_axis(pos, cpos, turn) - end - return nodes2 -end - - -------------------------------------------------------------------------------- --- Helper functions -------------------------------------------------------------------------------- --- allowed for digging -local SimpleNodes = {} - --- translation from param2 to dir (out of the node upwards) -local Param2Dir = {} -for idx,val in ipairs(Input) do - Param2Dir[val] = math.floor((idx - 1) / 4) + 1 -end - --- used by lamps and power switches -function techage.determine_node_bottom_as_dir(node) - return tubelib2.Turn180Deg[Param2Dir[node.param2] or 1] -end - -function techage.determine_node_top_as_dir(node) - return Param2Dir[node.param2] or 1 -end - --- rotation rules (screwdriver) for wallmounted "facedir" nodes -function techage.rotate_wallmounted(param2) - local offs = math.floor(param2 / 4) * 4 - local rot = ((param2 % 4) + 1) % 4 - return offs + rot -end - -function techage.in_range(val, min, max) - val = tonumber(val) - if val < min then return min end - if val > max then return max end - return val -end - -function techage.one_of(val, selection) - for _,v in ipairs(selection) do - if val == v then return val end - end - return selection[1] -end - -function techage.index(list, x) - for idx, v in pairs(list) do - if v == x then return idx end - end - return nil -end - -function techage.in_list(list, x) - for idx, v in pairs(list) do - if v == x then return true end - end - return false -end - -function techage.add_to_set(set, x) - if not techage.index(set, x) then - table.insert(set, x) - end -end - --- techage.tbl_filter({"a", "b", "c", "d"}, function(v, k, t) return v >= "c" end) --> {"c","d"} -techage.tbl_filter = function(t, filterIter) - local out = {} - - for k, v in pairs(t) do - if filterIter(v, k, t) then out[k] = v end - end - - return out -end - -function techage.get_node_lvm(pos) - local node = minetest.get_node_or_nil(pos) - if node then - return node - end - local vm = minetest.get_voxel_manip() - local MinEdge, MaxEdge = vm:read_from_map(pos, pos) - local data = vm:get_data() - local param2_data = vm:get_param2_data() - local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) - local idx = area:indexp(pos) - if data[idx] and param2_data[idx] then - return { - name = minetest.get_name_from_content_id(data[idx]), - param2 = param2_data[idx] - } - end - return {name="ignore", param2=0} -end - -function techage.is_air_like(name) - local ndef = minetest.registered_nodes[name] - if ndef and ndef.buildable_to then - return true - end - return false -end - --- returns true, if node can be dug, otherwise false -function techage.can_dig_node(name, ndef) - if not ndef then return false end - if SimpleNodes[name] ~= nil then - return SimpleNodes[name] - end - - if ndef.groups and ndef.groups.techage_door == 1 then - SimpleNodes[name] = true - return true - end - if name == "ignore" then - SimpleNodes[name] = false - return false - end - if name == "air" then - SimpleNodes[name] = true - return true - end - if ndef.buildable_to == true then - SimpleNodes[name] = true - return true - end - -- don't remove nodes with some intelligence or undiggable nodes - if ndef.drop == "" then - SimpleNodes[name] = false - return false - end - if ndef.diggable == false then - SimpleNodes[name] = false - return false - end - if ndef.after_dig_node then - SimpleNodes[name] = false - return false - end - -- add it to the white list - SimpleNodes[name] = true - return true -end - --- Simple nodes -function techage.register_simple_nodes(node_names, is_valid) - if is_valid == nil then is_valid = true end - for _,name in ipairs(node_names or {}) do - SimpleNodes[name] = is_valid - end -end - -techage.dig_states = { - NOT_DIGGABLE = 1, - INV_FULL = 2, - DUG = 3 -} - --- Digs a node like a player would by utilizing a fake player object. --- add_to_inv(itemstacks) is a method that should try to add the dropped stacks to an appropriate inventory. --- The node will only be dug, if add_to_inv(itemstacks) returns true. -function techage.dig_like_player(pos, fake_player, add_to_inv) - local node = techage.get_node_lvm(pos) - local ndef = minetest.registered_nodes[node.name] - if not ndef or ndef.diggable == false or (ndef.can_dig and not ndef.can_dig(pos, fake_player)) then - return techage.dig_states.NOT_DIGGABLE - end - local drop_as_strings = minetest.get_node_drops(node) - local drop_as_stacks = {} - for _,itemstring in ipairs(drop_as_strings) do - drop_as_stacks[#drop_as_stacks+1] = ItemStack(itemstring) - end - local meta = M(pos) - if ndef.preserve_metadata then - ndef.preserve_metadata(pos, node, meta, drop_as_stacks) - end - - if add_to_inv(drop_as_stacks) then - local oldmeta = meta:to_table() - minetest.remove_node(pos) - - if ndef.after_dig_node then - ndef.after_dig_node(pos, node, oldmeta, fake_player) - end - return techage.dig_states.DUG - end - return techage.dig_states.INV_FULL -end - -local function handle_drop(drop) - -- To keep it simple, return only the item with the lowest rarity - if drop.items then - local rarity = 9999 - local name - for idx,item in ipairs(drop.items) do - if item.rarity and item.rarity < rarity then - rarity = item.rarity - name = item.items[1] -- take always the first item - else - return item.items[1] -- take always the first item - end - end - return name - end - return false -end - --- returns the node name, if node can be dropped, otherwise nil -function techage.dropped_node(node, ndef) - if node.name == "air" then return end - --if ndef.buildable_to == true then return end - if not ndef.diggable then return end - if ndef.drop == "" then return end - if type(ndef.drop) == "table" then - return handle_drop(ndef.drop) - end - return ndef.drop or node.name -end - --- needed for windmill plants -local function determine_ocean_ids() - techage.OceanIdTbl = {} - for name, _ in pairs(minetest.registered_biomes) do - if string.find(name, "ocean") then - local id = minetest.get_biome_id(name) - --print(id, name) - techage.OceanIdTbl[id] = true - end - end -end - -determine_ocean_ids() - --- check if natural water is on given position (water placed by player has param2 = 1) -function techage.is_ocean(pos) - if pos.y > 1 then return false end - local node = techage.get_node_lvm(pos) - if node.name ~= "default:water_source" then return false end - if node.param2 == 1 then return false end - return true -end - -function techage.item_image(x, y, itemname, count) - local name, size = unpack(string.split(itemname, " ")) - size = count and count or size - size = tonumber(size) or 1 - local label = "" - local text = minetest.formspec_escape(ItemStack(itemname):get_description()) - local tooltip = "tooltip["..x..","..y..";1,1;"..text..";#0C3D32;#FFFFFF]" - - if minetest.registered_tools[name] and size > 1 then - local offs = 0 - if size < 10 then - offs = 0.65 - elseif size < 100 then - offs = 0.5 - elseif size < 1000 then - offs = 0.35 - else - offs = 0.2 - end - label = "label["..(x + offs)..","..(y + 0.45)..";"..tostring(size).."]" - end - - return "box["..x..","..y..";0.85,0.9;#808080]".. - "item_image["..x..","..y..";1,1;"..itemname.."]".. - tooltip.. - label -end - -function techage.item_image_small(x, y, itemname, tooltip_prefix) - local name = unpack(string.split(itemname, " ")) - local tooltip = "" - local ndef = minetest.registered_nodes[name] or minetest.registered_items[name] or minetest.registered_craftitems[name] - - if ndef and ndef.description then - local text = minetest.formspec_escape(ndef.description) - tooltip = "tooltip["..x..","..y..";0.8,0.8;"..tooltip_prefix..": "..text..";#0C3D32;#FFFFFF]" - end - - return "box["..x..","..y..";0.65,0.7;#808080]".. - "item_image["..x..","..y..";0.8,0.8;"..name.."]".. - tooltip -end - -function techage.vector_dump(posses) - local t = {} - for _,pos in ipairs(posses) do - t[#t + 1] = minetest.pos_to_string(pos) - end - return table.concat(t, " ") -end - --- title bar help (width is the fornmspec width) -function techage.question_mark_help(width, tooltip) - local x = width- 0.6 - return "label["..x..",-0.1;"..minetest.colorize("#000000", minetest.formspec_escape("[?]")).."]".. - "tooltip["..x..",-0.1;0.5,0.5;"..tooltip..";#0C3D32;#FFFFFF]" -end - -function techage.wrench_tooltip(x, y) - local tooltip = S("Block has an\nadditional wrench menu") - return "image["..x.."," .. y .. ";0.5,0.5;techage_inv_wrench.png]" .. - "tooltip["..x..","..y..";0.5,0.5;"..tooltip..";#0C3D32;#FFFFFF]" -end - -techage.RegisteredMobsMods = {} - --- Register mobs mods for the move/fly controllers -function techage.register_mobs_mods(mod) - techage.RegisteredMobsMods[mod] = true -end - -function techage.beduino_signed_var(val) - val = val or 0 - return val >= 32768 and val - 0x10000 or val -end - -------------------------------------------------------------------------------- --- Terminal history buffer -------------------------------------------------------------------------------- -local BUFFER_DEPTH = 10 - -function techage.historybuffer_add(pos, s) - local mem = techage.get_mem(pos) - mem.hisbuf = mem.hisbuf or {} - - if #s > 2 then - table.insert(mem.hisbuf, s) - if #mem.hisbuf > BUFFER_DEPTH then - table.remove(mem.hisbuf, 1) - end - mem.hisbuf_idx = #mem.hisbuf + 1 - end -end - -function techage.historybuffer_priv(pos) - local mem = techage.get_mem(pos) - mem.hisbuf = mem.hisbuf or {} - mem.hisbuf_idx = mem.hisbuf_idx or 1 - - mem.hisbuf_idx = math.max(1, mem.hisbuf_idx - 1) - return mem.hisbuf[mem.hisbuf_idx] -end - -function techage.historybuffer_next(pos) - local mem = techage.get_mem(pos) - mem.hisbuf = mem.hisbuf or {} - mem.hisbuf_idx = mem.hisbuf_idx or 1 - - mem.hisbuf_idx = math.min(#mem.hisbuf, mem.hisbuf_idx + 1) - return mem.hisbuf[mem.hisbuf_idx] -end - -------------------------------------------------------------------------------- --- Player TA5 Experience Points -------------------------------------------------------------------------------- -function techage.get_expoints(player) - if player and player.get_meta then - local meta = player:get_meta() - if meta then - return meta:get_int("techage_ex_points") - end - end -end - --- Can only be used from one collider -function techage.add_expoint(player, number) - if player and player.get_meta then - local meta = player:get_meta() - if meta then - if not meta:contains("techage_collider_number") then - meta:set_string("techage_collider_number", number) - end - if meta:get_string("techage_collider_number") == number then - meta:set_int("techage_ex_points", meta:get_int("techage_ex_points") + 1) - return true - else - minetest.chat_send_player(player:get_player_name(), "[techage] More than one collider is not allowed!") - return false - end - end - end -end - --- Delete number with: `//lua minetest.get_player_by_name(""):get_meta():set_string("techage_collider_number", "")` - -function techage.on_remove_collider(player) - if player and player.get_meta then - local meta = player:get_meta() - if meta then - meta:set_string("techage_collider_number", "") - end - end -end - -function techage.set_expoints(player, ex_points) - if player and player.get_meta then - local meta = player:get_meta() - if meta then - meta:set_int("techage_ex_points", ex_points) - return true - end - end -end - -------------------------------------------------------------------------------- --- Scheduler for a table-based, cyclic call of functions -------------------------------------------------------------------------------- -local TABLE_SIZE = 256 -techage.scheduler = {} - -local function add_to_table(tbl, i, func) - while i < TABLE_SIZE do - if not tbl[i] then - tbl[i] = func - return i + 1 - end - i = i + 1 - end - return i -end - -function techage.scheduler.init(pos) - local mem = techage.get_mem(pos) - mem.sched_idx = 0 -end - --- tFunc : (empty) table of functions --- call_rate : (2,4,8,16,32,64 or 128) --- offset : 0-128 --- func : function to be called -function techage.scheduler.register(tFunc, call_rate, offset, func) - local i= 0 - while i < TABLE_SIZE do - if (i % call_rate) == offset then - i = add_to_table(tFunc, i, func) - else - i = i + 1 - end - end - return tFunc -end - --- tFunc : table of functions --- default : default function (optional) --- Returns a function to be called be the callee -function techage.scheduler.get(pos, tFunc, default) - local mem = techage.get_mem(pos) - mem.sched_idx = ((mem.sched_idx or 0) + 1) % TABLE_SIZE - return tFunc[mem.sched_idx] or default or function() end -end diff --git a/techage/basis/liquid_lib.lua b/techage/basis/liquid_lib.lua deleted file mode 100644 index 9df0975..0000000 --- a/techage/basis/liquid_lib.lua +++ /dev/null @@ -1,278 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Liquid lib - -]]-- - -local M = minetest.get_meta -local S = techage.S -local P2S = minetest.pos_to_string -local LQD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).liquid end - -local BLOCKING_TIME = 0.3 -- 300ms - -techage.liquid = {} -local LiquidDef = {} -local IsLiquid = {} -local ContainerDef = {} - -local function help(x, y) - local tooltip = S("To add liquids punch\nthe tank\nwith a liquid container") - return "label["..x..","..y..";"..minetest.colorize("#000000", minetest.formspec_escape("[?]")).."]".. - "tooltip["..x..","..y..";0.5,0.5;"..tooltip..";#0C3D32;#FFFFFF]" -end - -function techage.liquid.formspec(pos, nvm, title) - title = title or S("Liquid Tank") - local itemname = "techage:liquid" - if nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0 and nvm.liquid.name then - itemname = nvm.liquid.name.." "..nvm.liquid.amount - end - local name = minetest.get_node(pos).name - if name == "techage:ta4_tank" then - local meta = M(pos) - local public = dump((meta:get_int("public") or 0) == 1) - local keep_assignment = dump((meta:get_int("keep_assignment") or 0) == 1) - return "size[8,3.5]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize("#000000", title).."]".. - help(7.4, -0.1).. - techage.item_image(3.5, 1, itemname).. - "checkbox[0.1,2.5;public;"..S("Allow public access to the tank")..";"..public.."]".. - "checkbox[0.1,3;keep_assignment;"..S("keep assignment")..";"..keep_assignment.."]" - else - return "size[8,2]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize("#000000", title).."]".. - help(7.4, -0.1).. - techage.item_image(3.5, 1, itemname) - end -end - -function techage.liquid.is_empty(pos) - local nvm = techage.get_nvm(pos) - return not nvm.liquid or (nvm.liquid.amount or 0) <= 0 -end - -techage.liquid.recv_message = { - on_recv_message = function(pos, src, topic, payload) - if topic == "load" then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - return techage.power.percent(LQD(pos).capa, nvm.liquid.amount), nvm.liquid.amount - elseif topic == "size" then - return LQD(pos).capa - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 134 then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - if payload[1] == 1 then - local value = techage.power.percent(LQD(pos).capa, nvm.liquid.amount) - return 0, {math.floor(value + 0.5)} - else - return 0, {nvm.liquid.amount} - end - else - return 2, "" - end - end, -} - --- like: register_liquid("techage:ta3_barrel_oil", "techage:ta3_barrel_empty", 10, "techage:oil") -function techage.register_liquid(full_container, empty_container, container_size, inv_item) - LiquidDef[full_container] = {container = empty_container, size = container_size, inv_item = inv_item} - ContainerDef[empty_container] = ContainerDef[empty_container] or {} - ContainerDef[empty_container][inv_item] = full_container - IsLiquid[inv_item] = true - if inv_item == "techage:water" and container_size == 1 then - techage.register_water_bucket(empty_container, full_container) - end -end - -local function get_liquid_def(full_container) - return LiquidDef[full_container] -end - -local function get_container_def(container_name) - return ContainerDef[container_name] -end - -local function is_container_empty(container_name) - return ContainerDef[container_name] -end - -local function get_full_container(empty_container, inv_item) - return ContainerDef[empty_container] and ContainerDef[empty_container][inv_item] -end - --- used by filler -local function fill_container(pos, inv, empty_container) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - local full_container = get_full_container(empty_container, nvm.liquid.name) - if empty_container and full_container then - local ldef = get_liquid_def(full_container) - if ldef and nvm.liquid.amount - ldef.size >= 0 then - if inv:room_for_item("dst", {name = full_container}) then - inv:add_item("dst", {name = full_container}) - nvm.liquid.amount = nvm.liquid.amount - ldef.size - if nvm.liquid.amount == 0 then - nvm.liquid.name = nil - end - return true - end - end - end - -- undo - inv:add_item("src", {name = empty_container}) - return false -end - --- used by filler -local function empty_container(pos, inv, full_container) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - local ndef_lqd = LQD(pos) - local tank_size = (ndef_lqd and ndef_lqd.capa) or 0 - local ldef = get_liquid_def(full_container) - if ldef and (not nvm.liquid.name or ldef.inv_item == nvm.liquid.name) then - if nvm.liquid.amount + ldef.size <= tank_size then - if inv:room_for_item("dst", {name = ldef.container}) then - inv:add_item("dst", {name = ldef.container}) - nvm.liquid.amount = nvm.liquid.amount + ldef.size - nvm.liquid.name = ldef.inv_item - return true - end - end - end - -- undo - inv:add_item("src", {name = full_container}) - return false -end - --- check if the wielded empty container can be replaced by a full --- container and added to the players inventory -local function fill_on_punch(nvm, empty_container, item_count, puncher) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - local full_container = get_full_container(empty_container, nvm.liquid.name) - if empty_container and full_container then - local item = {name = full_container} - local ldef = get_liquid_def(full_container) - if ldef and nvm.liquid.amount - ldef.size >= 0 then - if item_count > 1 then -- can't be simply replaced? - -- check for extra free space - local inv = puncher:get_inventory() - if inv:room_for_item("main", {name = full_container}) then - -- add full container and return - -- the empty once - 1 - inv:add_item("main", {name = full_container}) - item = {name = empty_container, count = item_count - 1} - else - return -- no free space - end - end - nvm.liquid.amount = nvm.liquid.amount - ldef.size - if nvm.liquid.amount == 0 then - nvm.liquid.name = nil - end - return item -- to be added to the players inv. - end - elseif nvm.liquid.name and not IsLiquid[nvm.liquid.name] then - if empty_container == "" then - local count = math.max(nvm.liquid.amount, 99) - local name = nvm.liquid.name - nvm.liquid.amount = nvm.liquid.amount - count - if nvm.liquid.amount == 0 then - nvm.liquid.name = nil - end - return {name = name, count = count} - end - end -end - -local function legacy_items(full_container, item_count) - if full_container == "techage:isobutane" then - return {container = "", size = item_count, inv_item = full_container} - elseif full_container == "techage:oil_source" then - return {container = "", size = item_count, inv_item = full_container} - end -end - --- check if the wielded full container can be emptied into the tank -local function empty_on_punch(pos, nvm, full_container, item_count) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - local lqd_def = get_liquid_def(full_container) or legacy_items(full_container, item_count) - local ndef_lqd = LQD(pos) - if lqd_def and ndef_lqd then - local tank_size = ndef_lqd.capa or 0 - if not nvm.liquid.name or lqd_def.inv_item == nvm.liquid.name then - if nvm.liquid.amount + lqd_def.size <= tank_size then - nvm.liquid.amount = nvm.liquid.amount + lqd_def.size - nvm.liquid.name = lqd_def.inv_item - return {name = lqd_def.container} - end - end - end -end - -function techage.liquid.on_punch(pos, node, puncher, pointed_thing) - local public = M(pos):get_int("public") == 1 - if not public and minetest.is_protected(pos, puncher:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.blocking_time = mem.blocking_time or 0 - if mem.blocking_time > techage.SystemTime then - return - end - - local wielded_item = puncher:get_wielded_item():get_name() - local item_count = puncher:get_wielded_item():get_count() - local new_item = fill_on_punch(nvm, wielded_item, item_count, puncher) - or empty_on_punch(pos, nvm, wielded_item, item_count) - if new_item then - puncher:set_wielded_item(new_item) - M(pos):set_string("formspec", techage.fuel.formspec(pos, nvm)) - mem.blocking_time = techage.SystemTime + BLOCKING_TIME - return - end -end - -function techage.liquid.get_liquid_amount(nvm) - if nvm.liquid and nvm.liquid.amount then - return nvm.liquid.amount - end - return 0 -end - -techage.liquid.get_liquid_def = get_liquid_def -techage.liquid.get_container_def = get_container_def -techage.liquid.is_container_empty = is_container_empty -techage.liquid.get_full_container = get_full_container -techage.liquid.fill_container = fill_container -techage.liquid.empty_container = empty_container -techage.liquid.fill_on_punch = fill_on_punch -techage.liquid.empty_on_punch = empty_on_punch diff --git a/techage/basis/manual.lua b/techage/basis/manual.lua deleted file mode 100644 index d8e599c..0000000 --- a/techage/basis/manual.lua +++ /dev/null @@ -1,91 +0,0 @@ -techage.manual_DE = {} - -techage.manual_DE.aTitel = { - "1,SaferLua Controller with Periphery", - "2,SaferLua Controller", - "3,Central Server", - "3,SaferLua Controller Terminal", -} - -techage.manual_DE.aText = { - "", - - "The SaferLua Controller is a small computer programmable in Lua to control your machinery.\n".. - - "In contrast to the SmartLine Controller this controller allows to implement larger and smarter control and monitoring tasks.\n".. - - "\n".. - - "The controller can be programmed in SaferLua a subset of Lua for safe and secure Lua programs the Minetest server.\n".. - - "\n", - - "The Server node can be placed everywhere. It can also be used for communication purposes between several Controllers.\n".. - - "The Server has a form to enter valid usernames for server access.\n".. - - "\n".. - - "The controller has a menu form with the following tabs:\n".. - - "\n".. - - " - the 'init' tab for the initialization code block\n".. - - " - the 'func' tab for the Lua functions\n".. - - " - the 'loop' tab for the main code block\n".. - - " - the 'outp' tab for debugging outputs via '$print()'\n".. - - " - the 'notes' tab for your code snippets or other notes\n".. - - " - the 'help' tab with information to the available commands\n".. - - "\n".. - - "\n".. - - "The controller needs battery power to work.\n".. - - "\n", - - "The Terminal is used to send command strings to the controller.\n".. - - "In turn\\, the controller can send text strings to the terminal.\n".. - - "The Terminal has a help system for internal commands. Its supports the following commands:\n".. - - "\n".. - - " - 'clear' = clear the screen\n".. - - " - 'help' = output this message\n".. - - " - 'pub' = switch terminal to public use (everybody can enter commands)\n".. - - " - 'priv' = switch terminal to private use (only the owner can enter commands)\n".. - - " - 'send on/off' = send on/off event to e. g. lamps (for testing purposes)\n".. - - " - 'msg ' = send a text message to another Controller (for testing purposes)\n".. - - "\n".. - - "\n", - -} - -techage.manual_DE.aItemName = { - "", - "", - "", - "", -} - -techage.manual_DE.aPlanTable = { - "", - "", - "", - "", -} diff --git a/techage/basis/mark.lua b/techage/basis/mark.lua deleted file mode 100644 index 8058b1f..0000000 --- a/techage/basis/mark.lua +++ /dev/null @@ -1,98 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - mark.lua: - -]]-- - -local marker_region = {} - -function techage.unmark_region(name) - if marker_region[name] ~= nil then --marker already exists - --wip: make the area stay loaded somehow - for _, entity in ipairs(marker_region[name]) do - entity:remove() - end - marker_region[name] = nil - end -end - -function techage.mark_region(name, pos1, pos2, owner, secs) - - if not name or not pos1 or not pos2 then return end - - techage.unmark_region(name) - - local thickness = 0.2 - local sizex, sizey, sizez = (1 + pos2.x - pos1.x) / 2, (1 + pos2.y - pos1.y) / 2, (1 + pos2.z - pos1.z) / 2 - local markers = {} - - --XY plane markers - for _, z in ipairs({pos1.z - 0.5, pos2.z + 0.5}) do - local marker = minetest.add_entity({x=pos1.x + sizex - 0.5, y=pos1.y + sizey - 0.5, z=z}, "techage:region_cube") - if marker ~= nil then - marker:set_properties({ - visual_size={x=sizex * 2, y=sizey * 2}, - --collisionbox = {-sizex, -sizey, -thickness, sizex, sizey, thickness}, - collisionbox = {0,0,0, 0,0,0}, - }) - if owner then - marker:set_nametag_attributes({text = owner}) - end - marker:get_luaentity().player_name = name - table.insert(markers, marker) - end - end - - --YZ plane markers - for _, x in ipairs({pos1.x - 0.5, pos2.x + 0.5}) do - local marker = minetest.add_entity({x=x, y=pos1.y + sizey - 0.5, z=pos1.z + sizez - 0.5}, "techage:region_cube") - if marker ~= nil then - marker:set_properties({ - visual_size={x=sizez * 2, y=sizey * 2}, - --collisionbox = {-thickness, -sizey, -sizez, thickness, sizey, sizez}, - collisionbox = {0,0,0, 0,0,0}, - }) - marker:set_yaw(math.pi / 2) - marker:get_luaentity().player_name = name - table.insert(markers, marker) - end - end - - marker_region[name] = markers - minetest.after(secs or 20, techage.unmark_region, name) -end - -function techage.switch_region(name, pos1, pos2) - if marker_region[name] ~= nil then --marker already exists - techage.unmark_region(name) - else - techage.mark_region(name, pos1, pos2) - end -end - -minetest.register_entity(":techage:region_cube", { - initial_properties = { - visual = "upright_sprite", - textures = {"techage_cube_mark.png"}, - use_texture_alpha = true, - physical = false, - glow = 12, - }, - on_step = function(self, dtime) - if marker_region[self.player_name] == nil then - self.object:remove() - return - end - end, - on_punch = function(self, hitter) - techage.unmark_region(self.player_name) - end, -}) diff --git a/techage/basis/mark2.lua b/techage/basis/mark2.lua deleted file mode 100644 index ab1124e..0000000 --- a/techage/basis/mark2.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - mark.lua: - -]]-- - -local marker_region = {} - -function techage.unmark_position(name) - if marker_region[name] ~= nil then --marker already exists - --wip: make the area stay loaded somehow - for _, entity in ipairs(marker_region[name]) do - entity:remove() - end - marker_region[name] = nil - end -end - -function techage.mark_position(name, pos, nametag, color, time) - local marker = minetest.add_entity(pos, "techage:position_cube") - if marker ~= nil then - marker:set_nametag_attributes({color = color, text = nametag}) - marker:get_luaentity().player_name = name - if not marker_region[name] then - marker_region[name] = {} - end - marker_region[name][#marker_region[name] + 1] = marker - end - minetest.after(time or 30, techage.unmark_position, name) -end - -function techage.mark_cube(name, pos1, pos2, nametag, color, time) - local new_x = pos1.x + ((pos2.x - pos1.x) / 2) - local new_y = pos1.y + ((pos2.y - pos1.y) / 2) - local new_z = pos1.z + ((pos2.z - pos1.z) / 2) - local size_x = math.abs(pos1.x - pos2.x) + 1 - local size_y = math.abs(pos1.y - pos2.y) + 1 - local size_z = math.abs(pos1.z - pos2.z) + 1 - - local marker = minetest.add_entity( - {x = new_x, y = new_y, z = new_z}, "techage:position_cube") - if marker ~= nil then - marker:set_nametag_attributes({color = color, text = nametag, visual_size = {x = size_x, y = size_y, z = size_z}}) - marker:get_luaentity().player_name = name - marker:set_properties({visual_size = {x = size_x, y = size_y, z = size_z}}) - if not marker_region[name] then - marker_region[name] = {} - end - marker_region[name][#marker_region[name] + 1] = marker - end - minetest.after(time or 30, techage.unmark_position, name) -end - -minetest.register_entity(":techage:position_cube", { - initial_properties = { - visual = "cube", - textures = { - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - }, - use_texture_alpha = true, - physical = false, - visual_size = {x = 1.1, y = 1.1}, - collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, - glow = 8, - }, - on_step = function(self, dtime) - if marker_region[self.player_name] == nil then - self.object:remove() - return - end - end, - on_punch = function(self, hitter) - techage.unmark_position(self.player_name) - end, -}) - -function techage.mark_side(name, pos, dir, nametag, color, time) - local v = vector.multiply(tubelib2.Dir6dToVector[dir or 0], 0.7) - local pos2 = vector.add(pos, v) - - local marker = minetest.add_entity(pos2, "techage:position_side") - if marker ~= nil then - marker:set_nametag_attributes({color = color, text = nametag}) - marker:get_luaentity().player_name = name - if dir == 2 or dir == 4 then - marker:setyaw(math.pi / 2) - end - - if not marker_region[name] then - marker_region[name] = {} - end - marker_region[name][#marker_region[name] + 1] = marker - end - minetest.after(time or 30, techage.unmark_position, name) -end - -minetest.register_entity(":techage:position_side", { - initial_properties = { - visual = "upright_sprite", - textures = {"techage_side_mark.png"}, - physical = false, - visual_size = {x = 1.1, y = 1.1, z = 1.1}, - collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, - glow = 12, - }, - on_step = function(self, dtime) - if marker_region[self.player_name] == nil then - self.object:remove() - return - end - end, - on_punch = function(self, hitter) - techage.unmark_position(self.player_name) - end, -}) diff --git a/techage/basis/mark_lib.lua b/techage/basis/mark_lib.lua deleted file mode 100644 index 40dee56..0000000 --- a/techage/basis/mark_lib.lua +++ /dev/null @@ -1,130 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Block marker lib for door/move/fly controller - -]]-- - -local MAX_NUM = 128 -local marker = {} - -local MarkedNodes = {} -- t[player] = {{entity, pos},...} -local MaxNumber = {} -local CurrentPos -- to mark punched entities - -local function unmark_position(name, pos) - pos = vector.round(pos) - for idx,item in ipairs(MarkedNodes[name] or {}) do - if vector.equals(pos, item.pos) then - item.entity:remove() - table.remove(MarkedNodes[name], idx) - CurrentPos = pos - return - end - end -end - -function marker.unmark_all(name) - for _,item in ipairs(MarkedNodes[name] or {}) do - item.entity:remove() - end - MarkedNodes[name] = nil -end - -local function mark_position(name, pos) - pos = vector.round(pos) - if not CurrentPos or not vector.equals(pos, CurrentPos) then -- entity not punched? - if #MarkedNodes[name] < MaxNumber[name] then - local entity = minetest.add_entity(pos, "techage:block_marker") - if entity ~= nil then - entity:get_luaentity().player_name = name - table.insert(MarkedNodes[name], {pos = pos, entity = entity}) - end - CurrentPos = nil - return true - end - end - CurrentPos = nil -end - -function marker.get_poslist(name) - local idx = 0 - local lst = {} - for _,item in ipairs(MarkedNodes[name] or {}) do - table.insert(lst, item.pos) - idx = idx + 1 - if idx >= MAX_NUM then break end - end - return lst -end - -minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) - if puncher and puncher:is_player() then - local name = puncher:get_player_name() - - if not MarkedNodes[name] then - return - end - - mark_position(name, pointed_thing.under) - end -end) - -function marker.start(name, max_num) - MaxNumber[name] = max_num or 99 - MarkedNodes[name] = {} -end - -function marker.stop(name) - MarkedNodes[name] = nil - MaxNumber[name] = nil -end - -minetest.register_on_leaveplayer(function(ObjectRef, timed_out) - if ObjectRef and ObjectRef:is_player() then - local name = ObjectRef:get_player_name() - marker.unmark_all(name) - end -end) - - -minetest.register_entity(":techage:block_marker", { - initial_properties = { - visual = "cube", - textures = { - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - }, - physical = false, - visual_size = {x=1.1, y=1.1}, - collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, - glow = 8, - }, - on_step = function(self, dtime) - self.ttl = (self.ttl or 2400) - 1 - if self.ttl <= 0 then - local pos = self.object:get_pos() - unmark_position(self.player_name, pos) - end - end, - on_punch = function(self, hitter) - local pos = self.object:get_pos() - local name = hitter:get_player_name() - if name == self.player_name then - unmark_position(name, pos) - end - end, -}) - -return marker diff --git a/techage/basis/node_states.lua b/techage/basis/node_states.lua deleted file mode 100644 index ac7373f..0000000 --- a/techage/basis/node_states.lua +++ /dev/null @@ -1,561 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - A state model/class for TechAge nodes. - -]]-- - - ---[[ - -Node states: - - +-----------------------------------+ +------------+ - | | | | - | V V | - | +---------+ | - | | | | - | +---------| STOPPED | | - | | | | | - | button | +---------+ | - | | ^ | - button | V | button | - | +---------+ | | button - | +--------->| |---------+ | - | | power | RUNNING | | - | | +------| |---------+ | - | | | +---------+ | | - | | | ^ | | | - | | | | | | | - | | V | V V | - | +---------+ +----------+ +---------+ | - | | | | | | | | - +---| NOPOWER | | STANDBY/ | | FAULT |----------+ - | | | BLOCKED | | | - +---------+ +----------+ +---------+ - - - | cycle time operational needs power - +---------+------------+-------------+------------- - | RUNNING normal yes yes - | BLOCKED long yes no - | STANDBY long yes no - | NOPOWER long no no - | FAULT none no no - | STOPPED none no no - -Node nvm data: - "techage_state" - node state, like "RUNNING" - "techage_countdown" - countdown to standby mode -]]-- - --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local P = minetest.string_to_pos -local M = minetest.get_meta -local N = techage.get_node_lvm - -local MAX_CYCLE_TIME = 20 - --- --- TechAge machine states --- - -techage.RUNNING = 1 -- in normal operation/turned on -techage.BLOCKED = 2 -- a pushing node is blocked due to a full destination inventory -techage.STANDBY = 3 -- nothing to do (e.g. no input items), or node (world) not loaded -techage.NOPOWER = 4 -- only for power consuming nodes, no operation -techage.FAULT = 5 -- any fault state (e.g. wrong source items), which can be fixed by the player -techage.STOPPED = 6 -- not operational/turned off -techage.UNLOADED = 7 -- Map block unloaded -techage.INACTIVE = 8 -- Map block loaded but node is not actively working - -techage.StatesImg = { - "techage_inv_button_on.png", - "techage_inv_button_warning.png", - "techage_inv_button_standby.png", - "techage_inv_button_nopower.png", - "techage_inv_button_error.png", - "techage_inv_button_off.png", -} - -local function error(pos, msg) - minetest.log("error", "[TA states] "..msg.." at "..S(pos).." "..N(pos).name) -end - --- Return state button image for the node inventory -function techage.state_button(state) - if state and state < 7 and state > 0 then - return techage.StatesImg[state] - end - return "techage_inv_button_off.png" -end - -function techage.get_power_image(pos, nvm) - local node = techage.get_node_lvm(pos) - local s = "3" -- electrical power - if string.find(node.name, "techage:ta2") then - s = "2" -- axles power - end - return "techage_inv_powerT"..s..".png" -end - --- State string based on button states -techage.StateStrings = {"running", "blocked", "standby", "nopower", "fault", "stopped"} - --- --- Local States --- -local RUNNING = techage.RUNNING -local BLOCKED = techage.BLOCKED -local STANDBY = techage.STANDBY -local NOPOWER = techage.NOPOWER -local FAULT = techage.FAULT -local STOPPED = techage.STOPPED - - --- --- NodeStates Class Functions --- -techage.NodeStates = {} -local NodeStates = techage.NodeStates - -local function can_start(pos, nvm) - --if false, node goes in FAULT - return true -end - -local function has_power(pos, nvm) - --if false, node goes in NOPOWER - return true -end - -local function swap_node(pos, new_name, old_name) - local node = techage.get_node_lvm(pos) - if node.name == new_name then - return - end - if node.name == old_name then - node.name = new_name - minetest.swap_node(pos, node) - end -end - --- true if node_timer should be executed -function techage.is_operational(nvm) - local state = nvm.techage_state or STOPPED - return state < NOPOWER -end - -function techage.is_running(nvm) - return (nvm.techage_state or STOPPED) == RUNNING -end - --- consumes power -function techage.needs_power(nvm) - local state = nvm.techage_state or STOPPED - return state == RUNNING or state == NOPOWER -end - --- consumes power -function techage.needs_power2(state) - state = state or STOPPED - return state == RUNNING or state == NOPOWER -end - -function techage.get_state_string(nvm) - return techage.StateStrings[nvm.techage_state or STOPPED] -end - -function NodeStates:new(attr) - local o = { - -- mandatory - cycle_time = attr.cycle_time, -- for running state - standby_ticks = attr.standby_ticks, -- for standby state - -- optional - countdown_ticks = attr.countdown_ticks or 1, - node_name_passive = attr.node_name_passive, - node_name_active = attr.node_name_active, - infotext_name = attr.infotext_name, - has_power = attr.has_power or has_power, - can_start = attr.can_start or can_start, - start_node = attr.start_node, - stop_node = attr.stop_node, - formspec_func = attr.formspec_func, - on_state_change = attr.on_state_change, - quick_start = attr.quick_start, - } - setmetatable(o, self) - self.__index = self - return o -end - -function NodeStates:node_init(pos, nvm, number) - nvm.techage_state = STOPPED - M(pos):set_string("node_number", number) - if self.infotext_name then - M(pos):set_string("infotext", self.infotext_name.." "..number..": stopped") - end - if self.formspec_func then - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end -end - --- to be used to re-start the timer outside of node_timer() -local function start_timer_delayed(pos, cycle_time) - local t = minetest.get_node_timer(pos) - t:stop() - if cycle_time > 0.9 then - minetest.after(0.1, t.start, t, cycle_time) - else - error(pos, "invalid cycle_time") - end -end - -function NodeStates:stop(pos, nvm) - local state = nvm.techage_state or STOPPED - nvm.techage_state = STOPPED - if self.stop_node then - self.stop_node(pos, nvm, state) - end - if self.node_name_passive then - swap_node(pos, self.node_name_passive, self.node_name_active) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": stopped") - end - if self.formspec_func then - nvm.ta_state_tooltip = "stopped" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if self.on_state_change then - self.on_state_change(pos, state, STOPPED) - end - if minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):stop() - end - return true -end - -function NodeStates:start(pos, nvm) - local state = nvm.techage_state or STOPPED - if state ~= RUNNING and state ~= FAULT then - local res = self.can_start(pos, nvm, state) - if res ~= true then - self:fault(pos, nvm, res) - return false - end - if not self.has_power(pos, nvm, state) then - self:nopower(pos, nvm) - return false - end - nvm.techage_state = RUNNING - if self.start_node then - self.start_node(pos, nvm, state) - end - nvm.techage_countdown = self.countdown_ticks - if self.node_name_active then - swap_node(pos, self.node_name_active, self.node_name_passive) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": running") - end - if self.formspec_func then - nvm.ta_state_tooltip = "running" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):stop() - end - if self.on_state_change then - self.on_state_change(pos, state, RUNNING) - end - start_timer_delayed(pos, self.cycle_time) - - if self.quick_start and state == STOPPED then - self.quick_start(pos, 0) - end - self:trigger_state(pos, nvm) - return true - end - return false -end - -function NodeStates:standby(pos, nvm, err_string) - local state = nvm.techage_state or STOPPED - if state == RUNNING or state == BLOCKED then - nvm.techage_state = STANDBY - if self.node_name_passive then - swap_node(pos, self.node_name_passive, self.node_name_active) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": "..(err_string or "standby")) - end - if self.formspec_func then - nvm.ta_state_tooltip = err_string or "standby" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if self.on_state_change then - self.on_state_change(pos, state, STANDBY) - end - start_timer_delayed(pos, self.cycle_time * self.standby_ticks) - return true - end - return false -end - --- special case of standby for pushing nodes -function NodeStates:blocked(pos, nvm, err_string) - local state = nvm.techage_state or STOPPED - if state == RUNNING then - nvm.techage_state = BLOCKED - if self.node_name_passive then - swap_node(pos, self.node_name_passive, self.node_name_active) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": "..(err_string or "blocked")) - end - if self.formspec_func then - nvm.ta_state_tooltip = err_string or "blocked" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if self.on_state_change then - self.on_state_change(pos, state, BLOCKED) - end - start_timer_delayed(pos, self.cycle_time * self.standby_ticks) - return true - end - return false -end - -function NodeStates:nopower(pos, nvm, err_string) - local state = nvm.techage_state or RUNNING - if state ~= NOPOWER then - nvm.techage_state = NOPOWER - if self.node_name_passive then - swap_node(pos, self.node_name_passive, self.node_name_active) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": "..(err_string or "no power")) - end - if self.formspec_func then - nvm.ta_state_tooltip = err_string or "no power" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if self.on_state_change then - self.on_state_change(pos, state, NOPOWER) - end - start_timer_delayed(pos, self.cycle_time * self.standby_ticks) - return true - end - return false -end - -function NodeStates:fault(pos, nvm, err_string) - local state = nvm.techage_state or STOPPED - err_string = err_string or "fault" - if state == RUNNING or state == STOPPED then - nvm.techage_state = FAULT - if self.node_name_passive then - swap_node(pos, self.node_name_passive, self.node_name_active) - end - if self.infotext_name then - local number = M(pos):get_string("node_number") - M(pos):set_string("infotext", self.infotext_name.." "..number..": "..err_string) - end - if self.formspec_func then - nvm.ta_state_tooltip = err_string or "fault" - M(pos):set_string("formspec", self.formspec_func(self, pos, nvm)) - end - if self.on_state_change then - self.on_state_change(pos, state, FAULT) - end - minetest.get_node_timer(pos):stop() - return true - end - return false -end - -function NodeStates:get_state(nvm) - return nvm.techage_state or techage.STOPPED -end - --- keep the timer running? -function NodeStates:is_active(nvm) - local state = nvm.techage_state or STOPPED - return state < FAULT -end - -function NodeStates:start_if_standby(pos) - local nvm = techage.get_nvm(pos) - if nvm.techage_state == STANDBY then - self:start(pos, nvm) - end -end - --- To be called if node is idle. --- If countdown reaches zero, the node is set to STANDBY. -function NodeStates:idle(pos, nvm) - local countdown = (nvm.techage_countdown or 0) - 1 - nvm.techage_countdown = countdown - if countdown <= 0 then - self:standby(pos, nvm) - end -end - --- To be called after successful node action to raise the timer --- and keep the node in state RUNNING -function NodeStates:keep_running(pos, nvm, val) - -- set to RUNNING if not already done - if nvm.techage_state ~= RUNNING then - self:start(pos, nvm) - end - nvm.techage_countdown = val or 4 - nvm.last_active = minetest.get_gametime() -end - -function NodeStates:trigger_state(pos, nvm) - nvm.last_active = minetest.get_gametime() -end - --- Start/stop node based on button events. --- if function returns false, no button was pressed -function NodeStates:state_button_event(pos, nvm, fields) - if fields.state_button ~= nil then - local state = nvm.techage_state or STOPPED - if state == STOPPED or state == STANDBY or state == BLOCKED then - if not self:start(pos, nvm) and (state == STANDBY or state == BLOCKED) then - self:stop(pos, nvm) - end - elseif state == RUNNING or state == FAULT or state == NOPOWER then - self:stop(pos, nvm) - end - return true - end - return false -end - -function NodeStates:get_state_button_image(nvm) - local state = nvm.techage_state or STOPPED - return techage.state_button(state) -end - -function NodeStates:get_state_tooltip(nvm) - local tp = nvm.ta_state_tooltip or "" - return tp..";#0C3D32;#FFFFFF" -end - --- command interface -function NodeStates:on_receive_message(pos, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "on" then - self:start(pos, techage.get_nvm(pos)) - return true - elseif topic == "off" then - self:stop(pos, techage.get_nvm(pos)) - return true - elseif topic == "state" then - local node = minetest.get_node(pos) - if node.name == "ignore" then -- unloaded node? - return "unloaded" - elseif nvm.techage_state == RUNNING then - local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME - if ttl < minetest.get_gametime() then - return "inactive" - end - end - return techage.get_state_string(techage.get_nvm(pos)) - elseif topic == "fuel" then - return techage.fuel.get_fuel_amount(nvm) - elseif topic == "load" then - return techage.liquid.get_liquid_amount(nvm) - else - return "unsupported" - end -end - -function NodeStates:on_beduino_receive_cmnd(pos, topic, payload) - if topic == 1 then - if payload[1] == 0 then - self:stop(pos, techage.get_nvm(pos)) - return 0 - else - self:start(pos, techage.get_nvm(pos)) - return 0 - end - else - return 2 -- unknown or invalid topic - end -end - -function NodeStates:on_beduino_request_data(pos, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then - local node = minetest.get_node(pos) - if node.name == "ignore" then -- unloaded node? - return 0, {techage.UNLOADED} - elseif nvm.techage_state == RUNNING then - local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME - if ttl < minetest.get_gametime() then - return 0, {techage.INACTIVE} - end - end - return 0, {nvm.techage_state or STOPPED} - else - return 2, "" -- topic is unknown or invalid - end -end - -function NodeStates.get_beduino_state(pos) - local node = minetest.get_node(pos) - local nvm = techage.get_nvm(pos) - if node.name == "ignore" then -- unloaded node? - return 0, {techage.UNLOADED} - elseif nvm.techage_state == RUNNING then - local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME - if ttl < minetest.get_gametime() then - return 0, {techage.INACTIVE} - end - end - return 0, {nvm.techage_state or STOPPED} -end - --- restart timer -function NodeStates:on_node_load(pos) - local nvm = techage.get_nvm(pos) - local state = nvm.techage_state or STOPPED - if state == RUNNING then - minetest.get_node_timer(pos):start(self.cycle_time) - elseif state < FAULT then - minetest.get_node_timer(pos):start(self.cycle_time * self.standby_ticks) - end -end - -minetest.register_node("techage:defect_dummy", { - description = "Corrupted Node (to be replaced)", - tiles = { - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_defect.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_defect.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_defect.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_defect.png", - }, - drop = "", - groups = {cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1}, - is_ground_content = false, -}) diff --git a/techage/basis/node_store.lua b/techage/basis/node_store.lua deleted file mode 100644 index 9e823e2..0000000 --- a/techage/basis/node_store.lua +++ /dev/null @@ -1,183 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Data storage system for node related volatile and non-volatile data. - Non-volatile data is stored from time to time and at shutdown. - Volatile data is lost at every shutdown. - -]]-- - -local NvmStore = {} -- non-volatile data cache -local MemStore = {} -- volatile data cache - -local N = function(pos) print(minetest.pos_to_string(pos), minetest.get_node(pos).name) end - -------------------------------------------------------------------- --- Backend -------------------------------------------------------------------- -local MP = minetest.get_modpath("techage") -local techage_use_sqlite = minetest.settings:get_bool('techage_use_sqlite', false) -local backend - -if techage_use_sqlite then - backend = dofile(MP .. "/basis/nodedata_sqlite.lua") -else - backend = dofile(MP .. "/basis/nodedata_meta.lua") -end - --- return keys for mapblock and inner-mapblock addressing based on the node position -local function get_keys(pos) - local kx1, kx2 = math.floor(pos.x / 16) + 2048, pos.x % 16 - local ky1, ky2 = math.floor(pos.y / 16) + 2048, pos.y % 16 - local kz1, kz2 = math.floor(pos.z / 16) + 2048, pos.z % 16 - return kx1 * 4096 * 4096 + ky1 * 4096 + kz1, kx2 * 16 * 16 + ky2 * 16 + kz2 -end - -local function pos_from_key(key1, key2) - - local x1 = (math.floor(key1 / (4096 * 4096)) - 2048) * 16 - local y1 = ((math.floor(key1 / 4096) % 4096) - 2048) * 16 - local z1 = ((key1 % 4096) - 2048) * 16 - local x2 = math.floor(key2 / (16 * 16)) - local y2 = math.floor(key2 / 16) % 16 - local z2 = key2 % 16 - - return {x = x1 + x2, y = y1 + y2, z = z1 + z2} -end - -local function debug(key1, item) - --local pos1 = pos_from_key(key1, 0) - --local pos2 = {x = pos1.x + 15, y = pos1.y + 15, z = pos1.z + 15} - --techage.mark_region("mapblock", pos1, pos2, "singleplayer", 5) - - local cnt = 0 - for key2, tbl in pairs(item) do - if key2 ~= "in_use" then - cnt = cnt + 1 - --N(pos_from_key(key1, key2)) - end - end - print("mapblock", string.format("%09X", key1), cnt.." nodes") -end - - -------------------------------------------------------------------- --- Storage scheduler -------------------------------------------------------------------- -local CYCLE_TIME = 600 -- store data every 10 min -local JobQueue = {} -local first = 0 -local last = -1 -local SystemTime = 0 - -local function push(key) - last = last + 1 - JobQueue[last] = {key = key, time = SystemTime + CYCLE_TIME} -end - -local function pop() - if first > last then return end - local item = JobQueue[first] - if item.time <= SystemTime then - JobQueue[first] = nil -- to allow garbage collection - first = first + 1 - return item.key - end -end - --- check every 100 msec if any data has to be stored -minetest.register_globalstep(function(dtime) - SystemTime = SystemTime + dtime - local key = pop() - if key and NvmStore[key] then --- minetest.log("warning", --- string.format("[TA Storage] SystemTime = %.3f, #JobQueue = %d, in_use = %s", --- SystemTime, last - first, NvmStore[key].in_use)) - local t = minetest.get_us_time() - if NvmStore[key].in_use then - NvmStore[key].in_use = nil - backend.store_mapblock_data(key, NvmStore[key]) - push(key) - else - NvmStore[key] = nil -- remove unused data from cache - end - t = minetest.get_us_time() - t - if t > 20000 then - minetest.log("warning", "[TA Storage] duration = "..(t/1000.0).." ms") - end - end -end) - -------------------------------------------------------------------- --- Store/Restore NVM data -------------------------------------------------------------------- -NvmStore = backend.restore_at_startup() - -minetest.register_on_shutdown(function() - backend.freeze_at_shutdown(NvmStore) -end) - -------------------------------------------------------------------- --- API functions -------------------------------------------------------------------- --- Returns volatile node data as table -function techage.get_mem(pos) - local hash = minetest.hash_node_position(pos) - if not MemStore[hash] then - MemStore[hash] = {} - end - return MemStore[hash] -end - --- Returns non-volatile node data as table -function techage.get_nvm(pos) - local key1, key2 = get_keys(pos) - - if not NvmStore[key1] then - NvmStore[key1] = backend.get_mapblock_data(key1) - push(key1) - end - - local block = NvmStore[key1] - block.in_use = true - if not block[key2] then - block[key2] = backend.get_node_data(pos) - end - return block[key2] -end - --- Returns true/false -function techage.has_nvm(pos) - local key1, key2 = get_keys(pos) - - if not NvmStore[key1] then - NvmStore[key1] = backend.get_mapblock_data(key1) - push(key1) - end - - return NvmStore[key1][key2] ~= nil -end - -function techage.peek_nvm(pos) - local key1, key2 = get_keys(pos) - local block = NvmStore[key1] or {} - return block[key2] or {} -end - --- To be called when a node is removed -function techage.del_mem(pos) - local hash = minetest.hash_node_position(pos) - MemStore[hash] = nil - - local key1, key2 = get_keys(pos) - NvmStore[key1] = NvmStore[key1] or backend.get_mapblock_data(key1) - NvmStore[key1][key2] = nil - backend.store_mapblock_data(key1, NvmStore[key1]) -end diff --git a/techage/basis/nodedata_meta.lua b/techage/basis/nodedata_meta.lua deleted file mode 100644 index 7141a41..0000000 --- a/techage/basis/nodedata_meta.lua +++ /dev/null @@ -1,103 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Storage backend for node related data as node metadata - -]]-- - --- for lazy programmers -local M = minetest.get_meta - -local storage = techage.storage - -------------------------------------------------------------------- --- Marshaling -------------------------------------------------------------------- -local use_marshal = minetest.settings:get_bool('techage_use_marshal', false) -local MAR_MAGIC = 0x8e - --- default functions -local serialize = minetest.serialize -local deserialize = minetest.deserialize - -if use_marshal then - if not techage.IE then - error("Please add 'secure.trusted_mods = techage' to minetest.conf!") - end - local marshal = techage.IE.require("marshal") - if not marshal then - error("Please install marshal via 'luarocks install lua-marshal'") - end - - serialize = marshal.encode - - deserialize = function(s) - if s ~= "" then - if s:byte(1) == MAR_MAGIC then - return marshal.decode(s) - else - return minetest.deserialize(s) - end - end - end -end - -------------------------------------------------------------------- --- API functions -------------------------------------------------------------------- -local api = {} - -function api.get_mapblock_data(key) - return {} -end - -function api.store_mapblock_data(key, mapblock_data) - for key, item in pairs(mapblock_data) do - if key ~= "in_use" then - local pos = item and item._POS_ - if pos then - item._POS_ = nil - local data = serialize(item) - item._POS_ = pos - local meta = M(pos) - meta:set_string("ta_data", data) - meta:mark_as_private("ta_data") - end - end - end -end - -function api.get_node_data(pos) - local tbl = {} - local s = M(pos):get_string("ta_data") - - if s ~= "" then - tbl = deserialize(s) or {} - end - tbl._POS_ = table.copy(pos) - - return tbl -end - --- Meta data can't be written reliable at shutdown, --- so we have to store/restore the data differently -function api.freeze_at_shutdown(data) - storage:set_string("shutdown_nodedata", serialize(data)) -end - -function api.restore_at_startup() - local s = storage:get_string("shutdown_nodedata") - if s ~= "" then - return deserialize(s) or {} - end - return {} -end - -return api diff --git a/techage/basis/nodedata_sqlite.lua b/techage/basis/nodedata_sqlite.lua deleted file mode 100644 index 8540365..0000000 --- a/techage/basis/nodedata_sqlite.lua +++ /dev/null @@ -1,123 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Storage backend for node related data via sqlite database - -]]-- - --- for lazy programmers -local M = minetest.get_meta - -------------------------------------------------------------------- --- Database -------------------------------------------------------------------- -local MN = minetest.get_current_modname() -local WP = minetest.get_worldpath() -local use_marshal = minetest.settings:get_bool('techage_use_marshal', false) -local MAR_MAGIC = 0x8e - -if not techage.IE then - error("Please add 'secure.trusted_mods = techage' to minetest.conf!") -end - -local sqlite3 = techage.IE.require("lsqlite3") -local marshal = techage.IE.require("marshal") - -if not sqlite3 then - error("Please install sqlite3 via 'luarocks install lsqlite3'") -end -if not marshal then - error("Please install marshal via 'luarocks install lua-marshal'") -end - -local db = sqlite3.open(WP.."/techage_nodedata.sqlite") -local ROW = sqlite3.ROW - --- Prevent use of this db instance. -if sqlite3 then sqlite3 = nil end - -db:exec[[ - CREATE TABLE mapblocks(id INTEGER PRIMARY KEY, key INTEGER, data BLOB); - CREATE UNIQUE INDEX idx ON mapblocks(key); -]] - -local set = db:prepare("INSERT or REPLACE INTO mapblocks VALUES(NULL, ?, ?);") -local get = db:prepare("SELECT * FROM mapblocks WHERE key=?;") - -local function set_block(key, data) - set:reset() - set:bind(1, key) - set:bind_blob(2, data) - set:step() -end - -local function get_block(key) - get:reset() - get:bind(1, key) - if get:step() == ROW then - return get:get_value(2) - end -end - -------------------------------------------------------------------- --- API functions -------------------------------------------------------------------- -local api = {} - -function api.store_mapblock_data(key, mapblock_data) - if use_marshal and mapblock_data then - local data = marshal.encode(mapblock_data) - if data then - set_block(key, data) - end - else - set_block(key, minetest.serialize(mapblock_data)) - end -end - -function api.get_mapblock_data(key) - local s = get_block(key) - if s then - if s:byte(1) == MAR_MAGIC then - return marshal.decode(s) - else - return minetest.deserialize(s) - end - end - api.store_mapblock_data(key, {}) - return {} -end - -function api.get_node_data(pos) - -- legacy data available? - local s = M(pos):get_string("ta_data") - if s ~= "" then - M(pos):set_string("ta_data", "") - if s:byte(1) == MAR_MAGIC then - return marshal.decode(s) - else - return minetest.deserialize(s) - end - end - return {} -end - -function api.freeze_at_shutdown(data) - for key, item in pairs(data) do - api.store_mapblock_data(key, item) - end -end - -function api.restore_at_startup() - -- nothing to restore - return {} -end - -return api diff --git a/techage/basis/numbers_sqlite.lua b/techage/basis/numbers_sqlite.lua deleted file mode 100644 index f2f8be8..0000000 --- a/techage/basis/numbers_sqlite.lua +++ /dev/null @@ -1,142 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Storage backend for node number mapping via sqlite database - -]]-- - --- for lazy programmers -local M = minetest.get_meta - -local storage = techage.storage - -------------------------------------------------------------------- --- Database -------------------------------------------------------------------- -local MN = minetest.get_current_modname() -local WP = minetest.get_worldpath() -local MAR_MAGIC = 0x8e - -if not techage.IE then - error("Please add 'secure.trusted_mods = techage' to minetest.conf!") -end - -local sqlite3 = techage.IE.require("lsqlite3") -local marshal = techage.IE.require("marshal") - -if not sqlite3 then - error("Please install sqlite3 via 'luarocks install lsqlite3'") -end -if not marshal then - error("Please install marshal via 'luarocks install lua-marshal'") -end - -local db = sqlite3.open(WP.."/techage_numbers.sqlite") -local ROW = sqlite3.ROW - --- Prevent use of this db instance. -if sqlite3 then sqlite3 = nil end - -db:exec[[ - CREATE TABLE numbers(id INTEGER PRIMARY KEY, number INTEGER, x INTEGER, y INTEGER, z INTEGER); - CREATE UNIQUE INDEX idx ON numbers(number); -]] - -local set = db:prepare("INSERT or REPLACE INTO numbers VALUES(NULL, ?, ?, ?, ?);") -local get = db:prepare("SELECT * FROM numbers WHERE number=?;") - -local function set_block(number, pos) - set:reset() - set:bind(1, number) - set:bind(2, pos.x) - set:bind(3, pos.y) - set:bind(4, pos.z) - set:step() - return true -end - -local function get_block(number) - get:reset() - get:bind(1, number) - if get:step() == ROW then - return {x = get:get_value(2), y = get:get_value(3), z = get:get_value(4)} - end -end - -local function del_block(number) - db:exec("DELETE FROM numbers WHERE number="..number..";") -end - -------------------------------------------------------------------- --- Migration from mod storage -------------------------------------------------------------------- -local Version = storage:get_int("Version") or 0 -local NextNumber = 0 - -if Version == 0 then - Version = 4 -end -if Version == 3 then - Version = 4 - NextNumber = storage:get_int("NextNumber") - for i = 1, NextNumber do - local number = tostring(i) - if storage:contains(number) then - local pos = minetest.string_to_pos(storage:get_string(number)) - set_block(number, pos) - storage:set_string(number, "") - end - end -elseif Version == 4 then - NextNumber = storage:get_int("NextNumber") -else - error("[] Invalid version number for 'number to pos mapping' table!") -end - - -------------------------------------------------------------------- --- API functions -------------------------------------------------------------------- -local api = {} - -function api.get_nodepos(number) - return get_block(number) -end - -function api.set_nodepos(number, pos) - set_block(number, pos) -end - -function api.add_nodepos(pos) - local num = tostring(NextNumber) - NextNumber = NextNumber + 1 - storage:set_int("NextNumber", NextNumber) - set_block(num, pos) - return num -end - -function api.del_nodepos(number) - del_block(number) -end - --- delete invalid entries -function api.delete_invalid_entries(node_def) - minetest.log("info", "[TechAge] Data maintenance started") - for id, num, x, y, z in db:urows('SELECT * FROM numbers') do - local pos = {x = x, y = y, z = z} - local name = techage.get_node_lvm(pos).name - if not node_def[name] then - del_block(num) - end - end - minetest.log("info", "[TechAge] Data maintenance finished") -end - -return api diff --git a/techage/basis/numbers_storage.lua b/techage/basis/numbers_storage.lua deleted file mode 100644 index 02219b1..0000000 --- a/techage/basis/numbers_storage.lua +++ /dev/null @@ -1,98 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Storage backend for node number mapping via mod storage - -]]-- - -local backend = {} -local storage = techage.storage - --- legacy method -local function deserialize(s) - local tbl = {} - for line in s:gmatch("[^;]+") do - local num, spos = unpack(string.split(line, "=")) - tbl[num] = minetest.string_to_pos(spos) - end - return tbl -end - - -local Version = minetest.deserialize(storage:get_string("Version")) or 3 -local NextNumber = 0 - -if Version == 1 then - Version = 3 - local tbl = minetest.deserialize(storage:get_string("Number2Pos")) or {} - NextNumber = minetest.deserialize(storage:get_string("NextNumber")) or 1 - for num, pos in pairs(tbl) do - storage:set_string(num, minetest.pos_to_string(pos)) - end - storage:set_string("Number2Pos", "") -elseif Version == 2 then - Version = 3 - NextNumber = minetest.deserialize(storage:get_string("NextNumber")) or 1 - local tbl = deserialize(storage:get_string("Number2Pos")) - for num, pos in pairs(tbl) do - storage:set_string(num, minetest.pos_to_string(pos)) - end - storage:set_string("Number2Pos", "") -else - Version = 3 - NextNumber = storage:get_int("NextNumber") -end - -storage:set_int("NextNumber", NextNumber) -storage:set_int("Version", Version) - - -------------------------------------------------------------------- --- API functions -------------------------------------------------------------------- -function backend.get_nodepos(number) - return minetest.string_to_pos(storage:get_string(number)) -end - -function backend.set_nodepos(number, pos) - storage:set_string(number, minetest.pos_to_string(pos)) -end - -function backend.add_nodepos(pos) - local num = tostring(NextNumber) - NextNumber = NextNumber + 1 - storage:set_int("NextNumber", NextNumber) - storage:set_string(num, minetest.pos_to_string(pos)) - return num -end - -function backend.del_nodepos(number) - storage:set_string(number, "") -end - --- delete invalid entries -function backend.delete_invalid_entries(node_def) - minetest.log("info", "[TechAge] Data maintenance started") - for i = 1, NextNumber do - local number = tostring(i) - if storage:contains(number) then - local pos = backend.get_nodepos(number) - local name = techage.get_node_lvm(pos).name - if not node_def[name] then - backend.del_nodepos(number) - else - minetest.get_meta(pos):set_string("node_number", number) - end - end - end - minetest.log("info", "[TechAge] Data maintenance finished") -end - -return backend diff --git a/techage/basis/oggfiles.lua b/techage/basis/oggfiles.lua deleted file mode 100644 index ffe7c82..0000000 --- a/techage/basis/oggfiles.lua +++ /dev/null @@ -1,103 +0,0 @@ -techage.OggFileList = { - "autobahn_motor", -- ./mods/autobahn/sounds - "signs_bot_ping", -- ./mods/signs_bot/sounds - "signs_bot_go_away", -- ./mods/signs_bot/sounds - "signs_bot_step", -- ./mods/signs_bot/sounds - "signs_bot_pong", -- ./mods/signs_bot/sounds - "signs_bot_error", -- ./mods/signs_bot/sounds - "normal2", -- ./mods/hyperloop/sounds - "up2", -- ./mods/hyperloop/sounds - "down2", -- ./mods/hyperloop/sounds - "ele_norm", -- ./mods/hyperloop/sounds - "door", -- ./mods/hyperloop/sounds - "hyperloop_crowbar", -- ./mods/hyperloop/sounds - "ele_door", -- ./mods/hyperloop/sounds - "techage_watermill", -- ./mods/techage/sounds - "techage_button", -- ./mods/techage/sounds - "techage_steamengine", -- ./mods/techage/sounds - "techage_generator", -- ./mods/techage/sounds - "techage_gasflare", -- ./mods/techage/sounds - "techage_explore", -- ./mods/techage/sounds - "techage_mill", -- ./mods/techage/sounds - "techage_reactor", -- ./mods/techage/sounds - "techage_valve", -- ./mods/techage/sounds - "techage_oildrill", -- ./mods/techage/sounds - "techage_turbine", -- ./mods/techage/sounds - "techage_booster", -- ./mods/techage/sounds - "techage_quarry", -- ./mods/techage/sounds - "techage_reboiler", -- ./mods/techage/sounds - "jetpack_loop", -- ./mods/jetpack/sounds - "paperflip1", -- ./mods/unified_inventory/sounds - "teleport", -- ./mods/unified_inventory/sounds - "electricity", -- ./mods/unified_inventory/sounds - "owl", -- ./mods/unified_inventory/sounds - "click", -- ./mods/unified_inventory/sounds - "birds", -- ./mods/unified_inventory/sounds - "paperflip2", -- ./mods/unified_inventory/sounds - "dingdong", -- ./mods/unified_inventory/sounds - "trash", -- ./mods/unified_inventory/sounds - "trash_all", -- ./mods/unified_inventory/sounds - "ta4_jetpack", -- ./mods/ta4_jetpack/sounds - "ta4_jetpack_alarm", -- ./mods/ta4_jetpack/sounds - "ta4_jetpack_on", -- ./mods/ta4_jetpack/sounds - "player_damage", -- ./games/minetest_game/mods/player_api/sounds - "env_sounds_water", -- ./games/minetest_game/mods/env_sounds/sounds - "env_sounds_lava", -- ./games/minetest_game/mods/env_sounds/sounds - "doors_door_close", -- ./games/minetest_game/mods/doors/sounds - "doors_steel_door_close", -- ./games/minetest_game/mods/doors/sounds - "doors_door_open", -- ./games/minetest_game/mods/doors/sounds - "doors_fencegate_close", -- ./games/minetest_game/mods/doors/sounds - "doors_glass_door_close", -- ./games/minetest_game/mods/doors/sounds - "doors_fencegate_open", -- ./games/minetest_game/mods/doors/sounds - "doors_glass_door_open", -- ./games/minetest_game/mods/doors/sounds - "doors_steel_door_open", -- ./games/minetest_game/mods/doors/sounds - "fire_flint_and_steel", -- ./games/minetest_game/mods/fire/sounds - "fire_large", -- ./games/minetest_game/mods/fire/sounds - "fire_fire", -- ./games/minetest_game/mods/fire/sounds - "fire_extinguish_flame", -- ./games/minetest_game/mods/fire/sounds - "fire_small", -- ./games/minetest_game/mods/fire/sounds - "tnt_ignite", -- ./games/minetest_game/mods/tnt/sounds - "tnt_gunpowder_burning", -- ./games/minetest_game/mods/tnt/sounds - "tnt_explode", -- ./games/minetest_game/mods/tnt/sounds - "carts_cart_new", -- ./games/minetest_game/mods/carts/sounds - "carts_cart_moving", -- ./games/minetest_game/mods/carts/sounds - "xpanes_steel_bar_door_open", -- ./games/minetest_game/mods/xpanes/sounds - "xpanes_steel_bar_door_close", -- ./games/minetest_game/mods/xpanes/sounds - "default_break_glass", -- ./games/minetest_game/mods/default/sounds - "default_dig_dig_immediate", -- ./games/minetest_game/mods/default/sounds - "default_dig_cracky", -- ./games/minetest_game/mods/default/sounds - "default_dig_choppy", -- ./games/minetest_game/mods/default/sounds - "default_water_footstep", -- ./games/minetest_game/mods/default/sounds - "player_damage", -- ./games/minetest_game/mods/default/sounds - "default_gravel_footstep", -- ./games/minetest_game/mods/default/sounds - "default_dig_metal", -- ./games/minetest_game/mods/default/sounds - "default_gravel_dug", -- ./games/minetest_game/mods/default/sounds - "default_hard_footstep", -- ./games/minetest_game/mods/default/sounds - "default_sand_footstep", -- ./games/minetest_game/mods/default/sounds - "default_grass_footstep", -- ./games/minetest_game/mods/default/sounds - "default_chest_close", -- ./games/minetest_game/mods/default/sounds - "default_cool_lava", -- ./games/minetest_game/mods/default/sounds - "default_place_node_hard", -- ./games/minetest_game/mods/default/sounds - "default_ice_dug", -- ./games/minetest_game/mods/default/sounds - "default_dig_crumbly", -- ./games/minetest_game/mods/default/sounds - "default_tool_breaks", -- ./games/minetest_game/mods/default/sounds - "default_ice_footstep", -- ./games/minetest_game/mods/default/sounds - "default_dig_cracky", -- ./games/minetest_game/mods/default/sounds - "default_chest_open", -- ./games/minetest_game/mods/default/sounds - "default_gravel_dig", -- ./games/minetest_game/mods/default/sounds - "default_dig_oddly_breakable_by_hand", -- ./games/minetest_game/mods/default/sounds - "default_dug_metal", -- ./games/minetest_game/mods/default/sounds - "default_dirt_footstep", -- ./games/minetest_game/mods/default/sounds - "default_dig_choppy", -- ./games/minetest_game/mods/default/sounds - "default_glass_footstep", -- ./games/minetest_game/mods/default/sounds - "default_snow_footstep", -- ./games/minetest_game/mods/default/sounds - "default_place_node", -- ./games/minetest_game/mods/default/sounds - "default_dig_snappy", -- ./games/minetest_game/mods/default/sounds - "default_dug_node", -- ./games/minetest_game/mods/default/sounds - "default_metal_footstep", -- ./games/minetest_game/mods/default/sounds - "default_ice_dig", -- ./games/minetest_game/mods/default/sounds - "default_place_node_metal", -- ./games/minetest_game/mods/default/sounds - "default_wood_footstep", -- ./games/minetest_game/mods/default/sounds - "default_furnace_active", -- ./games/minetest_game/mods/default/sounds - "default_item_smoke", -- ./games/minetest_game/mods/default/sounds -} diff --git a/techage/basis/pack_lib.lua b/techage/basis/pack_lib.lua deleted file mode 100644 index 155cd3a..0000000 --- a/techage/basis/pack_lib.lua +++ /dev/null @@ -1,88 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2024 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Packing functions - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta - --- string/usercode conversion -local function usercode_to_string(tbl) - if tbl and tbl.inventory then - for list_name,list in pairs(tbl.inventory) do - for i,item in ipairs(list) do - tbl.inventory[list_name][i] = item:to_string() - end - end - end -end - -local function string_to_usercode(tbl) - if tbl and tbl.inventory then - for list_name,list in pairs(tbl.inventory) do - for i,item in ipairs(list) do - tbl.inventory[list_name][i] = ItemStack(item) - end - end - end -end - --- pack/unpack node nvm data -local function pack_nvm(pos) - if techage.has_nvm(pos) then - local s = minetest.serialize(techage.get_nvm(pos)) - techage.del_mem(pos) - return s - end -end - -local function unpack_nvm(pos, s) - if s and s ~= "" then - local tbl = minetest.deserialize(s) - local nvm = techage.get_nvm(pos) - for k,v in pairs(tbl) do - nvm.k = v - end - end -end - --- pack/unpack node metedata -local function pack_meta(pos) - local tbl = M(pos):to_table() or {} - usercode_to_string(tbl) - return minetest.serialize(tbl) -end - -local function unpack_meta(pos, s) - if s and s ~= "" then - local tbl = minetest.deserialize(s) or {} - string_to_usercode(tbl) - M(pos):from_table(tbl) - end -end - -------------------------------------------------------------------------------- --- preserve/restore API functions -------------------------------------------------------------------------------- - -function techage.preserve_nodedata(pos) - local smeta = pack_meta(pos) - local snvm = pack_nvm(pos) - return minetest.serialize({smeta = smeta, snvm = snvm}) -end - -function techage.restore_nodedata(pos, s) - local tbl = minetest.deserialize(s) or {} - unpack_nvm(pos, tbl.snvm) - unpack_meta(pos, tbl.smeta) -end diff --git a/techage/basis/recipe_lib.lua b/techage/basis/recipe_lib.lua deleted file mode 100644 index fc069b6..0000000 --- a/techage/basis/recipe_lib.lua +++ /dev/null @@ -1,292 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Recipe lib for formspecs - -]]-- - -local S = techage.S -local M = minetest.get_meta - -local Recipes = {} -- {rtype = {ouput = {....},...}} -local NormalizedRecipes = {} -- {output = "", items = {...}} - -local range = techage.in_range - -techage.recipes = {} - -local GROUP_ITEMS = { - stone = "default:cobble", - wood = "default:wood", - book = "default:book", - sand = "default:sand", - leaves = "default:leaves", - stick = "default:stick", - tree = "default:tree", - vessel = "vessels:glass_bottle", - wool = "wool:white", -} - - -local RECIPE = { - output = {name = "", num = 0}, - waste = {name = "", num = 0}, - input = { - {name = "", num =0}, - {name = "", num =0}, - {name = "", num =0}, - {name = "", num =0}, - }, - } - -local function filter_recipes_based_on_points(recipes, owner) - local ex_points = 0 - if owner then - local player = minetest.get_player_by_name(owner) - ex_points = techage.get_expoints(player) or 0 - end - - local tbl = {} - for _,item in ipairs(recipes) do - if ex_points >= (item.ex_points or 0) then - tbl[#tbl + 1] = item - end - end - return tbl -end - - --- Formspec -local function input_string(recipe) - local tbl = {} - for idx, item in ipairs(recipe.input) do - local x = ((idx-1) % 2) - local y = math.floor((idx-1) / 2) - tbl[idx] = techage.item_image(x, y, item.name.." "..item.num) - end - return table.concat(tbl, "") -end - -function techage.recipes.get(nvm, rtype, owner) - local recipes = Recipes[rtype] or {} - if owner then - recipes = filter_recipes_based_on_points(recipes, owner) - end - return recipes[nvm.recipe_idx or 1] or recipes[1] -end - --- Add 4 input/output/waste recipe --- { --- output = " ", -- units = 1..n --- waste = " ", -- units = 1..n --- input = { -- up to 4 items --- " ", --- " ", --- }, --- } -function techage.recipes.add(rtype, recipe) - if not Recipes[rtype] then - Recipes[rtype] = {} - end - - local name, num, output - local item = {input = {}} - for idx = 1,4 do - local inp = recipe.input[idx] or "" - name, num = unpack(string.split(inp, " ")) - item.input[idx] = {name = name or "", num = tonumber(num) or 0} - end - if recipe.waste then - name, num = unpack(string.split(recipe.waste, " ")) - else - name, num = "", "0" - end - item.waste = {name = name or "", num = tonumber(num) or 0} - name, num = unpack(string.split(recipe.output, " ")) - item.output = {name = name or "", num = tonumber(num) or 0} - item.catalyst = recipe.catalyst - item.ex_points = recipe.ex_points or 0 - Recipes[rtype][#Recipes[rtype]+1] = item - output = name - - techage.recipes.register_craft({ - output = recipe.output, - items = recipe.input, - type = rtype, - }) - NormalizedRecipes[output] = { - output = recipe.output, - items = recipe.input, - } -end - -function techage.recipes.formspec(x, y, rtype, nvm, owner) - local recipes = Recipes[rtype] or {} - recipes = filter_recipes_based_on_points(recipes, owner) - nvm.recipe_idx = range(nvm.recipe_idx or 1, 1, #recipes) - local idx = nvm.recipe_idx - local recipe = recipes[idx] or RECIPE - local output = recipe.output.name.." "..recipe.output.num - local waste = recipe.waste.name.." "..recipe.waste.num - local catalyst = recipe.catalyst and techage.item_image_small(2.05, 0, recipe.catalyst, S("Catalyst")) or "" - return "container["..x..","..y.."]".. - "background[0,0;4,3;techage_form_grey.png]".. - input_string(recipe).. - "image[2,0.7;1,1;techage_form_arrow.png]".. - catalyst.. - techage.item_image(2.95, 0, output).. - techage.item_image(2.95, 1, waste).. - "button[0,2;1,1;priv;<<]".. - "button[1,2;1,1;next;>>]".. - "label[1.9,2.2;"..S("Recipe")..": "..idx.."/"..#recipes.."]".. - "container_end[]" -end - -function techage.recipes.on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - - nvm.recipe_idx = nvm.recipe_idx or 1 - if not nvm.running then - if fields.next == ">>" then - nvm.recipe_idx = nvm.recipe_idx + 1 - return true - elseif fields.priv == "<<" then - nvm.recipe_idx = nvm.recipe_idx - 1 - return true - end - end -end - -function techage.recipes.get_recipe(name) - return NormalizedRecipes[name] -end - -function techage.recipes.set_recipe(pos, rtype, idx) - local nvm = techage.get_nvm(pos) - if not nvm.running then - local recipes = Recipes[rtype] or {} - idx = tonumber(idx) or 1 - nvm.recipe_idx = range(idx, 1, #recipes) - end -end - -function techage.recipes.get_default_group_item_name(item_name) - if item_name and item_name:sub(1, 6) == "group:" then - local default_name = GROUP_ITEMS[item_name:sub(7)] - if default_name then - return default_name - end - end - return item_name -end - -function techage.recipes.add_group_item(group, default_item_name) - GROUP_ITEMS[group] = default_item_name -end - -------------------------------------------------------------------------------- --- Borrowed from ghaydn -------------------------------------------------------------------------------- -local has_i3 = minetest.get_modpath("i3") -local has_ui = minetest.get_modpath("unified_inventory") -local has_cg = minetest.get_modpath("craftguide") - -local function format_i3(input) - local output = {} - for _, entry in ipairs(input) do - local secondput = "" - if type(entry) == "table" then - for _, secondtry in ipairs(entry) do - secondput = secondput..secondtry.."," - end - table.insert(output, secondput) - else - table.insert(output, entry) - end - end - return output -end - -techage.recipes.register_craft_type = function(name, def) - if has_cg then - local cg_def = { - description = def.description, - icon = def.icon, - } - craftguide.register_craft_type(name, cg_def) - end - if has_i3 then - local i3_def = { - description = def.description, - icon = def.icon, - width = def.width or 3, - height = def.height or 3, - dynamic_display_size = def.dynamic_display_size or nil, - uses_crafting_grid = def.uses_crafting_grid, - } - i3.register_craft_type(name, i3_def) - end - if has_ui then - local ui_def = { - description = def.description, - icon = def.icon, - width = def.width or 3, - height = def.height or 3, - dynamic_display_size = def.dynamic_display_size or nil, - uses_crafting_grid = def.uses_crafting_grid, - } - unified_inventory.register_craft_type(name, ui_def) - end -end - -techage.recipes.register_craft = function(def) - if not def.items then - if def.input then - def.items = table.copy(def.input) - elseif def.recipe then - def.items = table.copy(def.recipe) - end - end - if not def.result then - if def.output then def.result = def.output end - end - - if has_cg then - local cg_def = { - result = def.result, - type = def.type, - items = def.items, - } - craftguide.register_craft(cg_def) - end - if has_i3 then - - local i3_def = { - result = def.result, - type = def.type, - items = format_i3(def.items), - width = def.width or 3, - } - i3.register_craft(i3_def) - end - if has_ui then - local ui_def = { - output = def.result, - type = def.type, - items = def.items, - width = def.width or 3, - height = def.height or 3, - } - unified_inventory.register_craft(ui_def) - end -end diff --git a/techage/basis/shared_inv.lua b/techage/basis/shared_inv.lua deleted file mode 100644 index 2c5138b..0000000 --- a/techage/basis/shared_inv.lua +++ /dev/null @@ -1,74 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Library for shared inventories - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -techage.shared_inv = {} - -local hyperloop = techage.hyperloop -local remote_pos = techage.hyperloop.remote_pos - -local function copy_inventory_list(from_pos, to_pos, listname) - local inv1 = minetest.get_inventory({type="node", pos=from_pos}) - local inv2 = minetest.get_inventory({type="node", pos=to_pos}) - inv2:set_list(listname, inv1:get_list(listname)) -end - -function techage.shared_inv.node_timer(pos, elapsed) - local rmt_pos = remote_pos(pos) - if rmt_pos and techage.is_activeformspec(pos) then - copy_inventory_list(rmt_pos, pos, "main") - return true - end - return false -end - --- Synchronize the client inventory with the server one -function techage.shared_inv.before_inv_access(pos, listname) - if hyperloop.is_client(pos) then - local rmt_pos = remote_pos(pos) - if rmt_pos then - copy_inventory_list(rmt_pos, pos, listname) - return true - end - end - return false -end - --- Synchronize the client inventory with the server one -function techage.shared_inv.after_inv_access(pos, listname) - if hyperloop.is_client(pos) then - local rmt_pos = remote_pos(pos) - if rmt_pos then - copy_inventory_list(pos, rmt_pos, listname) - return true - end - end - return false -end - -function techage.shared_inv.on_rightclick(pos, clicker, listname) - if hyperloop.is_client(pos) then - local rmt_pos = remote_pos(pos) - if rmt_pos then - copy_inventory_list(rmt_pos, pos, listname) - techage.set_activeformspec(pos, clicker) - minetest.get_node_timer(pos):start(2) - end - end -end diff --git a/techage/basis/shared_tank.lua b/techage/basis/shared_tank.lua deleted file mode 100644 index 1e2f067..0000000 --- a/techage/basis/shared_tank.lua +++ /dev/null @@ -1,116 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Library for shared inventories - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local NDEF = function(pos) return minetest.registered_nodes[techage.get_node_lvm(pos).name] or {} end - -techage.shared_tank = {} - -local liquid = networks.liquid -local hyperloop = techage.hyperloop -local remote_pos = techage.hyperloop.remote_pos -local is_paired = techage.hyperloop.is_paired -local menu = techage.menu - -local function formspec(pos) - local ndef = NDEF(pos) - local status = M(pos):get_string("conn_status") - if hyperloop.is_client(pos) or hyperloop.is_server(pos) then - local title = ndef.description .. " " .. status - local nvm = techage.get_nvm(remote_pos(pos)) - return techage.liquid.formspec(pos, nvm, title) - else - return menu.generate_formspec(pos, ndef, hyperloop.SUBMENU) - end -end - -function techage.shared_tank.node_timer(pos) - if techage.is_activeformspec(pos) and is_paired(pos) then - M(pos):set_string("formspec", formspec(pos)) - return true - end - return false -end - -function techage.shared_tank.on_rightclick(pos, node, clicker) - --if hyperloop.is_client(pos) then - techage.set_activeformspec(pos, clicker) - minetest.get_node_timer(pos):start(2) - --end - M(pos):set_string("formspec", formspec(pos)) -end - -function techage.shared_tank.can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - pos = remote_pos(pos) - return techage.liquid.is_empty(pos) -end - -function techage.shared_tank.peek_liquid(pos, indir) - if is_paired(pos) then - pos = remote_pos(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end -end - -function techage.shared_tank.take_liquid(pos, indir, name, amount) - if is_paired(pos) then - pos = remote_pos(pos) - local nvm = techage.get_nvm(pos) - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return amount, name - end - return 0, name -end - -function techage.shared_tank.put_liquid(pos, indir, name, amount) - if is_paired(pos) then - pos = remote_pos(pos) - -- check if it is not powder - local ndef = minetest.registered_craftitems[name] or {} - if not ndef.groups or ndef.groups.powder ~= 1 then - local nvm = techage.get_nvm(pos) - local ndef = NDEF(pos) - local leftover = liquid.srv_put(nvm, name, amount, ndef.liquid.capa) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return leftover - end - end - return amount -end - -function techage.shared_tank.untake_liquid(pos, indir, name, amount) - if is_paired(pos) then - pos = remote_pos(pos) - local nvm = techage.get_nvm(pos) - local ndef = NDEF(pos) - local leftover = liquid.srv_put(nvm, name, amount, ndef.liquid.capa) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(pos)) - end - return leftover - end - return amount -end - -techage.shared_tank.formspec = formspec diff --git a/techage/basis/submenu.lua b/techage/basis/submenu.lua deleted file mode 100644 index 46ce5da..0000000 --- a/techage/basis/submenu.lua +++ /dev/null @@ -1,318 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - A formspec control to generate formspec strings for machine settings and monitoring -]]-- - -local S = techage.S - -techage.menu = {} - -local function index(list, x) - for idx, v in ipairs(list or {}) do - if tostring(v) == x then return idx end - end - return nil -end - -local function allow_put(inv, listname, index, stack, player) - local list = inv:get_list(listname) - stack:set_count(1) - inv:set_stack(listname, index, stack) - return 0 -end - -local function allow_take(inv, listname, index, stack, player) - local list = inv:get_list(listname) - stack:set_count(0) - inv:set_stack(listname, index, stack) - return 0 -end - - --- generate the formspec string to be placed into a container frame -local function generate_formspec_substring(pos, meta, form_def, player_name) - local tbl = {} - local player_inv_needed = false - if meta and form_def then - local nvm = techage.get_nvm(pos) - - for i,elem in ipairs(form_def) do - local offs = (i - 1) * 0.9 - 0.2 - tbl[#tbl+1] = "label[0," .. offs .. ";" .. minetest.formspec_escape(elem.label) .. ":]" - tbl[#tbl+1] = "tooltip[0," .. offs .. ";4,1;" .. elem.tooltip .. "]" - if elem.type == "label" then - -- none - elseif elem.type == "number" then - local val = elem.default - if meta:contains(elem.name) then - val = meta:get_int(elem.name) - end - if nvm.running or techage.is_running(nvm) then - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. val .. "]" - else - tbl[#tbl+1] = "field[5," .. (offs+0.2) .. ";5.3,1;" .. elem.name .. ";;" .. val .. "]" - end - elseif elem.type == "numbers" then - local val = elem.default - if meta:contains(elem.name) then - val = meta:get_string(elem.name) - end - if nvm.running or techage.is_running(nvm) then - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. val .. "]" - else - tbl[#tbl+1] = "field[5," .. (offs+0.2) .. ";5.3,1;" .. elem.name .. ";;" .. val .. "]" - end - elseif elem.type == "float" then - local val = elem.default - if meta:contains(elem.name) then - val = tonumber(meta:get_string(elem.name)) or 0 - end - if nvm.running or techage.is_running(nvm) then - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. val .. "]" - else - tbl[#tbl+1] = "field[5," .. (offs+0.2) .. ";5.3,1;" .. elem.name .. ";;" .. val .. "]" - end - elseif elem.type == "ascii" then - local val = elem.default - if meta:contains(elem.name) then - val = meta:get_string(elem.name) - end - if nvm.running or techage.is_running(nvm) then - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. minetest.formspec_escape(val) .. "]" - else - tbl[#tbl+1] = "field[5," .. (offs+0.2) .. ";5.3,1;" .. elem.name .. ";;" .. minetest.formspec_escape(val) .. "]" - end - elseif elem.type == "const" then - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. elem.value .. "]" - elseif elem.type == "output" then - local val = nvm[elem.name] or meta:get_string(elem.name) or "" - if tonumber(val) then - val = techage.round(val) - end - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. val .. "]" - elseif elem.type == "dropdown" then - if nvm.running or techage.is_running(nvm) then - local val = elem.default or "" - if meta:contains(elem.name) then - val = meta:get_string(elem.name) or "" - end - tbl[#tbl+1] = "label[4.75," .. offs .. ";" .. val .. "]" - elseif elem.on_dropdown then -- block provides a specific list of choice elements - local val = elem.default - if meta:contains(elem.name) then - val = meta:get_string(elem.name) or "" - end - local choices = elem.on_dropdown(pos) - local l = choices:split(",") - local idx = index(l, val) or 1 - tbl[#tbl+1] = "dropdown[4.72," .. (offs) .. ";5.5,1.4;" .. elem.name .. ";" .. choices .. ";" .. idx .. "]" - else - local val = elem.default - if meta:contains(elem.name) then - val = meta:get_string(elem.name) or "" - end - local idx - if elem.values then - idx = index(elem.values, val) or 1 - else - local l = elem.choices:split(",") - idx = index(l, val) or 1 - end - tbl[#tbl+1] = "dropdown[4.72," .. (offs) .. ";5.5,1.4;" .. elem.name .. ";" .. elem.choices .. ";" .. idx .. "]" - end - elseif elem.type == "items" then -- inventory - if elem.size then - tbl[#tbl+1] = "list[detached:" .. minetest.formspec_escape(player_name) .. "_techage_wrench_menu;cfg;4.75," .. offs .. ";" .. elem.size .. ",1;]" - else - tbl[#tbl+1] = "list[detached:" .. minetest.formspec_escape(player_name) .. "_techage_wrench_menu;cfg;4.75," .. offs .. ";" .. elem.width .. "," .. elem.height .. ";]" - end - player_inv_needed = true - end - end - if nvm.running or techage.is_running(nvm) then - local offs = #form_def * 0.9 - 0.2 - tbl[#tbl+1] = "label[0," .. offs .. ";" .. S("Note: You can't change any values while the block is running!") .. "]" - end - end - - return player_inv_needed, table.concat(tbl, "") -end - -local function value_check(elem, value, player_name) - if elem.check then - return elem.check(value, player_name) - end - return value ~= nil -end - -local function evaluate_data(pos, meta, form_def, fields, player_name) - local res = true - - if meta and form_def then - local nvm = techage.get_nvm(pos) - if nvm.running or techage.is_running(nvm) then - return res - end - for idx,elem in ipairs(form_def) do - if elem.type == "number" then - if fields[elem.name] then - if fields[elem.name] == "" then - meta:set_string(elem.name, "") - elseif fields[elem.name]:find("^[%d ]+$") then - local val = tonumber(fields[elem.name]) - if value_check(elem, val, player_name) then - meta:set_int(elem.name, val) - --print("set_int", elem.name, val) - else - res = false - end - else - res = false - end - end - elseif elem.type == "numbers" then - if fields[elem.name] then - if fields[elem.name] == "" then - meta:set_string(elem.name, "") - elseif fields[elem.name]:find("^[%d ]+$") and - value_check(elem, fields[elem.name], player_name) then - meta:set_string(elem.name, fields[elem.name]) - else - res = false - end - end - elseif elem.type == "float" then - if fields[elem.name] == ""then - meta:set_string(elem.name, "") - elseif fields[elem.name] then - local val = tonumber(fields[elem.name]) - if val and value_check(elem, val, player_name) then - meta:set_string(elem.name, val) - else - res = false - end - end - elseif elem.type == "ascii" then - if fields[elem.name] == ""then - meta:set_string(elem.name, "") - elseif fields[elem.name] then - if value_check(elem, fields[elem.name], player_name) then - meta:set_string(elem.name, fields[elem.name]) - else - res = false - end - end - elseif elem.type == "dropdown" then - if fields[elem.name] ~= nil then - if elem.values then - local l = elem.choices:split(",") - local idx = index(l, fields[elem.name]) or 1 - local text = elem.values[idx] - meta:set_string(elem.name, text) - else - meta:set_string(elem.name, fields[elem.name]) - end - end - elseif elem.type == "items" and player_name then - local inv_name = minetest.formspec_escape(player_name) .. "_techage_wrench_menu" - local dinv = minetest.get_inventory({type = "detached", name = inv_name}) - local ninv = minetest.get_inventory({type = "node", pos = pos}) - if dinv and ninv then - for i = 1, ninv:get_size("cfg") do - ninv:set_stack("cfg", i, dinv:get_stack("cfg", i)) - end - end - end - end - end - return res -end - -function techage.menu.generate_formspec(pos, ndef, form_def, player_name) - local meta = minetest.get_meta(pos) - local number = techage.get_node_number(pos) or "-" - local mem = techage.get_mem(pos) - mem.star = ((mem.star or 0) + 1) % 2 - local star = mem.star == 1 and "*" or "" - if player_name then - local inv_name = minetest.formspec_escape(player_name) .. "_techage_wrench_menu" - minetest.create_detached_inventory(inv_name, { - allow_put = allow_put, - allow_take = allow_take}) - local dinv = minetest.get_inventory({type = "detached", name = inv_name}) - local ninv = minetest.get_inventory({type = "node", pos = pos}) - if dinv and ninv then - dinv:set_size('cfg', ninv:get_size("cfg")) - for i = 1, ninv:get_size("cfg") do - dinv:set_stack("cfg", i, ninv:get_stack("cfg", i)) - end - end - end - if meta and number and ndef and form_def then - local title = ndef.description .. " (" .. number .. ")" - local player_inv_needed, text = generate_formspec_substring(pos, meta, form_def, player_name) - local buttons - - if player_inv_needed then - buttons = "button[0.5,6.2;3,1;refresh;" .. S("Refresh") .. "]" .. - "button_exit[3.5,6.2;3,1;cancel;" .. S("Cancel") .. "]" .. - "button[6.5,6.2;3,1;save;" .. S("Save") .. "]" .. - "list[current_player;main;1,7.2;8,2;]" - else - buttons = "button[0.5,8.4;3,1;refresh;" .. S("Refresh") .. "]" .. - "button_exit[3.5,8.4;3,1;cancel;" .. S("Cancel") .. "]" .. - "button[6.5,8.4;3,1;save;" .. S("Save") .. "]" - end - - if #form_def > 8 then - local size = (#form_def * 10) - 60 - return "size[10,9]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;9.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "label[9.5,-0.1;" .. minetest.colorize( "#000000", star) .. "]" .. - "scrollbaroptions[max=" .. size .. "]" .. - "scrollbar[9.4,0.6;0.4,7.7;vertical;wrenchmenu;]" .. - "scroll_container[0,1;12,9;wrenchmenu;vertical;]" .. - text .. - "scroll_container_end[]" .. - buttons - else - return "size[10,9]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;9.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "label[9.5,-0.1;" .. minetest.colorize( "#000000", star) .. "]" .. - "container[0,1]" .. - text .. - "container_end[]" .. - buttons - end - end - return "" -end - -function techage.menu.eval_input(pos, form_def, fields, player_name) - if fields.save or fields.key_enter_field then - local meta = minetest.get_meta(pos) - evaluate_data(pos, meta, form_def, fields, player_name) - end - return fields.refresh or fields.save or fields.key_enter_field -end - -function techage.dropdown_index(sChoices, selected_value) - local l = sChoices:split(",") - return index(l, selected_value) or 1 -end diff --git a/techage/basis/teleport.lua b/techage/basis/teleport.lua deleted file mode 100644 index a9dd85b..0000000 --- a/techage/basis/teleport.lua +++ /dev/null @@ -1,167 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - For tupe/pipe blocks with teleport support - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local NDEF = function(pos) return minetest.registered_nodes[techage.get_node_lvm(pos).name] or {} end -local M = minetest.get_meta -local S = techage.S -local menu = techage.menu - -techage.teleport = {} - -local PairingList = {} -- {owner = {node_type = {channel = pos}}} - -local function get_pairing_table1(meta) - local owner = meta:get_string("owner") - local node_type = meta:get_string("tele_node_type") - PairingList[owner] = PairingList[owner] or {} - PairingList[owner][node_type] = PairingList[owner][node_type] or {} - return PairingList[owner][node_type] -end - -local function get_pairing_table2(oldmetadata) - local owner = oldmetadata.fields.owner - local node_type = oldmetadata.fields.tele_node_type - PairingList[owner] = PairingList[owner] or {} - PairingList[owner][node_type] = PairingList[owner][node_type] or {} - return PairingList[owner][node_type] -end - -local function get_free_server_list(pos) - local tbl = {""} - for name, pos in pairs(get_pairing_table1(M(pos))) do - table.insert(tbl, name) - end - return table.concat(tbl, ",") -end - -local TELE_MENU = { - { - type = "label", - label = S("Enter a block name or select an existing one"), - tooltip = "", - name = "l1", - }, - { - type = "ascii", - name = "conn_name", - label = S("Block name"), - tooltip = S("Connection name for this block"), - default = "", - }, - { - type = "dropdown", - choices = "", - on_dropdown = get_free_server_list, - name = "remote_name", - label = S("Remote name"), - tooltip = S("Connection name of the remote block"), - }, - { - type = "output", - label = S("Status"), - tooltip = S("Connection status"), - name = "status", - default = "", - }, -} - -function techage.teleport.formspec(pos) - local ndef = NDEF(pos) - return menu.generate_formspec(pos, ndef, TELE_MENU) -end - -local function store_connection(pos, peer_pos) - local meta = M(pos) - local status = S("connected to") .. " " .. P2S(peer_pos) - meta:set_string("tele_status", status) - meta:set_string("tele_peer_pos", P2S(peer_pos)) - meta:set_string("formspec", "") -end - -function techage.teleport.prepare_pairing(pos, node_type, status) - local meta = M(pos) - if node_type then - meta:set_string("tele_node_type", node_type) - end - status = status or S("not connected") - meta:set_string("tele_status", status) - meta:set_string("tele_peer_pos", "") - meta:set_string("formspec", techage.teleport.formspec(pos)) -end - -function techage.teleport.stop_pairing(pos, oldmetadata) - -- disconnect peer node - if oldmetadata and oldmetadata.fields then - if oldmetadata.fields.tele_peer_pos then - local peer_pos = S2P(oldmetadata.fields.tele_peer_pos) - local meta = M(peer_pos) - if meta:get_string("conn_name") ~= "" then -- Server - local tbl = get_pairing_table1(meta) - tbl[meta:get_string("conn_name")] = peer_pos - techage.teleport.prepare_pairing(peer_pos, nil, S("server not connected")) - else - techage.teleport.prepare_pairing(peer_pos) - end - elseif oldmetadata.fields.conn_name then - local tbl = get_pairing_table2(oldmetadata) - tbl[oldmetadata.fields.conn_name] = nil - end - end -end - -function techage.teleport.is_connected(pos) - return M(pos):get_string("tele_peer_pos") ~= "" -end - -function techage.teleport.get_remote_pos(pos) - local s = M(pos):get_string("tele_peer_pos") - if s ~= "" then - return S2P(s) - end -end - -function techage.teleport.after_formspec(pos, player, fields, max_dist, ex_points) - if techage.get_expoints(player) >= ex_points then - if techage.menu.eval_input(pos, TELE_MENU, fields) then - if not techage.teleport.is_connected(pos) then - local meta = M(pos) - if fields.remote_name ~= "" then -- Client - local tbl = get_pairing_table1(meta) - local peer_pos = tbl[fields.remote_name] - if peer_pos then - if vector.distance(pos, peer_pos) <= max_dist then - tbl[fields.remote_name] = nil - store_connection(pos, peer_pos) - store_connection(peer_pos, pos) - M(pos):set_string("status", S("Connected")) - else - M(pos):set_string("status", S("Distance > @1 blocks", max_dist)) - meta:set_string("formspec", techage.teleport.formspec(pos)) - end - end - elseif fields.conn_name ~= "" then -- Server - local tbl = get_pairing_table1(meta) - tbl[fields.conn_name] = pos - techage.teleport.prepare_pairing(pos, nil, S("server not connected")) - end - end - end - else - M(pos):set_string("status", S("Ex-points missing (@1 < @2)", techage.get_expoints(player), ex_points)) - M(pos):set_string("formspec", techage.teleport.formspec(pos)) - end -end diff --git a/techage/basis/tube_wall_entry.lua b/techage/basis/tube_wall_entry.lua deleted file mode 100644 index a2dab89..0000000 --- a/techage/basis/tube_wall_entry.lua +++ /dev/null @@ -1,57 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tube wall entry - -]]-- - -local S = techage.S - -local Tube = techage.Tube - -minetest.register_node("techage:tube_wall_entry", { - description = S("Tube Wall Entry"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_tube_hole.png", - "basic_materials_concrete_block.png^techage_tube_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Tube:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - groups = {crumbly = 2, cracky = 2, snappy = 2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - output = "techage:tube_wall_entry", - recipe = { - {"", "techage:tubeS", ""}, - {"", "basic_materials:concrete_block", ""}, - {"", "",""}, - }, -}) diff --git a/techage/basis/tubes.lua b/techage/basis/tubes.lua deleted file mode 100644 index 177cb5e..0000000 --- a/techage/basis/tubes.lua +++ /dev/null @@ -1,148 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tubes based on tubelib2 - -]]-- - -local S = techage.S - - --- used for registered nodes -techage.KnownNodes = { - ["techage:tubeS"] = true, - ["techage:tubeA"] = true, - ["techage:ta4_tubeS"] = true, - ["techage:ta4_tubeA"] = true, -} - - -local Tube = tubelib2.Tube:new({ - -- North, East, South, West, Down, Up - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = 200, - show_infotext = false, - primary_node_names = { - "techage:tubeS", "techage:tubeA", - "techage:ta4_tubeS", "techage:ta4_tubeA", - "techage:tube_wall_entry", - }, - after_place_tube = function(pos, param2, tube_type, num_tubes, tbl) - local name = minetest.get_node(pos).name - if name == "techage:tubeS" or name == "techage:tubeA" then - minetest.swap_node(pos, {name = "techage:tube"..tube_type, param2 = param2}) - elseif name == "techage:tube_wall_entry" then - minetest.swap_node(pos, {name = "techage:tube_wall_entry", param2 = param2}) - else - minetest.swap_node(pos, {name = "techage:ta4_tube"..tube_type, param2 = param2}) - end - end, -}) - -techage.Tube = Tube - -minetest.register_node("techage:tubeS", { - description = S("TechAge Tube"), - tiles = { -- Top, base, right, left, front, back - "techage_tube_tube.png^[transformR90", - "techage_tube_tube.png^[transformR90", - "techage_tube_tube.png", - "techage_tube_tube.png", - "techage_tube_hole.png", - "techage_tube_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Tube:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/8, -2/8, -4/8, 2/8, 2/8, 4/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 }, - }, - collision_box = { - type = "fixed", - fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 }, - }, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy=2, cracky=3}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:tubeA", { - description = S("TechAge Tube"), - tiles = { -- Top, base, right, left, front, back - "techage_tube_knee2.png", - "techage_tube_hole2.png^[transformR180", - "techage_tube_knee.png^[transformR270", - "techage_tube_knee.png", - "techage_tube_knee2.png", - "techage_tube_hole2.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/8, -4/8, -2/8, 2/8, 2/8, 2/8}, - {-2/8, -2/8, -4/8, 2/8, 2/8, -2/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 }, - }, - collision_box = { - type = "fixed", - fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 }, - }, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy=2, cracky=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - drop = "techage:tubeS", -}) - -minetest.register_craft({ - output = "techage:tubeS 4", - recipe = { - {"default:steel_ingot", "", "group:wood"}, - {"", "group:wood", ""}, - {"group:wood", "", "default:tin_ingot"}, - }, -}) diff --git a/techage/basis/tubes_ta4.lua b/techage/basis/tubes_ta4.lua deleted file mode 100644 index 6c06af2..0000000 --- a/techage/basis/tubes_ta4.lua +++ /dev/null @@ -1,120 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Tubes in TA4 design based on tubelib2 - -]]-- - -local Tube = techage.Tube -local S = techage.S - -minetest.register_node("techage:ta4_tubeS", { - description = S("TA4 Tube"), - tiles = { -- Top, base, right, left, front, back - "techage_tubeta4_tube.png^[transformR90", - "techage_tubeta4_tube.png^[transformR90", - "techage_tubeta4_tube.png", - "techage_tubeta4_tube.png", - "techage_tube_hole.png", - "techage_tube_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Tube:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/8, -2/8, -4/8, 2/8, 2/8, 4/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 }, - }, - collision_box = { - type = "fixed", - fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 }, - }, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy=2, cracky=3}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_tubeA", { - description = S("TA4 Tube"), - tiles = { -- Top, base, right, left, front, back - "techage_tubeta4_knee2.png", - "techage_tubeta4_hole2.png^[transformR180", - "techage_tubeta4_knee.png^[transformR270", - "techage_tubeta4_knee.png", - "techage_tubeta4_knee2.png", - "techage_tubeta4_hole2.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Tube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/8, -4/8, -2/8, 2/8, 2/8, 2/8}, - {-2/8, -2/8, -4/8, 2/8, 2/8, -2/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 }, - }, - collision_box = { - type = "fixed", - fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 }, - }, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy=2, cracky=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta4_tubeS", -}) - -minetest.register_craft({ - output = "techage:ta4_tubeS 6", - recipe = { - {"dye:blue", "", "basic_materials:plastic_sheet"}, - {"", "basic_materials:plastic_sheet", ""}, - {"basic_materials:plastic_sheet", "", "techage:aluminum"}, - }, -}) - -techage.TA4tubes = { - ["techage:ta4_tubeS"] = true, - ["techage:ta4_tubeA"] = true, -} diff --git a/techage/basis/windturbine_lib.lua b/techage/basis/windturbine_lib.lua deleted file mode 100644 index bbd4397..0000000 --- a/techage/basis/windturbine_lib.lua +++ /dev/null @@ -1,86 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Wind turbine helper function - -]]-- - -local S = techage.S -local P = minetest.string_to_pos -local M = minetest.get_meta - -local OCEAN = "ocean" - -if minetest.global_exists("asuna") then - OCEAN = "below" -end - -local function chat_message(player_name, msg) - if player_name then - minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]").." "..msg) - end - return false, msg -end - --- num_turbines is the mx number of valid wind turbines. In the case of a tool --- it should be 0, in case of the rotor: 1 -function techage.valid_place_for_windturbine(pos, player_name, num_turbines) - local pos1, pos2, num - - -- Check if occean (only for tool) - if num_turbines == 0 and pos.y ~= 1 then - return chat_message(player_name, S("This is not the surface of the ocean!")) - end - local node = minetest.get_node(pos) - if num_turbines == 0 and node.name ~= "default:water_source" then - return chat_message(player_name, S("This is no ocean water!")) - end - local data = minetest.get_biome_data({x=pos.x, y=-2, z=pos.z}) - if data then - local name = minetest.get_biome_name(data.biome) - if not string.find(name, OCEAN) then - return chat_message(player_name, S("This is a").." "..name.." "..S("biome and no ocean!")) - end - end - -- check the space over ocean - pos1 = {x=pos.x-20, y=2, z=pos.z-20} - pos2 = {x=pos.x+20, y=22, z=pos.z+20} - num = #minetest.find_nodes_in_area(pos1, pos2, {"air", "ignore"}) - if num < (41 * 41 * 21 * 0.9) then - techage.mark_region(player_name, pos1, pos2, "") - return chat_message(player_name, - S("Here is not enough wind\n(A free air space of 41x41x21 m is necessary)!")) - end - -- Check for water surface (occean) - pos1 = {x=pos.x-20, y=1, z=pos.z-20} - pos2 = {x=pos.x+20, y=1, z=pos.z+20} - num = #minetest.find_nodes_in_area(pos1, pos2, - {"default:water_source", "default:water_flowing", "ignore"}) - - if num < (41*41 * 0.8) then - techage.mark_region(player_name, pos1, pos2, "") - return chat_message(player_name, S("Here is not enough water (41x41 m)!")) - end - -- Check for next wind turbine - pos1 = {x=pos.x-13, y=2, z=pos.z-13} - pos2 = {x=pos.x+13, y=22, z=pos.z+13} - - num = #minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_wind_turbine"}) - if num > num_turbines then - techage.mark_region(player_name, pos1, pos2, "") - return chat_message(player_name, S("The next wind turbines is too close!")) - end - - if num_turbines == 0 then - chat_message(player_name, minetest.pos_to_string(pos).." ".. - S("is a suitable place for a wind turbine!")) - end - return true, "ok" -end diff --git a/techage/beduino/kv_store.lua b/techage/beduino/kv_store.lua deleted file mode 100644 index 9f565b7..0000000 --- a/techage/beduino/kv_store.lua +++ /dev/null @@ -1,60 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - K/V Store for the Beduino controller - -]]-- - -local COSTS = 400 - -local function ta_kv_init(cpu_pos, address, regA, regB, regC) - local nvm = techage.get_nvm(cpu_pos) - nvm.kv_store = {} - return 1, COSTS -end - -local function ta_kv_add(cpu_pos, address, regA, regB, regC) - local nvm = techage.get_nvm(cpu_pos) - local text = vm16.read_ascii(cpu_pos, regA, 32) - nvm.kv_store[text] = regB - return 1, COSTS -end - -local function ta_kv_get(cpu_pos, address, regA, regB, regC) - local nvm = techage.get_nvm(cpu_pos) - local text = vm16.read_ascii(cpu_pos, regA, 32) - return nvm.kv_store[text] or 0, COSTS -end - -local kvstore_c = [[ -// Initialize the key/value store -func ta_kv_init() { - return system(0x140, 0); -} - -// Add a key/value pair to the store -func ta_kv_add(key_str, value) { - return system(0x141, key_str, value); -} - -// Returns the value for the given key string -func ta_kv_get(key_str) { - return system(0x142, key_str); -} -]] - -minetest.register_on_mods_loaded(function() - if minetest.global_exists("beduino") and minetest.global_exists("vm16") then - beduino.lib.register_SystemHandler(0x140, ta_kv_init) - beduino.lib.register_SystemHandler(0x141, ta_kv_add) - beduino.lib.register_SystemHandler(0x142, ta_kv_get) - vm16.register_ro_file("beduino", "lib/ta_kvstore.c", kvstore_c) - end -end) diff --git a/techage/carts/chest_cart.lua b/techage/carts/chest_cart.lua deleted file mode 100644 index ff6da7d..0000000 --- a/techage/carts/chest_cart.lua +++ /dev/null @@ -1,181 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Chest Cart - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local MP = minetest.get_modpath("minecart") - -local Tube = techage.Tube - -local function on_rightclick(pos, node, clicker) - if clicker and clicker:is_player() then - if M(pos):get_int("userID") == 0 then - minecart.show_formspec(pos, clicker) - end - end -end - -local function formspec() - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;3,0;2,2;]".. - "list[current_player;main;0,2.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - local owner = M(pos):get_string("owner") - if owner ~= "" and owner ~= player:get_player_name() then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - local owner = M(pos):get_string("owner") - if owner ~= "" and owner ~= player:get_player_name() then - return 0 - end - return stack:get_count() -end - -minetest.register_node("techage:chest_cart", { - description = S("TA Chest Cart"), - tiles = { - -- up, down, right, left, back, front - "techage_chest_cart_top.png", - "techage_chest_cart_bottom.png", - "techage_chest_cart_side.png", - "techage_chest_cart_side.png", - "techage_chest_cart_front.png", - "techage_chest_cart_front.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-7/16, 3/16, -7/16, 7/16, 8/16, 7/16}, - {-8/16, -8/16, -8/16, 8/16, 3/16, 8/16}, - }, - }, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, - node_placement_prediction = "", - diggable = false, - - on_place = minecart.on_nodecart_place, - on_punch = minecart.on_nodecart_punch, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_rightclick = on_rightclick, - - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size('main', 4) - if placer and placer:is_player() then - minecart.show_formspec(pos, placer) - else - M(pos):set_string("formspec", formspec()) - end - end, - - set_cargo = function(pos, data) - local inv = M(pos):get_inventory() - for idx, stack in ipairs(data) do - inv:set_stack("main", idx, stack) - end - end, - - get_cargo = function(pos) - local inv = M(pos):get_inventory() - local data = {} - for idx = 1, 4 do - local stack = inv:get_stack("main", idx) - data[idx] = {name = stack:get_name(), count = stack:get_count()} - end - return data - end, - - has_cargo = function(pos) - local inv = minetest.get_meta(pos):get_inventory() - return not inv:is_empty("main") - end -}) - -minecart.register_cart_entity("techage:chest_cart_entity", "techage:chest_cart", "chest", { - initial_properties = { - physical = false, - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - visual = "wielditem", - textures = {"techage:chest_cart"}, - visual_size = {x=0.66, y=0.66, z=0.66}, - static_save = false, - }, -}) - -techage.register_node({"techage:chest_cart"}, { - on_pull_item = function(pos, in_dir, num, item_name) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_inv_state(inv, "main") - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- Chest State - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return 0, {techage.get_inv_state_num(inv, "main")} - else - return 2, "" - end - end, -}) - -Tube:set_valid_sides("techage:chest_cart", {"L", "R", "F", "B"}) - -minetest.register_craft({ - output = "techage:chest_cart", - recipe = { - {"default:junglewood", "default:chest_locked", "default:junglewood"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - }, -}) diff --git a/techage/carts/tank_cart.lua b/techage/carts/tank_cart.lua deleted file mode 100644 index 48796b4..0000000 --- a/techage/carts/tank_cart.lua +++ /dev/null @@ -1,176 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Tank Cart - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local Pipe = techage.LiquidPipe -local MP = minetest.get_modpath("minecart") - -local liquid = networks.liquid -local CAPACITY = 200 - -local function on_rightclick(pos, node, clicker) - if clicker and clicker:is_player() then - if M(pos):get_int("userID") == 0 then - minecart.show_formspec(pos, clicker) - else - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - minetest.get_node_timer(pos):start(2) - end - end -end - -local function node_timer(pos, elapsed) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - return true - end - return false -end - -local function peek_liquid(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) -end - -local function take_liquid(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return amount, name -end - -local function put_liquid(pos, indir, name, amount) - -- check if it is not powder - local ndef = minetest.registered_craftitems[name] or {} - if not ndef.groups or ndef.groups.powder ~= 1 then - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return leftover - end - return amount -end - -local function untake_liquid(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return leftover -end - -minetest.register_node("techage:tank_cart", { - description = S("TA Tank Cart"), - tiles = { - -- up, down, right, left, back, front - "techage_tank_cart_top.png", - "techage_tank_cart_bottom.png", - "techage_tank_cart_side.png", - "techage_tank_cart_side.png", - "techage_tank_cart_front.png", - "techage_tank_cart_front.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/16, 7/16, -3/16, 3/16, 8/16, 3/16}, - {-7/16, 3/16, -7/16, 7/16, 7/16, 7/16}, - {-8/16, -8/16, -8/16, 8/16, 3/16, 8/16}, - }, - }, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, - node_placement_prediction = "", - diggable = false, - - on_place = minecart.on_nodecart_place, - on_punch = minecart.on_nodecart_punch, - - after_place_node = function(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - -- Delete the network between pump and cart - Pipe:after_dig_node(pos) - Pipe:after_place_node(pos) - end, - - set_cargo = function(pos, data) - local nvm = techage.get_nvm(pos) - nvm.liquid = data - end, - - get_cargo = function(pos) - local nvm = techage.get_nvm(pos) - local data = nvm.liquid - nvm.liquid = {} - return data - end, - - has_cargo = function(pos) - return not techage.liquid.is_empty(pos) - end, - - on_timer = node_timer, - on_rightclick = on_rightclick, -}) - -techage.register_node({"techage:tank_cart"}, techage.liquid.recv_message) - -liquid.register_nodes({"techage:tank_cart"}, - Pipe, "tank", {"U"}, { - capa = CAPACITY, - peek = peek_liquid, - put = put_liquid, - take = take_liquid, - untake = untake_liquid, - } -) - -minecart.register_cart_entity("techage:tank_cart_entity", "techage:tank_cart", "tank", { - initial_properties = { - physical = false, - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - visual = "wielditem", - textures = {"techage:tank_cart"}, - visual_size = {x=0.66, y=0.66, z=0.66}, - static_save = false, - }, - only_dig_if_empty = 1, -}) - -minetest.register_craft({ - output = "techage:tank_cart", - recipe = { - {"default:junglewood", "techage:ta3_tank", "default:junglewood"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - }, -}) diff --git a/techage/chemistry/ta4_doser.lua b/techage/chemistry/ta4_doser.lua deleted file mode 100644 index d2c05db..0000000 --- a/techage/chemistry/ta4_doser.lua +++ /dev/null @@ -1,394 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Doser - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local recipes = techage.recipes - -local Liquids = {} -- {hash(pos) = {name = outdir},...} - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 3 -local CYCLE_TIME = 10 - -local function formspec(self, pos, nvm) - return "size[6,3.6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;5.8,0.5;#c6e8ff]".. - "label[2.5,-0.1;"..minetest.colorize( "#000000", S("Doser")).."]".. - recipes.formspec(0.1, 0.8, "ta4_doser", nvm).. - "image_button[5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[5,2;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local function get_liquids(pos) - local hash = minetest.hash_node_position(pos) - if Liquids[hash] then - return Liquids[hash] - end - -- determine the available input liquids - local tbl = {} - for outdir = 1,4 do - local name, num = liquid.peek(pos, Pipe, outdir) - if name then - tbl[name] = outdir - end - end - Liquids[hash] = tbl - return Liquids[hash] -end - -local function del_liquids(pos) - local hash = minetest.hash_node_position(pos) - Liquids[hash] = nil -end - --- if liquids are missing, update the cached liquid table -local function reload_liquids(pos) - local hash = minetest.hash_node_position(pos) - -- determine the available input liquids - local tbl = {} - for outdir = 1,4 do - local name, num = liquid.peek(pos, Pipe, outdir) - if name then - tbl[name] = outdir - end - end - Liquids[hash] = tbl - return Liquids[hash] -end - -local function reactor_cmnd(pos, cmnd, payload) - return techage.transfer( - pos, - 6, -- outdir - cmnd, -- topic - payload, -- payload - Pipe, -- network - {"techage:ta4_reactor_fillerpipe"}) -end - - -local function can_start(pos, nvm, state) - -- check reactor - local res = reactor_cmnd(pos, "check") - if not res then - return S("reactor defect") - end - res = reactor_cmnd(pos, "can_start") - if not res then - return S("reactor defect or no power") - end - local recipe = recipes.get(nvm, "ta4_doser") - if recipe.catalyst then - res = reactor_cmnd(pos, "catalyst") - if not res or res == "" then - return S("catalyst missing") - end - if res ~= recipe.catalyst then - return S("wrong catalyst") - end - end - return true -end - -local function start_node(pos, nvm, state) - reactor_cmnd(pos, "start") - del_liquids(pos) - nvm.running = true -end - -local function stop_node(pos, nvm, state) - reactor_cmnd(pos, "stop") - nvm.running = false -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_doser", - node_name_active = "techage:ta4_doser_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = "TA4 Doser", - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function untake(pos, taken) - for _,item in pairs(taken) do - liquid.untake(pos, Pipe, item.outdir, item.name, item.num) - end -end - -local function dosing(pos, nvm, elapsed) - -- trigger reactor (power) - if not reactor_cmnd(pos, "power") then - if not nvm.techage_countdown or nvm.techage_countdown < 3 then - reactor_cmnd(pos, "stop") - State:nopower(pos, nvm, S("reactor has no power")) - return - end - State:idle(pos, nvm) - return - end - -- available liquids - local liquids = get_liquids(pos) - local recipe = recipes.get(nvm, "ta4_doser") - if not liquids or not recipe then return end - -- check from time to time - nvm.check_cnt = (nvm.check_cnt or 0) + 1 - if nvm.check_cnt >= 4 then - nvm.check_cnt = 0 - local res = reactor_cmnd(pos, "check") - if not res then - State:fault(pos, nvm, S("reactor defect")) - reactor_cmnd(pos, "stop") - return - end - if recipe.catalyst then - res = reactor_cmnd(pos, "catalyst") - if not res then - State:fault(pos, nvm, S("catalyst missing")) - reactor_cmnd(pos, "stop") - return - end - if res ~= recipe.catalyst then - State:fault(pos, nvm, S("wrong catalyst")) - reactor_cmnd(pos, "stop") - return - end - end - end - - -- check leftover - local leftover - local mem = techage.get_mem(pos) - if mem.waste_leftover then - leftover = reactor_cmnd(pos, "waste", { - name = mem.waste_leftover.name, - amount = mem.waste_leftover.num}) or mem.waste_leftover.num - if leftover > 0 then - mem.waste_leftover.num = leftover - State:blocked(pos, nvm) - return - end - mem.waste_leftover = nil - end - if mem.output_leftover then - leftover = reactor_cmnd(pos, "output", { - name = mem.output_leftover.name, - amount = mem.output_leftover.num}) or mem.output_leftover.num - if leftover > 0 then - mem.output_leftover.num = leftover - State:blocked(pos, nvm) - return - end - mem.output_leftover = nil - end - - -- inputs - local taken = {} - mem.dbg_cycles = (mem.dbg_cycles or 0) - 1 - - for _,item in pairs(recipe.input) do - if item.name ~= "" then - local outdir = liquids[item.name] or reload_liquids(pos)[item.name] - if not outdir then - State:standby(pos, nvm) - reactor_cmnd(pos, "stop") - untake(pos, taken) - return - end - local num = liquid.take(pos, Pipe, outdir, item.name, item.num, mem.dbg_cycles > 0) - if num < item.num then - taken[#taken + 1] = {outdir = outdir, name = item.name, num = num} - State:standby(pos, nvm) - reactor_cmnd(pos, "stop") - untake(pos, taken) - return - end - taken[#taken + 1] = {outdir = outdir, name = item.name, num = item.num} - end - end - -- waste - if recipe.waste.name ~= "" then - leftover = reactor_cmnd(pos, "waste", { - name = recipe.waste.name, - amount = recipe.waste.num}) or recipe.waste.num - if leftover > 0 then - mem.waste_leftover = {name = recipe.waste.name, num = leftover} - mem.output_leftover = {name = recipe.output.name, num = recipe.output.num} - State:blocked(pos, nvm) - reactor_cmnd(pos, "stop") - return - end - end - -- output - leftover = reactor_cmnd(pos, "output", { - name = recipe.output.name, - amount = recipe.output.num}) or recipe.output.num - if leftover > 0 then - mem.output_leftover = {name = recipe.output.name, num = leftover} - State:blocked(pos, nvm) - reactor_cmnd(pos, "stop") - return - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - dosing(pos, nvm, elapsed) - return State:is_active(nvm) -end - -local function on_rightclick(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - if not nvm.running then - if recipes.on_receive_fields(pos, formname, fields, player) then - local mem = techage.get_mem(pos) - mem.waste_leftover = nil - mem.output_leftover = nil - end - end - local mem = techage.get_mem(pos) - mem.dbg_cycles = 5 - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -minetest.register_node("techage:ta4_doser", { - description = S("TA4 Doser"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_pump_up.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta4_doser") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec(State, pos, nvm)) - meta:set_string("infotext", S("TA4 Doser").." "..number) - State:node_init(pos, nvm, number) - Pipe:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir, tlib2, node) - liquid.update_network(pos, dir, tlib2, node) - del_liquids(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_doser_on", { - description = S("TA4 Doser"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - { - name = "techage_filling8_ta4.png^techage_frame8_ta4.png^techage_appl_pump_up8.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - }, - - tubelib2_on_update2 = function(pos, dir, tlib2, node) - liquid.update_network(pos, dir, tlib2, node) - del_liquids(pos) - end, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta4_doser", "techage:ta4_doser_on"}, Pipe, "pump", nil, {}) - -techage.register_node({"techage:ta4_doser", "techage:ta4_doser_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "recipe" then - techage.recipes.set_recipe(pos, "ta4_doser", payload) - return true - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - -techage.recipes.register_craft_type("ta4_doser", { - description = S("TA4 Reactor"), - icon = 'techage_reactor_filler_plan.png', - width = 2, - height = 2, -}) - -minetest.register_craft({ - output = "techage:ta4_doser", - recipe = { - {"", "techage:ta3_pipeS", ""}, - {"techage:ta3_pipeS", "techage:t4_pump", "techage:ta3_pipeS"}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) diff --git a/techage/chemistry/ta4_liquid_filter.lua b/techage/chemistry/ta4_liquid_filter.lua deleted file mode 100644 index 988a1d5..0000000 --- a/techage/chemistry/ta4_liquid_filter.lua +++ /dev/null @@ -1,209 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - Copyright (C) 2020 Thomas S. - - AGPL v3 - See LICENSE.txt for more information - - TA4 Liquid Filter - -]]-- - --- For now, the Red Mud -> Lye/Desert Cobble recipe is hardcoded. --- If necessary, this can be adjusted later. - -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - --- Checks if the filter structure is ok and returns the amount of gravel -local function checkStructure(pos) - local pos1_outer = {x=pos.x-2,y=pos.y-7,z=pos.z-2} - local pos2_outer = {x=pos.x+2,y=pos.y,z=pos.z+2} - local pos1_inner = {x=pos.x-1,y=pos.y-1,z=pos.z-1} - local pos2_inner = {x=pos.x+1,y=pos.y-7,z=pos.z+1} - local pos1_top = {x=pos.x-1,y=pos.y,z=pos.z-1} - local pos2_top = {x=pos.x+1,y=pos.y,z=pos.z+1} - local pos1_bottom = {x=pos.x-2,y=pos.y-8,z=pos.z-2} - local pos2_bottom = {x=pos.x+2,y=pos.y-8,z=pos.z+2} - - - local gravel = minetest.find_nodes_in_area(pos1_inner, pos2_inner, {"default:gravel"}) - - local _, inner = minetest.find_nodes_in_area(pos1_inner, pos2_inner, { - "default:desert_cobble" - }) - if #gravel + (inner["default:desert_cobble"] or 0) ~= 63 then -- 7x3x3=63 - return false, gravel - end - - local _, outer = minetest.find_nodes_in_area(pos1_outer, pos2_outer, { - "basic_materials:concrete_block", - "default:obsidian_glass" - }) - - -- + 4x7=28 (corners) - -- + 5x5-3x3=16 (top ring) - -- ------------------------------ - -- = 44 (total concrete) - if outer["basic_materials:concrete_block"] ~= 44 then - return false, gravel - end - if outer["default:obsidian_glass"] ~= 84 then -- 4x7x3=84 - return false, gravel - end - - local _,top = minetest.find_nodes_in_area(pos1_top, pos2_top, {"air"}) - if top["air"] ~= 8 then - return false, gravel - end - - local _,bottom = minetest.find_nodes_in_area(pos1_bottom, pos2_bottom, { - "basic_materials:concrete_block", - "techage:ta3_pipe_wall_entry" - }) - if bottom["basic_materials:concrete_block"] ~= 22 or bottom["techage:ta3_pipe_wall_entry"] ~= 2 then - return false, gravel - end - - if minetest.get_node({x=pos.x,y=pos.y-8,z=pos.z}).name ~= "techage:ta4_liquid_filter_sink" then - return false, gravel - end - - return true, gravel -end - -minetest.register_node("techage:ta4_liquid_filter_filler", { - description = S("TA4 Liquid Filter Filler"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png^techage_gaspipe_hole.png", - "basic_materials_concrete_block.png^techage_liquid_filter_filler_bottom.png", - "basic_materials_concrete_block.png^techage_liquid_filter_filler.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-6/8, -0.5, -6/8, 6/8, -0.25, 6/8}, - {-7/16, -0.25, -7/16, 7/16, 0, 7/16}, - {-1/8, 0, -1/8, 1/8, 13/32, 1/8}, - {-2/8, 13/32, -2/8, 2/8, 0.5, 2/8}, - }, - }, - after_place_node = function(pos) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, - - paramtype = "light", - paramtype2 = "facedir", - use_texture_alpha = techage.CLIP, - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta4_liquid_filter_filler"}, - Pipe, "tank", {"U"}, { - capa = 1, - peek = function(...) return nil end, - put = function(pos, indir, name, amount) - local structure_ok, gravel = checkStructure(pos) - if name ~= "techage:redmud" then - return amount - end - if not structure_ok then - return amount - end - if #gravel < 33 then - return amount - end - if math.random() < 0.5 then - local out_pos = {x=pos.x,y=pos.y-8,z=pos.z} - local leftover = liquid.put(out_pos, Pipe, networks.side_to_outdir(out_pos, "R"), "techage:lye", 1) - if leftover > 0 then - return amount - end - else - minetest.swap_node(gravel[math.random(#gravel)], {name = "default:desert_cobble"}) - end - return amount - 1 - end, - take = function(...) return 0 end, - untake = function(pos, outdir, name, amount, player_name) - return amount - end, - } -) - - -minetest.register_node("techage:ta4_liquid_filter_sink", { - description = S("TA4 Liquid Filter Sink"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png^techage_appl_arrow.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_appl_hole_pipe.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 3/16, 0.5}, - {-0.5, 3/16, -0.5, 0.5, 5/16, -0.25}, - {0.25, 3/16, -0.5, 0.5, 5/16, 0.5}, - {-0.5, 3/16, 0.25, 0.5, 5/16, 0.5}, - {-0.5, 3/16, -0.5, -0.25, 5/16, 0.5} - }, - }, - after_place_node = function(pos) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta4_liquid_filter_sink"}, - Pipe, "pump", {"R"}, {} -) - - -minetest.register_craft({ - output = 'techage:ta4_liquid_filter_filler', - recipe = { - {'', 'techage:ta3_pipeS', ''}, - {'basic_materials:concrete_block', 'basic_materials:concrete_block', 'basic_materials:concrete_block'}, - {'', 'default:steel_ingot', ''}, - } -}) - -minetest.register_craft({ - output = 'techage:ta4_liquid_filter_sink 2', - recipe = { - {'basic_materials:concrete_block', '', 'basic_materials:concrete_block'}, - {'basic_materials:concrete_block', 'techage:ta3_pipeS', 'techage:ta3_pipeS'}, - {'basic_materials:concrete_block', 'basic_materials:concrete_block', 'basic_materials:concrete_block'}, - } -}) diff --git a/techage/chemistry/ta4_reactor.lua b/techage/chemistry/ta4_reactor.lua deleted file mode 100644 index 6b2108d..0000000 --- a/techage/chemistry/ta4_reactor.lua +++ /dev/null @@ -1,226 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Reactor - -]]-- - -local S = techage.S -local M = minetest.get_meta -local Pipe = techage.LiquidPipe -local Cable = techage.ElectricCable -local liquid = networks.liquid - -minetest.register_node("techage:ta4_reactor_fillerpipe", { - description = S("TA4 Reactor Filler Pipe"), - tiles = { - -- up, down, right, left, back, front - "techage_reactor_filler_top.png", - "techage_reactor_filler_top.png", - "techage_reactor_filler_side.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/8, 13/32, -2/8, 2/8, 4/8, 2/8}, - {-1/8, 0/8, -1/8, 1/8, 4/8, 1/8}, - {-5/16, 0/8, -5/16, 5/16, 2/8, 5/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-2/8, 0/8, -2/8, 2/8, 4/8, 2/8}, - }, - after_place_node = function(pos) - local pos1 = {x = pos.x, y = pos.y-1, z = pos.z} - if minetest.get_node(pos1).name == "air" then - local node = minetest.get_node(pos) - minetest.remove_node(pos) - minetest.set_node(pos1, node) - Pipe:after_place_node(pos1) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -local function stand_cmnd(pos, cmnd, payload) - return techage.transfer( - {x = pos.x, y = pos.y-1, z = pos.z}, - 5, -- outdir - cmnd, -- topic - payload, -- payload - nil, -- network - {"techage:ta4_reactor_stand"}) -end - -local function base_waste(pos, payload) - local pos2 = {x = pos.x, y = pos.y-3, z = pos.z} - local outdir = M(pos2):get_int("outdir") - return liquid.put(pos2, Pipe, outdir, payload.name, payload.amount, payload.player_name) -end - --- controlled by the doser -techage.register_node({"techage:ta4_reactor_fillerpipe"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "check" then - local pos2,node = Pipe:get_node(pos, 5) - if not node or node.name ~= "techage:ta4_reactor" then - return false - end - pos2,node = Pipe:get_node(pos2, 5) - if not node or node.name ~= "techage:ta4_reactor_stand" then - return false - end - return true - elseif topic == "waste" then - return base_waste(pos, payload or {}) - elseif topic == "catalyst" then - local pos2,node = Pipe:get_node(pos, 5) - if not node or node.name ~= "techage:ta4_reactor" then - return - end - local inv = M(pos2):get_inventory() - local stack = inv:get_stack("main", 1) - return stack and stack:get_name() - else - return stand_cmnd(pos, topic, payload or {}) - end - end, -}) - -liquid.register_nodes({"techage:ta4_reactor_fillerpipe"}, Pipe, "tank", {"U"}, {}) - -local function formspec() - local title = S("TA4 Reactor") - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize("#000000", title).."]".. - "label[4.5,1.2;"..S("Catalyst").."]".. - "list[context;main;3.5,1;1,1;]".. - "list[current_player;main;0,2.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return 1 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -minetest.register_node("techage:ta4_reactor", { - description = S("TA4 Reactor"), - tiles = {"techage_reactor_side.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_12h.obj", - selection_box = { - type = "fixed", - fixed = {-1/2, -23/32, -1/2, 1/2, 32/32, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -23/32, -1/2, 1/2, 32/32, 1/2}, - }, - after_place_node = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('main', 1) - M(pos):set_string("formspec", formspec()) - end, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -techage.register_node({"techage:ta4_reactor"}, { - on_inv_request = function(pos, in_dir, access_type) - local meta = minetest.get_meta(pos) - return meta:get_inventory(), "main" - end, - on_pull_item = function(pos, in_dir, num, item_name) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, -}) - -minetest.register_craft({ - output = 'techage:ta4_reactor', - recipe = { - {'default:steel_ingot', 'techage:ta3_pipeS', 'default:steel_ingot'}, - {'techage:iron_ingot', '', 'techage:iron_ingot'}, - {'default:steel_ingot', 'techage:ta3_pipeS', 'default:steel_ingot'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta4_reactor_fillerpipe', - recipe = { - {'', '', ''}, - {'', 'techage:ta3_pipeS', ''}, - {'default:steel_ingot', 'basic_materials:motor', 'default:steel_ingot'}, - } -}) - -minetest.register_lbm({ - label = "Upgrade reactor", - name = "techage:update_reactor", - - nodenames = { - "techage:ta4_reactor", - }, - - run_at_every_load = true, - - action = function(pos, node) - local inv = M(pos):get_inventory() - inv:set_size('main', 1) - M(pos):set_string("formspec", formspec()) - end, -}) diff --git a/techage/chemistry/ta4_stand.lua b/techage/chemistry/ta4_stand.lua deleted file mode 100644 index efd429e..0000000 --- a/techage/chemistry/ta4_stand.lua +++ /dev/null @@ -1,209 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Reactor Stand and Base - -]]-- - -local S = techage.S -local M = minetest.get_meta -local Cable = techage.ElectricCable -local Pipe = techage.LiquidPipe -local power = networks.power -local liquid = networks.liquid - -local PWR_NEEDED = 8 -local CYCLE_TIME = 2 - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_reactor", { - pos = pos, - gain = 0.5, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function on_power(pos) - M(pos):set_string("infotext", S("on")) - play_sound(pos) - local nvm = techage.get_nvm(pos) - nvm.running = true -end - -local function on_nopower(pos) - M(pos):set_string("infotext", S("no power")) - stop_sound(pos) - local nvm = techage.get_nvm(pos) - nvm.running = false -end - -local function is_running(pos, nvm) - return nvm.running -end - -minetest.register_node("techage:ta4_reactor_stand", { - description = S("TA4 Reactor Stand"), - tiles = { - -- up, down, right, left, back, front - "techage_reactor_stand_top.png^[transformR90", - "techage_reactor_stand_bottom.png^[transformFY^[transformR270", - "techage_reactor_stand_front.png", - "techage_reactor_stand_back.png", - "techage_reactor_stand_side.png^[transformFX", - "techage_reactor_stand_side.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -8/16, 2/16, -8/16, 8/16, 4/16, 8/16 }, - - { -8/16, -8/16, -8/16, -6/16, 8/16, -6/16 }, - { 6/16, -8/16, -8/16, 8/16, 8/16, -6/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - - {-1/8, -4/8, -1/8, 1/8, 4/8, 1/8}, - {-4/8, -1/8, -1/8, 4/8, 1/8, 1/8}, - {-4/8, -1/8, -3/8, -3/8, 1/8, 3/8}, - { 3/8, -1/8, -3/8, 4/8, 1/8, 3/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - M(pos):set_string("infotext", S("off")) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if not nvm.running and consumed == PWR_NEEDED then - on_power(pos) - elseif nvm.running and consumed < PWR_NEEDED then - on_nopower(pos) - end - return true - end, - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - --- controlled by the fillerpipe -techage.register_node({"techage:ta4_reactor_stand"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "power" then - return nvm.running or power.power_available(pos, Cable) - elseif topic == "output" then - local outdir = M(pos):get_int("outdir") - return liquid.put(pos, Pipe, outdir, payload.name, payload.amount, payload.player_name) - elseif topic == "can_start" then - return power.power_available(pos, Cable) - elseif topic == "start" then - nvm.running = false - minetest.get_node_timer(pos):start(CYCLE_TIME) - M(pos):set_string("infotext", "...") - return true - elseif topic == "stop" then - nvm.has_power = false - stop_sound(pos) - minetest.get_node_timer(pos):stop() - M(pos):set_string("infotext", S("off")) - return true - end - end, - on_node_load = function(pos, node) - local nvm = techage.get_nvm(pos) - if nvm.has_power then - play_sound(pos) - end - end, -}) - -minetest.register_node("techage:ta4_reactor_base", { - description = S("TA4 Reactor Base"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_appl_arrowXL.png^techage_appl_hole_pipe.png^[transformR270", - "techage_concrete.png", - "techage_concrete.png^techage_appl_hole_pipe.png", - "techage_concrete.png", - "techage_concrete.png", - "techage_concrete.png", - }, - - after_place_node = function(pos, placer) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -liquid.register_nodes({"techage:ta4_reactor_base"}, Pipe, "pump", {"R"}, {}) -liquid.register_nodes({"techage:ta4_reactor_stand"}, Pipe, "pump", {"R"}, {}) -power.register_nodes({"techage:ta4_reactor_stand"}, Cable, "con", {"L"}) - -minetest.register_craft({ - output = 'techage:ta4_reactor_stand', - recipe = { - {'', 'dye:blue', ''}, - {'basic_materials:steel_bar', 'techage:ta3_pipeS', 'basic_materials:steel_bar'}, - {'basic_materials:steel_bar', '', 'basic_materials:steel_bar'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta4_reactor_base', - recipe = { - {'basic_materials:concrete_block', '', ''}, - {'techage:ta3_pipeS', '', ''}, - {'', '', ''}, - } -}) diff --git a/techage/coal_power_station/boiler_base.lua b/techage/coal_power_station/boiler_base.lua deleted file mode 100644 index 73c37d5..0000000 --- a/techage/coal_power_station/boiler_base.lua +++ /dev/null @@ -1,67 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Coal Power Station Boiler Base - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.SteamPipe -local networks = techage.networks - -local function after_place_node(pos) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) -end - -minetest.register_node("techage:coalboiler_base", { - description = S("TA3 Boiler Base"), - tiles = {"techage_coal_boiler_mesh_base.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_12.obj", - selection_box = { - type = "fixed", - fixed = {-13/32, -16/32, -13/32, 13/32, 16/32, 13/32}, - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:coalboiler_base"}) - --- for logical communication -techage.register_node({"techage:coalboiler_base"}, { - on_transfer = function(pos, in_dir, topic, payload) - return true - end -}) - -minetest.register_craft({ - output = "techage:coalboiler_base", - recipe = { - {"default:stone", "", "default:stone"}, - {"techage:iron_ingot", "", "techage:iron_ingot"}, - {"default:stone", "default:stone", "default:stone"}, - }, -}) diff --git a/techage/coal_power_station/boiler_top.lua b/techage/coal_power_station/boiler_top.lua deleted file mode 100644 index 9ec177f..0000000 --- a/techage/coal_power_station/boiler_top.lua +++ /dev/null @@ -1,110 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Coal Power Station Boiler Top - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 4 -local WATER_CONSUMPTION = 0.1 - -local Pipe = techage.SteamPipe -local boiler = techage.boiler - -local function steaming(pos, nvm, temp) - if temp >= 80 then - local wc = WATER_CONSUMPTION * (nvm.power_ratio or 1) - nvm.water_level = math.max((nvm.water_level or 0) - wc, 0) - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local temp = boiler.water_temperature(pos, nvm) - steaming(pos, nvm, temp) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", boiler.formspec(pos, nvm)) - end - return temp > 20 -end - -local function after_place_node(pos) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node.name == "techage:coalboiler_base" then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", boiler.formspec(pos, nvm)) - Pipe:after_place_node(pos) - end -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:coalboiler_top", { - description = S("TA3 Boiler Top"), - tiles = {"techage_coal_boiler_mesh_top.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_12.obj", - selection_box = { - type = "fixed", - fixed = {-13/32, -48/32, -13/32, 13/32, 16/32, 13/32}, - }, - - can_dig = boiler.can_dig, - on_timer = node_timer, - on_rightclick = boiler.on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_punch = boiler.on_punch, - - paramtype = "light", - paramtype2 = "facedir", - groups = {cracky=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:coalboiler_top"}) - - -techage.register_node({"techage:coalboiler_top"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "trigger" then - local nvm = techage.get_nvm(pos) - nvm.fire_trigger = true - if not minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):start(CYCLE_TIME) - end - if (nvm.temperature or 20) > 80 then - nvm.power_ratio = techage.transfer(pos, "F", "trigger", nil, Pipe, { - "techage:turbine", "techage:turbine_on"}) or 0 - return nvm.power_ratio - else - return 0 - end - end - end, -}) - -minetest.register_craft({ - output = "techage:coalboiler_top", - recipe = { - {"default:stone", "default:stone", "default:stone"}, - {"techage:iron_ingot", "", "techage:iron_ingot"}, - {"default:stone", "", "default:stone"}, - }, -}) diff --git a/techage/coal_power_station/cooler.lua b/techage/coal_power_station/cooler.lua deleted file mode 100644 index 31e9585..0000000 --- a/techage/coal_power_station/cooler.lua +++ /dev/null @@ -1,133 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Cooler - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.SteamPipe - -local function transfer(pos, in_dir, topic, payload) - return techage.transfer(pos, in_dir, topic, payload, Pipe, - {"techage:coalboiler_base"}) -end - -local function after_place_node(pos) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:cooler", { - description = S("TA3 Cooler"), - tiles = { - -- up, down, right, left, back, front - { - name = "techage_filling4_ta3.png^techage_appl_cooler4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_cooler4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_cooler.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_cooler.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - --- legacy node -minetest.register_node("techage:cooler_on", { - description = S("TA3 Cooler"), - tiles = { - -- up, down, right, left, back, front - { - name = "techage_filling4_ta3.png^techage_appl_cooler4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_cooler4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_cooler.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_cooler.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - drop = "techage:cooler", - groups = {cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:cooler", "techage:cooler_on"}) - --- for logical communication -techage.register_node({"techage:cooler", "techage:cooler_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - return transfer(pos, in_dir, topic, payload) - end -}) - -minetest.register_craft({ - output = "techage:cooler", - recipe = { - {"basic_materials:steel_bar", "default:wood", "basic_materials:steel_bar"}, - {"techage:steam_pipeS", "basic_materials:gear_steel", "techage:steam_pipeS"}, - {"basic_materials:steel_bar", "default:wood", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/coal_power_station/firebox.lua b/techage/coal_power_station/firebox.lua deleted file mode 100644 index e556883..0000000 --- a/techage/coal_power_station/firebox.lua +++ /dev/null @@ -1,231 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Coal Power Station Firebox - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local firebox = techage.firebox - -local CYCLE_TIME = 2 -local BURN_CYCLE_FACTOR = 0.5 - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local power = techage.transfer( - {x=pos.x, y=pos.y+2, z=pos.z}, - nil, -- outdir - "trigger", -- topic - nil, -- payload - nil, -- network - {"techage:coalboiler_top"} -- nodenames - ) - nvm.burn_cycles = (nvm.burn_cycles or 0) - math.max((power or 0.02), 0.02) - if nvm.burn_cycles <= 0 then - local taken = firebox.get_fuel(pos) - if taken then - nvm.burn_cycles = (firebox.Burntime[taken:get_name()] or 1) / CYCLE_TIME * BURN_CYCLE_FACTOR - nvm.burn_cycles_total = nvm.burn_cycles - else - nvm.running = false - firebox.set_firehole(pos, false) - M(pos):set_string("formspec", firebox.formspec(nvm)) - return false - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", firebox.formspec(nvm)) - end - return true -end - -local function start_firebox(pos, nvm) - if not nvm.running then - nvm.running = true - node_timer(pos, 0) - firebox.set_firehole(pos, true) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end -end - -minetest.register_node("techage:coalfirebox", { - description = S("TA3 Power Station Firebox"), - inventory_image = "techage_coal_boiler_inv.png", - tiles = {"techage_coal_boiler_mesh_top.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_12.obj", - selection_box = { - type = "fixed", - fixed = {-13/32, -16/32, -13/32, 13/32, 16/32, 13/32}, - }, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - - on_timer = node_timer, - can_dig = firebox.can_dig, - allow_metadata_inventory_put = firebox.allow_metadata_inventory_put, - allow_metadata_inventory_take = firebox.allow_metadata_inventory_take, - on_rightclick = firebox.on_rightclick, - - after_place_node = function(pos, placer) - if firebox.is_free_position(pos, placer:get_player_name()) then - techage.add_node(pos, "techage:coalfirebox", true) - local nvm = techage.get_nvm(pos) - nvm.running = false - nvm.burn_cycles = 0 - local meta = M(pos) - meta:set_string("formspec", firebox.formspec(nvm)) - local inv = meta:get_inventory() - inv:set_size('fuel', 1) - firebox.set_firehole(pos, false) - else - minetest.remove_node(pos) - return true - end - end, - - on_destruct = function(pos) - firebox.set_firehole(pos, nil) - end, - - on_metadata_inventory_put = function(pos, listname, index, stack, player) - local nvm = techage.get_nvm(pos) - start_firebox(pos, nvm) - M(pos):set_string("formspec", firebox.formspec(nvm)) - end, -}) - -minetest.register_node("techage:coalfirehole", { - description = S("TA3 Coal Power Station Firebox"), - tiles = { - -- up, down, right, left, back, front - "techage_coal_boiler.png", - "techage_coal_boiler.png", - "techage_coal_boiler.png", - "techage_coal_boiler.png", - "techage_coal_boiler.png", - "techage_coal_boiler.png^techage_appl_firehole.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-6/16, -6/16, 6/16, 6/16, 6/16, 12/16}, - }, - }, - - paramtype = "light", - paramtype2 = "facedir", - pointable = false, - diggable = false, - is_ground_content = false, - groups = {not_in_creative_inventory=1}, -}) - -minetest.register_node("techage:coalfirehole_on", { - description = S("TA3 Coal Power Station Firebox"), - tiles = { - -- up, down, right, left, back, front - "techage_coal_boiler.png^[colorize:black:80", - "techage_coal_boiler.png^[colorize:black:80", - "techage_coal_boiler.png^[colorize:black:80", - "techage_coal_boiler.png^[colorize:black:80", - "techage_coal_boiler.png^[colorize:black:80", - { - name = "techage_coal_boiler4.png^[colorize:black:80^techage_appl_firehole4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-6/16, -6/16, 6/16, 6/16, 6/16, 12/16}, - }, - }, - paramtype = "light", - paramtype2 = "facedir", - light_source = 8, - pointable = false, - diggable = false, - is_ground_content = false, - groups = {not_in_creative_inventory=1}, -}) - - -techage.register_node({"techage:coalfirebox"}, { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "fuel", num) - end, - on_push_item = function(pos, in_dir, stack) - if firebox.Burntime[stack:get_name()] then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local nvm = techage.get_nvm(pos) - start_firebox(pos, nvm) - return techage.put_items(inv, "fuel", stack) - end - return false - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "fuel", stack) - end, - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - return nvm.running and "running" or "stopped" - elseif topic == "fuel" then - return techage.fuel.get_fuel_amount(nvm) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then - return 0, {nvm.running and techage.RUNNING or techage.STOPPED} - elseif topic == 132 then - return 0, {techage.fuel.get_fuel_amount(nvm)} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - output = "techage:coalfirebox", - recipe = { - {'default:stone', 'default:stone', 'default:stone'}, - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'default:stone', 'default:stone', 'default:stone'}, - }, -}) diff --git a/techage/coal_power_station/generator.lua b/techage/coal_power_station/generator.lua deleted file mode 100644 index 34a7e28..0000000 --- a/techage/coal_power_station/generator.lua +++ /dev/null @@ -1,276 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Station Generator - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 4 -local PWR_PERF = 80 - -local function formspec(self, pos, nvm) - return techage.generator_formspec(self, pos, nvm, S("Generator"), nvm.provided, PWR_PERF) -end - -local function transfer_turbine(pos, topic, payload) - return techage.transfer(pos, "L", topic, payload, nil, - {"techage:turbine", "techage:turbine_on"}) -end - -local function can_start(pos, nvm, state) - return (nvm.firebox_trigger or 0) > 0 -- by means of firebox -end - -local function has_fire(nvm) - nvm.firebox_trigger = (nvm.firebox_trigger or 0) - 1 - return nvm.firebox_trigger > 0 -end - -local function start_node(pos, nvm, state) - local meta = M(pos) - nvm.provided = 0 - local outdir = meta:get_int("outdir") - transfer_turbine(pos, "start") - power.start_storage_calc(pos, Cable, outdir) - techage.evaluate_charge_termination(nvm, meta) -end - -local function stop_node(pos, nvm, state) - nvm.provided = 0 - local outdir = M(pos):get_int("outdir") - transfer_turbine(pos, "stop") - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:generator", - node_name_active = "techage:generator_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = S("TA3 Generator"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - local fire = has_fire(nvm) - if running and not fire then - State:standby(pos, nvm) - stop_node(pos, nvm, State) - elseif not running and fire then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local meta = M(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) - local val = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - if val > 0 then - nvm.load = val - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:generator") - State:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -minetest.register_node("techage:generator", { - description = S("TA3 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_generator.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_generator.png^[transformFX]", - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta3", PWR_PERF), - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:generator_on", { - description = S("TA3 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_open.png^techage_frame_ta3.png", - { - name = "techage_filling4_ta3.png^techage_appl_generator4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_generator4.png^[transformFX]^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta3", PWR_PERF), - - drop = "", - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:generator", "techage:generator_on"}, Cable, "gen", {"R"}) - --- controlled by the turbine -techage.register_node({"techage:generator", "techage:generator_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then - nvm.firebox_trigger = 3 - if techage.is_running(nvm) then - return math.max((nvm.provided or PWR_PERF) / PWR_PERF, 0.02) - else - return 0 - end - end - end, - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "delivered" then - return math.floor((nvm.provided or 0) + 0.5) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 135 then -- Delivered Power - return 0, {math.floor((nvm.provided or 0) + 0.5)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, -}) - --- used by power terminal -control.register_nodes({"techage:generator", "techage:generator_on"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA3 Generator"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:generator", - recipe = { - {"basic_materials:steel_bar", "dye:green", "default:wood"}, - {"", "basic_materials:gear_steel", "techage:electric_cableS"}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/coal_power_station/oilfirebox.lua b/techage/coal_power_station/oilfirebox.lua deleted file mode 100644 index 7fd7ad2..0000000 --- a/techage/coal_power_station/oilfirebox.lua +++ /dev/null @@ -1,156 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Coal Power Station Firebox - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local firebox = techage.firebox -local fuel = techage.fuel -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local CYCLE_TIME = 2 -local BURN_CYCLE_FACTOR = 0.5 - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local power = techage.transfer( - {x=pos.x, y=pos.y+2, z=pos.z}, - nil, -- outdir - "trigger", -- topic - nil, -- payload - nil, -- network - {"techage:coalboiler_top"} -- nodenames - ) - nvm.burn_cycles = (nvm.burn_cycles or 0) - math.max((power or 0.02), 0.02) - if nvm.burn_cycles <= 0 then - local liq_name = fuel.get_fuel(nvm) - if liq_name then - nvm.burn_cycles = fuel.burntime(liq_name) / CYCLE_TIME * BURN_CYCLE_FACTOR - nvm.burn_cycles_total = nvm.burn_cycles - else - nvm.running = false - firebox.set_firehole(pos, false) - M(pos):set_string("formspec", fuel.formspec(nvm)) - return false - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", fuel.formspec(nvm)) - end - return true -end - -local function start_firebox(pos, nvm) - if not nvm.running and fuel.has_fuel(nvm) then - nvm.running = true - node_timer(pos, 0) - firebox.set_firehole(pos, true) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end -end - -minetest.register_node("techage:oilfirebox", { - description = S("TA3 Power Station Oil Burner"), - inventory_image = "techage_oil_boiler_inv.png", - tiles = {"techage_coal_boiler_mesh_top.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_12.obj", - selection_box = { - type = "fixed", - fixed = {-13/32, -16/32, -13/32, 13/32, 16/32, 13/32}, - }, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - - on_timer = node_timer, - can_dig = fuel.can_dig, - on_rightclick = fuel.on_rightclick, - on_receive_fields = fuel.on_receive_fields, - - after_place_node = function(pos, placer) - if firebox.is_free_position(pos, placer:get_player_name()) then - techage.add_node(pos, "techage:oilfirebox", true) - local nvm = techage.get_nvm(pos) - nvm.running = false - nvm.burn_cycles = 0 - nvm.liquid = {} - nvm.liquid.amount = 0 - local meta = M(pos) - meta:set_string("formspec", fuel.formspec(nvm)) - local inv = meta:get_inventory() - firebox.set_firehole(pos, false) - else - minetest.remove_node(pos) - return true - end - end, - - on_destruct = function(pos) - firebox.set_firehole(pos, nil) - end, - - on_punch = function(pos, node, puncher, pointed_thing) - local nvm = techage.get_nvm(pos) - fuel.on_punch(pos, node, puncher, pointed_thing) - if nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0 then - minetest.after(1, start_firebox, pos, nvm) - end - end, -}) - -liquid.register_nodes({"techage:oilfirebox"}, - Pipe, "tank", nil, fuel.get_liquid_table(fuel.BT_OIL, fuel.CAPACITY, start_firebox)) - - -techage.register_node({"techage:oilfirebox"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - return nvm.running and "running" or "stopped" - elseif topic == "fuel" then - return fuel.get_fuel_amount(nvm) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then - return 0, {nvm.running and techage.RUNNING or techage.STOPPED} - elseif topic == 132 then - return 0, {fuel.get_fuel_amount(nvm)} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - output = "techage:oilfirebox", - recipe = { - {'', 'techage:coalfirebox', ''}, - {'', 'techage:ta3_barrel_empty', ''}, - {'', '', ''}, - }, -}) diff --git a/techage/coal_power_station/turbine.lua b/techage/coal_power_station/turbine.lua deleted file mode 100644 index 9f697d2..0000000 --- a/techage/coal_power_station/turbine.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Station Turbine - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.SteamPipe - -local function transfer_cooler(pos, topic, payload) - return techage.transfer(pos, 6, topic, payload, Pipe, - {"techage:cooler", "techage:cooler_on"}) -end - -local function transfer_generator(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, nil, - {"techage:generator", "techage:generator_on"}) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_turbine", { - pos = pos, - gain = 1, - max_hear_distance = 15, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function after_place_node(pos) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - stop_sound(pos) - Pipe:after_dig_node(pos) - techage.del_mem(pos) -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - swap_node(pos, "techage:turbine") - stop_sound(pos) -end - -minetest.register_node("techage:turbine", { - description = S("TA3 Turbine"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_appl_turbine.png^techage_frame_ta3.png^[transformFX", - "techage_filling_ta3.png^techage_appl_turbine.png^techage_frame_ta3.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:turbine_on", { - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_steam_hole.png", - { - name = "techage_filling4_ta3.png^techage_appl_turbine4.png^techage_frame4_ta3.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_turbine4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:turbine", "techage:turbine_on"}) - -techage.register_node({"techage:turbine", "techage:turbine_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then -- used by boiler - if not transfer_cooler(pos, topic, payload) then - return 0 - end - local power = transfer_generator(pos, topic, payload) - if not power or power <= 0 and nvm.running then - swap_node(pos, "techage:turbine") - stop_sound(pos) - nvm.running = false - return 0 - end - return power - elseif topic == "start" then -- used by generator - swap_node(pos, "techage:turbine_on") - play_sound(pos) - nvm.running = true - return true - elseif topic == "stop" then -- used by generator - swap_node(pos, "techage:turbine") - stop_sound(pos) - nvm.running = false - return true - end - end, - on_node_load = function(pos, node) - if node.name == "techage:turbine_on" then - play_sound(pos) - end - end, -}) - -minetest.register_craft({ - output = "techage:turbine", - recipe = { - {"basic_materials:steel_bar", "techage:steam_pipeS", "default:wood"}, - {"techage:steam_pipeS", "basic_materials:gear_steel", ""}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/collider/cooler.lua b/techage/collider/cooler.lua deleted file mode 100644 index 435b58f..0000000 --- a/techage/collider/cooler.lua +++ /dev/null @@ -1,89 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Cooler as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe - -minetest.register_node("techage:ta4_collider_cooler", { - description = S("TA4 Collider Cooler"), - tiles = { - -- up, down, right, left, back, front - { - name = "techage_appl_cooler4.png^techage_frame4_ta4_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_appl_cooler4.png^techage_frame4_ta4_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_cooler.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_cooler.png", - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - networks = { - pipe2 = {}, - }, - - after_place_node = function(pos, placer, itemstack) - Pipe:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - -Pipe:add_secondary_node_names({"techage:ta4_collider_cooler"}) -Pipe:set_valid_sides("techage:ta4_collider_cooler", {"R", "L"}) - -techage.register_node({"techage:ta4_collider_cooler"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "cooler" then - return true - else - return false - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_collider_cooler", - recipe = { - {'', 'dye:blue', ''}, - {'', 'techage:cooler', ''}, - {'', 'techage:aluminum', ''}, - }, -}) diff --git a/techage/collider/detector.lua b/techage/collider/detector.lua deleted file mode 100644 index df8f86d..0000000 --- a/techage/collider/detector.lua +++ /dev/null @@ -1,448 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Detector as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local getpos = techage.assemble.get_pos - -local CYCLE_TIME = 2 -local TNO_MAGNETS = 22 -local IMPROBABILITY = 40 -- every 40 min --- one point per 40 min: check every 20 s => factor = 40 * 3 = 120 -IMPROBABILITY = (minetest.settings:get("techage_expoint_rate_in_min") or 40) * 3 - -local TIME_SLOTS = 10 -local Schedule = {[0] = - -- Route: 0 = forward, 1 = right, 2 = backward, 3 = left - -- Gas left/right - {name = "techage:ta4_collider_pipe_inlet", yoffs = 1, route = {3,3,3,2}, check = techage.gas_inlet_check}, - {name = "techage:ta4_collider_pipe_inlet", yoffs = 1, route = {1,1,1,2}, check = techage.gas_inlet_check}, - -- Power left/right - {name = "techage:ta4_collider_cable_inlet", yoffs = 2, route = {3,3,3}, check = techage.power_inlet_check}, - {name = "techage:ta4_collider_cable_inlet", yoffs = 2, route = {1,1,1}, check = techage.power_inlet_check}, - -- Cooler - {name = "techage:ta4_collider_pipe_inlet", yoffs = 0, route = {0}, check = techage.cooler_check}, - {name = "techage:ta4_collider_pipe_inlet", yoffs = 2, route = {0}, check = techage.cooler_check}, - -- Air outlet - {name = "techage:ta4_collider_pipe_outlet", yoffs = 2, route = {}, check = techage.air_outlet_check}, - -- All nodes - {name = "shell", yoffs = 0, route = {}, check = nil}, -} - -local function play_sound(pos) - minetest.sound_play("techage_hum", { - pos = pos, - gain = 0.5, - max_hear_distance = 10, - }) -end - -local function terminal_message(pos, msg) - local term_num = M(pos):contains("term_num") and M(pos):get_string("term_num") - local own_num = M(pos):get_string("node_number") - - if term_num and own_num then - techage.send_single(own_num, term_num, "text", msg) - end -end - -local function experience_points(pos) - if math.random(IMPROBABILITY) == 1 then - local owner = M(pos):get_string("owner") - local own_num = M(pos):get_string("node_number") - local player = minetest.get_player_by_name(owner) - if player then - if techage.add_expoint(player, own_num) then - terminal_message(pos, "Experience point reached!") - end - end - end -end - -local function check_shell(pos, param2) - local pos1 = getpos(pos, param2, {3,3,3,2}, 0) - local pos2 = getpos(pos, param2, {1,1,1,0}, 2) - local _, tbl = minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_detector_magnet", "techage:ta4_colliderblock", "default:obsidian_glass"}) - if tbl["techage:ta4_detector_magnet"] < 16 then - return false, "Magnet missing" - elseif tbl["techage:ta4_colliderblock"] < 31 then - return false, "Steel block missing" - elseif tbl["default:obsidian_glass"] < 1 then - return false, "Obsidian glass missing" - end - return true -end - -local function check_state(pos) - -- Cyclically check all connections - local param2 = minetest.get_node(pos).param2 - local nvm = techage.get_nvm(pos) - nvm.ticks = (nvm.ticks or 0) + 1 - local idx = nvm.ticks % TIME_SLOTS - local item = Schedule[idx] - - if idx == 1 then - nvm.result = true - end - - if item then - if item.name == "shell" then - local res, err = check_shell(pos, param2) - if not res then - nvm.result = false - nvm.runnning = false - terminal_message(pos, (err or "unknown") .. "!!!") - return nvm.result - end - else - local pos2 = getpos(pos, param2, item.route, item.yoffs) - local nvm2 = techage.get_nvm(pos2) - local meta2 = M(pos2) - local node2 = minetest.get_node(pos2) - if item.name == node2.name then - local res, err = item.check(pos2, node2, meta2, nvm2) - --print("check_state", idx, res, err) - if not res then - nvm.result = false - nvm.runnning = false - terminal_message(pos, (err or "unknown") .. "!!!") - return nvm.result - end - else - nvm.result = false - nvm.runnning = false - terminal_message(pos, "Detector defect!!!") - end - end - elseif idx == #Schedule + 1 then - return nvm.result - end -end - -local function add_laser(pos) - local param2 = minetest.get_node(pos).param2 - local pos1 = getpos(pos, param2, {3,3}, 1) - local pos2 = getpos(pos, param2, {1,1,1}, 1) - techage.del_laser(pos) - techage.add_laser(pos, pos1, pos2) -end - -local function create_task(pos, task) - local mem = techage.get_mem(pos) - if not mem.co then - mem.co = coroutine.create(task) - end - - local _, err = coroutine.resume(mem.co, pos) - if err then - mem.co = nil - --print(err) - return - end - minetest.after(0.4, create_task, pos, task) -end - --- Call on_cyclic_check of all magents so that the magnets don't need a FLB. -local function magnets_on_cyclic_check(pos, nvm) - local ndef = minetest.registered_nodes["techage:ta4_magnet"] - for idx,pos2 in ipairs(nvm.magnet_positions or {}) do - local res = ndef.on_cyclic_check(pos2) - if res == -2 then - terminal_message(pos, "Magnet #" .. idx .. " defect!!!") - return false - elseif res == -1 then - terminal_message(pos, "Vacuum defect!!!") - techage.air_outlet_reset({x=pos.x, y=pos.y + 2, z=pos.z}) - return false - end - end - return true -end - --- Turn off all magnets so that they don't consume power -local function magnets_turn_off(pos, nvm) - local ndef = minetest.registered_nodes["techage:ta4_magnet"] - for idx,pos2 in ipairs(nvm.magnet_positions or {}) do - ndef.on_turn_off(pos2) - end -end - -local function cable_inlets_turn_on_off(pos, on) - local turn_on_off = function(pos, param2, item) - local pos2 = getpos(pos, param2, item.route, item.yoffs) - local node2 = minetest.get_node(pos2) - if item.name == node2.name then - local nvm = techage.get_nvm(pos2) - techage.power_inlet_turn_on_off(pos2, nvm, on) - end - end - - local param2 = minetest.get_node(pos).param2 - turn_on_off(pos, param2, Schedule[2]) - turn_on_off(pos, param2, Schedule[3]) -end - -minetest.register_node("techage:ta4_detector_core", { - description = S("TA4 Collider Detector Core"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png^techage_collider_detector_core.png", - "default_steel_block.png^techage_collider_detector_core.png", - "default_steel_block.png^techage_collider_detector_core.png", - "default_steel_block.png^techage_collider_detector_core.png", - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - local meta = M(pos) - local own_num = techage.add_node(pos, "techage:ta4_detector_core") - meta:set_string("node_number", own_num) - meta:set_string("owner", placer:get_player_name()) - M({x=pos.x, y=pos.y - 1, z=pos.z}):set_string("infotext", S("TA4 Collider Detector") .. " " .. own_num) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.running then - if not magnets_on_cyclic_check(pos, nvm) then - techage.del_laser(pos) - terminal_message(pos, "Detector stopped.") - magnets_turn_off(pos, nvm) - cable_inlets_turn_on_off(pos, false) - nvm.running = false - nvm.magnet_positions = nil - else - local res = check_state(pos) - if res == true then - experience_points(pos) - add_laser(pos) - if nvm.ticks <= TIME_SLOTS then -- only once - terminal_message(pos, "Detector running.") - end - elseif res == false then - techage.del_laser(pos) - magnets_turn_off(pos, nvm) - cable_inlets_turn_on_off(pos, false) - nvm.running = false - nvm.magnet_positions = nil - terminal_message(pos, "Detector stopped.") - end - if nvm.running then - play_sound(pos) - end - end - end - return true - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.on_remove_collider(digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, -}) - -local function check_expr(own_num, term_num, text, expr) - techage.send_single(own_num, term_num, "text", text .. "..." .. (expr and "ok" or "error!!!")) - return expr -end - -local function start_task(pos) - local term_num = M(pos):contains("term_num") and M(pos):get_string("term_num") - local param2 = minetest.get_node(pos).param2 - local pos2 = getpos(pos, param2, {3,3,3}, 1) - local own_num = M(pos):get_string("node_number") - local nvm = techage.get_nvm(pos) - nvm.magnet_positions = {} - - if term_num and param2 and pos2 then - techage.send_single(own_num, term_num, "text", "#### Start ####") - - coroutine.yield() - local resp = techage.tube_inlet_command(pos2, "enumerate", 1) - if not check_expr(own_num, term_num, "- Check number of magnets", resp == TNO_MAGNETS) then - nvm.locked = false - return - end - - coroutine.yield() - techage.send_single(own_num, term_num, "text", "- Check position of magnets...") - resp = techage.tube_inlet_command(pos2, "distance") - if resp ~= true then - techage.send_single(own_num, term_num, "append", "#" .. resp .. " defect!!!") - nvm.locked = false - return - end - techage.send_single(own_num, term_num, "append", "ok") - - coroutine.yield() - techage.send_single(own_num, term_num, "text", "- Start magnets...") - local t = {} - for num = 1, TNO_MAGNETS do - local resp = techage.tube_inlet_command(pos2, "pos", num) - if not resp or type(resp) ~= "table" then - techage.send_single(own_num, term_num, "append", "#" .. num .. " defect!!!") - nvm.magnet_positions = nil - nvm.locked = false - return - else - t[#t + 1] = resp - end - coroutine.yield() - end - nvm.magnet_positions = t - techage.send_single(own_num, term_num, "append", "ok") - cable_inlets_turn_on_off(pos, true) - - coroutine.yield() - techage.send_single(own_num, term_num, "text", "- Check magnets...") - -- The check will be performed by the timer, so wait 5 sec. - for i = 1,14 do - coroutine.yield() - end - if nvm.magnet_positions then - techage.send_single(own_num, term_num, "append", "ok") - else - nvm.locked = false - return - end - - coroutine.yield() - techage.send_single(own_num, term_num, "text", "- Check detector...") - for _,item in ipairs(Schedule)do - if item.name == "shell" then - local res, err = check_shell(pos, param2) - if not res then - techage.send_single(own_num, term_num, "append", err .. "!!!") - nvm.magnet_positions = nil - nvm.locked = false - cable_inlets_turn_on_off(pos, false) - return - end - else - local pos2 = getpos(pos, param2, item.route, item.yoffs) - local nvm2 = techage.get_nvm(pos2) - local meta2 = M(pos2) - local node2 = minetest.get_node(pos2) - if item.name == node2.name then - local res, err = item.check(pos2, node2, meta2, nvm2) - if not res then - techage.send_single(own_num, term_num, "append", err .. "!!!") - nvm.magnet_positions = nil - nvm.locked = false - cable_inlets_turn_on_off(pos, false) - return - end - else - techage.send_single(own_num, term_num, "append", "defect!!!") - nvm.magnet_positions = nil - nvm.locked = false - cable_inlets_turn_on_off(pos, false) - return - end - coroutine.yield() - end - end - techage.send_single(own_num, term_num, "append", "ok") - - coroutine.yield() - techage.send_single(own_num, term_num, "text", "Collider starting...") - nvm.ticks = 0 - nvm.running = true - end -end - -local function test_magnet(pos, payload) - local term_num = M(pos):contains("term_num") and M(pos):get_string("term_num") - local param2 = minetest.get_node(pos).param2 - local pos2 = getpos(pos, param2, {3,3,3}, 1) - local own_num = M(pos):get_string("node_number") - local magnet_num = tonumber(payload) - local res, err = techage.tube_inlet_command(pos2, "test", magnet_num) - if res then - techage.send_single(own_num, term_num, "text", "magnet #" .. magnet_num .. ": ok") - else - techage.send_single(own_num, term_num, "text", "magnet #" .. magnet_num .. ": " .. (err or "unknown error") .. "!!!") - end -end - -techage.register_node({"techage:ta4_detector_core"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "connect" then - M(pos):set_string("term_num", src) - return true - elseif topic == "start" then - -- Worker block - nvm.locked = true - create_task(pos, start_task) - return true - elseif topic == "stop" then - nvm.running = false - techage.del_laser(pos) - nvm.locked = false - magnets_turn_off(pos, nvm) - cable_inlets_turn_on_off(pos, false) - nvm.magnet_positions = nil - return "Detector stopped." - elseif topic == "status" then - if nvm.running == true then - return "running" - elseif nvm.result == false then - return "fault" - else - return "stopped" - end - elseif topic == "test"then - if payload and tonumber(payload) then - test_magnet(pos, payload) - return true - else - return "Invalid magnet number" - end - elseif topic == "points" then - local owner = M(pos):get_string("owner") - local player = minetest.get_player_by_name(owner) - if player then - local points = techage.get_expoints(player) - return "Ex. Points = " .. points - end - else - return "unsupported" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - - -minetest.register_craft({ - output = "techage:ta4_detector_core", - recipe = { - {'techage:aluminum', 'basic_materials:heating_element', 'default:steel_ingot'}, - {'default:diamond', 'techage:ta4_wlanchip', 'techage:electric_cableS'}, - {'default:steel_ingot', '', 'techage:aluminum'}, - }, -}) diff --git a/techage/collider/inlets.lua b/techage/collider/inlets.lua deleted file mode 100644 index c8ec7fa..0000000 --- a/techage/collider/inlets.lua +++ /dev/null @@ -1,375 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Tube/Pipe Inputs/Outputs as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local PWR_NEEDED = 15 -local CYCLE_TIME = 2 -local GAS_CAPA = 20 -local AIR_CAPA = 1000 - -local VTube = techage.VTube -local Pipe = techage.LiquidPipe -local Cable = techage.ElectricCable -local power = networks.power -local liquid = networks.liquid - --------------------------------------------------------------------------------- --- Tube Input --------------------------------------------------------------------------------- -minetest.register_node("techage:ta4_collider_tube_inlet", { - description = S("TA4 Collider Tube Input"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png^techage_collider_tube_open.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-4/8, -4/8, -4/8, -1/8, 4/8, 4/8}, - { 1/8, -4/8, -4/8, 4/8, 4/8, 4/8}, - {-4/8, 1/8, -4/8, 4/8, 4/8, 4/8}, - {-4/8, -4/8, -4/8, 4/8, -1/8, 4/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-4/8, -4/8, -4/8, 4/8, 4/8, 4/8}, - }, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack) - VTube:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode) - VTube:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - -VTube:add_secondary_node_names({"techage:ta4_collider_tube_inlet"}) -VTube:set_valid_sides("techage:ta4_collider_tube_inlet", {"F"}) - --- Called from the detector via tube ring -techage.register_node({"techage:ta4_collider_tube_inlet"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "distance" then - return pos - elseif topic == "enumerate" and payload then - return payload - 1 - elseif topic == "check" then - local nvm = techage.get_nvm(pos) - nvm.check_received = true - return true - end - end, -}) - --- Used by the detector to check the tube connection -function techage.tube_inlet_command(pos, command, payload) - if command == "distance" then - local pos2 = techage.transfer(pos, "F", command, payload, VTube, {"techage:ta4_magnet"}) - if type(pos2) == "table" then - local dist = math.abs(pos.x - pos2.x) + math.abs(pos.z - pos2.z) - if pos.y == pos2.y and dist == VTube.max_tube_length + 1 then - return true - end - return 0 - else - return pos2 - end - end - return techage.transfer(pos, "F", command, payload, VTube, {"techage:ta4_magnet"}) -end - -minetest.register_craft({ - output = "techage:ta4_collider_tube_inlet", - recipe = { - {'', '', ''}, - {'techage:ta4_vtubeS', 'techage:ta4_colliderblock', ''}, - {'', '', ''}, - }, -}) - --------------------------------------------------------------------------------- --- Pipe Input (gas) --------------------------------------------------------------------------------- -minetest.register_node("techage:ta4_collider_pipe_inlet", { - description = S("TA4 Collider Pipe Input"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png^techage_appl_hole_pipe.png", - }, - drawtype = "nodebox", - paramtype2 = "facedir", - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - networks = { - pipe2 = {}, - }, - - after_place_node = function(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - Pipe:after_place_node(pos) - nvm.liquid = {} - end, - - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - -liquid.register_nodes({"techage:ta4_collider_pipe_inlet"}, Pipe, "tank", {"F"}, { - capa = GAS_CAPA, - peek = function(pos, indir) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_put(nvm, name, amount, GAS_CAPA) - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_take(nvm, name, amount) - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - liquid.srv_put(nvm, name, amount, GAS_CAPA) - end, -}) - -techage.register_node({"techage:ta4_collider_pipe_inlet"}, { - on_transfer = function(pos, in_dir, topic, payload) - -- called from heatexchanger - if topic == "detector" then - local nvm = techage.get_nvm(pos) - nvm.detector_received = true - return true - end - end, -}) - --- Used by the detector to check for gas pressure -function techage.gas_inlet_check(pos, node, meta, nvm) - nvm.liquid = nvm.liquid or {} - if nvm.liquid.amount == GAS_CAPA and nvm.liquid.name == "techage:isobutane" then - return true - end - return false, "no gas" -end - --- Used by the detector to check for cooler connection -function techage.cooler_check(pos, node, meta, nvm) - if nvm.detector_received then - nvm.detector_received = nil - return true - end - return false, "Cooler defect" -end - -minetest.register_craft({ - output = "techage:ta4_collider_pipe_inlet", - recipe = { - {'', '', ''}, - {'techage:ta3_pipeS', 'techage:ta4_colliderblock', ''}, - {'', '', ''}, - }, -}) - - --------------------------------------------------------------------------------- --- Pipe Output (air) --------------------------------------------------------------------------------- -local function init_air(nvm) - nvm.liquid = { - amount = AIR_CAPA, - name = "air", - } - return nvm.liquid -end - -minetest.register_node("techage:ta4_collider_pipe_outlet", { - description = S("TA4 Collider Pipe Output"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png^techage_appl_hole_pipe.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - }, - drawtype = "nodebox", - paramtype2 = "facedir", - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - networks = { - pipe2 = {}, - }, - - after_place_node = function(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - init_air(nvm) - Pipe:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - -liquid.register_nodes({"techage:ta4_collider_pipe_outlet"}, Pipe, "tank", {"U"}, { - capa = AIR_CAPA, - peek = function(pos, indir) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_put(nvm, name, amount, AIR_CAPA) - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_take(nvm, name, amount) - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - liquid.srv_put(nvm, name, amount, AIR_CAPA) - end, -}) - --- Used by the detector to check the vacuum -function techage.air_outlet_check(pos, node, meta, nvm) - nvm.liquid = nvm.liquid or {} - if nvm.liquid.amount == 0 then - return true - end - return false, "no vacuum" -end - -function techage.air_outlet_reset(pos) - local nvm = techage.get_nvm(pos) - init_air(nvm) -end - -minetest.register_craft({ - output = "techage:ta4_collider_pipe_outlet", - recipe = { - {'', 'techage:ta3_pipeS', ''}, - {'', 'techage:ta4_colliderblock', ''}, - {'', '', ''}, - }, -}) - --------------------------------------------------------------------------------- --- Cable Input (power) --------------------------------------------------------------------------------- -minetest.register_node("techage:ta4_collider_cable_inlet", { - description = S("TA4 Collider Cable Input"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png^techage_appl_hole_electric.png", - }, - drawtype = "nodebox", - paramtype2 = "facedir", - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - networks = { - pipe2 = {}, - }, - - after_place_node = function(pos, placer, itemstack) - Cable:after_place_node(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.running then - nvm.consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - else - nvm.consumed = 0 - end - return true - end, - - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - --- Used by the detector to check for power -function techage.power_inlet_check(pos, node, meta, nvm) - if nvm.consumed == PWR_NEEDED then - return true - end - return false, "no power" -end - --- Used by the detector to turn on/off the node -function techage.power_inlet_turn_on_off(pos, nvm, on) - nvm.running = on -end - -power.register_nodes({"techage:ta4_collider_cable_inlet"}, Cable, "con", {"F"}) - -techage.register_node({"techage:ta4_collider_cable_inlet"}, { - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_craft({ - output = "techage:ta4_collider_cable_inlet", - recipe = { - {'', '', ''}, - {'techage:electric_cableS', 'techage:ta4_colliderblock', ''}, - {'', '', ''}, - }, -}) diff --git a/techage/collider/magnet.lua b/techage/collider/magnet.lua deleted file mode 100644 index 76e13ea..0000000 --- a/techage/collider/magnet.lua +++ /dev/null @@ -1,333 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Magnet as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string - -local PWR_NEEDED = 5 -local CYCLE_TIME = 2 -local CAPACITY = 10 - -local Cable = techage.ElectricCable -local Pipe = techage.LiquidPipe -local VTube = techage.VTube -local power = networks.power -local liquid = networks.liquid - -local function is_junction(pos, side) - local node = techage.get_node_lvm(techage.get_pos(pos, side)) - return node and techage.string_compare(node.name, "techage:ta3_junction") -end - --- Turn the magnet to the right direction -local function handle_legacy_magnet(pos) - if M(pos):get_string("version") ~= "V2" then - if is_junction(pos, "B") and not is_junction(pos, "F") then - local node = techage.get_node_lvm(pos) - node.param2 = (node.param2 + 2) % 4 - minetest.swap_node(pos, node) - end - end - M(pos):set_string("version", "V2") -end - -minetest.register_node("techage:ta4_colliderblock", { - description = S("TA4 Collider Steel Block"), - tiles = { - "default_steel_block.png", - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_detector_magnet", { - description = S("TA4 Collider Detector Magnet"), - tiles = { - -- up, down, right, left, back, front - "techage_collider_magnet.png^techage_collider_magnet_appl.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png", - "techage_collider_magnet.png", - "techage_collider_magnet.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png", - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_magnet", { - description = S("TA4 Collider Magnet"), - inventory_image = minetest.inventorycube( - "techage_collider_magnet.png^techage_appl_hole_electric.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png^techage_appl_hole_pipe.png^techage_collider_magnet_sign.png", - "techage_collider_magnet.png^techage_collider_magnet_tube.png"), - tiles = { - -- up, down, right, left, back, front - "techage_collider_magnet.png^techage_appl_hole_electric.png", - "techage_collider_magnet.png", - "techage_collider_magnet.png^techage_collider_magnet_tube.png", - "techage_collider_magnet.png^techage_collider_magnet_tube.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png^techage_collider_magnet_sign.png", - "techage_collider_magnet.png^techage_collider_magnet_appl.png^techage_appl_hole_pipe.png^techage_collider_magnet_sign.png", - }, - drawtype = "nodebox", - use_texture_alpha = techage.CLIP, - node_box = { - type = "fixed", - fixed = { - {-11/16, -11/16, -11/16, 11/16, 11/16, -2/16}, - {-11/16, -11/16, 2/16, 11/16, 11/16, 11/16}, - {-11/16, 2/16, -11/16, 11/16, 11/16, 11/16}, - {-11/16, -11/16, -11/16, 11/16, -2/16, 11/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-4/8, -4/8, -4/8, 4/8, 4/8, 4/8}, - }, - collision_box = { - type = "fixed", - fixed = {-11/16, -11/16, -11/16, 11/16, 11/16, 11/16}, - }, - wield_scale = {x = 0.8, y = 0.8, z = 0.8}, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack) - if pos.y > techage.collider_min_depth then - minetest.remove_node(pos) - minetest.add_item(pos, ItemStack("techage:ta4_magnet")) - return - end - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - VTube:after_place_node(pos) - M(pos):set_string("infotext", S("TA4 Collider Magnet") .. " #0") - M(pos):set_string("version", "V2") - end, - - -- To be called by the detector - on_cyclic_check = function(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.consumed = power.consume_power(pos, Cable, 6, PWR_NEEDED) - if nvm.tube_damage then - nvm.tube_damage = nil - nvm.running = nil - return -1 - elseif nvm.liquid.amount == CAPACITY and - nvm.liquid.name == "techage:isobutane" and - nvm.consumed == PWR_NEEDED then - nvm.running = true - return 0 - end - nvm.running = nil - return -2 - end, - - on_turn_off = function(pos) - local nvm = techage.get_nvm(pos) - nvm.running = nil - end, - - tubelib2_on_update2 = function(pos, outdir, tlib2, node) - if tlib2.tube_type == "vtube" then - local nvm = techage.get_nvm(pos) - nvm.tube_damage = true - elseif tlib2.tube_type == "pipe2" then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = 0 - end - end, - - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - VTube:after_dig_node(pos) - techage.del_mem(pos) - end, -}) - -power.register_nodes({"techage:ta4_magnet"}, Cable, "con", {"U"}) -liquid.register_nodes({"techage:ta4_magnet"}, Pipe, "tank", {"F"}, { - capa = CAPACITY, - peek = function(pos, indir) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_put(nvm, name, amount, CAPACITY) - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_take(nvm, name, amount) - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - liquid.srv_put(nvm, name, amount, CAPACITY) - end, -}) - -VTube:add_secondary_node_names({"techage:ta4_magnet"}) -VTube:set_valid_sides("techage:ta4_magnet", {"R", "L"}) - -local function send_to_next(pos, in_dir, topic, payload) - return techage.transfer(pos, in_dir, topic, payload, VTube, - {"techage:ta4_magnet", "techage:ta4_collider_tube_inlet"}) -end - ---[[ -Commands --------- - -distance : Check distance between all magnets. - Returns pos of next magnet or the number of the defect magnet. -enumerate : Give each magnet a unique number (1...n) -pos : Read the position -test : Test all magnet attributs. - Returns true or false, err -]]-- -techage.register_node({"techage:ta4_magnet"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "distance" then - local pos2 = send_to_next(pos, in_dir, topic, payload) - if type(pos2) == "table" then - local dist = math.abs(pos.x - pos2.x) + math.abs(pos.z - pos2.z) - if pos.y == pos2.y and dist == VTube.max_tube_length + 1 then - return pos - end - return nvm.number or 0 - else - return pos2 - end - elseif topic == "enumerate" and payload then - handle_legacy_magnet(pos) - payload = tonumber(payload) or 1 - nvm.number = payload - M(pos):set_string("infotext", S("TA4 Collider Magnet") .. " #" .. payload) - return send_to_next(pos, in_dir, topic, payload + 1) - elseif topic == "pos" then - if payload and tonumber(payload) == nvm.number then - nvm.tube_damage = nil - return pos - else - return send_to_next(pos, in_dir, topic, payload) - end - elseif topic == "test" then - if payload and tonumber(payload) == nvm.number then - if not nvm.liquid or not nvm.liquid.amount or nvm.liquid.amount < CAPACITY then - return false, "no gas" - elseif nvm.liquid.name ~= "techage:isobutane" then - return false, "wrong gas" - elseif nvm.consumed ~= PWR_NEEDED then - return false, "no power" - elseif nvm.tube_damage then - nvm.tube_damage = nil - return false, "no vacuum" - end - return true - else - return send_to_next(pos, in_dir, topic, payload) - end - end - end, -}) - -minetest.register_node("techage:ta4_magnet_base", { - description = S("TA4 Collider Magnet Base"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-6/16, -8/16, -6/16, 6/16, 5/16, 6/16}, - }, - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - is_ground_content = false, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_colliderblock", - recipe = { - {'techage:aluminum', '', 'default:steel_ingot'}, - {'', '', ''}, - {'default:steel_ingot', '', 'techage:aluminum'}, - }, -}) - - -minetest.register_craft({ - output = "techage:ta4_detector_magnet 2", - recipe = { - {'default:steel_ingot', '', 'techage:aluminum'}, - {'dye:red', 'basic_materials:gold_wire', 'dye:brown'}, - {'techage:aluminum', '', 'default:steel_ingot'}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_magnet", - recipe = { - {'techage:ta3_pipeS', '', 'techage:electric_cableS'}, - {'techage:ta4_round_ceramic', 'techage:ta4_detector_magnet', 'techage:ta4_round_ceramic'}, - {'', '', ''}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_magnet_base 4", - recipe = { - {'techage:aluminum', 'default:steel_ingot', ''}, - {'techage:aluminum', 'default:steel_ingot', ''}, - {'techage:aluminum', 'default:steel_ingot', ''}, - }, -}) - -minetest.register_lbm({ - label = "Repair Magnets", - name = "techage:magnets", - nodenames = {"techage:ta4_magnet", "techage:ta4_collider_pipe_inlet"}, - run_at_every_load = false, - action = function(pos, node) - local nvm = techage.get_nvm(pos) - if nvm.liquid and nvm.liquid.name == "techage:hydrogen" then - nvm.liquid.name = "techage:isobutane" - end - end, -}) diff --git a/techage/collider/vacuumtube.lua b/techage/collider/vacuumtube.lua deleted file mode 100644 index 9782670..0000000 --- a/techage/collider/vacuumtube.lua +++ /dev/null @@ -1,130 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Vacuum Tube as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local VTube = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4}, - max_tube_length = 5, - tube_type = "vtube", - show_infotext = false, - primary_node_names = {"techage:ta4_vtubeS", "techage:ta4_vtubeA"}, - secondary_node_names = {"techage:ta4_magnet"}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - minetest.swap_node(pos, {name = "techage:ta4_vtube"..tube_type, param2 = param2}) - end, -}) - -techage.VTube = VTube - -minetest.register_node("techage:ta4_vtubeS", { - description = S("TA4 Vacuum Tube"), - drawtype = "nodebox", - tiles = { - -- up, down, right, left, back, front - "techage_collider_tube.png^[transformR90", - "techage_collider_tube.png^[transformR90", - "techage_collider_tube.png", - "techage_collider_tube.png", - 'techage_collider_tube_open.png', - 'techage_collider_tube_open.png', - }, - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, 6/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, -6/16, 8/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not VTube:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - VTube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_vtubeA", { - description = S("TA4 Vacuum Tube"), - drawtype = "nodebox", - tiles = { - -- up, down, right, left, back, front - "techage_collider_tube.png^[transformR90", - 'techage_collider_tube.png^techage_collider_tube_open.png', - "techage_collider_tube.png", - "techage_collider_tube.png", - "techage_collider_tube.png^[transformR90", - 'techage_collider_tube.png^techage_collider_tube_open.png', - }, - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -6/16, 8/16, 8/16}, - { 6/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, 6/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, 6/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, -6/16, -6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - VTube:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 1, not_in_creative_inventory=1}, - drop = "techage:ta4_vtubeS", - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_vtubeS 4", - recipe = { - {'', 'default:steel_ingot', ''}, - {'techage:aluminum', 'dye:blue', 'techage:aluminum'}, - {'', 'default:steel_ingot', ''}, - }, -}) diff --git a/techage/collider/worker.lua b/techage/collider/worker.lua deleted file mode 100644 index 89c1793..0000000 --- a/techage/collider/worker.lua +++ /dev/null @@ -1,208 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Detector Worlker as part of the Collider - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local AssemblyPlan = { - -- y-offs, path, facedir-offs, name - -- 0 = forward, 1 = right, 2 = backward, 3 = left - - -- level 1 - -- left/right - { 1, {3,3,3,2}, 0, "techage:ta4_colliderblock"}, - { 1, {3,3,3}, 0, "techage:ta4_colliderblock"}, - { 1, {3,3,3,0}, 0, "techage:ta4_colliderblock"}, - { 1, {1,1,1,2}, 0, "techage:ta4_colliderblock"}, - { 1, {1,1,1}, 0, "techage:ta4_colliderblock"}, - { 1, {1,1,1,0}, 0, "techage:ta4_colliderblock"}, - -- front - { 1, {3,3,2}, 0, "techage:ta4_colliderblock"}, - { 1, {3,2}, 0, "techage:ta4_colliderblock"}, - { 1, {2}, 0, "techage:ta4_colliderblock"}, - { 1, {1,2}, 0, "techage:ta4_colliderblock"}, - { 1, {1,1,2}, 0, "techage:ta4_colliderblock"}, - -- back - { 1, {3,3,0}, 0, "techage:ta4_colliderblock"}, - { 1, {3,0}, 0, "techage:ta4_colliderblock"}, - { 1, {0}, 2, "techage:ta4_collider_pipe_inlet"}, - { 1, {1,0}, 0, "techage:ta4_colliderblock"}, - { 1, {1,1,0}, 0, "techage:ta4_colliderblock"}, - -- middle - { 1, {3,3}, 0, "techage:ta4_detector_magnet"}, - { 1, {3}, 0, "techage:ta4_detector_magnet"}, - { 1, {1}, 0, "techage:ta4_detector_magnet"}, - { 1, {1,1}, 0, "techage:ta4_detector_magnet"}, - - -- level 2 - -- left/right - { 2, {3,3,3,2}, 1, "techage:ta4_collider_pipe_inlet"}, - { 2, {3,3,3}, 1, "techage:ta4_collider_tube_inlet"}, - { 2, {3,3,3,0}, 0, "techage:ta4_colliderblock"}, - { 2, {1,1,1,2}, 3, "techage:ta4_collider_pipe_inlet"}, - { 2, {1,1,1}, 3, "techage:ta4_collider_tube_inlet"}, - { 2, {1,1,1,0}, 0, "techage:ta4_colliderblock"}, - -- front - { 2, {3,3,2}, 0, "techage:ta4_detector_magnet"}, - { 2, {3,2}, 0, "techage:ta4_detector_magnet"}, - { 2, {2}, 0, "default:obsidian_glass"}, - { 2, {1,2}, 0, "techage:ta4_detector_magnet"}, - { 2, {1,1,2}, 0, "techage:ta4_detector_magnet"}, - -- back - { 2, {3,3,0}, 0, "techage:ta4_detector_magnet"}, - { 2, {3,0}, 0, "techage:ta4_detector_magnet"}, - { 2, {0}, 0, "techage:ta4_colliderblock"}, - { 2, {1,0}, 0, "techage:ta4_detector_magnet"}, - { 2, {1,1,0}, 0, "techage:ta4_detector_magnet"}, - - -- level 3 - -- left/right - { 3, {3,3,3,2}, 0, "techage:ta4_colliderblock"}, - { 3, {3,3,3}, 1, "techage:ta4_collider_cable_inlet"}, - { 3, {3,3,3,0}, 0, "techage:ta4_colliderblock"}, - { 3, {1,1,1,2}, 0, "techage:ta4_colliderblock"}, - { 3, {1,1,1}, 3, "techage:ta4_collider_cable_inlet"}, - { 3, {1,1,1,0}, 0, "techage:ta4_colliderblock"}, - -- front - { 3, {3,3,2}, 0, "techage:ta4_colliderblock"}, - { 3, {3,2}, 0, "techage:ta4_colliderblock"}, - { 3, {2}, 0, "techage:ta4_colliderblock"}, - { 3, {1,2}, 0, "techage:ta4_colliderblock"}, - { 3, {1,1,2}, 0, "techage:ta4_colliderblock"}, - -- back - { 3, {3,3,0}, 0, "techage:ta4_colliderblock"}, - { 3, {3,0}, 0, "techage:ta4_colliderblock"}, - { 3, {0}, 2, "techage:ta4_collider_pipe_inlet"}, - { 3, {1,0}, 0, "techage:ta4_colliderblock"}, - { 3, {1,1,0}, 0, "techage:ta4_colliderblock"}, - -- middle - { 3, {3,3}, 0, "techage:ta4_detector_magnet"}, - { 3, {3}, 0, "techage:ta4_detector_magnet"}, - { 3, {}, 0, "techage:ta4_collider_pipe_outlet"}, - { 3, {1}, 0, "techage:ta4_detector_magnet"}, - { 3, {1,1}, 0, "techage:ta4_detector_magnet"}, - - -- Core block - { 1, {}, 0, "techage:ta4_detector_core"}, -} - -local t = {} -for name, cnt in pairs(techage.assemble.count_items(AssemblyPlan)) do - t[#t + 1] = " - " .. cnt .. " " .. name -end -local LABEL = table.concat(t, "\n") - -local function build(pos, player_name) - minetest.chat_send_player(player_name, S("[TA4] Detector is being built!")) - local inv = M(pos):get_inventory() - techage.assemble.build_inv(pos, inv, AssemblyPlan, player_name) -end - -local function remove(pos, player_name) - minetest.chat_send_player(player_name, S("[TA4] Detector is being removed!")) - local inv = M(pos):get_inventory() - techage.assemble.remove_inv(pos, inv, AssemblyPlan, player_name) -end - - -local function formspec() - return "size[8,8.2]".. - "list[context;src;5,0;3,3;]".. - "label[0.2,-0.2;" .. S("Item list") .. ":\n" .. LABEL .. "]" .. - "button_exit[0,3.5;4,1;build;" .. S("Build detector") .. "]" .. - "button_exit[4,3.5;4,1;remove;" .. S("Remove detector") .. "]" .. - "list[current_player;main;0,4.5;8,4;]".. - "listring[context;src]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:ta4_collider_detector_worker", { - description = S("TA4 Collider Detector Worker"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png^techage_collider_detector_appl.png^techage_collider_detector_banner.png", - "default_steel_block.png^techage_collider_detector_banner.png", - "default_steel_block.png^techage_collider_detector_banner.png", - "default_steel_block.png^techage_collider_detector_banner.png", - "default_steel_block.png^techage_collider_detector_banner.png", - "default_steel_block.png^techage_collider_detector_appl.png^techage_collider_detector_banner.png", - }, - paramtype2 = "facedir", - groups = {cracky = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack) - if pos.y > (techage.collider_min_depth - 2) then - minetest.remove_node(pos) - minetest.add_item(pos, ItemStack("techage:ta4_collider_detector_worker")) - return - end - local inv = M(pos):get_inventory() - inv:set_size("src", 9) - M(pos):set_string("formspec", formspec()) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - if fields.build then - if not nvm.assemble_locked then - build(pos, player:get_player_name()) - end - elseif fields.remove then - if not nvm.assemble_locked then - local nvm = techage.get_nvm({x=pos.x, y=pos.y + 1, z=pos.z}) - if not nvm.locked then - remove(pos, player:get_player_name()) - end - end - end - end, - - after_dig_node = function(pos, oldnode) - techage.del_mem(pos) - end, - - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked or nvm.assemble_build then - minetest.after(30, function(pos) - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - end, pos) - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("src") - end, -}) - - -minetest.register_craft({ - output = "techage:ta4_collider_detector_worker", - recipe = { - {'techage:aluminum', 'default:chest', 'default:steel_ingot'}, - {'', 'basic_materials:gear_steel', ''}, - {'default:steel_ingot', 'default:mese_crystal', 'techage:aluminum'}, - }, -}) diff --git a/techage/digtron/battery.lua b/techage/digtron/battery.lua deleted file mode 100644 index 5e5b6c0..0000000 --- a/techage/digtron/battery.lua +++ /dev/null @@ -1,175 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - Copyright (C) 2020 Thomas S. - - AGPL v3 - See LICENSE.txt for more information - - Electricity powered battery for Digtron - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 4 -local INV_SIZE = 4 -local FUEL = "default:coal_lump" -local FUEL_STACK_MAX = ItemStack(FUEL):get_stack_max() -local TOTAL_MAX = INV_SIZE * FUEL_STACK_MAX - -local function count_coal(metadata) - local total = 0 - for _,stack in pairs(metadata.inventory.fuel or {}) do - total = total + stack:get_count() - end - return total -end - -local function formspec(self, pos, nvm) - local meta = M(pos):to_table() - local total = 0 - if meta.inventory then - total = count_coal(meta) - end - return "size[5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;4.8,0.5;#c6e8ff]".. - "label[1,-0.1;"..minetest.colorize("#000000", S("Digtron Battery")).."]".. - techage.formspec_label_bar(pos, 0, 0.8, S("Load"), TOTAL_MAX, total, S("Coal Equivalents")).. - "image_button[2.6,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2.6,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "image[3.75,2;1,1;"..techage.get_power_image(pos, nvm).."]" -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - return 0 -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - return 0 -end - -local function produce_coal(pos, crd, nvm, inv) - local stack = ItemStack(FUEL) - if inv:room_for_item("fuel", stack) then - inv:add_item("fuel", stack) - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - else - crd.State:idle(pos, nvm) - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - produce_coal(pos, crd, nvm, inv) - - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - - -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG - -tiles = { - -- up, down, right, left, back, front - "digtron_plate.png^digtron_core.png", - "digtron_plate.png^digtron_core.png", - "digtron_plate.png^digtron_battery.png", - "digtron_plate.png^digtron_battery.png", - "digtron_plate.png^digtron_battery.png", - "digtron_plate.png^digtron_battery.png", -} - -local tubing = { - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, -} - -local node_name_ta2, node_name_ta3, node_name_ta4 = -techage.register_consumer("digtron_battery", S("Digtron Battery"), { act = tiles, pas = tiles }, { - drawtype = "normal", - paramtype = "light", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer, itemstack) - local inv = M(pos):get_inventory() - inv:set_size('fuel', INV_SIZE) - if itemstack then - local stack_meta = itemstack:get_meta() - if stack_meta then - local coal_amount = techage.in_range(stack_meta:get_int("coal"), 0, TOTAL_MAX) - while coal_amount > 0 do - local amount = math.min(coal_amount, FUEL_STACK_MAX) - inv:add_item("fuel", ItemStack(FUEL.." "..amount)) - coal_amount = coal_amount - amount; - end - end - end - end, - preserve_metadata = function(pos, oldnode, oldmetadata, drops) - local metadata = M(pos):to_table() - if metadata.inventory then - local total = count_coal(metadata) - local meta = drops[1]:get_meta() - meta:set_int("coal", total) - local text = S("Digtron Battery").." ("..math.floor(total/TOTAL_MAX * 100).." %)" - meta:set_string("description", text) - end - end, - on_rightclick = function(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2, digtron=5}, - sounds = default.node_sound_wood_defaults(), - power_consumption = {0,25,25,25}, - power_sides = {L=1, R=1, U=1, D=1, F=1, B=1}, -}, {false, false, true, false}) - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"group:wood", "default:copper_ingot", "group:wood"}, - {"techage:electric_cableS", "default:tin_ingot", "digtron:digtron_core"}, - {"group:wood", "default:copper_ingot", "group:wood"}, - }, -}) diff --git a/techage/doc/guide.lua b/techage/doc/guide.lua deleted file mode 100644 index b4153a7..0000000 --- a/techage/doc/guide.lua +++ /dev/null @@ -1,279 +0,0 @@ ---[[ - -]]-- - -local S = techage.S -local M = minetest.get_meta -local MP = minetest.get_modpath("techage") - -local settings = { - symbol_item = "techage:construction_board_EN", -} - -doclib.create_manual("techage", "DE", settings) -doclib.create_manual("techage", "EN", settings) -doclib.create_manual("techage", "pt-BR", settings) -doclib.create_manual("techage", "RU", settings) - -local content -content = dofile(MP.."/doc/manual_DE.lua") -doclib.add_to_manual("techage", "DE", content) -content = dofile(MP.."/doc/manual_ta1_DE.lua") -doclib.add_to_manual("techage", "DE", content) -content = dofile(MP.."/doc/manual_ta2_DE.lua") -doclib.add_to_manual("techage", "DE", content) -content = dofile(MP.."/doc/manual_ta3_DE.lua") -doclib.add_to_manual("techage", "DE", content) -content = dofile(MP.."/doc/manual_ta4_DE.lua") -doclib.add_to_manual("techage", "DE", content) -content = dofile(MP.."/doc/manual_ta5_DE.lua") -doclib.add_to_manual("techage", "DE", content) - -content = dofile(MP.."/doc/manual_EN.lua") -doclib.add_to_manual("techage", "EN", content) -content = dofile(MP.."/doc/manual_ta1_EN.lua") -doclib.add_to_manual("techage", "EN", content) -content = dofile(MP.."/doc/manual_ta2_EN.lua") -doclib.add_to_manual("techage", "EN", content) -content = dofile(MP.."/doc/manual_ta3_EN.lua") -doclib.add_to_manual("techage", "EN", content) -content = dofile(MP.."/doc/manual_ta4_EN.lua") -doclib.add_to_manual("techage", "EN", content) -content = dofile(MP.."/doc/manual_ta5_EN.lua") -doclib.add_to_manual("techage", "EN", content) - -content = dofile(MP.."/doc/manual_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_ta1_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_ta2_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_ta3_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_ta4_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_ta5_RU.lua") -doclib.add_to_manual("techage", "RU", content) -content = dofile(MP.."/doc/manual_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) -content = dofile(MP.."/doc/manual_ta1_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) -content = dofile(MP.."/doc/manual_ta2_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) -content = dofile(MP.."/doc/manual_ta3_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) -content = dofile(MP.."/doc/manual_ta4_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) -content = dofile(MP.."/doc/manual_ta5_pt-BR.lua") -doclib.add_to_manual("techage", "pt-BR", content) - -local board_box = { - type = "wallmounted", - wall_side = {-16/32, -11/32, -16/32, -15/32, 6/16, 8/16}, -} - -minetest.register_node("techage:construction_board", { - description = "TA Konstruktionsplan (DE)", - inventory_image = 'techage_constr_plan_inv_de.png', - tiles = {"techage_constr_plan_de.png"}, - drawtype = "nodebox", - node_box = board_box, - selection_box = board_box, - - after_place_node = function(pos, placer, itemstack) - M(pos):set_string("infotext", "TA Konstruktionsplan (DE)") - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "DE")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "DE", fields)) - end, - - paramtype2 = "wallmounted", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:construction_board", - recipe = { - {"default:stick", "default:stick", "default:stick"}, - {"default:paper", "default:paper", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - }, -}) - -minetest.register_node("techage:construction_board_EN", { - description = "TA Construction Board (EN)", - inventory_image = 'techage_constr_plan_inv.png', - tiles = {"techage_constr_plan.png"}, - drawtype = "nodebox", - node_box = board_box, - selection_box = board_box, - - after_place_node = function(pos, placer, itemstack) - M(pos):set_string("infotext", "TA Construction Board (EN)") - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "EN")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "EN", fields)) - end, - - paramtype2 = "wallmounted", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:construction_board_EN", - recipe = { - {"default:stick", "default:paper", "default:stick"}, - {"default:paper", "default:paper", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - }, -}) - -minetest.register_node("techage:construction_board_RU", { - description = "TA Construction Board (RU)", - inventory_image = 'techage_constr_plan_inv_ru.png', - tiles = {"techage_constr_plan_ru.png"}, - drawtype = "nodebox", - node_box = board_box, - selection_box = board_box, - - after_place_node = function(pos, placer, itemstack) - M(pos):set_string("infotext", "План строительства ТА (RU)") - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "RU")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "RU", fields)) - end, - - paramtype2 = "wallmounted", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:construction_board_RU", - recipe = { - {"default:paper", "default:paper", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - }, -}) - -minetest.register_node("techage:construction_board_pt_BR", { - description = "TA Placa de construção (pt-BR)", - inventory_image = 'techage_constr_plan_inv_br.png', - tiles = {"techage_constr_plan_br.png"}, - drawtype = "nodebox", - node_box = board_box, - selection_box = board_box, - - after_place_node = function(pos, placer, itemstack) - M(pos):set_string("infotext", "TA Placa de construção (pt-BR)") - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "pt-BR")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - M(pos):set_string("formspec", doclib.formspec(pos, "techage", "pt-BR", fields)) - end, - - paramtype2 = "wallmounted", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:construction_board_pt_BR", - recipe = { - {"default:stick", "default:stick", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - {"default:paper", "default:paper", "default:paper"}, - }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:construction_board_EN", - recipe = {"techage:construction_board"}, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:construction_board_RU", - recipe = { "techage:construction_board_EN" }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:construction_board_pt_BR", - recipe = {"techage:construction_board_RU"}, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:construction_board", - recipe = {"techage:construction_board_pt_BR"}, -}) - --- --- Legacy API functions --- -function techage.add_to_manual(language, titles, texts, items, plans) - local content = {titles = titles, texts = texts, images = items or {}, plans = plans or {}} - doclib.add_to_manual("techage", language, content) -end - -function techage.add_manual_items(table_with_items) - for name, image in pairs(table_with_items) do - doclib.add_manual_image("techage", "EN", name, image) - doclib.add_manual_image("techage", "DE", name, image) - doclib.add_manual_image("techage", "pt-BR", name, image) - doclib.add_manual_image("techage", "RU", name, image) - end -end - -function techage.add_manual_plans(table_with_plans) - for name, plan in pairs(table_with_plans) do - doclib.add_manual_plan("techage", "EN", name, plan) - doclib.add_manual_plan("techage", "DE", name, plan) - doclib.add_manual_plan("techage", "RU", name, plan) - doclib.add_manual_plan("techage", "pt-BR", name, plan) - end -end diff --git a/techage/doc/items.lua b/techage/doc/items.lua deleted file mode 100644 index b3e8953..0000000 --- a/techage/doc/items.lua +++ /dev/null @@ -1,234 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA Items Table - -]]-- - -local items = { - techage_ta1 = "techage_ta1.png", - iron = "techage:iron_ingot", - charcoal = "techage:charcoal", - lighter = "techage:lighter", - ta1_gravelsieve = "techage:sieve3", - hammer = "techage:hammer_bronze", - meridium = "techage:meridium_ingot", - baborium = "techage:stone_with_baborium", - bauxite = "techage:bauxite_stone", - usmium = "techage:usmium_nuggets", - basalt = "techage:basalt_stone", - oil = "techage:oil_source", - ta1_hopper = "techage:hopper_ta1", - wlanchip = "techage:ta4_wlanchip", - tube = "techage:tubeS", - concentrator = "techage:concentrator27", - ta1_sluice = "techage:ta1_sluice_closed", - ta1_sluice_handle = "techage:ta1_sluice_handle_closed", - ta1_board1 = "techage:ta1_board1_apple", - ta1_board2 = "techage:ta1_board2_apple", - ---------------- - techage_ta2 = "techage_ta2.png", - ta2_firebox = "techage:firebox", - ta2_boiler = "techage:boiler2", - ta2_cylinder = "techage:cylinder", - ta2_flywheel = "techage:flywheel", - ta2_steampipe = "techage:steam_pipeS", - ta2_distributor = "techage:ta2_distributor_pas", - ta2_pusher = "techage:ta2_pusher_pas", - ta2_gravelrinser = "techage:ta2_rinser_pas", - ta2_grinder = "techage:ta2_grinder_pas", - ta2_quarry = "techage:ta2_quarry_pas", - ta2_autocrafter = "techage:ta2_autocrafter_pas", - ta2_electronicfab = "techage:ta2_electronic_fab_pas", - ta2_gravelsieve = "techage:ta2_gravelsieve_pas", - ta2_liquidsampler = "techage:ta2_liquidsampler_pas", - ta2_rinser = "techage:ta2_rinser_pas", - ta2_chest = "techage:chest_ta2", - ta2_forceload = "techage:forceload", - ta2_driveaxle = "techage:axle", - ta2_generator = "techage:ta2_generator_off", - ta2_winch = "techage:ta2_winch", - ta2_weight_chest = "techage:ta2_weight_chest", - --------------------- - techage_ta3 = "techage_ta3.png", - techage_ta31 = "techage_ta3b.png", - ta3_firebox = "techage:coalfirebox", - ta3_oilbox = "techage:oilfirebox", - ta3_boiler = "techage:coalboiler_top", - ta3_turbine = "techage:turbine", - ta3_generator = "techage:generator", - ta3_cooler = "techage:cooler", - ta3_distributor = "techage:ta3_distributor_pas", - ta3_pusher = "techage:ta3_pusher_pas", - ta3_gravelrinser = "techage:ta3_rinser_pas", - ta3_grinder = "techage:ta3_grinder_pas", - ta3_quarry = "techage:ta3_quarry_pas", - ta3_autocrafter = "techage:ta3_autocrafter_pas", - ta3_electronicfab = "techage:ta3_electronic_fab_pas", - ta3_gravelsieve = "techage:ta3_gravelsieve_pas", - ta3_liquidsampler = "techage:ta3_liquidsampler_pas", - ta3_powercable = "techage:electric_cableS", - ta3_powerline = "techage:power_lineS", - ta3_powerswitch = "techage:powerswitch", - ta3_powerswitchsmall = "techage:powerswitchsmall", - ta3_powerjunction = "techage:electric_junction0", - ta3_powerpole = "techage:power_pole3", - ta3_powerpole2 = "techage:power_pole2", - ta3_powerpole4 = "techage:power_pole", - ta3_powerswitchbox = "techage:powerswitch_box", - ta3_powerterminal = "techage:ta3_power_terminal", - ta3_trowel = "techage:trowel", - ta3_screwdriver = "techage:screwdriver", - ta3_tinygenerator = "techage:tiny_generator", - ta3_akkublock = "techage:ta3_akku", - ta3_furnace = "techage:ta3_furnace_pas", - ta3_furnacefirebox = "techage:furnace_firebox", - ta3_booster = "techage:ta3_booster", - ta3_oilexplorer = "techage:oilexplorer", - ta3_drillbox = "techage:ta3_drillbox_pas", - ta3_pumpjack = "techage:ta3_pumpjack_pas", - ta3_drillbit = "techage:oil_drillbit", - ta3_end_wrench = "techage:end_wrench", - ta3_tank = "techage:ta3_tank", - ta3_pump = "techage:t3_pump", - oiltank = "techage:oiltank", - reboiler = "techage:ta3_reboiler", - ta3_filler = "techage:filler", - tank_cart = "techage:tank_cart", - chest_cart = "techage:chest_cart", - ---------------------------- - ta3_button = "techage:ta3_button_off", - ta3_cartdetector = "techage:ta3_cartdetector_off", - ta3_detector = "techage:ta3_detector_off", - ta3_logic = "techage:ta3_logic", - ta3_nodedetector = "techage:ta3_nodedetector_off", - ta3_playerdetector = "techage:ta3_playerdetector_off", - ta3_lightdetector = "techage:ta3_lightdetector_off", - ta3_repeater = "techage:ta3_repeater", - ta3_sequencer = "techage:ta3_sequencer", - ta3_timer = "techage:ta3_timer", - ta3_terminal = "techage:terminal2", - ta3_colorlamp = "techage:color_lamp_off", - ta3_doorblock = "techage:doorblock20", - ta3_soundblock = "techage:ta3_soundblock", - ta3_programmer = "techage:programmer", - ta3_doorcontroller = "techage:ta3_doorcontroller", - ta3_drill_pipe_wrench = "techage:ta3_drill_pipe_wrench", - ta3_pipe = "techage:ta3_pipeS", - ta3_pipe_wall_entry = "techage:ta3_pipe_wall_entry", - ta3_mesecons_converter = "techage:ta3_mesecons_converter", - ta3_valve = "techage:ta3_valve_closed", - ta3_motor = "techage:ta3_motor_off", - ta3_injector = "techage:ta3_injector_pas", - ta3_command_converter = "techage:ta3_command_converter_off", - ta3_flipflop = "techage:ta3_flipflop_off", - ---------------------------- - techage_ta4 = "techage_ta4.png", - techage_ta4c = "techage_ta4c.png", - ta4_windturbine = "techage:ta4_wind_turbine", - ta4_pillar = "techage:pillar", - ta4_blinklamp = "techage:rotor_signal_lamp_off", - ta4_nacelle = "techage:ta4_wind_turbine_nacelle", - ta4_minicell = "techage:ta4_solar_minicell", - ta4_pipe = "techage:ta4_pipeS", - ta4_tube = "techage:ta4_tubeS", - ta4_junctionpipe = "techage:ta4_junctionpipe25", - ta4_pipeinlet = "techage:ta4_pipe_inlet", - ta4_turbine = "techage:ta4_turbine", - ta4_generator = "techage:ta4_generator", - ta4_heatexchanger = "techage:heatexchanger3", - ta4_powercable = "techage:ta4_power_cableS", - ta4_powerbox = "techage:ta4_power_box", - ta4_solarmodule = "techage:ta4_solar_module", - ta4_solarcarrier = "techage:ta4_solar_carrier", - ta4_solar_inverter = "techage:ta4_solar_inverter", - techage_ta4_solar = "techage_ta4_solar.png", - ta4_hydrogen = "techage_hydrogen_inv.png", - ta4_electrolyzer = "techage:ta4_electrolyzer", - ta4_fuelcell = "techage:ta4_fuelcell", - ta4_reactor = "techage:ta4_reactor", - ta4_tank = "techage:ta4_tank", - ta4_pump = "techage:t4_pump", - ta4_doser = "techage:ta4_doser", - ta4_silo = "techage:ta4_silo", - ta4_fillerpipe = "techage:ta4_reactor_fillerpipe", - ta4_reactorstand = "techage:ta4_reactor_stand", - ta4_reactorbase = "techage:ta4_reactor_base", - ta4_furnaceheater = "techage:furnace_heater", - ta4_waterpump = "techage:t4_waterpump", - ta4_icta_controller = "techage:ta4_icta_controller", - ta4_battery = "techage:ta4_battery", - ta4_display = "techage:ta4_display", - ta4_displayXL = "techage:ta4_displayXL", - ta4_signaltower = "techage:ta4_signaltower", - ta4_lua_controller = "techage:ta4_lua_controller", - ta4_lua_server = "techage:ta4_server", - ta4_sensor_chest = "techage:ta4_sensor_chest", - ta4_terminal = "techage:ta4_terminal", - ta4_button = "techage:ta4_button_off", - ta4_playerdetector = "techage:ta4_playerdetector_off", - ta4_collector = "techage:ta4_collector", - ta4_pusher = "techage:ta4_pusher_pas", - ta4_distributor = "techage:ta4_distributor_pas", - ta4_high_performance_distributor = "techage:ta4_high_performance_distributor_pas", - ta4_gravelsieve = "techage:ta4_gravelsieve_pas", - ta4_grinder = "techage:ta4_grinder_pas", - ta4_detector = "techage:ta4_detector_off", - ta4_chest = "techage:chest_ta4", - ta4_8x2000_chest = "techage:ta4_chest", - ta4_growlight = "techage:growlight_on", - ta4_streetlamp = "techage_ta4_streetlamp.png", - ta4_industriallamp = "techage:industriallamp4_off", - ta4_quarry = "techage:ta4_quarry_pas", - ta4_electronicfab = "techage:ta4_electronic_fab_pas", - ta4_injector = "techage:ta4_injector_pas", - ta4_liquid_filter = "techage_ta4_filter.png", - ta4_recycler = "techage:ta4_recycler_pas", - ta4_waterinlet = "techage:ta4_waterinlet", - ta4_laser = "techage:ta4_laser_emitter", - ta4_concentrator = "techage:ta4_concentrator27", - ta4_electricmeter = "techage:ta4_electricmeter", - ta4_transformer = "techage:ta4_transformer", - power_reduction = "techage_power_reduction.png", - ta4_button_2x = "techage:ta4_button_2x", - ta4_button_4x = "techage:ta4_button_4x", - ta4_sequencer = "techage:ta4_sequencer", - ta4_movecontroller = "techage:ta4_movecontroller", - ta4_turncontroller = "techage:ta4_turncontroller", - ta4_signallamp_2x = "techage:ta4_signallamp_2x", - ta4_signallamp_4x = "techage:ta4_signallamp_4x", - ta4_terminal = "techage:terminal3", - ta4_autocrafter = "techage:ta4_autocrafter_pas", - ta4_recipeblock = "techage:ta4_recipeblock", - ta4_chargedetector = "techage:ta4_chargedetector_off", - ta4_gaze_sensor = "techage:ta4_gaze_sensor_off", - ta4_nodedetector = "techage:ta4_nodedetector_off", - ---------------------------- - techage_ta5 = "techage:ta5_fr_nucleus", - ta5_flycontroller = "techage:ta5_flycontroller", - ta5_aichip = "techage:ta5_aichip", - ta5_aichip2 = "techage:ta5_aichip2", - ta5_tele_pipe = "techage:ta5_tele_pipe", - ta5_tele_tube = "techage:ta5_tele_tube", - ta5_chest = "techage:ta5_hl_chest", - ta5_tank = "techage:ta5_hl_tank", - ta5_magnet = "techage:ta5_magnet1", - ta5_pump = "techage:ta5_pump", - ta5_fr_shell = "techage:ta5_fr_shell", - ta5_fr_nucleus = "techage:ta5_fr_nucleus", - ta5_fr_controller = "techage:ta5_fr_controller_pas", -} - -for name, image in pairs(items) do - doclib.add_manual_image("techage", "DE", name, image) - doclib.add_manual_image("techage", "EN", name, image) - doclib.add_manual_image("techage", "pt-BR", name, image) - doclib.add_manual_image("techage", "RU", name, image) -end diff --git a/techage/doc/manual_DE.lua b/techage/doc/manual_DE.lua deleted file mode 100644 index 399f705..0000000 --- a/techage/doc/manual_DE.lua +++ /dev/null @@ -1,132 +0,0 @@ -return { - titles = { - "1,Tech Age Mod", - "2,Hinweise", - "2,Änderungen ab Version 1.0", - "3,Tipps zur Umstellung", - "2,Erze und Mineralien", - "3,Meridium", - "3,Usmium", - "3,Baborium", - "3,Erdöl", - "3,Bauxit", - "3,Basalt", - }, - texts = { - "Tech Age ist eine Technik-Mod mit 5 Entwicklungsstufen:\n".. - "\n".. - "TA1: Eisenzeitalter (Iron Age)\n".. - "Benutze Werkzeuge und Hilfsmittel wie Köhler\\, Kohlebrenner\\, Kiessieb\\, Hammer\\, Hopper um notwendige Erze und Metalle zu schürfen und zu verarbeiten.\n".. - "\n".. - "TA2: Dampfzeitalter (Steam Age)\n".. - "Baue eine Dampfmaschine mit Antriebsachsen und betreibe damit deine ersten Maschinen zur Verarbeitung von Erzen.\n".. - "\n".. - "TA3: Ölzeitalter (Oil Age)\n".. - "Suche und fördere Öl\\, baute Schienenwege zur Ölbeförderung. Ein Kraftwerk liefert den notwendigen Strom für deine Maschinen. Elektrisches Licht erhellt deine Industrieanlagen.\n".. - "\n".. - "TA4: Gegenwart (Present)\n".. - "Regenerative Energiequellen wie Wind\\, Sonne und Biokraft helfen dir\\, das Ölzeitalter zu verlassen. Mit modernen Technologien und intelligenten Maschinen machst du dich auf in die Zukunft.\n".. - "\n".. - "TA5: Zukunft (Future)\n".. - "Maschinen zur Überwindung von Raum und Zeit\\, neue Energiequellen und andere Errungenschaften prägen dein Leben.\n".. - "\n".. - "Hinweis: Mit Klicken auf die Pluszeichen kommst du in die Unterkapitel dieser Anleitung.\n".. - "\n".. - "\n".. - "\n", - "Diese Dokumentation ist sowohl \"ingame\" (Block Konstruktionsplan) als auch auf GitHub als MD-Files verfügbar.\n".. - "\n".. - " - Link: https://github.com/joe7575/techage/wiki\n".. - "\n".. - "Die Konstruktionspläne (Diagramme) für den Aufbau der Maschinen sowie die Bilder sind aber nur ingame verfügbar.\n".. - "\n".. - "Bei Tech Age musst du von vorne beginnen. Nur mit den Items aus TA1 kannst du TA2 Blöcke herstellen\\, für TA3 benötigst du die Ergebnisse aus TA2\\, usw.\n".. - "\n".. - "In TA2 laufen die Maschinen nur mit Antriebsachsen.\n".. - "\n".. - "Ab TA3 laufen die Maschinen mit Strom und besitzen eine Kommunikationsschnittstelle zur Fernsteuerung.\n".. - "\n".. - "Mit TA4 kommen weitere Stromquellen dazu\\, aber auch höhere logistische Herausforderungen (Stromtrassen\\, Item Transport).\n".. - "\n", - "Ab V1.0 (17.07.2021) hat sich folgendes geändert:\n".. - "\n".. - " - Der Algorithmus zur Berechnung der Stromverteilung hat sich geändert. Energiespeichersystem werden dadurch wichtiger. Diese gleichen Schankungen aus\\, was bei größeren Netzen mit mehreren Generatoren wichtig wird.\n".. - " - Aus diesem Grund hat TA2 seinen eigenen Energiespeicher erhalten.\n".. - " - Die Akkublöcke aus TA3 dienen auch als Energiespeicher. Ihre Funktionsweise wurde entsprechend angepasst.\n".. - " - Das TA4 Speichersystem wurde überarbeitet. Die Wärmetauscher (heatexchanger) haben eine neue Nummer bekommen\\, da die Funktionalität vom unteren in den mittleren Block verschoben wurde. Sofern diese ferngesteuert wurden\\, muss die Knotennummer angepasst werden. Die Generatoren haben kein eigenes Menü mehr\\, sondern werden nur noch über den Wärmetauscher ein-/ausgeschaltet. Wärmetauscher und Generator müssen jetzt am gleichen Netz hängen!\n".. - " - Mehrere Stromnetze können jetzt über einen TA4 Transformator Blöcke gekoppelt werden.\n".. - " - Neu ist auch ein TA4 Stromzähler Block für Unternetze.\n".. - "\n", - "Viele weitere Blöcke haben kleinere Änderungen bekommen. Daher kann es sein\\, dass Maschinen oder Anlagen nach der Umstellung nicht gleich wieder anlaufen. Sollte es zu Störungen kommen\\, helfen folgende Tipps:\n".. - "\n".. - " - Maschinen aus- und wieder eingeschalten\n".. - " - ein Stromkabel-Block entfernen und wieder setzen\n".. - " - den Block ganz entfernen und wieder setzen\n".. - " - mindestens ein Akkublock oder Speichersystem in jedes Netzwerk\n".. - "\n", - "Techage fügt dem Spiel einige neue Items hinzu:\n".. - "\n".. - " - Meridium - eine Legierung zur Herstellung von leuchtenden Werkzeugen in TA1\n".. - " - Usmium - ein Erz\\, was in TA2 gefördert und für TA3 benötigt wird\n".. - " - Baborium - ein Metall\\, welches für Rezepte in TA3 benötigt wird\n".. - " - Erdöl - wird in TA3 benötigt\n".. - " - Bauxit - ein Aluminiumerz\\, was in TA4 zur Herstellung von Aluminium benötigt wird\n".. - " - Basalt - entsteht\\, wenn sich Wasser und Lave berühren\n".. - "\n", - "Meridium ist eine Legierung aus Stahl und Mesekristallen. Meridium Ingots können mit dem Kohlebrenner aus Stahl und Mesesplitter hergestellt werden. Meridium leuchtet im Dunkeln. Auch Werkzeuge aus Meridium leuchten und sind daher im Untertagebau sehr hilfreich.\n".. - "\n".. - "\n".. - "\n", - "Usmium kommt nur als Nuggets vor und kann nur beim Waschen von Kies mit der TA2/TA3 Kieswaschanlage gewonnen werden.\n".. - "\n".. - "\n".. - "\n", - "Barborium kann nur im Untertagebau gewonnen werden. Diesen Stoff findet man nur in einer Tiefe von -250 bis -340 Metern.\n".. - "Baborium kann nur im TA3 Industrieofen geschmolzen werden.\n".. - "\n".. - "\n".. - "\n", - "Erdöl kann nur mit Hilfe des Explorers gefunden und mit Hilfe entsprechender TA3 Maschinen gefördert werden. Siehe TA3.\n".. - "\n".. - "\n".. - "\n", - "Bauxit wird nur im Untertagebau gewonnen. Bauxit findet man nur in Stein in einer Höhe zwischen -50 und -500 Meter.\n".. - "Es wird zur Herstellung von Aluminium benötigt\\, was vor allem in TA4 Verwendung findet.\n".. - "\n".. - "\n".. - "\n", - "Basalt entsteht nur\\, wenn Lava und Wasser zusammen kommen.\n".. - "Dazu sollte man am besten eine Anlage aufbauen\\, bei der eine Lava- und eine Wasserquelle zusammenfließen.\n".. - "Dort wo sich beide Flüssigkeiten treffen\\, entsteht Basalt.\n".. - "Einen automatisierten Basalt Generator kann man mit dem Sign Bot aufbauen.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta4", - "", - "", - "", - "", - "meridium", - "usmium", - "baborium", - "oil", - "bauxite", - "basalt", - }, - plans = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_EN.lua b/techage/doc/manual_EN.lua deleted file mode 100644 index 246392e..0000000 --- a/techage/doc/manual_EN.lua +++ /dev/null @@ -1,144 +0,0 @@ -return { - titles = { - "1,Tech Age Mod", - "2,Hints", - "2,Changes from version 1.0", - "3,Tips on switching", - "2,Ores and Minerals", - "3,Meridium", - "3,Usmium", - "3,Baborium", - "3,Petroleum", - "3,Bauxite", - "3,Basalt", - "2,History", - }, - texts = { - "Tech Age is a technology mod with 5 development stages:\n".. - "\n".. - "TA1: Iron Age\n".. - "Use tools and aids such as coal burners\\, coal burners\\, gravel sieves\\, hammers and hoppers to mine and process the necessary ores and metals.\n".. - "\n".. - "TA2: Steam Age\n".. - "Build a steam engine with drive axles and use it to operate your first ore processing machines.\n".. - "\n".. - "TA3: Oil Age\n".. - "Find and extract oil\\, built railways for oil transportation. A power plant provides the necessary electricity for your machines. Electric light illuminates your industrial plants.\n".. - "\n".. - "TA4: Present\n".. - "Renewable energy sources such as wind\\, sun and bio-fuels help you to leave the oil age. With modern technologies and intelligent machines you set out into the future.\n".. - "\n".. - "TA5: Future\n".. - "Machines to overcome space and time\\, new sources of energy and other achievements shape your life.\n".. - "\n".. - "Note: With a click on the plus sign you get into the sub-chapters of this manual.\n".. - "\n".. - "\n".. - "\n", - "This documentation is available both \"ingame\" (block construction plan) and on GitHub as MD files.\n".. - "\n".. - " - Link: https://github.com/joe7575/techage/wiki\n".. - "\n".. - "The construction plans (diagrams) for the construction of the machines and the pictures are only available in-game.\n".. - "\n".. - "With Tech Age you have to start over. You can only create TA2 blocks with the items from TA1\\, for TA3 you need the results from TA2\\, etc.\n".. - "\n".. - "In TA2\\, the machines only run with drive axes.\n".. - "\n".. - "From TA3\\, the machines run on electricity and have a communication interface for remote control.\n".. - "\n".. - "TA4 adds more power sources\\, but also higher logistical challenges (power lines\\, item transport).\n".. - "\n", - "From V1.0 (07/17/2021) the following has changed:\n".. - "\n".. - " - The algorithm for calculating the power distribution has changed. This makes energy storage systems more important. These compensate for fluctuations\\, which is important in larger networks with several generators.\n".. - " - For this reason TA2 got its own energy storage.\n".. - " - The battery blocks from TA3 also serve as energy storage. Their functionality has been adapted accordingly.\n".. - " - The TA4 storage system has been revised. The heat heat exchanger have been given a new number because the functionality has been moved from the lower to the middle block. If these were remotely controlled\\, the node number must be adapted. The generators no longer have their own menu\\, but are only switched on / off via the heat exchanger. The heat exchanger and generator must now be connected to the same network!\n".. - " - Several power grids can now be coupled via a TA4 transformer blocks.\n".. - " - A TA4 electricity meter block for sub-networks is also new.\n".. - " - At least one battery block or a storage system in each network\n".. - "\n", - "Many more blocks have received minor changes. It is therefore possible that machines or systems do not start up again immediately after the changeover. In the event of malfunctions\\, the following tips will help:\n".. - "\n".. - " - Switch machines off and on again\n".. - " - remove a power cable block and put it back in place\n".. - " - remove the block completely and put it back in place\n".. - "\n", - "Techage adds some new items to the game:\n".. - "\n".. - " - Meridium - an alloy for the production of luminous tools in TA1\n".. - " - Usmium - an ore that is mined in TA2 and needed for TA3\n".. - " - Baborium - a metal that is needed for recipes in TA3\n".. - " - Petroleum - is needed in TA3\n".. - " - Bauxite - an aluminum ore that is needed in TA4 to produce aluminum\n".. - " - Basalt - arises when water and lave touch\n".. - "\n", - "Meridium is an alloy of steel and mesecons crystals. Meridium ingots can be made with the coal burner from steel and mesecons crystals. Meridium glows in the dark. Tools made of Meridium also light up and are therefore very helpful in underground mining.\n".. - "\n".. - "\n".. - "\n", - "Usmium only occurs as nuggets and can only be obtained by washing gravel with the TA2/TA3 gravel washing system.\n".. - "\n".. - "\n".. - "\n", - "Barborium can only be obtained from underground mining. This substance can only be found at a depth of -250 to -340 meters.\n".. - "\n".. - "Baborium can only be melted in the TA3 Industrial Furnace.\n".. - "\n".. - "\n".. - "\n", - "Petroleum can only be found with the help of the Explorer and extracted with the help of appropriate TA3 machines. See TA3.\n".. - "\n".. - "\n".. - "\n", - "Bauxite is only extracted in underground mining. Bauxite is only found in stone at a height between -50 and -500 meters.\n".. - "It is required for the production of aluminum\\, which is mainly used in TA4.\n".. - "\n".. - "\n".. - "\n", - "Basalt is only created when lava and water come together.\n".. - "The best thing to do is to set up a system where a lava and a water source flow together.\n".. - "Basalt is formed where both liquids meet.\n".. - "You can build an automated basalt generator with the Sign Bot.\n".. - "\n".. - "\n".. - "\n", - " - 28.09.2019: Solar system added\n".. - " - 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed\n".. - " - 18.11.2019: Chapter for ores\\, reactor\\, aluminum\\, silo\\, bauxite\\, furnace heating\\, gravel washing system added\n".. - " - 22.02.2020: corrections and chapters on the update\n".. - " - 29.02.2020: ICTA controller added and further corrections\n".. - " - 14.03.2020 Lua controller added and further corrections\n".. - " - 22.03.2020 More TA4 blocks added\n".. - "\n", - }, - images = { - "techage_ta4", - "", - "", - "", - "", - "meridium", - "usmium", - "baborium", - "oil", - "bauxite", - "basalt", - "", - }, - plans = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_RU.lua b/techage/doc/manual_RU.lua deleted file mode 100644 index d483b29..0000000 --- a/techage/doc/manual_RU.lua +++ /dev/null @@ -1,144 +0,0 @@ -return { - titles = { - "1,Tech Age Mod", - "2,Подсказки", - "2,Изменения по сравнению с версией 1.0", - "3,Советы по переключению", - "2,Руды и минералы", - "3,Меридий", - "3,Усмий", - "3,Баборий", - "3,Нефть", - "3,Боксит", - "3,Базальт", - "2,History", - }, - texts = { - "Tech Age - это технологический мод с 5 стадиями развития:\n".. - "\n".. - "TA1: Железный век\n".. - "Используйте инструменты и приспособления\\, такие как угольные горелки\\, угольные горелки\\, гравийные сита\\, молоты и бункеры\\, чтобы добывать и обрабатывать необходимые руды и металлы.\n".. - "\n".. - "TA2: Паровой век\n".. - "Постройте паровой двигатель с ведущими осями и используйте его для работы своих первых машин по переработке руды.\n".. - "\n".. - "TA3: Нефтяной век\n".. - "Найдите и добывайте нефть\\, постройте железные дороги для транспортировки нефти. Электростанция дает необходимое электричество для ваших машин. Электрический свет освещает ваши промышленные предприятия.\n".. - "\n".. - "TA4: Настоящее время\n".. - "Возобновляемые источники энергии\\, такие как ветер\\, солнце и биотопливо\\, помогают вам покинуть нефтяной век. С помощью современных технологий и умных машин вы отправляетесь в будущее.\n".. - "\n".. - "TA5: Будущее\n".. - "Машины\\, преодолевающие пространство и время\\, новые источники энергии и другие достижения определяют вашу жизнь.\n".. - "\n".. - "Примечание: Нажав на знак \"плюс\"\\, вы попадаете в подразделы этого руководства.\n".. - "\n".. - "\n".. - "\n", - "Эта документация доступна как \"в игре\" (план строительства блоков)\\, так и на GitHub в виде MD-файлов.\n".. - "\n".. - " - Ссылка: https://github.com/joe7575/techage/wiki\n".. - "\n".. - "Строительные планы (схемы) для постройки машин и картинки доступны только в игре.\n".. - "\n".. - "В Tech Age вам придется начинать все сначала. Вы можете создавать блоки TA2 только с помощью предметов из TA1\\, для TA3 вам нужны результаты из TA2 и т.д.\n".. - "\n".. - "В TA2 машины работают только с приводными осями.\n".. - "\n".. - "В TA3 машины работают от электричества и имеют коммуникационный интерфейс для дистанционного управления.\n".. - "\n".. - "TA4 добавляет больше источников энергии\\, но также и более сложные логистические задачи (линии электропередач\\, транспортировка изделий).\n".. - "\n", - "С версии 1.0 (07/17/2021) изменилось следующее:\n".. - "\n".. - " - Изменился алгоритм расчета распределения энергии. Это делает системы хранения энергии более важными. Они компенсируют колебания\\, что важно для больших сетей с несколькими генераторами.\n".. - " - По этой причине TA2 обзавелась собственным накопителем энергии.\n".. - " - Аккумуляторные блоки из TA3 также служат в качестве накопителей энергии. Их функциональность была соответствующим образом адаптирована.\n".. - " - Система хранения TA4 была пересмотрена. Теплообменник получил новый номер\\, поскольку его функциональность была перенесена с нижнего на средний блок. Если они управлялись дистанционно\\, номер узла должен быть адаптирован. Генераторы больше не имеют собственного меню\\, а включаются/выключаются только через теплообменник. Теплообменник и генератор теперь должны быть подключены к одной сети!\n".. - " - Несколько электросетей теперь могут быть соединены через трансформаторные блоки TA4.\n".. - " - Также появился блок счетчиков электроэнергии TA4 для подсетей.\n".. - " - Как минимум один блок аккумуляторов или система хранения в каждой сети\n".. - "\n", - "Многие другие блоки получили незначительные изменения. Поэтому возможно\\, что машины или системы не будут запускаться сразу после переключения. В случае неполадок помогут следующие советы:\n".. - "\n".. - " - выключите и снова включите машины\n".. - " - снимите блок силовых кабелей и установите его на место\n".. - " - полностью снимите блок и установите его на место\n".. - "\n", - "Techage добавляет в игру несколько новых предметов:\n".. - "\n".. - " - Меридий - сплав для производства светящихся инструментов в TA1\n".. - " - Усмий - руда\\, которая добывается в TA2 и необходима для TA3\n".. - " - Бабориум - металл\\, необходимый для рецептов в TA3\n".. - " - Нефть - необходима в TA3\n".. - " - Боксит - алюминиевая руда\\, которая необходима в TA4 для производства алюминия\n".. - " - Базальт - возникает при соприкосновении воды и лав\n".. - "\n", - "Меридий - это сплав стали и кристаллов мезекона. Слитки меридиума можно изготовить с помощью угольной горелки из стали и кристаллов мезекона. Меридий светится в темноте. Инструменты из меридиума также светятся и поэтому очень полезны при подземной добыче.\n".. - "\n".. - "\n".. - "\n", - "Усмий встречается только в виде самородков и может быть получен только при промывке гравия с помощью системы промывки гравия TA2/TA3.\n".. - "\n".. - "\n".. - "\n", - "Барборий можно получить только при подземной добыче. Это вещество можно найти только на глубине от -250 до -340 метров.\n".. - "\n".. - "Бабориум можно переплавить только в промышленной печи TA3.\n".. - "\n".. - "\n".. - "\n", - "Нефть можно найти только с помощью Исследователя и добыть с помощью соответствующих машин TA3. См. TA3.\n".. - "\n".. - "\n".. - "\n", - "Боксит можно добыть только в подземной шахте. Боксит можно найти только в камне на высоте от -50 до -500 метров.\n".. - "Он необходим для производства алюминия\\, который в основном используется в TA4.\n".. - "\n".. - "\n".. - "\n", - "Базальт образуется только при соединении лавы и воды.\n".. - "Лучше всего создать систему\\, в которой лава и вода будут течь вместе.\n".. - "Базальт образуется там\\, где встречаются обе жидкости.\n".. - "Вы можете создать автоматический генератор базальта с помощью Sign Bot.\n".. - "\n".. - "\n".. - "\n", - " - 28.09.2019: Solar system added\n".. - " - 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed\n".. - " - 18.11.2019: Chapter for ores\\, reactor\\, aluminum\\, silo\\, bauxite\\, furnace heating\\, gravel washing system added\n".. - " - 22.02.2020: corrections and chapters on the update\n".. - " - 29.02.2020: ICTA controller added and further corrections\n".. - " - 14.03.2020 Lua controller added and further corrections\n".. - " - 22.03.2020 More TA4 blocks added\n".. - "\n", - }, - images = { - "techage_ta4", - "", - "", - "", - "", - "meridium", - "usmium", - "baborium", - "oil", - "bauxite", - "basalt", - "", - }, - plans = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_pt-BR.lua b/techage/doc/manual_pt-BR.lua deleted file mode 100644 index 212f27d..0000000 --- a/techage/doc/manual_pt-BR.lua +++ /dev/null @@ -1,152 +0,0 @@ -return { - titles = { - "1,Mod Tech Age", - "2,TA1: Idade do Ferro", - "2,TA2: Idade do Vapor", - "2,TA3: Idade do Petróleo", - "2,TA4: Tempos atuais (Presente)", - "2,TA5: Futuro", - "1,Dicas", - "1,Mudanças a partir da versão 1.0", - "2,Dicas sobre a troca", - "1,Minérios e Minerais", - "2,Meridium", - "2,Usmium", - "2,Baborium", - "2,Petróleo", - "2,Bauxita", - "2,Basalto", - "2,History", - }, - texts = { - "O Tech Age é um mod de tecnologia com 5 estágios de desenvolvimento:\n".. - "\n", - "Utilize ferramentas e instrumentos auxiliares como queimadores de carvão\\, peneiras de cascalho\\, martelos e funis para extrair e processar minérios e metais necessários.\n".. - "\n", - "Construa uma máquina a vapor com eixos de transmissão e use-a para operar suas primeiras máquinas de processamento de minérios.\n".. - "\n", - "Encontre e extraia óleo\\, construa ferrovias para transporte de óleo. Uma usina fornece a eletricidade necessária para suas máquinas. A luz elétrica ilumina suas instalações industriais.\n".. - "\n", - "Fontes de energia renovável\\, como vento\\, sol e biocombustíveis\\, ajudam você a sair da era do petróleo. Com tecnologias modernas e máquinas inteligentes\\, você parte para o futuro.\n".. - "\n", - "Máquinas para superar espaço e tempo\\, novas fontes de energia e outras conquistas moldam sua vida.\n".. - "\n".. - "Nota: Clicando no sinal de adição\\, você acessa os subcapítulos deste manual.\n".. - "\n".. - "\n".. - "\n", - "Esta documentação está disponível tanto \"dentro do jogo\" (plano de construção de blocos) quanto no GitHub como arquivos MD.\n".. - "\n".. - " - Link: https://github.com/joe7575/techage/wiki\nOs planos de construção (diagramas) para a construção das máquinas e as imagens estão disponíveis apenas no jogo.\n".. - "\n".. - "Com o Tech Age\\, você precisa começar do zero. Você só pode criar blocos TA2 com os itens do TA1\\, para o TA3 você precisa dos resultados do TA2\\, e assim por diante.\n".. - "\n".. - "No TA2\\, as máquinas só funcionam com eixos de transmissão.\n".. - "\n".. - "A partir do TA3\\, as máquinas funcionam com eletricidade e têm uma interface de comunicação para controle remoto.\n".. - "\n".. - "O TA4 adiciona mais fontes de energia\\, mas também desafios logísticos mais altos (linhas de energia\\, transporte de itens).\n".. - "\n", - "A partir da V1.0 (17/07/2021)\\, as seguintes alterações foram feitas:\n".. - "\n".. - " - O algoritmo para calcular a distribuição de energia foi alterado. Isso torna os sistemas de armazenamento de energia mais importantes. Eles compensam as flutuações\\, o que é importante em redes maiores com vários geradores.\n".. - " - Por esse motivo\\, o TA2 recebeu seu próprio sistema de armazenamento de energia.\n".. - " - Os blocos de bateria do TA3 também servem como armazenamento de energia. Sua funcionalidade foi adaptada de acordo.\n".. - " - O sistema de armazenamento do TA4 foi revisado. O permutador de calor recebeu um novo número porque a funcionalidade foi movida do bloco inferior para o bloco central. Se eles estiverem sendo controlados remotamente\\, o número do nó deve ser adaptado. Os geradores não têm mais um menu próprio\\, mas são ligados/desligados apenas através do permutador de calor. O permutador de calor e o gerador agora devem estar conectados à mesma rede!\n".. - " - Vários sistemas de energia podem agora ser acoplados via blocos transformadores TA4.\n".. - " - Um novo bloco medidor de eletricidade TA4 para sub-redes também foi adicionado.\n".. - " - Pelo menos um bloco de bateria ou um sistema de armazenamento em cada rede.\n".. - "\n", - "Muitos outros blocos receberam alterações menores. Portanto\\, é possível que máquinas ou sistemas não reiniciem imediatamente após a troca. Em caso de falhas\\, as seguintes dicas ajudarão:\n".. - "\n".. - " - Desligue e ligue as máquinas novamente.\n".. - " - Remova um bloco de cabo de energia e coloque-o de volta no lugar.\n".. - " - Remova completamente o bloco e coloque-o de volta no lugar.\n".. - "\n", - "Techage adiciona novos itens ao jogo:\n".. - "\n".. - " - Meridium - uma liga para a produção de ferramentas luminosas no TA1\n".. - " - Usmium - um minério que é extraído no TA2 e necessário para o TA3\n".. - " - Baborium - um metal necessário para receitas no TA3\n".. - " - Petróleo - necessário no TA3\n".. - " - Bauxita - um minério de alumínio necessário no TA4 para produzir alumínio\n".. - " - Basalto - surge quando água e lava se encontram\n".. - "\n", - "O Meridium é uma liga de aço e cristais de mesecons. Lingotes de Meridium podem ser feitos com a caldeira a carvão a partir de aço e cristais de mesecons. O Meridium brilha no escuro. Ferramentas feitas de Meridium também emitem luz e são\\, portanto\\, muito úteis na mineração subterrânea.\n".. - "\n".. - "\n".. - "\n", - "O Usmium ocorre apenas como pepitas e só pode ser obtido lavando cascalho com o sistema de lavagem de cascalho TA2/TA3.\n".. - "\n".. - "\n".. - "\n", - "O Baborium só pode ser obtido através da mineração subterrânea. Essa substância só pode ser encontrada a uma profundidade de -250 a -340 metros.\n".. - "\n".. - "O Baborium só pode ser derretido na Fornalha Industrial TA3.\n".. - "\n".. - "\n".. - "\n", - "O Petróleo só pode ser encontrado com a ajuda do Explorer e extraído com a ajuda de máquinas apropriadas do TA3. Veja TA3.\n".. - "\n".. - "\n".. - "\n", - "A Bauxita é extraída apenas na mineração subterrânea. A Bauxita só é encontrada na pedra a uma altura entre -50 e -500 metros.\n".. - "É necessária para a produção de alumínio\\, que é principalmente usada no TA4.\n".. - "\n".. - "\n".. - "\n", - "O Basalto só é criado quando lava e água se encontram.\n".. - "A melhor coisa a fazer é montar um sistema onde uma fonte de lava e uma fonte de água se encontram.\n".. - "O Basalto é formado onde ambos os líquidos se encontram.\n".. - "Você pode construir um gerador automático de basalto com o Sign Bot.\n".. - "\n".. - "\n".. - "\n", - " - 28.09.2019: Solar system added\n".. - " - 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed\n".. - " - 18.11.2019: Chapter for ores\\, reactor\\, aluminum\\, silo\\, bauxite\\, furnace heating\\, gravel washing system added\n".. - " - 22.02.2020: corrections and chapters on the update\n".. - " - 29.02.2020: ICTA controller added and further corrections\n".. - " - 14.03.2020 Lua controller added and further corrections\n".. - " - 22.03.2020 More TA4 blocks added\n".. - "\n", - }, - images = { - "", - "", - "", - "", - "", - "techage_ta4", - "", - "", - "", - "", - "meridium", - "usmium", - "baborium", - "oil", - "bauxite", - "basalt", - "", - }, - plans = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta1_DE.lua b/techage/doc/manual_ta1_DE.lua deleted file mode 100644 index a1f6b51..0000000 --- a/techage/doc/manual_ta1_DE.lua +++ /dev/null @@ -1,172 +0,0 @@ -return { - titles = { - "1,TA1: Eisenzeitalter", - "2,Köhler / Coal Pile", - "2,Kohlebrenner / Coal Burner", - "2,Wassermühle", - "3,TA1 Mühle", - "3,TA1 Schleusenschieber / TA1 Sluice Gate", - "3,TA1 Schleusengriff / TA1 Sluice Handle", - "3,TA1 Apfelholzbrett / TA1 Apple Wood Board", - "3,TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board", - "2,Erze und Werkzeuge", - "3,Hammer", - "3,Kiessieb / Gravel Sieve", - "3,Trichter / Hopper", - "3,Kies sieben mit dem Trichter", - "3,Meridium", - }, - texts = { - "In TA1 geht es darum\\, mit einfachen Werkzeugen und Gerätschaften ausreichend Erze zu schürfen und Holzkohle herzustellen\\, so dass damit TA2 Maschinen hergestellt und betrieben werden können.\n".. - "\n".. - "Natürlich muss es für ein Eisenzeitalter auch Eisen geben und nicht nur Stahl (steel)\\, wie in \"Minetest Game\". Daher wurden einige Rezepte geändert\\, so dass zuerst Eisen hergestellt werden muss und erst später dann Stahl.\n".. - "\n".. - "Auch ist die Haltbarkeit der Werkzeuge an die Zeitalter angelehnt und entspricht damit nicht dem Minetest Originalspiel.\n".. - "Die Haltbarkeit/Härte bspw. für eine Axt ist:\n".. - "\n".. - " - Bronze: 20\n".. - " - Stahl: 30\n".. - "\n".. - "\n".. - "\n", - "Den Köhler brauchst du\\, um Holzkohle herzustellen. Holzkohle wird für den Brenner\\, aber auch bspw. in TA2 für die Dampfmaschine benötigt.\n".. - "\n".. - "Für den Köhler brauchst du:\n".. - "\n".. - " - einen Anzünderblock ('techage:lighter')\n".. - " - 26 Hölzblöcke (wood)\\, die zu einem Würfen aufgeschichtet werden. Die Holzsorte spielt keine Rolle.\n".. - " - Erde (dirt) um den Holzhaufen abzudecken.\n".. - " - Feuerstein und Eisen (technischer Name: 'fire:flint_and_steel') um den Anzünderblock anzuzünden.\n".. - "\n".. - "Bauanleitung (siehe auch Plan):\n".. - "\n".. - " - Baue eine 5x5 große Fläche aus Erde (dirt)\n".. - " - Platziere in die Mitte einen Anzünder (lighter)\n".. - " - Platziere rund um den Anzünder 7 Holz (wood)\\, aber lasse ein Loch zum Anzünder frei\n".. - " - Baue weitere 2 Schichten Holz darüber\\, so dass ein 3x3x3 großer Holzwürfel entsteht\n".. - " - Überdecke alles mit einer Schicht Erde zu einem 5x5x5 großen Würfel\\, aber lasse das Loch zum Anzünder frei\n".. - " - Entzünde den Anzünder und verschließe das Loch sofort mit jeweils einem Block Holz und Erde\n".. - " - Wenn du alles richtig gemacht hast\\, fängt der Köhler nach wenigen Sekunden an zu rauchen\n".. - " - Öffne den Köhler erst\\, wenn der Rauch verschwunden ist (ca. 20 min)\n".. - "\n".. - "Dann kannst du die 9 Holzkohleblöcke entnehmen und den Köhler erneut füllen.\n".. - "\n".. - "\n".. - "\n", - "Den Kohlebrenner benötigst du bspw. um Eisen und andere Erze im Schmelztiegel zu schmelzen. Es gibt verschiedene Rezepte\\, welche verschiedene Temperaturen benötigen. Je höher der Turm\\, um so heißer ist die Flamme. Eine Höhe von 11 Blöcken über der Bodenplatte ist für alle Rezepte ausreichend\\, ein Brenner mit dieser Höhe verbraucht aber auch mehr Holzkohle.\n".. - "\n".. - "Bauanleitung (siehe auch Plan):\n".. - "\n".. - " - Baue einen Turm aus Stein (cobble) mit einer 3x3 Grundfläche (7-11 Blöcke hoch)\n".. - " - Lasse unten ein Loch an einer Seite offen\n".. - " - Lege einen Anzünder (lighter) hinein\n".. - " - Fülle den Turm bis zum Rand mit Holzkohle\\, in dem du die Holzkohle von oben in das Loch fallen lässt\n".. - " - Entzünde den Anzünder durch das Loch\n".. - " - Platziere den Schmelztiegel oben auf dem Turm direkt in die Flamme\\, einen Block über dem Turmrand\n".. - " - Um den Brenner anzuhalten\\, schließe das Loch vorübergehend bspw. mit einem Erdblock.\n".. - "\n".. - "Der Schmelztiegel hat ein eigenes Menü mit Rezepten und ein Inventar\\, wo du die Erze hinein legst.\n".. - "\n".. - "\n".. - "\n", - "Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle wird mit\n".. - "Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden.\n".. - "Über eine Schleuse kann der Wasserfluss und damit das Mühlrad gesteuert werden.\n".. - "Die Schleuse besteht aus Schleusenschieber und Schleusengriff.\n".. - "\n".. - "Die Abbildung rechts (auf \"Plan\" klicken) zeigt den Aufbau der Wassermühle.\n".. - "\n".. - "\n".. - "\n", - "Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden.\n".. - "Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle.\n".. - "\n".. - "Die Mühle kann mit Hilfe eines Minecart Hoppers automatisiert werden\\, so dass das Mehl bspw. direkt von der Mühle in einen Ofen befördert wird\\, um daraus Brot zu backen.\n".. - "\n".. - "\n".. - "\n", - "Der Schleusenschieber muss auf gleicher Höhe wie die Wasseroberfläche direkt an einen Teich oder in einen Bach gesetzt werden.\n".. - "Wird die Schleuse geöffnet\\, so fließt Wasser durch den Schieber. Dieses Wasser muss dann zum Mühlrad geleitet werden und treibt dort die Mühle an.\n".. - "\n".. - "\n".. - "\n", - "Der TA1 Schleusengriff muss auf den Schleusenschieber gesetzt werden. Mit Hilfe des Schleusengriffs (Rechtsklick) kann der Schieber geöffnet werden.\n".. - "\n".. - "\n".. - "\n", - "Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Es kann aber auch jedes andere Material verwendet werden.\n".. - "\n".. - "\n".. - "\n", - "Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Dieser Block eignet sich speziell in Verbindung mit den Pfosten des Holzzauns um eine Stütze für den Kanal zu bauen.\n".. - "\n".. - "\n".. - "\n", - "TA1 hat seine eigenen Werkzeuge wie Hammer und Kiessieb\\, aber auch der Minecart Hopper kann genutzt werden.\n".. - "\n".. - "\n".. - "\n", - "Mit dem TA1 Hammer können Steine (stone) und Kopfsteinpflaster-Steine (cobble) zu Kies (gravel) zertrümmert werden. Der Hammer ist in verschiedenen Ausführungen und damit verschiedenen Eigenschaften verfügbar: Bronze\\, Stahl\\, Mese und Diamant.\n".. - "\n".. - "\n".. - "\n", - "Mit dem Kiessieb können Erze aus dem Kies gesiebt werden. Dazu mit dem Kies (gravel) auf das Sieb klicken. Der gesiebte Kies und die Erze fallen unten heraus.\n".. - "\n".. - "Um hier nicht stundenlang am Sieb zu stehen\\, kann das Sieben mit dem Trichter (hopper) automatisiert werden.\n".. - "\n".. - "\n".. - "\n", - "Der Hopper aus der Mod \"Minecart\" dient in erster Linie zum Be- und Entladen von Minecarts. Er saugt Gegenstände (items) von oben ein und gibt diese nach rechts weiter. Beim Platzieren des Trichters muss daher auf die Ausgaberichtung geachtet werden.\n".. - "\n".. - "Der Trichter kann aber auch Items aus Kisten (chest) ziehen\\, sofern die Kiste neben oder auf dem Trichter steht. \n".. - "\n".. - "Der Trichter kann auch Items in Kisten legen\\, sofern die Kiste neben dem Trichter steht.\n".. - "\n".. - "\n".. - "\n", - "Mit Hilfe von zwei Kisten\\, zwei Trichtern und einem Kiessieb kann der Siebevorgang automatisiert werden. Der Plan rechts zeigt den Aufbau.\n".. - "\n".. - "Bei den Kisten darauf achten\\, dass es die \"chest_locked\" ist\\, sonst klaut dir jemand die wertvollen Erze aus der Kiste unten.\n".. - "\n".. - "\n".. - "\n", - "TA1 hat seine eigene Metalllegierung Meridium. Meridium Ingots können mit dem Kohlebrenner aus Stahl und Mesesplittern hergestellt werden. Meridium leuchtet im Dunkeln. Auch Werkzeuge aus Meridium leuchten und sind daher im Untertagebau sehr hilfreich.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta1", - "", - "", - "", - "", - "ta1_sluice", - "ta1_sluice_handle", - "ta1_board1", - "ta1_board2", - "ta1_gravelsieve", - "hammer", - "ta1_gravelsieve", - "ta1_hopper", - "", - "meridium", - }, - plans = { - "", - "coalpile", - "coalburner", - "watermill1", - "watermill2", - "", - "", - "", - "", - "", - "", - "", - "", - "hoppersieve", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta1_EN.lua b/techage/doc/manual_ta1_EN.lua deleted file mode 100644 index d11b581..0000000 --- a/techage/doc/manual_ta1_EN.lua +++ /dev/null @@ -1,170 +0,0 @@ -return { - titles = { - "1,TA1: Iron Age", - "2,Charcoal Pile (charcoal burner)", - "2,Melting Furnace", - "2,Watermill", - "3,TA1 mill", - "3,TA1 sluice gate", - "3,TA1 sluice handle", - "3,TA1 Apple Wood Board", - "3,TA1 Apple Millrace Board", - "2,Ores and Tools", - "3,Hammer", - "3,Gravel Sieve", - "3,Hopper", - "3,Gravel seven with the hopper", - "3,Meridium", - }, - texts = { - "TA1 is about mining sufficient ores and producing charcoal with simple tools and equipment\\, so that TA2 machines can be manufactured and operated.\n".. - "\n".. - "Of course\\, for an iron age there must also be iron and not just steel\\, as in \"Minetest Game\". As a result\\, some recipes have been changed so that iron has to be produced first and then steel later.\n".. - "\n".. - "The durability of the tools is based on the ages and therefore does not correspond to the original Minetest game.\n".. - "The durability / hardness for an axe\\, for example:\n".. - "\n".. - " - Bronze: 20\n".. - " - Steel: 30\n".. - "\n".. - "\n".. - "\n", - "You need the Charcoal Pile to make charcoal. Charcoal is required for the melting furnace\\, but also\\, for example\\, in TA2 for the steam engine.\n".. - "\n".. - "For the charcoal burner you need:\n".. - "\n".. - " - a lighter block ('techage:lighter')\n".. - " - 26 wooden blocks that are stacked into a pile of wood. The type of wood is irrelevant\n".. - " - Dirt to cover the pile of wood\n".. - " - Flint and Iron (technical name: 'fire:flint_and_steel') to light the lighter block\n".. - "\n".. - "Building instructions (see also plan):\n".. - "\n".. - " - Build a 5x5 area of dirt\n".. - " - Place 7 wood around the lighter but leave a hole to the lighter\n".. - " - Build another 2 layers of wood on top\\, making a 3x3x3 wooden cube\n".. - " - Cover everything with a layer of dirt into a 5x5x5 cube\\, but keep the hole to the lighter open\n".. - " - Light the lighter and immediately close the hole with a block of wood and dirt\n".. - " - If you have done everything correctly\\, the coal burner will start smoking after a few seconds\n".. - " - Only open the charcoal burner when the smoke has disappeared (approx. 20 min)\n".. - "\n".. - "Then you can remove the 9 charcoal blocks and refill the Charcoal Pile.\n".. - "\n".. - "\n".. - "\n", - "You need the melting furnace\\, for example\\, to melt iron and other ores in the melting pot. There are different recipes that require different temperatures. The higher the melting tower\\, the hotter the flame. A height of 11 blocks above the base plate is for all recipes\\, but a burner with this height also requires more charcoal.\n".. - "\n".. - "Building instructions (see also plan):\n".. - "\n".. - " - Build a stone tower (cobble) with a 3x3 base (7-11 blocks high)\n".. - " - Leave a hole open on one side at the bottom\n".. - " - Put a lighter in it\n".. - " - Fill the tower to the brim with charcoal by dropping the charcoal into the hole from above\n".. - " - Light the lighter through the hole\n".. - " - Place the melting pot on top of the tower directly into the flame\\, one block above the tower edge\n".. - " - To stop the burner\\, temporarily close the hole with an dirt block\\, for example.\n".. - "\n".. - "The melting pot has its own menu of recipes and an inventory where you have to put the ores in.\n".. - "\n".. - "\n".. - "\n", - "The watermill can be used to grind wheat and other grains into flour and then bake them in the furnace to make bread. \n".. - "The mill is powered by water power. To do this\\, a millrace must be led to the mill wheel via a canal.\n".. - "The water flow and thus the mill wheel can be controlled via a sluice. The sluice consists of the sluice lock and sluice handle.\n".. - "\n".. - "The picture on the right (click on \"Plan\") shows the structure of the watermill. \n".. - "\n".. - "\n".. - "\n", - "The watermill can be used to grind wheat and other grains into flour and then bake them in the oven to make bread. The mill must be connected to the mill wheel with a TA1 axle. The power of the mill wheel is only enough for one mill.\n".. - "\n".. - "The mill can be automated with the help of a Minecart Hopper\\, so that the flour\\, for example\\, is transported directly from the mill into an furnace in order to bake bread from it.\n".. - "\n".. - "\n".. - "\n", - "The sluice gate valve must be placed directly next to a pond or in a stream at the same height as the water surface.\n".. - "When the gate is opened\\, water flows through the slide. This water then has to be fed to the mill wheel\\, where it drives the mill.\n".. - "\n".. - "\n".. - "\n", - "The TA1 sluice handle must be placed on the sluice gate. The gate can be opened with the aid of the sluice handle (right click).\n".. - "\n".. - "\n".. - "\n", - "Block in different types of wood for building the millrace canal. However\\, any other material can also be used.\n".. - "\n".. - "\n".. - "\n", - "Block in different types of wood for building the millrace canal. This block is especially suitable in connection\n".. - "with posts of the wooden fence to build a support of the canal.\n".. - "\n".. - "\n".. - "\n", - "TA1 has its own tools such as hammer and gravel sieve\\, but the Minecart Hopper can also be used.\n".. - "\n".. - "\n".. - "\n", - "The TA1 hammer can be used to knock/dig stone in a mine\\, but also to smash cobble to gravel. The hammer is available in different versions and therefore different properties: bronze\\, steel\\, brass and diamond.\n".. - "\n".. - "\n".. - "\n", - "Ores can be sifted from the gravel with the gravel sieve. To do this\\, click on the sieve with the gravel. The sifted gravel and ores fall out below.\n".. - "\n".. - "In order not to stand at the sieve for hours\\, sieving can be automated with the hopper.\n".. - "\n".. - "\n".. - "\n", - "The hopper from the \"Minecart\" mod is primarily used for loading and unloading Minecarts. He sucks in items from above and passes them on to the right. Therefore\\, when placing the hopper\\, pay attention to the direction of dispensing.\n".. - "\n".. - "The hopper can also pull items from boxes (chest)\\, provided the box is next to or on the hopper.\n".. - "\n".. - "The hopper can also put items in boxes if the box is next to the hopper.\n".. - "\n".. - "\n".. - "\n", - "With the help of two boxes\\, two hoppers and a gravel sieve\\, the sieving process can be automated. The plan on the right shows the structure.\n".. - "\n".. - "Make sure that the boxes are \"chest_locked\"\\, otherwise someone will steal the valuable ores from the box below.\n".. - "\n".. - "\n".. - "\n", - "TA1 has its own metal alloy meridium. Meridium ingots can be made with the coal burner from steel and mesecons crystals. Meridium glows in the dark. Tools made of Meridium also light up and are therefore very helpful in underground mining.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta1", - "", - "", - "", - "", - "ta1_sluice", - "ta1_sluice_handle", - "ta1_board1", - "ta1_board2", - "ta1_gravelsieve", - "hammer", - "ta1_gravelsieve", - "ta1_hopper", - "", - "meridium", - }, - plans = { - "", - "coalpile", - "coalburner", - "watermill1", - "watermill2", - "", - "", - "", - "", - "", - "", - "", - "", - "hoppersieve", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta1_RU.lua b/techage/doc/manual_ta1_RU.lua deleted file mode 100644 index 8a9a754..0000000 --- a/techage/doc/manual_ta1_RU.lua +++ /dev/null @@ -1,170 +0,0 @@ -return { - titles = { - "1,TA1: Эпоха железа", - "2,Углевыжигательная куча (древесноугольная печь)", - "2,Плавильная печь", - "2,Водяная мельница", - "3,TA1 мельница", - "3,TA1 шлюзовой затвор", - "3,TA1 шлюзовой рычаг", - "3,TA1 яблоневая доска", - "3,TA1 яблоневая мельничная доска", - "2,Руды и инструменты", - "3,Молот", - "3,Гравийное сито", - "3,Хоппер", - "3,Просеивание гравия и хоппер", - "3,Меридий", - }, - texts = { - "TA1 - про добычу необходимейших руд и изготовление древесного угля простейшими инструментами и оборудованием\\, чтобы ТА2 машины можно было построить и запустить.\n".. - "\n".. - "Конечно\\, для Эпохи железа потребуется также железо и не только сталь\\, как в ванильной \"Minetest Game\". В результате\\, некоторые рецепты были изменены, и теперь сперва нужно произвести железо, а сталь - позже.\n".. - "\n".. - "Долговечность инструментов зависит от эпохи и поэтому не соответствует оригинальной игре Майнтест.\n".. - "Долговечность / прочность топора\\, например:\n".. - "\n".. - " - Бронза: 20\n".. - " - Сталь: 30\n".. - "\n".. - "\n".. - "\n", - "Для изготовления древесного угля потребуется Углевыжигательная Куча. Древесный уголь используется в плавильной печи\\, но также\\, например\\, в TA2 для парового двигателя.\n".. - "\n".. - "Для жжения угля понадобится:\n".. - "\n".. - " - блок-поджигатель ('techage:lighter')\n".. - " - 26 деревянный блоков досок, составленных в кучу. Тип дерева не важен.\n".. - " - Земля для покрытия кучи дерева.\n".. - " - Огниво (техническое наименование: 'fire:flint_and_steel') чтобы зажечь блок-поджигатель\n".. - "\n".. - "Инструкция по строительству (см. также чертёж):\n".. - "\n".. - " - Соорудите площадку из земли 5х5\n".. - " - Поставьте 7 досок вокруг поджигателя но оставьте отверстие для доступа к поджигателю\n".. - " - Постройте ещё 2 слоя досок вверх\\, формируя деревянный куб 3х3х3\n".. - " - Покройте всё слоем земли, формируя земляной куб 5х5х5\\, но оставьте отверстие для доступа к поджигателю\n".. - " - Воспламените поджигатель и немедленно закройте отверстие блоком досок и блоком земли.\n".. - " - Если всё сделано верно\\, углесжигательная куча начнёт пускать дым вверх через несколько секунд\n".. - " - Вскрывайте кучу только тогда, когда дым исчезнет! (примерно 20 минут)\n".. - "\n".. - "Теперь можно забрать 9 блоков древесного угля и заполнить Кучу снова.\n".. - "\n".. - "\n".. - "\n", - "Плавильная печь понадобится\\, например\\, чтобы выплавлять железо и другие руды в плавильном тигеле. Для разных рецептов требуется разная температура. Чем выше плавильная башня\\, тем горячее пламя. Высота 11 блоков приемлема для всех рецептов\\, однако и потребляет больше всего древесного угля.\n".. - "\n".. - "Инструкция по строительству (см. также чертёж):\n".. - "\n".. - " - Соорудите каменную башню (булыжник) с основанием 3х3 высотой 7-11 блоков.\n".. - " - Оставьте отверстие внизу с одной стороны.\n".. - " - Поместите поджигатель в отверстие.\n".. - " - Заполните башню древесным углем до краёв, сбрасывая древесный уголь сверху в шахту.\n".. - " - Воспламените поджигатель через отверстие.\n".. - " - Установите плавильный тигель наверху башни\n(на один блок выше пламени)\n".. - " - Чтобы временно прервать горение\\, закройте отверстие блоком земли\\, например.\n".. - "\n".. - "У плавильного тигеля есть своё меню рецептов и инвентарь, куда помещать руды.\n".. - "\n".. - "\n".. - "\n", - "Мельница используется для перемалывания пшеницы и других зёрен в муку, затем муку испекают в печи для получения хлеба.\n".. - "Мельница крутится силой воды. Для этого\\, к мельнице нужно подвести водный поток каналом.\n".. - "Поток воды и мельничное колесо можно контролировать шлюзом. Шлюз состоит из шлюзового замка и шлюзового рычага.\n".. - "\n".. - "Картинка справа (кликните на \"Plan\") иллюстрирует устройство мельницы. \n".. - "\n".. - "\n".. - "\n", - "Мельница используется для перемалывания пшеницы и других зёрен в муку, затем муку испекают в печи для получения хлеба. Мельница должна быть соединена с мельничным колесом посредством ТА1 оси. Мощности мельничного колеса хватает только для одной мельницы.\n".. - "\n".. - "Автоматизировать мельницу можно Железнодорожным хоппером\\, так что мука\\, например\\, будет перевозиться от мельницы до печи для дальнейшей выпечки.\n".. - "\n".. - "\n".. - "\n", - "Шлюзовой затвор нужно размещать непосредственно рядом с водоёмом или в потоке, на том же уровне что и поверхность воды.\n".. - "Когда шлюзовой затвор открыт\\, вода стекает вниз. Эта вода напирает на мельничное колесо.\\, и крутит мельницу.\n".. - "\n".. - "\n".. - "\n", - "TA1 шлюзовой рычаг размещается на шлюзовом затворе. Затвор можно открывать рычагом (правый клик).\n".. - "\n".. - "\n".. - "\n", - "Блок любого типа дерева для строительства мельничного водоканала. Впрочем\\, можно использовать любой другой материал.\n".. - "\n".. - "\n".. - "\n", - "Блок любого типа дерева для строительства мельничного водоканала. Этот блок оптимально подходит для соединения.\n".. - "со столбами деревянного забора, для строительства опор канала.\n".. - "\n".. - "\n".. - "\n", - "TA1 содержит собственные инструменты, такие как молот и гравийное сито\\, но также можно использовать Железнодорожный хоппер.\n".. - "\n".. - "\n".. - "\n", - "TA1 молот используется для разбивания/выкапывания камня\\, а также для раздробления булыжника в гравий. Молот доступен в разных исполнениях с разными свойствами: бронза\\, сталь\\, латунь и алмаз.\n".. - "\n".. - "\n".. - "\n", - "Руды можно высеивать из гравия через гравийное сито. Для этого\\, кликайте гравием на сито. Просеянный гравий и руды выпадут снизу.\n".. - "\n".. - "Чтобы не стоять возле сита часами\\, процесс можно автоматизировать хоппером.\n".. - "\n".. - "\n".. - "\n", - "Хоппер из мода \"Minecart\" (Вагонетка) задуман для погрузки-разгрузки вагонеток. Хоппер втягивает предметы сверху от себя и выгружает направо от себя. Так\\, располагая хоппер\\, обращайте внимание на направление выгрузки.\n".. - "\n".. - "Хоппер также может вытягивать предметы из коробок (сундуков)\\, при условии что коробка расположена рядом или над хоппером.\n".. - "\n".. - "Хоппер также может помещать предметы в коробки, при условии что коробка расположена рядом с хоппером.\n".. - "\n".. - "\n".. - "\n", - "С помощью двух коробок\\, двух хопперов и гравийного сита\\, процесс просеивания может быть автоматизирован. Чертёж справа иллюстрирует механизм.\n".. - "\n".. - "Убедитесь, что коробки \"chest_locked\"\\ (защищённые), иначе кто-нибудь похитит ценные руды из верхней коробки.\n".. - "\n".. - "\n".. - "\n", - "TA1 отркрывает собственный сплав - меридий. Меридиевые слитки изготавливаются в плавильном тигеле из стали и месекон кристаллов. Меридий светится в темноте. Меридиевые инструменты тоже светятся, становясь хорошей поддержкой в подземных раскопках.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta1", - "", - "", - "", - "", - "ta1_sluice", - "ta1_sluice_handle", - "ta1_board1", - "ta1_board2", - "ta1_gravelsieve", - "hammer", - "ta1_gravelsieve", - "ta1_hopper", - "", - "meridium", - }, - plans = { - "", - "coalpile", - "coalburner", - "watermill1", - "watermill2", - "", - "", - "", - "", - "", - "", - "", - "", - "hoppersieve", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta1_pt-BR.lua b/techage/doc/manual_ta1_pt-BR.lua deleted file mode 100644 index e7ade68..0000000 --- a/techage/doc/manual_ta1_pt-BR.lua +++ /dev/null @@ -1,153 +0,0 @@ -return { - titles = { - "1,TA1: Idade do Ferro", - "2,Pilha de Carvão (queimador de carvão)", - "2,Forno de Fundição", - "2,Moinho d'Água", - "3,Moinho d'Água TA1", - "3,Comporta TA1", - "3,Alavanca de Comporta TA1", - "3,Placa de Madeira de Maçã TA1", - "3,Placa de Curso d'Água de Maçã TA1", - "1,Minérios e Ferramentas", - "2,Martelo", - "2,Peneira de Cascalho(Sieve)", - "2,Funil (Minecart Hopper)", - "2,Peneirando sete cascalhos com Funil", - }, - texts = { - "TA1 trata da extração de minérios suficientes e da produção de carvão com ferramentas e equipamentos simples\\, para que as máquinas TA2 possam ser fabricadas e operadas.\n".. - "\n".. - "É claro que\\, para uma Idade do Ferro\\, deve haver ferro e não apenas aço\\, como em \"Minetest Game\". Como resultado\\, algumas receitas foram alteradas para que o ferro precise ser produzido primeiro e\\, posteriormente\\, o aço.\n".. - "\n".. - "A durabilidade das ferramentas é baseada nas eras e\\, portanto\\, não corresponde ao jogo original do Minetest.\n".. - "A durabilidade/dureza de um machado\\, por exemplo:\n".. - "\n".. - " - Bronze: 20\n".. - " - Aço: 30\n".. - "\n".. - "\n".. - "\n", - "Você precisa da Pilha de Carvão para fazer carvão. O carvão é necessário para a fundição\\, mas também\\, por exemplo\\, em TA2 para a máquina a vapor.\n".. - "\n".. - "Para o queimador de carvão\\, você precisa de:\n".. - "\n".. - " - Um bloco de acendedor ('techage:lighter')\n".. - " - 26 blocos de madeira empilhados para formar um monte de madeira. O tipo de madeira é irrelevante.\n".. - " - Terra para cobrir o monte de madeira\n".. - " - Pedra lascada e Ferro (nome técnico: 'fire:flint_and_steel') para acender o bloco de acendedor\n".. - "\n".. - "Instruções de construção (veja também o plano):\n".. - "\n".. - " - Construa uma área de 5x5 de terra\n".. - " - Coloque 7 blocos de madeira ao redor do acendedor\\, mas deixe um buraco para o acendedor\n".. - " - Construa mais 2 camadas de madeira em cima\\, formando um cubo de madeira 3x3x3\n".. - " - Cubra tudo com uma camada de terra formando um cubo de 5x5x5\\, mas mantenha o buraco para o acendedor aberto\n".. - " - Acenda utilizando o isqueiro e feche imediatamente o buraco com um bloco de madeira e terra\n".. - " - Se você fez tudo corretamente\\, o queimador de carvão começará a soltar fumaça após alguns segundos\n".. - " - Só abra o queimador de carvão quando a fumaça tiver desaparecido (aproximadamente 20 minutos)\n".. - " - Então você pode remover os 9 blocos de carvão e reabastecer a Pilha de Carvão.\n".. - "\n".. - "\n".. - "\n", - "Você precisa do forno de fundição\\, por exemplo\\, para fundir ferro e outros minérios no Vaso de fundição(cadinho). Existem receitas diferentes que requerem diferentes temperaturas. Quanto mais alto a torre de fusão\\, mais quente é a chama. Uma altura de 11 blocos acima da placa base é para todas as receitas\\, mas um queimador com essa altura também requer mais carvão.\n".. - "\n".. - "Instruções de construção (veja também o plano):\n".. - "\n".. - " - Construa uma torre de pedregulho (cobble) com uma base de 3x3 (7-11 blocos de altura)\n".. - " - Deixe um buraco aberto de um lado na parte inferior\n".. - " - Coloque um acendedor nele\n".. - " - Encha a torre até a borda com carvão despejando o carvão no buraco de cima para baixo\n".. - " - Acenda o acendedor através do buraco\n".. - " - Coloque o Vaso de fundição(cadinho) no topo da torre diretamente na chama\\, um bloco acima da borda da torre\n".. - " - Para parar o queimador\\, feche temporariamente o buraco com um bloco de terra\\, por exemplo.\n".. - " - O Vaso de fundição(cadinho) tem seu próprio menu de receitas e um inventário onde você precisa colocar os minérios.\n".. - "\n".. - "\n".. - "\n", - "O moinho d'água pode ser usado para moer trigo e outros grãos para fazer farinha e depois assá-los no forno para fazer pão.\n".. - "O moinho é alimentado por energia hidráulica. Para isso\\, um curso de água deve ser conduzido até a roda do moinho através de um canal.\n".. - "O fluxo de água e\\, portanto\\, a roda do moinho\\, podem ser controlados por meio de uma comporta. A comporta é composta pelo bloqueio de comporta e pela alavanca de comporta.\n".. - "\n".. - "A imagem à direita (clique em \"Plano\") mostra a estrutura do moinho d'água.\n".. - "\n".. - "\n".. - "\n", - "O moinho d'água pode ser usado para moer trigo e outros grãos para fazer farinha e depois assá-los no forno para fazer pão. O moinho deve ser conectado à roda do moinho com um eixo TA1. A potência da roda do moinho é apenas suficiente para um moinho.\n".. - "\n".. - "O moinho pode ser automatizado com a ajuda de um Funil(Minecart Hopper)\\, para que a farinha\\, por exemplo\\, seja transportada diretamente do moinho para um forno para assar pão.\n".. - "\n".. - "\n".. - "\n", - "A válvula de comporta deve ser colocada diretamente ao lado de um lago ou em um riacho na mesma altura que a superfície da água.\n".. - "Quando a comporta é aberta\\, a água flui através do canal. Essa água deve ser conduzida até a roda do moinho\\, onde movimenta o moinho.\n".. - "\n".. - "\n".. - "\n", - "A alavanca de comporta TA1 deve ser colocada na comporta. A comporta pode ser aberta com a ajuda da alavanca de comporta (clique com o botão direito).\n".. - "\n".. - "\n".. - "\n", - "Podem ser usados bloco de diferentes tipos de madeira para construir o canal do curso d'água. No entanto\\, qualquer outro material também pode ser usado.\n".. - "\n".. - "\n".. - "\n", - "Podem ser utilizados blocos em diferentes tipos de madeira para construir o canal do curso d'água. Este bloco é especialmente adequado em conexão com postes da cerca de madeira para construir um suporte do canal.\n".. - "\n".. - "\n".. - "\n", - "O TA1 possui suas próprias ferramentas\\, como martelo e peneira de cascalho\\, mas o Funil(Minecart Hopper) também pode ser utilizado.\n".. - "\n", - "O martelo TA1 pode ser utilizado para bater/escavar pedra em uma mina\\, mas também para quebrar pedregulho(cobble) em cascalho(gravel). O martelo está disponível em diferentes versões\\, cada uma com propriedades distintas: bronze\\, aço\\, latão e diamante.\n".. - "\n", - "Minérios podem ser peneirados do cascalho com a peneira de cascalho. Para fazer isso\\, clique na peneira com o cascalho. O cascalho peneirado e os minérios caem abaixo.\n".. - "\n".. - "Para não ficar horas na peneira\\, é possível automatizar o processo com o Funil(Minecart Hopper).\n".. - "\n", - "O funil do mod \"Minecart Hopper\" é utilizado principalmente para carregar e descarregar carrinhos de mineração. Ele suga itens de cima e os passa para a direita. Portanto\\, ao posicionar o funil\\, preste atenção na direção de dispensa.\n".. - "\n".. - "O funil também pode puxar itens de baús\\, desde que a caixa esteja ao lado ou em cima do funil.\n".. - "\n".. - "O funil também pode colocar itens em baús se a caixa estiver ao lado do funil.\n".. - "\n", - "Com a ajuda de dois baús\\, dois funis e uma peneira de cascalho\\, o processo de peneiração pode ser automatizado. O plano à direita mostra a estrutura.\n".. - "\n".. - "Certifique-se de que os baús são protegidos\\, caso contrário\\, alguém pode roubar os minérios valiosos do baú abaixo.\n".. - "\n".. - "Meridium\n".. - "O TA1 possui sua própria liga metálica\\, o Meridium. Lingotes de meridium podem ser feitos com a caldeira a carvão\\, utilizando aço e cristais de mesecons. O meridium brilha no escuro. Ferramentas feitas de meridium também emitem luz\\, sendo\\, portanto\\, muito úteis na mineração subterrânea.\n".. - "\n", - }, - images = { - "techage_ta1", - "", - "", - "", - "", - "ta1_sluice", - "ta1_sluice_handle", - "ta1_board1", - "ta1_board2", - "", - "", - "", - "", - "", - }, - plans = { - "", - "coalpile", - "coalburner", - "watermill1", - "watermill2", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta2_DE.lua b/techage/doc/manual_ta2_DE.lua deleted file mode 100644 index 7c91acb..0000000 --- a/techage/doc/manual_ta2_DE.lua +++ /dev/null @@ -1,308 +0,0 @@ -return { - titles = { - "1,TA2: Dampfzeitalter", - "2,Dampfmaschine", - "3,TA2 Feuerbox / Firebox", - "3,TA2 Boiler", - "3,TA2 Zylinder /Cylinder", - "3,TA2 Schwungrad / Flywheel", - "3,TA2 Dampfleitungen / Steam Pipe", - "3,TA2 Antriebsachsen / TA2 Drive Axle", - "3,TA2 Stromgenerator / TA2 Power Generator", - "2,TA2 Energiespeicher", - "3,TA2 Seilwinde / TA2 Winch", - "3,TA2 Gewichtekiste / TA2 Weight Chest", - "3,TA2 Kupplung / TA2 Clutch", - "2,Items schieben und sortieren", - "3,Röhren / TechAge Tube", - "3,Röhren Konzentrator / Tube Concentrator", - "3,TA2 Schieber / Pusher", - "3,TA2 Verteiler / Distributor", - "2,Kieswaschanlage", - "3,TA2 Kiesspüler / Gravel Rinser", - "2,Stein brechen\\, mahlen und sieben", - "3,TA2 Steinbrecher / Quarry", - "3,TA2 Mühle / Grinder", - "3,TA2 Kiessieb / Gravel Sieve", - "2,Items produzieren", - "3,TA2 Autocrafter", - "3,TA2 Elektronikfabrik / Electronic Fab", - "2,Sonstige Blöcke", - "3,TA2 Flüssigkeitensammler / Liquid Sampler", - "3,TA2 Gesicherte Kiste / Protected Chest", - "3,Techage Forceload Block", - }, - texts = { - "In TA2 geht es darum\\, erste Maschinen zur Verarbeitung von Erzen zu bauen und zu betreiben. Einige Maschinen müssen dazu über Antriebsachsen angetrieben werden. Dazu musst du eine Dampfmaschine bauen und diese mit Kohle oder Holzkohle anheizen.\n".. - "\n".. - "In TA2 steht auch ein Kiesspüler zur Verfügung\\, mit dem seltene Erze wie Usmium Nuggets ausgewaschen werden können. Diese Nuggets wirst du später für weitere Rezepte brauchen.\n".. - "\n".. - "\n".. - "\n", - "Die Dampfmaschine besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet\\, zusammen gebaut werden. Dazu werden die Blöcke TA2 Feuerbox\\, TA2 Boiler oben\\, TA2 Boiler unten\\, TA2 Zylinder\\, TA2 Schwungrad und Dampfleitungen benötigt.\n".. - "\n".. - "Zusätzlich werden Antriebsachsen sowie Getriebeblöcke für Richtungswechsel benötigt. Das Schwungrad muss über die Antriebsachsen mit allen Maschinen verbunden werden\\, die angetrieben werden müssen.\n".. - "\n".. - "Bei allen Blöcken beim Setzen immer auch die Ausrichtung achten:\n".. - "\n".. - " - Zylinder links\\, Schwungrad rechts daneben\n".. - " - Dampfleitungen anschließen\\, wo ein entsprechendes Loch ist\n".. - " - Antriebsachse beim Schwungrad nur rechts\n".. - " - bei allen Maschinen kann die Antriebsachse an allen Seiten angeschlossen werden\\, welche nicht durch andere Funktionen belegt wird\\, wie bspw. die IN und OUT Löcher bei Mühle und Sieb.\n".. - "\n".. - "Der Boiler muss mit Wasser gefüllt werden. Dazu bis zu 10 Eimer Wasser in den Boiler füllen.\n".. - "Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden.\n".. - "Wenn das Wasser heiß ist (Temperaturanzeige ganz oben)\\, kann die Dampfmaschine am Schwungrad gestartet werden.\n".. - "\n".. - "Die Dampfmaschine leistet 25 ku und kann damit mehrere Maschinen gleichzeitig antreiben.\n".. - "\n".. - "\n".. - "\n", - "Teil der Dampfmaschine. \n".. - "\n".. - "Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. Die Brenndauer ist abhängig von der Leistung\\, die von der Dampfmaschine angefordert wird. Unter Volllast brennt Kohle 32 s und Holzkohle 96 s.\n".. - "\n".. - "\n".. - "\n", - "Teil der Dampfmaschine. Muss mit Wasser gefüllt werden. Dies erfolgt durch Klicken mit einem Wassereimer auf den Boiler. Wenn kein Wasser mehr vorhanden ist oder die Temperatur zu weit absinkt\\, schaltet sich die Dampfmaschine ab. Bei der Dampfmaschine geht bei jedem Kolbenhub etwas Wasser als Dampf verloren\\, daher muss regelmäßig Wasser nachgefüllt werden.\n".. - "\n".. - "\n".. - "\n", - "Teil der Dampfmaschine.\n".. - "\n".. - "\n".. - "\n", - "Antriebsteil der Dampfmaschine. Das Schwungrad muss über Antriebsachsen mit den Maschinen verbunden werden. \n".. - "\n".. - "\n".. - "\n", - "Teil der Dampfmaschine. Der Boiler muss mit dem Zylinder über die Dampfleitungen (steam pipes) verbunden werden. Die Dampfleitung besitzt keine Abzweigungen\\, die maximale Länge beträgt 12 m (Blöcke).\n".. - "\n".. - "\n".. - "\n", - "Die Antriebsachsen dienen zur Kraftübertragung von der Dampfmaschine zu anderen Maschinen. Die maximale Länge einer Antriebsachse beträgt 10 Blöcke. Über Getriebeblöcke können auch größere Strecken überbrückt\\, sowie Abzweigungen und Richtungswechsel realisiert werden.\n".. - "\n".. - "\n".. - "\n", - "Um Lampen oder andere Stromverbraucher an einer Dampfmaschine betreiben zu können\\, wird der TA2 Stromgenerator benötigt. Der TA2 Stromgenerator muss auf einer Seite mit Antriebsachsen verbunden werden und liefert dann auf der anderen Seite elektrischen Strom.\n".. - "\n".. - "Wird der Stromgenerator nicht mit ausreichend Kraft versorgt\\, geht er in einen Fehlerzustand und muss über einen Rechtsklick wieder aktiviert werden.\n".. - "\n".. - "Das Stromgenerator nimmt primär max. 25 ku an Achsenkraft auf und gibt sekundär max. 24 ku als Strom wieder ab. Er verbraucht also ein ku für die Umwandlung.\n".. - "\n".. - "\n".. - "\n", - "Bei größeren Anlagen mit mehreren Dampfmaschinen oder vielen angetriebenen Maschinen empfiehlt sich ein Energiespeicher. Der Energiespeicher bei TA2 arbeitet mit Lageenergie. Dazu wird Balast (Steine\\, Kies) in einer Kiste mit Hilfe einer Seilwinde in die Höhe gezogen. Ist überschüssige Energie im Achsen-Netzwerk vorhanden\\, so wird die Kiste nach oben gezogen. Wird kurzfristig mehr Energie benötigt\\, als die Dampfmaschine liefern kann\\, so gibt der Energiespeicher die gespeicherte Energie wieder ab\\, und die Balast-Kiste bewegt sich wieder nach unten.\n".. - "\n".. - "Der Energiespeicher besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet\\, zusammen gebaut werden.\n".. - "\n".. - "Um die maximale Speicherkapazität zu erreichen\\, muss die Kiste mit Gewichten komplett gefüllt\\, und der Mast inklusive der zwei Getriebeblöcke 12 Blöcke hoch sein. Kleinere Aufbauten sind aber auch möglich.\n".. - "\n".. - "\n".. - "\n", - "Die Seilwinde muss mit einem Getriebeblock verbunden werden und kann so überschüssige Energie aufnehmen und damit eine Gewichtekiste nach oben ziehen. Achte beim Aufbau der Seilwinde darauf\\, dass der Pfeil auf der Blockoberseite zum Getriebeblock zeigt. Die maximale Seillänge beträgt 10 Blöcke.\n".. - "\n".. - "\n".. - "\n", - "Diese Kiste muss mit bis zu 10 Blöcken Abstand unter die Seilwinde gesetzt und mit Pflastersteinen Kies oder Sand gefüllt werden. Ist das Mindestgewicht von einem Stack (99+ Items) erreicht und überschüssige Energie vorhanden\\, wird die Kiste automatisch über eine Seil mit der Seilwinde verbunden und in die Höhe gezogen.\n".. - "\n".. - "\n".. - "\n", - "Mit der Kupplung können Achsen und Maschinen vom Energiespeicher getrennt werden. Damit kommen die Achsen nach der Kupplung zum Stillstand und Maschinenanlagen können umgebaut werden. Achte beim Aufbau der Kupplung darauf\\, dass der Pfeil auf der Blockoberseite zum Energiespeicher zeigt. \n".. - "\n".. - "\n".. - "\n", - "Um Gegenstände (Items) von einer Verarbeitungsstation zur nächsten weiter zu transportieren\\, werden Schieber und Röhren verwendet. Siehe Plan.\n".. - "\n".. - "\n".. - "\n", - "Zwei Maschinen können mit Hilfe eines Schiebers und einer Röhre (tube) verbunden werden. Röhren besitzen keine Abzweigungen. Die maximale Länge beträgt 200 m (Blöcke).\n".. - "\n".. - "Röhren können alternativ mit Hilfe der Shift-Taste platziert werden. Dies erlaubt bspw. Röhren parallel zu verlegen\\, ohne dass diese sich unbeabsichtigt verbinden.\n".. - "\n".. - "Die Transportkapazität einer Röhre ist unbegrenzt und nur durch die Schieber begrenzt.\n".. - "\n".. - "\n".. - "\n", - "Über den Konzentrator können mehrere Röhren zu einer Röhre zusammengeführt werden. Die Richtung\\, in der alle Items weitergegeben werden\\, ist mit einem Pfeil markiert.\n".. - "\n".. - "\n".. - "\n", - "Ein Schieber ist in der Lage\\, Items aus Kisten oder Maschinen zu ziehen und in andere Kisten oder Maschinen zu schieben. Oder anders gesagt: Zwischen zwei Blöcken mit Inventar muss ein und genau ein Schieber sein. Mehrere Schieber in Reihe sind nicht möglich.\n".. - "In die Gegenrichtung ist ein Schieber für Items aber durchlässig\\, so dass eine Kiste über eine Röhre gefüllt und ebenso geleert werden kann. \n".. - "\n".. - "Ein Schieber geht in den Zustand \"standby\"\\, wenn der keine Items zum Schieben hat. Ist der Ausgang blockiert oder das Inventory des Empfängers voll\\, so geht der Schieber in den Zustand \"blocked\". Aus beiden Zuständen kommt der Schieber nach einigen Sekunden selbsttätig wieder raus\\, sofern sich die Situation geändert hat.\n".. - "\n".. - "Der Verarbeitungsleistung eines TA2 Schiebers beträgt 2 Items alle 2 s.\n".. - "\n".. - "\n".. - "\n", - "Der Verteiler ist in der Lage\\, die Items aus seinem Inventar sortiert in bis zu vier Richtungen weiter zu transportieren. Dazu muss der Verteiler entsprechend konfiguriert werden. \n".. - "\n".. - "Der Verteiler besitzt dazu ein Menü mit 4 Filter mit unterschiedlichen Farben\\, entsprechend den 4 Ausgängen. Soll ein Ausgang genutzt werden\\, so muss der entsprechende Filter über die \"on\" Checkbox aktiviert werden. Alle Items\\, die für diesen Filter konfiguriert sind\\, werden über den zugeordneten Ausgang ausgegeben. Wird ein Filter aktiviert\\, ohne das Items konfiguriert werden\\, so sprechen wir hier von einem \"nicht-konfigurierten\"\\, offenen Ausgang.\n".. - "\n".. - "*Achtung: Der Verteiler ist an seinen Ausgängen gleichzeitig ein Schieber. Daher niemals die Gegenstände mit einem Schieber aus dem Verteiler ziehen!*\n".. - "\n".. - "Für einen nicht-konfigurierten Ausgang gibt es zwei Betriebsarten:\n".. - "\n".. - "1) Alle Items ausgeben\\, die an keine anderen Ausgängen ausgegeben werden können\\, auch wenn diese blockiert sind.\n".. - "\n".. - "2) Nur die Items ausgeben\\, die für keinen anderen Filter konfiguriert wurden.\n".. - "\n".. - "Im ersten Fall werden immer alle Items weitergeleitet und der Verteiler läuft nicht voll. Im zweiten Fall werden Items zurückgehalten und der Verteiler kann voll laufen und in der Folge blockieren.\n".. - "\n".. - "Einstellbar ist die Betriebsart über die \"blockiere\" Checkbox.\n".. - "\n".. - "Der Verarbeitungsleistung eines TA2 Verteilers beträgt 4 Items alle 2 s\\, wobei der Verteiler dabei versucht\\, die 4 Items auf die offenen Ausgänge zu verteilen.\n".. - "\n".. - "Wird dasselbe Item in einem Filter mehrfach hinterlegt\\, so beeinflusst dies das langfristige Verteilungsverhältnis entsprechend.\n".. - "\n".. - "Bitte beachte\\, dass die Verteilung ein probabilistischer Vorgang ist\\, d.h. die Verhältnisse werden nicht exakt\\, sondern nur langfristig eingehalten.\n".. - "\n".. - "In den Filtern beträgt die maximale Stackgröße 12\\; insgesamt können höchstens 36 Items konfiguriert werden.\n".. - "\n".. - "\n".. - "\n", - "Die Kieswaschanlage ist eine komplexere Maschine mit dem Ziel\\, Usmium Nuggets aus gesiebtem Kies auszuwaschen. Für den Aufbau wird ein TA2 Kiesspüler mit Achsenantrieb\\, ein Trichter\\, eine Kiste\\, sowie fließendes Wasser benötigt. \n".. - "\n".. - "Aufbau von links nach rechts (siehe auch Plan):\n".. - "\n".. - " - Ein Erdblock\\, darauf die Wasserquelle\\, umgeben auf 3 Seiten von bspw. Glasblöcken\n".. - " - daneben den Kiesspüler\\, ggf. mit Röhrenanschlüssen für den Kies An- und Abtransport\n".. - " - dann den Trichter mit Kiste\n".. - "\n".. - "Das Ganze umgeben von weiteren Glasblöcken\\, so dass das Wasser über den Kiesspüler und den Trichter fließt und ausgespülten Nuggets vom Trichter wieder eingesammelt werden können.\n".. - "\n".. - "\n".. - "\n", - "Der Kiesspüler ist in der Lage\\, aus bereits gesiebtem Kies die Erze Usmium und Kupfer auszuspülen\\, sofern dieser von Wasser überspült wird.\n".. - "\n".. - "Ob der Kiesspüler korrekt arbeitet\\, kann mit Hilfe von Stöcken (sticks) getestet werden\\, wenn diese in das Inventar des Kiesspülers getan werden. Diese müssen einzeln ausgespült und vom Trichter eingefangen werden.\n".. - "\n".. - "Die Verarbeitungsleistung ist ein Kies Item alle 2 s. Der Kiesspüler benötigt 3 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "Das Brechen\\, Mahlen und Siebe von Gestein dient zur Gewinnung von Erzen. Gesiebtes Kies kann aber auch anderweitig genutzt werden. Steinbrecher\\, Mühle und Sieb müssen angetrieben und damit in der Nähe einer Dampfmaschine aufgebaut werden.\n".. - "\n".. - "\n".. - "\n", - "Der Steinbrecher dient zum Abbau von Steinen und anderen Materialien aus dem Untergrund. Der Steinbrecher gräbt ein 5x5 Blöcke großes Loch. Die Tiefe ist einstellbar.\n".. - "Die Verarbeitungsleistung ist ein Block alle 4 s. Der Steinbrecher benötigt 10 ku Energie. Die maximale Tiefe beträgt 20 Meter. Für größere Tiefen siehe TA3/TA4.\n".. - "\n".. - "\n".. - "\n", - "Die Mühle ist in der Lage\\, verschiedenes Gestein\\, aber auch Holz und andere Items zu mahlen.\n".. - "Die Verarbeitungsleistung ist ein Item alle 4 s. Die Mühle benötigt 4 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "Das Kiessieb ist in der Lage\\, Kies zu sieben um Erze zu gewinnen. Als Ergebnis erhält man teilweise \"gesiebtes Kies\"\\, was nicht wieder gesiebt werden kann.\n".. - "Die Verarbeitungsleistung ist ein Item alle 4 s. Das Kiessieb benötigt 3 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "Mit TA2 Maschinen können nicht nur Erze gewonnen\\, sondern auch Gegenstände hergestellt werden.\n".. - "\n", - "Der Autocrafter dient zur automatischen Herstellung von Waren. Alles was der Spieler über das \"Crafting Grid\" herstellen kann\\, kann auch durch den Autocrafter erledigt werden. Dazu müssen im Menü des Autocrafters das Rezept eingegeben und die notwendigen Zutaten hinzugefügt werden.\n".. - "\n".. - "Zutaten und hergestellte Waren können über Röhren und Schieber in und aus dem Block transportiert werden.\n".. - "\n".. - "Die Verarbeitungsleistung ist ein Item alle 4 s. Der Autocrafter benötigt 4 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "Die Elektronikfabrik ist eine Spezialmaschine und nur für die Herstellung der Vakuumröhren nutzbar. Vakuumröhren werden für TA3 Maschinen und Blöcke benötigt.\n".. - "\n".. - "Die Verarbeitungsleistung ist eine Vakuumröhre alle 6 s. Die Elektronikfabrik benötigt 8 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "", - "Für manche Rezepte wird Wasser benötigt. Damit auch diese Rezepte automatisiert mit dem Autocrafter bearbeitet werden können\\, muss Wasser in Eimern bereitgestellt werden. Hierzu dient der Flüssigkeitensammler. Er benötigt leere Eimer und muss ins Wasser gestellt werden.\n".. - "\n".. - "Die Verarbeitungsleistung ist ein Wassereimer alle 8 s. Der Flüssigkeitensammler benötigt 3 ku Energie.\n".. - "\n".. - "\n".. - "\n", - "Die gesicherte Kiste kann nur von den Spielern genutzt werden\\, die an diesem Ort auch bauen können\\, also Protection Rechte besitzen. Es spielt dabei keine Rolle\\, wer die Kiste setzt. \n".. - "\n".. - "\n".. - "\n", - "Minetest teilt die Karte in sogenannte Map-Blocks ein. Das sind Würfel mit 16x16x16 Blöcke Kantenlänge. So ein Map-Block wird vom Server immer komplett geladen\\, aber es werden nur die Blöcke um einen Spieler herum geladen (ca. 2-3 Blöcke in alle Richtungen). In Sichtrichtung des Spielers sind es auch mehr Map-Blöcke. Nur dieser Teil der Welt ist aktiv und nur hier wachsen Pflanzen und Bäume bzw. laufen die Maschinen.\n".. - "\n".. - "Mit einem Forceload-Block kannst du erzwingen\\, dass der Map-Block\\, in dem der Forceload Block steht\\, immer geladen bleibt\\, solange du auf dem Server bist. Wenn alle deine Farmen und Maschinen mit Forceload Blöcken abgedeckt sind\\, ist immer alles am Laufen.\n".. - "\n".. - "Die Map-Blöcke mit ihren Koordinaten sind vordefiniert\\, also bspw. (0\\,0\\,0) bis (15\\,15\\,15)\\, oder (16\\,16\\,16) bis (31\\,31\\,31).\n".. - "Man kann einen Forceload-Block innerhalb eines Map-Blockes verschieben wie man will\\, die Position des Map-Blocks bleibt dabei unverändert. \n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta2", - "", - "ta2_firebox", - "ta2_boiler", - "ta2_cylinder", - "ta2_flywheel", - "ta2_steampipe", - "ta2_driveaxle", - "ta2_generator", - "", - "ta2_winch", - "ta2_weight_chest", - "techage:ta2_clutch_off", - "", - "tube", - "concentrator", - "ta2_pusher", - "ta2_distributor", - "", - "ta2_rinser", - "ta2_grinder", - "ta2_quarry", - "ta2_grinder", - "ta2_gravelsieve", - "", - "ta2_autocrafter", - "ta2_electronicfab", - "", - "ta2_liquidsampler", - "ta2_chest", - "ta2_forceload", - }, - plans = { - "", - "steamengine", - "", - "", - "", - "", - "", - "", - "", - "ta2_storage", - "", - "", - "", - "itemtransport", - "", - "", - "", - "", - "gravelrinser", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta2_EN.lua b/techage/doc/manual_ta2_EN.lua deleted file mode 100644 index af0cfe4..0000000 --- a/techage/doc/manual_ta2_EN.lua +++ /dev/null @@ -1,308 +0,0 @@ -return { - titles = { - "1,TA2: Steam Age", - "2,Steam Engine", - "3,TA2 Firebox", - "3,TA2 Boiler", - "3,TA2 Cylinder", - "3,TA2 Flywheel", - "3,TA2 Steam Pipes", - "3,TA2 Drive Axle / TA2 Gearbox", - "3,TA2 Power Generator", - "2,TA2 energy storage", - "3,TA2 Winch", - "3,TA2 Weight Chest", - "3,TA2 Clutch", - "2,Push and sort items", - "3,TechAge Tube", - "3,Tube Concentrator", - "3,TA2 Pusher", - "3,TA2 Distributor", - "2,Gravel washer", - "3,TA2 Gravel Rinser", - "2,Dig stone\\, grind and sieve", - "3,TA2 Quarry", - "3,TA2 Grinder", - "3,TA2 Gravel Sieve", - "2,Produce Items", - "3,TA2 Autocrafter", - "3,TA2 Electronic Fab", - "2,Other blocks", - "3,TA2 Liquid Sampler", - "3,TA2 Protected Chest", - "3,Techage Forceload Block", - }, - texts = { - "TA2 is about building and operating the first machines for processing ores. Some machines have to be driven via drive axles. To do this\\, you need to build a steam engine and heat it with coal or charcoal.\n".. - "\n".. - "In TA2 there is also a gravel rinser that can be used to wash out rare ores such as Usmium nuggets. You will need these nuggets later for further recipes.\n".. - "\n".. - "\n".. - "\n", - "The steam engine consists of several blocks and must be assembled as shown in the plan on the right. The blocks TA2 fire box\\, TA2 boiler top\\, TA2 boiler bottom\\, TA2 cylinder\\, TA2 flywheel and steam pipes are required.\n".. - "\n".. - "In addition\\, drive axles and gear blocks are required for changing direction. The flywheel must be connected to all machines that have to be driven via the drive axles.\n".. - "\n".. - "Always pay attention to the alignment of all blocks when placing:\n".. - "\n".. - " - Cylinder on the left\\, flywheel on the right\n".. - " - Connect steam pipes where there is a corresponding hole\n".. - " - Drive axle on flywheel only on the right\n".. - " - In all machines\\, the drive axles can be connected on all sides\\, which is not occupied by other functions\\, such as the IN and OUT holes in the grinder and sieve.\n".. - "\n".. - "The boiler must be filled with water. Fill up to 10 buckets of water in the boiler.\n".. - "The fire box must be filled with coal or charcoal.\n".. - "When the water is hot (temperature display at the top)\\, the steam engine can be started on the flywheel.\n".. - "\n".. - "The steam engine has a capacity of 25 ku\\, so it can drive several machines at the same time.\n".. - "\n".. - "\n".. - "\n", - "Part of the steam engine.\n".. - "\n".. - "The fire box must be filled with coal or charcoal. The burning time depends on the power demanded by the steam engine. Coal burns for 32 s and charcoal for 96 s under full load.\n".. - "\n".. - "\n".. - "\n", - "Part of the steam engine. Must be filled with water. This is done by clicking on the boiler with a water bucket. When there is no more water or the temperature drops too low\\, the steam engine switches off. With the steam engine\\, some water is lost as steam with each piston stroke\\, so water has to be refilled regularly.\n".. - "\n".. - "\n".. - "\n", - "Part of the steam engine.\n".. - "\n".. - "\n".. - "\n", - "Drive part of the steam engine. The flywheel must be connected to the machines via drive axles.\n".. - "\n".. - "\n".. - "\n", - "Part of the steam engine. The boiler must be connected to the cylinder via the steam pipes. The steam pipe has no branches\\, the maximum length is 12 m (blocks).\n".. - "\n".. - "\n".. - "\n", - "The drive axles are used to transmit power from the steam engine to other machines. The maximum length of a drive axis is 10 blocks. With TA2 Gearboxes\\, larger distances can be bridged\\, and branches and changes of direction can be realized.\n".. - "\n".. - "\n".. - "\n", - "The TA2 Power Generator is required to operate lamps or other power consumers on a steam engine. The TA2 Power Generator has to be connected to drive axles on one side and then supplies electricity on the other side.\n".. - "\n".. - "If the Power Generator is not supplied with sufficient power\\, it goes into an error state and must be reactivated with a right-click.\n".. - "\n".. - "The Power Generator takes max. 25 ku of axle power and provides on the other side max. 24 ku as electricity. So he consumes one ku for the conversion.\n".. - "\n".. - "\n".. - "\n", - "For larger systems with several steam engines or many driven machines\\, an energy storage system is recommended. The energy storage at TA2 works with position energy. For this purpose\\, ballast (stones\\, gravel\\, sand) is pulled up in a chest with the help of a cable winch. If there is excess energy in the axis network\\, the chest is pulled upwards. If more energy is required in the short term than the steam engine can supply\\, the energy store releases the stored energy again and the weight chest moves down again. \n".. - "The energy storage consists of several blocks and must be assembled as shown in the plan on the right. \n".. - "In order to achieve the maximum storage capacity\\, the chest must be completely filled with weights and the mast including the two gear boxes must be 12 blocks high. Smaller structures are also possible.\n".. - "\n".. - "\n".. - "\n", - "The cable winch must be connected to a gear box and can absorb excess energy and thus pull a weight chest upwards. \n".. - "When assembling the cable winch\\, make sure that the arrow on the top of the block points to the gearbox.\n".. - "The maximum rope length is 10 blocks. \n".. - "\n".. - "\n".. - "\n", - "This chest must be placed under the winch with a distance of up to 10 blocks and filled with cobblestone\\, gravel or sand. If the minimum weight of a stack (99+ items) is reached and there is excess energy\\, the box is automatically connected to the winch via a rope and pulled up. \n".. - "\n".. - "\n".. - "\n", - "With the clutch\\, axles and machines can be separated from the energy storage. This means that the axles after the clutch come to a standstill and machine systems can be rebuilt. When assembling the clutch\\, make sure that the arrow on the top of the block points to the energy storage system.\n".. - "\n".. - "\n".. - "\n", - "In order to transport objects from one processing station to the next\\, pushers and tubes are used. See plan.\n".. - "\n".. - "\n".. - "\n", - "Two machines can be connected with the help of a pusher and a tube. Tubes have no branches. The maximum length is 200 m (blocks).\n".. - "\n".. - "Alternatively\\, tubes can be placed using the Shift key. This allows\\, for example\\, tubes to be laid in parallel without them accidentally connecting.\n".. - "\n".. - "The transport capacity of a tube is unlimited and only limited by the pusher.\n".. - "\n".. - "\n".. - "\n", - "Several tubes can be combined into one tube via the concentrator. The direction in which all items are passed on is marked with an arrow. \n".. - "\n".. - "\n".. - "\n", - "A pusher is able to pull items out of boxes or machines and push them into other boxes or machines. In other words\\, there must be one and exactly one pusher between two blocks with inventory. Multiple pushers in a row are not possible.\n".. - "In the opposite direction\\, however\\, a pusher is permeable for items\\, so that a box can be filled via a tube and also taught.\n".. - "\n".. - "A pusher goes into the \"standby\" state if it has no items to push. If the output is blocked or the recipient's inventory is full\\, the pusher goes into the \"blocked\" state. The pusher automatically comes out of both states after a few seconds if the situation has changed.\n".. - "\n".. - "The processing power of a TA2 pusher is 2 items every 2 s.\n".. - "\n".. - "\n".. - "\n", - "The distributor is able to transport the items from his inventory sorted in up to four directions. To do this\\, the distributor must be configured accordingly.\n".. - "\n".. - "The distributor has a menu with 4 filters with different colors\\, corresponding to the 4 outputs. If an output is to be used\\, the corresponding filter must be activated via the \"on\" checkbox. All items that are configured for this filter are output via the assigned output. If a filter is activated without items being configured\\, we are talking about an \"unconfigured\"\\, open output.\n".. - "\n".. - "*Attention: The distributor is also a pusher at its output sides. Therefore\\, never pull items out of the distributor with a pusher!*\n".. - "\n".. - "There are two operating modes for a non-configured output:\n".. - "\n".. - "1) Output all items that cannot be output to any other exit\\, even if they are blocked.\n".. - "\n".. - "2) Only output the items that have not been configured for any other filter.\n".. - "\n".. - "In the first case\\, all items are always forwarded and the distributor does not run full. In the second case\\, items are held back and the distributor can run full and then block.\n".. - "\n".. - "The operating mode can be set using the \"blocking mode\" checkbox.\n".. - "\n".. - "The processing power of a TA2 distributor is 4 items every 2 s\\, whereby the distributor tries to distribute the 4 items to the open outputs.\n".. - "\n".. - "If the same item is configured multiple times in one filter\\, the long term distribution ratio will be influenced accordingly.\n".. - "\n".. - "Please note that the distribution is a probabilistic process. This means that the distribution rations won't be matched exactly\\, but only in the long term.\n".. - "\n".. - "The maximum stack size in the filters is 12\\; in total\\, not more than 36 items can be configured.\n".. - "\n".. - "\n".. - "\n", - "The gravel washer is a more complex machine with the goal of washing Usmium nuggets out of sieved gravel. A TA2 rinser with axis drive\\, a hopper\\, a chest and running water are required for the installation.\n".. - "\n".. - "Structure from left to right (see also plan):\n".. - "\n".. - " - A dirt block\\, on top of it the water source\\, surrounded on 3 sides by e.g. glass blocks\n".. - " - next to it the gravel rinser\\, if necessary with tube connections for the gravel delivery and removal\n".. - " - then the hopper with chest\n".. - "\n".. - "The whole thing is surrounded by further glass blocks\\, so that the water flows over the gravel rinser and the hopper and rinsed-out nuggets can be collected again by the hopper.\n".. - "\n".. - "\n".. - "\n", - "The gravel washer is able to rinse out the Usmium and copper ores from gravel that has already been sieved\\, provided that this is flushed with water.\n".. - "\n".. - "Whether the Gravel Rinser works correctly can be tested with sticks if these are placed in the inventory of the Gravel Rinser. These must be rinsed out individually and caught by the hopper.\n".. - "\n".. - "The processing power is one gravel item every 2 s. The gravel washer needs 3 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "Crushing\\, grinding and sieving of cobblestone is used to extract ores. Sieved gravel can also be used for other purposes. Quarry\\, grinder and sieve must be driven and thus installed near a steam engine.\n".. - "\n".. - "\n".. - "\n", - "The quarry is used to remove stones and other materials from the underground. The quarry digs a 5x5 block hole. The depth is adjustable.\n".. - "The processing power is one block every 4 s. The quarry needs 10 ku of energy. The maximum depth is 20 meters. For greater depths see TA3 / TA4.\n".. - "\n".. - "\n".. - "\n", - "The grinder is able to grind various rocks\\, but also wood and other items.\n".. - "The processing power is one item every 4 s. The grinder needs 4 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "The gravel sieve is able to sieve gravel to extract ores. The result is partially \"sieved gravel\"\\, which cannot be sieved again.\n".. - "The processing power is one item every 4 s. The gravel sieve requires 3 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "TA2 machines can not only extract ores\\, but also produce objects.\n".. - "\n", - "The autocrafter is used for the automatic production of goods. Everything that the player can produce via the \"Crafting Grid\" can also be done by the autocrafter. To do this\\, the recipe must be entered in the menu of the autocrafter and the necessary ingredients added.\n".. - "\n".. - "Ingredients and manufactured goods can be transported in and out of the block via tubes and pushers.\n".. - "\n".. - "The processing power is one item every 4 s. The autocrafter requires 4 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "The electronic fab is a special machine and can only be used for the production of vacuum tubes. Vacuum tubes are required for TA3 machines and blocks.\n".. - "\n".. - "The processing power is one vacuum tube every 6 s. The electronic fab requires 8 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "", - "Some recipes require water. So that these recipes can also be processed automatically with the autocrafter\\, water must be provided in buckets. The liquid sampler is used for this. He needs empty buckets and has to be put in the water.\n".. - "\n".. - "The processing capacity is one water bucket every 8 s. The liquid sampler requires 3 ku of energy.\n".. - "\n".. - "\n".. - "\n", - "The protected chest can only be used by players who can build at this location\\, i.e. who have protection rights. It does not matter who sets the chest.\n".. - "\n".. - "\n".. - "\n", - "Minetest divides the map into so-called map blocks. These are cubes with an edge length of 16x16x16 blocks. Such a map block is always loaded completely by the server\\, but only the blocks around a player are loaded (approx. 2-3 blocks in all directions). In the player's direction of view\\, there are also more map blocks. Only this part of the world is active and only here do plants and trees grow or the machines run.\n".. - "\n".. - "With a forceload block you can force the map block in which the forceload block is located to remain loaded as long as you are on the server. When all your farms and machines are covered with Forceload blocks\\, everything is always running.\n".. - "\n".. - "The map blocks with their coordinates are predefined\\, e.g. (0\\,0\\,0) to (15\\,15\\,15)\\, or (16\\,16\\,16) to (31\\,31\\,31).\n".. - "You can move a forceload block within a map block as you like\\, the position of the map block remains unchanged.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta2", - "", - "ta2_firebox", - "ta2_boiler", - "ta2_cylinder", - "ta2_flywheel", - "ta2_steampipe", - "ta2_driveaxle", - "ta2_generator", - "", - "ta2_winch", - "ta2_weight_chest", - "techage:ta2_clutch_off", - "", - "tube", - "concentrator", - "ta2_pusher", - "ta2_distributor", - "", - "ta2_rinser", - "ta2_grinder", - "ta2_quarry", - "ta2_grinder", - "ta2_gravelsieve", - "", - "ta2_autocrafter", - "ta2_electronicfab", - "", - "ta2_liquidsampler", - "ta2_chest", - "ta2_forceload", - }, - plans = { - "", - "steamengine", - "", - "", - "", - "", - "", - "", - "", - "ta2_storage", - "", - "", - "", - "itemtransport", - "", - "", - "", - "", - "gravelrinser", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta2_RU.lua b/techage/doc/manual_ta2_RU.lua deleted file mode 100644 index 0de82d5..0000000 --- a/techage/doc/manual_ta2_RU.lua +++ /dev/null @@ -1,308 +0,0 @@ -return { - titles = { - "1,TA2: Эпоха пара", - "2,Паровой двигатель", - "3,TA2 Топка", - "3,TA2 Котел", - "3,TA2 Поршень", - "3,TA2 Маховик", - "3,TA2 Паровые трубы", - "3,TA2 Приводная ось / TA2 редуктор", - "3,TA2 Энергогенератор", - "2,TA2 Энергохранилище", - "3,TA2 Лебедка", - "3,TA2 Ящик-груз", - "3,TA2 Муфта", - "2,Двигаем и сортируем предметы", - "3,ТА труба", - "3,Трубосборник", - "3,TA2 Толкатель", - "3,TA2 Распределитель", - "2,Промывание гравия", - "3,TA2 Гравийная мойка", - "2,Копаем камень\\, дробим и просеиваем", - "3,TA2 Карьер", - "3,TA2 Дробилка", - "3,TA2 Гравийное сито", - "2,Производим предметы", - "3,TA2 Автокрафтер", - "3,TA2 Электронная фабрика", - "2,Другие блоки", - "3,TA2 Заборник жидкостей", - "3,TA2 Защищенный сундук", - "3,ТА Загрузочный блок", - }, - texts = { - "TA2 - про сооружение и запуск первых рудоперерабатывающих машин. Некоторые машины приводятся в движение приводными осями. Для этого\\, нужно построить паровой двигатель и разогреть его углем или древесным углем.\n".. - "\n".. - "В TA2 ещё есть гравийная мойка, которая применяется для намывания редких руд, в частности усмиевых самородков. Эти самородки понадобятся в будущих рецептах.\n".. - "\n".. - "\n".. - "\n", - "Паровой двигатель состоит из нескольких блоков и должен быть собран так, как показано на чертеже справа. Понадобятся блоки ТА2 Топка\\, TA2 котёл навершие\\, TA2 котёл основание\\, TA2 поршень\\, TA2 маховик и паровые трубы.\n".. - "\n".. - "Кроме того\\, приводные оси и редуктор(ы) необходимы для изменения направления. Маховик должен быть соединен со всеми машинами, которые требуют привода от осей.\n".. - "\n".. - "Всегда обращайте внимание на направление ориентации блока, который размещаете:\n".. - "\n".. - " - Поршень слева\\, маховик справа\n".. - " - Подключайте паровые трубы в местах, где есть соответствующее отверстие\n".. - " - Приводная ось к маховику только справа\n".. - " - Для всех машин\\, приводная ось может быть присоединена к любой стороне\\, не занятой другой функцией\\, такой как отверстия ВХОД (IN) и ВЫХОД (OUT) у дробилки и сита.\n".. - "\n".. - "Котёл должен быть заполнен водой. Наливайте до 10 вёдер.\n".. - "Топка должна быть заполнена углём или древесным углём.\n".. - "Когда вода достаточно нагрелась (градусник наверху)\\, паровой двигатель начнет вращать маховик.\n".. - "\n".. - "Мощность парового двигателя 25 кю (ku, kilo unit, условных килоединиц)\\, он может питать несколько машин одновременно.\n".. - "\n".. - "\n".. - "\n", - "Часть парового двигателя.\n".. - "\n".. - "Топка должна быть заполнена углём или древесным углём. Время горения зависит от мощности, вырабатываемой паровым двигателем. Уголь горит 32 с, древесный уголь 86 с при полной нагрузке.\n".. - "\n".. - "\n".. - "\n", - "Часть парового двигателя. Должен быть заполнен водой. Кликать на котёл ведром с водой. Если вода закончится или температура упадёт слишком низко\\, паровой двигатель отключится.\n".. - "\n".. - "\n".. - "\n", - "Часть парового двигателя.\n".. - "\n".. - "\n".. - "\n", - "Приводная часть парового двигателя. Маховик должен быть соединен с машинами через приводные оси.\n".. - "\n".. - "\n".. - "\n", - "Часть парового двигателя. Котел должен быть соединен с поршнем посредством паровых труб. Паровая труба не может иметь ответвлений\\, максимальная длина 12 м (блоков).\n".. - "\n".. - "\n".. - "\n", - "Приводные оси нужны для передачи мощности от парового двигателя к остальным машинам. Максимальная длина приводной оси 10 блоков. С помощью ТА2 редукторов\\, можно увеличивать расстояния\\, а также организовать ветвления и повороты.\n".. - "\n".. - "\n".. - "\n", - "TA2 Электрогенератор требуется для активации ламп или других потребителей на паровом двигателе. ТА2 Электрогенератор должен быть присоединен к приводной оси с одной стороны, тогда он выдаёт электричество с другой стороны.\n".. - "\n".. - "Если Электрогенератор не получает достаточно мощности\\, он переходит в состояние ошибки и должен быть повторно активирован правым кликом.\n".. - "\n".. - "Электрогенератор потребляет максимум 25 кю с приводной оси и выдаёт на другой стороне максимум 24 кю в виде электричества. Одна кю потребляется на преобразование.\n".. - "\n".. - "\n".. - "\n", - "Для более крупных систем с несколькими паровыми двигателями или множеством машин\\, рекомендуется энергохранилище. Энергохранилище в ТА2 работает от позиционной энергии. Для этого\\, балласт (камни\\, гравий\\, песок) подтягивается вверх в сундуке кабельной лебёдкой. Если в осевой сети избыток энергии\\, сундук тянется вверх. Если потребление энергии превышает возможости парового двигателя\\, хранилище выпускает энергию, и грузовой сундук движется вниз. \n".. - "Энергохранилище состоит из нескольких блоков и собирается как показано на чертеже справа. \n".. - "Чтобы получить максимальную ёмкость хранения\\, сундук должен быть польностью заполнен грузом, а мачта вместе с двумя редукторами должна быть 12 блоков в высоту. Меньшие конструкции допускаются.\n".. - "\n".. - "\n".. - "\n", - "Лебедка должна быть подключена к редуктору и может поглощать избыточную энергию и, таким образом, подтягивать ящик-груз вверх. \n".. - "При сборке лебедки\\ убедитесь, что стрелка в верхней части блока указывает на редуктор.\n".. - "Максимальная длина веревки составляет 10 блоков. \n".. - "\n".. - "\n".. - "\n", - "Этот сундук должен быть размещён под лебедкой на расстоянии до 10 блоков и заполнен булыжником,\\, гравием или песком. Если минимальный вес стака (99+ штук) достигнут и имеется избыточная энергия\\, коробка автоматически присоединится к лебедке тросом и будет утянута вверх. \n".. - "\n".. - "\n".. - "\n", - "С помощью муфты\\ можно отделить оси и машины от накопителя энергии. Это означает, что оси после сцепления останавливаются, а системы машин могут быть восстановлены. При сборке сцепления\\ убедитесь, что стрелка на верхней части блока направлена на накопитель энергии.\n".. - "\n".. - "\n".. - "\n", - "Для транспортировки предметов от одного пункта переработки к другому\\, использудтся толкатели и трубы. См. план.\n".. - "\n".. - "\n".. - "\n", - "Две машины можно соединить толкателем и трубой. У труб нет ответвлений. Максимальная длина 200 м (блоков).\n".. - "\n".. - "Альтернативно\\, трубы можно размещать с применением клавиши Shift. Это позволитs\\, например\\, уложить трубы параллельно без их случайного соединения.\n".. - "\n".. - "Пропускная способность трубы неограниченна, ограничение имеет только толкатель.\n".. - "\n".. - "\n".. - "\n", - "Несколько труб можно собрать в одну посредством концентратора. Стрелкой обозначено направление, в котором будут передаваться предметы.\n".. - "\n".. - "\n".. - "\n", - "Толкатель способен вынимать предметы из сундуков или из машине и толкать их в другие сундуки или машины. Иными словами\\, между двумя блоками с инвентарем должен один и только один толкатель. Несколько толкателей в ряд поставить нельзя.\n".. - "В обратном направлении\\, однако\\, толькатель проницаем для предметов\\, так что сундук может заполняться через трубу и в то же время обучен (чё?).\n".. - "\n".. - "Толкатель переходит в режим \"standby\" ожидания, если нет предметов для толкания. Если выход заблокирован или инвентарь получателя переполнен\\, толкатель переходит в состояние \"blocked\" заблокирован. Толкатель автоматически выходит из обоих состояний через несколько секунд после изменения обстановки.\n".. - "\n".. - "Перерабатывающая мощность ТА2 толкателя составляет 2 предмета каждые 2 с.\n".. - "\n".. - "\n".. - "\n", - "Распределитель может передавать предметы из своего инвентаря, сортируя их по направлениям, до 4 направлений. Для этого\\, распределитель нужно соответственно сконфигурировать.\n".. - "\n".. - "У распределителя в меню 4 фильтра разных цветов.\\, соответствующих 4 выходам. Если выход будет использоваться\\, соответствующий фильтр нужно активировать галочкой \"on\". Все предметы, на которые этот фильтр настроен, двинутся через начначенный выход. Если фильтр активирован без назначенных предметов\\, мы говорим о несконфигурированном \"unconfigured\"\\, открытом выходе.\n".. - "\n".. - "*Внимание: Распределитель является толкателем на своих выходных сторонах. Поэтому\\, никогда не вытягивайте предметы из распределителя толкателем!*\n".. - "\n".. - "Для несконфигурированного выхода есть два режима работы:\n".. - "\n".. - "1) Выпускать все предметы, которые не могут выйти через другие стороны\\, даже если они заблокированы.\n".. - "\n".. - "2) Выпускать только те предметы, которые не были сконфигурированы для какого-либо из остальных фильтров.\n".. - "\n".. - "В первом случае\\, все предметы всегда пересылаются и распределитель не наполняется. Во втором случае\\, предметы удерживаются и распределитель может переполниться и заблокироваться.\n".. - "\n".. - "Операционный режим устанавливается галочкой в \"blocking mode\".\n".. - "\n".. - "Производительность ТА2 распределителя составляет 4 штуки каждые 2 секунды\\, он пытается распределить 4 штуки в открытые выходы.\n".. - "\n".. - "Если один предмет сконфигурирован несколько раз в один фильтр\\, то соответственно увеличится долгосрочный темп распределения.\n".. - "\n".. - "Обратите вннимание: распределение это вероятностный процесс. Это значит, что темп распределения соблюдается не в точности\\, но сохраняется при длительной работе.\n".. - "\n".. - "Максимальный размер стека в фильтре - 12\\; в сумме\\, можно сконфигурировать не более 36 позиций.\n".. - "\n".. - "\n".. - "\n", - "Гравийная мойка это достаточно сложная машина предназначенная для вымывания усмиевых самородоков из просеянного гравия. ТА2 мойка с осевым приводом\\, хопром\\, сундуком и текущей водой требуются для запуска.\n".. - "\n".. - "Структура слева направо (также см. план):\n".. - "\n".. - " - Блок земли\\, сверху него источник воды\\, с трех сторон окружен блоками, например стекла\n".. - " - следом гравийная мойка\\, по желанию с трубными соединениями для поступления и удаления гравия\n".. - " - затем хопер с сундуком\n".. - "\n".. - "Вся конструкция окружена блоками стекла\\, так что вода течет над мойкой и хопром и вымытые самородки собираются в хопер.\n".. - "\n".. - "\n".. - "\n", - "Гравийнай мойка вымывает усмий и медь из гравия который был ранее просеян\\, предполагая что это обеспечивается водными потоком.\n".. - "\n".. - "Правильную работоспособность мойки можно проверить палками, помещенными в инвентарь мойки. Они должны поочередно вымываться и собираться в хопер.\n".. - "\n".. - "Производительность гравийной мойки 1 гравий каждые 2 секунды. Потребление энергии 2 ku.\n".. - "\n".. - "\n".. - "\n", - "Дробление\\, перемалывание и просеивание булыжника применяется для извлечения руд. Просеянный гравий также может быть использован в других процессах. Карьер\\, дробилка и сито требуют привода и поэтому ставятся поблизости от парового двигателя.\n".. - "\n".. - "\n".. - "\n", - "Карьер используют для извлечения камней и иных материалов из-под земли. Карьер копает шахту размером 5х5 блоков. Глубину можно настраивать.\n".. - "Производительность карьера 1 блок каждые 4 секунды. Потребляет 10 ku энергии. Максимальная глубина 20 метров. Для больших глубин переходите к ТА3 / ТА4.\n".. - "\n".. - "\n".. - "\n", - "Дробилка может дробить различные породы\\, а также дерево и некторые другие предметы.\n".. - "Производительность 1 штука каждые 4 секунды. Потребление 4 ku.\n".. - "\n".. - "\n".. - "\n", - "Гравийное сито может просеивать гравий для извлечения руд. На выходе также образуется просеянный гравий \"sieved gravel\"\\, который можно просеивать повторно.\n".. - "Производительность гравийного сита 1 штука каждые 4 секунды. Потребление 3 ku.\n".. - "\n".. - "\n".. - "\n", - "ТА2 машины могут не только извлекать руды\\, но также и производить объекты.\n".. - "\n", - "Автокрафтер используется для автоматического производства изделий. Все что игрок может создать на решетке крафта \"Crafting Grid\" может быть выполнено автокрафтером. Для этого\\, рецепт нужно ввести в меню автокрафтера и вложить нужные ингредиенты.\n".. - "\n".. - "Ингредиенты и произведенные изделия можно транспортировать внутрь и наружу автокрафтера через трубы и толкатели.\n".. - "\n".. - "Производительность автокрафтера 1 предмет каждые 4 секунды. Потребление 4 ku.\n".. - "\n".. - "\n".. - "\n", - "Электронная фабрика это отдельная машина которая используется только для производства радиоламп. Радиолампы требуются для ТА3 машин и блоков.\n".. - "\n".. - "Производительность электронной фабрики 1 радиолампа каждые 6 секунд. Потребление 8 ku.\n".. - "\n".. - "\n".. - "\n", - "", - "Некоторые рецепты требуют воды. Такие рецепты также могут быть обработаны автокрафтером\\, вода должна поступать в ведрах. Для этого нужен водозаборник. В него нужно поместить пустые ведра, а его - в воду.\n".. - "\n".. - "Производительность водозаборника 1 ведро каждые 8 секунд. Потребление 3 ku.\n".. - "\n".. - "\n".. - "\n", - "Защищенный сундук могут использовать только игроки с правами строительства на этой территории\\, т.е. с правами привата. Неважно, кто поставил сундук.\n".. - "\n".. - "\n".. - "\n", - "Майнтест делит карту на блоки - так называемые чанки. Это кубы с гранью 16 блоков. Такой чанк всегда загружается сервером целиком\\, но загружаются только блоки вокруг игрока, примерно 2-3 чанка во всех направлениях. В направлении взгляда игрока\\, загружается больше чанков. Только эта часть мира активна и только в ней растения растут и машины работают.\n".. - "\n".. - "Блоком принудительной загрузки (БПЗ) вы можете заставить чанк, в котором размещен такой блок, оставаться активным все время пока вы находитесь на сервере. Если все ваши фермы и фабрики покрыты БлокамиПЗ\\, всё работает непрерывно.\n".. - "\n".. - "Блоки карты - чанки предопределены в своих координатах\\, например (0\\,0\\,0) до (15\\,15\\,15)\\, или (16\\,16\\,16) до (31\\,31\\,31).\n".. - "БлокПЗ можно ставить в любом месте чанка\\, тогда как положение чанка всегда неизменно.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta2", - "", - "ta2_firebox", - "ta2_boiler", - "ta2_cylinder", - "ta2_flywheel", - "ta2_steampipe", - "ta2_driveaxle", - "ta2_generator", - "", - "ta2_winch", - "ta2_weight_chest", - "techage:ta2_clutch_off", - "", - "tube", - "concentrator", - "ta2_pusher", - "ta2_distributor", - "", - "ta2_rinser", - "ta2_grinder", - "ta2_quarry", - "ta2_grinder", - "ta2_gravelsieve", - "", - "ta2_autocrafter", - "ta2_electronicfab", - "", - "ta2_liquidsampler", - "ta2_chest", - "ta2_forceload", - }, - plans = { - "", - "steamengine", - "", - "", - "", - "", - "", - "", - "", - "ta2_storage", - "", - "", - "", - "itemtransport", - "", - "", - "", - "", - "gravelrinser", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta2_pt-BR.lua b/techage/doc/manual_ta2_pt-BR.lua deleted file mode 100644 index 5db2a6e..0000000 --- a/techage/doc/manual_ta2_pt-BR.lua +++ /dev/null @@ -1,306 +0,0 @@ -return { - titles = { - "1,TA2: Era a Vapor", - "2,Máquina a Vapor", - "3,Caixa de Fogo(Firebox) TA2", - "3,TA2 Caldeira(Boiler)", - "3,TA2 Cilindro(Cylinder)", - "3,TA2 Volante(Flywheel)", - "3,TA2 Tubos de Vapor(Steam pipes)", - "3,TA2 Eixo de Transmissão(Drive axle) TA2 / Caixa de Engrenagem(Gearbox)", - "3,TA2 Gerador de Energia", - "2,TA2 Armazenamento de Energia", - "3,TA2 Guincho", - "3,TA2 Baú de Pesos", - "3,TA2 Embreagem", - "2,Empurrar e classificar itens", - "3,Tubo TechAge", - "3,Tubo Concentrador", - "3,TA2 Pusher", - "3,TA2 Distributor(Distribuidor)", - "2,Gravel washer(Lavador de cascalho)", - "3,TA2 Gravel Rinser(Enxaguatório de cascalho)", - "2,Escavar pedra\\, moer e peneirar", - "3,TA2 Quarry(Pedreira)", - "3,TA2 Grinder(Moedor)", - "3,TA2 Gravel Sieve(Peneira de cascalho)", - "2,Produzindo Itens", - "3,TA2 Autocrafter", - "3,TA2 Electronic Fab", - "2,Outros Blocos", - "3,TA2 Liquid Sampler", - "3,TA2 Protected Chest", - "3,Techage Forceload Block", - }, - texts = { - "TA2 trata-se de construir e operar as primeiras máquinas para processamento de minérios. Algumas máquinas precisam ser acionadas por eixos de transmissão. Para fazer isso\\, você precisa construir uma máquina a vapor e aquecê-la com carvão ou carvão vegetal.\n".. - "\n".. - "No TA2\\, há também um lavador de cascalho que pode ser usado para lavar minérios raros\\, como pepitas de Usmium. Você precisará dessas pepitas posteriormente para receitas adicionais.\n".. - "\n".. - "\n".. - "\n", - "A máquina a vapor é composta por vários blocos e deve ser montada conforme mostrado no plano à direita. São necessários os blocos da Caixa de Fogo(Firebox) TA2\\, parte superior da Caldeira(Boiler) TA2\\, parte inferior da Caldeira(Boiler) TA2\\, Cilindro(Cylinder) TA2\\, Volante(Flywheel) TA2 e Tubos de Vapor(steam piper) TA2.\n".. - "\n".. - "Além disso\\, são necessários Eixos de Transmissão(drive axles) e blocos de Engrenagem(gear) para mudança de direção. O Volante deve ser conectado a todas as máquinas que precisam ser acionadas pelos Eixos de Transmissão.\n".. - "\n".. - "Sempre preste atenção ao alinhamento de todos os blocos ao colocá-los:\n".. - "\n".. - " - Cilindro à esquerda\\, volante à direita\n".. - " - Conectar os tubos de vapor onde há um furo correspondente\n".. - " - Eixo de transmissão no volante apenas à direita\n".. - " - Em todas as máquinas\\, os eixos de transmissão podem ser conectados em todos os lados que não estejam ocupados por outras funções\\, como os furos de ENTRADA(IN) e SAÍDA(OUTPUT) no Moedor(grinder) e na Peneira(sieve).\n".. - "\n".. - "A Caldeira deve ser preenchida com água. Preencha até 10 baldes de água na caldeira.\n".. - "A Caixa de fogo deve ser preenchida com carvão ou carvão vegetal.\n".. - "Quando a água estiver quente (indicador de temperatura no topo)\\, a máquina a vapor pode ser iniciada no Volante.\n".. - "\n".. - "A máquina a vapor tem uma capacidade de 25ku\\, podendo acionar várias máquinas ao mesmo tempo.\n".. - "\n".. - "\n".. - "\n", - "Parte da máquina a vapor.\n".. - "\n".. - "A Caixa de fogo deve ser preenchida com carvão ou carvão vegetal. O tempo de queima depende da potência exigida pela máquina a vapor. O carvão queima por 32s e o carvão vegetal por 96s em carga máxima.\n".. - "\n".. - "\n".. - "\n", - "Parte da máquina a vapor. Deve ser preenchida com água. Isso é feito clicando na caldeira com um balde de água. Quando não há mais água ou a temperatura cai muito\\, a máquina a vapor desliga. Com a máquina a vapor\\, parte da água é perdida como vapor a cada curso do pistão\\, então a água deve ser reabastecida regularmente.\n".. - "\n".. - "\n".. - "\n", - "Parte da máquina a vapor.\n".. - "\n".. - "\n".. - "\n", - "Parte motora da máquina a vapor. O Volante deve ser conectado às máquinas por meio de eixos de transmissão.\n".. - "\n".. - "\n".. - "\n", - "Parte da máquina a vapor. A caldeira deve ser conectada ao cilindro por meio dos Tubos de vapor. O tubo de vapor não tem ramificações\\, o comprimento máximo é 12 m (blocos).\n".. - "\n".. - "\n".. - "\n", - "Os Eixos de transmissão são usados para transmitir energia da máquina a vapor para outras máquinas. O comprimento máximo de um eixo de transmissão é 10 blocos. Com as Caixas de Engrenagem TA2\\, é possível vencer distâncias maiores\\, e também realizar ramificações e mudanças de direção.\n".. - "\n".. - "\n".. - "\n", - "O Gerador de Energia TA2 é necessário para operar lâmpadas ou outros consumidores de energia em uma Máquina a vapor. O Gerador de Energia TA2 deve ser conectado aos eixos de transmissão de um lado e\\, em seguida\\, fornece eletricidade do outro lado.\n".. - "\n".. - "Se o Gerador de Energia não receber energia suficiente\\, ele entra em estado de erro e deve ser reativado com um clique direito.\n".. - "\n".. - "O Gerador de Energia consome no máximo 25ku de potência do eixo e fornece no máximo 24ku como eletricidade do outro lado. Portanto\\, ele consome um ku para a conversão.\n".. - "\n".. - "\n".. - "\n", - "Para sistemas maiores com várias máquinas a vapor ou muitas máquinas acionadas\\, é recomendado um sistema de armazenamento de energia. O armazenamento de energia no TA2 funciona com energia potencial. Para isso\\, o peso (pedras\\, cascalho\\, areia) é puxado para cima em um baú com a ajuda de um guincho. Se houver excesso de energia na rede de eixos\\, o baú é puxado para cima. Se mais energia for necessária a curto prazo do que a máquina a vapor pode fornecer\\, o armazenamento de energia libera a energia armazenada novamente e o baú de pesos desce novamente.\n".. - "O armazenamento de energia é composto por vários blocos e deve ser montado conforme mostrado no plano à direita. \n".. - "Para alcançar a capacidade máxima de armazenamento\\, o baú deve ser completamente preenchido com pesos e o mastro\\, incluindo as duas caixas de engrenagens\\, deve ter 12 blocos de altura. Estruturas menores também são possíveis.\n".. - "\n".. - "\n".. - "\n", - "O guincho deve ser conectado a uma caixa de engrenagens e pode absorver energia excessiva e assim puxar um baú de pesos para cima. \n".. - "Ao montar o guincho\\, certifique-se de que a seta no topo do bloco aponte para a caixa de engrenagens.\n".. - "O comprimento máximo da corda é 10 blocos. \n".. - "\n".. - "\n".. - "\n", - "Este baú deve ser colocado sob o guincho com uma distância de até 10 blocos e preenchido com pedras\\, cascalho ou areia. Se o peso mínimo de uma pilha (99+ itens)\n".. - "\n", - "Com a embreagem\\, eixos e máquinas podem ser separados do armazenamento de energia. Isso significa que os eixos após a embreagem param e sistemas de máquinas podem ser reconstruídos. Ao montar a embreagem\\, certifique-se de que a seta na parte superior do bloco aponta para o sistema de armazenamento de energia.\n".. - "\n".. - "\n".. - "\n", - "Para transportar objetos de uma estação de processamento para a próxima\\, são usados pushers e tubos. Veja o plano.\n".. - "\n".. - "\n".. - "\n", - "Duas máquinas podem ser conectadas com a ajuda de um pusher e um tubo. Tubos não têm ramificações. O comprimento máximo é 200m (blocos).\n".. - "\n".. - "Alternativamente\\, os tubos podem ser colocados usando a tecla Shift. Isso permite\\, por exemplo\\, que tubos sejam colocados em paralelo sem que eles se conectem acidentalmente.\n".. - "\n".. - "A capacidade de transporte de um tubo é ilimitada e é limitada apenas pelo pusher.\n".. - "\n".. - "\n".. - "\n", - "Vários tubos podem ser combinados em um único tubo via concentrador. A direção na qual todos os itens são passados é marcada com uma seta. \n".. - "\n".. - "\n".. - "\n", - "Um pusher(empurrador) é capaz de puxar itens de caixas ou máquinas e empurrá-los para outras caixas ou máquinas. Em outras palavras\\, deve haver um e apenas um pusher entre dois blocos com inventário. Múltiplos pushers em sequência não são possíveis.\n".. - "No entanto\\, na direção oposta\\, um pusher é permeável a itens\\, de modo que uma caixa pode ser preenchida via tubo e também ensinada.\n".. - "\n".. - "Um pusher entra no estado \"standby\" se não tiver itens para empurrar. Se a saída estiver bloqueada ou o inventário do destinatário estiver cheio\\, o pusher entra no estado \"bloqueado\". O pusher automaticamente sai de ambos os estados após alguns segundos se a situação mudar.\n".. - "\n".. - "A capacidade de processamento de um pusher TA2 é de 2 itens a cada 2 s.\n".. - "\n".. - "\n".. - "\n", - "O distribuidor é capaz de transportar os itens de seu inventário ordenados em até quatro direções. Para fazer isso\\, o distribuidor deve ser configurado conforme necessário.\n".. - "\n".. - "O distribuidor possui um menu com 4 filtros com cores diferentes\\, correspondendo às 4 saídas. Se uma saída for usada\\, o filtro correspondente deve ser ativado via caixa de seleção \"ligado\". Todos os itens configurados para este filtro são enviados através da saída designada. Se um filtro for ativado sem que itens sejam configurados\\, estamos falando de uma saída \"não configurada\"\\, aberta.\n".. - "\n".. - "*Atenção: O distribuidor também é um pusher em suas saídas. Portanto\\, nunca puxe itens do distribuidor com um pusher!*\n".. - "\n".. - "Existem dois modos de operação para uma saída não configurada:\n".. - "\n".. - "1) Enviar todos os itens que não podem ser enviados para nenhuma outra saída\\, mesmo que estejam bloqueados.\n".. - "\n".. - "2) Enviar apenas os itens que não foram configurados para nenhum outro filtro.\n".. - "\n".. - "No primeiro caso\\, todos os itens são sempre encaminhados e o distribuidor não fica cheio. No segundo caso\\, os itens são retidos e o distribuidor pode ficar cheio e\\, em seguida\\, bloquear.\n".. - "\n".. - "O modo de operação pode ser definido usando a caixa de seleção \"modo de bloqueio\".\n".. - "\n".. - "A capacidade de processamento de um distribuidor TA2 é de 4 itens a cada 2s\\, onde o distribuidor tenta distribuir os 4 itens para as saídas abertas.\n".. - "\n".. - "Se o mesmo item for configurado várias vezes em um filtro\\, a proporção de distribuição a longo prazo será influenciada de acordo.\n".. - "\n".. - "Observe que a distribuição é um processo probabilístico. Isso significa que as proporções de distribuição não serão correspondidas exatamente\\, mas apenas a longo prazo.\n".. - "\n".. - "O tamanho máximo de pilha nos filtros é 12\\; no total\\, não mais que 36 itens podem ser configurados.\n".. - "\n".. - "\n".. - "\n", - "O lavador de cascalho é uma máquina mais complexa com o objetivo de lavar pepitas de Usmium a partir de cascalho peneirado. Um enxaguatório TA2 com eixo de acionamento\\, um funil\\, um baú e água corrente são necessários para a instalação.\n".. - "\n".. - "Estrutura da esquerda para a direita (veja também o plano):\n".. - "\n".. - " - Um bloco de terra\\, sobre ele a fonte de água\\, cercada em 3 lados\\, por exemplo\\, por blocos de vidro\n".. - " - Ao lado\\, o enxaguatório de cascalho\\, se necessário com conexões de tubulação para a entrega e remoção de cascalho\n".. - " - Em seguida\\, o funil com baú\n".. - "\n".. - "O conjunto é cercado por mais blocos de vidro\\, para que a água flua sobre o enxaguatório de cascalho e o funil\\, e as pepitas lavadas possam ser coletadas novamente pelo funil.\n".. - "\n".. - "\n".. - "\n", - "O lavador de cascalho é capaz de enxaguar os minérios de Usmium e cobre do cascalho que já foi peneirado\\, desde que seja lavado com água.\n".. - "\n".. - "Se o Enxaguatório de Cascalho funciona corretamente\\, pode ser testado com pedaços de madeira\\, se estes forem colocados no inventário do Enxaguatório de Cascalho. Eles devem ser enxaguados individualmente e recolhidos pelo funil.\n".. - "\n".. - "A capacidade de processamento é de um item de cascalho a cada 2s. O lavador de cascalho precisa de 3 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "Esmagar\\, moer e peneirar pedregulhos é usado para extrair minérios. O cascalho peneirado também pode ser usado para outros fins. A pedreira\\, moedor e peneira devem ser acionados e\\, portanto\\, instalados perto de uma máquina a vapor.\n".. - "\n".. - "\n".. - "\n", - "A pedreira é usada para remover pedras e outros materiais do subsolo. A pedreira escava um buraco de 5x5 blocos. A profundidade é ajustável.\n".. - "A capacidade de processamento é de um bloco a cada 4s. A pedreira precisa de 10 ku de energia. A profundidade máxima é de 20 metros. Para maiores profundidades\\, consulte TA3 / TA4.\n".. - "\n".. - "\n".. - "\n", - "O moedor é capaz de moer várias rochas\\, mas também madeira e outros itens.\n".. - "A capacidade de processamento é de um item a cada 4s. O moedor precisa de 4 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "A peneira de cascalho é capaz de peneirar cascalho para extrair minérios. O resultado é parcialmente \"sieved gravel\"\\, que não pode ser peneirado novamente.\n".. - "A capacidade de processamento é de um item a cada 4s. A peneira de cascalho requer 3 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "As máquinas TA2 podem não apenas extrair minérios\\, mas também produzir objetos.\n".. - "\n", - "O autocrafter é usado para a produção automática de bens. Tudo o que o jogador pode produzir via \"Crafting Grid\" também pode ser feito pelo autocrafter. Para isso\\, a receita deve ser inserida no menu do autocrafter e os ingredientes necessários adicionados.\n".. - "\n".. - "Ingredientes e produtos fabricados podem ser transportados para dentro e para fora do bloco por meio de tubos e pushers.\n".. - "\n".. - "A capacidade de processamento é de um item a cada 4s. O autocrafter requer 4 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "O electronic fab é uma máquina especial e só pode ser usada para a produção de tubos de vácuo. Tubos de vácuo são necessários para máquinas e blocos TA3.\n".. - "\n".. - "A capacidade de processamento é de um tubo de vácuo a cada 6s. O electronic fab requer 8 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "", - "Algumas receitas requerem água. Para que essas receitas também possam ser processadas automaticamente com o autocrafter\\, água deve ser fornecida em baldes. Isso é feito usando o liquid sampler. Ele precisa de baldes vazios e deve ser colocado na água.\n".. - "\n".. - "A capacidade de processamento é de um balde de água a cada 8s. O liquid sampler requer 3 ku de energia.\n".. - "\n".. - "\n".. - "\n", - "O protected chest só pode ser usado por jogadores que têm permissão de construção neste local\\, ou seja\\, que têm direitos de proteção. Não importa quem coloca o baú.\n".. - "\n".. - "\n".. - "\n", - "O Minetest divide o mapa em chamados map blocks. Estes são cubos com uma aresta de 16x16x16 blocos. Um map block é sempre completamente carregado pelo servidor\\, mas apenas os blocos ao redor de um jogador são carregados (aproximadamente 2-3 blocos em todas as direções). Na direção de visão do jogador\\, também existem mais map blocks. Apenas esta parte do mundo é ativa e apenas aqui as plantas e árvores crescem ou as máquinas funcionam.\n".. - "\n".. - "Com um bloco forceload\\, você pode forçar o map block em que o bloco forceload está localizado a permanecer carregado enquanto você estiver no servidor. Quando todos os seus campos e máquinas estão cobertos com blocos Forceload\\, tudo está sempre em execução.\n".. - "\n".. - "Os map blocks com suas coordenadas são predefinidos\\, por exemplo\\, (0\\,0\\,0) a (15\\,15\\,15)\\, ou (16\\,16\\,16) a (31\\,31\\,31).\n".. - "Você pode mover um bloco forceload dentro de um map block como quiser\\, a posição do map block permanece inalterada.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta2", - "", - "ta2_firebox", - "ta2_boiler", - "ta2_cylinder", - "ta2_flywheel", - "ta2_steampipe", - "ta2_driveaxle", - "ta2_generator", - "", - "ta2_winch", - "", - "techage:ta2_clutch_off", - "", - "tube", - "concentrador", - "ta2_pusher", - "ta2_distributor", - "", - "ta2_rinser", - "ta2_grinder", - "ta2_quarry", - "ta2_grinder", - "ta2_gravelsieve", - "", - "ta2_autocrafter", - "ta2_electronicfab", - "", - "ta2_liquidsampler", - "ta2_chest", - "ta2_forceload", - }, - plans = { - "", - "steamengine", - "", - "", - "", - "", - "", - "", - "", - "ta2_storage", - "", - "", - "", - "itemtransport", - "", - "", - "", - "", - "gravelrinser", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta3_DE.lua b/techage/doc/manual_ta3_DE.lua deleted file mode 100644 index b1a4003..0000000 --- a/techage/doc/manual_ta3_DE.lua +++ /dev/null @@ -1,934 +0,0 @@ -return { - titles = { - "1,TA3: Ölzeitalter", - "2,Kohlekraftwerk / Ölkraftwerk", - "3,TA3 Kraftwerks-Feuerbox / Power Station Firebox", - "3,TA3 Kraftwerks-Ölbrenner / TA3 Power Station Oil Burner", - "3,TA3 Boiler unten/oben", - "3,TA3 Turbine", - "3,TA3 Generator", - "3,TA3 Kühler / Cooler", - "2,Elektrischer Strom", - "3,Bedeutung von Speichersystemen", - "3,TA Stromkabel / Electric Cable", - "3,TA Verteilerdose / Electric Junction Box", - "3,TA Stromleitung / Power Line", - "3,TA Strommast / Power Pole", - "3,TA Strommastkopf / Power Pole Top", - "3,TA Strommastkopf 2 / Power Pole Top 2", - "3,TA Stromschalter / Power Switch", - "3,TA Stromschalter klein / Power Switch Small", - "3,TA Stromschalterbox / Power Switch Box", - "3,TA3 Kleiner Stromgenerator / Tiny Power Generator", - "3,TA3 Akku Block / TA3 Accu Box", - "3,TA3 Strom Terminal / Power Terminal", - "3,TA3 Elektromotor / TA3 Electric Motor", - "2,TA3 Industrieofen", - "3,TA3 Ofen-Ölbrenner / Furnace Oil Burner", - "3,TA3 Ofenoberteil / Furnace Top", - "3,TA3 Gebläse / Booster", - "2,Flüssigkeiten", - "3,TA3 Tank / TA3 Tank", - "3,TA3 Pumpe / TA3 Pump", - "3,TA Einfülltrichter / TA Liquid Filler", - "3,TA4 Röhre / Pipe", - "3,TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke", - "3,TA Ventil / TA Valve", - "2,Öl-Förderung", - "3,TA3 Ölexplorer / Oil Explorer", - "3,TA3 Ölbohrkiste / Oil Drill Box", - "3,TA3 Ölpumpe / Oil Pumpjack", - "3,TA3 Bohrgestänge / Drill Pipe", - "3,Öltank / Oil Tank", - "2,Öl-Transport", - "3,Öl-Transport mit dem Tankwagen", - "3,Öl-Transport mit Fässern über Minecarts", - "3,Tankwagen / Tank Cart", - "3,Kistenwagen / Chest Cart", - "2,Öl-Verarbeitung", - "3,Destillationsturm / distiller tower", - "4,Aufkocher / reboiler)", - "2,Logik-/Schalt-Blöcke", - "3,TA3 Taster/Schalter / Button/Switch", - "3,TA3 Kommando Konverter / Command Converter", - "3,TA3 Flipflop / Flip-Flop", - "3,TA3 Logikblock / Logic Block", - "3,TA3 Wiederholer / Repeater", - "3,TA3 Sequenzer / Sequencer", - "3,TA3 Timer", - "3,TA3 Terminal", - "3,TechAge Farblampe / Color Lamp", - "3,Tür/Tor Blöcke / Door/Gate Blocks", - "3,TA3 Tür Controller / Door Controller", - "3,TA3 Tür Controller II / Door Controller II", - "3,TA3 Sound Block", - "3,TA3 Mesecons Umsetzer / TA3 Mesecons Converter", - "2,Detektoren", - "3,TA3 Detektor / Detector", - "3,TA3 Wagen Detektor / Cart Detector", - "3,TA3 Block Detektor / Node Detector", - "3,TA3 Spieler Detektor / Player Detector", - "3,TA3 Lichtdetektor", - "2,TA3 Maschinen", - "3,TA3 Schieber / Pusher", - "3,TA3 Verteiler / Distributor", - "3,TA3 Autocrafter", - "3,TA3 Elektronikfabrik / Electronic Fab", - "3,TA3 Steinbrecher / Quarry", - "3,TA3 Kiessieb / Gravel Sieve", - "3,TA3 Kieswaschanlage / Gravel Rinser", - "3,TA3 Mühle / Grinder", - "3,TA3 Injektor / Injector", - "2,Werkzeuge", - "3,Techage Info Tool", - "3,TechAge Programmer", - "3,TechAge Kelle / Trowel", - "3,TA3 Bohrgestängezange / TA3 Drill Pipe Wrench", - "3,Techage Schraubendreher / Screwdriver", - "3,TechAge Montagewerkzeug / Assembly Tool", - }, - texts = { - "Bei TA3 gilt es\\, die Dampf-betriebenen Maschinen durch leistungsfähigere und mit elektrischem Strom betriebene Maschinen abzulösen.\n".. - "\n".. - "Dazu musst du Kohlekraftwerke und Generatoren bauen. Bald wirst du sehen\\, dass dein Strombedarf nur mit Öl-betriebenen Kraftwerken zu decken ist. Also machst du dich auf die Suche nach Erdöl. Bohrtürme und Ölpumpen helfen die\\, an das Öl zu kommen. Schienenwege dienen dir zum Öltransport bis in die Kraftwerke.\n".. - "\n".. - "Das Industrielle Zeitalter ist auf seinem Höhepunkt.\n".. - "\n".. - "\n".. - "\n", - "Das Kohlekraftwerk besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet\\, zusammen gebaut werden. Dazu werden die Blöcke TA3 Kraftwerks-Feuerbox\\, TA3 Boiler oben\\, TA3 Boiler unten\\, TA3 Turbine\\, TA3 Generator und TA3 Kühler benötigt.\n".. - "\n".. - "Der Boiler muss mit Wasser gefüllt werden. Dazu bis zu 10 Eimer Wasser in den Boiler füllen.\n".. - "Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden.\n".. - "Wenn das Wasser heiß ist\\, kann der Generator gestartet werden.\n".. - "\n".. - "Das Kraftwerk kann alternativ auch mit einem Ölbrenner ausgestattet und dann mit Öl betrieben werden.\n".. - "Das Öl kann über eine Pumpe und Ölleitung nachgefüllt werden.\n".. - "\n".. - "Das Kraftwerk liefert eine Leistung von 80 ku.\n".. - "\n".. - "\n".. - "\n", - "Teil des Kraftwerks. \n".. - "Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. Die Brenndauer ist abhängig von der Leistung\\, die vom Kraftwerk angefordert wird. Unter Volllast brennt Kohle 20 s und Holzkohle 60 s. Unter Teillast entsprechend länger (50% Last = doppelte Zeit).\n".. - "\n".. - "\n".. - "\n", - "Teil des Kraftwerks. \n".. - "\n".. - "Der Ölbrenner kann mit Erdöl\\, Schweröl\\, Naphtha oder Benzin gefüllt werden. Die Brenndauer ist abhängig von der Leistung\\, die vom Kraftwerk angefordert wird. Unter Volllast brennt Erdöl 15 s\\, Schweröl 20 s\\, Naphtha 22 s und Benzin 25 s. \n".. - "\n".. - "Unter Teillast entsprechend länger (50% Last = doppelte Zeit).\n".. - "\n".. - "Der Ölbrenner kann nur 50 Einheiten Kraftstoff aufnehmen. Ein zusätzlicher Öltank und eine Ölpumpe sind daher ratsam.\n".. - "\n".. - "\n".. - "\n", - "Teil des Kraftwerk. Muss mit Wasser gefüllt werden. Wem kein Wasser mehr vorhanden ist oder die Temperatur zu weit absinkt\\, schaltet sich das Kraftwerk ab. Der Wasserverbrauch des TA3-Kessels ist durch den geschlossenen Dampfkreislauf viel geringer als bei der Dampfmachine.\n".. - "Bei der Dampfmaschine geht bei jedem Kolbenhub etwas Wasser als Dampf verloren.\n".. - "\n".. - "\n".. - "\n", - "Die Turbine ist Teil des Kraftwerk. Sie muss neben den Generator gesetzt und über Dampfleitungen mit dem Boiler und dem Kühler\\, wie im Plan abgebildet\\, verbunden werden.\n".. - "\n".. - "\n".. - "\n", - "Der Generator dient zur Stromerzeugung. Er muss über Stromkabel und Verteilerdosen mit den Maschinen verbunden werden.\n".. - "\n".. - "\n".. - "\n", - "Dient zur Abkühlung des heißen Dampfs aus der Turbine. Muss über Dampfleitungen mit dem Boiler und der Turbine\\, wie im Plan abgebildet\\, verbunden werden.\n".. - "\n".. - "\n".. - "\n", - "In TA3 (und TA4) werden die Maschinen mit Strom angetrieben. Dazu müssen die Maschinen\\, Speichersysteme und Generatoren mit Stromkabel verbunden werden.\n".. - "TA3 besitzt 2 Arten von Stromkabel:\n".. - "\n".. - " - Isolierte Kabel (TA Stromkabel) für die lokale Verkabelung im Boden oder in Gebäuden. Diese Kabel lassen sich in der Wand oder im Boden verstecken (können mit der Kelle \"verputzt\" werden).\n".. - " - Überlandleitungen (TA Stromleitung) für Freiluftverkabelung über große Strecken. Diese Kabel sind geschützt\\, können also von anderen Spielern nicht entfernt werden.\n".. - "\n".. - "Mehrere Verbraucher\\, Speichersysteme und Generatoren können in einem Stromnetzwerk zusammen betrieben werden. Mit Hilfe der Verteilerdosen können so Netzwerke aufgebaut werden.\n".. - "Wird zu wenig Strom bereitgestellt\\, gehen die Verbraucher aus.\n".. - "In diesem Zusammenhang ist auch wichtig\\, dass die Funktionsweise von Forceload Blöcken verstanden wurde\\, denn bspw. Generatoren liefern nur Strom\\, wenn der entsprechende Map-Block geladen ist. Dies kann mit einen Forceload Block erzwungen werden.\n".. - "\n".. - "In TA4 kommt noch ein Kabel für die Solaranlage hinzu.\n".. - "\n".. - "\n".. - "\n", - "Speichersysteme im Stromnetz erfüllen zwei Aufgaben:\n".. - "\n".. - " - Um Bedarfsspitzen abzufangen: Alle Generatoren liefern immer gerade soviel Leistung\\, wie benötigt wird. Werden aber Verbraucher ein/ausgeschaltet oder kommt es aus anderen Gründen zu Bedarfsschwankungen\\, so können Verbraucher kurzzeitig ausfallen. Um dies zu verhindern\\, sollte immer mindestens ein Akkublock in jedem Netzwerk vorhanden sein. Dieser dient als Puffer und gleicht diese Schwankungen im Sekundenbereich aus.\n".. - " - Um regenerative Energie zu speichern: Solar und Wind stehen nicht 24 Stunden am Tag zur Verfügung. Damit die Stromversorgung nicht ausfällt\\, wenn kein Strom produziert wird\\, müssen ein oder mehrere Speichersysteme im Netzwerk verbaut werden. Alternativ können die Lücken auch mit Öl/Kohle-Strom überbrückt werden.\n".. - "\n".. - "Ein Speichersystem gibt seine Kapazität in kud an\\, also ku pro day (Tag). Bspw. ein Speichersystem mit 100 kud liefert 100 ku einen Spieltag lang\\, oder auch 10 ku für 10 Spieltage.\n".. - "\n".. - "Alle TA3/TA4 Energiequellen besitzen eine einstellbare Ladecharakteristik. Standardmäßig ist diese auf \"80% - 100%\" eingestellt. Dies bedeutet\\, dass die Leistung ab 80% Füllung des Speichersystems immer weiter reduziert wird\\, bis sie bei 100 % komplett abschaltet. Sofern Strom im Netzwerk benötigt wird\\, werden die 100 % nie erreicht\\, da die Leistung des Generators irgendwann auf den Strombedarf im Netzwerk abgesunken ist und damit das Speichersystem nicht mehr geladen\\, sondern nur noch die Verbraucher bedient werden.\n".. - "\n".. - "Dies hat mehrere Vorteile:\n".. - "\n".. - " - Die Ladecharakteristik ist einstellbar. Damit kann man bspw. Öl/Kohle Energiequellen bei 60% und die regenerativen Energiequellen erst bei 80% zurückfahren. Damit wird nur Öl/Kohle verbrannt\\, wenn nicht ausreichend regenerativen Energiequellen zur Verfügung stehen.\n".. - " - Mehrere Energiequellen können parallel betrieben werden und werden dabei nahezu gleichmäßig belastet\\, denn alle Energiequellen arbeiten bspw. bis 80% Ladekapazität des Speichersystems mit ihrer vollen Leistung und fahren dann gleichzeitig ihre Leistung zurück.\n".. - " - Alle Speichersysteme in einem Netzwerk bilden einen großen Puffer. An jedem Speichersystem aber auch am Strom Terminal kann immer die Ladekapazität und der Füllungsgrad des gesamten Speichersystems in Prozent abgelesen werden.\n".. - "\n".. - "\n".. - "\n", - "Für die lokale Verkabelung im Boden oder in Gebäuden.\n".. - "Abzweigungen können mit Hilfe von Verteilerdosen realisiert werden. Die maximale Kabellänge zwischen Maschinen oder Verteilerdosen beträgt 1000 m. Es können maximale 1000 Knoten in einem Strom-Netzwerk verbunden werden. Als Knoten zählen alle Blöcke mit Stromanschluss\\, also auch Verteilerdosen.\n".. - "\n".. - "Da die Stromkabel nicht automatisch geschützt sind\\, wird für längere Strecken die Überlandleitungen (TA Stromleitung) empfohlen.\n".. - "\n".. - "Stromkabel können mit der Kelle verputzt also in der Wand oder im Boden versteckt werden. Als Material zum Verputzen können alle Stein-\\, Clay- und sonstige Blöcke ohne \"Intelligenz\" genutzt werden. Erde (dirt) geht nicht\\, da Erde zu Gras oder ähnlichem konvertiert werden kann\\, was die Leitung zerstören würde.\n".. - "\n".. - "Zum Verputzen muss mit der Kelle auf das Kabel geklickt werden. Das Material\\, mit dem das Kabel verputzt werden soll\\, muss sich im Spieler-Inventar ganz links befinden.\n".. - "Die Kabel können wieder sichtbar gemacht werden\\, indem man mit der Kelle wieder auf den Block klickt.\n".. - "\n".. - "Außer Kabel können auch die TA Verteilerdose und die TA Stromschalterbox verputzt werden.\n".. - "\n".. - "\n".. - "\n", - "Mit der Verteilerdose kann Strom in bis zu 6 Richtungen verteilt werden. Verteilerdosen können auch mit der Kelle verputzt (versteckt) und wieder sichtbar gemacht werden.\n".. - "\n".. - "\n".. - "\n", - "Mit der TA Stromleitung und den Strommasten können halbwegs realistische Überlandleitungen realisiert werden. Die Strommasten-Köpfe dienen gleichzeitig zum Schutz der Stromleitung (Protection). Dazu muss alle 16 m oder weniger ein Masten gesetzt werden. Der Schutz gilt aber nur die die Stromleitung und die Masten\\, alle anderen Blöcke in diesem Bereich sind dadurch nicht geschützt.\n".. - "\n".. - "\n".. - "\n", - "Dient zum Bauen von Strommasten. Ist durch den Strommast-Kopf vor Zerstörung geschützt und kann nur vom Besitzer wieder abgebaut werden.\n".. - "\n".. - "\n".. - "\n", - "Hat bis zu vier Arme und erlaubt damit\\, Strom in bis zu 6 Richtungen weiter zu verteilen. \n".. - "Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.\n".. - "\n".. - "\n".. - "\n", - "Dieser Strommastkopf hat zwei feste Arme und wird für die Überlandleitungen genutzt. Er kann aber auch Strom nach unten und oben weiterleiten.\n".. - "Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.\n".. - "\n".. - "\n".. - "\n", - "Mit dem Schalter kann der Strom ein- und ausgeschaltet werden. Der Schalter muss dazu auf eine Stromschalterbox gesetzt werden. Die Stromschalterbox muss dazu auf beiden Seiten mit dem Stromkabel verbunden sein.\n".. - "\n".. - "\n".. - "\n", - "Mit dem Schalter kann der Strom ein- und ausgeschaltet werden. Der Schalter muss dazu auf eine Stromschalterbox gesetzt werden. Die Stromschalterbox muss dazu auf beiden Seiten mit dem Stromkabel verbunden sein.\n".. - "\n".. - "\n".. - "\n", - "siehe TA Stromschalter.\n".. - "\n".. - "\n".. - "\n", - "Der kleine Stromgenerator wird mit Benzin betrieben und kann für kleine Verbraucher mit bis zu 12 ku genutzt werden. Unter Volllast brennt Benzin 150 s. Unter Teillast entsprechend länger (50% Last = doppelte Zeit).\n".. - "\n".. - "Der Stromgenerator kann nur 50 Einheiten Benzin aufnehmen. Ein zusätzlicher Tank und eine Pumpe sind daher ratsam.\n".. - "\n".. - "\n".. - "\n", - "Der Akku Block dient zur Speicherung von überschüssiger Energie und gibt bei Stromausfall automatisch Strom ab (soweit vorhanden).\n".. - "Mehrere Akku Blocks zusammen bilden ein TA3 Energiespeichersystem. Jeder Akku Block hat eine Anzeige für den Ladezustand und für die gespeicherte Ladung\\, wobei hier immer die Werte für das gesamte Netzwerk angezeigt werden. Die gespeicherte Ladung wird in \"kud\" also \"ku-days\" angezeigt (analog zu kWh) 5 kud entspricht damit bspw. 5 ku für einen Spieltag (20 min) oder 1 ku für 5 Spieltage.\n".. - "\n".. - "Ein Akku Block hat 3.33 kud.\n".. - "\n".. - "\n".. - "\n", - "Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an.\n".. - "\n".. - "In der oberen Hälfte werden die wichtigsten Größen ausgegeben:\n".. - "\n".. - " - aktuelle/maximale Generatorleistung\n".. - " - aktueller Stromaufnahme aller Verbraucher\n".. - " - aktueller Ladestrom in/aus dem Speichersystems\n".. - " - aktuellen Ladezustand des Speichersystems in Prozent\n".. - "\n".. - "In der unteren Hälfte wird die Anzahl der Netzwerkblöcke ausgegeben.\n".. - "\n".. - "Über den Reiter \"console\" können weitere Daten zu den Generatoren und Speichersystemen abgefragt werden.\n".. - "\n".. - "\n".. - "\n", - "Um TA2 Maschinen über das Stromnetz betreiben zu können\\, wird der TA3 Elektromotor benötigt. Dieser wandelt Strom in Achsenkraft um.\n".. - "Wird der Elektromotor nicht mit ausreichend Strom versorgt\\, geht er in einen Fehlerzustand und muss über einen Rechtsklick wieder aktiviert werden.\n".. - "\n".. - "Das Elektromotor nimmt primär max. 40 ku an Strom auf und gibt sekundär max. 39 ku als Achsenkraft wieder ab. Er verbraucht also ein ku für die Umwandlung.\n".. - "\n".. - "\n".. - "\n", - "Der TA3 Industrieofen dient als Ergänzung zu normalen Ofen (furnace). Damit können alle Waren mit \"Koch\" Rezepten\\, auch im Industrieofen hergestellt werden. Es gibt aber auch spezielle Rezepte\\, die nur im Industrieofen hergestellt werden können.\n".. - "Der Industrieofen hat sein eigenes Menü zur Rezeptauswahl. Abhängig von den Waren im Industrieofen Inventar links kann rechts das Ausgangsprodukt gewählt werden.\n".. - "\n".. - "Der Industrieofen benötigt Strom (für das Gebläse) sowie Schweröl/Benzin für den Brenner. Der Industrieofen muss wie im Plan rechts abgebildet\\, zusammen gebaut werden.\n".. - "\n".. - "Siehe auch TA4 Ofenheizung.\n".. - "\n".. - "\n".. - "\n", - "Ist Teil des TA3 Industrieofen.\n".. - "\n".. - "Der Ölbrenner kann mit Erdöl\\, Schweröl\\, Naphtha oder Benzin betrieben werden. Die Brennzeit beträgt für Erdöl 65 s\\, Schweröl 80 s\\, Naphtha 90 s und Benzin 100 s.\n".. - "\n".. - "Der Ölbrenner kann nur 50 Einheiten Kraftstoff aufnehmen. Ein zusätzlicher Tank und eine Pumpe sind daher ratsam.\n".. - "\n".. - "\n".. - "\n", - "Ist Teil des TA3 Industrieofen. Siehe TA3 Industrieofen.\n".. - "\n".. - "\n".. - "\n", - "Ist Teil des TA3 Industrieofen. Siehe TA3 Industrieofen.\n".. - "\n".. - "\n".. - "\n", - "Flüssigkeiten wie Wasser oder Öl können nur die spezielle Leitungen gepumpt und in Tanks gespeichert werden. Wie auch bei Wasser gibt es aber Behälter (Kanister\\, Fässer)\\, in denen die Flüssig gelagert und transportiert werden kann.\n".. - "\n".. - "Über die gelben Leitungen und Verbindungsstücke ist es auch möglich\\, mehrere Tanks zu verbinden. Allerdings müssen die Tanks den selben Inhalt haben und zwischen Tank\\, Pumpe und Verteiler muss immer mindestens eine gelbe Leitung sein.\n".. - "\n".. - "Bspw. zwei Tanks direkt mit einem Verteilerstück zu verbinden\\, geht nicht.\n".. - "\n".. - "Um Flüssigkeiten von Behältern nach Tanks umzufüllen\\, dient der Einfülltrichter. Im Plan ist dargestellt\\, wie Kanistern oder Fässer mit Flüssigkeiten über Schieber in einen Einfülltrichter geschoben werden. Im Einfülltrichter wird der Behälter geleert und die Flüssigkeit nach unten in den Tank geleitet. \n".. - "\n".. - "Der Einfülltrichter kann auch unter einen Tank gesetzt werden\\, um den Tank zu leeren.\n".. - "\n".. - "\n".. - "\n", - "In einem Tank können Flüssigkeiten gespeichert werden. Ein Tank kann über eine Pumpe gefüllt bzw. geleert werden. Dazu muss die Pumpe über einer Leitung (gelbe Röhre) mit dem Tank verbunden sein.\n".. - "\n".. - "Ein Tank kann auch von Hand gefüllt oder geleert werden\\, indem mit einem vollen oder leeren Flüssigkeitsbehälter (Fass\\, Kanister) auf den Tank geklickt wird. Dabei ist zu beachten\\, dass Fässer nur komplett gefüllt oder entleert werden können. Sind bspw. weniger als 10 Einheiten im Tank\\, muss dieser Rest mit Kanistern entnommen oder leergepumpt werden.\n".. - "\n".. - "In einen TA3 Tank passen 1000 Einheiten oder 100 Fässer einer Flüssigkeit.\n".. - "\n".. - "\n".. - "\n", - "Mit der Pumpe können Flüssigkeiten von Tanks oder Behältern zu anderen Tanks oder Behältern gepumpt werden. Bei der Pumpe muss die Pumprichtung (Pfeil) beachtet werden. Über die gelben Leitungen und Verbindungsstücke ist es auch möglich\\, mehrere Tanks auf jeder Seite der Pumpe anzuordnen. Allerdings müssen die Tanks den selben Inhalt haben.\n".. - "\n".. - "Die TA3 Pumpe pumpt 4 Einheiten Flüssigkeit alle zwei Sekunden.\n".. - "\n".. - "Hinweis 1: Die Pumpe darf nicht direkt neben den Tank platziert werden. Es muss immer mindestens ein Stück gelbe Leitung dazwischen sein.\n".. - "\n".. - "Hinweis 2: Nach dem Starten markiert die Pumpe 10 x die Blöcke\\, von und zu denen gepumpt wird.\n".. - "\n".. - "\n".. - "\n", - "Um Flüssigkeiten zwischen Behältern und Tanks umzufüllen\\, dient der Einfülltrichter.\n".. - "\n".. - " - wird der Einfülltrichter unter einen Tank gesetzt und werden leere Fässer mit einem Schieber oder von Hand in den Einfülltrichter gegeben\\, wird der Tankinhalt in die Fässer umgefüllt und die Fässer können ausgangsseitig wieder entnommen werden\n".. - " - wird der Einfülltrichter auf einen Tank gesetzt und werden volle Fässer mit einem Schieber oder von Hand in den Einfülltrichter gegeben\\, werden diese in den Tank umgefüllt und die Fässer können ausgangsseitig wieder entnommen werden\n".. - "\n".. - "Dabei ist zu beachten\\, dass Fässer nur komplett gefüllt oder entleert werden können. Sind bspw. weniger als 10 Einheiten im Tank\\, muss dieser Rest mit Kanistern entnommen oder leergepumpt werden.\n".. - "\n".. - "\n".. - "\n", - "Die gelben Röhren dienen zur Weiterleitung von Gas und Flüssigkeiten. \n".. - "Die maximale Leitungslänge beträgt 100 m.\n".. - "\n".. - "\n".. - "\n", - "Die Blöcke dienen als Wanddurchbrüche für Röhren\\, so dass keine Löcher offen bleiben.\n".. - "\n".. - "\n".. - "\n", - "Für die gelben Röhren gibt es ein Ventil\\, welches über Mausklicks geöffnet und geschlossen werden kann.\n".. - "Das Ventil kann auch über on/off Kommandos angesteuert werden.\n".. - "\n".. - "\n".. - "\n", - "Um deine Generatoren und Öfen mit Öl betreiben zu können\\, muss du zuerst nach Öl suchen und einen Bohrturm errichten und danach das Öl fördern.\n".. - "Dazu dienen dir TA3 Ölexplorer\\, TA3 Ölbohrkiste und TA3 Ölpumpe.\n".. - "\n".. - "\n".. - "\n", - "Mit dem Ölexplorer kannst du nach Öl suchen. Dazu den Block auf den Boden setzen und mit Rechtsklick die Suche starten. Der Ölexplorer kann oberirdisch und unterirdisch in allen Tiefen eingesetzt werden.\n".. - "Über die Chat-Ausgabe wird dir angezeigt\\, in welcher Tiefe nach Öl gesucht wurde und wie viel Öl (oil) gefunden wurde.\n".. - "Du kannst mehrfach auf den Block klicken\\, um auch in tieferen Bereichen nach Öl zu suchen. Ölfelder haben eine Größe von 4000 bis zu 20000 Items.\n".. - "\n".. - "Falls die Suche erfolglos war\\, musst du den Block ca. 16 m weiter setzen.\n".. - "Der Ölexplorer sucht immer innerhalb des ganzen Map-Blocks und darunter nach Öl\\, in dem er gesetzt wurde. Eine erneute Suche im gleichen Map-Block (16x16 Feld) macht daher keinen Sinn.\n".. - "\n".. - "Falls Öl gefunden wurde\\, wird die Stelle für den Bohrturm angezeigt. Du musst den Bohrturm innerhalb des angezeigten Bereiches errichten\\, die Stelle am besten gleich mit einem Schild markieren und den ganzen Bereich gegen fremde Spieler schützen.\n".. - "\n".. - "Gib die Suche nach Öl nicht zu schnell auf. Es kann wenn du Pech hast\\, sehr lange dauern\\, bis du eine Ölquelle gefunden hast.\n".. - "Es macht auch keinen Sinn\\, einen Bereich den ein anderer Spieler bereits abgesucht hat\\, nochmals abzusuchen. Die Chance\\, irgendwo Öl zu finden\\, ist für alle Spieler gleich.\n".. - "\n".. - "Der Ölexplorer kann immer wieder zur Suche nach Öl eingesetzt werden.\n".. - "\n".. - "\n".. - "\n", - "Die Ölbohrkiste muss an die Stelle gesetzt werden\\, die vom Ölexplorer angezeigt wurde. An anderen Stellen nach Öl zu bohren ist zwecklos.\n".. - "Wird auf den Button der Ölbohrkiste geklickt\\, wird über der Kiste ein Bohrturm errichtet. Dies dauert einige Sekunden.\n".. - "Die Ölbohrkiste hat 4 Seiten\\, bei IN muss das Bohrgestänge über Schieber angeliefert und bei OUT muss das Bohrmaterial abtransportiert werden. Über eine der anderen zwei Seiten muss die Ölbohrkiste mit Strom versorgt werden.\n".. - "\n".. - "Die Ölbohrkiste bohrt bis zum Ölfeld (1 Meter in 16 s) und benötigt dazu 16 ku Strom.\n".. - "Wurde das Ölfeld erreicht\\, kann der Bohrturm abgebaut und die Kiste entfernt werden.\n".. - "\n".. - "\n".. - "\n", - "An die Stelle der Ölbohrkiste muss nun die Ölpumpe platziert werden. Auch die Ölpumpe benötigt Strom (16 ku) und liefert alle 8 s ein Einheit Erdöl. Das Erdöl muss in einem Tank gesammelt werden. Dazu muss die Ölpumpe über eine Leitung (gelbe Röhre) mit dem Tank verbunden werden.\n".. - "Ist alles Öl abgepumpt\\, kann auch die Ölpumpe wieder entfernt werden.\n".. - "\n".. - "\n".. - "\n", - "Das Bohrgestänge wird für die Bohrung benötigt. Es werden so viele Bohrgestänge Items benötigt wie als Tiefe für das Ölfeld angegeben wurde. Das Bohrgestänge ist nach der Bohrung nutzlos\\, kann aber auch nicht abgebaut werden und verbleibt im Boden. Es gibt aber ein Werkzeug\\, um die Bohrgestänge Blöcke wieder entfernen zu können (-> Werkzeuge -> TA3 Bohrgestängezange).\n".. - "\n".. - "\n".. - "\n", - "Der Öltank ist die große Ausführung des TA3 Tanks (siehe Flüssigkeiten -> TA3 Tank).\n".. - "\n".. - "Der große Tank kann 4000 Einheiten Öl\\, aber auch jede andere Art von Flüssigkeit aufnehmen.\n".. - "\n".. - "\n".. - "\n", - "", - "Um Öl von der Ölquelle zur Ölverarbeitungsanlage zu befördern\\, können Tankwagen (tank carts) genutzt werden. Ein Tankwagen kann direkt über Pumpen gefüllt bzw. geleert werden. In beiden Fällen muss die gelbe Röhre von oben mit dem Tankwagen verbunden werden.\n".. - "\n".. - "Dazu sind folgende Schritte notwendig:\n".. - "\n".. - " - Den Tankwagen vor den Prellbock setzen. Der Prellbock darf noch nicht mit einer Zeit programmiert sein\\, so dass der Tankwagen nicht automatisch losfährt\n".. - " - Den Tankwagen über gelbe Röhren mit der Pumpe verbinden\n".. - " - Pumpe einschalten\n".. - " - Prellbock mit einer Zeit (10 - 20 s) programmieren\n".. - "\n".. - "Diese Reihenfolge muss auf beiden Seiten /Füllen/Leeren) eingehalten werden.\n".. - "\n".. - "\n".. - "\n", - "In die Minecarts können Kanister und Fässer geladen werden. Das Öl muss dazu zuvor in Fässer umgeladen werden. Die Ölfässer können direkt mit einem Schieber und Röhren in das Minecart geschoben werden (siehe Plan). Die leeren Fässer\\, welche per Minecart von der Entladestation zurück kommen\\, können über einen Hopper entladen werden\\, der unter der Schiene an der Haltestelle platziert wird.\n".. - "\n".. - "Es ist mit dem Hopper nicht möglich\\, an *einer* Haltestelle sowohl die leeren Fässer zu entladen\\, als auch die vollen Fässer zu beladen. Der Hopper lädt die vollen Fässer sofort wieder aus. Daher ist es ratsam\\, jeweils 2 Stationen auf der Be- und Entladeseite einzurichten und den Minecart dann über eine Aufzeichnungsfahrt entsprechend zu programmieren.\n".. - "\n".. - "Der Plan zeigt\\, wie das Öl in einen Tank gepumpt und über einen Einfülltrichter in Fässer umgefüllt und in Minecarts geladen werden kann.\n".. - "\n".. - "Damit die Minecarts automatisch wieder starten\\, müssen die Prellböcke mit Stationsname und Wartezeit konfiguriert werden. Für das Entladen reichen 5 s. Da aber die Schieber immer für mehrere Sekunden in den Standby fallen\\, wenn kein Minecart da ist\\, muss für das Beladen eine Zeit von 15 oder mehr Sekunden eingegeben werden.\n".. - "\n".. - "\n".. - "\n", - "Der Tankwagen dient zum Transport von Flüssigkeiten. Es kann wie Tanks mit Pumpen gefüllt bzw. geleert werden. In beiden Fällen muss die gelbe Röhre von oben mit dem Tankwagen verbunden werden.\n".. - "\n".. - "In den Tankwagen passen 200 Einheiten.\n".. - "\n".. - "\n".. - "\n", - "Der Kistenwagen dient zum Transport von Items. Es kann wie Kisten über Schieber gefüllt bzw. geleert werden.\n".. - "\n".. - "In den Kistenwagen passen 4 Stacks.\n".. - "\n".. - "\n".. - "\n", - "Öl ist ein Stoffgemisch und besteht aus sehr vielen Komponenten. Über einen Destillationsturm kann das Öl in seine Hauptbestandteile wie Bitumen\\, Schweröl\\, Naphtha\\, Benzin und Gas zerlegt werden.\n".. - "Die weitere Verarbeitung zu Endprodukten erfolgt im Chemischen Reaktor.\n".. - "\n".. - "\n".. - "\n", - "Der Destillationsturm muss wie im Plan rechts oben aufgebaut werden. \n".. - "Über den Basisblock wird das Bitumen abgelassen. Der Ausgang ist auf der Rückseite des Basisblocks (Pfeilrichtung beachten).\n".. - "Auf diesen Basisblock kommen die \"Destillationsturm\" Blöcke mit den Nummern: 1\\, 2\\, 3\\, 2\\, 3\\, 2\\, 3\\, 4\n".. - "An den Öffnungen von unten nach oben werden Schweröl\\, Naphtha und Benzin abgeleitet. Ganz oben wird das Propangas abgefangen.\n".. - "Es müssen alle Öffnungen am Turm mit Tanks verbunden werden.\n".. - "Der Aufkocher (reboiler) muss mit dem Block \"Destillationsturm 1\" verbunden werden.\n".. - "\n".. - "Der Aufkocher benötigt Strom (nicht im Plan zu sehen)!\n".. - "\n".. - "\n".. - "\n", - "Der Aufkocher erhitzt das Erdöl auf ca. 400°C. Dabei verdampft es weitgehend und wird in den Destillationsturm zur Abkühlung geleitet.\n".. - "\n".. - "Der Aufkocher benötigt 14 Einheiten Strom und produziert alle 16 s jeweils eine Einheit Bitumen\\, Schweröl\\, Naphtha\\, Benzin und Propangas.\n".. - "Dazu muss der Aufkocher über einen Pumpe mit Erdöl versorgt werden.\n".. - "\n".. - "\n".. - "\n", - "Neben den Röhren für Warentransport\\, sowie den Gas- und Stromleitungen gibt es auch noch eine drahtlose Kommunikationsebene\\, über die Blöcke untereinander Daten austauschen können. Dafür müssen keine Leitungen gezogen werden\\, sondern die Verbindung zwischen Sender und Empfänger erfolgt nur über die Blocknummer. \n".. - "\n".. - "*Info:* Eine *Blocknummer* ist eine eindeutige Zahl\\, die von Techage beim Setzen von vielen Techage Blöcken generiert wird. Die Blocknummer dient zur Adressierung bei der Kommunikation zwischen Techage Controllern und Maschinen. Alle Blöcke\\, die an dieser Kommunikation teilnehmen können\\, zeigen die Blocknummer als Info-Text an\\, wenn man mit dem Mauscursor den Block fixiert.\n".. - "\n".. - "Welche Kommandos ein Block unterstützt\\, kann mit dem TechAge Info Werkzeug (Schraubenschlüssel) ausgelesen und angezeigt werden.\n".. - "Die einfachsten Kommandos\\, die von fast allen Blöcken unterstützt werden\\, sind:\n".. - "\n".. - " - 'on' - Block/Maschine/Lampe einschalten\n".. - " - 'off' - Block/Maschine/Lampe ausschalten\n".. - "\n".. - "Mir Hilfe des TA3 Terminal können diese Kommandos sehr einfach ausprobiert werden. Angenommen\\, eine Signallampe hat die Nummer 123.\n".. - "Dann kann mit:\n".. - "\n".. - " cmd 123 on\n".. - "\n".. - "die Lampe ein\\, und mit:\n".. - "\n".. - " cmd 123 off\n".. - "\n".. - "die Lampe wieder ausgeschaltet werden. Diese Kommandos müssen so in das Eingabefeld des TA3 Terminals eingegeben werden.\n".. - "\n".. - "Kommandos wie 'on' und 'off' werden zum Empfänger gesendet\\, ohne dass eine Antwort zurück kommt. Diese Kommandos können daher bspw. mit einem Taster/Schalter auch gleichzeitig an mehrere Empfänger gesendet werden\\, wenn dort im Eingabefeld mehrere Nummern eingegeben werden.\n".. - "\n".. - "Ein Kommandos wie 'state' fordert den Status eines Blockes an. Der Block sendet in Folge seinen Status zurück. Diese Art von bestätigten Kommandos kann gleichzeitig nur an einen Empfänger gesendet werden.\n".. - "Auch dieses Kommandos kann mit dem TA3 Terminal bspw. an einem Schieber ausprobiert werden:\n".. - "\n".. - " cmd 123 state\n".. - "\n".. - "Mögliche Antworten des Schiebers sind:\n".. - "\n".. - " - 'running' --> bin am arbeiten\n".. - " - 'stopped' --> ausgeschaltet\n".. - " - 'standby' --> nichts zu tun\\, da Quell-Inventar leer\n".. - " - 'blocked' --> kann nichts tun\\, da Ziel-Inventar voll\n".. - "\n".. - "Dieser Status und weitere Informationen werden auch ausgegeben\\, wenn mit dem Schraubenschlüssel auf den Block geklickt wird.\n".. - "\n".. - "\n".. - "\n", - "Der Taster/Schalter sendet 'on'/'off' Kommandos zu den Blöcken\\, die über die Nummern konfiguriert wurden.\n".. - "Der Taster/Schalter kann als Taster (button) oder Schalter (switch) konfiguriert werden. Wird er als Taster konfiguriert\\, so kann die Zeit zwischen den 'on' und 'off' Kommandos eingestellt werden. Mit der Betriebsart \"on button\" wird nur ein 'on' und kein 'off' Kommandos gesendet.\n".. - "\n".. - "Über die Checkbox \"public\" kann eingestellt werden\\, ob den Taster von jedem (gesetzt)\\, oder nur vom Besitzer selbst (nicht gesetzt) genutzt werden darf.\n".. - "\n".. - "Hinweis: Mit dem Programmer können Blocknummern sehr einfach eingesammelt und konfiguriert werden.\n".. - "\n".. - "\n".. - "\n", - "Mit dem TA3 Kommando Konverter können 'on' / 'off' Kommandos in andere Kommandos umgewandelt werden\\, sowie die Weiterleitung verhindert oder verzögert werden. Die Nummer des Zielblockes bzw. die Nummern der Zielblöcke\\, die Kommandos die gesendet werden sollen\\, sowie die Verzögerungszeiten in Sekunden müssen eingegeben werden. Wird kein Kommando eingegeben\\, wird nichts gesendet.\n".. - "\n".. - "Die Nummern können auch mit Hilfe des Techage Programmers programmiert werden.\n".. - "\n".. - "\n".. - "\n", - "Das TA3 Flipflop wechselt seinen Zustand mit jedem empfangenen 'on' Kommando. Empfangene 'off' Kommandos werden ignoriert. Damit werden abhängig vom Zustandswechsel abwechselnd 'on' / 'off' Kommandos gesendet. Die Nummer des Zielblockes bzw. die Nummern der Zielblöcke müssen eingegeben werden. Die Nummern können auch mit Hilfe des Techage Programmers programmiert werden.\n".. - "\n".. - "Damit lassen sich bspw. Lampen mit Hilfe von Tastern ein- und wieder ausschalten.\n".. - "\n".. - "\n".. - "\n", - "Den TA3 Logikblock kann man so programmieren\\, dass ein oder mehrere Eingangskommandos zu einem Ausgangskommando verknüpft und gesendet werden. Dieser Block kann daher diverse Logik-Elemente wie AND\\, OR\\, NOT\\, XOR usw. ersetzen.\n".. - "Eingangkommandos für den Logikblock sind 'on'/'off' Kommandos.\n".. - "Eingangskommandos werden über die Nummer referenziert\\, also bspw. '1234' für das Kommando vom Sender mit der Nummer 1234.\n".. - "Das gleiche gilt für Ausgangskommandos.\n".. - "\n".. - "Eine Regel ist wie folgt aufgebaut:\n".. - "\n".. - " = on/off if is true\n".. - "\n".. - "'' ist die Nummer des Blocks\\, zu dem das Kommando gesendet werden soll.\n".. - "'' ist ein boolescher Ausdruck\\, bei dem Eingabenummern ausgewertet werden. \n".. - "\n".. - "*Beispiele für den Input Ausdruck*\n".. - "\n".. - "Signal negieren (NOT):\n".. - "\n".. - " 1234 == off\n".. - "\n".. - "Logisches UND (AND):\n".. - "\n".. - " 1234 == on and 2345 == on\n".. - "\n".. - "Logisches ODER (OR):\n".. - "\n".. - " 1234 == on or 2345 == on\n".. - "\n".. - "Folgende Operatoren sind zulässig: 'and' 'or' 'on' 'off' 'me' '==' '~=' '(' ')'\n".. - "\n".. - "Ist der Ausdruck wahr (true)\\, wird ein Kommando an den Block mit der '' Nummer gesendet.\n".. - "\n".. - "Es können bis zu vier Regeln definiert werden\\, wobei immer alle Regeln geprüft werden\\, wenn ein Kommando empfangen wird.\n".. - "\n".. - "Die interne Durchlaufzeit aller Kommandos beträgt 100 ms.\n".. - "\n".. - "Über das Schlüsselwort 'me' kann die eigene Knotennummer referenziert werden. Damit ist es möglich\\, dass sich der Block selbst ein Kommando sendet (Flip-Flop Funktion).\n".. - "\n".. - "Die Sperrzeit definiert eine Pause nach einem Kommando\\, in der der Logikblock kein weiteres Kommando von extern annimmt. Empfangene Kommandos in der Sperrzeit werden damit verworfen. Die Sperrzeit kann in Sekunden definiert werden.\n".. - "\n".. - "\n".. - "\n", - "Der Wiederholer (repeater) sendet das empfangene Signal an alle konfigurierten Nummern weiter.\n".. - "Dies kann bspw. Sinn machen\\, wenn man viele Blöcke gleichzeitig angesteuert werden sollen. Den Wiederholer kann man dazu mit dem Programmer konfigurieren\\, was nicht bei allen Blöcken möglich ist.\n".. - "\n".. - "\n".. - "\n", - "Der Sequenzer kann eine Reihe von 'on'/'off' Kommandos senden\\, wobei der Abstand zwischen den Kommandos in Sekunden angegeben werden muss. Damit kann man bspw. eine Lampe blinken lassen.\n".. - "Es können bis zu 8 Kommandos konfiguriert werden\\, jedes mit Zielblocknummer und Anstand zum nächsten Kommando.\n".. - "Der Sequenzer wiederholt die Kommandos endlos\\, wenn \"Run endless\" gesetzt wird.\n".. - "Wird also Kommando nichts ausgewählt\\, wird nur die angegeben Zeit in Sekunden gewartet.\n".. - "\n".. - "\n".. - "\n", - "Der Timer kann Kommandos Spielzeit-gesteuert senden. Für jede Kommandozeile kann die Uhrzeit\\, die Zielnummer(n) und das Kommando selbst angegeben werden. Damit lassen sich bspw. Lampen abends ein- und morgens wieder ausschalten.\n".. - "\n".. - "\n".. - "\n", - "Das Terminal dient in erster Linie zum Austesten der Kommandoschnittstelle anderer Blöcke (siehe \"Logik-/Schalt-Blöcke\").\n".. - "Man kann aber auch Kommandos auf Tasten legen und so das Terminal produktiv nutzen.\n".. - "\n".. - " set \n".. - "\n".. - "Mit 'set 1 ON cmd 123 on' kann bspw. die Usertaste 1 mit dem Kommando 'cnd 123 on' programmiert werden. Wird die Taste gedrückt\\, wird das Kommando gesendet und die Antwort auf dem Bildschirm ausgegeben.\n".. - "\n".. - "Das Terminal besitzt folgende\\, lokalen Kommandos:\n".. - "\n".. - " - 'clear' lösche Bildschirm\n".. - " - 'help' gib eine Hilfeseite aus\n".. - " - 'pub' schalte in den öffentlichen Modus um\n".. - " - 'priv' schalte in den privaten Modus um\n".. - "\n".. - "Im privaten Modus (private) kann das Terminal nur von Spielern verwendet werden\\, die an diesem Ort bauen können\\, also Protection Rechte besitzen. Im öffentlichen Modus (public) können alle Spieler die vorkonfigurierten Tasten verwenden.\n".. - "\n".. - "\n".. - "\n", - "Die Farblampe kann mit 'on'/'off' Kommando ein- bzw. ausgeschaltet werden. Diese Lampe braucht keinen Strom und\n".. - "kann mit der Spritzpistole aus der Mod \"Unified Dyes\" und über Lua/Beduino Kommandos eingefärbt werden.\n".. - "\n".. - "Mit dem Chat-Kommando '/ta_color' wird die Farbpalette mit den Werten für die Lua/Beduino Kommandos angezeigt und mit '/ta_send color ' kann die Farbe geändert werden.\n".. - "\n".. - "\n".. - "\n", - "Mit diese Blöcken kann man Türe und Tore realisieren\\, die über Kommandos geöffnet (Blöcke verschwinden) und wieder geschlossen werden können. Pro Tor oder Tür wird dazu ein Tür Controller benötigt. \n".. - "\n".. - "Das Aussehen der Blöcke kann über das Block-Menü eingestellt werden.\n".. - "Damit lassen sich Geheimtüren realisieren\\, die sich nur bei bestimmten Spielern öffnen (mit Hilfe des Spieler-Detektors). \n".. - "\n".. - "\n".. - "\n", - "Der Tür Controller dient zur Ansteuerung der TA3 Tür/Tor Blöcke. Beim Tür Controller müssen die Nummern der Tür/Tor Blöcke eingegeben werden. Wird ein 'on'/'off' Kommando Kommando an den Tür Controller gesendet\\, öffnet/schließt dieser die Tür bzw. das Tor.\n".. - "\n".. - "\n".. - "\n", - "Der Tür Controller II kann alle Arten von Blöcken entfernen und wieder setzen. Um den Tür Controller II anzulernen\\, muss der \"Aufzeichnen\" Button gedrückt werden. Dann müssen alle Blöcke angeklickt werden\\, die Teil der Tür / des Tores sein sollen. Danach muss der \"Fertig\" Button gedrückt werden. Es können bis zu 16 Blöcke ausgewählt werden. Die entfernten Blöcke werden im Inventar des Controllers gespeichert.\n".. - "\n".. - " Über die Tasten \"Entfernen\" bzw. \"Setzen\" kann die Funktion des Controllers von Hand getestet werden.\n".. - "\n".. - "Wird ein 'on' / 'off' Kommando an den Tür Controller II gesendet\\, entfernt bzw. setzt er die Blöcke ebenfalls.\n".. - "\n".. - "Mit '$send_cmnd(node_number\\, \"exchange\"\\, 2)' können einzelne Böcke gesetzt\\, entfernt\\, bzw. durch andere Blöcke aus dem Inventar ersetzt werden. \n".. - "\n".. - "Mit '$send_cmnd(node_number\\, \"set\"\\, 2)' kann ein Block aus dem Inventory explizit gesetzt werden\\, sofern der Inventory Slot nicht leer ist.\n".. - "\n".. - "Mit '$send_cmnd(node_number\\, \"dig\"\\, 2)' kann ein Block wieder entfernt werden\\, sofern der Inventory Slot leer ist. \n".. - "\n".. - "Mit '$send_cmnd(node_number\\, \"get\"\\, 2)' wird der Name des gesetzten Blocks zurückgeliefert. \n".. - "\n".. - "Die Slot-Nummer des Inventars (1 .. 16) muss in allen drei Fällen als payload übergeben werden.\n".. - "\n".. - "Damit lassen sich auch ausfahrbare Treppen und ähnliches simulieren.\n".. - "\n".. - "\n".. - "\n", - "Mir dem Sound Block können veschiedene Sounds/Laute abgespielt werden. Es sind alle Sounds der Mods Techage\\, Signs Bot\\, Hyperloop\\, Unified Inventory\\, TA4 Jetpack und Minetest Game verfügbar.\n".. - "\n".. - "Die Sounds können über das Menü und über ein Kommando ausgewählt und abgespielt werden.\n".. - "\n".. - " - Kommando 'on' zum Abspielen eines Sounds\n".. - " - Kommando 'sound ' zur Auswahl eines Sounds über den Index\n".. - " - Kommando 'gain ' zum Einstellen der Lautstärke über den '' Wert (1 bis 5).\n".. - "\n".. - "\n".. - "\n", - "Der Mesecons Umsetzer dient zur Umwandlung von Techage on/off Kommandos in Mesecons Signale und umgekehrt.\n".. - "Dazu müssen eine oder mehrere Knotennummern eingegeben und der Konverter mit Mesecons Blöcken \n".. - "über Mesecons Leitungen verbunden werden. Den Mesecons Umsetzer kann man auch mit dem Programmer konfigurieren.\n".. - "Der Mesecons Umsetzer akzeptiert bis zu 5 Kommandos pro Sekunde\\, bei höherer Belastung schaltet er sich ab.\n".. - "\n".. - "*Dieser Block existiert aber nur\\, wenn die Mod mesecons aktiv ist!*\n".. - "\n".. - "\n".. - "\n", - "Detektoren scannen ihre Umgebung ab und senden ein 'on'-Kommando\\, wenn das Gesuchte erkannt wurde.\n".. - "\n".. - "\n".. - "\n", - "Der Detektor ist eine spezieller Röhrenblock\\, der erkennt\\, wenn Items über die Röhre weitergegeben werden. Es muss dazu auf beiden Seiten mit der Röhre verbunden sein. Werden Items mit einem Schieber in den Detektor geschoben\\, gibt er diese automatisch weiter.\n".. - "Er sendet ein 'on'\\, wenn ein Item erkannt wird\\, gefolgt von einem 'off' eine Sekunde später.\n".. - "Danach werden weitere Kommando für 8 Sekunden blockiert.\n".. - "Die Wartezeit\\, sowie die Items\\, die ein Kommando auslösen sollen\\, können über das Gabelschlüssel-Menü konfiguriert werden.\n".. - "\n".. - "\n".. - "\n", - "Der Wagen Detektor sendet ein 'on'-Kommando\\, wenn er einen Wagen/Cart (Minecart) direkt vor sich erkannt hat. Zusätzlich kann der Detektor auch den Wagen wieder starten\\, wenn ein 'on'-Kommando empfangen wird.\n".. - "\n".. - "Der Detektor kann auch mit seiner eigenen Nummer programmiert werden. In diesem Falle schiebt er alle Wagen an\\, die in seiner Nähe (ein Block in alle Richtungen) zum Halten kommen.\n".. - "\n".. - "\n".. - "\n", - "Der Block Detektor sendet ein 'on'-Kommando\\, wenn er erkennt\\, dass Blöcke vor ihm erscheinen oder verschwinden\\, muss jedoch entsprechend konfiguriert werden. Nach dem Zurückschalten des Detektors in den Standardzustand (grauer Block) wird ein 'off'-Kommando gesendet. Gültige Blöcke sind alle Arten von Blöcken und Pflanzen\\, aber keine Tiere oder Spieler. Die Sensorreichweite beträgt 3 Blöcke/Meter in Pfeilrichtung.\n".. - "\n".. - "\n".. - "\n", - "Der Spieler Detektor sendet ein 'on'-Kommando\\, wenn er einen Spieler in einem Umkreis von 4 m um den Block herum erkennt. Verlässt der Spieler wieder den Bereich\\, wird ein 'off'-Kommando gesendet.\n".. - "Soll die Suche auf bestimmte Spieler eingegrenzt werden\\, so können diese Spielernamen auch eingegeben werden.\n".. - "\n".. - "\n".. - "\n", - "Der Lichtdetektor sendet einen 'on'-Kommando\\, wenn der Lichtpegel des darüber liegenden Blocks einen bestimmten Pegel überschreitet\\, der über das Rechtsklickmenü eingestellt werden kann.\n".. - "Mit einen TA4 Lua Controller kann die genaue Lichtstärke mit $get_cmd(num\\, 'light_level') ermitteln werden.\n".. - "\n".. - "\n".. - "\n", - "Bei TA3 existieren die gleichen Maschinen wie bei TA2\\, nur sind diese hier leistungsfähiger und benötigen Strom statt Achsenantrieb.\n".. - "Im folgenden sind daher nur die unterschiedlichen\\, technischen Daten angegeben.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 6 Items alle 2 s.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion des TA3 Verteilers entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 12 Items alle 4 s.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Autocrafter benötigt hierfür 6 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2\\, nur werden hier TA4 WLAN Chips produziert.\n".. - "Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierfür 12 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die maximale Tiefe beträgt 40 Meter. Der Steinbrecher benötigt 12 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 4 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Auch die Wahrscheinlichkeit ist wie bei TA2. Der Block benötigt auch 3 ku Strom.\n".. - "Aber im Gegensatz zu TA2 kann beim TA3 Block bspw. der Status abgefragt werden (Controller)\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 6 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Der Injektor ist ein TA3 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter\\, Industrieofen und Elektronikfabrik).\n".. - "\n".. - "Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert\\, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert.\n".. - "\n".. - "Der Injektor kann auch auf \"Ziehe-Modus\" umgeschaltet werden. Dann zieht er nur Items von den Positionen aus der Kiste\\, die in der Konfiguration des Injektors definiert sind. Hier müssen also Item-Typ und Position überein stimmen. Damit können geziehlt Speicherplätze im Inventar einer Kiste geleert werden.\n".. - "\n".. - "Die Verarbeitungsleistung beträgt bis zu 8 mal ein Item alle 4 Sekunden.\n".. - "\n".. - "\n".. - "\n", - "", - "Das Techage Info Tool (Schraubenschlüssel) hat verschiedene Funktionen. Er zeigt die Uhrzeit\\, die Position\\, die Temperatur und das Biome an\\, wenn auf einen unbekannten Block geklickt wird.\n".. - "Wird auf einen TechAge Block mit Kommandoschnittstelle geklickt\\, werden alle verfügbaren Daten abgerufen (siehe auch \"Logik-/Schalt-Blöcke\").\n".. - "\n".. - "Mit Shift+Rechtsklick kann bei einigen Blöcken ein erweitertes Menü geöffnet werden. Hier lassen sich je nach Block weitere Daten abrufen oder spezielle Einstellungen vornehmen. Bei einem Generator kann bspw. die Ladekurve/abschaltung programmiert werden. \n".. - "\n".. - "\n".. - "\n", - "Mit dem Programmer können Blocknummern mit einem Rechtsklick von mehreren Blöcken eingesammelt und mit einem Linksklick in einen Block wie Taster/Schalter geschrieben werden.\n".. - "Wird in die Luft geklickt\\, wird der interne Speicher gelöscht.\n".. - "\n".. - "\n".. - "\n", - "Die Kelle dient zum Verputzen von Stromkabel. Siehe dazu \"TA Stromkabel\".\n".. - "\n".. - "\n".. - "\n", - "Mit diesem Werkzeug lassen sich die Bohrgestängezange Blöcke wieder entfernen\\, wenn dort bspw. ein Tunnel durch soll.\n".. - "\n".. - "\n".. - "\n", - "Der Techage Schraubendreher dient als Ersatz für den normalen Schraubendreher. Es besitzt folgende Funktionen:\n".. - "\n".. - " - Linksklick: Den Block nach links drehen\n".. - " - Rechtsklick: Die sichtbare Seite des Blockes nach oben drehen\n".. - " - Shift+Linksklick: Ausrichtung des angeklickten Blockes speichern\n".. - " - Shift+Rechtsklick: Die gespeicherte Ausrichtung auf den angeklickten Block anwenden\n".. - "\n".. - "\n".. - "\n", - "Das TechAge Montagewerkzeug dient zum Entfernen und wieder Setzen von Techage Blöcken\\, ohne dass diese Blöcke ihre Blocknummer verlieren\\, bzw. beim Setzen eine neue Nummer zugeteilt bekommen. Dies ist bspw. bei Steinbrechern hilfreich\\, da diese oft umgesetzt werden müssen.\n".. - "\n".. - " - Linke Taste: Entfernen eines Blocks\n".. - " - Rechte Taste: Setzen eines Blocks\n".. - "\n".. - "Der Block\\, der zuvor mit dem Montagewerkzeug entfernt wurde und wieder gesetzt werden soll\\, muss sich im Spieler-Inventar ganz links befinden.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta3", - "", - "ta3_firebox", - "ta3_oilbox", - "ta3_boiler", - "ta3_turbine", - "ta3_generator", - "ta3_cooler", - "ta3_powerswitch", - "power_reduction", - "ta3_powercable", - "ta3_powerjunction", - "ta3_powerline", - "ta3_powerpole", - "ta3_powerpole4", - "ta3_powerpole2", - "ta3_powerswitch", - "ta3_powerswitchsmall", - "ta3_powerswitchbox", - "ta3_tinygenerator", - "ta3_akkublock", - "ta3_powerterminal", - "ta3_motor", - "", - "ta3_furnacefirebox", - "ta3_furnace", - "ta3_booster", - "", - "ta3_tank", - "ta3_pump", - "ta3_filler", - "ta3_pipe", - "ta3_pipe_wall_entry", - "ta3_valve", - "techage_ta3", - "ta3_oilexplorer", - "ta3_drillbox", - "ta3_pumpjack", - "ta3_drillbit", - "oiltank", - "", - "tank_cart", - "", - "tank_cart", - "chest_cart", - "techage_ta31", - "", - "reboiler", - "ta3_logic", - "ta3_button", - "ta3_command_converter", - "ta3_flipflop", - "ta3_logic", - "ta3_repeater", - "ta3_sequencer", - "ta3_timer", - "ta3_terminal", - "ta3_colorlamp", - "ta3_doorblock", - "ta3_doorcontroller", - "ta3_doorcontroller", - "ta3_soundblock", - "ta3_mesecons_converter", - "ta3_nodedetector", - "ta3_detector", - "ta3_cartdetector", - "ta3_nodedetector", - "ta3_playerdetector", - "ta3_lightdetector", - "ta3_grinder", - "ta3_pusher", - "ta3_distributor", - "ta3_autocrafter", - "ta3_electronicfab", - "ta3_quarry", - "ta3_gravelsieve", - "ta3_gravelrinser", - "ta3_grinder", - "ta3_injector", - "", - "ta3_end_wrench", - "ta3_programmer", - "ta3_trowel", - "ta3_drill_pipe_wrench", - "ta3_screwdriver", - "techage:assembly_tool", - }, - plans = { - "", - "coalpowerstation", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_furnace", - "", - "", - "", - "ta3_tank", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_loading", - "", - "", - "", - "ta3_distiller", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta3_EN.lua b/techage/doc/manual_ta3_EN.lua deleted file mode 100644 index e63e9c1..0000000 --- a/techage/doc/manual_ta3_EN.lua +++ /dev/null @@ -1,931 +0,0 @@ -return { - titles = { - "1,TA3: Oil Age", - "2,Coal-fired Power Station / Oil-fired Power Station", - "3,TA3 power station firebox", - "3,TA3 Power Station Oil Burner", - "3,TA3 boiler base / top", - "3,TA3 turbine", - "3,TA3 generator", - "3,TA3 cooler", - "2,Electrical current", - "3,Importance of storage systems", - "3,TA Electric Cable", - "3,TA Electric Junction Box", - "3,TA Power Line", - "3,TA Power Pole", - "3,TA Power Pole Top", - "3,TA Power Pole Top 2", - "3,TA Power Switch", - "3,TA Power Switch Small", - "3,TA Power Switch Box", - "3,TA3 Small Power Generator", - "3,TA3 Accu Block", - "3,TA3 Power Terminal", - "3,TA3 Electric Motor", - "2,TA3 Industrial Furnace", - "3,TA3 Furnace Oil Burner", - "3,TA3 Furnace Top", - "3,TA3 Booster", - "2,Liquids", - "3,TA3 Tank", - "3,TA3 Pump", - "3,TA Liquid Filler", - "3,TA4 Pipe", - "3,TA3 Pipe Wall Entry Blocks", - "3,TA Valve", - "2,Oil Production", - "3,TA3 Oil Explorer", - "3,TA3 Oil Drill Box", - "3,TA3 Oil Pumpjack", - "3,TA3 Drill Pipe", - "3,Oil tank", - "2,Oil Transportation", - "3,Oil transportation by Tank Carts", - "3,Oil transportation with barrels over Minecarts", - "3,Tank Cart", - "3,Chest Cart", - "2,Oil Processing", - "3,Distillation Tower", - "4,Reboiler", - "2,Logic / Switching Blocks", - "3,TA3 Button / Switch", - "3,TA3 Command Converter", - "3,TA3 Flip-Flop", - "3,TA3 Logic Block", - "3,TA3 Repeater", - "3,TA3 Sequencer", - "3,TA3 Timer", - "3,TA3 Terminal", - "3,TechAge Color Lamp", - "3,Door/Gate Blocks", - "3,TA3 Door Controller", - "3,TA3 Door Controller II", - "3,TA3 Sound Block", - "3,TA3 Mesecons Converter", - "2,Detectors", - "3,TA3 Detector", - "3,TA3 Cart Detector", - "3,TA3 Node Detector", - "3,TA3 Player Detector", - "3,TA3 Light Detector", - "2,TA3 Machines", - "3,TA3 Pusher", - "3,TA3 Distributor", - "3,TA3 Autocrafter", - "3,TA3 Electronic Fab", - "3,TA3 Quarry", - "3,TA3 Gravel Sieve", - "3,TA3 Gravel Rinser", - "3,TA3 Grinder", - "3,TA3 Injector", - "2,Tools", - "3,Techage Info Tool", - "3,TechAge Programmer", - "3,TechAge Trowel / Trowel", - "3,TA3 drill pipe wrench", - "3,Techage Screwdriver", - "3,TechAge Assembly Tool", - }, - texts = { - "At TA3 it is important to replace the steam-powered machines with more powerful and electric-powered machines.\n".. - "\n".. - "To do this\\, you have to build coal-fired power plants and generators. You will soon see that your electricity needs can only be met with oil-powered power plants. So you go looking for oil. Drilling derricks and oil pumps help them get the oil. Railways are used to transport oil to the power plants.\n".. - "\n".. - "The industrial age is at its peak.\n".. - "\n".. - "\n".. - "\n", - "The coal-fired power plant consists of several blocks and must be assembled as shown in the plan on the right. The blocks TA3 power station fire box\\, TA3 boiler top\\, TA3 boiler base\\, TA3 turbine\\, TA3 generator and TA3 cooler are required.\n".. - "\n".. - "The boiler must be filled with water. Fill up to 10 buckets of water in the boiler.\n".. - "The fire box must be filled with coal or charcoal.\n".. - "When the water is hot\\, the generator can then be started.\n".. - "\n".. - "Alternatively\\, the power plant can be equipped with an oil burner and then operated with oil.\n".. - "The oil can be refilled using a pump and oil pipe.\n".. - "\n".. - "The power plant delivers an output of 80 ku.\n".. - "\n".. - "\n".. - "\n", - "Part of the power plant.\n".. - "The fire box must be filled with coal or charcoal. The burning time depends on the power that is requested by the power plant. Coal burns for 20 s and charcoal for 60 s under full load. Correspondingly longer under partial load (50% load = double time).\n".. - "\n".. - "\n".. - "\n", - "Part of the power plant.\n".. - "\n".. - "The oil burner can be filled with crude oil\\, fuel oil\\, naphtha or gasoline. The burning time depends on the power that is requested by the power plant. Under full load\\, crude oil burns 15 s\\, fuel oil 20 s\\, naphtha 22 s and gasoline 25 s.\n".. - "\n".. - "Correspondingly longer under partial load (50% load = double time).\n".. - "\n".. - "The oil burner can only hold 50 units of fuel. An additional oil tank and an oil pump are therefore advisable.\n".. - "\n".. - "\n".. - "\n", - "Part of the power plant. Must be filled with water. If there is no more water or the temperature drops too low\\, the power plant switches off.\n".. - "\n".. - "The water consumption of the TA3 boiler is much lower than that of the steam engine due to the closed steam circuit.\n".. - "With the steam engine\\, some water is lost as steam with each piston stroke.\n".. - "\n".. - "\n".. - "\n", - "The turbine is part of the power plant. It must be placed next to the generator and connected to the boiler and cooler via steam pipes as shown in the plan.\n".. - "\n".. - "\n".. - "\n", - "The generator is used to generate electricity. It must be connected to the machines via power cables and junction boxes.\n".. - "\n".. - "\n".. - "\n", - "Used to cool the hot steam from the turbine. Must be connected to the boiler and turbine via steam pipes as shown in the plan.\n".. - "\n".. - "\n".. - "\n", - "In TA3 (and TA4) the machines are powered by electricity. To do this\\, machines\\, storage systems\\, and generators must be connected with power cables.\n".. - "TA3 has 2 types of power cables:\n".. - "\n".. - " - Insulated cables (TA power cables) for local wiring in the floor or in buildings. These cables can be hidden in the wall or in the floor (can be \"plastered\" with the trowel).\n".. - " - Overland lines (TA power line) for outdoor cabling over long distances. These cables are protected and cannot be removed by other players.\n".. - "\n".. - "Several consumers\\, storage systems\\, and generators can be operated together in a power network. Networks can be set up with the help of the junction boxes.\n".. - "If too little electricity is provided\\, consumers run out.\n".. - "In this context\\, it is also important that the functionality of Forceload blocks is understood\\, because generators\\, for example\\, only supply electricity when the corresponding map block is loaded. This can be enforced with a forceload block.\n".. - "\n".. - "In TA4 there is also a cable for the solar system.\n".. - "\n".. - "\n".. - "\n", - "Storage systems in the power grid fulfill two tasks:\n".. - "\n".. - " - To cope with peaks in demand: All generators always deliver just as much power as is needed. However\\, if consumers are switched on/off or there are fluctuations in demand for other reasons\\, consumers can fail for a short time. To prevent this\\, there should always be at least one battery block in every network. This serves as a buffer and compensates for these fluctuations in the seconds range.\n".. - " - To store regenerative energy: Solar and wind are not available 24 hours a day. So that the power supply does not fail when no electricity is produced\\, one or more storage systems must be installed in the network. Alternatively\\, the gaps can also be bridged with oil/coal electricity.\n".. - "\n".. - "A storage system indicates its capacity in kud\\, i.e. ku per day. For example\\, a storage system with 100 kud delivers 100 ku for one game day\\, or 10 ku for 10 game days.\n".. - "\n".. - "All TA3/TA4 energy sources have adjustable charging characteristics. By default this is set to \"80% - 100%\". This means that when the storage system is 80% full\\, the output is reduced further and further until it switches off completely at 100%. If electricity is required in the network\\, 100% will never be reached\\, since the power of the generator has at some point dropped to the electricity demand in the network and the storage system is no longer charged\\, but only the consumers are served.\n".. - "\n".. - "This has several advantages:\n".. - "\n".. - " - The charging characteristics are adjustable. This means\\, for example\\, that oil/coal energy sources can be reduced at 60% and regenerative energy sources only at 80%. This means that oil/coal is only burned if there are not enough renewable energy sources available.\n".. - " - Several energy sources can be operated in parallel and are loaded almost evenly\\, because all energy sources work\\, for example\\, up to 80% of the storage system's charging capacity at their full capacity and then reduce their capacity at the same time.\n".. - " - All storage systems in a network form a large buffer. The charging capacity and the filling level of the entire storage system can always be read in percent on every storage system\\, but also on the electricity terminal.\n".. - "\n".. - " \n".. - "\n", - "For local wiring in the floor or in buildings.\n".. - "Branches can be realized using junction boxes. The maximum cable length between machines or junction boxes is 1000 m. A maximum of 1000 nodes can be connected in a power network. All blocks with power connection\\, including junction boxes\\, count as nodes.\n".. - "\n".. - "Since the power cables are not automatically protected\\, the land lines (TA power line) are recommended for longer distances.\n".. - "\n".. - "Power cables can be plastered with the trowel so they can be hidden in the wall or in the floor. All stone\\, clay and other blocks without \"intelligence\" can be used as plastering material. Dirt does not work because dirt can be converted to grass or the like\\, which would destroy the line.\n".. - "\n".. - "For plastering\\, the cable must be clicked on with the trowel. The material with which the cable is to be plastered must be on the far left in the player inventory.\n".. - "The cables can be made visible again by clicking on the block with the trowel.\n".. - "\n".. - "In addition to cables\\, the TA junction box and the TA power switch box can also be plastered.\n".. - "\n".. - "\n".. - "\n", - "With the junction box\\, electricity can be distributed in up to 6 directions. Junction boxes can also be plastered (hidden) with a trowel and made visible again.\n".. - "\n".. - "\n".. - "\n", - "With the TA power line and the electricity poles\\, reasonably realistic overhead lines can be realized. The power pole heads also serve to protect the power line (protection). A pole must be set every 16 m or less. The protection only applies to the power line and the poles\\, however\\, all other blocks in this area are not protected.\n".. - "\n".. - "\n".. - "\n", - "Used to build electricity poles. Is protected from destruction by the electricity pole head and can only be removed by the owner.\n".. - "\n".. - "\n".. - "\n", - "Has up to four arms and thus allows electricity to be distributed in up to 6 directions.\n".. - "The electricity pole head protects power lines and poles within a radius of 8 m.\n".. - "\n".. - "\n".. - "\n", - "This electricity pole head has two fixed arms and is used for the overhead lines. However\\, it can also transmit current downwards and upwards.\n".. - "The electricity pole head protects power lines and poles within a radius of 8 m.\n".. - "\n".. - "\n".. - "\n", - "The switch can be used to switch the power on and off. To do this\\, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides.\n".. - "\n".. - "\n".. - "\n", - "The switch can be used to switch the power on and off. To do this\\, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides.\n".. - "\n".. - "\n".. - "\n", - "see TA power switch.\n".. - "\n".. - "\n".. - "\n", - "The small power generator runs on gasoline and can be used for small consumers with up to 12 ku. Gasoline burns for 150 s under full load. Correspondingly longer under partial load (50% load = double time).\n".. - "\n".. - "The power generator can only hold 50 units of gasoline. An additional tank and a pump are therefore advisable.\n".. - "\n".. - "\n".. - "\n", - "The accu block (rechargeable battery) is used to store excess energy and automatically delivers power in the event of a power failure (if available).\n".. - "Several accu blocks together form a TA3 energy storage system. Each accu block has a display for the charging state and for the stored load.\n".. - "The values for the entire network are always displayed here. The stored load is displayed in \"kud\" or \"ku-days\" (analogous to kWh) 5 kud thus corresponds\\, for example\\, to 5 ku for a game day (20 min) or 1 ku for 5 game days.\n".. - "\n".. - "A accu block has 3.33 kud\n".. - "\n".. - "\n".. - "\n", - "The power terminal must be connected to the power grid. It shows data from the power grid.\n".. - "\n".. - "The most important figures are displayed in the upper half:\n".. - "\n".. - " - current/maximum generator power\n".. - " - current power consumption of all consumers\n".. - " - current charging current in/from the storage system\n".. - " - Current state of charge of the storage system in percent\n".. - "\n".. - "The number of network blocks is output in the lower half.\n".. - "\n".. - "Additional data on the generators and storage systems can be queried via the \"console\" tab.\n".. - "\n".. - "\n".. - "\n", - "The TA3 Electric Motor is required in order to be able to operate TA2 machines via the power grid. The TA3 Electric Motor converts electricity into axle power.\n".. - "If the electric motor is not supplied with sufficient power\\, it goes into an fault state and must be reactivated with a right-click.\n".. - "\n".. - "The electric motor takes max. 40 ku of electricity and provides on the other side max. 39 ku as axle power. So he consumes one ku for the conversion.\n".. - "\n".. - "\n".. - "\n", - "The TA3 industrial furnace serves as a supplement to normal furnaces. This means that all goods can be produced with \"cooking\" recipes\\, even in an industrial furnace. But there are also special recipes that can only be made in an industrial furnace.\n".. - "The industrial furnace has its own menu for recipe selection. Depending on the goods in the industrial furnace inventory on the left\\, the output product can be selected on the right.\n".. - "\n".. - "The industrial furnace requires electricity (for the booster) and fuel oil / gasoline for the burner. The industrial furnace must be assembled as shown in the plan on the right.\n".. - "\n".. - "See also TA4 heater.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace.\n".. - "\n".. - "The oil burner can be operated with crude oil\\, fuel oil\\, naphtha or gasoline. The burning time is 64 s for crude oil\\, 80 s for fuel oil\\, 90 s for naphtha and 100 s for gasoline.\n".. - "\n".. - "The oil burner can only hold 50 units of fuel. An additional tank and a pump are therefore advisable.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace. See TA3 industrial furnace.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace. See TA3 industrial furnace.\n".. - "\n".. - "\n".. - "\n", - "Liquids such as water or oil can only be pumped through the special pipes and stored in tanks. As with water\\, there are containers (canisters\\, barrels) in which the liquid can be stored and transported.\n".. - "\n".. - "It is also possible to connect several tanks using the yellow pipes and connectors. However\\, the tanks must have the same content and there must always be at least one yellow pipe between the tank\\, pump and distributor pipe.\n".. - "\n".. - "E.g. It is not possible to connect two tanks directly to a distributor pipe.\n".. - "\n".. - "The liquid filler is used to transfer liquids from containers to tanks. The plan shows how canisters or barrels with liquids are pushed into a liquid filler via pushers. The container is emptied in the liquid filler and the liquid is led down into the tank.\n".. - "\n".. - "The liquid filler can also be placed under a tank to empty the tank.\n".. - "\n".. - "\n".. - "\n", - "Liquids can be stored in a tank. A tank can be filled or emptied using a pump. To do this\\, the pump must be connected to the tank via a pipe (yellow pipes).\n".. - "\n".. - "A tank can also be filled or emptied manually by clicking on the tank with a full or empty liquid container (barrel\\, canister). It should be noted that barrels can only be completely filled or emptied. If\\, for example\\, there are less than 10 units in the tank\\, this remainder must be removed with canisters or pumped empty.\n".. - "\n".. - "A TA3 tank can hold 1000 units or 100 barrels of liquid.\n".. - "\n".. - "\n".. - "\n", - "The pump can be used to pump liquids from tanks or containers to other tanks or containers. The pump direction (arrow) must be observed for the pump. The yellow lines and connectors also make it possible to arrange several tanks on each side of the pump. However\\, the tanks must have the same content.\n".. - "\n".. - "The TA3 pump pumps 4 units of liquid every two seconds.\n".. - "\n".. - "Note 1: The pump must not be placed directly next to the tank. There must always be at least a piece of yellow pipe between them.\n".. - "\n".. - "\n".. - "\n", - "The liquid filler is used to transfer liquids between containers and tanks.\n".. - "\n".. - " - If the liquid filler is placed under a tank and empty barrels are put into the liquid filler with a pusher or by hand\\, the contents of the tank are transferred to the barrels and the barrels can be removed from the outlet\n".. - " - If the liquid filler is placed on a tank and if full containers are put into the liquid filler with a pusher or by hand\\, the content is transferred to the tank and the empty containers can be removed on the exit side\n".. - "\n".. - "It should be noted that barrels can only be completely filled or emptied. If\\, for example\\, there are less than 10 units in the tank\\, this remainder must be removed with canisters or pumped empty.\n".. - "\n".. - "\n".. - "\n", - "The yellow pipes are used for the transmission of gas and liquids.\n".. - "The maximum pipe length is 100 m.\n".. - "\n".. - "\n".. - "\n", - "The blocks serve as wall openings for tubes\\, so that no holes remain open.\n".. - "\n".. - "\n".. - "\n", - "There is a valve for the yellow pipes\\, which can be opened and closed with a click of the mouse.\n".. - "The valve can also be controlled via on/off commands.\n".. - "\n".. - "\n".. - "\n", - "In order to run your generators and stoves with oil\\, you must first look for oil and build a derrick and then extract the oil.\n".. - "TA3 oil explorer\\, TA3 oil drilling box and TA3 pump jack are used for this.\n".. - "\n".. - "\n".. - "\n", - "You can search for oil with the oil explorer. To do this\\, place the block on the floor and right-click to start the search. The oil explorer can be used above ground and underground at all depths.\n".. - "The chat output shows you the depth to which oil was searched and how much oil (petroleum) was found.\n".. - "You can click the block multiple times to search for oil in deeper areas. Oil fields range in size from 4\\,000 to 20\\,000 items.\n".. - "\n".. - "If the search was unsuccessful\\, you have to move the block approx. 16 m further.\n".. - "The oil explorer always searches for oil in the whole map block and below\\, in which it was set. A new search in the same map block (16x16 field) therefore makes no sense.\n".. - "\n".. - "If oil is found\\, the location for the derrick is displayed. You have to erect the derrick within the area shown\\, it is best to mark the spot with a sign and protect the entire area against foreign players.\n".. - "\n".. - "Don't give up looking for oil too quickly. If you're unlucky\\, it can take a long time to find an oil well.\n".. - "It also makes no sense to search an area that another player has already searched. The chance of finding oil anywhere is the same for all players.\n".. - "\n".. - "The oil explorer can always be used to search for oil.\n".. - "\n".. - "\n".. - "\n", - "The oil drill box must be placed in the position indicated by the oil explorer. Drilling for oil elsewhere is pointless.\n".. - "If the button on the oil drilling box is clicked\\, the derrick is erected above the box. This takes a few seconds.\n".. - "The oil drilling box has 4 sides\\, at IN the drill pipe has to be delivered via pusher and at OUT the drilling material has to be removed. The oil drilling box must be supplied with power via one of the other two sides.\n".. - "\n".. - "The oil drilling box drills to the oil field (1 meter in 16 s) and requires 16 ku of electricity.\n".. - "Once the oil field has been reached\\, the derrick can be dismantled and the box removed.\n".. - "\n".. - "\n".. - "\n", - "The oil pump (pump-jack) must now be placed in the place of the oil drilling box. The oil pump also requires electricity (16 ku) and supplies one unit of oil every 8 s. The oil must be collected in a tank. To do this\\, the oil pump must be connected to the tank via yellow pipes.\n".. - "Once all the oil has been pumped out\\, the oil pump can also be removed.\n".. - "\n".. - "\n".. - "\n", - "The drill pipe is required for drilling. As many drill pipe items are required as the depth specified for the oil field. The drill pipe is useless after drilling\\, but it also cannot be dismantled and remains in the ground. However\\, there is a tool to remove the drill pipe blocks (-> Tools -> TA3 drill pipe pliers).\n".. - "\n".. - "\n".. - "\n", - "The oil tank is the large version of the TA3 tank (see liquids -> TA3 tank).\n".. - "\n".. - "The large tank can hold 4000 units of oil\\, but also any other type of liquid.\n".. - "\n".. - "\n".. - "\n", - "", - "Tank carts can be used to transport oil from the oil well to the oil processing plant. A tank cart can be filled or emptied directly using pumps. In both cases\\, the yellow pipes must be connected to the tank cart from above.\n".. - "\n".. - "The following steps are necessary:\n".. - "\n".. - " - Place the tank cart in front of the rail bumper block. The bumper block must not yet be programmed with a time so that the tank cart does not start automatically\n".. - " - Connect the tank cart to the pump using yellow pipes\n".. - " - Switch on the pump\n".. - " - Program the bumper with a time (10 - 20 s)\n".. - "\n".. - "This sequence must be observed on both sides (fill / empty).\n".. - "\n".. - "\n".. - "\n", - "Canisters and barrels can be loaded into the Minecarts. To do this\\, the oil must first be transferred to barrels. The oil barrels can be pushed directly into the Minecart with a pusher and tubes (see map). The empty barrels\\, which come back from the unloading station by Minecart\\, can be unloaded using a hopper\\, which is placed under the rail at the stop.\n".. - "\n".. - "It is not possible with the hopper to both *unload the empty barrels and load the full barrels at a stop*. The hopper immediately unloads the full barrels. It is therefore advisable to set up 2 stations on the loading and unloading side and then program the Minecart accordingly using a recording run.\n".. - "\n".. - "The plan shows how the oil can be pumped into a tank and filled into barrels via a liquid filler and loaded into Minecarts.\n".. - "\n".. - "For the Minecarts to start again automatically\\, the bumper blocks must be configured with the station name and waiting time. 5 s are sufficient for unloading. However\\, since the pushers always go into standby for several seconds when there is no Minecart\\, a time of 15 or more seconds must be entered for loading.\n".. - "\n".. - "\n".. - "\n", - "The tank truck is used to transport liquids. Like tanks\\, it can be filled with pumps or emptied. In both cases\\, the yellow tube must be connected to the tank truck from above.\n".. - "\n".. - "200 units fit in the tank truck.\n".. - "\n".. - "\n".. - "\n", - "The chest cart is used to transport items. Like chests\\, it can be filled or emptied using a pusher.\n".. - "\n".. - "4 stacks fit in the chest cart.\n".. - "\n".. - "\n".. - "\n", - "Oil is a mixture of substances and consists of many components. The oil can be broken down into its main components such as bitumen\\, fuel oil\\, naphtha\\, gasoline and propane gas via a distillation tower.\n".. - "Further processing to end products takes place in the chemical reactor.\n".. - "\n".. - "\n".. - "\n", - "The distillation tower must be set up as in the plan at the top right.\n".. - "The bitumen is drained off via the base block. The exit is on the back of the base block (note the direction of the arrow).\n".. - "The \"distillation tower\" blocks with the numbers: 1\\, 2\\, 3\\, 2\\, 3\\, 2\\, 3\\, 4 are placed on this basic block\n".. - "Fuel oil\\, naphtha and gasoline are drained from the openings from bottom to top. The propane gas is caught at the top.\n".. - "All openings on the tower must be connected to tanks.\n".. - "The reboiler must be connected to the \"distillation tower 1\" block.\n".. - "\n".. - "The reboiler needs electricity (not shown in the plan)!\n".. - "\n".. - "\n".. - "\n", - "The reboiler heats the oil to approx. 400 ° C. It largely evaporates and is fed into the distillation tower for cooling.\n".. - "\n".. - "The reboiler requires 14 units of electricity and produces one unit of bitumen\\, fuel oil\\, naphtha\\, gasoline and propane every 16 s.\n".. - "To do this\\, the reboiler must be supplied with oil via a pump.\n".. - "\n".. - "\n".. - "\n", - "In addition to the tubes for goods transport\\, as well as the gas and power pipes\\, there is also a wireless communication level through which blocks can exchange data with each other. No lines have to be drawn for this\\, the connection between transmitter and receiver is only made via the block number. \n".. - "\n".. - "*Info:* A block number is a unique number that is generated by Techage when many Techage blocks are placed. The block number is used for addressing during communication between Techage controllers and machines. All blocks that can participate in this communication show the block number as info text if you fix the block with the mouse cursor.\n".. - "\n".. - "Which commands a block supports can be read out and displayed with the TechAge Info Tool (wrench).\n".. - "The simplest commands supported by almost all blocks are:\n".. - "\n".. - " - 'on' - to turn on block / machine / lamp\n".. - " - 'off' - to turn off the block / machine / lamp\n".. - "\n".. - "With the help of the TA3 Terminal\\, these commands can be tried out very easily. Suppose a signal lamp is number 123.\n".. - "Then with:\n".. - "\n".. - " cmd 123 on\n".. - "\n".. - "the lamp can be turned on and with:\n".. - "\n".. - " cmd 123 off\n".. - "\n".. - "the lamp can be turned off again. These commands must be entered in the input field of the TA3 terminal.\n".. - "\n".. - "Commands such as 'on' and'off' are sent to the recipient without a response coming back. These commands can therefore be sent to several receivers at the same time\\, for example with a push button / switch\\, if several numbers are entered in the input field.\n".. - "\n".. - "A command like 'state' requests the status of a block. The block then sends its status back. This type of confirmed command can only be sent to one recipient at a time.\n".. - "This command can also be tested with the TA3 terminal on a pusher\\, for example:\n".. - "\n".. - " cmd 123 state\n".. - "\n".. - "Possible responses from the pusher are:\n".. - "\n".. - " - 'running' -> I'm working\n".. - " - 'stopped' -> switched off\n".. - " - 'standby' -> nothing to do because source inventory is empty\n".. - " - 'blocked' -> can't do anything because target inventory is full\n".. - "\n".. - "This status and other information is also output when the wrench is clicked on the block.\n".. - "\n".. - "\n".. - "\n", - "The button/switch sends 'on' / 'off' commands to the blocks that have been configured via the numbers.\n".. - "The button/switch can be configured as a button or a switch. If it is configured as a button\\, the time between the 'on' and 'off' commands can be set. With the operating mode \"on button\" only an 'on' and no 'off' command is sent.\n".. - "\n".. - "The checkbox \"public\" can be used to set whether the button can be used by everyone (set) or only by the owner himself (not set).\n".. - "\n".. - "Note: With the programmer\\, block numbers can be easily collected and configured.\n".. - "\n".. - "\n".. - "\n", - "With the TA3 command converter\\, 'on' / 'off' commands can be converted into other commands\\, and forwarding can be prevented or delayed.\n".. - "The number of the target block or the numbers of the target blocks\\, the commands to be sent and the delay times in seconds must be entered. If no command is entered\\, nothing is sent.\n".. - "\n".. - "The numbers can also be programmed using the Techage programmer.\n".. - "\n".. - "\n".. - "\n", - "The TA3 flip-flop changes its state with each received 'on' command. Received 'off' commands are ignored. Depending on the status change\\, 'on' / 'off' commands are sent alternately. The number of the target block or the numbers of the target blocks must be entered. The numbers can also be programmed using the Techage programmer.\n".. - "\n".. - "For example\\, lamps can be switched on and off with the help of buttons.\n".. - "\n".. - "\n".. - "\n", - "The TA3 logic block can be programmed in such a way that one or more input commands are linked to one output command and sent. This block can therefore replace various logic elements such as AND\\, OR\\, NOT\\, XOR etc. \n".. - "Input commands for the logic block are 'on' /'off' commands.\n".. - "Input commands are referenced via the number\\, e.g. '1234' for the command from the sender with the number 1234. \n".. - "The same applies to output commands.\n".. - "\n".. - "A rule is structured as follows: \n".. - "\n".. - " = on/off if is true\n".. - "\n".. - "'' is the block number to which the command should be sent.\n".. - "'' is a boolean expression where input numbers are evaluated.\n".. - "\n".. - "*Examples for the input expression*\n".. - "\n".. - "Negate signal (NOT):\n".. - "\n".. - " 1234 == off\n".. - "\n".. - "Logical AND:\n".. - "\n".. - " 1234 == on and 2345 == on\n".. - "\n".. - "Logical OR:\n".. - "\n".. - " 1234 == on or 2345 == on\n".. - "\n".. - "The following operators are allowed: 'and' 'or' 'on' 'off' 'me' '==' '~=' '(' ')'\n".. - "\n".. - "If the expression is true\\, a command is sent to the block with the '' number. \n".. - "Up to four rules can be defined\\, whereby all rules are always checked when a command is received. \n".. - "The internal processing time for all commands is 100 ms. \n".. - "\n".. - "Your own node number can be referenced using the keyword 'me'. This makes it possible for the block to send itself a command (flip-flop function). \n".. - "\n".. - "The blocking time defines a pause after a command\\, during which the logic block does not accept any further external commands. Commands received during the blocking period are thus discarded. The blocking time can be defined in seconds. \n".. - "\n".. - "\n".. - "\n", - "The repeater sends the received signal to all configured numbers.\n".. - "This can make sense\\, for example\\, if you want to control many blocks at the same time. The repeater can be configured with the programmer\\, which is not possible with all blocks.\n".. - "\n".. - "\n".. - "\n", - "The sequencer can send a series of 'on' / 'off' commands\\, whereby the interval between the commands must be specified in seconds. You can use it to make a lamp blink\\, for example.\n".. - "Up to 8 commands can be configured\\, each with target block number and pending the next command.\n".. - "The sequencer repeats the commands endlessly when \"Run endless\" is set.\n".. - "If nothing is selected\\, only the specified time in seconds is waited for.\n".. - "\n".. - "\n".. - "\n", - "The timer can send commands time-controlled. The time\\, the target number(s) and the command itself can be specified for each command line. This means that lamps can be switched on in the evening and switched off again in the morning.\n".. - "\n".. - "\n".. - "\n", - "The terminal is primarily used to test the command interface of other blocks (see \"Logic / switching blocks\").\n".. - "You can also assign commands to keys and use the terminal productively.\n".. - "\n".. - " set \n".. - "\n".. - "With 'set 1 ON cmd 123 on'\\, for example\\, user key 1 can be programmed with the command 'cmd 123 on'. If the key is pressed\\, the command is sent and the response is output on the screen.\n".. - "\n".. - "The terminal has the following local commands:\n".. - "\n".. - " - 'clear' clear screen\n".. - " - 'help' output a help page\n".. - " - 'pub' switch to public mode\n".. - " - 'priv' switch to private mode\n".. - "\n".. - "In private mode\\, the terminal can only be used by players who can build at this location\\, i.e. who have protection rights.\n".. - "\n".. - "In public mode\\, all players can use the preconfigured keys.\n".. - "\n".. - "\n".. - "\n", - "The signal lamp can be switched on or off with the 'on' / 'off' command. This lamp does not need electricity and can be colored with the airbrush tool from the mod Unified Dyes\" and via Lua/Beduino commands.\n".. - "\n".. - "With the chat command '/ta_color' the color palette with the values for the Lua/Beduino commands is displayed and with '/ta_send color ' the color can be changed.\n".. - "\n".. - "\n".. - "\n", - "With these blocks you can realize doors and gates that can be opened via commands (blocks disappear) and closed again. One door controller is required for each gate or door.\n".. - "\n".. - "The appearance of the blocks can be adjusted via the block menu.\n".. - "This makes it possible to realize secret doors that only open for certain players (with the help of the player detector).\n".. - "\n".. - "\n".. - "\n", - "The door controller is used to control the TA3 door/gate blocks. With the door controller\\, the numbers of the door/gate blocks must be entered. If an 'on' / 'off' command is sent to the door controller\\, this opens/closes the door or gate.\n".. - "\n".. - "\n".. - "\n", - "The Door Controller II can remove and set all types of blocks. To teach in the Door Controller II\\, the \"Record\" button must be pressed. Then all blocks that should be part of the door / gate must be clicked. Then the \"Done\" button must be pressed. Up to 16 blocks can be selected. The removed blocks are saved in the controller's inventory. The function of the controller can be tested manually using the \"Remove\" or \"Set\" buttons. If an 'on' /'off' command is sent to the Door Controller II\\, it removes or sets the blocks as well.\n".. - "\n".. - "With '$send_cmnd(node_number\\, \"exchange\"\\, 2)' individual blocks can be set\\, removed or replaced by other blocks from the inventory. \n".. - "\n".. - "With '$send_cmnd(node_number\\, \"set\"\\, 2)' a block from the inventory can be set explicitly\\, as long as the inventory slot is not empty.\n".. - "\n".. - "A block can be removed again with '$send_cmnd(node_number\\, \"dig\"\\, 2)' if the inventory slot is empty. \n".. - "\n".. - "The name of the set block is returned with '$send_cmnd(node_number\\, \"get\"\\, 2)'.\n".. - "\n".. - "The slot number of the inventory (1 .. 16) must be passed as payload in all three cases.\n".. - "\n".. - "This can also be used to simulate extendable stairs and the like. \n".. - "\n".. - "\n".. - "\n", - "Different sounds can be played with the sound block. All sounds of the Mods Techage\\, Signs Bot\\, Hyperloop\\, Unified Inventory\\, TA4 Jetpack and Minetest Game are available.\n".. - "\n".. - "The sounds can be selected and played via the menu and via command.\n".. - "\n".. - " - Command 'on' to play a sound\n".. - " - Command 'sound ' to select a sound via the index\n".. - " - Command 'gain ' to adjust the volume via the '' value (1 to 5).\n".. - "\n".. - "\n".. - "\n", - "The Mesecons converter is used to convert Techage on/off commands into Mesecons signals and vice versa.\n".. - "To do this\\, one or more node numbers must be entered and the converter with Mesecons blocks\n".. - "has to be connected via Mesecons cables. The Mesecons converter can also be configured with the programmer.\n".. - "The Mesecons converter accepts up to 5 commands per second\\; it switches itself off at higher loads.\n".. - "\n".. - "*This node only exists if the mod mesecons is active!*\n".. - "\n".. - "\n".. - "\n", - "Detectors scan their surroundings and send an 'on' command when the search is recognized.\n".. - "\n".. - "\n".. - "\n", - "The detector is a special tube block that detects when items are passed on through the tube. To do this\\, it must be connected to tubes on both sides. If items are pushed into the detector with a pusher\\, they are automatically passed on.\n".. - "It sends an 'on' when an item is recognized\\, followed by an 'off' a second later.\n".. - "Then further commands are blocked for 8 seconds.\n".. - "The waiting time and the items that should trigger a command can be configured using the open-ended wrench menu. \n".. - "\n".. - "\n".. - "\n", - "The cart detector sends an 'on' command if it has recognized a cart (Minecart) directly in front of it. In addition\\, the detector can also restart the cart when an 'on' command is received.\n".. - "\n".. - "The detector can also be programmed with its own number. In this case\\, he pushes all the wagons that stop near him (one block in all directions).\n".. - "\n".. - "\n".. - "\n", - "The node detector sends an 'on' command if it detects that nodes (blocks) appear or disappear in front of it\\, but must be configured accordingly. After switching the detector back to the standard state (gray block)\\, an 'off' command is sent. Valid blocks are all types of blocks and plants\\, but not animals or players. The sensor range is 3 blocks / meter in the direction of the arrow.\n".. - "\n".. - "\n".. - "\n", - "The player detector sends an 'on' command if it detects a player within 4 m of the block. If the player leaves the area again\\, an 'off' command is sent.\n".. - "If the search should be limited to specific players\\, these player names can also be entered.\n".. - "\n".. - "\n".. - "\n", - "The light detector sends an 'on' command if the light level of the block above exceeds a certain level\\, which can be set through the right-click menu.\n".. - "If you have a TA4 Lua Controller\\, you can get the exact light level with $get_cmd(num\\, 'light_level')\n".. - "\n".. - "\n".. - "\n", - "TA3 has the same machines as TA2\\, only these are more powerful and require electricity instead of axis drive.\n".. - "Therefore\\, only the different technical data are given below.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 6 items every 2 s.\n".. - "\n".. - "\n".. - "\n", - "The function of the TA3 distributor corresponds to that of TA2.\n".. - "The processing power is 12 items every 4 s.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The autocrafter requires 6 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2\\, only TA4 WLAN chips are produced here.\n".. - "The processing power is one chip every 6 s. The block requires 12 ku of electricity for this.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The maximum depth is 40 meters. The quarry requires 12 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The block requires 4 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The probability is also the same as for TA2. The block also requires 3 ku of electricity.\n".. - "But in contrast to TA2\\, the status of the TA3 block can be read (controller)\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The block requires 6 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The injector is a TA3 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest to pass them on to machines with recipes (autocrafter\\, industrial furnace and electronic fab).\n".. - "\n".. - "When passing on\\, only one position in the inventory is used in the target machine. If\\, for example\\, only the first three entries are configured in the injector\\, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented.\n".. - "\n".. - "The injector can also be switched to \"pull mode\". Then he only pulls items out of the chest from the positions that are defined in the configuration of the injector. In this case\\, item type and position must match. This allows to empty specific inventory entries of a chest. \n".. - "\n".. - "The processing power is up to 8 times one item every 4 seconds.\n".. - "\n".. - "\n".. - "\n", - "", - "The Techage Info Tool (open-ended wrench) has several functions. It shows the time\\, position\\, temperature and biome when an unknown block is clicked on.\n".. - "If you click on a TechAge block with command interface\\, all available data will be shown (see also \"Logic / switching blocks\").\n".. - "\n".. - "With Shift + right click an extended menu can be opened for some blocks. Depending on the block\\, further data can be called up or special settings can be made here. In the case of a generator\\, for example\\, the charging curve/switch-off can be programmed. \n".. - "\n".. - "\n".. - "\n", - "With the programmer\\, block numbers can be collected from several blocks with a right click and written into a block like a button / switch with a left click.\n".. - "If you click in the air\\, the internal memory is deleted.\n".. - "\n".. - "\n".. - "\n", - "The trowel is used for plastering power cables. See also \"TA power cable\".\n".. - "\n".. - "\n".. - "\n", - "This tool can be used to remove the drill pipe blocks if\\, for example\\, a tunnel is to pass through there.\n".. - "\n".. - "\n".. - "\n", - "The Techage Screwdriver serves as a replacement for the normal screwdriver. It has the following functions:\n".. - "\n".. - " - Left click: turn the block to the left\n".. - " - Right click: turn the visible side of the block upwards\n".. - " - Shift + left click: save the alignment of the clicked block\n".. - " - Shift + right click: apply the saved alignment to the clicked block\n".. - "\n".. - " \n".. - "\n", - "The TechAge Assembly Tool is used to remove and reposition Techage blocks without these blocks losing their block number or being assigned a new number when setting. This is helpful\\, for example\\, for quarries\\, as they often have to be moved.\n".. - "\n".. - " - Left button: Remove a block\n".. - " - Right button: Set a block\n".. - "\n".. - "The block that was previously removed with the assembly tool and is to be placed again must be on the far left of the player inventory.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta3", - "", - "ta3_firebox", - "ta3_oilbox", - "ta3_boiler", - "ta3_turbine", - "ta3_generator", - "ta3_cooler", - "ta3_powerswitch", - "power_reduction", - "ta3_powercable", - "ta3_powerjunction", - "ta3_powerline", - "ta3_powerpole", - "ta3_powerpole4", - "ta3_powerpole2", - "ta3_powerswitch", - "ta3_powerswitchsmall", - "ta3_powerswitchbox", - "ta3_tinygenerator", - "ta3_akkublock", - "ta3_powerterminal", - "ta3_motor", - "", - "ta3_furnacefirebox", - "ta3_furnace", - "ta3_booster", - "", - "ta3_tank", - "ta3_pump", - "ta3_filler", - "ta3_pipe", - "ta3_pipe_wall_entry", - "ta3_valve", - "techage_ta3", - "ta3_oilexplorer", - "ta3_drillbox", - "ta3_pumpjack", - "ta3_drillbit", - "oiltank", - "", - "", - "", - "", - "", - "techage_ta31", - "", - "reboiler", - "ta3_logic", - "ta3_button", - "ta3_command_converter", - "ta3_flipflop", - "ta3_logic", - "ta3_repeater", - "ta3_sequencer", - "ta3_timer", - "ta3_terminal", - "ta3_colorlamp", - "ta3_doorblock", - "ta3_doorcontroller", - "ta3_doorcontroller", - "ta3_soundblock", - "ta3_mesecons_converter", - "ta3_nodedetector", - "ta3_detector", - "ta3_cartdetector", - "ta3_nodedetector", - "ta3_playerdetector", - "ta3_lightdetector", - "ta3_grinder", - "ta3_pusher", - "ta3_distributor", - "ta3_autocrafter", - "ta3_electronicfab", - "ta3_quarry", - "ta3_gravelsieve", - "ta3_gravelrinser", - "ta3_grinder", - "ta3_injector", - "", - "ta3_end_wrench", - "ta3_programmer", - "ta3_trowel", - "ta3_drill_pipe_wrench", - "ta3_screwdriver", - "techage:assembly_tool", - }, - plans = { - "", - "coalpowerstation", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_furnace", - "", - "", - "", - "ta3_tank", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_loading", - "", - "", - "", - "ta3_distiller", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta3_RU.lua b/techage/doc/manual_ta3_RU.lua deleted file mode 100644 index ae1a46a..0000000 --- a/techage/doc/manual_ta3_RU.lua +++ /dev/null @@ -1,931 +0,0 @@ -return { - titles = { - "1,TA3: Эпоха нефти", - "2,Угольная электростанция / Нефтяная электростанция", - "3,TA3 топка электростанции", - "3,TA3 нефтяная топка электростанции", - "3,TA3 котел основание / навершие", - "3,TA3 турбина", - "3,TA3 генератор", - "3,TA3 охладитель", - "2,Электрический ток", - "3,Значимость хранилищ энергии", - "3,TA Электрический кабель", - "3,TA Электрическая распред.коробка", - "3,TA Электролиния", - "3,TA Электростолб", - "3,TA Электростолб навершие", - "3,TA Электростолб навершие 2", - "3,TA Электрический переключатель", - "3,TA Электрический переключатель малый", - "3,TA Электрощиток", - "3,TA3 Малый электрогенератор", - "3,TA3 Батарейный пакет", - "3,TA3 Электотерминал", - "3,TA3 Электромотор", - "2,TA3 Промышленная печь", - "3,TA3 Нефтяная печная топка", - "3,TA3 Печь навершие", - "3,TA3 Нагнетатель", - "2,Жидкости", - "3,TA3 Цистерна", - "3,TA3 Насос", - "3,TA Жидкостный нагнетатель", - "3,TA4 Труба", - "3,TA3 Трубно-стеновой проходной блок", - "3,TA Клапана", - "2,Нефтедобыча", - "3,TA3 Нефтеразведчик", - "3,TA3 Нефтяная буровая вышка", - "3,TA3 Скважинный насос", - "3,TA3 Буровая труба", - "3,Нефтяная цистерна", - "2,Транспортировка нефти", - "3,Транспортировка нефти железнодорожными цистернами", - "3,Транспортировка нефти бочками на вагонетках", - "3,Железнодорожная цистерна", - "3,Вагонетки-сундуки", - "2,Нефтепереработка", - "3,Ректификационная колонна", - "4,Ребойлер", - "2,Логика / Блоки-переключатели", - "3,TA3 Кнопка / Переключатель", - "3,TA3 Command Converter", - "3,TA3 Flip-Flop", - "3,TA3 Логический блок", - "3,TA3 Повторитель", - "3,TA3 Секвенсер", - "3,TA3 Таймер", - "3,TA3 Терминал", - "3,ТА цветная лампа", - "3,Блоки дверей/ворот", - "3,TA3 контроллер дверей", - "3,TA3 контроллер дверей II", - "3,TA3 Звуковой блок", - "3,TA3 Преобразователь месекон", - "2,Датчики", - "3,TA3 Датчик", - "3,TA3 Определитель вагонетки", - "3,TA3 Определитель блока", - "3,TA3 Определитель игрока", - "3,TA3 Определитель света", - "2,TA3 Машины", - "3,TA3 Толкатель", - "3,TA3 Распределитель", - "3,TA3 Автокрафтер", - "3,TA3 Электронная фабрика", - "3,TA3 Карьер", - "3,TA3 Гравийное сито", - "3,TA3 Гравийная мойка", - "3,TA3 Дробилка", - "3,TA3 Внедритель", - "2,Инструменты", - "3,ТА инфо-инструмент", - "3,ТА программатор", - "3,ТА шпатель / Шпатель", - "3,TA3 буротрубный ключ", - "3,ТА отвертка", - "3,TechAge Монтажный инструмент", - }, - texts = { - "В ТА3 происходит замещение паровых машин более мощными машинами с электроприводом.\n".. - "\n".. - "Для этого\\, нужно построить угольную электростанции и генераторы. Постепенно вы обнаружите, что потребности в электроэнергии могут быть покрыты только электростанциями на нефтепродуктах. Отправляемся на поиски нефти. Буровые вышки и нефтяные насосы выдадут нефть. Железные дороги будут использованы для доставки нефти на электростанции.\n".. - "\n".. - "Индустриальная эпоха в разгаре.\n".. - "\n".. - "\n".. - "\n", - "Угольная электростанция состоит из нескольких блоков и собирается как показано на чертеже справа. Требуемые блоки: ТА3 топка электростанции\\, TA3 навершие котла\\, TA3 основа котла\\, TA3 турбина\\, TA3 генератор и TA3 теплообменник.\n".. - "\n".. - "Котел нужно заполнить водой в количестве до 10 ведер. Клик левой кнопкой мыши ведром на котел.\n".. - "Топку нужно заполнить углем или ТА древесным углем. Прим. переводчика: Древесный уголь из других модов не подходит!\n".. - "Как только вода вскипит\\, генератор можно запускать.\n".. - "\n".. - "Альтернативная топка\\, которой заменить угольную - нефтяная.\n".. - "Нефть можно подавать в топку с помощью насоса и нефтяной трубы.\n".. - "\n".. - "Электростанция выдает мощность до 80 ku.\n".. - "\n".. - "\n".. - "\n", - "Часть электростанции.\n".. - "Топку нужно заполнить углем или ТА древесным углем. Длительность горения зависит от мощности потребителей электростанции. Уголь сгорает 20 секунд, древесный уголь 60 секунд под полной нагрузкой. Под частичной загрузкой пропорционально дольше (50% нагрузка = вдвое дольше).\n".. - "\n".. - "\n".. - "\n", - "Часть электростанции.\n".. - "\n".. - "Нефтяная топка может быть наполнена сырой нефтью\\, печным топливом\\, нафтой или бензином. Длительность горения зависит от мощности потребителей электростанции. Под полной нагрузкой\\, сырая нефть сгорает 15 секунд\\, печное топливо 20 секунд\\, нафта 22 секунды и бензин 25 секунд\n".. - "\n".. - "Под частичной загрузкой пропорционально дольше (50% нагрузка = вдвое дольше).\n".. - "\n".. - "Нефтяная топка вмещает только 50 единиц топлива. Поэтому рекомендуется дополнительный топливный бак и насос.\n".. - "\n".. - "\n".. - "\n", - "Часть электростанции. Нужно заполнять водой. Если воды больше нет или температура снизилась\\, электростанция отключится.\n".. - "\n".. - "Расход воды в котле TA3 намного меньше, чем в паровом двигателе, благодаря замкнутому паровому контуру.\n".. - "В паровом двигателе\\, часть воды теряется в виде пара при каждом ходе поршня.\n".. - "\n".. - "\n".. - "\n", - "Турбина - часть электростанции. Должна быть размещена рядом с генератором и соединена с котлом и теплообменником паровыми трубами, как показано на чертеже.\n".. - "\n".. - "\n".. - "\n", - "Генератор использутся для выработки электричества. Должен быть соединен с машинами-потребителями электропроводами и электрораспределительными коробками.\n".. - "\n".. - "\n".. - "\n", - "Нужен для охлаждения пара выходящего из турбины. Должен быть присоединен к котлу и к турбине паровыми трубами, как показано на чертеже.\n".. - "\n".. - "\n".. - "\n", - "В ТА3 (и ТА4) машины приводятся в движение электричеством. Для этого\\, машины\\, хранилища\\, и генераторы должны быть соединены силовыми кабелями.\n".. - "В ТА3 есть 2 типа силовых кабелей:\n".. - "\n".. - " - Изолированные кабели (ТА силовые кабели) для местной проводки на этажах зданий. Эти кабели можно прятать внутрь строительных блоков - заштукатуривать \"plastered\" шпателем.\n".. - " - Магистральные линии (ТА силовые линии) для уличной проводки на дальние дистанции. Эти кабели защищены и не могут быть удалены другими игроками.\n".. - "\n".. - "Несколько потребителей\\, хранилищ\\, и генераторов могут работать совместно в силовой сети. Сети настраиваются распределительными коробками.\n".. - "Если поступает недостаточно электричества\\, потребители начинают отключаться.\n".. - "В такой ситуации\\, важно понимать принцип действия Блока принудительной загрузки\\, поскольку генераторы\\, например\\, поставляют электричество только когда чанк их размещения загружен. Загрузку можно гарантировать размещением БлокаПЗ.\n".. - "\n".. - "In TA4 there is also a cable for the solar system.\n".. - "\n".. - "\n".. - "\n", - "Storage systems in the power grid fulfill two tasks:\n".. - "\n".. - " - To cope with peaks in demand: All generators always deliver just as much power as is needed. However\\, if consumers are switched on/off or there are fluctuations in demand for other reasons\\, consumers can fail for a short time. To prevent this\\, there should always be at least one battery block in every network. This serves as a buffer and compensates for these fluctuations in the seconds range.\n".. - " - To store regenerative energy: Solar and wind are not available 24 hours a day. So that the power supply does not fail when no electricity is produced\\, one or more storage systems must be installed in the network. Alternatively\\, the gaps can also be bridged with oil/coal electricity.\n".. - "\n".. - "A storage system indicates its capacity in kud\\, i.e. ku per day. For example\\, a storage system with 100 kud delivers 100 ku for one game day\\, or 10 ku for 10 game days.\n".. - "\n".. - "All TA3/TA4 energy sources have adjustable charging characteristics. By default this is set to \"80% - 100%\". This means that when the storage system is 80% full\\, the output is reduced further and further until it switches off completely at 100%. If electricity is required in the network\\, 100% will never be reached\\, since the power of the generator has at some point dropped to the electricity demand in the network and the storage system is no longer charged\\, but only the consumers are served.\n".. - "\n".. - "This has several advantages:\n".. - "\n".. - " - The charging characteristics are adjustable. This means\\, for example\\, that oil/coal energy sources can be reduced at 60% and regenerative energy sources only at 80%. This means that oil/coal is only burned if there are not enough renewable energy sources available.\n".. - " - Several energy sources can be operated in parallel and are loaded almost evenly\\, because all energy sources work\\, for example\\, up to 80% of the storage system's charging capacity at their full capacity and then reduce their capacity at the same time.\n".. - " - All storage systems in a network form a large buffer. The charging capacity and the filling level of the entire storage system can always be read in percent on every storage system\\, but also on the electricity terminal.\n".. - "\n".. - " \n".. - "\n", - "For local wiring in the floor or in buildings.\n".. - "Branches can be realized using junction boxes. The maximum cable length between machines or junction boxes is 1000 m. A maximum of 1000 nodes can be connected in a power network. All blocks with power connection\\, including junction boxes\\, count as nodes.\n".. - "\n".. - "Since the power cables are not automatically protected\\, the land lines (TA power line) are recommended for longer distances.\n".. - "\n".. - "Power cables can be plastered with the trowel so they can be hidden in the wall or in the floor. All stone\\, clay and other blocks without \"intelligence\" can be used as plastering material. Dirt does not work because dirt can be converted to grass or the like\\, which would destroy the line.\n".. - "\n".. - "For plastering\\, the cable must be clicked on with the trowel. The material with which the cable is to be plastered must be on the far left in the player inventory.\n".. - "The cables can be made visible again by clicking on the block with the trowel.\n".. - "\n".. - "In addition to cables\\, the TA junction box and the TA power switch box can also be plastered.\n".. - "\n".. - "\n".. - "\n", - "With the junction box\\, electricity can be distributed in up to 6 directions. Junction boxes can also be plastered (hidden) with a trowel and made visible again.\n".. - "\n".. - "\n".. - "\n", - "With the TA power line and the electricity poles\\, reasonably realistic overhead lines can be realized. The power pole heads also serve to protect the power line (protection). A pole must be set every 16 m or less. The protection only applies to the power line and the poles\\, however\\, all other blocks in this area are not protected.\n".. - "\n".. - "\n".. - "\n", - "Used to build electricity poles. Is protected from destruction by the electricity pole head and can only be removed by the owner.\n".. - "\n".. - "\n".. - "\n", - "Has up to four arms and thus allows electricity to be distributed in up to 6 directions.\n".. - "The electricity pole head protects power lines and poles within a radius of 8 m.\n".. - "\n".. - "\n".. - "\n", - "This electricity pole head has two fixed arms and is used for the overhead lines. However\\, it can also transmit current downwards and upwards.\n".. - "The electricity pole head protects power lines and poles within a radius of 8 m.\n".. - "\n".. - "\n".. - "\n", - "The switch can be used to switch the power on and off. To do this\\, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides.\n".. - "\n".. - "\n".. - "\n", - "The switch can be used to switch the power on and off. To do this\\, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides.\n".. - "\n".. - "\n".. - "\n", - "see TA power switch.\n".. - "\n".. - "\n".. - "\n", - "The small power generator runs on gasoline and can be used for small consumers with up to 12 ku. Gasoline burns for 150 s under full load. Correspondingly longer under partial load (50% load = double time).\n".. - "\n".. - "The power generator can only hold 50 units of gasoline. An additional tank and a pump are therefore advisable.\n".. - "\n".. - "\n".. - "\n", - "The accu block (rechargeable battery) is used to store excess energy and automatically delivers power in the event of a power failure (if available).\n".. - "Several accu blocks together form a TA3 energy storage system. Each accu block has a display for the charging state and for the stored load.\n".. - "The values for the entire network are always displayed here. The stored load is displayed in \"kud\" or \"ku-days\" (analogous to kWh) 5 kud thus corresponds\\, for example\\, to 5 ku for a game day (20 min) or 1 ku for 5 game days.\n".. - "\n".. - "A accu block has 3.33 kud\n".. - "\n".. - "\n".. - "\n", - "The power terminal must be connected to the power grid. It shows data from the power grid.\n".. - "\n".. - "The most important figures are displayed in the upper half:\n".. - "\n".. - " - current/maximum generator power\n".. - " - current power consumption of all consumers\n".. - " - current charging current in/from the storage system\n".. - " - Current state of charge of the storage system in percent\n".. - "\n".. - "The number of network blocks is output in the lower half.\n".. - "\n".. - "Additional data on the generators and storage systems can be queried via the \"console\" tab.\n".. - "\n".. - "\n".. - "\n", - "The TA3 Electric Motor is required in order to be able to operate TA2 machines via the power grid. The TA3 Electric Motor converts electricity into axle power.\n".. - "If the electric motor is not supplied with sufficient power\\, it goes into an fault state and must be reactivated with a right-click.\n".. - "\n".. - "The electric motor takes max. 40 ku of electricity and provides on the other side max. 39 ku as axle power. So he consumes one ku for the conversion.\n".. - "\n".. - "\n".. - "\n", - "The TA3 industrial furnace serves as a supplement to normal furnaces. This means that all goods can be produced with \"cooking\" recipes\\, even in an industrial furnace. But there are also special recipes that can only be made in an industrial furnace.\n".. - "The industrial furnace has its own menu for recipe selection. Depending on the goods in the industrial furnace inventory on the left\\, the output product can be selected on the right.\n".. - "\n".. - "The industrial furnace requires electricity (for the booster) and fuel oil / gasoline for the burner. The industrial furnace must be assembled as shown in the plan on the right.\n".. - "\n".. - "See also TA4 heater.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace.\n".. - "\n".. - "The oil burner can be operated with crude oil\\, fuel oil\\, naphtha or gasoline. The burning time is 64 s for crude oil\\, 80 s for fuel oil\\, 90 s for naphtha and 100 s for gasoline.\n".. - "\n".. - "The oil burner can only hold 50 units of fuel. An additional tank and a pump are therefore advisable.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace. See TA3 industrial furnace.\n".. - "\n".. - "\n".. - "\n", - "Is part of the TA3 industrial furnace. See TA3 industrial furnace.\n".. - "\n".. - "\n".. - "\n", - "Liquids such as water or oil can only be pumped through the special pipes and stored in tanks. As with water\\, there are containers (canisters\\, barrels) in which the liquid can be stored and transported.\n".. - "\n".. - "It is also possible to connect several tanks using the yellow pipes and connectors. However\\, the tanks must have the same content and there must always be at least one yellow pipe between the tank\\, pump and distributor pipe.\n".. - "\n".. - "E.g. It is not possible to connect two tanks directly to a distributor pipe.\n".. - "\n".. - "The liquid filler is used to transfer liquids from containers to tanks. The plan shows how canisters or barrels with liquids are pushed into a liquid filler via pushers. The container is emptied in the liquid filler and the liquid is led down into the tank.\n".. - "\n".. - "The liquid filler can also be placed under a tank to empty the tank.\n".. - "\n".. - "\n".. - "\n", - "Liquids can be stored in a tank. A tank can be filled or emptied using a pump. To do this\\, the pump must be connected to the tank via a pipe (yellow pipes).\n".. - "\n".. - "A tank can also be filled or emptied manually by clicking on the tank with a full or empty liquid container (barrel\\, canister). It should be noted that barrels can only be completely filled or emptied. If\\, for example\\, there are less than 10 units in the tank\\, this remainder must be removed with canisters or pumped empty.\n".. - "\n".. - "A TA3 tank can hold 1000 units or 100 barrels of liquid.\n".. - "\n".. - "\n".. - "\n", - "The pump can be used to pump liquids from tanks or containers to other tanks or containers. The pump direction (arrow) must be observed for the pump. The yellow lines and connectors also make it possible to arrange several tanks on each side of the pump. However\\, the tanks must have the same content.\n".. - "\n".. - "The TA3 pump pumps 4 units of liquid every two seconds.\n".. - "\n".. - "Note 1: The pump must not be placed directly next to the tank. There must always be at least a piece of yellow pipe between them.\n".. - "\n".. - "\n".. - "\n", - "The liquid filler is used to transfer liquids between containers and tanks.\n".. - "\n".. - " - If the liquid filler is placed under a tank and empty barrels are put into the liquid filler with a pusher or by hand\\, the contents of the tank are transferred to the barrels and the barrels can be removed from the outlet\n".. - " - If the liquid filler is placed on a tank and if full containers are put into the liquid filler with a pusher or by hand\\, the content is transferred to the tank and the empty containers can be removed on the exit side\n".. - "\n".. - "It should be noted that barrels can only be completely filled or emptied. If\\, for example\\, there are less than 10 units in the tank\\, this remainder must be removed with canisters or pumped empty.\n".. - "\n".. - "\n".. - "\n", - "The yellow pipes are used for the transmission of gas and liquids.\n".. - "The maximum pipe length is 100 m.\n".. - "\n".. - "\n".. - "\n", - "The blocks serve as wall openings for tubes\\, so that no holes remain open.\n".. - "\n".. - "\n".. - "\n", - "There is a valve for the yellow pipes\\, which can be opened and closed with a click of the mouse.\n".. - "The valve can also be controlled via on/off commands.\n".. - "\n".. - "\n".. - "\n", - "In order to run your generators and stoves with oil\\, you must first look for oil and build a derrick and then extract the oil.\n".. - "TA3 oil explorer\\, TA3 oil drilling box and TA3 pump jack are used for this.\n".. - "\n".. - "\n".. - "\n", - "You can search for oil with the oil explorer. To do this\\, place the block on the floor and right-click to start the search. The oil explorer can be used above ground and underground at all depths.\n".. - "The chat output shows you the depth to which oil was searched and how much oil (petroleum) was found.\n".. - "You can click the block multiple times to search for oil in deeper areas. Oil fields range in size from 4\\,000 to 20\\,000 items.\n".. - "\n".. - "If the search was unsuccessful\\, you have to move the block approx. 16 m further.\n".. - "The oil explorer always searches for oil in the whole map block and below\\, in which it was set. A new search in the same map block (16x16 field) therefore makes no sense.\n".. - "\n".. - "If oil is found\\, the location for the derrick is displayed. You have to erect the derrick within the area shown\\, it is best to mark the spot with a sign and protect the entire area against foreign players.\n".. - "\n".. - "Don't give up looking for oil too quickly. If you're unlucky\\, it can take a long time to find an oil well.\n".. - "It also makes no sense to search an area that another player has already searched. The chance of finding oil anywhere is the same for all players.\n".. - "\n".. - "The oil explorer can always be used to search for oil.\n".. - "\n".. - "\n".. - "\n", - "The oil drill box must be placed in the position indicated by the oil explorer. Drilling for oil elsewhere is pointless.\n".. - "If the button on the oil drilling box is clicked\\, the derrick is erected above the box. This takes a few seconds.\n".. - "The oil drilling box has 4 sides\\, at IN the drill pipe has to be delivered via pusher and at OUT the drilling material has to be removed. The oil drilling box must be supplied with power via one of the other two sides.\n".. - "\n".. - "The oil drilling box drills to the oil field (1 meter in 16 s) and requires 16 ku of electricity.\n".. - "Once the oil field has been reached\\, the derrick can be dismantled and the box removed.\n".. - "\n".. - "\n".. - "\n", - "The oil pump (pump-jack) must now be placed in the place of the oil drilling box. The oil pump also requires electricity (16 ku) and supplies one unit of oil every 8 s. The oil must be collected in a tank. To do this\\, the oil pump must be connected to the tank via yellow pipes.\n".. - "Once all the oil has been pumped out\\, the oil pump can also be removed.\n".. - "\n".. - "\n".. - "\n", - "The drill pipe is required for drilling. As many drill pipe items are required as the depth specified for the oil field. The drill pipe is useless after drilling\\, but it also cannot be dismantled and remains in the ground. However\\, there is a tool to remove the drill pipe blocks (-> Tools -> TA3 drill pipe pliers).\n".. - "\n".. - "\n".. - "\n", - "The oil tank is the large version of the TA3 tank (see liquids -> TA3 tank).\n".. - "\n".. - "The large tank can hold 4000 units of oil\\, but also any other type of liquid.\n".. - "\n".. - "\n".. - "\n", - "", - "Tank carts can be used to transport oil from the oil well to the oil processing plant. A tank cart can be filled or emptied directly using pumps. In both cases\\, the yellow pipes must be connected to the tank cart from above.\n".. - "\n".. - "The following steps are necessary:\n".. - "\n".. - " - Place the tank cart in front of the rail bumper block. The bumper block must not yet be programmed with a time so that the tank cart does not start automatically\n".. - " - Connect the tank cart to the pump using yellow pipes\n".. - " - Switch on the pump\n".. - " - Program the bumper with a time (10 - 20 s)\n".. - "\n".. - "This sequence must be observed on both sides (fill / empty).\n".. - "\n".. - "\n".. - "\n", - "Canisters and barrels can be loaded into the Minecarts. To do this\\, the oil must first be transferred to barrels. The oil barrels can be pushed directly into the Minecart with a pusher and tubes (see map). The empty barrels\\, which come back from the unloading station by Minecart\\, can be unloaded using a hopper\\, which is placed under the rail at the stop.\n".. - "\n".. - "It is not possible with the hopper to both *unload the empty barrels and load the full barrels at a stop*. The hopper immediately unloads the full barrels. It is therefore advisable to set up 2 stations on the loading and unloading side and then program the Minecart accordingly using a recording run.\n".. - "\n".. - "The plan shows how the oil can be pumped into a tank and filled into barrels via a liquid filler and loaded into Minecarts.\n".. - "\n".. - "For the Minecarts to start again automatically\\, the bumper blocks must be configured with the station name and waiting time. 5 s are sufficient for unloading. However\\, since the pushers always go into standby for several seconds when there is no Minecart\\, a time of 15 or more seconds must be entered for loading.\n".. - "\n".. - "\n".. - "\n", - "The tank truck is used to transport liquids. Like tanks\\, it can be filled with pumps or emptied. In both cases\\, the yellow tube must be connected to the tank truck from above.\n".. - "\n".. - "200 units fit in the tank truck.\n".. - "\n".. - "\n".. - "\n", - "The chest cart is used to transport items. Like chests\\, it can be filled or emptied using a pusher.\n".. - "\n".. - "4 stacks fit in the chest cart.\n".. - "\n".. - "\n".. - "\n", - "Oil is a mixture of substances and consists of many components. The oil can be broken down into its main components such as bitumen\\, fuel oil\\, naphtha\\, gasoline and propane gas via a distillation tower.\n".. - "Further processing to end products takes place in the chemical reactor.\n".. - "\n".. - "\n".. - "\n", - "The distillation tower must be set up as in the plan at the top right.\n".. - "The bitumen is drained off via the base block. The exit is on the back of the base block (note the direction of the arrow).\n".. - "The \"distillation tower\" blocks with the numbers: 1\\, 2\\, 3\\, 2\\, 3\\, 2\\, 3\\, 4 are placed on this basic block\n".. - "Fuel oil\\, naphtha and gasoline are drained from the openings from bottom to top. The propane gas is caught at the top.\n".. - "All openings on the tower must be connected to tanks.\n".. - "The reboiler must be connected to the \"distillation tower 1\" block.\n".. - "\n".. - "The reboiler needs electricity (not shown in the plan)!\n".. - "\n".. - "\n".. - "\n", - "The reboiler heats the oil to approx. 400 ° C. It largely evaporates and is fed into the distillation tower for cooling.\n".. - "\n".. - "The reboiler requires 14 units of electricity and produces one unit of bitumen\\, fuel oil\\, naphtha\\, gasoline and propane every 16 s.\n".. - "To do this\\, the reboiler must be supplied with oil via a pump.\n".. - "\n".. - "\n".. - "\n", - "In addition to the tubes for goods transport\\, as well as the gas and power pipes\\, there is also a wireless communication level through which blocks can exchange data with each other. No lines have to be drawn for this\\, the connection between transmitter and receiver is only made via the block number. \n".. - "\n".. - "*Info:* A block number is a unique number that is generated by Techage when many Techage blocks are placed. The block number is used for addressing during communication between Techage controllers and machines. All blocks that can participate in this communication show the block number as info text if you fix the block with the mouse cursor.\n".. - "\n".. - "Which commands a block supports can be read out and displayed with the TechAge Info Tool (wrench).\n".. - "The simplest commands supported by almost all blocks are:\n".. - "\n".. - " - 'on' - to turn on block / machine / lamp\n".. - " - 'off' - to turn off the block / machine / lamp\n".. - "\n".. - "With the help of the TA3 Terminal\\, these commands can be tried out very easily. Suppose a signal lamp is number 123.\n".. - "Then with:\n".. - "\n".. - " cmd 123 on\n".. - "\n".. - "the lamp can be turned on and with:\n".. - "\n".. - " cmd 123 off\n".. - "\n".. - "the lamp can be turned off again. These commands must be entered in the input field of the TA3 terminal.\n".. - "\n".. - "Commands such as 'on' and'off' are sent to the recipient without a response coming back. These commands can therefore be sent to several receivers at the same time\\, for example with a push button / switch\\, if several numbers are entered in the input field.\n".. - "\n".. - "A command like 'state' requests the status of a block. The block then sends its status back. This type of confirmed command can only be sent to one recipient at a time.\n".. - "This command can also be tested with the TA3 terminal on a pusher\\, for example:\n".. - "\n".. - " cmd 123 state\n".. - "\n".. - "Possible responses from the pusher are:\n".. - "\n".. - " - 'running' -> I'm working\n".. - " - 'stopped' -> switched off\n".. - " - 'standby' -> nothing to do because source inventory is empty\n".. - " - 'blocked' -> can't do anything because target inventory is full\n".. - "\n".. - "This status and other information is also output when the wrench is clicked on the block.\n".. - "\n".. - "\n".. - "\n", - "The button/switch sends 'on' / 'off' commands to the blocks that have been configured via the numbers.\n".. - "The button/switch can be configured as a button or a switch. If it is configured as a button\\, the time between the 'on' and 'off' commands can be set. With the operating mode \"on button\" only an 'on' and no 'off' command is sent.\n".. - "\n".. - "The checkbox \"public\" can be used to set whether the button can be used by everyone (set) or only by the owner himself (not set).\n".. - "\n".. - "Note: With the programmer\\, block numbers can be easily collected and configured.\n".. - "\n".. - "\n".. - "\n", - "With the TA3 command converter\\, 'on' / 'off' commands can be converted into other commands\\, and forwarding can be prevented or delayed.\n".. - "The number of the target block or the numbers of the target blocks\\, the commands to be sent and the delay times in seconds must be entered. If no command is entered\\, nothing is sent.\n".. - "\n".. - "The numbers can also be programmed using the Techage programmer.\n".. - "\n".. - "\n".. - "\n", - "The TA3 flip-flop changes its state with each received 'on' command. Received 'off' commands are ignored. Depending on the status change\\, 'on' / 'off' commands are sent alternately. The number of the target block or the numbers of the target blocks must be entered. The numbers can also be programmed using the Techage programmer.\n".. - "\n".. - "For example\\, lamps can be switched on and off with the help of buttons.\n".. - "\n".. - "\n".. - "\n", - "The TA3 logic block can be programmed in such a way that one or more input commands are linked to one output command and sent. This block can therefore replace various logic elements such as AND\\, OR\\, NOT\\, XOR etc. \n".. - "Input commands for the logic block are 'on' /'off' commands.\n".. - "Input commands are referenced via the number\\, e.g. '1234' for the command from the sender with the number 1234. \n".. - "The same applies to output commands.\n".. - "\n".. - "A rule is structured as follows: \n".. - "\n".. - " = on/off if is true\n".. - "\n".. - "'' is the block number to which the command should be sent.\n".. - "'' is a boolean expression where input numbers are evaluated.\n".. - "\n".. - "*Examples for the input expression*\n".. - "\n".. - "Negate signal (NOT):\n".. - "\n".. - " 1234 == off\n".. - "\n".. - "Logical AND:\n".. - "\n".. - " 1234 == on and 2345 == on\n".. - "\n".. - "Logical OR:\n".. - "\n".. - " 1234 == on or 2345 == on\n".. - "\n".. - "The following operators are allowed: 'and' 'or' 'on' 'off' 'me' '==' '~=' '(' ')'\n".. - "\n".. - "If the expression is true\\, a command is sent to the block with the '' number. \n".. - "Up to four rules can be defined\\, whereby all rules are always checked when a command is received. \n".. - "The internal processing time for all commands is 100 ms. \n".. - "\n".. - "Your own node number can be referenced using the keyword 'me'. This makes it possible for the block to send itself a command (flip-flop function). \n".. - "\n".. - "The blocking time defines a pause after a command\\, during which the logic block does not accept any further external commands. Commands received during the blocking period are thus discarded. The blocking time can be defined in seconds. \n".. - "\n".. - "\n".. - "\n", - "The repeater sends the received signal to all configured numbers.\n".. - "This can make sense\\, for example\\, if you want to control many blocks at the same time. The repeater can be configured with the programmer\\, which is not possible with all blocks.\n".. - "\n".. - "\n".. - "\n", - "The sequencer can send a series of 'on' / 'off' commands\\, whereby the interval between the commands must be specified in seconds. You can use it to make a lamp blink\\, for example.\n".. - "Up to 8 commands can be configured\\, each with target block number and pending the next command.\n".. - "The sequencer repeats the commands endlessly when \"Run endless\" is set.\n".. - "If nothing is selected\\, only the specified time in seconds is waited for.\n".. - "\n".. - "\n".. - "\n", - "The timer can send commands time-controlled. The time\\, the target number(s) and the command itself can be specified for each command line. This means that lamps can be switched on in the evening and switched off again in the morning.\n".. - "\n".. - "\n".. - "\n", - "The terminal is primarily used to test the command interface of other blocks (see \"Logic / switching blocks\").\n".. - "You can also assign commands to keys and use the terminal productively.\n".. - "\n".. - " set \n".. - "\n".. - "With 'set 1 ON cmd 123 on'\\, for example\\, user key 1 can be programmed with the command 'cmd 123 on'. If the key is pressed\\, the command is sent and the response is output on the screen.\n".. - "\n".. - "The terminal has the following local commands:\n".. - "\n".. - " - 'clear' clear screen\n".. - " - 'help' output a help page\n".. - " - 'pub' switch to public mode\n".. - " - 'priv' switch to private mode\n".. - "\n".. - "In private mode\\, the terminal can only be used by players who can build at this location\\, i.e. who have protection rights.\n".. - "\n".. - "In public mode\\, all players can use the preconfigured keys.\n".. - "\n".. - "\n".. - "\n", - "The signal lamp can be switched on or off with the 'on' / 'off' command. This lamp does not need electricity and can be colored with the airbrush tool from the mod Unified Dyes\" and via Lua/Beduino commands.\n".. - "\n".. - "With the chat command '/ta_color' the color palette with the values for the Lua/Beduino commands is displayed and with '/ta_send color ' the color can be changed.\n".. - "\n".. - "\n".. - "\n", - "With these blocks you can realize doors and gates that can be opened via commands (blocks disappear) and closed again. One door controller is required for each gate or door.\n".. - "\n".. - "The appearance of the blocks can be adjusted via the block menu.\n".. - "This makes it possible to realize secret doors that only open for certain players (with the help of the player detector).\n".. - "\n".. - "\n".. - "\n", - "The door controller is used to control the TA3 door/gate blocks. With the door controller\\, the numbers of the door/gate blocks must be entered. If an 'on' / 'off' command is sent to the door controller\\, this opens/closes the door or gate.\n".. - "\n".. - "\n".. - "\n", - "The Door Controller II can remove and set all types of blocks. To teach in the Door Controller II\\, the \"Record\" button must be pressed. Then all blocks that should be part of the door / gate must be clicked. Then the \"Done\" button must be pressed. Up to 16 blocks can be selected. The removed blocks are saved in the controller's inventory. The function of the controller can be tested manually using the \"Remove\" or \"Set\" buttons. If an 'on' /'off' command is sent to the Door Controller II\\, it removes or sets the blocks as well.\n".. - "\n".. - "With '$send_cmnd(node_number\\, \"exchange\"\\, 2)' individual blocks can be set\\, removed or replaced by other blocks from the inventory. \n".. - "\n".. - "With '$send_cmnd(node_number\\, \"set\"\\, 2)' a block from the inventory can be set explicitly\\, as long as the inventory slot is not empty.\n".. - "\n".. - "A block can be removed again with '$send_cmnd(node_number\\, \"dig\"\\, 2)' if the inventory slot is empty. \n".. - "\n".. - "The name of the set block is returned with '$send_cmnd(node_number\\, \"get\"\\, 2)'.\n".. - "\n".. - "The slot number of the inventory (1 .. 16) must be passed as payload in all three cases.\n".. - "\n".. - "This can also be used to simulate extendable stairs and the like. \n".. - "\n".. - "\n".. - "\n", - "Different sounds can be played with the sound block. All sounds of the Mods Techage\\, Signs Bot\\, Hyperloop\\, Unified Inventory\\, TA4 Jetpack and Minetest Game are available.\n".. - "\n".. - "The sounds can be selected and played via the menu and via command.\n".. - "\n".. - " - Command 'on' to play a sound\n".. - " - Command 'sound ' to select a sound via the index\n".. - " - Command 'gain ' to adjust the volume via the '' value (1 to 5).\n".. - "\n".. - "\n".. - "\n", - "The Mesecons converter is used to convert Techage on/off commands into Mesecons signals and vice versa.\n".. - "To do this\\, one or more node numbers must be entered and the converter with Mesecons blocks\n".. - "has to be connected via Mesecons cables. The Mesecons converter can also be configured with the programmer.\n".. - "The Mesecons converter accepts up to 5 commands per second\\; it switches itself off at higher loads.\n".. - "\n".. - "*This node only exists if the mod mesecons is active!*\n".. - "\n".. - "\n".. - "\n", - "Detectors scan their surroundings and send an 'on' command when the search is recognized.\n".. - "\n".. - "\n".. - "\n", - "The detector is a special tube block that detects when items are passed on through the tube. To do this\\, it must be connected to tubes on both sides. If items are pushed into the detector with a pusher\\, they are automatically passed on.\n".. - "It sends an 'on' when an item is recognized\\, followed by an 'off' a second later.\n".. - "Then further commands are blocked for 8 seconds.\n".. - "The waiting time and the items that should trigger a command can be configured using the open-ended wrench menu. \n".. - "\n".. - "\n".. - "\n", - "The cart detector sends an 'on' command if it has recognized a cart (Minecart) directly in front of it. In addition\\, the detector can also restart the cart when an 'on' command is received.\n".. - "\n".. - "The detector can also be programmed with its own number. In this case\\, he pushes all the wagons that stop near him (one block in all directions).\n".. - "\n".. - "\n".. - "\n", - "The node detector sends an 'on' command if it detects that nodes (blocks) appear or disappear in front of it\\, but must be configured accordingly. After switching the detector back to the standard state (gray block)\\, an 'off' command is sent. Valid blocks are all types of blocks and plants\\, but not animals or players. The sensor range is 3 blocks / meter in the direction of the arrow.\n".. - "\n".. - "\n".. - "\n", - "The player detector sends an 'on' command if it detects a player within 4 m of the block. If the player leaves the area again\\, an 'off' command is sent.\n".. - "If the search should be limited to specific players\\, these player names can also be entered.\n".. - "\n".. - "\n".. - "\n", - "The light detector sends an 'on' command if the light level of the block above exceeds a certain level\\, which can be set through the right-click menu.\n".. - "If you have a TA4 Lua Controller\\, you can get the exact light level with $get_cmd(num\\, 'light_level')\n".. - "\n".. - "\n".. - "\n", - "TA3 has the same machines as TA2\\, only these are more powerful and require electricity instead of axis drive.\n".. - "Therefore\\, only the different technical data are given below.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 6 items every 2 s.\n".. - "\n".. - "\n".. - "\n", - "The function of the TA3 distributor corresponds to that of TA2.\n".. - "The processing power is 12 items every 4 s.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The autocrafter requires 6 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2\\, only TA4 WLAN chips are produced here.\n".. - "The processing power is one chip every 6 s. The block requires 12 ku of electricity for this.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The maximum depth is 40 meters. The quarry requires 12 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The block requires 4 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The probability is also the same as for TA2. The block also requires 3 ku of electricity.\n".. - "But in contrast to TA2\\, the status of the TA3 block can be read (controller)\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 2 items every 4 s. The block requires 6 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The injector is a TA3 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest to pass them on to machines with recipes (autocrafter\\, industrial furnace and electronic fab).\n".. - "\n".. - "When passing on\\, only one position in the inventory is used in the target machine. If\\, for example\\, only the first three entries are configured in the injector\\, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented.\n".. - "\n".. - "The injector can also be switched to \"pull mode\". Then he only pulls items out of the chest from the positions that are defined in the configuration of the injector. In this case\\, item type and position must match. This allows to empty specific inventory entries of a chest. \n".. - "\n".. - "The processing power is up to 8 times one item every 4 seconds.\n".. - "\n".. - "\n".. - "\n", - "", - "The Techage Info Tool (open-ended wrench) has several functions. It shows the time\\, position\\, temperature and biome when an unknown block is clicked on.\n".. - "If you click on a TechAge block with command interface\\, all available data will be shown (see also \"Logic / switching blocks\").\n".. - "\n".. - "With Shift + right click an extended menu can be opened for some blocks. Depending on the block\\, further data can be called up or special settings can be made here. In the case of a generator\\, for example\\, the charging curve/switch-off can be programmed. \n".. - "\n".. - "\n".. - "\n", - "With the programmer\\, block numbers can be collected from several blocks with a right click and written into a block like a button / switch with a left click.\n".. - "If you click in the air\\, the internal memory is deleted.\n".. - "\n".. - "\n".. - "\n", - "The trowel is used for plastering power cables. See also \"TA power cable\".\n".. - "\n".. - "\n".. - "\n", - "This tool can be used to remove the drill pipe blocks if\\, for example\\, a tunnel is to pass through there.\n".. - "\n".. - "\n".. - "\n", - "The Techage Screwdriver serves as a replacement for the normal screwdriver. It has the following functions:\n".. - "\n".. - " - Left click: turn the block to the left\n".. - " - Right click: turn the visible side of the block upwards\n".. - " - Shift + left click: save the alignment of the clicked block\n".. - " - Shift + right click: apply the saved alignment to the clicked block\n".. - "\n".. - " \n".. - "\n", - "The TechAge Assembly Tool is used to remove and reposition Techage blocks without these blocks losing their block number or being assigned a new number when setting. This is helpful\\, for example\\, for quarries\\, as they often have to be moved.\n".. - "\n".. - " - Left button: Remove a block\n".. - " - Right button: Set a block\n".. - "\n".. - "The block that was previously removed with the assembly tool and is to be placed again must be on the far left of the player inventory.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta3", - "", - "ta3_firebox", - "ta3_oilbox", - "ta3_boiler", - "ta3_turbine", - "ta3_generator", - "ta3_cooler", - "ta3_powerswitch", - "power_reduction", - "ta3_powercable", - "ta3_powerjunction", - "ta3_powerline", - "ta3_powerpole", - "ta3_powerpole4", - "ta3_powerpole2", - "ta3_powerswitch", - "ta3_powerswitchsmall", - "ta3_powerswitchbox", - "ta3_tinygenerator", - "ta3_akkublock", - "ta3_powerterminal", - "ta3_motor", - "", - "ta3_furnacefirebox", - "ta3_furnace", - "ta3_booster", - "", - "ta3_tank", - "ta3_pump", - "ta3_filler", - "ta3_pipe", - "ta3_pipe_wall_entry", - "ta3_valve", - "techage_ta3", - "ta3_oilexplorer", - "ta3_drillbox", - "ta3_pumpjack", - "ta3_drillbit", - "oiltank", - "", - "", - "", - "", - "", - "techage_ta31", - "", - "reboiler", - "ta3_logic", - "ta3_button", - "ta3_command_converter", - "ta3_flipflop", - "ta3_logic", - "ta3_repeater", - "ta3_sequencer", - "ta3_timer", - "ta3_terminal", - "ta3_colorlamp", - "ta3_doorblock", - "ta3_doorcontroller", - "ta3_doorcontroller", - "ta3_soundblock", - "ta3_mesecons_converter", - "ta3_nodedetector", - "ta3_detector", - "ta3_cartdetector", - "ta3_nodedetector", - "ta3_playerdetector", - "ta3_lightdetector", - "ta3_grinder", - "ta3_pusher", - "ta3_distributor", - "ta3_autocrafter", - "ta3_electronicfab", - "ta3_quarry", - "ta3_gravelsieve", - "ta3_gravelrinser", - "ta3_grinder", - "ta3_injector", - "", - "ta3_end_wrench", - "ta3_programmer", - "ta3_trowel", - "ta3_drill_pipe_wrench", - "ta3_screwdriver", - "techage:assembly_tool", - }, - plans = { - "", - "coalpowerstation", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_furnace", - "", - "", - "", - "ta3_tank", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_loading", - "", - "", - "", - "ta3_distiller", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta3_pt-BR.lua b/techage/doc/manual_ta3_pt-BR.lua deleted file mode 100644 index ae26512..0000000 --- a/techage/doc/manual_ta3_pt-BR.lua +++ /dev/null @@ -1,942 +0,0 @@ -return { - titles = { - "1,TA3: Era do Petróleo", - "2,Usina Termelétrica a Carvão / Usina Termelétrica a Óleo", - "3,TA3 Fornalha(firebox) da estação de energia", - "3,TA3 Queimador de Óleo da Usina de Energia", - "3,TA3 Base / Topo da Caldeira", - "3,TA3 Turbina", - "3,TA3 Gerador", - "3,TA3 Cooler", - "2,Corrente elétrica", - "3,Importância dos sistemas de armazenamento", - "3,TA3 Cabo Elétrico", - "3,TA Caixa de Junção Elétrica", - "3,TA Linha de Energia", - "3,TA Poste de Energia", - "3,TA Topo do Poste de Energia", - "3,TA Topo do Poste de Energia 2", - "3,TA Interruptor de Energia", - "3,TA Interruptor de Energia Pequeno", - "3,TA Caixa de Interruptor de Energia", - "3,TA3 Pequeno Gerador de Energia", - "3,TA3 Bloco Acumulador", - "3,TA3 Terminal de Energia", - "3,TA3 Motor Elétrico", - "2,TA3 Forno Industrial", - "3,TA3 Forno - Queimador de Óleo", - "3,TA3 Forno - Parte Superior", - "3,TA3 Reforço", - "2,Líquidos", - "3,TA3 Tanque", - "3,TA3 Bomba", - "3,TA Liquid Filler", - "3,TA4 Tubos(pipe)", - "3,TA3 Tubos de parede (entre-blocos)", - "3,TA Válvula", - "2,Produção de Óleo", - "3,TA3 Explorador de petróleo", - "3,TA3 Caixa de perfuração de petróleo", - "3,TA3 Bomba de petróleo", - "3,TA3 Haste de perfuração", - "3,Tanque de petróleo", - "2,Transporte de Petróleo", - "3,Transporte de Petróleo por Vagões Tanque", - "3,Oil transportation with barrels over Minecarts", - "3,Transporte de Petróleo com Barris por Minecarts", - "3,Carrinho-tanque", - "3,Carrinho-baú", - "2,Processamento de Petróleo", - "3,Torre de Destilação", - "4,Refervedor(Reboiler)", - "2,Blocos Lógicos / de Comutação", - "3,TA3 Botão / Interruptor", - "3,TA3 Conversor de Comandos", - "3,TA3 Flip-Flop", - "3,Bloco Lógico TA3", - "3,TA3 Repetidor", - "3,TA3 Sequenciador", - "3,TA3 Temporizador", - "3,TA3 Terminal", - "3,Lâmpada Colorida TechAge", - "3,Blocos de Porta/Portão", - "3,TA3 Controlador de Porta", - "3,Controlador de Porta TA3 II", - "3,TA3 Bloco de Som", - "3,TA3 Conversor Mesecons", - "2,Detectores", - "3,TA3 Detector", - "3,TA3 Cart Detector", - "3,TA3 Node Detector", - "3,TA3 Detector de jogador(Player detector)", - "3,TA3 Detector de luz(Light detector)", - "2,Máquinas TA3", - "3,TA3 Pusher", - "3,TA3 Distributor", - "3,TA3 Autocrafter", - "3,TA3 Electronic Fab", - "3,TA3 Quarry", - "3,TA3 Gravel Sieve", - "3,TA3 Gravel Rinser", - "3,TA3 Grinder", - "3,TA3 Injetor", - "2,Ferramentas", - "3,Techage Info Tool", - "3,TechAge Programmer (Programador)", - "3,TechAge Trowel / Trowel", - "3,TA3 chave de cano", - "3,Techage Screwdriver", - "3,TechAge Assembly Tool", - }, - texts = { - "Na TA3\\, é importante substituir as máquinas a vapor por máquinas mais potentes movidas a eletricidade.\n".. - "\n".. - "Para fazer isso\\, é necessário construir usinas termelétricas a carvão e geradores. Logo você perceberá que suas necessidades de eletricidade só podem ser atendidas com usinas movidas a óleo. Portanto\\, você parte em busca de petróleo. Torres de perfuração e bombas de petróleo ajudam a extrair o óleo. Ferrovias são usadas para transportar o óleo até as usinas.\n".. - "\n".. - "A era industrial está em seu auge.\n".. - "\n".. - "\n".. - "\n", - "A usina termelétrica a carvão é composta por vários blocos e deve ser montada conforme mostrado no plano à direita. São necessários os blocos Fornalha(Firebox) TA3\\, Topo da Caldeira TA3\\, Base da Caldeira TA3\\, Turbina TA3\\, Gerador TA3 e Resfriador TA3.\n".. - "\n".. - "A caldeira deve ser preenchida com água. Encha até 10 baldes de água na caldeira.\n".. - "A caixa de fogo deve ser preenchida com carvão ou carvão vegetal.\n".. - "Quando a água estiver quente\\, o gerador pode ser iniciado.\n".. - "\n".. - "Alternativamente\\, a usina pode ser equipada com um queimador de óleo e operada com óleo. O óleo pode ser reabastecido usando uma bomba e um tubo de óleo.\n".. - "\n".. - "A usina fornece uma saída de 80 ku.\n".. - "\n".. - "\n".. - "\n", - "Parte da usina de energia.\n".. - "A fornalha deve ser preenchida com carvão ou carvão vegetal. O tempo de queima depende da potência solicitada pela usina. Carvão queima por 20s e carvão vegetal por 60s em carga total. Proporcionalmente mais tempo em carga parcial (50% de carga = dobro do tempo).\n".. - "\n".. - "\n".. - "\n", - "Parte da usina de energia.\n".. - "\n".. - "O queimador de óleo pode ser preenchido com óleo cru\\, óleo combustível\\, nafta ou gasolina. O tempo de queima depende da potência solicitada pela usina. Em carga total\\, óleo cru queima por 15s\\, óleo combustível por 20s\\, nafta por 22s e gasolina por 25s.\n".. - "\n".. - "Proporcionalmente mais tempo em carga parcial (50% de carga = dobro do tempo).\n".. - "\n".. - "O queimador de óleo pode armazenar apenas 50 unidades de combustível. Recomenda-se\\, portanto\\, um tanque de óleo adicional e uma bomba de óleo.\n".. - "\n".. - "\n".. - "\n", - "Parte da usina de energia. Deve ser preenchida com água. Se não houver mais água ou a temperatura diminuir muito\\, a usina desliga.\n".. - "\n".. - "O consumo de água da caldeira TA3 é muito menor do que o da máquina a vapor devido ao circuito de vapor fechado.\n".. - "Com a máquina a vapor\\, parte da água é perdida como vapor a cada curso do pistão.\n".. - "\n".. - "\n".. - "\n", - "A turbina faz parte da usina de energia. Deve ser colocada ao lado do gerador e conectada à caldeira e ao resfriador por meio de tubos de vapor\\, conforme mostrado no plano.\n".. - "\n".. - "\n".. - "\n", - "O gerador é usado para gerar eletricidade. Deve ser conectado às máquinas por meio de cabos de energia e caixas de junção.\n".. - "\n".. - "\n".. - "\n", - "Usado para resfriar o vapor quente da turbina. Deve ser conectado à caldeira e à turbina por meio de tubos de vapor\\, conforme mostrado no plano.\n".. - "\n".. - "\n".. - "\n", - "Em TA3 (e TA4)\\, as máquinas são alimentadas por eletricidade. Para isso\\, máquinas\\, sistemas de armazenamento e geradores devem ser conectados com cabos de energia.\n".. - "TA3 possui 2 tipos de cabos de energia:\n".. - "\n".. - " - Cabos isolados (cabos de energia TA) para instalação local no chão ou em edifícios. Esses cabos podem ser ocultos na parede ou no chão (podem ser \"revestidos\" com a colher de pedreiro).\n".. - " - Linhas aéreas (linha de energia TA) para cabeamento externo em longas distâncias. Esses cabos são protegidos e não podem ser removidos por outros jogadores.\n".. - "\n".. - "Vários consumidores\\, sistemas de armazenamento e geradores podem ser operados juntos em uma rede de energia. Redes podem ser configuradas com a ajuda das caixas de junção.\n".. - "Se houver pouca eletricidade fornecida\\, os consumidores ficam sem energia.\n".. - "Nesse contexto\\, também é importante entender a funcionalidade dos blocos de Forceload\\, porque os geradores\\, por exemplo\\, só fornecem eletricidade quando o bloco de mapa correspondente está carregado. Isso pode ser imposto com um bloco de Forceload.\n".. - "\n".. - "Em TA4\\, também existe um cabo para o sistema solar.\n".. - "\n".. - "\n".. - "\n", - "Os sistemas de armazenamento na rede elétrica desempenham duas funções:\n".. - "\n".. - " - Lidar com picos de demanda: Todos os geradores sempre fornecem exatamente a quantidade de energia necessária. No entanto\\, se os consumidores forem ligados/desligados ou houver flutuações na demanda por outros motivos\\, os consumidores podem falhar por um curto período. Para evitar isso\\, deve sempre haver pelo menos um bloco de bateria em cada rede. Isso serve como um buffer e compensa essas flutuações na faixa de segundos.\n".. - " - Armazenar energia regenerativa: Solar e eólica não estão disponíveis 24 horas por dia. Para que o fornecimento de energia não falhe quando não há produção de eletricidade\\, um ou mais sistemas de armazenamento devem ser instalados na rede. Alternativamente\\, as lacunas também podem ser preenchidas com eletricidade de óleo/carvão.\n".. - "\n".. - "Um sistema de armazenamento indica sua capacidade em kud\\, ou seja\\, ku por dia. Por exemplo\\, um sistema de armazenamento com 100 kud fornece 100 ku por um dia de jogo\\, ou 10 ku por 10 dias de jogo.\n".. - "\n".. - "Todas as fontes de energia TA3/TA4 têm características de carregamento ajustáveis. Por padrão\\, isso é configurado para \"80% - 100%\". Isso significa que\\, quando o sistema de armazenamento estiver 80% cheio\\, a saída é reduzida cada vez mais até desligar completamente em 100%. Se eletricidade for necessária na rede\\, nunca se atingirá 100%\\, pois a potência do gerador em algum momento caiu para a demanda de eletricidade na rede e o sistema de armazenamento não está mais sendo carregado\\, mas apenas os consumidores estão sendo atendidos.\n".. - "\n".. - "Isso tem várias vantagens:\n".. - "\n".. - " - As características de carregamento são ajustáveis. Isso significa\\, por exemplo\\, que as fontes de energia de óleo/carvão podem ser reduzidas em 60% e as fontes de energia renovável apenas em 80%. Isso significa que o óleo/carvão só é queimado se não houver energia renovável suficiente disponível.\n".. - " - Várias fontes de energia podem ser operadas em paralelo e são carregadas quase uniformemente\\, porque todas as fontes de energia trabalham\\, por exemplo\\, até 80% da capacidade de carga do sistema de armazenamento em sua capacidade total e depois reduzem sua capacidade ao mesmo tempo.\n".. - " - Todos os sistemas de armazenamento em uma rede formam um grande buffer. A capacidade de carga e o nível de preenchimento de todo o sistema de armazenamento podem sempre ser lidos em percentagem em todos os sistemas de armazenamento\\, mas também no terminal de eletricidade.\n".. - "\n".. - " \n".. - "\n", - "Para fiação local no chão ou em construções.\n".. - "Ramos podem ser realizados usando caixas de junção. O comprimento máximo do cabo entre máquinas ou caixas de junção é de 1000 m. Um máximo de 1000 nós pode ser conectado em uma rede elétrica. Todos os blocos com conexão elétrica\\, incluindo caixas de junção\\, contam como nós.\n".. - "\n".. - "Como os cabos elétricos não são automaticamente protegidos\\, as linhas aéreas (TA power line) são recomendadas para distâncias mais longas.\n".. - "\n".. - "Os cabos elétricos podem ser rebocados com a colher de alvenaria para que fiquem ocultos na parede ou no chão. Todos os blocos de pedra\\, argila e outros blocos sem \"inteligência\" podem ser usados como material de reboco. A sujeira não funciona porque pode ser convertida em grama ou algo semelhante\\, o que destruiria a linha.\n".. - "\n".. - "Para rebocar\\, o cabo deve ser clicado com a colher de alvenaria. O material com o qual o cabo deve ser rebocado deve estar no canto mais à esquerda do inventário do jogador.\n".. - "Os cabos podem ser tornados visíveis novamente clicando no bloco com a colher de alvenaria.\n".. - "\n".. - "Além dos cabos\\, a caixa de junção TA e a caixa de interruptores de energia TA também podem ser rebocadas.\n".. - "\n".. - "\n".. - "\n", - "Com a caixa de junção\\, a eletricidade pode ser distribuída em até 6 direções. Caixas de junção também podem ser rebocadas (ocultas) com uma colher de alvenaria e tornadas visíveis novamente.\n".. - "\n".. - "\n".. - "\n", - "Com a linha de energia TA e os postes de eletricidade\\, é possível realizar linhas aéreas razoavelmente realistas. As cabeças dos postes também servem para proteger a linha de energia (proteção). Um poste deve ser colocado a cada 16 m ou menos. A proteção se aplica apenas à linha de energia e aos postes\\; no entanto\\, todos os outros blocos nesta área não estão protegidos.\n".. - "\n".. - "\n".. - "\n", - "Usado para construir postes de eletricidade. É protegido contra destruição pela cabeça do poste de eletricidade e só pode ser removido pelo proprietário.\n".. - "\n".. - "\n".. - "\n", - "Possui até quatro braços e permite assim a distribuição de eletricidade em até 6 direções.\n".. - "A cabeça do poste de eletricidade protege as linhas de energia e os postes dentro de um raio de 8 m.\n".. - "\n".. - "\n".. - "\n", - "Esta cabeça de poste de eletricidade tem dois braços fixos e é usada para as linhas aéreas. No entanto\\, também pode transmitir corrente para baixo e para cima.\n".. - "A cabeça do poste de eletricidade protege as linhas de energia e os postes dentro de um raio de 8 m.\n".. - "\n".. - "\n".. - "\n", - "O interruptor pode ser usado para ligar e desligar a energia. Para isso\\, o interruptor deve ser colocado em uma caixa de interruptor de energia. A caixa de interruptor de energia deve ser conectada ao cabo de energia em ambos os lados.\n".. - "\n".. - "\n".. - "\n", - "O interruptor pode ser usado para ligar e desligar a energia. Para isso\\, o interruptor deve ser colocado em uma caixa de interruptor de energia. A caixa de interruptor de energia deve ser conectada ao cabo de energia em ambos os lados.\n".. - "\n".. - "\n".. - "\n", - "Veja o interruptor de energia TA.\n".. - "\n".. - "\n".. - "\n", - "O pequeno gerador de energia funciona com gasolina e pode ser usado para consumidores pequenos com até 12 ku. A gasolina queima por 150s em carga total. Correspondentemente mais tempo em carga parcial (50% de carga = tempo duplo).\n".. - "\n".. - "O gerador de energia só pode armazenar 50 unidades de gasolina. Portanto\\, é aconselhável um tanque adicional e uma bomba.\n".. - "\n".. - "\n".. - "\n", - "O bloco acumulador (bateria recarregável) é usado para armazenar energia excedente e fornece automaticamente energia em caso de queda de energia (se disponível).\n".. - "Vários blocos de acumulador juntos formam um sistema de armazenamento de energia TA3. Cada bloco de acumulador possui um display para o estado de carga e para a carga armazenada.\n".. - "Os valores para toda a rede são sempre exibidos aqui. A carga armazenada é exibida em \"kud\" ou \"ku-dias\" (análogo a kWh). Assim\\, 5 kud correspondem\\, por exemplo\\, a 5 ku para um dia de jogo (20 minutos) ou 1 ku para 5 dias de jogo.\n".. - "\n".. - "Um bloco de acumulador tem 3\\,33 kud.\n".. - "\n".. - "\n".. - "\n", - "O terminal de energia deve ser conectado à rede elétrica. Ele exibe dados da rede elétrica.\n".. - "\n".. - "As informações mais importantes são exibidas na metade superior:\n".. - "\n".. - " - potência do gerador atual/máxima\n".. - " - consumo de energia atual de todos os consumidores\n".. - " - corrente de carga atual dentro/fora do sistema de armazenamento\n".. - " - Estado de carga atual do sistema de armazenamento em percentual\n".. - "\n".. - "O número de blocos da rede é exibido na metade inferior.\n".. - "\n".. - "Dados adicionais sobre os geradores e sistemas de armazenamento podem ser consultados através da guia \"console\".\n".. - "\n".. - "\n".. - "\n", - "O Motor Elétrico TA3 é necessário para operar as máquinas TA2 através da rede elétrica. O Motor Elétrico TA3 converte eletricidade em potência de eixo.\n".. - "Se o motor elétrico não for alimentado com energia suficiente\\, ele entra em um estado de falha e deve ser reativado com um clique direito.\n".. - "\n".. - "O motor elétrico consome no máximo 40 ku de eletricidade e fornece do outro lado no máximo 39 ku como potência de eixo. Portanto\\, ele consome um ku para a conversão.\n".. - "\n".. - "\n".. - "\n", - "O forno industrial TA3 serve como complemento aos fornos normais. Isso significa que todos os produtos podem ser fabricados com receitas de \"cozimento\"\\, mesmo em um forno industrial. No entanto\\, também existem receitas especiais que só podem ser feitas em um forno industrial.\n".. - "O forno industrial possui seu próprio menu para seleção de receitas. Dependendo dos produtos no inventário do forno industrial à esquerda\\, o produto de saída pode ser selecionado à direita.\n".. - "\n".. - "O forno industrial requer eletricidade (para o impulsionador) e óleo combustível/gasolina para o queimador. O forno industrial deve ser montado conforme mostrado no plano à direita.\n".. - "\n".. - "Veja também o aquecedor TA4.\n".. - "\n".. - "\n".. - "\n", - "Parte do forno industrial TA3.\n".. - "\n".. - "O queimador de óleo pode ser operado com óleo bruto\\, óleo combustível\\, nafta ou gasolina. O tempo de queima é de 64 s para óleo bruto\\, 80 s para óleo combustível\\, 90 s para nafta e 100 s para gasolina.\n".. - "\n".. - "O queimador de óleo pode armazenar apenas 50 unidades de combustível. Portanto\\, é aconselhável um tanque adicional e uma bomba.\n".. - "\n".. - "\n".. - "\n", - "Faz parte do forno industrial TA3. Consulte o forno industrial TA3.\n".. - "\n".. - "\n".. - "\n", - "Faz parte do forno industrial TA3. Consulte o forno industrial TA3.\n".. - "\n".. - "\n".. - "\n", - "Líquidos como água ou óleo só podem ser bombeados através de tubulações especiais e armazenados em tanques. Assim como com a água\\, existem recipientes (latas\\, barris) nos quais o líquido pode ser armazenado e transportado.\n".. - "\n".. - "Também é possível conectar vários tanques usando as tubulações amarelas e conectores. No entanto\\, os tanques devem ter o mesmo conteúdo e sempre deve haver pelo menos um tubo amarelo entre o tanque\\, a bomba e o tubo distribuidor.\n".. - "\n".. - "Por exemplo\\, não é possível conectar dois tanques diretamente a um tubo distribuidor.\n".. - "\n".. - "O enchimento de líquidos é usado para transferir líquidos de recipientes para tanques. O plano mostra como latas ou barris com líquidos são empurrados para um enchimento de líquidos através de empurradores. O recipiente é esvaziado no enchimento de líquidos e o líquido é conduzido para baixo no tanque.\n".. - "\n".. - "O enchimento de líquidos também pode ser colocado sob um tanque para esvaziar o tanque.\n".. - "\n".. - "\n".. - "\n", - "Líquidos podem ser armazenados em um tanque. Um tanque pode ser preenchido ou esvaziado usando uma bomba. Para fazer isso\\, a bomba deve ser conectada ao tanque por meio de um tubo (tubos amarelos).\n".. - "\n".. - "Um tanque também pode ser preenchido ou esvaziado manualmente clicando no tanque com um recipiente de líquido cheio ou vazio (barril\\, galão). Deve-se observar que os barris só podem ser completamente preenchidos ou esvaziados. Se\\, por exemplo\\, houver menos de 10 unidades no tanque\\, esse restante deve ser removido com galões ou esvaziado com uma bomba.\n".. - "\n".. - "Um tanque TA3 pode armazenar 1000 unidades ou 100 barris de líquido.\n".. - "\n".. - "\n".. - "\n", - "A bomba pode ser usada para bombear líquidos de tanques ou recipientes para outros tanques ou recipientes. A direção da bomba (seta) deve ser observada. As linhas amarelas e os conectores também permitem organizar vários tanques em cada lado da bomba. No entanto\\, os tanques devem ter o mesmo conteúdo.\n".. - "\n".. - "A bomba TA3 bombeia 4 unidades de líquido a cada dois segundos.\n".. - "\n".. - "Observação 1: A bomba não deve ser colocada diretamente ao lado do tanque. Deve sempre haver pelo menos um pedaço de tubo amarelo entre eles.\n".. - "\n".. - "\n".. - "\n", - "O liquid filler é usado para transferir líquidos entre recipientes e tanques.\n".. - "\n".. - " - Se o liquid filler for colocado sob um tanque e barris vazios forem colocados no liquid filler com um empurrador ou manualmente\\, o conteúdo do tanque é transferido para os barris e os barris podem ser removidos da saída\n".. - " - Se o liquid filler for colocado em cima de um tanque e se recipientes cheios forem colocados no liquid filler com um empurrador ou manualmente\\, o conteúdo é transferido para o tanque e os recipientes vazios podem ser removidos no lado de saída\n".. - "\n".. - "Deve-se observar que os barris só podem ser completamente cheios ou esvaziados. Se\\, por exemplo\\, houver menos de 10 unidades no tanque\\, este restante deve ser removido com recipientes ou bombeado vazio.\n".. - "\n".. - "\n".. - "\n", - "Os tubos amarelos são usados para a transmissão de gás e líquidos.\n".. - "O comprimento máximo do tubo é 100m.\n".. - "\n".. - "\n".. - "\n", - "Os blocos servem como aberturas de parede para os tubos\\, para que não fiquem buracos abertos.\n".. - "\n".. - "\n".. - "\n", - "Existe uma válvula para os tubos amarelos\\, que pode ser aberta e fechada com um clique do mouse.\n".. - "A válvula também pode ser controlada por comandos ligar/desligar.\n".. - "\n".. - "\n".. - "\n", - "Para alimentar seus geradores e fogões com óleo\\, você deve primeiro procurar óleo e construir uma torre de perfuração para extrair o óleo.\n".. - "Para isso\\, são utilizados o explorador de óleo TA3\\, a caixa de perfuração de óleo TA3 e o macaco de bomba de óleo TA3.\n".. - "\n".. - "\n".. - "\n", - "Você pode procurar petróleo com o explorador de petróleo. Para fazer isso\\, coloque o bloco no chão e clique com o botão direito para iniciar a busca. O explorador de petróleo pode ser usado tanto acima quanto abaixo do solo em todas as profundidades.\n".. - "A saída do chat mostra a profundidade até a qual o petróleo foi procurado e quanto petróleo foi encontrado.\n".. - "Você pode clicar várias vezes no bloco para procurar petróleo em áreas mais profundas. Os campos de petróleo variam em tamanho de 4.000 a 20.000 itens.\n".. - "\n".. - "Se a busca não der certo\\, você deve mover o bloco aproximadamente 16 m para frente.\n".. - "O explorador de petróleo sempre procura petróleo em todo o bloco do mapa e abaixo\\, no qual foi colocado. Uma nova busca no mesmo bloco do mapa (campo 16x16) portanto\\, não faz sentido.\n".. - "\n".. - "Se o petróleo for encontrado\\, a localização para a torre de perfuração é exibida. Você precisa erguer a torre de perfuração dentro da área mostrada\\, é melhor marcar o local com uma placa e proteger toda a área contra jogadores estrangeiros.\n".. - "\n".. - "Não desista de procurar petróleo muito rapidamente. Se tiver azar\\, pode levar muito tempo para encontrar um poço de petróleo.\n".. - "Também não faz sentido procurar em uma área que outro jogador já tenha procurado. A chance de encontrar petróleo é a mesma para todos os jogadores.\n".. - "\n".. - "O explorador de petróleo pode ser sempre usado para procurar petróleo.\n".. - "\n".. - "\n".. - "\n", - "A caixa de perfuração de petróleo deve ser colocada na posição indicada pelo explorador de petróleo. Perfurar petróleo em outro lugar não tem sentido.\n".. - "Se o botão na caixa de perfuração de petróleo for clicado\\, a torre de perfuração será erguida acima da caixa. Isso leva alguns segundos.\n".. - "A caixa de perfuração de petróleo tem 4 lados\\, em IN o tubo de perfuração deve ser entregue via pusher e em OUT o material de perfuração deve ser removido. A caixa de perfuração de petróleo deve ser alimentada com eletricidade por um dos outros dois lados.\n".. - "\n".. - "A caixa de perfuração de petróleo perfura até o campo de petróleo (1 metro em 16 s) e requer 16 ku de eletricidade.\n".. - "Depois que o campo de petróleo for alcançado\\, a torre de perfuração pode ser desmontada e a caixa removida.\n".. - "\n".. - "\n".. - "\n", - "A bomba de petróleo (pumpjack) deve ser colocada no lugar da caixa de perfuração de petróleo. A bomba de petróleo também requer eletricidade (16 ku) e fornece uma unidade de petróleo a cada 8 segundos. O petróleo deve ser coletado em um tanque. Para fazer isso\\, a bomba de petróleo deve ser conectada ao tanque por meio de tubos amarelos.\n".. - "Depois que todo o petróleo for bombeado para fora\\, a bomba de petróleo também pode ser removida.\n".. - "\n".. - "\n".. - "\n", - "A haste de perfuração é necessária para perfurar. Tantos itens de haste de perfuração são necessários quanto a profundidade especificada para o campo de petróleo. A haste de perfuração é inútil após a perfuração\\, mas também não pode ser desmontada e permanece no solo. No entanto\\, há uma ferramenta para remover os blocos de haste de perfuração (-> Ferramentas -> TA3 Alicate de haste de perfuração(drill pipe pliers)).\n".. - "\n".. - "\n".. - "\n", - "O tanque de petróleo é a versão grande do tanque TA3 (ver líquidos -> Tanque TA3).\n".. - "\n".. - "O tanque grande pode armazenar 4000 unidades de petróleo\\, mas também qualquer outro tipo de líquido.\n".. - "\n".. - "\n".. - "\n", - "", - "Os vagões tanque podem ser usados para transportar petróleo do poço de petróleo para a usina de processamento de petróleo. Um vagão tanque pode ser preenchido ou esvaziado diretamente usando bombas. Em ambos os casos\\, os tubos amarelos devem ser conectados ao vagão tanque de cima.\n".. - "\n".. - "Os seguintes passos são necessários:\n".. - "\n".. - " - Coloque o vagão tanque na frente do bloco para-choque da ferrovia. O bloco para-choque ainda não deve estar programado com um tempo para que o vagão tanque não comece automaticamente.\n".. - " - Conecte o vagão tanque à bomba usando tubos amarelos.\n".. - " - Ligue a bomba.\n".. - " - Programe o para-choque com um tempo (10 - 20s).\n".. - "\n".. - "Essa sequência deve ser observada em ambos os lados (encher / esvaziar).\n".. - "\n".. - "\n".. - "\n", - "Canisters and barrels can be loaded into the Minecarts. To do this\\, the oil must first be transferred to barrels. The oil barrels can be pushed directly into the Minecart with a pusher and tubes (see map). The empty barrels\\, which come back from the unloading station by Minecart\\, can be unloaded using a hopper\\, which is placed under the rail at the stop.\n".. - "\n".. - "It is not possible with the hopper to both *unload the empty barrels and load the full barrels at a stop*. The hopper immediately unloads the full barrels. It is therefore advisable to set up 2 stations on the loading and unloading side and then program the Minecart accordingly using a recording run.\n".. - "\n".. - "The plan shows how the oil can be pumped into a tank and filled into barrels via a liquid filler and loaded into Minecarts.\n".. - "\n".. - "For the Minecarts to start again automatically\\, the bumper blocks must be configured with the station name and waiting time. 5 s are sufficient for unloading. However\\, since the pushers always go into standby for several seconds when there is no Minecart\\, a time of 15 or more seconds must be entered for loading.\n".. - "\n".. - "\n".. - "\n", - "As latas e barris podem ser carregados nos Minecarts. Para fazer isso\\, o petróleo deve primeiro ser transferido para os barris. Os barris de petróleo podem ser empurrados diretamente para dentro do Minecart com um empurrador e tubos (veja o mapa). Os barris vazios\\, que retornam da estação de descarga por Minecart\\, podem ser descarregados usando um funil\\, que é colocado sob os trilhos na parada.\n".. - "\n".. - "Não é possível com o funil *descarregar os barris vazios e carregar os barris cheios em uma parada*. O funil descarrega imediatamente os barris cheios. Portanto\\, é aconselhável configurar 2 estações no lado de carregamento e descarregamento e\\, em seguida\\, programar o Minecart de acordo com uma corrida de gravação.\n".. - "\n".. - "O plano mostra como o petróleo pode ser bombeado para um tanque\\, preenchido em barris via um dispositivo de enchimento de líquidos e carregado em Minecarts.\n".. - "\n".. - "Para que os Minecarts reiniciem automaticamente\\, os blocos para-choque devem ser configurados com o nome da estação e o tempo de espera. 5 segundos são suficientes para descarregar. No entanto\\, como os empurradores sempre entram em espera por vários segundos quando não há Minecart\\, um tempo de 15 segundos ou mais deve ser inserido para carregar.\n".. - "\n".. - "\n".. - "\n", - "O carrinho-tanque é usado para transportar líquidos. Assim como os tanques\\, ele pode ser cheio com bombas ou esvaziado. Em ambos os casos\\, o tubo amarelo deve ser conectado ao caminhão-tanque de cima.\n".. - "\n".. - "Cabem 200 unidades no caminhão-tanque.\n".. - "\n".. - "\n".. - "\n", - "O carrinho-baú é usado para transportar itens. Assim como os baús\\, ele pode ser cheio ou esvaziado usando um empurrador.\n".. - "\n".. - "Cabem 4 pilhas no carrinho de baú.\n".. - "\n".. - "\n".. - "\n", - "O petróleo é uma mistura de substâncias e consiste em muitos componentes. O petróleo pode ser decomposto em seus principais componentes\\, como betume\\, óleo combustível\\, nafta\\, gasolina e gás propano\\, por meio de uma torre de destilação.\n".. - "O processamento adicional para produtos finais ocorre no reator químico.\n".. - "\n".. - "\n".. - "\n", - "A torre de destilação deve ser montada como no plano no canto superior direito.\n".. - "O betume é drenado pelo bloco de base. A saída está na parte de trás do bloco de base (observe a direção da seta).\n".. - "Os blocos \"torre de destilação\" com os números: 1\\, 2\\, 3\\, 2\\, 3\\, 2\\, 3\\, 4 são colocados sobre este bloco base.\n".. - "Óleo combustível\\, nafta e gasolina são drenados das aberturas de baixo para cima. O gás propano é capturado no topo.\n".. - "Todas as aberturas na torre devem ser conectadas a tanques.\n".. - "O reboiler deve ser conectado ao bloco \"torre de destilação 1\".\n".. - "\n".. - "O reboiler precisa de eletricidade (não mostrado no plano)!\n".. - "\n".. - "\n".. - "\n", - "O reboiler aquece o petróleo para aproximadamente 400 °C. Ele evapora em grande parte e é alimentado na torre de destilação para resfriamento.\n".. - "\n".. - "O reboiler requer 14 unidades de eletricidade e produz uma unidade de betume\\, óleo combustível\\, nafta\\, gasolina e propano a cada 16s.\n".. - "Para isso\\, o reboiler deve ser alimentado com petróleo por meio de uma bomba.\n".. - "\n".. - "\n".. - "\n", - "Além dos tubos para transporte de mercadorias\\, bem como os tubos de gás e energia\\, há também um nível de comunicação sem fio através do qual os blocos podem trocar dados entre si. Não é necessário desenhar linhas para isso\\, a conexão entre transmissor e receptor é feita apenas através do número do bloco.\n".. - "\n".. - "*Info:* Um número de bloco é um número único gerado pelo Techage quando muitos blocos do Techage são colocados. O número do bloco é usado para endereçamento durante a comunicação entre controladores e máquinas Techage. Todos os blocos que podem participar dessa comunicação mostram o número do bloco como texto de informações se você fixar o bloco com o cursor do mouse.\n".. - "\n".. - "Quais comandos um bloco suporta podem ser lidos e exibidos com a TechAge Info Tool (chave inglesa ou wrench).\n".. - "Os comandos mais simples suportados por quase todos os blocos são:\n".. - "\n".. - " - 'on' - para ligar o bloco / máquina / lâmpada\n".. - " - 'off' - para desligar o bloco / máquina / lâmpada\n".. - "\n".. - "Com a ajuda do Terminal TA3\\, esses comandos podem ser testados muito facilmente. Suponha que uma lâmpada de sinalização seja o número 123.\n".. - "Então com:\n".. - "\n".. - " cmd 123 on\n".. - "\n".. - "a lâmpada pode ser ligada e com:\n".. - "\n".. - " cmd 123 off\n".. - "\n".. - "a lâmpada pode ser desligada novamente. Esses comandos devem ser inseridos no campo de entrada do terminal TA3.\n".. - "\n".. - "Comandos como 'on' e 'off' são enviados ao destinatário sem que uma resposta seja enviada de volta. Portanto\\, esses comandos podem ser enviados para vários destinatários ao mesmo tempo\\, por exemplo\\, com um botão de pressão / interruptor\\, se vários números forem inseridos no campo de entrada.\n".. - "\n".. - "Um comando como 'state' solicita o status de um bloco. O bloco então envia seu status de volta. Esse tipo de comando confirmado só pode ser enviado para um destinatário de cada vez.\n".. - "Esse comando também pode ser testado com o terminal TA3 em um empurrador\\, por exemplo:\n".. - "\n".. - " cmd 123 state\n".. - "\n".. - "As respostas possíveis do empurrador são:\n".. - "\n".. - " - 'running' -> Estou funcionando\n".. - " - 'stopped' -> desligado\n".. - " - 'standby' -> nada a fazer porque o inventário da fonte está vazio\n".. - " - 'blocked' -> não pode fazer nada porque o inventário de destino está cheio\n".. - "\n".. - "Esse status e outras informações também são exibidos quando a chave inglesa(wrench) é clicada no bloco.\n".. - "\n".. - "\n".. - "\n", - "O botão/interruptor envia comandos 'on' / 'off' para os blocos que foram configurados através dos números.\n".. - "O botão/interruptor pode ser configurado como um botão ou um interruptor. Se for configurado como um botão\\, o tempo entre os comandos 'on' e 'off' pode ser definido. Com o modo de operação \"no botão\"\\, apenas um comando 'on' e nenhum comando 'off' é enviado.\n".. - "\n".. - "A caixa de seleção \"público\" pode ser usada para definir se o botão pode ser usado por todos (marcado) ou apenas pelo próprio proprietário (não marcado).\n".. - "\n".. - "Nota: Com o programador\\, os números dos blocos podem ser facilmente coletados e configurados.\n".. - "\n".. - "\n".. - "\n", - "Com o conversor de comandos TA3\\, os comandos 'on' / 'off' podem ser convertidos em outros comandos\\, e o encaminhamento pode ser impedido ou atrasado.\n".. - "Deve-se inserir o número do bloco de destino ou os números dos blocos de destino\\, os comandos a serem enviados e os tempos de atraso em segundos. Se nenhum comando for inserido\\, nada será enviado.\n".. - "\n".. - "Os números também podem ser programados usando o programador Techage(programmer).\n".. - "\n".. - "\n".. - "\n", - "O flip-flop TA3 muda de estado a cada comando 'on' recebido. Os comandos 'off' recebidos são ignorados. Dependendo da alteração de status\\, os comandos 'on' / 'off' são enviados alternadamente. Deve-se inserir o número do bloco de destino ou os números dos blocos de destino. Os números também podem ser programados usando o programador Techage.\n".. - "\n".. - "Por exemplo\\, lâmpadas podem ser ligadas e desligadas com a ajuda de botões.\n".. - "\n".. - "\n".. - "\n", - "O bloco lógico TA3 pode ser programado de forma que um ou mais comandos de entrada estejam vinculados a um comando de saída e sejam enviados. Este bloco pode\\, portanto\\, substituir vários elementos lógicos\\, como AND\\, OR\\, NOT\\, XOR\\, etc.\n".. - "Os comandos de entrada para o bloco lógico são comandos 'ligar' / 'desligar'.\n".. - "Os comandos de entrada são referenciados pelo número\\, por exemplo\\, '1234' para o comando do remetente com o número 1234.\n".. - "O mesmo se aplica aos comandos de saída.\n".. - "\n".. - "Uma regra é estruturada da seguinte forma:\n".. - "\n".. - " = on/off if is true\n".. - "\n".. - "'' é o número do bloco para o qual o comando deve ser enviado.\n".. - "'' é uma expressão booleana onde os números de entrada são avaliados.\n".. - "\n".. - "*Exemplos para a expressão de entrada*\n".. - "\n".. - "Negar sinal (NOT):\n".. - "\n".. - " 1234 == off\n".. - "\n".. - "AND lógico:\n".. - "\n".. - " 1234 == on e 2345 == on\n".. - "\n".. - "OR lógico:\n".. - "\n".. - " 1234 == ligar ou 2345 == ligar\n".. - "\n".. - "Os seguintes operadores são permitidos: 'and' 'or' 'on' 'off' 'me' '==' '~=' '(' ')'\n".. - "\n".. - "Se a expressão for verdadeira\\, um comando é enviado para o bloco com o número ''.\n".. - "Até quatro regras podem ser definidas\\, sendo que todas as regras são sempre verificadas quando um comando é recebido.\n".. - "O tempo interno de processamento para todos os comandos é de 100 ms.\n".. - "\n".. - "Seu próprio número de nó pode ser referenciado usando a palavra-chave 'me'. Isso permite que o bloco envie a si mesmo um comando (função flip-flop).\n".. - "\n".. - "O tempo de bloqueio define uma pausa após um comando\\, durante a qual o bloco lógico não aceita mais comandos externos. Comandos recebidos durante o período de bloqueio são descartados. O tempo de bloqueio pode ser definido em segundos.\n".. - "\n".. - "\n".. - "\n", - "O repetidor envia o sinal recebido para todos os números configurados.\n".. - "Isso pode fazer sentido\\, por exemplo\\, se você quiser controlar muitos blocos ao mesmo tempo. O repetidor pode ser configurado com o programador\\, o que não é possível com todos os blocos.\n".. - "\n".. - "\n".. - "\n", - "O sequenciador pode enviar uma série de comandos 'on' / 'off'\\, em que o intervalo entre os comandos deve ser especificado em segundos. Você pode usá-lo para fazer uma lâmpada piscar\\, por exemplo.\n".. - "Até 8 comandos podem ser configurados\\, cada um com número de bloco de destino e aguardando o próximo comando.\n".. - "O sequenciador repete os comandos indefinidamente quando \"Run endless\" está ativado.\n".. - "Se nada for selecionado\\, apenas o tempo especificado em segundos é aguardado.\n".. - "\n".. - "\n".. - "\n", - "O temporizador pode enviar comandos controlados pelo tempo. O horário\\, o(s) número(s) de destino e o comando em si podem ser especificados para cada linha de comando. Isso significa que as lâmpadas podem ser ligadas à noite e desligadas pela manhã.\n".. - "\n".. - "\n".. - "\n", - "O terminal é usado principalmente para testar a interface de comando de outros blocos (veja \"Blocos lógicos / de comutação\").\n".. - "Você também pode atribuir comandos a teclas e usar o terminal de maneira produtiva.\n".. - "\n".. - " set \n".. - "\n".. - "Com 'set 1 ON cmd 123 on'\\, por exemplo\\, a tecla do usuário 1 pode ser programada com o comando 'cmd 123 on'. Se a tecla for pressionada\\, o comando é enviado e a resposta é exibida na tela.\n".. - "\n".. - "O terminal possui os seguintes comandos locais:\n".. - "\n".. - " - 'clear' limpa a tela\n".. - " - 'help' exibe uma página de ajuda\n".. - " - 'pub' alterna para o modo público\n".. - " - 'priv' alterna para o modo privado\n".. - "\n".. - "No modo privado\\, o terminal só pode ser usado por jogadores que podem construir neste local\\, ou seja\\, que têm direitos de proteção.\n".. - "\n".. - "No modo público\\, todos os jogadores podem usar as teclas preconfiguradas.\n".. - "\n".. - "\n".. - "\n", - "A lâmpada de sinalização pode ser ligada ou desligada com o comando 'on' / 'off'. Esta lâmpada não precisa de eletricidade e pode ser colorida com a ferramenta de aerografia do mod \"Dyes Unificados\" e via comandos Lua/Beduino.\n".. - "\n".. - "Com o comando de chat '/ta_color'\\, a paleta de cores com os valores para os comandos Lua/Beduino é exibida e com '/ta_send color ' a cor pode ser alterada.\n".. - "\n".. - "\n".. - "\n", - "Com esses blocos\\, você pode criar portas e portões que podem ser abertos por meio de comandos (blocos desaparecem) e fechados novamente. Um controlador de porta é necessário para cada portão ou porta.\n".. - "\n".. - "A aparência dos blocos pode ser ajustada por meio do menu de blocos.\n".. - "Isso permite a criação de portas secretas que só se abrem para certos jogadores (com a ajuda do detector de jogadores).\n".. - "\n".. - "\n".. - "\n", - "O controlador de porta é usado para controlar os blocos de porta/portão TA3. Com o controlador de porta\\, os números dos blocos de porta/portão devem ser inseridos. Se um comando 'on' / 'off' for enviado para o controlador de porta\\, isso abre/fecha a porta ou portão.\n".. - "\n".. - "\n".. - "\n", - "O Controlador de Porta II pode remover e definir todos os tipos de blocos. Para ensinar ao Controlador de Porta II\\, o botão \"Record\" deve ser pressionado. Em seguida\\, todos os blocos que devem fazer parte da porta/portão devem ser clicados. Depois\\, o botão \"Done\" deve ser pressionado. Até 16 blocos podem ser selecionados. Os blocos removidos são salvos no inventário do controlador. A função do controlador pode ser testada manualmente usando os botões \"Remove\" ou \"Set\". Se um comando 'on' /'off' for enviado para o Controlador de Porta II\\, ele remove ou define os blocos também.\n".. - "\n".. - "Com '$send_cmnd(número_do_nó\\, \"exchange\"\\, 2)' blocos individuais podem ser definidos\\, removidos ou substituídos por outros blocos do inventário.\n".. - "\n".. - "Com '$send_cmnd(número_do_nó\\, \"set\"\\, 2)' um bloco do inventário pode ser definido explicitamente\\, desde que o slot do inventário não esteja vazio.\n".. - "\n".. - "Um bloco pode ser removido novamente com '$send_cmnd(número_do_nó\\, \"dig\"\\, 2)' se o slot do inventário estiver vazio.\n".. - "\n".. - "O nome do bloco definido é retornado com '$send_cmnd(número_do_nó\\, \"get\"\\, 2)'.\n".. - "\n".. - "O número do slot do inventário (1 .. 16) deve ser passado como carga útil em todos os três casos.\n".. - "\n".. - "Isso também pode ser usado para simular escadas extensíveis e coisas do tipo.\n".. - "\n".. - "\n".. - "\n", - "Diferentes sons podem ser reproduzidos com o bloco de som. Todos os sons dos Mods Techage\\, Signs Bot\\, Hyperloop\\, Unified Inventory\\, TA4 Jetpack e Minetest Game estão disponíveis.\n".. - "\n".. - "Os sons podem ser selecionados e reproduzidos pelo menu e via comando.\n".. - "\n".. - " - Comando 'on' para reproduzir um som\n".. - " - Comando 'sound <índice>' para selecionar um som via o índice\n".. - " - Comando 'gain ' para ajustar o volume via o valor '' (1 a 5).\n".. - "\n".. - "\n".. - "\n", - "O conversor Mesecons é utilizado para converter comandos de ligar/desligar do Techage em sinais Mesecons e vice-versa.\n".. - "Para fazer isso\\, um ou mais números de nó devem ser inseridos e o conversor deve ser conectado a blocos Mesecons por meio de cabos Mesecons. O conversor Mesecons também pode ser configurado com o programador.\n".. - "O conversor Mesecons aceita até 5 comandos por segundo\\; ele se desativa em cargas mais altas.\n".. - "\n".. - "*Este nó só existe se o mod mesecons estiver ativo!*\n".. - "\n".. - "\n".. - "\n", - "Os detectores escaneiam o ambiente e enviam um comando 'on' quando a busca é reconhecida.\n".. - "\n".. - "\n".. - "\n", - "O detector é um bloco de tubo especial que detecta quando itens passam pelo tubo. Para fazer isso\\, ele deve ser conectado a tubos dos dois lados. Se os itens forem empurrados para o detector com um empurrador(pusher)\\, eles são passados automaticamente.\n".. - "Ele envia um comando 'on' quando um item é reconhecido\\, seguido por um 'off' um segundo depois.\n".. - "Em seguida\\, outros comandos são bloqueados por 8 segundos.\n".. - "O tempo de espera e os itens que devem acionar um comando podem ser configurados usando o menu de chave inglesa(wrench).\n".. - "\n".. - "\n".. - "\n", - "O detector de carrinho envia um comando 'on' se reconhecer um carrinho (Minecart) diretamente na frente dele. Além disso\\, o detector também pode reiniciar o carrinho quando recebe um comando 'on'.\n".. - "\n".. - "O detector também pode ser programado com seu próprio número. Nesse caso\\, ele empurra todos os vagões que param perto dele (um bloco em todas as direções).\n".. - "\n".. - "\n".. - "\n", - "O detector de nó envia um comando 'on' se detectar que nós (blocos) aparecem ou desaparecem na frente dele\\, mas deve ser configurado de acordo. Após retornar o detector ao estado padrão (bloco cinza)\\, um comando 'off' é enviado. Blocos válidos são todos os tipos de blocos e plantas\\, mas não animais ou jogadores. O alcance do sensor é de 3 blocos por metro na direção da seta.\n".. - "\n".. - "\n".. - "\n", - "O detector de jogador envia um comando 'on' se detectar um jogador dentro de 4m do bloco. Se o jogador sair da área\\, um comando 'off' é enviado.\n".. - "Se a pesquisa deve ser limitada a jogadores específicos\\, esses nomes de jogador também podem ser inseridos.\n".. - "\n".. - "\n".. - "\n", - "O detector de luz envia um comando 'on' se o nível de luz do bloco acima exceder um certo nível\\, que pode ser definido através do menu de clique direito.\n".. - "Se você tiver um Controlador Lua TA4\\, pode obter o nível exato de luz com $get_cmd(num\\, 'light_level')\n".. - "\n".. - "\n".. - "\n", - "TA3 possui as mesmas máquinas que o TA2\\, apenas estas são mais poderosas e requerem eletricidade em vez de movimento por eixo.\n".. - "Portanto\\, abaixo são fornecidos apenas os dados técnicos diferentes.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 6 itens a cada 2 segundos.\n".. - "\n".. - "\n".. - "\n", - "A função do Distribuidor TA3 corresponde à do TA2.\n".. - "A capacidade de processamento é de 12 itens a cada 4 segundos.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 2 itens a cada 4 segundos. O autocrafter requer 6 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2\\, apenas os chips WLAN do TA4 são produzidos aqui.\n".. - "A capacidade de processamento é de um chip a cada 6 segundos. O bloco requer 12 ku de eletricidade para isso.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A profundidade máxima é de 40 metros. A pedreira requer 12 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 2 itens a cada 4 segundos. O bloco requer 4 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A probabilidade também é a mesma que a do TA2. O bloco também requer 3 ku de eletricidade.\n".. - "Mas\\, ao contrário do TA2\\, o status do bloco TA3 pode ser lido (controlador)\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 2 itens a cada 4 segundos. O bloco requer 6 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "O injetor é um TA3 pusher com propriedades especiais. Ele possui um menu para configuração. Até 8 itens podem ser configurados aqui. Ele apenas pega esses itens de um baú para passá-los para as máquinas com receitas (autocrafter\\, forno industrial e electronic fab).\n".. - "\n".. - "Ao passar\\, apenas uma posição no inventário é usada na máquina de destino. Se\\, por exemplo\\, apenas as três primeiras entradas estiverem configuradas no injetor\\, apenas as três primeiras posições de armazenamento no inventário da máquina serão usadas. Isso evita o transbordamento no inventário da máquina.\n".. - "\n".. - "O injetor também pode ser alternado para o \"modo pull\". Então ele apenas retira itens do baú das posições que estão definidas na configuração do injetor. Nesse caso\\, o tipo e a posição do item devem corresponder. Isso permite esvaziar entradas específicas do inventário de um baú.\n".. - "\n".. - "A capacidade de processamento é de até 8 vezes um item a cada 4 segundos.\n".. - "\n".. - "\n".. - "\n", - "", - "O Techage Info Tool (chave inglesa de ponta aberta) possui várias funções. Ele mostra a hora\\, posição\\, temperatura e bioma quando um bloco desconhecido é clicado.\n".. - "Se você clicar em um bloco TechAge com interface de comando\\, todos os dados disponíveis serão mostrados (consulte também \"Blocos lógicos / de comutação\").\n".. - "\n".. - "Com Shift + clique direito\\, um menu estendido pode ser aberto para alguns blocos. Dependendo do bloco\\, dados adicionais podem ser chamados ou configurações especiais podem ser feitas aqui. No caso de um gerador\\, por exemplo\\, a curva de carga/desligamento pode ser programada.\n".. - "\n".. - "\n".. - "\n", - "Com o programador\\, números de bloco podem ser coletados de vários blocos com um clique direito e gravados em um bloco como um botão / interruptor com um clique esquerdo.\n".. - "Se você clicar no ar\\, a memória interna é apagada.\n".. - "\n".. - "\n".. - "\n", - "A colher de pedreiro é usada para revestir cabos de energia. Veja também \"Cabo de energia TA\".\n".. - "\n".. - "\n".. - "\n", - "Esta ferramenta pode ser usada para remover blocos de tubo se\\, por exemplo\\, um túnel precisar passar por lá.\n".. - "\n".. - "\n".. - "\n", - "A chave de fenda Techage serve como substituto da chave de fenda normal. Ela possui as seguintes funções:\n".. - "\n".. - " - Clique esquerdo: girar o bloco para a esquerda\n".. - " - Clique direito: girar a face visível do bloco para cima\n".. - " - Shift + clique esquerdo: salvar o alinhamento do bloco clicado\n".. - " - Shift + clique direito: aplicar o alinhamento salvo ao bloco clicado\n".. - "\n".. - " \n".. - "\n", - "A TechAge Assembly Tool é usada para remover e reposicionar blocos Techage sem que esses blocos percam seu número de bloco ou recebam um novo número ao serem configurados. Isso é útil\\, por exemplo\\, para pedreiras\\, já que muitas vezes precisam ser movidas.\n".. - "\n".. - " - Botão esquerdo: remover um bloco\n".. - " - Botão direito: configurar um bloco\n".. - "\n".. - "O bloco que foi removido anteriormente com a ferramenta de montagem e que será colocado novamente deve estar no extremo esquerdo do inventário do jogador.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta3", - "", - "ta3_firebox", - "ta3_oilbox", - "ta3_boiler", - "ta3_turbine", - "ta3_generator", - "ta3_cooler", - "ta3_powerswitch", - "power_reduction", - "ta3_powercable", - "ta3_powerjunction", - "ta3_powerline", - "ta3_powerpole", - "ta3_powerpole4", - "ta3_powerpole2", - "ta3_powerswitch", - "ta3_powerswitchsmall", - "ta3_powerswitchbox", - "ta3_tinygenerator", - "ta3_akkublock", - "ta3_powerterminal", - "ta3_motor", - "", - "ta3_furnacefirebox", - "ta3_furnace", - "ta3_booster", - "", - "ta3_tank", - "ta3_pump", - "ta3_filler", - "ta3_pipe", - "ta3_pipe_wall_entry", - "ta3_valve", - "techage_ta3", - "ta3_oilexplorer", - "ta3_drillbox", - "ta3_pumpjack", - "ta3_drillbit", - "oiltank", - "", - "tank_cart", - "", - "", - "tank_cart", - "chest_cart", - "techage_ta31", - "", - "reboiler", - "ta3_logic", - "ta3_button", - "ta3_command_converter", - "ta3_flipflop", - "ta3_logic", - "ta3_repeater", - "ta3_sequencer", - "ta3_timer", - "ta3_terminal", - "ta3_colorlamp", - "ta3_doorblock", - "ta3_doorcontroller", - "ta3_doorcontroller", - "ta3_soundblock", - "ta3_mesecons_converter", - "ta3_nodedetector", - "ta3_detector", - "ta3_cartdetector", - "ta3_nodedetector", - "ta3_playerdetector", - "ta3_lightdetector", - "ta3_grinder", - "ta3_pusher", - "ta3_distributor", - "ta3_autocrafter", - "ta3_electronicfab", - "ta3_quarry", - "ta3_gravelsieve", - "ta3_gravelrinser", - "ta3_grinder", - "ta3_injector", - "", - "ta3_end_wrench", - "ta3_programmer", - "ta3_trowel", - "ta3_drill_pipe_wrench", - "ta3_screwdriver", - "techage:assembly_tool", - }, - plans = { - "", - "coalpowerstation", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_furnace", - "", - "", - "", - "ta3_tank", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta3_loading", - "ta3_loading", - "", - "", - "", - "ta3_distiller", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta4_DE.lua b/techage/doc/manual_ta4_DE.lua deleted file mode 100644 index 92aee0e..0000000 --- a/techage/doc/manual_ta4_DE.lua +++ /dev/null @@ -1,1052 +0,0 @@ -return { - titles = { - "1,TA4: Gegenwart", - "2,Windkraftanlage", - "3,TA4 Windkraftanlage / Wind Turbine", - "3,TA4 Windkraftanlagengondel / Wind Turbine Nacelle", - "3,TA4 Wind Turbine Signal Lamp", - "3,TA4 Säule / Pillar", - "2,Solaranlage", - "3,TA4 Solarmodul / Solar Module", - "3,TA4 Solar Trägermodul / Carrier Module", - "3,TA4 Solar Wechselrichter / Solar Inverter", - "3,TA4 Niederspannungskabel / Low Power Cable", - "3,TA4 Niederspannungsverteilerbox / Low Power Box", - "3,TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell", - "2,Energiespeicher", - "3,TA4 Wärmetauscher / Heat Exchanger", - "3,TA4 Turbine", - "3,TA4 Generator", - "3,TA4 Rohrzulauf / TA4 Pipe Inlet", - "3,TA4 Röhre / Pipe", - "2,Stromverteilung", - "3,TA4 Trenntransformator / TA4 Isolation Transformer", - "3,TA4 Stromzähler / TA4 Electric Meter", - "3,TA4 Laser", - "2,Wasserstoff", - "3,Elektrolyseur", - "3,Brennstoffzelle", - "2,Chemischer Reaktor / chemical reactor", - "3,TA4 Dosierer / doser", - "3,TA4 Reaktor / reactor", - "3,TA4 Einfüllstutzen / fillerpipe", - "3,TA4 Reaktorständer / reactor stand", - "3,TA4 Reaktorsockel / reactor base", - "3,TA4 Silo / silo", - "2,ICTA Controller", - "3,TA4 ICTA Controller", - "3,Batterie", - "3,TA4 Display", - "3,TA4 Display XL", - "3,TA4 Signal Tower", - "2,TA4 Lua Controller", - "3,TA4 Lua Server", - "3,TA4 Sensor Kiste/Chest", - "3,TA4 Lua Controller Terminal", - "2,TA4 Logik-/Schalt-Module", - "3,TA4 Taster/Schalter / Button/Switch", - "3,TA4 2x Taster / 2x Button", - "3,TA4 4x Taster / 4x Button", - "3,TA4 2x Signallampe / 2x Signal Lamp", - "3,TA4 4x Signallampe / 4x Signal Lamp", - "3,TA4 Spieler Detektor / Player Detector", - "3,TA4 Zustandssammler / State Collector", - "3,TA4 Detektor / Detector", - "3,TA4 Block Detektor / Node Detector", - "3,TA4 Energiespeicher-Ladungsdetektor / Energy Storage Charge Detector", - "3,TA4 Blicksensor / Gaze Sensor", - "3,TA4 Sequenzer", - "2,Move/Dreh-Controller", - "3,TA4 Move Controller", - "3,TA4 Drehcontroller / Turn Controller", - "2,TA4 Lampen", - "3,TA4 LED Pflanzenlampe / TA4 LED Grow Light", - "3,TA4 LED Straßenlampe / TA4 LED Street Lamp", - "3,TA4 LED Industrielampe / TA4 LED Industrial Lamp", - "2,TA4 Flüssigkeitsfilter", - "3,Fundament-Ebene", - "3,Schotter-Ebene", - "3,Einfüll-Ebene", - "2,TA4 Teilchenbeschleuniger / Collider", - "3,Detektor", - "3,Steuerung / TA4 Terminal", - "3,Kühlung und Strom", - "3,Aufbau", - "2,Weitere TA4 Blöcke", - "3,TA4 Rezept Block", - "3,TA4 Autocrafter", - "3,TA4 Tank / TA4 Tank", - "3,TA4 Pumpe / TA4 Pump", - "3,TA4 Ofenheizung / furnace heater", - "3,TA4 Wasserpumpe / Water Pump (veraltet)", - "3,TA4 Wassereinlass / TA4 Water Inlet", - "3,TA4 Röhren / TA4 Tube", - "3,TA4 Schieber / Pusher", - "3,TA4 Kiste / TA4 Chest", - "3,TA4 8x2000 Kiste / TA4 8x2000 Chest", - "3,TA4 Verteiler / Distributor", - "3,TA4 Hochleistungs-Verteiler / High Performance Distributor", - "3,TA4 Kiessieb / Gravel Sieve", - "3,TA4 Mühle / Grinder", - "3,TA4 Steinbrecher / Quarry", - "3,TA4 Elektronikfabrik / Electronic Fab", - "3,TA4 Injektor / Injector", - "3,TA4 Recycler", - }, - texts = { - "Regenerative Energiequellen wie Wind\\, Sonne und Biokraft helfen dir\\, das Ölzeitalter zu verlassen. Mit modernen Technologien und intelligenten Maschinen machst du dich auf in die Zukunft.\n".. - "\n".. - "\n".. - "\n", - "Eine Windkraftanlage liefern immer dann Strom\\, wenn Wind vorhanden ist. Im Spiel gibt es keinen Wind\\, aber die Mod simuliert dies dadurch\\, dass sich nur morgens (5:00 - 9:00) und abends (17:00 - 21:00) die Windräder drehen. Eine Windkraftanlage liefert nur dann Strom\\, wenn sie an einer geeigneten Stelle aufgestellt ist.\n".. - "\n".. - "Die TA Windkraftanlagen sind reine Offshore Anlagen\\, das heißt\\, die müssen im Meer errichtet werden. Dies bedeutet\\, dass Windkraftanlagen nur in einem Meer (occean) Biom errichtet werden können und dass um den Mast herum ausreichend Wasser und freie Sicht vorhanden sein müssen.\n".. - "\n".. - "Um eine geeignete Stelle zu finden\\, musst du mit dem Schraubenschlüssel (TechAge Info Werkzeug) auf das Wasser klicken. Ob diese Stelle für den Mast der Windkraftanlage geeignet ist\\, wird dir als Chat Nachricht angezeigt.\n".. - "\n".. - "Der Strom muss vom Rotor-Block durch den Mast nach unten geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit TA4 Säulenblöcke \"verputzen\". Unten kann eine Arbeitsplattform errichtet werden. Der Plan rechts zeigt den Aufbau im oberen Teil.\n".. - "\n".. - "Die Windkraftanlage liefert eine Leistung von 70 ku\\, aber dies nur 8 Stunden am Tag (siehe oben).\n".. - "\n".. - "\n".. - "\n", - "Der Windkraftanlagenblock (Rotor) ist das Herzstück der Windkraftanlage. Dieser Block muss oben auf den Mast gesetzt werden. Idealerweise auf Y = 15\\, dann bleibst du noch gerade innerhalb eines Map-/Forceload-Blocks.\n".. - "Beim Starten der Windkraftanlage werden alle Bedingungen für den Betrieb der Windkraftanlage überprüft. Sofern alle Bedingungen erfüllt sind\\, erscheinen auch automatisch die Rotorblätter (Flügel). Anderenfalls wird eine Fehlermeldung angezeigt. \n".. - "\n".. - "\n".. - "\n", - "Dieser Block muss an das schwarze Ende des Wind Turbinen Block gesetzt werden.\n".. - "\n".. - "\n".. - "\n", - "Dieses Blinklicht ist nur für dekorative Zwecke und kann oben auf den Wind Turbinen Block gesetzt werden.\n".. - "\n".. - "\n".. - "\n", - "Damit wird der Mast für die Windkraftanlage gebaut. Allerdings werden diese Blöcke nicht von Hand gesetzt sondern müssen mit Hilfe der Kelle gesetzt werden\\, so dass die Stromleitung zur Mastspitze mit diesen Blöcken ersetzt wird (siehe unter TA Stromkabel).\n".. - "\n".. - "\n".. - "\n", - "Die Solaranlage produziert nur Strom\\, wenn die Sonne scheint. Im Spiel ist das jeder Spieltag von morgens 6:00 bis abends 18:00.\n".. - "In dieser Zeit steht immer die gleiche Leistung zur Verfügung. Nach 18:00 schalten die Solarmodule komplett ab.\n".. - "\n".. - "Für die Leistung der Solarmodule ist die Biome Temperatur entscheidend. Je heißer die Temperatur\\, um so höher der Ertrag.\n".. - "Die Biome Temperatur kann mit dem Techage Info Tool (Schraubenschlüssel) bestimmt werden. Sie schwankt typischerweise zwischen 0 und 100:\n".. - "\n".. - " - bei 100 steht die volle Leistung zur Verfügung\n".. - " - bei 50 steht die halbe Leistung zur Verfügung\n".. - " - bei 0 steht keine Leistung zur Verfügung\n".. - "\n".. - "Es empfiehlt sich daher\\, nach heißen Steppen und Wüsten für die Solaranlage Ausschau zu halten.\n".. - "Für den Stromtransport stehen die Überlandleitungen zur Verfügung.\n".. - "Es kann aber auch Wasserstoff produziert werden\\, welcher sich transportieren und am Ziel wieder zu Strom umwandeln lässt.\n".. - "\n".. - "Die kleinste Einheit bei einer Solaranlage sind zwei Solarmodule und ein Trägermodul. Das Trägermodul muss zuerst gesetzt werden\\, die zwei Solarmodule dann links und rechts daneben (nicht darüber!).\n".. - "\n".. - "Der Plan rechts zeigt 3 Einheiten mit je zwei Solarmodulen und einem Trägermodul\\, über rote Kabel mit dem Wechselrichter verbunden.\n".. - "\n".. - "Solarmodule liefern Gleichspannung\\, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser besteht aus zwei Blöcken\\, einen für das rote Kabel zu den Solarmodulen (DC) und einen für das graue Stromkabel ins Stromnetz (AC).\n".. - "\n".. - "Der Kartenbereich\\, wo die Solaranlage steht\\, muss komplett geladen sein. Die gilt auch für die direkte Position über dem Solarmodul\\, denn dort wird regelmäßig die Lichtstärke gemessen. Es empfiehlt sich daher\\, zuerst einen Forceload Block zu setzen\\, und dann innerhalb dieses Bereiches die Module zu platzieren.\n".. - "\n".. - "\n".. - "\n", - "Das Solarmodul muss an das Trägermodul gesetzt werden. Es sind immer zwei Solarmodule notwendig.\n".. - "Im Paar leisten die Solarmodule bis 3 ku\\, je nach Temperatur.\n".. - "Bei den Solarmodul muss darauf geachtet werden\\, dass diese das volle Tageslicht haben und nicht durch Blöcke oder Bäume beschattet sind. Getestet kann dies mit dem Info Tool (Schraubenschlüssel).\n".. - "\n".. - "\n".. - "\n", - "Das Trägermodul gibt es in zwei Bauhöhen (1m und 2m). Funktionell sind beide identisch.\n".. - "Die Trägermodule können direkt aneinander gesetzt und so zu einer Modulreihe verbunden werden. Die Verbindung zum Wechselrichter oder zu anderen Modulreihen muss mit den roten Niederspannungskabeln bzw. den Niederspannungsverteilerboxen hergestellt werden.\n".. - "\n".. - "\n".. - "\n", - "Der Wechselrichter wandelt den Solarstrom (DC) in Wechselstrom (AC) um\\, so dass dieser in das Stromnetz eingespeist werden kann.\n".. - "Ein Wechselrichter kann maximal 100 ku an Strom einspeisen\\, was 33 Solarmodulen oder auch mehr entspricht.\n".. - "\n".. - "\n".. - "\n", - "Das Niederspannungskabel dient zur Verbindung von Solar-Modulreihen mit dem Wechselrichter. Das Kabel darf nicht für andere Zwecke benutzt werden.\n".. - "\n".. - "Die maximale Leitungslänge beträgt 200 m.\n".. - "\n".. - "\n".. - "\n", - "Die Verteilerbox muss auf den Boden gesetzt werden. Sie besitzt nur 4 Anschlüsse (in die 4 Himmelsrichtungen).\n".. - "\n".. - "\n".. - "\n", - "Die Straßenlampen-Solarzelle dient\\, wie der Name schon sagt\\, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet\\, die Lampe leuchtet nur im Dunkeln.\n".. - "\n".. - "Diese Solarzelle kann nicht mit den anderen Solarmodulen kombiniert werden.\n".. - "\n".. - "\n".. - "\n", - "Der TA4 Energiespeicher ersetzt den Batterie Block aus TA3.\n".. - "\n".. - "Der Energiespeicher besteht aus einer Betonhülle (Concrete Block) gefüllt mit Gravel. Es gibt 5 Größen vom Speicher:\n".. - "\n".. - " - Hülle mit 5x5x5 Concrete Blocks\\, gefüllt mit 27 Gravel\\, Speicherkapazität: 22.5 kud\n".. - " - Hülle mit 7x7x7 Concrete Blocks\\, gefüllt mit 125 Gravel\\, Speicherkapazität: 104 kud\n".. - " - Hülle mit 9x9x9 Concrete Blocks\\, gefüllt mit 343 Gravel\\, Speicherkapazität: 286 kud\n".. - " - Hülle mit 11x11x11 Concrete Blocks\\, gefüllt mit 729 Gravel\\, Speicherkapazität: 610 kud\n".. - " - Hülle mit 13x13x13 Concrete Blocks\\, gefüllt mit 1331 Gravel\\, Speicherkapazität: 1112 kud\n".. - "\n".. - "In der Betonhülle darf ein Fenster aus einem Obsidian Glas Block sein. Dieses muss ziemlich in der Mitte der Wand platziert werden. Durch dieses Fenster sieht man\\, ob der Speicher mehr als 80 % geladen ist. Im Plan rechts sieht man den Aufbau aus TA4 Wärmetauscher bestehend aus 3 Blöcken\\, der TA4 Turbine und dem TA4 Generator. Beim Wärmetauscher ist auf die Ausrichtung zu achten (der Pfeil bei Block 1 muss zur Turbine zeigen).\n".. - "\n".. - "Entgegen dem Plan rechts müssen die Anschlüsse am Speicherblock auf gleicher Ebene sein (horizontal angeordnet\\, also nicht unten und oben). Die Rohrzuläufe (TA4 Pipe Inlet) müssen genau in der Mitte der Wand sein und stehen sich damit gegenüber. Als Röhren kommen die gelben TA4 Röhren zum Einsatz. Die TA3 Dampfrohre können hier nicht verwendet werden.\n".. - "Sowohl der Generator als auch der Wärmetauscher haben einen Stromanschluss und müssen mit dem Stromnetz verbunden werden.\n".. - "\n".. - "Im Prinzip arbeitet das das Wärmespeichersystem genau gleich wie die Akkus\\, nur mit viel mehr Speicherkapazität. \n".. - "\n".. - "Damit das Wärmespeichersystem funktioniert\\, müssen alle Blöcke (auch Betonhülle und Gravel) mit Hilfe eines Forceloadblockes geladen sein.\n".. - "\n".. - "\n".. - "\n", - "Der Wärmetauscher besteht aus 3 Teilen\\, die aufeinander gesetzt werden müssen\\, wobei der Pfeil des ersten Blockes Richtung Turbine zeigen muss. Die Rohrleitungen müssen mit den gelben TA4 Röhren aufgebaut werden.\n".. - "Der Wärmetauscher muss am Stromnetz angeschlossen werden. Über den Wärmetauscher wird der Energiespeicher wieder aufgeladen\\, sofern ausreichend Strom zur Verfügung steht.\n".. - "\n".. - "\n".. - "\n", - "Die Turbine ist Teil des Energiespeichers. Sie muss neben den Generator gesetzt und über TA4 Röhren\\, wie im Plan abgebildet\\, mit dem Wärmetauscher verbunden werden.\n".. - "\n".. - "\n".. - "\n", - "Der Generator ist Teil des Energiespeichers. Er dient zur Stromerzeugung und gibt damt die Energie des Energiespeichers wieder ab. Daher muss auch der Generator am Stromnetz angeschlossen werden. \n".. - "\n".. - "Wichtig: Wärmetauscher und Generator müssen mit ein und demselben Stromnetz verbunden sein!\n".. - "\n".. - "\n".. - "\n", - "Je ein Rohrzulaufblock muss auf beiden Seiten des Speicherblockes eingebaut werden. Die Blöcke müssen sich exakt gegenüber stehen.\n".. - "\n".. - "Die Rohrzulaufblöcke können *nicht* als normale Wanddurchbrüche verwendet werden\\, dazu die TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke verwenden.\n".. - "\n".. - "\n".. - "\n", - "Die gelben Röhren dienen bei TA4 zur Weiterleitung von Gas und Flüssigkeiten. \n".. - "Die maximale Leitungslänge beträgt 100 m.\n".. - "\n".. - "\n".. - "\n", - "Mit Hilfe von Stromkabeln und Verteilerdosen können Stromnetze von bis zu 1000 Blöcke/Knoten aufgebaut werden. Hierbei ist aber zu beachten\\, dass Verteilerdosen auch mitgezählt werden müssen. Somit können bis zu 500 Generatoren/Speichersysteme/Maschinen/Lampen an einem Stromnetz hängen.\n".. - "\n".. - "Mit Hilfe von Trenntransformator und Stromzähler können Netzwerke zu noch größeren Strukturen verbunden werden.\n".. - "\n".. - "\n".. - "\n", - "Mit Hilfe eines Trenntransformators können zwei Stromnetze zu einem größeren Netzwerk verbunden werden. Der Trenntransformator kann Strom in beide Richtungen übertragen.\n".. - "\n".. - "Der Trenntransformator kann bis zu 300 ku übertragen. Der Maximalwert ist über das Schraubenschlüsselmenü einstellbar.\n".. - "\n".. - "\n".. - "\n", - "Mit Hilfe eines Stromzählers können zwei Stromnetze zu einem größeren Netzwerk verbunden werden. Der Stromzähler leitet den Strom nur in eine Richtungen weiter (Pfeil beachten). Die durchgeleitete Menge an elektrischer Energie (in kud) wird gemessen und angezeigt. Dieser Wert kann auch über das Kommando 'consumption' durch einen Lua Controller abgefragt werden. Die aktuelle Stromstärke kann über 'current' abgefragt werden.\n".. - "\n".. - "Der Stromzähler kann bis zu 200 ku durchleiten. Der Maximalwert ist über das Schraubenschlüsselmenü einstellbar.\n".. - "\n".. - "Über das Schraubenschlüsselmenü kann auch ein Countdown für die Leistungsabgabe eingegeben werden. Läuft dieser Countdown auf Null\\, schaltet sich der Stromzähler ab. Der Countdown kann über das Kommando 'countdown' abgefragt werden.\n".. - "\n".. - "\n".. - "\n", - "Der TA4 Laser dient zur kabellosen Stromübertagung. Dazu sind zwei Blöcke notwendig: TA4 Laserstrahl Sender und TA4 Laserstrahl Empfänger. Zwischen beiden Blöcken muss sich eine Luftstrecke befinden\\, so dass der Laserstrahl vom Sender bis zum Empfänger aufgebaut werden kann.\n".. - "\n".. - "Zuerst muss der Sender platziert werden. Dieser schaltet sofort den Laserstahls ein und zeigt damit mögliche Positionen des Empfängers an. Mögliche Positionen für den Empfänger werden auch über eine Chat-Nachricht ausgegeben. Mit dem Laser lassen sich Strecken bis 96 Blöcke überbrücken.\n".. - "\n".. - "Ist die Verbindung aufgebaut (es muss dazu noch kein Strom fließen)\\, wird dies über den Info-Text des Senders und auch des Empfängers angezeigt.\n".. - "\n".. - "Die Laserblöcke selbst benötigen keinen Strom.\n".. - "\n".. - "\n".. - "\n", - "Strom kann mittels Elektrolyse in Wasserstoff und Sauerstoff aufgespalten werden. Auf der anderen Seite kann über eine Brennstoffzelle Wasserstoff mit Sauerstoff aus der Luft wieder in Strom umgewandelt werden.\n".. - "Damit können Stromspitzen oder ein Überangebot an Strom in Wasserstoff umgewandelt und so gespeichert werden.\n".. - "\n".. - "Im Spiel kann Strom mit Hilfe des Elektrolyseurs in Wasserstoff und Wasserstoff über die Brennstoffzelle wieder in Strom umgewandelt werden.\n".. - "Damit kann Strom (in Form von Wasserstoff) nicht nur in Tanks gelagert\\, sonder mit dem Tankwagen auch transportiert werden.\n".. - "\n".. - "Die Umwandlung von Strom in Wasserstoff und zurück ist aber verlustbehaftet. Von 100 Einheiten Strom kommen nach der Umwandlung in Wasserstoff und zurück nur 95 Einheiten Strom wieder raus.\n".. - "\n".. - "\n".. - "\n", - "Der Elektrolyseur wandelt Strom in Wasserstoff um.\n".. - "Es muss von links mit Strom versorgt werden. Rechts kann Wasserstoff über Röhren und Pumpen entnommen werden.\n".. - "\n".. - "Der Elektrolyseur kann bis zu 35 ku an Strom aufnehmen und generiert dann alle 4 s ein Wasserstoff Item.\n".. - "In den Elektrolyseur passen 200 Einheiten Wasserstoff.\n".. - "\n".. - "Der Elektrolyseur besitzt ein Schraubenschlüssel-Menü zur Einstellung der Stromaufnahme und des Abschaltpunkts.\n".. - "\n".. - "Unterschreitet die im Stromnetz gespeicherte Leistung den angegebenen Wert des Abschaltpunkts\\, so schaltet sich der Elektrolyseur automatisch ab. Damit kann ein Leerlaufen der Speichersysteme verhindert werden.\n".. - "\n".. - "\n".. - "\n", - "Die Brennstoffzelle wandelt Wasserstoff in Strom um.\n".. - "Sie muss von links per Pumpe mit Wasserstoff versorgt werden. Rechts ist der Stromanschluss.\n".. - "\n".. - "Die Brennstoffzelle kann bis zu 34 ku an Strom abgeben und benötigt dazu alle 4 s ein Wasserstoff Item.\n".. - "\n".. - "Normalerweise arbeitet die Brennstoffzelle als Generator der Kategorie 2 (wie auch anderen Speichersystemen).\n".. - "In diesem Fall können keine anderen Blöcke der Kategorie 2 wie der Akku-Block geladen werden.\n".. - "Über das Kontrollkästchen kann die Brennstoffzelle jedoch auch als Generator der Kategorie 1 eingesetzt werden.\n".. - "\n".. - "\n".. - "\n", - "Der Reaktor dient dazu\\, die über den Destillationsturm oder aus anderen Rezepten gewonnenen Zutaten zu neuen Produkten weiter zu verarbeiten. Der Plan links zeigt nur eine mögliche Variante\\, da die Anordnung der Silos und Tanks rezeptabhängig ist.\n".. - "\n".. - "Das primäre Ausgabeprodukt wird immer an der Seite des Reaktorständers ausgegeben\\, unabhängig davon\\, ob es sich um ein Pulver oder eine Flüssigkeit handelt. Das (sekundäre) Abfallprodukt wird immer unten am Reaktorständers ausgegeben.\n".. - "\n".. - "Ein Reaktor besteht aus:\n".. - "\n".. - " - div. Tanks und Silos mit den Zutaten\\, die über Leitungen mit dem Dosierer verbunden sind\n".. - " - optional einem Reaktorsockel\\, welcher die Abfälle aus dem Reaktor ableitet (nur bei Rezepten mit zwei Ausgabestoffen notwendig)\n".. - " - dem Reaktorständer\\, der auf den Sockel gesetzt werden muss (sofern vorhanden). Der Ständer hat einen Stromanschluss und zieht bei Betrieb 8 ku.\n".. - " - dem eigentlichen Reaktorbehälter\\, der auf den Reaktorständer gesetzt werden muss\n".. - " - dem Einfüllstutzen der auf den Reaktorbehälter gesetzt werden muss\n".. - " - dem Dosierer\\, welcher über Leitungen mit den Tanks oder Silos sowie dem Einfüllstutzen verbunden werden muss\n".. - "\n".. - "Hinweis 1: Flüssigkeiten werden nur in Tanks gelagert\\, feste Stoffe und Stoffe in Pulverform nur in Silos. Dies gilt für Zutaten und Ausgabestoffe.\n".. - "\n".. - "Hinweis 2: Tanks oder Silos mit verschiedenen Inhalten dürfen nicht zu einem Leitungssystem verbunden werden. Mehrere Tanks oder Silos mit gleichem Inhalt dürfen dagegen parallel an einer Leitung hängen.\n".. - "\n".. - "Beim Cracken werden lange Kette von Kohlenwasserstoffen unter Verwendung eines Katalysator in kurze Ketten gebrochen.\n".. - "Als Katalysator dient Gibbsitpulver (wird nicht verbraucht). Damit kann Bitumen in Schweröl\\, Schweröl in Naphtha und Naphtha in Benzin umgewandelt werden.\n".. - "\n".. - "Bei der Hydrierung werden einem Molekül Paare von Wasserstoffatomen hinzugefügt\\, um kurzkettige Kohlenwasserstoffe in lange umzuwandeln.\n".. - "Hier wird Eisenpulver als Katalysator benötigt (wird nicht verbraucht). Damit kann Propangas in Isobutan\\, Isobutan in Benzin\\, Benzin in Naphtha\\,\n".. - "Naphtha in Schweröl und Schweröl in Bitumen umgewandelt werden.\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors.\n".. - "Auf allen 4 Seiten der Dosierers können Leitungen für Eingangsmaterialien angeschlossen werden. Nach oben werden die Materialien für den Reaktor ausgegeben.\n".. - "\n".. - "Über den Dosierer kann das Rezept eingestellt und der Reaktor gestartet werden.\n".. - "\n".. - "Wie auch bei anderen Maschinen:\n".. - "\n".. - " - geht der Dosierer in den standby Zustand\\, so fehlen ein oder mehrere Zutaten\n".. - " - geht der Dosierer in den blocked Zustand\\, so ist Ausgabetank oder Silo voll\\, defekt oder falsch angeschlossen\n".. - "\n".. - "Der Dosierer benötigt keinen Strom. Alle 10 s wird ein Rezept abgearbeitet.\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors. Der Reaktor verfügt über ein Inventar für die Katalysator \n".. - "Gegenstände (für Cracking- und Hydrierungs-Rezepte).\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors. Muss auf den Reaktor gesetzt werden. Wenn dies nicht klappt\\, ggf. das Rohr an der Position darüber nochmals entfernen und neu setzen.\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors. Hier ist auch der Stromanschluss für den Reaktor. Der Reaktor benötigt 8 ku Strom.\n".. - "\n".. - "Der Ständer hat zwei Leitungsanschlüsse\\, nach rechst für das primäre Ausgabeprodukt und nach unten für den Abfall\\, wie bspw. Rotschlamm bei der Aluminiumherstellung.\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors. Wird für den Abfluss des Abfallproduktes benötigt.\n".. - "\n".. - "\n".. - "\n", - "Teil des Chemischen Reaktors. Wird zur Aufbewahrung von Stoffen in Pulver- oder Granulatform benötigt.\n".. - "\n".. - "\n".. - "\n", - "Der ICTA Controller (ICTA steht für \"If Condition Then Action\") dient zur Überwachung und Steuerung von Maschinen. Mit dem Controller kann man Daten von Maschinen und anderen Blöcken einlesen und abhängig davon andere Maschinen und Blöcke ein-/ausschalten.\n".. - "\n".. - "Einlesen von Maschinendaten sowie das Steuern von Blöcken und Maschinen erfolgt über sogenannte Kommandos. Für das Verständnis\\, wie Kommandos funktionieren\\, ist das Kapitel TA3 -> Logik-/Schalt-Blöcke wichtig. \n".. - "\n".. - "Der Controller benötigt für den Betrieb eine Batterie. Das Display dient zur Ausgabe von Daten\\, der Signal Tower zur Anzeige von Fehlern.\n".. - "\n".. - "\n".. - "\n", - "Der Controller arbeitet auf das Basis von 'IF THEN ' Regeln. Es können bis zu 8 Regeln pro Controller angelegt werden.\n".. - "\n".. - "Beispiele für Regeln sind:\n".. - "\n".. - " - Wenn ein Verteiler verstopft ist ('blocked')\\, soll der Schieber davor ausgeschaltet werden\n".. - " - Wenn eine Maschine einen Fehler anzeigt\\, soll dieser auf dem Display ausgegeben werden\n".. - "\n".. - "Der Controller prüft diese Regeln zyklisch. Dazu muss pro Regel eine Zykluszeit in Sekunden ('Cycle/s') angegeben werden (1..1000). \n".. - "\n".. - "Für Regeln die einen on/off Eingang auswerten\\, bspw. von einen Schalter oder Detektor\\, muss als Zykluszeit 0 angegeben werden. Der Wert 0 bedeutet\\, dass diese Regel immer dann ausgeführt werden soll\\, wenn sich das Eingangssignal geändert hat\\, also bspw. der Button einen neuen Wert gesendet hat.\n".. - "\n".. - "Alle Regeln sollten nur so oft wie notwendig ausgeführt werden. Dies hat zwei Vorteile:\n".. - "\n".. - " - die Batterie des Controllers hält länger (jeder Controller benötigt eine Batterie)\n".. - " - die Last für den Server ist geringer (damit weniger Lags)\n".. - "\n".. - "Man muss für jede action eine Verzögerungszeit ('after/s') einstellen. Soll die Aktion sofort ausgeführt werden\\, ist 0 einzugeben.\n".. - "\n".. - "Der Controller hat eine eigene Hilfe und Hinweise zu allen Kommandos über das Controller-Menü.\n".. - "\n".. - "\n".. - "\n", - "Die Batterie muss in unmittelbarer Nähe zum Controller platziert werden\\, also an einer der 26 Positionen um den Controller herum.\n".. - "\n".. - "\n".. - "\n", - "Das Display zeigt nach dem Platzieren seine Nummer an. Über diese Nummer kann das Display angesprochen werden. Auf dem Display können Texte ausgegeben werden\\, wobei das Display 5 Zeilen und damit 5 unterschiedliche Texte darstellen kann.\n".. - "\n".. - "Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden\\, muss dem Text das Zeichen „t“ (Tabulator) vorangestellt werden.\n".. - "\n".. - "Das Display wird maximal ein mal pro Sekunde aktualisiert.\n".. - "\n".. - "\n".. - "\n", - "Das TA4 Display XL hat die doppelte Größ wie das TA4 Display.\n".. - "\n".. - "Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden\\, muss dem Text das Zeichen „t“ (Tabulator) vorangestellt werden.\n".. - "\n".. - "Das Display wird maximal alle zwei Sekunden aktualisiert.\n".. - "\n".. - "\n".. - "\n", - "Der Signal Tower kann rot\\, grün und orange anzeigen. Eine Kombination der 3 Farben ist nicht möglich.\n".. - "\n".. - "\n".. - "\n", - "Der Lua Controller muss\\, wie der Name schon sagt\\, in der Programmiersprache Lua programmiert werden. Außerdem sollte man etwas Englisch können (oder Google bemühen)\\, denn die Anleitung dazu gibt es nur in Englisch:\n".. - "\n".. - "https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md\n".. - "\n".. - "Auch der Lua Controller benötigt eine Batterie. Die Batterie muss in unmittelbarer Nähe zum Controller platziert werden\\, also an einer der 26 Positionen um den Controller herum.\n".. - "\n".. - "\n".. - "\n", - "Der Server dient zur zentralen Speicherung von Daten von mehreren Lua Controllern. Es speichert auch die Daten über einen Server-Neustart hinweg.\n".. - "\n".. - "\n".. - "\n", - "Die TA4 Sensor Kiste dient zum Aufbau von Automatischen Lagern oder Verkaufsautomaten in Verbindung mit dem Lua Controller.\n".. - "Wird etwas in die Kiste gelegt\\, oder entnommen\\, oder eine der Tasten \"F1\"/\"F2\" gedrückt\\, so wird ein Event-Signal an den Lua Controller gesendet.\n".. - "Die Sensor Kiste unterstützt folgende Kommandos:\n".. - "\n".. - " - Über 'state = $send_cmnd(\\, \"state\")' kann der Status der Kiste abgefragt werden. Mögliche Antworten sind: \"empty\"\\, \"loaded\"\\, \"full\"\n".. - " - Über 'name\\, action = $send_cmnd(\\, \"action\")' kann die letzte Spieleraktion abgefragt werden. 'name' ist der Spielername\\, Als 'action' wird zurückgeliefert: \"put\"\\, \"take\"\\, \"f1\"\\, \"f2\".\n".. - " - Über 'stacks = $send_cmnd(\\, \"stacks\")' kann der Inhalt der Kiste ausgelesen werden. Siehe dazu: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest\n".. - " - Über '$send_cmnd(\\, \"text\"\\, \"press both buttons andnput something into the chest\")' kann der Text im Menü der Sensor Kiste gesetzt werden.\n".. - "\n".. - "Über die Checkbox \"Erlaube öffentlichen Zugriff\" kann eingestellt werden\\, ob die Kiste von jedem genutzt werden darf\\, oder nur von Spielern die hier Zugriffsrechte haben.\n".. - "\n".. - "\n".. - "\n", - "Das Terminal dient zur Ein-/Ausgabe für den Lua Controller.\n".. - "\n".. - "\n".. - "\n", - "", - "Beim TA4 Taster/Schalter hat sich nur das Aussehen geändert. Die Funktionalität ist gleich wie beim TA3 Taster/Schalter. Mit dem Schraubenschlüssel-Menü können die Daten aber nachträglich geändert werden.\n".. - "\n".. - "\n".. - "\n", - "Dieser Block hat zwei Taster\\, die über das Schraubenschlüssel-Menü individuell konfiguriert werden können. Für beide Taster kann die Beschriftung und die Zielblockadresse konfiguriert werden. Zusätzlich kann für beide Taster das Kommando konfiguriert werden\\, welches gesendet werden soll.\n".. - "\n".. - "\n".. - "\n", - "Dieser Block hat vier Taster\\, die über das Schraubenschlüssel-Menü individuell konfiguriert werden können. Für jeden Taster kann die Beschriftung und die Zielblockadresse konfiguriert werden. Zusätzlich kann für jeden Taster das Kommando konfiguriert werden\\, welches gesendet werden soll.\n".. - "\n".. - "\n".. - "\n", - "Dieser Block hat zwei Lampen\\, die individuell angesteuert werden können. Jede Lampe kann die Farben \"rot\"\\, \"grün\" und \"orange\" anzeigen. Über das Schraubenschlüssel-Menü kann für beide Lampen die Beschriftung konfiguriert werden. Die Lampen können über folgende Kommandos angesteuert werden:\n".. - "\n".. - " - Lampe 1 auf rot schalten: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Lampe 2 auf grün schalten: '$send_cmnd(1234\\, \"green\"\\, 2)'\n".. - " - Lampe 1 auf orange schalten: '$send_cmnd(1234\\, \"amber\"\\, 1)'\n".. - " - Lampe 2 aus schalten: '$send_cmnd(1234\\, \"off\"\\, 2)'\n".. - "\n".. - "\n".. - "\n", - "Dieser Block hat vier Lampen\\, die individuell angesteuert werden können. Jede Lampe kann die Farben \"rot\"\\, \"grün\" und \"orange\" anzeigen. Über das Schraubenschlüssel-Menü kann für alle Lampen die Beschriftung konfiguriert werden. Die Lampen können über folgende Kommandos angesteuert werden:\n".. - "\n".. - " - Lampe 1 auf rot schalten: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Lampe 2 auf grün schalten: '$send_cmnd(1234\\, \"green\"\\, 2)'\n".. - " - Lampe 3 auf orange schalten: '$send_cmnd(1234\\, \"amber\"\\, 3)'\n".. - " - Lampe 4 aus schalten: '$send_cmnd(1234\\, \"off\"\\, 4)'\n".. - "\n".. - "\n".. - "\n", - "Beim TA4 Spieler Detektor hat sich nur das Aussehen geändert. Die Funktionalität ist gleich wie beim TA3 Spieler Detektor.\n".. - "\n".. - "\n".. - "\n", - "\n".. - "\n".. - "Der Zustandssammler fragt der Reihe nach alle konfigurierten Maschinen nach dem Status ab. Wenn eine der Maschinen einen vorkonfigurierte Status erreicht oder überschritten hat\\, wird ein \"on\" Kommando gesendet. Damit können bspw. vom einem Lua Controller aus sehr einfach viele Maschinen auf Störungen überwacht werden.\n".. - "\n", - "Die Funktionalität ist gleich wie beim TA3 Detektor / Detector. Zusätzlich zählt der Detector aber die weitergegebenen Items. \n".. - "Diesen Zähler kann man über das Kommando 'count' abfragen und über 'reset' zurücksetzen.\n".. - "\n".. - "\n".. - "\n", - "Die Funktionalität ist gleich wie beim TA3 Block Detektor. \n".. - "\n".. - "Im Unterschied zum TA3 Block Detektor können hier die Positionen\\, die überwacht werden sollen\\, individuell konfiguriert werden. Dazu muss der \"Aufzeichnen\" Button gedrückt werden. Dann müssen alle Blöcke angeklickt werden\\, von denen die Position überprüft werden soll. Danach muss der \"Fertig\" Button gedrückt werden. \n".. - "\n".. - "Es können bis zu 4 Blöcke ausgewählt werden. \n".. - "\n".. - "\n".. - "\n", - "Der Ladungsdetektor misst alle 8 s den Ladezustand des Energiespeichers des Stromnetzwerkes.\n".. - "\n".. - "Fällt der Wert unter eine konfigurierbare Schwelle (Schaltpunkt)\\, wird ein Kommando (default: \"off\") versendet. Steigt der Wert wieder über diesen Schaltpunkt\\, so wird ein zweites Kommando (default: \"on\") gesendet. Damit lassen sich Verbraucher vom Netz trennen\\, wenn der Ladezustand des Energiespeichers unter den angegebenen Schaltpunkt sinkt.\n".. - "\n".. - "Der Ladungsdetektor muss dazu über eine Verteilerdose an das Stromnetz angeschlossen werden. Die Konfiguration des Ladungsdetektors erfolgt über das Gabelschlüsselmenü.\n".. - "\n".. - "\n".. - "\n", - "Der TA4 Blicksensor generiert ein Kommando\\, wenn der Block vom Besitzer oder anderen konfigurierten Spielern angesehen/fokussiert wird und sendet ein zweites Kommando\\, wenn der Block nicht mehr fokussiert wird. Er dient damit als Ersatz für Taster/Schalter\\, um bspw. Türen zu öffnen/schließen.\n".. - "\n".. - "Der TA4 Blicksensor kann nur mit dem Gabelschlüsselmenü programmiert werden. Hat man einen Gabelschlüssel in der Hand\\, löst der Sensor nicht aus\\, auch wenn dieser fokussiert wird.\n".. - "\n".. - "\n".. - "\n", - "über den TA4 Sequenzer können ganze Abläufe programmiert werden. Hier ein Beispiel:\n".. - "\n".. - " -- this is a comment\n".. - " \\[1\\] send 1234 a2b\n".. - " \\[30\\] send 1234 b2a\n".. - " \\[60\\] goto 1\n".. - "\n".. - " - Jede Zeile beginnt mit einem Nummer\\, welche einem Zeitpunkt entspricht '\\[\\]'\n".. - " - Für Zeitpunkte sind Werte von 1 bis 50000 zulässig\n".. - " - 1 entspricht 100 ms\\, 50000 entspricht in etwa 4 Spieltagen\n".. - " - Leerzeilen oder Kommentare sind erlaubt ('-- comment')\n".. - " - Mit 'send ' kann man ein Kommando an einen Block senden\n".. - " - Mit 'goto ' kann man an eine andere Zeile/Zeitpunkt springen\n".. - " - Mit 'stop' kann man den Sequenzer verzögert stoppen\\, so dass er kein neues Kommando\nvon einem Taster oder anderem Block annimmt (um eine Bewegung abzuschließen)\nOhne 'stop' geht der Sequenzer sofort nach dem letzten Kommando in den stopped Modus.\n".. - "\n".. - "Der TA4 Sequenzer unterstützt folgende techage Kommandos:\n".. - "\n".. - " - 'goto ' Zu einer Kommandozeile springen und damit den Sequenzer starten\n".. - " - 'stop' Den Sequenzer anhalten\n".. - " - 'on' und 'off' als Alias für 'goto 1' bzw. 'stop'\n".. - "\n".. - "Das 'goto' Kommando wird nur angenommen\\, wenn der Sequenzer gestoppt ist.\n".. - "\n".. - "Über das Gabelschlüssel-Menü kann beim Sequenzer die Zykluszeit (normal: 100 ms) geändert werden. \n".. - "\n".. - "\n".. - "\n", - "", - "Der TA4 Move Controller ist ähnlich zum \"Door Controller 2\"\\, aber die ausgewählten Blöcke werden nicht entfernt\\, sondern können bewegt werden.\n".. - "Da die bewegten Blöcke Spieler und Mobs mitnehmen können\\, die auf dem Block stehen\\, können damit Fahrstühle und ähnliche Transportsysteme gebaut werden.\n".. - "\n".. - "Anleitung:\n".. - "\n".. - " - Controller setzen und die Blöcke\\, die bewegt werden sollen\\, über das Menü (Taste \"Aufzeichnen\") an-trainieren (Es können bis zu 16 Blöcke an-trainiert werden)\n".. - " - die \"Flugstrecke\" muss über eine x\\,y\\,z Angabe (relativ) eingegeben werden (die maximale Distanz (x+y+z) beträgt 200 m)\n".. - " - mit den Menü-Tasten \"Bewege A-B\" sowie \"Bewege B-A\" kann die Bewegung getestet werden\n".. - " - man kann auch durch Wände oder andere Blöcke fliegen\n".. - " - auch die Zielposition für die Blöcke kann belegt sein. Die Blöcke werden in diesem Falle \"unsichtbar\" gespeichert. Dies ist für Schiebetüren und ähnliches gedacht\n".. - "\n".. - "Der Move Controller unterstützt folgende techage Kommandos:\n".. - "\n".. - " - 'a2b' Bewege Block von A nach B\n".. - " - 'b2a' Bewege Block von B nach A\n".. - " - 'move' Bewege Block auf die andere Seite\n".. - "\n".. - "Über das Schraubenschlüssel-Menü kann auf die Betriebsart 'move xyz' umgeschaltet werden. Nach der Umschaltung werden folgende techage Kommandos unterstützt:\n".. - "\n".. - " - 'move2' Beim Kommando muss zusätzlich die Flugstrecke als x\\,y\\,z Vektor angegeben werden.\nBeispiel Lua Controller: '$send_cmnd(MOVE_CTLR\\, \"move2\"\\, \"0\\,12\\,0\")'\n".. - " - 'reset' Block/Blöcke zurück in Startposition bewegen\n".. - "\n".. - "*Wichtige Hinweise:*\n".. - "\n".. - " - Sofern mehrere Blöcke bewegt werden sollen\\, muss der Block\\, der die Spieler/Mobs mitnehmen soll\\, beim Antrainieren als erstes angeklickt werden.\n".. - " - Hat der Block\\, der die Spieler/Mobs mitnehmen soll\\, eine reduzierte Höhe\\, so muss die Höhe im Controller über das Schraubenschlüsselmenü eingestellt werden (bspw. Höhe = 0.5). Ansonsten wird der Spieler/Mob nicht \"gefunden\" und damit nicht mitgenommen.\n".. - "\n".. - "\n".. - "\n", - "Der TA4 Drehcontroller ist ähnlich zum Move Controller\"\\, aber die ausgewählten Blöcke werden nicht bewegt\\, sondern um ihr Zentrum nach rechts oder links gedreht.\n".. - "\n".. - "Anleitung:\n".. - "\n".. - " - Controller setzen und die Blöcke\\, die bewegt werden sollen\\, über das Menü an-trainieren (Es können bis zu 16 Blöcke an-trainiert werden)\n".. - " - mit den Menü-Tasten \"Drehe links\" sowie \"Drehe rechts\" kann die Bewegung getestet werden\n".. - "\n".. - "Der Drehcontroller unterstützt folgende techage Kommandos:\n".. - "\n".. - " - 'left' Drehe nach links\n".. - " - 'right' Drehe nach rechts\n".. - " - 'uturn' Drehe um 180 Grad\n".. - "\n".. - "\n".. - "\n", - "TA4 beinhaltet eine Reihe von leistungsstarken Lampen\\, die eine bessere Ausleuchtung ermöglichen oder Spezialaufgaben übernehmen.\n".. - "\n", - "Die TA4 LED Pflanzenlampe ermöglicht ein schnelles und kräftiges Wachstum aller Pflanzen aus der 'farming' Mod. Die Lampe beleuchtet ein 3x3 großes Feld\\, so dass sich damit auch Pflanzen unter Tage anbauen lassen.\n".. - "Die Lampe muss mit einem Abstand von einem Block über dem Boden in der Mitte des 3x3 Feldes platziert werden.\n".. - "\n".. - "Zusätzlich kann die Lampe auch zur Blumenzucht genutzt werden. Wird die Lampe über ein 3x3 großes Blumenbeet aus \"Garden Soil\" (Mod 'compost') platziert\\, so wachsen dort die Blumen ganz von selbst (über und unter Tage).\n".. - "\n".. - "Abernten kann man die Blumen mit den Signs Bot\\, der auch über ein entsprechendes Zeichen verfügt\\, das vor das Blumenfeld gestellt werden muss.\n".. - "\n".. - "Die Lampe benötigt 1 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die TA4 LED Straßenlampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe besteht aus dem Lampengehäuse\\, Lampenarm und Lampenmast Blöcken.\n".. - "\n".. - "Der Strom muss von unten durch den Mast nach oben zum Lampengehäuse geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit Lampenmast Blöcken \"verputzen\".\n".. - "\n".. - "Die Lampe benötigt 1 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die TA4 LED Industrielampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe muss von oben mit Strom versorgt werden.\n".. - "\n".. - "Die Lampe benötigt 1 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Im Flüssigkeitsfilter wird Rotschlamm gefiltert.\n".. - "Dabei entsteht entweder Lauge\\, welche unten in einem Tank gesammelt werden kann oder Wüstenkopfsteinpflaster\\, welches sich im Filter absetzt.\n".. - "Wenn der Filter zu sehr verstopft ist\\, muss er geleert und neu befüllt werden.\n".. - "Der Filter besteht aus einer Fundament-Ebene\\, auf der 7 identische Filterschichten platziert werden. \n".. - "Ganz oben befindet sich die Einfüllebene.\n".. - "\n".. - "\n".. - "\n", - "Der Aufbau dieser Ebene kann dem Plan entnommen werden.\n".. - "\n".. - "Im Tank wird die Lauge gesammelt.\n".. - "\n".. - "\n".. - "\n", - "Diese Ebene muss so wie im Plan gezeigt mit Schotter befüllt werden.\n".. - "Insgesamt müssen sieben Lagen Schotter übereinander liegen.\n".. - "Dabei wird mit der Zeit der Filter verunreinigt\\, sodass das Füllmaterial erneuert werden muss.\n".. - "\n".. - "\n".. - "\n", - "Diese Ebene dient zum Befüllen des Filters mit Rotschlamm.\n".. - "In den Einfüllstutzen muss Rotschlamm mittels einer Pumpe geleitet werden.\n".. - "\n".. - "\n".. - "\n", - "Der Teilchenbeschleuniger ist eine Forschungsanlage\\, bei der Grundlagenforschung betrieben wird. Hier können Erfahrungspunkte (experience points) gesammelt werden\\, welche für TA5 (Future Age) benötigt werden.\n".. - "\n".. - "Der Teilchenbeschleuniger muss wie sein Original am CERN in Genf unterirdisch aufgebaut werden. Die Standardeinstellung ist hier Y <= -28. Der Wert kann aber per Konfiguration vom Server Personal geändert werden. Ab besten nachfragen\\, oder mit dem \"TA4 Collider Detector Worker\" Block ausprobieren.\n".. - "\n".. - "Pro Spieler kann nur ein Teilchenbeschleuniger betrieben werden. Es macht also keinen Sinn\\, zwei oder mehrere Teilchenbeschleuniger aufzubauen. Erfahrungspunkte werden dem Spieler gutgeschrieben\\, dem der Teilchenbeschleuniger gehört. Die Erfahrungspunkte können nicht übertragen werden.\n".. - "\n".. - "Ein Teilchenbeschleuniger besteht aus einem \"Ring\" aus Röhren und Magneten sowie dem Detektor mit Kühlanlage. \n".. - "\n".. - " - Der Detektor ist das Herz der Anlage. Hier finden die wissenschaftlichen Experimente statt. Der Detektor ist 3x3x7 Blöcke groß.\n".. - " - 22 TA4 Collider Magnete (nicht die TA4 Collider Detector Magnete!) müssen über jeweils 5 Blöcken der TA4 Vakuumröhre miteinander verbunden werden. Das ganze bildet (wie rechts im Plan abgebildet) ein Quadrat mit einer Kantenlänge von 37 Metern.\n".. - "\n".. - "Der Plan zeigt die Anlage von oben:\n".. - "\n".. - " - der graue Block ist der Detektor mit dem Worker-Block in der Mitte\n".. - " - die roten Blöcke sind die Magnete\\, das blaue die Vakuumröhren\n".. - "\n".. - "\n".. - "\n", - "Der Detektor wird mit Hilfe des \"TA4 Collider Detector Worker\" Blocks automatisch aufgebaut (ähnlich wie beim Bohrturm). Alle dazu notwendigen Materialien müssen zuvor in den Worker-Block gelegt werden. Auf dem Worker-Block ist der Detektor symbolisch dargestellt. Der Detektor wird über dem Worker-Block in Querrichtung errichtet.\n".. - "\n".. - "Der Detektor kann mit Hilfe des Worker-Blocks auch wieder abgebaut werden.\n".. - "\n".. - "Auf den beiden Stirnseiten des Detektors befinden sich die Anschlüsse für Strom\\, Gas und Vakuumröhre. Oben muss eine TA4 Pumpe angeschlossen werden\\, um die Röhre leer zu saugen / das Vakuum zu erzeugen.\n".. - "\n".. - "Auf der Rückseite des Detektors muss das Kühlsystem angeschlossen werden. Im Plan rechts ist das Kühlsystem abgebildet. Hier wird neben dem TA4 Wärmetauscher des Energiespeichers (welcher hier zur Kühlung genutzt wird)\\, auch ein TA4 Kühlerblock benötigt. \n".. - "\n".. - "Hinweis: Der Pfeil des Wärmetauschers muss vom Detektor weg zeigen. Auch der Wärmetauscher muss mit Strom versorgt werden.\n".. - "\n".. - "\n".. - "\n", - "Der Teilchenbeschleuniger wird über ein TA4 Terminal gesteuert (nicht über das TA4 Lua Controller Terminal).\n".. - "\n".. - "Dieses Terminal muss mit dem Detektor verbunden werden. Die Nummer des Detektors wird als Infotext am Worker-Block angezeigt.\n".. - "\n".. - "Das Terminal unterstützt folgende Kommandos:\n".. - "\n".. - " - 'connect ' (verbinden mit dem Detektor)\n".. - " - 'start' (starten des Detektors)\n".. - " - 'stop' (stoppen des Detektors)\n".. - " - 'test ' (überprüfen eines Magneten)\n".. - " - 'points' (abfragen der bereits erreichten Erfahrungspunkte)\n".. - "\n".. - "Tritt beim 'start' an einem Magneten ein Fehler auf\\, so wird die Nummer des Magneten ausgegeben. Über das 'test' Kommando können weitere Informationen zum Fehler des Magneten angefordert werden.\n".. - "\n".. - "\n".. - "\n", - "Jeder TA4 Collider Magnet muss zusätzlich (wie rechts im Plan abgebildet) mit Strom sowie mit Isobutan zur Kühlung versorgt werden:\n".. - "\n".. - " - Der Anschluss für den Strom ist auf der Oberseite des Magneten.\n".. - " - Der Anschluss für die Kühlung ist auf der Vorderseite des Magneten.\n".. - " - Für die Kühlung der gesamten Anlage wird zusätzlich eine TA4 Pumpe und ein TA4 Tank mit mindestens 250 Einheiten Isobutan benötigt.\n".. - " - Die Anlage benötigt auch einiges an Strom. Daher ist eine eigene Stromversorgung mit mindestens 145 ku sinnvoll.\n".. - "\n".. - "\n".. - "\n", - "Beim Aufbau des Teilchenbeschleunigers empfiehlt sich folgende Reihenfolge:\n".. - "\n".. - " - Einen Forceload Block setzen. Nur der Detektor mit der Kühlanlage muss sich im Bereich des Forceload Blockes befinden.\n".. - " - Den Worker-Block setzen\\, mit Items füllen und den Detektor über das Menü aufbauen\n".. - " - Den Ring mit Röhren und Magneten aufbauen\n".. - " - Alle Magnete und den Detektor mit Stromkabel verbinden\n".. - " - Alle Magnete und den Detektor mit den gelben Röhren verbinden und das Isobutan mit einer Pumpe in das Röhrensystem pumpen.\n".. - " - Eine TA4 Pumpe als Vakuumpumpe auf dem Detektor installieren und einschalten (es wird kein zusätzlicher Tank benötigt). Geht die Pumpe in den \"standby\"\\, ist das Vakuum hergestellt. Dies dauert einige Sekunden\n".. - " - den Kühler (Wärmetauscher) aufbauen und mit dem Stromkabel verbinden\n".. - " - Das TA4 Terminal vor den Detektor setzen und über 'connect ' mit dem Detektor verbinden\n".. - " - Die Stromversorgung einschalten/herstellen\n".. - " - den Kühler (Wärmetauscher) einschalten\n".. - " - den Detektor über 'start' am TA4 Terminal einschalten. Der Detektor geht nach einigen Prüfschritten in den Normalbetrieb oder gibt einen Fehler aus.\n".. - " - Der Teilchenbeschleunigers muss im Dauerbetrieb laufen und liefert dann nach und nach Erfahrungspunkte. Für 10 Punkte muss der Teilchenbeschleuniger schon einige Stunden laufen.\n".. - "\n".. - "\n".. - "\n", - "", - "Im Rezept Block können bis zu 10 Rezepte gespeichert werden. Diese Rezepte können dann über ein TA4 Autocrafter Kommando abgerufen werden. Dies ermöglicht eine Rezept-Konfiguration des Autocrafters über ein Kommando. Die Rezepte des Rezept Blocks können auch direkt per Kommando abgefragt werden.\n".. - "\n".. - "'input ' liest ein Rezept aus dem TA4 Rezeptblock. '' ist die Nummer des Rezepts. Der Block gibt eine Liste von Rezept-Zutaten zurück. \n".. - "\n".. - "Beispiel: '$send_cmnd(1234\\, \"input\"\\, 1)'\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA3. \n".. - "\n".. - "Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Autocrafter benötigt hierfür 9 ku Strom.\n".. - "\n".. - "Zusätzlich unterstützt der TA4 Autocrafter die Auswahl unterschiedlicher Rezepte über folgende Kommandos:\n".. - "\n".. - "'recipe \".\"' schaltet den Autocrafter auf ein Rezept des TA4 Rezept Blocks um. '' ist die Nummer des Rezept Blocks\\, '' die Rezept-Nummer. Beispiel: '$send_cmnd(1234\\, \"recipe\"\\, \"5467.1\")'\n".. - "\n".. - "Alternativ kann ein Rezept auch über die Zutatenliste ausgewählt werden\\, wie bspw.:\n".. - "'$send_cmnd(1234\\, \"recipe\"\\, \"default:coal_lump\\,\\,\\,default:stick\")'\n".. - "Hier müssen alle technische Namen eines Rezeptes durch Kommas getrennt angegeben werden. Siehe auch das Kommando 'input' beim TA4 Rezept Block.\n".. - "\n".. - "Das Kommando 'flush' verschiebt alle Artikel vom Eingabeinventar in das Ausgabeinventar. Das Kommando liefert 'true' zurück\\, wenn das Eingabeinventar dabei vollständig geleert wurde. Falls 'false' zurückgeliefert wurde (Ausgabeinventar voll)\\, muss das Kommando zu einem späteren Zeitpunkt wiederholt werden.\n".. - "\n".. - "\n".. - "\n", - "Siehe TA3 Tank.\n".. - "\n".. - "In einen TA4 Tank passen 2000 Einheiten oder 200 Fässer einer Flüssigkeit.\n".. - "\n".. - "\n".. - "\n", - "Siehe TA3 Pumpe.\n".. - "\n".. - "Die TA4 Pumpe pumpt 8 Einheiten Flüssigkeit alle zwei Sekunden. \n".. - "\n".. - "In der Betriebsart \"Durchflussbegrenzer\" kann die Anzahl der Einheiten\\, die von der Pumpe gepumpt werden\\, begrenzt werden. Die Betriebsart Durchflussbegrenzer kann über das Gabelschlüssel-Menü aktiviert werden\\, indem im Menü die Anzahl an Einheiten konfiguriert wird. Sobald die konfigurierte Anzahl an Einheiten gepumpt wurden\\, schaltet sich die Pumpe ab. Wird die Pumpe wieder eingeschaltet\\, pumpt sie wieder die konfigurierte Anzahl an Einheiten und schaltet sich dann ab.\n".. - "\n".. - "Der Durchflussbegrenzer kann auch per Lua- oder Beduino Controller konfiguriert und gestartet werden.\n".. - "\n".. - "Zusätzlich unterstützt die Pumpe das Kommando 'flowrate'. Damit kann die Gesamtdurchflussmenge durch die Pumpe abgefragt werden.\n".. - "\n".. - "\n".. - "\n", - "Mit TA4 hat der Industrieofen auch seine elektrische Heizung. Der Ölbrenner und auch das Gebläse können mit der Ofenheizung ersetzt werden.\n".. - "\n".. - "Die Ofenheizung benötigt 14 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Dieser Block kann nicht mehr gecraftet werden und wird durch den TA4 Wassereinlass Block ersetzt.\n".. - "\n", - "Für manche Rezepte wird Wasser benötigt. Das Wasser muss mit einer Pumpe aus dem Meer (Wasser auf y = 1) gepumpt werden. Ein \"Pool\" aus ein paar Wasserblöcken ist dafür nicht ausreichend!\n".. - "\n".. - "Dazu muss der Wassereinlass-Block ins Wasser gesetzt und über Röhren mit der Pumpe verbunden werden. Wird der Block ins Wasser gesetzt\\, so muss darauf geachtet werden\\, dass sich unter dem Block Wasser befindet (Wasser muss mindestens 2 Blöcke tief sein). \n".. - "\n".. - "\n".. - "\n", - "TA4 hat auch seine eigenen Röhren im TA4 Design. Diese können wie Standard Röhren eingesetzt werden.\n".. - "Aber: TA4 Schieber und TA4 Verteiler erreichen ihre volle Leistungsfähigkeit nur beim Einsatz mit TA4 Röhren.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht grundsätzlich der von TA2/TA3. Zusätzlich kann aber über ein Menü konfiguriert werden\\, welche Gegenstände aus einer TA4 Kiste geholt und weiter transportiert werden sollen.\n".. - "Die Verarbeitungsleistung beträgt 12 Items alle 2 s\\, sofern auf beiden Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 6 Items alle 2 s.\n".. - "\n".. - "In der Betriebsart \"Durchlaufbegrenzer\" kann die Anzahl der Items\\, die von dem Schieber bewegt werden\\, begrenzt werden. Die Betriebsart Durchlaufbegrenzer kann über das Gabelschlüssel-Menü aktiviert werden\\, indem im Menü die Anzahl an Items konfiguriert wird. Sobald die konfigurierte Anzahl an Items bewegt wurden\\, schaltet sich der Schieber ab. Wird der Schieber wieder eingeschaltet\\, bewegt er wieder die konfigurierte Anzahl an Items und schaltet sich dann ab.\n".. - "\n".. - "Der TA4 Schieber kann auch per Lua- oder Beduino Controller konfiguriert und gestartet werden.\n".. - "\n".. - "Hier die zusätzlichen Kommandos für den Lua Controller:\n".. - "\n".. - " - 'config' dient zur Konfiguration des Schiebers\\, analog zum manuellen Konfiguration über das Menü.\nBeispiel: '$send_cmnd(1234\\, \"config\"\\, \"default:dirt\")'\nMit '$send_cmnd(1234\\, \"config\"\\, \"\")' wird die Konfiguration gelöscht\n".. - " - 'limit' dient zum Setzen der Anzahl der Items für die Durchlaufbegrenzer Betriebsart:\nBeispiel: '$send_cmnd(1234\\, \"init\"\\, 7)'\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA3. Die Kiste kann aber mehr Inhalt aufnehmen.\n".. - "\n".. - "Zusätzlich besitzt die TA4 Kiste ein Schatteninventar zur Konfiguration. Hier können bestimmte Speicherplätze mit einem Item vorbelegt werden. Vorbelegte Speicherplätze werden beim Füllen nur mit diesen Items belegt. Zum Leeren eines vorbelegten Speicherplatzes wird ein TA4 Schieber oder TA4 Injektor mit entsprechender Konfiguration benötigt.\n".. - "\n".. - "\n".. - "\n", - "Die TA4 8x2000 Kiste hat kein normales Inventar wir andere Kisten\\, sondern verfügt über 8 Speicher\\, wobei jeder Speicher bis zu 2000 Items einer Sorte aufnehmen kann. Über die orangefarbenen Taster können Items in den Speicher verschoben bzw. wieder heraus geholt werden. Die Kiste kann auch wie sonst üblich mit einem Schieber (TA2\\, TA3 oder TA4) gefüllt bzw. geleert werden.\n".. - "\n".. - "Wird die Kiste mit einem Schieber gefüllt\\, so füllen sich alle Speicherplätze von links nach rechts. Sind alle 8 Speicher voll und können keine weiteren Items hinzugefügt werden\\, so werden weitere Items werden abgewiesen.\n".. - "\n".. - "*Reihenfunktion*\n".. - "\n".. - "Mehrere TA4 8x2000 Kisten können zu einer großen Kiste mit mehr Inhalt verbunden werden. Dazu müssen die Kisten in einer Reihe hintereinander gesetzt werden.\n".. - "\n".. - "Zuerst muss die Front-Kiste gesetzt werden\\, dann werden die Stapel-Kisten mit gleicher Blickrichtung dahinter gesetzt (alle Kisten haben die Front in Richtung Spieler). Bei 2 Kisten in Reihe erhöht sich die Größe auf 8x4000\\, usw.\n".. - "\n".. - "Die angereihten Kisten können nun nicht mehr entfernt werden. Um die Kisten wieder abbauen zu können\\, gibt es zwei Möglichkeiten:\n".. - "\n".. - " - Die Frontkiste leeren und entfernen. Damit wird die nächste Kiste entsperrt und kann entfernt werden.\n".. - " - Die Frontkiste soweit leeren dass alle Speicherplätzen maximal 2000 Items beinhalten. Damit wird die nächste Kiste entsperrt und kann entfernt werden.\n".. - "\n".. - "Die Kisten haben eine \"Reihenfolge\" Checkbox. Wird diese Checkbox aktiviert\\, werden die Speicherplätze durch einen Schieber nicht mehr vollständig entleert. Das letzte Item verbleibt als Vorbelegung in dem Speicherplatz. Damit ergibt sich eine feste Zuordnung von Items zu Speicherplätzen.\n".. - "\n".. - "Die Kiste kann nur von den Spielern genutzt werden\\, die an diesem Ort auch bauen können\\, also Protection Rechte besitzen. Es spielt dabei keine Rolle\\, wer die Kiste setzt. \n".. - "\n".. - "Der Kiste besitzt ein zusätzliches Kommandos für den Lua Controller:\n".. - "\n".. - " - 'count' dient zur Anfrage\\, wie viele Items in der Kiste sind.\nBeispiel 1: '$send_cmnd(CHEST\\, \"count\")' --> Summe der Items über alle 8 Speicher\nBeispiel 2: '$send_cmnd(CHEST\\, \"count\"\\, 2)' --> Anzahl der Items in Speicher 2 (zweiter von links)\n".. - " - 'storesize' wird verwendet\\, um die Größe eines der acht Speicher auszulesen\nBeispiel: '$send_cmnd(CHEST\\, \"storesize\")' -> Funktion liefert bspw. 6000 zurück\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 24 Items alle 4 s\\, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 12 Items alle 4 s.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht dem normalen TA4 Verteiler\\, mit zwei Unterschieden:\n".. - "Die Verarbeitungsleistung beträgt 36 Items alle 4 s\\, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s.\n".. - "Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 5 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2.\n".. - "Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 9 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht weitgehend der von TA2. \n".. - "\n".. - "Zusätzlich kann die Lochgröße zwischen 3x3 und 11x11 Blöcken eingestellt werden. \n".. - "Die maximale Tiefe beträgt 80 Meter. Der Steinbrecher benötigt 14 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA2\\, nur werden hier verschiedene Chips produziert.\n".. - "Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierfür 12 ku Strom.\n".. - "\n".. - "\n".. - "\n", - "Die Funktion entspricht der von TA3. \n".. - "\n".. - "Die Verarbeitungsleistung beträgt bis zu 8 mal vier Items alle 4 Sekunden.\n".. - "\n".. - "\n".. - "\n", - "Der Recycler ist eine Maschine\\, die alle Techage Rezepte rückwärts abarbeitet\\, also Maschinen und Blöcke wieder in die Bestandteile zerlegen kann. Die Maschine kann so ziemlich alle Techage und Hyperloop Blöcke zerlegen.\n".. - "Aber nicht alle Zutaten/Materialien der Rezepte lassen sich recyclen:\n".. - "\n".. - " - Holz wird zu Sticks\n".. - " - Stein wird zu Sand oder Kies\n".. - " - Halbleiter/Chips können nicht recycelt werden\n".. - " - Werkzeuge können nicht recycelt werden\n".. - "\n".. - "Die Verarbeitungsleistung beträgt ein Item alle 8 s. Der Block benötigt hierfür 16 ku Strom.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta4", - "", - "ta4_windturbine", - "ta4_nacelle", - "ta4_blinklamp", - "ta4_pillar", - "", - "ta4_solarmodule", - "ta4_solarcarrier", - "ta4_solar_inverter", - "ta4_powercable", - "ta4_powerbox", - "ta4_minicell", - "", - "ta4_heatexchanger", - "ta4_turbine", - "ta4_generator", - "ta4_pipeinlet", - "ta4_pipe", - "ta4_transformer", - "ta4_transformer", - "ta4_electricmeter", - "ta4_laser", - "ta4_hydrogen", - "ta4_electrolyzer", - "ta4_fuelcell", - "", - "ta4_doser", - "ta4_reactor", - "ta4_fillerpipe", - "ta4_reactorstand", - "ta4_reactorbase", - "ta4_silo", - "ta4_icta_controller", - "ta4_icta_controller", - "ta4_battery", - "ta4_display", - "ta4_displayXL", - "ta4_signaltower", - "ta4_lua_controller", - "ta4_lua_server", - "ta4_sensor_chest", - "ta4_terminal", - "", - "ta4_button", - "ta4_button_2x", - "ta4_button_4x", - "ta4_signallamp_2x", - "ta4_signallamp_4x", - "ta4_playerdetector", - "ta4_collector", - "ta4_detector", - "ta4_nodedetector", - "ta4_chargedetector", - "ta4_gaze_sensor", - "ta4_sequencer", - "", - "ta4_movecontroller", - "ta4_turncontroller", - "", - "ta4_growlight", - "ta4_streetlamp", - "ta4_industriallamp", - "ta4_liquid_filter", - "", - "", - "", - "", - "", - "ta4_terminal", - "", - "techage_ta4c", - "", - "ta4_recipeblock", - "ta4_autocrafter", - "ta4_tank", - "ta4_pump", - "ta4_furnaceheater", - "", - "ta4_waterinlet", - "ta4_tube", - "ta4_pusher", - "ta4_chest", - "ta4_8x2000_chest", - "ta4_distributor", - "ta4_high_performance_distributor", - "ta4_gravelsieve", - "ta4_grinder", - "ta4_quarry", - "ta4_electronicfab", - "ta4_injector", - "ta4_recycler", - }, - plans = { - "", - "ta4_windturbine", - "", - "", - "", - "", - "ta4_solarplant", - "", - "", - "", - "", - "", - "", - "ta4_storagesystem", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_reactor", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_liquid_filter_base", - "ta4_liquid_filter_gravel", - "ta4_liquid_filter_top", - "techage_collider_plan", - "ta4_cooler", - "", - "techage_collider_plan2", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta4_EN.lua b/techage/doc/manual_ta4_EN.lua deleted file mode 100644 index 32faa51..0000000 --- a/techage/doc/manual_ta4_EN.lua +++ /dev/null @@ -1,1054 +0,0 @@ -return { - titles = { - "1,TA4: Present", - "2,Wind Turbine", - "3,TA4 Wind Turbine", - "3,TA4 Wind Turbine Nacelle", - "3,TA4 Wind Turbine Signal Lamp", - "3,TA4 Pillar", - "2,Solar System", - "3,TA4 Solar Module", - "3,TA4 Solar Carrier Module", - "3,TA4 Solar Inverter", - "3,TA4 Low Power Cable", - "3,TA4 Low Voltage Junction Box", - "3,TA4 Street Lamp Solar Cell", - "2,Thermal Energy Storage", - "3,TA4 Heat Exchanger", - "3,TA4 Turbine", - "3,TA4 Generator", - "3,TA4 Pipe Inlet", - "3,TA4 Pipe", - "2,Power Distribution", - "3,TA4 Isolation Transformer", - "3,TA4 Electric Meter", - "3,TA4 Laser", - "2,Hydrogen", - "3,Electrolyzer", - "3,Fuel Cell", - "2,Chemical Reactor", - "3,TA4 Doser", - "3,TA4 Reactor", - "3,TA4 Filler Pipe", - "3,TA4 Reactor Stand", - "3,TA4 Reactor Base", - "3,TA4 Silo", - "2,ICTA Controller", - "3,TA4 ICTA controller", - "3,Battery", - "3,TA4 Display", - "3,TA4 Display XL", - "3,TA4 Signal Tower", - "2,TA4 Lua Controller", - "3,TA4 Lua Server", - "3,TA4 Sensor Box / Chest", - "3,TA4 Lua Controller Terminal", - "2,TA4 Logic/Switching Modules", - "3,TA4 Button/Switch", - "3,TA4 2x Button", - "3,TA4 4x Button", - "3,TA4 2x Signal Lamp", - "3,TA4 4x Signal Lamp", - "3,TA4 Player Detector", - "3,TA4 State Collector", - "3,TA4 Detector", - "3,TA4 Node Detector", - "3,TA4 Energy Storage Charge Detector", - "3,TA4 Gaze Sensor", - "3,TA4 Sequencer", - "2,Move/Turn Controller", - "3,TA4 Move Controller", - "3,TA4 Turn Controller", - "2,TA4 Lamps", - "3,TA4 LED Grow Light", - "3,TA4 Street Lamp", - "3,TA4 LED Industrial Lamp", - "2,TA4 Liquid Filter", - "3,Base Layer", - "3,Gravel Layer", - "3,Filling Layer", - "2,TA4 Collider (Particle Accelerator)", - "3,Detector", - "3,Control / TA4 Terminal", - "3,Cooling and power", - "3,Construction", - "2,More TA4 Blocks", - "3,TA4 Recipe Block", - "3,TA4 Autocrafter", - "3,TA4 Tank", - "3,TA4 Pump", - "3,TA4 Furnace Heater", - "3,TA4 Water Pump (deprecated)", - "3,TA4 Water Inlet", - "3,TA4 Tube", - "3,TA4 Pusher", - "3,TA4 Chest", - "3,TA4 8x2000 Chest", - "3,TA4 Distributor", - "3,TA4 High Performance Distributor", - "3,TA4 Gravel Sieve", - "3,TA4 Grinder", - "3,TA4 Quarry", - "3,TA4 Electronic Fab", - "3,TA4 Injector", - "3,TA4 Recycler", - }, - texts = { - "Renewable energy sources such as wind\\, sun and biofuels help you to leave the oil age. With modern technologies and intelligent machines you set out into the future.\n".. - "\n".. - "\n".. - "\n", - "A wind turbine always supplies electricity when there is wind. There is no wind in the game\\, but the mod simulates this by turning the wind turbines only in the morning (5:00 - 9:00) and in the evening (17:00 - 21:00). A wind turbine only supplies electricity if it is set up in a suitable location.\n".. - "\n".. - "The TA wind power plants are pure offshore plants\\, which means that they have to be built in the sea. This means that wind turbines can only be build in a sea (occean) biome and that there must be sufficient water and a clear view around the mast.\n".. - "\n".. - "To find a suitable spot\\, click on the water with the wrench (TechAge Info Tool). A chat message will show you whether this position is suitable for the mast of the wind turbine.\n".. - "\n".. - "The current must be led from the rotor block down through the mast. First pull the power line up and then \"plaster\" the power cable with TA4 pillar blocks. A work platform can be built below. The plan on the right shows the structure in the upper part.\n".. - "\n".. - "The wind turbine delivers 70 ku\\, but only 8 hours a day (see above).\n".. - "\n".. - "\n".. - "\n", - "The wind turbine block (rotor) is the heart of the wind turbine. This block must be placed on top of the mast. Ideally at Y = 15\\, then you just stay within a map / forceload block.\n".. - "When you start the turbine\\, all conditions for the operation of the wind turbine are checked. If all conditions are met\\, the rotor blades (wings) appear automatically. Otherwise you will get an error message.\n".. - "\n".. - "\n".. - "\n", - "This block must be placed on the black end of the wind turbine block.\n".. - "\n".. - "\n".. - "\n", - "This flashing light is only for decorative purposes and can be placed on top of the wind turbine block.\n".. - "\n".. - "\n".. - "\n", - "This builds the mast for the wind turbine. However\\, these blocks are not set by hand but must be set with the help of a trowel\\, so that the power line to the mast tip is replaced with these blocks (see under TA power cable).\n".. - "\n".. - "\n".. - "\n", - "The solar system only produces electricity when the sun is shining. In the game this is every game day from 6:00 am to 6:00 pm.\n".. - "The same power is always available during this time. After 6:00 p.m.\\, the solar modules switch off completely.\n".. - "\n".. - "The biome temperature is decisive for the performance of the solar modules. The hotter the temperature\\, the higher the yield.\n".. - "The biome temperature can be determined with the Techage Info Tool (wrench). It typically fluctuates between 0 and 100:\n".. - "\n".. - " - full power is available at 100\n".. - " - at 50\\, half the power is available\n".. - " - at 0 there is no service available\n".. - "\n".. - "It is therefore advisable to look for hot steppes and deserts for the solar system.\n".. - "The overhead lines are available for the transport of electricity.\n".. - "However\\, hydrogen can also be produced\\, which can be transported and converted back into electricity at the destination.\n".. - "\n".. - "The smallest unit in a solar system is two solar modules and one carrier module. The carrier module must be placed first\\, the two solar modules to the left and right next to it (not above!).\n".. - "\n".. - "The plan on the right shows 3 units\\, each with two solar modules and one carrier module\\, connected to the inverter via red cables.\n".. - "\n".. - "Solar modules supply DC voltage\\, which cannot be fed directly into the power grid. Therefore\\, the solar units must first be connected to the inverter via the red cable. This consists of two blocks\\, one for the red cable to the solar modules (DC) and one for the gray power cable to the power grid (AC).\n".. - "\n".. - "The map area where the solar system is located must be fully loaded. This also applies to the direct position above the solar module\\, because the light intensity is regularly measured there. It is therefore advisable to first set a forceload block and then to place the modules within this area.\n".. - "\n".. - "\n".. - "\n", - "The solar module must be placed on the carrier module. Two solar modules are always required.\n".. - "In a pair\\, the solar modules perform up to 3 ku\\, depending on the temperature.\n".. - "With the solar modules\\, care must be taken that they have full daylight and are not shaded by blocks or trees. This can be tested with the Info Tool (wrench).\n".. - "\n".. - "\n".. - "\n", - "The carrier module is available in two heights (1m and 2m). Both are functionally identical.\n".. - "The carrier modules can be placed directly next to one another and thus connected to form a row of modules. The connection to the inverter or to other module series must be made with the red low-voltage cables or the low-voltage junction boxes.\n".. - "\n".. - "\n".. - "\n", - "The inverter converts the solar power (DC) into alternating current (AC) so that it can be fed into the power grid.\n".. - "An inverter can feed a maximum of 100 ku of electricity\\, which corresponds to 33 solar modules or more.\n".. - "\n".. - "\n".. - "\n", - "The low voltage cable is used to connect rows of solar modules to the inverter. The cable must not be used for other purposes.\n".. - "\n".. - "The maximum cable length is 200 m.\n".. - "\n".. - "\n".. - "\n", - "The junction box must be placed on the floor. It has only 4 connections (in the 4 directions).\n".. - "\n".. - "\n".. - "\n", - "As the name suggests\\, the street lamp solar cell is used to power a street lamp. A solar cell can supply two lamps (1 ku). The solar cell stores the sun's energy during the day and delivers the electricity to the lamp at night. That means the lamp only glows in the dark.\n".. - "\n".. - "This solar cell cannot be combined with the other solar modules.\n".. - "\n".. - "\n".. - "\n", - "The thermal energy storage replaces the battery block from TA3.\n".. - "\n".. - "The thermal energy store consists of a concrete shell (concrete blocks) filled with gravel. Five sizes of the storage are possible:\n".. - "\n".. - " - Cover with 5x5x5 concrete blocks\\, filled with 27 gravel\\, storage capacity: 22.5 kud\n".. - " - Cover with 7x7x7 concrete blocks\\, filled with 125 gravel\\, storage capacity: 104 kud\n".. - " - Cover with 9x9x9 concrete blocks\\, filled with 343 gravel\\, storage capacity: 286 kud\n".. - " - Cover with 11x11x11 concrete blocks\\, filled with 729 gravel\\, storage capacity: 610 kud\n".. - " - Cover with 13x13x13 concrete blocks\\, filled with 1331 gravel\\, storage capacity: 1112 kud\n".. - "\n".. - "A window made of an obsidian glass block may be in the concrete shell. This must be placed fairly in the middle of the wall. Through this window you can see whether the storage is loaded more than 80%. In the plan on the right you can see the structure of TA4 heat exchanger consisting of 3 blocks\\, the TA4 turbine and the TA4 generator. Pay attention to the alignment of the heat exchanger (the arrow at block 1 must point to the turbine).\n".. - "\n".. - "Contrary to the plan on the right\\, the connections on the storage block must be on the same level (arranged horizontally\\, i.e. not below and above). The pipe inlets (TA4 Pipe Inlet) must be exactly in the middle of the wall and face each other. The yellow TA4 pipes are used as steam pipes. The TA3 steam pipes cannot be used here.\n".. - "Both the generator and the heat exchanger have a power connection and must be connected to the power grid.\n".. - "\n".. - "In principle\\, the heat storage system works exactly the same as the batteries\\, only with much more storage capacity.\n".. - "\n".. - "In order for the heat storage system to work\\, all blocks (also the concrete shell and gravel) must be loaded using a forceload block.\n".. - "\n".. - "\n".. - "\n", - "The heat exchanger consists of 3 parts that must be placed on top of each other\\, with the arrow of the first block pointing towards the turbine. The pipes must be built with the yellow TA4 pipes.\n".. - "The heat exchanger must be connected to the power grid. The energy storage device is recharged via the heat exchanger\\, provided that sufficient electricity is available. \n".. - "\n".. - "\n".. - "\n", - "The turbine is part of the energy storage. It must be placed next to the generator and connected to the heat exchanger via TA4 tubes as shown in the plan.\n".. - "\n".. - "\n".. - "\n", - "The generator is used to generate electricity. Therefore\\, the generator must also be connected to the power grid.\n".. - "The generator is part of the energy storage. It is used to generate electricity and thus releases the energy from the energy storage unit. Therefore\\, the generator must also be connected to the power grid.\n".. - "\n".. - "Important: Both\\, heat exchanger and generator must be connected to the same power grid! \n".. - "\n".. - "\n".. - "\n", - "One pipe inlet block each must be installed on both sides of the storage block. The blocks must face each other exactly.\n".. - "\n".. - "The pipe inlet blocks *cannot* be used as normal wall openings\\, use the TA3 pipe wall entry blocks instead.\n".. - "\n".. - "\n".. - "\n", - "With TA4\\, the yellow pipes are used for the transmission of gas and liquids.\n".. - "The maximum cable length is 100 m.\n".. - "\n".. - "\n".. - "\n", - "With the help of power cables and junction boxes\\, power networks of up to 1000 blocks/nodes can be set up. However\\, it should be noted that distribution boxes must also be counted. This means that up to 500 generators/storage systems/machines/lamps can be connected to a power grid.\n".. - "\n".. - "With the help of an isolating transformer and electricity meter\\, networks can be connected to form even larger structures.\n".. - "\n".. - "\n".. - "\n", - "With the help of an isolating transformer\\, two power grids can be connected to form a larger network. The isolation transformer can transmit electricity in both directions.\n".. - "\n".. - "The isolation transformer can transmit up to 300 ku. The maximum value is adjustable via the wrench menu.\n".. - "\n".. - "\n".. - "\n", - "With the help of an electricity meter\\, two electricity networks can be connected to form a larger network. The electricity meter only transmits electricity in one direction (note arrow). The amount of electrical energy passed through (in kud) is measured and displayed. This value can also be queried by a Lua controller using the 'consumption' command. The current current can be queried via the command 'current'.\n".. - "\n".. - "The electricity meter can pass up to 200 ku. The maximum value is adjustable via the wrench menu.\n".. - "\n".. - "A power output countdown can also be entered via the wrench menu. When this countdown reaches zero\\, the electricity meter switches off. The countdown can be queried using the 'countdown' command.\n".. - "\n".. - "\n".. - "\n", - "The TA4 laser is used for wireless power transmission. Two blocks are required for this: TA4 Laser Beam Emitter and TA4 Laser Beam Receiver. There must be an air gap between the two blocks so that the laser beam can be built up from the emitter to the receiver. First the emitter must be placed. This immediately switches on the laser beam and shows possible positions of the receiver. Possible positions for the receiver are also output via a chat message. \n".. - "\n".. - "With the laser\\, distances of up to 96 blocks can be bridged. Once the connection has been established (no current has to flow)\\, this is indicated via the info text of the emitter and also of the receiver. \n".. - "\n".. - "The laser blocks themselves do not require any electricity.\n".. - "\n".. - "\n".. - "\n", - "Electrolysis can be used to split electricity into hydrogen and oxygen. On the other hand\\, hydrogen can be converted back into electricity with oxygen from the air using a fuel cell.\n".. - "This enables current peaks or an excess supply of electricity to be converted into hydrogen and thus stored.\n".. - "\n".. - "In the game\\, electricity can be converted back into electricity via the fuel cell using the electrolyzer in hydrogen and hydrogen.\n".. - "This means that electricity (in the form of hydrogen) can not only be stored in tanks\\, but also transported by means of the tank cart.\n".. - "\n".. - "However\\, the conversion of electricity into hydrogen and back is lossy. Out of 100 units of electricity\\, only 95 units of electricity come out after the conversion to hydrogen and back.\n".. - "\n".. - "\n".. - "\n", - "The electrolyzer converts electricity into hydrogen.\n".. - "It must be powered from the left. On the right\\, hydrogen can be extracted via pipes and pumps.\n".. - "\n".. - "The electrolyzer can draw up to 35 ku of electricity and then generates a hydrogen item every 4 s.\n".. - "200 units of hydrogen fit into the electrolyzer.\n".. - "\n".. - "The electrolyzer has a wrench menu for setting the current consumption and the switch-off point.\n".. - "\n".. - "If the power stored in the power grid falls below the specified value of the switch-off point\\, the electrolyzer switches off automatically. This prevents the storage systems from running empty.\n".. - "\n".. - "\n".. - "\n", - "The fuel cell converts hydrogen into electricity.\n".. - "It must be supplied with hydrogen from the left by a pump. The power connection is on the right.\n".. - "\n".. - "The fuel cell can deliver up to 34 ku of electricity and needs a hydrogen item every 4 s.\n".. - "\n".. - "Usually the fuel cell works as a category 2 generator (like other storage systems). \n".. - "In this case\\, no other category 2 blocks such as the battery block can be charged. However\\, the fuel cell can also be used as a category 1 generator via the check box.\n".. - "\n".. - "\n".. - "\n", - "The reactor is used to process the ingredients obtained from the distillation tower or from other recipes into new products.\n".. - "The plan on the left shows only one possible variant\\, since the arrangement of the silos and tanks depends on the recipe.\n".. - "\n".. - "The primary output product is always output to the side of the reactor stand\\, regardless of whether it is a powder or a liquid. The (secondary) waste product is always discharged at the bottom of the reactor stand.\n".. - "\n".. - "A reactor consists of:\n".. - "\n".. - " - Various tanks and silos with the ingredients that are connected to the doser via pipes\n".. - " - optionally a reactor base\\, which discharges the waste from the reactor (only necessary for recipes with two output products)\n".. - " - the reactor stand\\, which must be placed on the base (if available). The stand has a power connection and draws 8 ku during operation.\n".. - " - The reactor vessel that has to be placed on the reactor stand\n".. - " - The filler pipe that must be placed on the reactor vessel\n".. - " - The dosing device\\, which has to be connected to the tanks or silos and the filler pipe via pipes\n".. - "\n".. - "Note 1: Liquids are only stored in tanks\\, solids and substances in powder form only in silos. This applies to ingredients and output products.\n".. - "\n".. - "Note 2: Tanks or silos with different contents must not be connected to a pipe system. In contrast\\, several tanks or silos with the same content may hang in parallel on one line.\n".. - "\n".. - "Cracking breaks long chains of hydrocarbons into short chains using a catalyst.\n".. - "Gibbsite powder serves as a catalyst (is not consumed). It can be used to convert bitumen into fueloil\\, fueloil into naphtha and naphtha into gasoline.\n".. - "\n".. - "In hydrogenation\\, pairs of hydrogen atoms are added to a molecule to convert short-chain hydrocarbons into long ones.\n".. - "Here iron powder is required as a catalyst (is not consumed). It can be used to convert gas (propane) into isobutane\\,\n".. - "isobutane into gasoline\\, gasoline into naphtha\\, naphtha into fueloil\\, and fueloil into bitumen.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor.\n".. - "Pipes for input materials can be connected on all 4 sides of the doser. The materials for the reactor are discharged upwards.\n".. - "\n".. - "The recipe can be set and the reactor started via the doser.\n".. - "\n".. - "As with other machines:\n".. - "\n".. - " - if the doser is in standby mode\\, one or more ingredients are missing\n".. - " - if the doser is in the blocked state\\, the output tank or silo is full\\, defective or incorrectly connected\n".. - "\n".. - "The doser does not need any electricity. A recipe is processed every 10 s.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. The reactor has a inventory for the catalyst items (for cracking and hydrogenation recipes).\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Must be placed on the reactor. If this does not work\\, remove the pipe at the position above and place it again.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Here is also the power connection for the reactor. The reactor requires 8 ku of electricity.\n".. - "\n".. - "The stand has two pipe connections\\, to the right for the starting product and down for the waste\\, such as red mud in aluminum production.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Is required for the drainage of the waste product.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Is required to store substances in powder or granule form.\n".. - "\n".. - "\n".. - "\n", - "The ICTA controller (ICTA stands for \"If Condition Then Action\") is used to monitor and control machines. The controller can be used to read in data from machines and other blocks and\\, depending on this\\, switch other machines and blocks on / off.\n".. - "\n".. - "Machine data is read in and blocks and machines are controlled using commands. Chapter TA3 -> Logic / switching blocks is important for understanding how commands work.\n".. - "\n".. - "The controller requires a battery to operate. The display is used to output data\\, the signal tower to display errors.\n".. - "\n".. - "\n".. - "\n", - "The controller works on the basis of 'IF THEN ' rules. Up to 8 rules can be created per controller.\n".. - "\n".. - "Examples of rules are:\n".. - "\n".. - " - If a distributor is 'blocked'\\, the pusher in front of it should be switched off\n".. - " - If a machine shows an error\\, this should be shown on the display\n".. - "\n".. - "The controller checks these rules cyclically. To do this\\, a cycle time in seconds (`` Cycle / s '') must be specified for each rule (1..1000).\n".. - "\n".. - "For rules that evaluate an on / off input\\, e.g. from a switch or detector\\, cycle time 0 must be specified. The value 0 means that this rule should always be carried out when the input signal has changed\\, e.g. the button has sent a new value.\n".. - "\n".. - "All rules should only be executed as often as necessary. This has two advantages:\n".. - "\n".. - " - the battery of the controller lasts longer (each controller needs a battery)\n".. - " - the load for the server is lower (therefore fewer lags)\n".. - "\n".. - "You have to set a delay time ('after/s') for each action. If the action is to be carried out immediately\\, 0 must be entered.\n".. - "\n".. - "The controller has its own help and information on all commands via the controller menu.\n".. - "\n".. - "\n".. - "\n", - "The battery must be placed in close proximity to the controller\\, i.e. in one of the 26 positions around the controller.\n".. - "\n".. - "\n".. - "\n", - "The display shows its number after placement. The display can be addressed via this number. Texts can be output on the display\\, whereby the display can display 5 lines and thus 5 different texts.\n".. - "\n".. - "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. - "\n".. - "The display is updated at most once per second.\n".. - "\n".. - "\n".. - "\n", - "The TA4 Display XL is twice the size of the TA4 display.\n".. - "\n".. - "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. - "\n".. - "The display is updated every two seconds at most.\n".. - "\n".. - "\n".. - "\n", - "The signal tower can display red\\, green and orange. A combination of the 3 colors is not possible.\n".. - "\n".. - "\n".. - "\n", - "As the name suggests\\, the Lua controller must be programmed in the Lua programming language. The manual in English is here available:\n".. - "\n".. - "https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md\n".. - "\n".. - "The Lua controller also requires a battery. The battery must be placed in close proximity to the controller\\, i.e. in one of the 26 positions around the controller.\n".. - "\n".. - "\n".. - "\n", - "The server is used for the central storage of data from several Lua controllers. It also saves the data after a server restart.\n".. - "\n".. - "\n".. - "\n", - "The TA4 sensor box is used to set up automatic warehouses or vending machines in conjunction with the Lua controller.\n".. - "If something is put into the box or removed\\, or one of the \"F1\" / \"F2\" keys is pressed\\, an event signal is sent to the Lua controller.\n".. - "The sensor box supports the following commands:\n".. - "\n".. - " - The status of the box can be queried via 'state = $send_cmnd(\\, \"state\")'. Possible answers are: \"empty\"\\, \"loaded\"\\, \"full\"\n".. - " - The last player action can be queried via 'name\\, action = $send_cmnd(\\, \"action\")'. 'name' is the player name. One of the following is returned as 'action': \"put\"\\, \"take\"\\, \"f1\"\\, \"f2\".\n".. - " - The contents of the box can be read out via 'stacks = $send_cmnd(\\, \"stacks\")'. See: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest\n".. - " - Via '$send_cmnd(\\, \"text\"\\, \"press both buttons andnput something into the chest\")' the text can be set in the menu of the sensor box.\n".. - "\n".. - "The checkbox \"Allow public chest access\" can be used to set whether the box can be used by everyone or only by players who have access/protection rights here.\n".. - "\n".. - "\n".. - "\n", - "The terminal is used for input / output for the Lua controller.\n".. - "\n".. - "\n".. - "\n", - "", - "Only the appearance of the TA4 button/switch has changed. The functionality is the same as with the TA3 button/switch. With the wrench menu\\, however\\, the data can be changed later.\n".. - "\n".. - "\n".. - "\n", - "This block has two buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition\\, the command that is to be sent can be configured for each button. \n".. - "\n".. - "\n".. - "\n", - "This block has four buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition\\, the command that is to be sent can be configured for each button. \n".. - "\n".. - "\n".. - "\n", - "This block has two lamps that can be controlled individually. Each lamp can display the colors \"red\"\\, \"green\" and \"amber\". The labeling for both lamps can be configured via the wrench menu. The lamps can be controlled using the following commands:\n".. - "\n".. - " - Switch lamp 1 to red: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Switch lamp 2 to green: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Switch lamp 1 to orange: '$send_cmnd(1234\\, \"amber\"\\, 1)'\n".. - " - Switch lamp 2 off: '$send_cmnd(1234\\, \"off\"\\, 2)'\n".. - "\n".. - "\n".. - "\n", - "This block has four lamps that can be controlled individually. Each lamp can display the colors \"red\"\\, \"green\" and \"amber\". The labeling for all lamps can be configured via the wrench menu. The lamps can be controlled using the following commands:\n".. - "\n".. - " - Switch lamp 1 to red: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Switch lamp 2 to green: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Switch lamp 3 to orange: '$send_cmnd(1234\\, \"amber\"\\, 3)'\n".. - " - Switch lamp 4 off: '$send_cmnd(1234\\, \"off\"\\, 4)'\n".. - "\n".. - "\n".. - "\n", - "Only the appearance of the TA4 player detector has changed. The functionality is the same as with the TA3 player detector.\n".. - "\n".. - "\n".. - "\n", - "\n".. - "\n".. - "The status collector queries all configured machines in turn for the status. If one of the machines has reached or exceeded a preconfigured status\\, an \"on\" command is sent. For example\\, many machines can be easily monitored for faults from a Lua controller.\n".. - "\n", - "The functionality is the same as for the TA3 detector. In addition\\, the detector counts the items passed on.\n".. - "This counter can be queried with the 'count' command and reset with 'reset'.\n".. - "\n".. - "\n".. - "\n", - "The functionality is the same as with the TA3 Node Detector.\n".. - "\n".. - "In contrast to the TA3 node detector\\, the positions to be monitored can be configured individually here. To do this\\, the \"Record\" button must be pressed. Then all blocks must be clicked\\, the position of which is to be checked. Then the \"Done\" button must be pressed.\n".. - "\n".. - "Up to 4 blocks can be selected.\n".. - "\n".. - "\n".. - "\n", - "The charge detector measures the state of charge of the power grid's energy storage every 8 s.\n".. - "\n".. - "If the value falls below a configurable threshold (switching point)\\, a command (default: \"off\") is sent. If the value rises above this switching point again\\, a second command (default: \"on\") is sent. This allows consumers to be disconnected from the grid when the charge level of the energy storage device falls below the specified switching point.\n".. - "\n".. - "To do this\\, the charge detector must be connected to the grid via a junction box. The charge detector is configured via the open-end wrench menu.\n".. - "\n".. - "\n".. - "\n", - "The TA4 gaze sensor generates a command when the block is viewed/focused by the owner or other configured players and sends a second command when the block is no longer focused. It thus serves as a replacement for buttons/switches\\, for example to open/close doors.\n".. - "\n".. - "The TA4 Gaze Sensor can only be programmed using the open-end wrench menu. If you have an open-end wrench in your hand\\, the sensor does not trigger\\, even if it is focused.\n".. - "\n".. - "\n".. - "\n", - "Entire processes can be programmed using the TA4 sequencer. Here's an example:\n".. - "\n".. - " -- this is a comment\n".. - " \\[1\\] send 1234 a2b\n".. - " \\[30\\] send 1234 b2a\n".. - " \\[60\\] goto 1\n".. - "\n".. - " - Each line begins with a number which corresponds to a point in time '\\[\\]'\n".. - " - Values from 1 to 50000 are permitted for times\n".. - " - 1 corresponds to 100 ms\\, 50000 corresponds to about 4 game days\n".. - " - Empty lines or comments are allowed ('-- comment')\n".. - " - With 'send ' you can send a command to a block\n".. - " - With 'goto ' you can jump to another line / point in time\n".. - " - With 'stop' you can stop the sequencer with a delay so that it does not receive a new command\naccepts from a button or other block (to complete a movement)\nWithout 'stop'\\, the sequencer goes into stopped mode immediately after the last command.\n".. - "\n".. - "The TA4 sequencer supports the following techage commands:\n".. - "\n".. - " - 'goto ' Jump to a command line and start the sequencer\n".. - " - 'stop' Stop the sequencer\n".. - " - 'on' and 'off' as aliases for 'goto 1' resp. 'stop'\n".. - "\n".. - "The 'goto' command is only accepted when the sequencer is stopped.\n".. - "\n".. - "The cycle time (default: 100 ms) can be changed for the sequencer via the open-end wrench menu.\n".. - "\n".. - "\n".. - "\n", - "", - "The TA4 Move Controller is similar to \"Door Controller 2\"\\, but the selected blocks are not removed\\, but can be moved.\n".. - "Since the moving blocks can take players and mobs standing on the block with them\\, elevators and similar transport systems can be built with them.\n".. - "\n".. - "Instructions:\n".. - "\n".. - " - Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained)\n".. - " - the \"flight route\" must be entered via an x\\, y\\, z specification (relative) (the maximum distance (x+y+z) is 200 m)\n".. - " - The movement can be tested with the menu buttons \"Move A-B\" and \"Move B-A\"\n".. - " - you can also fly through walls or other blocks\n".. - " - The target position for the blocks can also be occupied. In this case\\, the blocks are saved \"invisibly\". This is intended for sliding doors and the like\n".. - "\n".. - "The Move Controller supports the following techage commands:\n".. - "\n".. - " - 'a2b' Move block from A to B.\n".. - " - 'b2a' Move block from B to A.\n".. - " - 'move' Move block to the other side\n".. - "\n".. - "You can switch to the 'move xyz' operating mode via the wrench menu. After switching\\, the following techage commands are supported: \n".. - "\n".. - " - 'move2' With the command\\, the flight route must also be specified as an x\\,y\\,z vector.\nExample Lua Controller: '$send_cmnd(MOVE_CTLR\\, \"move2\"\\, \"0\\,12\\,0\")'\n".. - " - 'reset' move block(s) back to start position\n".. - "\n".. - "*Important instructions:*\n".. - "\n".. - " - If several blocks are to be moved\\, the block that is to take the players/mobs must be clicked first when training.\n".. - " - If the block that is supposed to take the players/mobs has a reduced height\\, the height must be set in the controller using the open-ended wrench menu (e.g. height = 0.5). Otherwise the player/mob will not be \"found\" and will not be taken away.\n".. - "\n".. - "\n".. - "\n", - "The TA4 turn controller is similar to the \"Move Controller\"\\, but the selected blocks are not moved\\, but rotated around their center to the right or left.\n".. - "\n".. - "Instructions:\n".. - "\n".. - " - Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained)\n".. - " - The movement can be tested with the menu buttons \"Turn left\" and \"Turn right\"\n".. - "\n".. - "The turn controller supports the following techage commands:\n".. - "\n".. - " - 'left' Turn left\n".. - " - 'right' Turn right\n".. - " - 'uturn' Turn 180 degrees\n".. - "\n".. - "\n".. - "\n", - "TA4 contains a series of powerful lamps that enable better illumination or take on special tasks.\n".. - "\n", - "The TA4 LED grow light enables fast and vigorous growth of all plants from the 'farming' mod. The lamp illuminates a 3x3 field\\, so that plants can also be grown underground.\n".. - "The lamp must be placed one block above the ground in the middle of the 3x3 field.\n".. - "\n".. - "The lamp can also be used to grow flowers. If the lamp is placed over a 3x3 flower bed made of \"Garden Soil\" (Mod 'compost')\\, the flowers grow there automatically (above and below ground).\n".. - "\n".. - "You can harvest the flowers with the Signs Bot\\, which also has a corresponding sign that must be placed in front of the flower field.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The TA4 LED street lamp is a lamp with particularly strong illumination. The lamp consists of the lamp housing\\, lamp arm and lamp pole blocks.\n".. - "\n".. - "The current must be led from below through the mast up to the lamp housing. First pull the power line up and then \"plaster\" the power cable with lamp pole blocks.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The TA4 LED industrial lamp is a lamp with particularly strong illumination. The lamp must be powered from above.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The liquid filter filters red mud.\n".. - "A part of the red mud becomes lye\\, which can be collected at the bottom in a tank.\n".. - "The other part becomes desert cobblestone and clutters the filter material.\n".. - "If the filter is too clogged\\, it has to be cleaned and re-filled.\n".. - "The filter consists of a base layer\\, 7 identical filter layers and a filling layer at the top.\n".. - "\n".. - "\n".. - "\n", - "You can see the structure of this layer in the plan.\n".. - "\n".. - "The lye is collected in the tank.\n".. - "\n".. - "\n".. - "\n", - "This layer has to be filled with gravel as shown in the plan.\n".. - "In total\\, there must be seven layers of gravel.\n".. - "The filter will become cluttered over time\\, so that it has to be cleaned and re-filled.\n".. - "\n".. - "\n".. - "\n", - "This layer is used to fill the filter with red mud.\n".. - "The red mud must be pumped into the filler pipe.\n".. - "\n".. - "\n".. - "\n", - "The Collider is a research facility that conducts basic research. Experience points can be collected here\\, which are required for TA5 (Future Age).\n".. - "\n".. - "Like its original at CERN in Geneva\\, the collider must be built underground. The standard setting here is Y <= -28. The value can\\, however\\, be changed by the server personnel via configuration. Please ask or try the \"TA4 Collider Detector Worker\" block.\n".. - "\n".. - "Only one collider can be operated per player. So it makes no sense to set up two or more colliders. Experience points are credited to the player who owns the collider. The experience points cannot be transferred.\n".. - "\n".. - "A collider consists of a \"ring\" made of tubes and magnets as well as a detector with a cooling system.\n".. - "\n".. - " - The detector is the heart of the system. This is where the scientific experiments take place. The detector is 3x3x7 blocks in size.\n".. - " - 22 TA4 Collider Magnets (not the TA4 Collider Detector Magnets!) must be connected to each other via 5 blocks of the TA4 vacuum tube. Each magnet also requires electricity and a gas connection for cooling. The whole thing forms (as shown in the plan on the right) a square with an edge length of 37 meters.\n".. - "\n".. - "The plan shows the facility from above:\n".. - "\n".. - " - the gray block is the detector with the worker block in the middle\n".. - " - the red blocks are the magnets\\, the blue the vacuum tubes\n".. - "\n".. - "\n".. - "\n", - "The detector is set up automatically with the help of the \"TA4 Collider Detector Worker\" block (similar to the derrick). All of the materials required for this must first be placed in the worker block. The detector is shown symbolically on the worker block. The detector is set up across the worker block.\n".. - "\n".. - "The detector can also be dismantled again with the help of the worker block.\n".. - "\n".. - "The connections for electricity\\, gas and vacuum tubes are located on the two front sides of the detector. A TA4 pump must be connected at the top in order to suck the tube empty / to create the vacuum.\n".. - "\n".. - "The cooling system must be connected to the rear of the detector. The cooling system is shown in the plan on the right. In addition to the TA4 heat exchanger of the energy storage unit (which is used here for cooling)\\, a TA4 cooler block is also required.\n".. - "\n".. - "Note: The arrow on the heat exchanger must point away from the detector. The heat exchanger must also be supplied with electricity.\n".. - "\n".. - "\n".. - "\n".. - " - In addition\\, cooling is required\\, which must also be installed at the detector. Isobutane is required for cooling.\n".. - " - The system requires quite a bit of electricity. Therefore\\, it makes sense to have your own power supply.\n".. - "\n", - "The collider is controlled via a TA4 terminal (not via the TA4 Lua controller terminal).\n".. - "\n".. - "This terminal must be connected to the detector. The number of the detector is displayed as info text on the worker block.\n".. - "\n".. - "The terminal supports the following commands:\n".. - "\n".. - " - 'connect ' (connect to the detector)\n".. - " - 'start' (starting the detector)\n".. - " - 'stop' (stop the detector)\n".. - " - 'test ' (checking a magnet)\n".. - " - 'points' (query of the experience points already achieved)\n".. - "\n".. - "If an error occurs on a magnet during the 'start'\\, the number of the magnet is output. The 'test' command can be used to request further information on the magnet error.\n".. - "\n".. - "\n".. - "\n", - "Each TA4 Collider magnet must also be supplied with electricity (as shown on the right in the plan) and with Isobutane for cooling:\n".. - "\n".. - " - The connection for the power is on the top of the magnet.\n".. - " - The connection for the cooling is on the front of the magnet.\n".. - " - A TA4 pump and a TA4 tank with at least 250 units of isobutane are also required to cool the entire system.\n".. - " - The system also requires a lot of electricity. It therefore makes sense to have your own power supply with at least 145 ku.\n".. - "\n".. - "\n".. - "\n", - "The following sequence is recommended when setting up the collider:\n".. - "\n".. - " - Put a forceload block. Only the detector with the cooling system has to be in the area of ​​the forceload block.\n".. - " - Set the worker block\\, fill it with items and set up the detector via the menu\n".. - " - Build the ring with tubes and magnets\n".. - " - Connect all magnets and the detector with power cables\n".. - " - Connect all magnets and the detector with the yellow tubes and pump the isobutane into the tube system with a pump\n".. - " - Install a TA4 pump as a vacuum pump on the detector and switch it on (no additional tank is required). If the pump goes into \"standby\"\\, the vacuum is established. This will take a few seconds\n".. - " - assemble the cooler (heat exchanger) and connect it to the power cable\n".. - " - Place the TA4 terminal in front of the detector and connect it to the detector via 'connect '\n".. - " - Switch on / connect the power supply\n".. - " - switch on the cooler (heat exchanger)\n".. - " - Switch on the detector via 'start' on the TA4 terminal. After a few test steps\\, the detector goes into normal operation or outputs an error.\n".. - " - The collider has to run continuously and then gradually delivers experience points. For 10 points\\, the collider has to run for a few hours\n".. - "\n".. - "\n".. - "\n", - "", - "Up to 10 recipes can be saved in the recipe block. These recipes can then be called up via a TA4 Autocrafter command. This enables the autocrafter's recipe to be configured using a command. The recipes in the recipe block can also be queried directly using a command.\n".. - "\n".. - "'input ' reads a recipe from the TA4 recipe block. '' is the number of the recipe. The block returns a list of recipe ingredients.\n".. - "\n".. - "Example: '$send_cmnd(1234\\, \"input\"\\, 1)'\n".. - "\n".. - " \n".. - "\n", - "The function corresponds to that of TA3.\n".. - "\n".. - "The processing power is 4 items every 4 s. The autocrafter requires 9 ku of electricity for this.\n".. - "\n".. - "In addition\\, the TA4 Autocrafter supports the selection of different recipes using the following commands:\n".. - "\n".. - "'recipe \".\"' switches the autocrafter to a recipe from the TA4 Recipe Block. '' is the number of the recipe block\\, '' the recipe number. Example: '$send_cmnd(1234\\, \"recipe\"\\, \"5467.1\")'\n".. - "\n".. - "Alternatively\\, a recipe can also be selected via the list of ingredients\\, such as:\n".. - "'$send_cmnd(1234\\, \"recipe\"\\, \"default:coal_lump\\,\\,\\,default:stick\")'\n".. - "All technical names of a recipe must be specified here\\, separated by commas. See also the command 'input' in the TA4 recipe block.\n".. - "\n".. - "The 'flush' command moves all items from the input inventory to the output inventory. The command returns 'true' if the input inventory was completely emptied. If 'false' was returned (output inventory full)\\, the command must be repeated at a later time.\n".. - "\n".. - " \n".. - "\n", - "See TA3 tank.\n".. - "\n".. - "A TA4 tank can hold 2000 units or 200 barrels of liquid.\n".. - "\n".. - "\n".. - "\n", - "See TA3 pump.\n".. - "\n".. - "The TA4 pump pumps 8 units of liquid every two seconds. \n".. - "\n".. - "In the \"Flow limiter\" mode\\, the number of units pumped by the pump can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of units in the menu. Once the configured number of units have been pumped\\, the pump will turn off. When the pump is turned on again\\, it will pump the configured number of units again and then turn off.\n".. - "\n".. - "The flow limiter can also be configured and started using a Lua or Beduino controller.\n".. - "\n".. - "The pump also supports the 'flowrate' command. This allows the total flow rate through the pump to be queried.\n".. - "\n".. - "\n".. - "\n", - "With TA4\\, the industrial furnace also has its electrical heating. The oil burner and the blower can be replaced with the heater.\n".. - "\n".. - "The heater requires 14 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "This block can no longer be crafted and will be replaced by the TA4 water inlet block. \n".. - "\n", - "Some recipes require water. The water must be pumped from the sea with a pump (water at y = 1). A \"pool\" made up of a few water blocks is not sufficient for this! \n".. - "\n".. - "To do this\\, the water inlet block must be placed in the water and connected to the pump via pipes. If the block is placed in the water\\, it must be ensured that there is water under the block (water must be at least 2 blocks deep). \n".. - "\n".. - "\n".. - "\n", - "TA4 also has its own tubes in the TA4 design. These can be used like standard tubes.\n".. - "But: TA4 pushers and TA4 distributors only achieve their full performance when used with TA4 tubes.\n".. - "\n".. - "\n".. - "\n", - "The function basically corresponds to that of TA2 / TA3. In addition\\, a menu can be used to configure which objects should be taken from a TA4 chest and transported further.\n".. - "The processing power is 12 items every 2 s\\, if TA4 tubes are used on both sides. Otherwise there are only 6 items every 2 s.\n".. - "\n".. - "In the \"flow limiter\" mode\\, the number of items that are moved by the pusher can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of items in the menu. As soon as the configured number of items have been moved\\, the pusher switches off. If the pusher is switched on again\\, it moves the configured number of items again and then switches off.\n".. - "\n".. - "The TA4 pusher can also be configured and started using a Lua or Beduino controller.\n".. - "\n".. - "Here are the additional commands for the Lua controller:\n".. - "\n".. - " - 'config' is used to configure the pusher\\, analogous to manual configuration via the menu.\n Example: '$send_cmnd(1234\\, \"config\"\\, \"default:dirt\")'\n With '$send_cmnd(1234\\, \"config\"\\, \"\")' the configuration is deleted\n".. - " - 'limit' is used to set the number of items for the flow limiter mode:\n Example: '$send_cmnd(1234\\, \"init\"\\, 7)'\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA3. The chest can hold more content.\n".. - "\n".. - "In addition\\, the TA4 chest has a shadow inventory for configuration. Here certain stack locations can be pre-assigned with an item. Pre-assigned inventory stacks are only filled with these items when filling. A TA4 pusher or TA4 injector with the appropriate configuration is required to empty a pre-assigned inventory stacks.\n".. - "\n".. - "\n".. - "\n", - "The TA4 8x2000 chest does not have a normal inventory like other chest\\, but has 8 stores\\, whereby each store can hold up to 2000 items of one sort. The orange buttons can be used to move items to or from the store. The box can also be filled or emptied with a pusher (TA2\\, TA3 or TA4) as usual.\n".. - "\n".. - "If the chest is filled with a pusher\\, all stores fill from left to right. If all 8 stores are full and no further items can be added\\, further items are rejected.\n".. - "\n".. - "*Row function*\n".. - "\n".. - "Several TA4 8x2000 chests can be connected to a large chest with more content. To do this\\, the chests must be placed in a row one after the other.\n".. - "\n".. - "First the front chest must be placed\\, then the stacking chests are placed behind with the same direction of view (all boxes have the front towards the player). With 2 chests in a row\\, the size increases to 8x4000\\, etc.\n".. - "\n".. - "The rows of chests can no longer be removed. There are two ways to dismantle the chests:\n".. - "\n".. - " - Empty and remove the front chest. This unlocks the next chest and can be removed.\n".. - " - Empty the front chest so far that all stores contain a maximum of 2000 items. This unlocks the next chest and can be removed.\n".. - "\n".. - "The chests have an \"order\" checkbox. If this checkbox is activated\\, the stores are no longer completely emptied by a pusher. The last item remains in the store as a default. This results in a fixed assignment of items to storage locations.\n".. - "\n".. - "The chest can only be used by players who can build at this location\\, i.e. who have protection rights. It does not matter who sets the chest.\n".. - "\n".. - "The chest has an additional command for the Lua controller:\n".. - "\n".. - " - 'count' is used to request how many items are in the chest.\nExample 1: '$send_cmnd(CHEST\\, \"count\")' -> Sum of items across all 8 stores\nExample 2: '$send_cmnd(CHEST\\, \"count\"\\, 2)' -> number of items in store 2 (second from left)\n".. - " - 'storesize' is used to read the size of one of the eight stores:\nExample: '$send_cmnd(CHEST\\, \"storesize\")' -> function returns e.g. 6000\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 24 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 12 items every 4 s.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of the normal TA4 distributor\\, with two differences:\n".. - "The processing power is 36 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s.\n".. - "Furthermore\\, up to 8 items can be configured per direction.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 4 items every 4 s. The block requires 5 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 4 items every 4 s. The block requires 9 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function largely corresponds to that of TA2.\n".. - "\n".. - "In addition\\, the hole size can be set between 3x3 and 11x11 blocks.\n".. - "The maximum depth is 80 meters. The quarry requires 14 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2\\, only different chips are produced here.\n".. - "The processing power is one chip every 6 s. The block requires 12 ku of electricity for this.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA3.\n".. - "\n".. - "The processing power is up to 8 times four items every 4 seconds.\n".. - "\n".. - "\n".. - "\n", - "The recycler is a machine that processes all Techage recipes backwards\\, i.e. it can dismantle machines and blocks back into their components. \n".. - "\n".. - "The machine can disassemble pretty much any Techage and Hyperloop blocks. But not all recipe items/materials can be recycled:\n".. - "\n".. - " - Wood turns into sticks\n".. - " - Stone turns into sand or gravel\n".. - " - Semiconductors / chips cannot be recycled\n".. - " - Tools cannot be recycled\n".. - "\n".. - "The processing power is one item every 8 s. The block requires 16 ku of electricity for this.\n".. - "\n".. - " \n".. - "\n", - }, - images = { - "techage_ta4", - "", - "ta4_windturbine", - "ta4_nacelle", - "ta4_blinklamp", - "ta4_pillar", - "", - "ta4_solarmodule", - "ta4_solarcarrier", - "ta4_solar_inverter", - "ta4_powercable", - "ta4_powerbox", - "ta4_minicell", - "", - "ta4_heatexchanger", - "ta4_turbine", - "ta4_generator", - "ta4_pipeinlet", - "ta4_pipe", - "ta4_transformer", - "ta4_transformer", - "ta4_electricmeter", - "ta4_laser", - "ta4_hydrogen", - "ta4_electrolyzer", - "ta4_fuelcell", - "", - "ta4_doser", - "ta4_reactor", - "ta4_fillerpipe", - "ta4_reactorstand", - "ta4_reactorbase", - "ta4_silo", - "ta4_icta_controller", - "ta4_icta_controller", - "ta4_battery", - "ta4_display", - "ta4_displayXL", - "ta4_signaltower", - "ta4_lua_controller", - "ta4_lua_server", - "ta4_sensor_chest", - "ta4_terminal", - "", - "ta4_button", - "ta4_button_2x", - "ta4_button_4x", - "ta4_signallamp_2x", - "ta4_signallamp_4x", - "ta4_playerdetector", - "ta4_collector", - "ta4_detector", - "ta4_nodedetector", - "ta4_chargedetector", - "ta4_gaze_sensor", - "ta4_sequencer", - "", - "ta4_movecontroller", - "ta4_turncontroller", - "", - "ta4_growlight", - "ta4_streetlamp", - "ta4_industriallamp", - "ta4_liquid_filter", - "", - "", - "", - "", - "", - "ta4_terminal", - "", - "techage_ta4c", - "", - "ta4_recipeblock", - "ta4_autocrafter", - "ta4_tank", - "ta4_pump", - "ta4_furnaceheater", - "", - "ta4_waterinlet", - "ta4_tube", - "ta4_pusher", - "ta4_chest", - "ta4_8x2000_chest", - "ta4_distributor", - "ta4_high_performance_distributor", - "ta4_gravelsieve", - "ta4_grinder", - "ta4_quarry", - "ta4_electronicfab", - "ta4_injector", - "ta4_recycler", - }, - plans = { - "", - "ta4_windturbine", - "", - "", - "", - "", - "ta4_solarplant", - "", - "", - "", - "", - "", - "", - "ta4_storagesystem", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_reactor", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_liquid_filter_base", - "ta4_liquid_filter_gravel", - "ta4_liquid_filter_top", - "techage_collider_plan", - "ta4_cooler", - "", - "techage_collider_plan2", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta4_RU.lua b/techage/doc/manual_ta4_RU.lua deleted file mode 100644 index 32faa51..0000000 --- a/techage/doc/manual_ta4_RU.lua +++ /dev/null @@ -1,1054 +0,0 @@ -return { - titles = { - "1,TA4: Present", - "2,Wind Turbine", - "3,TA4 Wind Turbine", - "3,TA4 Wind Turbine Nacelle", - "3,TA4 Wind Turbine Signal Lamp", - "3,TA4 Pillar", - "2,Solar System", - "3,TA4 Solar Module", - "3,TA4 Solar Carrier Module", - "3,TA4 Solar Inverter", - "3,TA4 Low Power Cable", - "3,TA4 Low Voltage Junction Box", - "3,TA4 Street Lamp Solar Cell", - "2,Thermal Energy Storage", - "3,TA4 Heat Exchanger", - "3,TA4 Turbine", - "3,TA4 Generator", - "3,TA4 Pipe Inlet", - "3,TA4 Pipe", - "2,Power Distribution", - "3,TA4 Isolation Transformer", - "3,TA4 Electric Meter", - "3,TA4 Laser", - "2,Hydrogen", - "3,Electrolyzer", - "3,Fuel Cell", - "2,Chemical Reactor", - "3,TA4 Doser", - "3,TA4 Reactor", - "3,TA4 Filler Pipe", - "3,TA4 Reactor Stand", - "3,TA4 Reactor Base", - "3,TA4 Silo", - "2,ICTA Controller", - "3,TA4 ICTA controller", - "3,Battery", - "3,TA4 Display", - "3,TA4 Display XL", - "3,TA4 Signal Tower", - "2,TA4 Lua Controller", - "3,TA4 Lua Server", - "3,TA4 Sensor Box / Chest", - "3,TA4 Lua Controller Terminal", - "2,TA4 Logic/Switching Modules", - "3,TA4 Button/Switch", - "3,TA4 2x Button", - "3,TA4 4x Button", - "3,TA4 2x Signal Lamp", - "3,TA4 4x Signal Lamp", - "3,TA4 Player Detector", - "3,TA4 State Collector", - "3,TA4 Detector", - "3,TA4 Node Detector", - "3,TA4 Energy Storage Charge Detector", - "3,TA4 Gaze Sensor", - "3,TA4 Sequencer", - "2,Move/Turn Controller", - "3,TA4 Move Controller", - "3,TA4 Turn Controller", - "2,TA4 Lamps", - "3,TA4 LED Grow Light", - "3,TA4 Street Lamp", - "3,TA4 LED Industrial Lamp", - "2,TA4 Liquid Filter", - "3,Base Layer", - "3,Gravel Layer", - "3,Filling Layer", - "2,TA4 Collider (Particle Accelerator)", - "3,Detector", - "3,Control / TA4 Terminal", - "3,Cooling and power", - "3,Construction", - "2,More TA4 Blocks", - "3,TA4 Recipe Block", - "3,TA4 Autocrafter", - "3,TA4 Tank", - "3,TA4 Pump", - "3,TA4 Furnace Heater", - "3,TA4 Water Pump (deprecated)", - "3,TA4 Water Inlet", - "3,TA4 Tube", - "3,TA4 Pusher", - "3,TA4 Chest", - "3,TA4 8x2000 Chest", - "3,TA4 Distributor", - "3,TA4 High Performance Distributor", - "3,TA4 Gravel Sieve", - "3,TA4 Grinder", - "3,TA4 Quarry", - "3,TA4 Electronic Fab", - "3,TA4 Injector", - "3,TA4 Recycler", - }, - texts = { - "Renewable energy sources such as wind\\, sun and biofuels help you to leave the oil age. With modern technologies and intelligent machines you set out into the future.\n".. - "\n".. - "\n".. - "\n", - "A wind turbine always supplies electricity when there is wind. There is no wind in the game\\, but the mod simulates this by turning the wind turbines only in the morning (5:00 - 9:00) and in the evening (17:00 - 21:00). A wind turbine only supplies electricity if it is set up in a suitable location.\n".. - "\n".. - "The TA wind power plants are pure offshore plants\\, which means that they have to be built in the sea. This means that wind turbines can only be build in a sea (occean) biome and that there must be sufficient water and a clear view around the mast.\n".. - "\n".. - "To find a suitable spot\\, click on the water with the wrench (TechAge Info Tool). A chat message will show you whether this position is suitable for the mast of the wind turbine.\n".. - "\n".. - "The current must be led from the rotor block down through the mast. First pull the power line up and then \"plaster\" the power cable with TA4 pillar blocks. A work platform can be built below. The plan on the right shows the structure in the upper part.\n".. - "\n".. - "The wind turbine delivers 70 ku\\, but only 8 hours a day (see above).\n".. - "\n".. - "\n".. - "\n", - "The wind turbine block (rotor) is the heart of the wind turbine. This block must be placed on top of the mast. Ideally at Y = 15\\, then you just stay within a map / forceload block.\n".. - "When you start the turbine\\, all conditions for the operation of the wind turbine are checked. If all conditions are met\\, the rotor blades (wings) appear automatically. Otherwise you will get an error message.\n".. - "\n".. - "\n".. - "\n", - "This block must be placed on the black end of the wind turbine block.\n".. - "\n".. - "\n".. - "\n", - "This flashing light is only for decorative purposes and can be placed on top of the wind turbine block.\n".. - "\n".. - "\n".. - "\n", - "This builds the mast for the wind turbine. However\\, these blocks are not set by hand but must be set with the help of a trowel\\, so that the power line to the mast tip is replaced with these blocks (see under TA power cable).\n".. - "\n".. - "\n".. - "\n", - "The solar system only produces electricity when the sun is shining. In the game this is every game day from 6:00 am to 6:00 pm.\n".. - "The same power is always available during this time. After 6:00 p.m.\\, the solar modules switch off completely.\n".. - "\n".. - "The biome temperature is decisive for the performance of the solar modules. The hotter the temperature\\, the higher the yield.\n".. - "The biome temperature can be determined with the Techage Info Tool (wrench). It typically fluctuates between 0 and 100:\n".. - "\n".. - " - full power is available at 100\n".. - " - at 50\\, half the power is available\n".. - " - at 0 there is no service available\n".. - "\n".. - "It is therefore advisable to look for hot steppes and deserts for the solar system.\n".. - "The overhead lines are available for the transport of electricity.\n".. - "However\\, hydrogen can also be produced\\, which can be transported and converted back into electricity at the destination.\n".. - "\n".. - "The smallest unit in a solar system is two solar modules and one carrier module. The carrier module must be placed first\\, the two solar modules to the left and right next to it (not above!).\n".. - "\n".. - "The plan on the right shows 3 units\\, each with two solar modules and one carrier module\\, connected to the inverter via red cables.\n".. - "\n".. - "Solar modules supply DC voltage\\, which cannot be fed directly into the power grid. Therefore\\, the solar units must first be connected to the inverter via the red cable. This consists of two blocks\\, one for the red cable to the solar modules (DC) and one for the gray power cable to the power grid (AC).\n".. - "\n".. - "The map area where the solar system is located must be fully loaded. This also applies to the direct position above the solar module\\, because the light intensity is regularly measured there. It is therefore advisable to first set a forceload block and then to place the modules within this area.\n".. - "\n".. - "\n".. - "\n", - "The solar module must be placed on the carrier module. Two solar modules are always required.\n".. - "In a pair\\, the solar modules perform up to 3 ku\\, depending on the temperature.\n".. - "With the solar modules\\, care must be taken that they have full daylight and are not shaded by blocks or trees. This can be tested with the Info Tool (wrench).\n".. - "\n".. - "\n".. - "\n", - "The carrier module is available in two heights (1m and 2m). Both are functionally identical.\n".. - "The carrier modules can be placed directly next to one another and thus connected to form a row of modules. The connection to the inverter or to other module series must be made with the red low-voltage cables or the low-voltage junction boxes.\n".. - "\n".. - "\n".. - "\n", - "The inverter converts the solar power (DC) into alternating current (AC) so that it can be fed into the power grid.\n".. - "An inverter can feed a maximum of 100 ku of electricity\\, which corresponds to 33 solar modules or more.\n".. - "\n".. - "\n".. - "\n", - "The low voltage cable is used to connect rows of solar modules to the inverter. The cable must not be used for other purposes.\n".. - "\n".. - "The maximum cable length is 200 m.\n".. - "\n".. - "\n".. - "\n", - "The junction box must be placed on the floor. It has only 4 connections (in the 4 directions).\n".. - "\n".. - "\n".. - "\n", - "As the name suggests\\, the street lamp solar cell is used to power a street lamp. A solar cell can supply two lamps (1 ku). The solar cell stores the sun's energy during the day and delivers the electricity to the lamp at night. That means the lamp only glows in the dark.\n".. - "\n".. - "This solar cell cannot be combined with the other solar modules.\n".. - "\n".. - "\n".. - "\n", - "The thermal energy storage replaces the battery block from TA3.\n".. - "\n".. - "The thermal energy store consists of a concrete shell (concrete blocks) filled with gravel. Five sizes of the storage are possible:\n".. - "\n".. - " - Cover with 5x5x5 concrete blocks\\, filled with 27 gravel\\, storage capacity: 22.5 kud\n".. - " - Cover with 7x7x7 concrete blocks\\, filled with 125 gravel\\, storage capacity: 104 kud\n".. - " - Cover with 9x9x9 concrete blocks\\, filled with 343 gravel\\, storage capacity: 286 kud\n".. - " - Cover with 11x11x11 concrete blocks\\, filled with 729 gravel\\, storage capacity: 610 kud\n".. - " - Cover with 13x13x13 concrete blocks\\, filled with 1331 gravel\\, storage capacity: 1112 kud\n".. - "\n".. - "A window made of an obsidian glass block may be in the concrete shell. This must be placed fairly in the middle of the wall. Through this window you can see whether the storage is loaded more than 80%. In the plan on the right you can see the structure of TA4 heat exchanger consisting of 3 blocks\\, the TA4 turbine and the TA4 generator. Pay attention to the alignment of the heat exchanger (the arrow at block 1 must point to the turbine).\n".. - "\n".. - "Contrary to the plan on the right\\, the connections on the storage block must be on the same level (arranged horizontally\\, i.e. not below and above). The pipe inlets (TA4 Pipe Inlet) must be exactly in the middle of the wall and face each other. The yellow TA4 pipes are used as steam pipes. The TA3 steam pipes cannot be used here.\n".. - "Both the generator and the heat exchanger have a power connection and must be connected to the power grid.\n".. - "\n".. - "In principle\\, the heat storage system works exactly the same as the batteries\\, only with much more storage capacity.\n".. - "\n".. - "In order for the heat storage system to work\\, all blocks (also the concrete shell and gravel) must be loaded using a forceload block.\n".. - "\n".. - "\n".. - "\n", - "The heat exchanger consists of 3 parts that must be placed on top of each other\\, with the arrow of the first block pointing towards the turbine. The pipes must be built with the yellow TA4 pipes.\n".. - "The heat exchanger must be connected to the power grid. The energy storage device is recharged via the heat exchanger\\, provided that sufficient electricity is available. \n".. - "\n".. - "\n".. - "\n", - "The turbine is part of the energy storage. It must be placed next to the generator and connected to the heat exchanger via TA4 tubes as shown in the plan.\n".. - "\n".. - "\n".. - "\n", - "The generator is used to generate electricity. Therefore\\, the generator must also be connected to the power grid.\n".. - "The generator is part of the energy storage. It is used to generate electricity and thus releases the energy from the energy storage unit. Therefore\\, the generator must also be connected to the power grid.\n".. - "\n".. - "Important: Both\\, heat exchanger and generator must be connected to the same power grid! \n".. - "\n".. - "\n".. - "\n", - "One pipe inlet block each must be installed on both sides of the storage block. The blocks must face each other exactly.\n".. - "\n".. - "The pipe inlet blocks *cannot* be used as normal wall openings\\, use the TA3 pipe wall entry blocks instead.\n".. - "\n".. - "\n".. - "\n", - "With TA4\\, the yellow pipes are used for the transmission of gas and liquids.\n".. - "The maximum cable length is 100 m.\n".. - "\n".. - "\n".. - "\n", - "With the help of power cables and junction boxes\\, power networks of up to 1000 blocks/nodes can be set up. However\\, it should be noted that distribution boxes must also be counted. This means that up to 500 generators/storage systems/machines/lamps can be connected to a power grid.\n".. - "\n".. - "With the help of an isolating transformer and electricity meter\\, networks can be connected to form even larger structures.\n".. - "\n".. - "\n".. - "\n", - "With the help of an isolating transformer\\, two power grids can be connected to form a larger network. The isolation transformer can transmit electricity in both directions.\n".. - "\n".. - "The isolation transformer can transmit up to 300 ku. The maximum value is adjustable via the wrench menu.\n".. - "\n".. - "\n".. - "\n", - "With the help of an electricity meter\\, two electricity networks can be connected to form a larger network. The electricity meter only transmits electricity in one direction (note arrow). The amount of electrical energy passed through (in kud) is measured and displayed. This value can also be queried by a Lua controller using the 'consumption' command. The current current can be queried via the command 'current'.\n".. - "\n".. - "The electricity meter can pass up to 200 ku. The maximum value is adjustable via the wrench menu.\n".. - "\n".. - "A power output countdown can also be entered via the wrench menu. When this countdown reaches zero\\, the electricity meter switches off. The countdown can be queried using the 'countdown' command.\n".. - "\n".. - "\n".. - "\n", - "The TA4 laser is used for wireless power transmission. Two blocks are required for this: TA4 Laser Beam Emitter and TA4 Laser Beam Receiver. There must be an air gap between the two blocks so that the laser beam can be built up from the emitter to the receiver. First the emitter must be placed. This immediately switches on the laser beam and shows possible positions of the receiver. Possible positions for the receiver are also output via a chat message. \n".. - "\n".. - "With the laser\\, distances of up to 96 blocks can be bridged. Once the connection has been established (no current has to flow)\\, this is indicated via the info text of the emitter and also of the receiver. \n".. - "\n".. - "The laser blocks themselves do not require any electricity.\n".. - "\n".. - "\n".. - "\n", - "Electrolysis can be used to split electricity into hydrogen and oxygen. On the other hand\\, hydrogen can be converted back into electricity with oxygen from the air using a fuel cell.\n".. - "This enables current peaks or an excess supply of electricity to be converted into hydrogen and thus stored.\n".. - "\n".. - "In the game\\, electricity can be converted back into electricity via the fuel cell using the electrolyzer in hydrogen and hydrogen.\n".. - "This means that electricity (in the form of hydrogen) can not only be stored in tanks\\, but also transported by means of the tank cart.\n".. - "\n".. - "However\\, the conversion of electricity into hydrogen and back is lossy. Out of 100 units of electricity\\, only 95 units of electricity come out after the conversion to hydrogen and back.\n".. - "\n".. - "\n".. - "\n", - "The electrolyzer converts electricity into hydrogen.\n".. - "It must be powered from the left. On the right\\, hydrogen can be extracted via pipes and pumps.\n".. - "\n".. - "The electrolyzer can draw up to 35 ku of electricity and then generates a hydrogen item every 4 s.\n".. - "200 units of hydrogen fit into the electrolyzer.\n".. - "\n".. - "The electrolyzer has a wrench menu for setting the current consumption and the switch-off point.\n".. - "\n".. - "If the power stored in the power grid falls below the specified value of the switch-off point\\, the electrolyzer switches off automatically. This prevents the storage systems from running empty.\n".. - "\n".. - "\n".. - "\n", - "The fuel cell converts hydrogen into electricity.\n".. - "It must be supplied with hydrogen from the left by a pump. The power connection is on the right.\n".. - "\n".. - "The fuel cell can deliver up to 34 ku of electricity and needs a hydrogen item every 4 s.\n".. - "\n".. - "Usually the fuel cell works as a category 2 generator (like other storage systems). \n".. - "In this case\\, no other category 2 blocks such as the battery block can be charged. However\\, the fuel cell can also be used as a category 1 generator via the check box.\n".. - "\n".. - "\n".. - "\n", - "The reactor is used to process the ingredients obtained from the distillation tower or from other recipes into new products.\n".. - "The plan on the left shows only one possible variant\\, since the arrangement of the silos and tanks depends on the recipe.\n".. - "\n".. - "The primary output product is always output to the side of the reactor stand\\, regardless of whether it is a powder or a liquid. The (secondary) waste product is always discharged at the bottom of the reactor stand.\n".. - "\n".. - "A reactor consists of:\n".. - "\n".. - " - Various tanks and silos with the ingredients that are connected to the doser via pipes\n".. - " - optionally a reactor base\\, which discharges the waste from the reactor (only necessary for recipes with two output products)\n".. - " - the reactor stand\\, which must be placed on the base (if available). The stand has a power connection and draws 8 ku during operation.\n".. - " - The reactor vessel that has to be placed on the reactor stand\n".. - " - The filler pipe that must be placed on the reactor vessel\n".. - " - The dosing device\\, which has to be connected to the tanks or silos and the filler pipe via pipes\n".. - "\n".. - "Note 1: Liquids are only stored in tanks\\, solids and substances in powder form only in silos. This applies to ingredients and output products.\n".. - "\n".. - "Note 2: Tanks or silos with different contents must not be connected to a pipe system. In contrast\\, several tanks or silos with the same content may hang in parallel on one line.\n".. - "\n".. - "Cracking breaks long chains of hydrocarbons into short chains using a catalyst.\n".. - "Gibbsite powder serves as a catalyst (is not consumed). It can be used to convert bitumen into fueloil\\, fueloil into naphtha and naphtha into gasoline.\n".. - "\n".. - "In hydrogenation\\, pairs of hydrogen atoms are added to a molecule to convert short-chain hydrocarbons into long ones.\n".. - "Here iron powder is required as a catalyst (is not consumed). It can be used to convert gas (propane) into isobutane\\,\n".. - "isobutane into gasoline\\, gasoline into naphtha\\, naphtha into fueloil\\, and fueloil into bitumen.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor.\n".. - "Pipes for input materials can be connected on all 4 sides of the doser. The materials for the reactor are discharged upwards.\n".. - "\n".. - "The recipe can be set and the reactor started via the doser.\n".. - "\n".. - "As with other machines:\n".. - "\n".. - " - if the doser is in standby mode\\, one or more ingredients are missing\n".. - " - if the doser is in the blocked state\\, the output tank or silo is full\\, defective or incorrectly connected\n".. - "\n".. - "The doser does not need any electricity. A recipe is processed every 10 s.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. The reactor has a inventory for the catalyst items (for cracking and hydrogenation recipes).\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Must be placed on the reactor. If this does not work\\, remove the pipe at the position above and place it again.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Here is also the power connection for the reactor. The reactor requires 8 ku of electricity.\n".. - "\n".. - "The stand has two pipe connections\\, to the right for the starting product and down for the waste\\, such as red mud in aluminum production.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Is required for the drainage of the waste product.\n".. - "\n".. - "\n".. - "\n", - "Part of the chemical reactor. Is required to store substances in powder or granule form.\n".. - "\n".. - "\n".. - "\n", - "The ICTA controller (ICTA stands for \"If Condition Then Action\") is used to monitor and control machines. The controller can be used to read in data from machines and other blocks and\\, depending on this\\, switch other machines and blocks on / off.\n".. - "\n".. - "Machine data is read in and blocks and machines are controlled using commands. Chapter TA3 -> Logic / switching blocks is important for understanding how commands work.\n".. - "\n".. - "The controller requires a battery to operate. The display is used to output data\\, the signal tower to display errors.\n".. - "\n".. - "\n".. - "\n", - "The controller works on the basis of 'IF THEN ' rules. Up to 8 rules can be created per controller.\n".. - "\n".. - "Examples of rules are:\n".. - "\n".. - " - If a distributor is 'blocked'\\, the pusher in front of it should be switched off\n".. - " - If a machine shows an error\\, this should be shown on the display\n".. - "\n".. - "The controller checks these rules cyclically. To do this\\, a cycle time in seconds (`` Cycle / s '') must be specified for each rule (1..1000).\n".. - "\n".. - "For rules that evaluate an on / off input\\, e.g. from a switch or detector\\, cycle time 0 must be specified. The value 0 means that this rule should always be carried out when the input signal has changed\\, e.g. the button has sent a new value.\n".. - "\n".. - "All rules should only be executed as often as necessary. This has two advantages:\n".. - "\n".. - " - the battery of the controller lasts longer (each controller needs a battery)\n".. - " - the load for the server is lower (therefore fewer lags)\n".. - "\n".. - "You have to set a delay time ('after/s') for each action. If the action is to be carried out immediately\\, 0 must be entered.\n".. - "\n".. - "The controller has its own help and information on all commands via the controller menu.\n".. - "\n".. - "\n".. - "\n", - "The battery must be placed in close proximity to the controller\\, i.e. in one of the 26 positions around the controller.\n".. - "\n".. - "\n".. - "\n", - "The display shows its number after placement. The display can be addressed via this number. Texts can be output on the display\\, whereby the display can display 5 lines and thus 5 different texts.\n".. - "\n".. - "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. - "\n".. - "The display is updated at most once per second.\n".. - "\n".. - "\n".. - "\n", - "The TA4 Display XL is twice the size of the TA4 display.\n".. - "\n".. - "Lines of text are always left-aligned. If the text is to be centered horizontally\\, the text must be preceded by the character \"t\" (tabulator).\n".. - "\n".. - "The display is updated every two seconds at most.\n".. - "\n".. - "\n".. - "\n", - "The signal tower can display red\\, green and orange. A combination of the 3 colors is not possible.\n".. - "\n".. - "\n".. - "\n", - "As the name suggests\\, the Lua controller must be programmed in the Lua programming language. The manual in English is here available:\n".. - "\n".. - "https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md\n".. - "\n".. - "The Lua controller also requires a battery. The battery must be placed in close proximity to the controller\\, i.e. in one of the 26 positions around the controller.\n".. - "\n".. - "\n".. - "\n", - "The server is used for the central storage of data from several Lua controllers. It also saves the data after a server restart.\n".. - "\n".. - "\n".. - "\n", - "The TA4 sensor box is used to set up automatic warehouses or vending machines in conjunction with the Lua controller.\n".. - "If something is put into the box or removed\\, or one of the \"F1\" / \"F2\" keys is pressed\\, an event signal is sent to the Lua controller.\n".. - "The sensor box supports the following commands:\n".. - "\n".. - " - The status of the box can be queried via 'state = $send_cmnd(\\, \"state\")'. Possible answers are: \"empty\"\\, \"loaded\"\\, \"full\"\n".. - " - The last player action can be queried via 'name\\, action = $send_cmnd(\\, \"action\")'. 'name' is the player name. One of the following is returned as 'action': \"put\"\\, \"take\"\\, \"f1\"\\, \"f2\".\n".. - " - The contents of the box can be read out via 'stacks = $send_cmnd(\\, \"stacks\")'. See: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest\n".. - " - Via '$send_cmnd(\\, \"text\"\\, \"press both buttons andnput something into the chest\")' the text can be set in the menu of the sensor box.\n".. - "\n".. - "The checkbox \"Allow public chest access\" can be used to set whether the box can be used by everyone or only by players who have access/protection rights here.\n".. - "\n".. - "\n".. - "\n", - "The terminal is used for input / output for the Lua controller.\n".. - "\n".. - "\n".. - "\n", - "", - "Only the appearance of the TA4 button/switch has changed. The functionality is the same as with the TA3 button/switch. With the wrench menu\\, however\\, the data can be changed later.\n".. - "\n".. - "\n".. - "\n", - "This block has two buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition\\, the command that is to be sent can be configured for each button. \n".. - "\n".. - "\n".. - "\n", - "This block has four buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition\\, the command that is to be sent can be configured for each button. \n".. - "\n".. - "\n".. - "\n", - "This block has two lamps that can be controlled individually. Each lamp can display the colors \"red\"\\, \"green\" and \"amber\". The labeling for both lamps can be configured via the wrench menu. The lamps can be controlled using the following commands:\n".. - "\n".. - " - Switch lamp 1 to red: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Switch lamp 2 to green: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Switch lamp 1 to orange: '$send_cmnd(1234\\, \"amber\"\\, 1)'\n".. - " - Switch lamp 2 off: '$send_cmnd(1234\\, \"off\"\\, 2)'\n".. - "\n".. - "\n".. - "\n", - "This block has four lamps that can be controlled individually. Each lamp can display the colors \"red\"\\, \"green\" and \"amber\". The labeling for all lamps can be configured via the wrench menu. The lamps can be controlled using the following commands:\n".. - "\n".. - " - Switch lamp 1 to red: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Switch lamp 2 to green: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Switch lamp 3 to orange: '$send_cmnd(1234\\, \"amber\"\\, 3)'\n".. - " - Switch lamp 4 off: '$send_cmnd(1234\\, \"off\"\\, 4)'\n".. - "\n".. - "\n".. - "\n", - "Only the appearance of the TA4 player detector has changed. The functionality is the same as with the TA3 player detector.\n".. - "\n".. - "\n".. - "\n", - "\n".. - "\n".. - "The status collector queries all configured machines in turn for the status. If one of the machines has reached or exceeded a preconfigured status\\, an \"on\" command is sent. For example\\, many machines can be easily monitored for faults from a Lua controller.\n".. - "\n", - "The functionality is the same as for the TA3 detector. In addition\\, the detector counts the items passed on.\n".. - "This counter can be queried with the 'count' command and reset with 'reset'.\n".. - "\n".. - "\n".. - "\n", - "The functionality is the same as with the TA3 Node Detector.\n".. - "\n".. - "In contrast to the TA3 node detector\\, the positions to be monitored can be configured individually here. To do this\\, the \"Record\" button must be pressed. Then all blocks must be clicked\\, the position of which is to be checked. Then the \"Done\" button must be pressed.\n".. - "\n".. - "Up to 4 blocks can be selected.\n".. - "\n".. - "\n".. - "\n", - "The charge detector measures the state of charge of the power grid's energy storage every 8 s.\n".. - "\n".. - "If the value falls below a configurable threshold (switching point)\\, a command (default: \"off\") is sent. If the value rises above this switching point again\\, a second command (default: \"on\") is sent. This allows consumers to be disconnected from the grid when the charge level of the energy storage device falls below the specified switching point.\n".. - "\n".. - "To do this\\, the charge detector must be connected to the grid via a junction box. The charge detector is configured via the open-end wrench menu.\n".. - "\n".. - "\n".. - "\n", - "The TA4 gaze sensor generates a command when the block is viewed/focused by the owner or other configured players and sends a second command when the block is no longer focused. It thus serves as a replacement for buttons/switches\\, for example to open/close doors.\n".. - "\n".. - "The TA4 Gaze Sensor can only be programmed using the open-end wrench menu. If you have an open-end wrench in your hand\\, the sensor does not trigger\\, even if it is focused.\n".. - "\n".. - "\n".. - "\n", - "Entire processes can be programmed using the TA4 sequencer. Here's an example:\n".. - "\n".. - " -- this is a comment\n".. - " \\[1\\] send 1234 a2b\n".. - " \\[30\\] send 1234 b2a\n".. - " \\[60\\] goto 1\n".. - "\n".. - " - Each line begins with a number which corresponds to a point in time '\\[\\]'\n".. - " - Values from 1 to 50000 are permitted for times\n".. - " - 1 corresponds to 100 ms\\, 50000 corresponds to about 4 game days\n".. - " - Empty lines or comments are allowed ('-- comment')\n".. - " - With 'send ' you can send a command to a block\n".. - " - With 'goto ' you can jump to another line / point in time\n".. - " - With 'stop' you can stop the sequencer with a delay so that it does not receive a new command\naccepts from a button or other block (to complete a movement)\nWithout 'stop'\\, the sequencer goes into stopped mode immediately after the last command.\n".. - "\n".. - "The TA4 sequencer supports the following techage commands:\n".. - "\n".. - " - 'goto ' Jump to a command line and start the sequencer\n".. - " - 'stop' Stop the sequencer\n".. - " - 'on' and 'off' as aliases for 'goto 1' resp. 'stop'\n".. - "\n".. - "The 'goto' command is only accepted when the sequencer is stopped.\n".. - "\n".. - "The cycle time (default: 100 ms) can be changed for the sequencer via the open-end wrench menu.\n".. - "\n".. - "\n".. - "\n", - "", - "The TA4 Move Controller is similar to \"Door Controller 2\"\\, but the selected blocks are not removed\\, but can be moved.\n".. - "Since the moving blocks can take players and mobs standing on the block with them\\, elevators and similar transport systems can be built with them.\n".. - "\n".. - "Instructions:\n".. - "\n".. - " - Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained)\n".. - " - the \"flight route\" must be entered via an x\\, y\\, z specification (relative) (the maximum distance (x+y+z) is 200 m)\n".. - " - The movement can be tested with the menu buttons \"Move A-B\" and \"Move B-A\"\n".. - " - you can also fly through walls or other blocks\n".. - " - The target position for the blocks can also be occupied. In this case\\, the blocks are saved \"invisibly\". This is intended for sliding doors and the like\n".. - "\n".. - "The Move Controller supports the following techage commands:\n".. - "\n".. - " - 'a2b' Move block from A to B.\n".. - " - 'b2a' Move block from B to A.\n".. - " - 'move' Move block to the other side\n".. - "\n".. - "You can switch to the 'move xyz' operating mode via the wrench menu. After switching\\, the following techage commands are supported: \n".. - "\n".. - " - 'move2' With the command\\, the flight route must also be specified as an x\\,y\\,z vector.\nExample Lua Controller: '$send_cmnd(MOVE_CTLR\\, \"move2\"\\, \"0\\,12\\,0\")'\n".. - " - 'reset' move block(s) back to start position\n".. - "\n".. - "*Important instructions:*\n".. - "\n".. - " - If several blocks are to be moved\\, the block that is to take the players/mobs must be clicked first when training.\n".. - " - If the block that is supposed to take the players/mobs has a reduced height\\, the height must be set in the controller using the open-ended wrench menu (e.g. height = 0.5). Otherwise the player/mob will not be \"found\" and will not be taken away.\n".. - "\n".. - "\n".. - "\n", - "The TA4 turn controller is similar to the \"Move Controller\"\\, but the selected blocks are not moved\\, but rotated around their center to the right or left.\n".. - "\n".. - "Instructions:\n".. - "\n".. - " - Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained)\n".. - " - The movement can be tested with the menu buttons \"Turn left\" and \"Turn right\"\n".. - "\n".. - "The turn controller supports the following techage commands:\n".. - "\n".. - " - 'left' Turn left\n".. - " - 'right' Turn right\n".. - " - 'uturn' Turn 180 degrees\n".. - "\n".. - "\n".. - "\n", - "TA4 contains a series of powerful lamps that enable better illumination or take on special tasks.\n".. - "\n", - "The TA4 LED grow light enables fast and vigorous growth of all plants from the 'farming' mod. The lamp illuminates a 3x3 field\\, so that plants can also be grown underground.\n".. - "The lamp must be placed one block above the ground in the middle of the 3x3 field.\n".. - "\n".. - "The lamp can also be used to grow flowers. If the lamp is placed over a 3x3 flower bed made of \"Garden Soil\" (Mod 'compost')\\, the flowers grow there automatically (above and below ground).\n".. - "\n".. - "You can harvest the flowers with the Signs Bot\\, which also has a corresponding sign that must be placed in front of the flower field.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The TA4 LED street lamp is a lamp with particularly strong illumination. The lamp consists of the lamp housing\\, lamp arm and lamp pole blocks.\n".. - "\n".. - "The current must be led from below through the mast up to the lamp housing. First pull the power line up and then \"plaster\" the power cable with lamp pole blocks.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The TA4 LED industrial lamp is a lamp with particularly strong illumination. The lamp must be powered from above.\n".. - "\n".. - "The lamp requires 1 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The liquid filter filters red mud.\n".. - "A part of the red mud becomes lye\\, which can be collected at the bottom in a tank.\n".. - "The other part becomes desert cobblestone and clutters the filter material.\n".. - "If the filter is too clogged\\, it has to be cleaned and re-filled.\n".. - "The filter consists of a base layer\\, 7 identical filter layers and a filling layer at the top.\n".. - "\n".. - "\n".. - "\n", - "You can see the structure of this layer in the plan.\n".. - "\n".. - "The lye is collected in the tank.\n".. - "\n".. - "\n".. - "\n", - "This layer has to be filled with gravel as shown in the plan.\n".. - "In total\\, there must be seven layers of gravel.\n".. - "The filter will become cluttered over time\\, so that it has to be cleaned and re-filled.\n".. - "\n".. - "\n".. - "\n", - "This layer is used to fill the filter with red mud.\n".. - "The red mud must be pumped into the filler pipe.\n".. - "\n".. - "\n".. - "\n", - "The Collider is a research facility that conducts basic research. Experience points can be collected here\\, which are required for TA5 (Future Age).\n".. - "\n".. - "Like its original at CERN in Geneva\\, the collider must be built underground. The standard setting here is Y <= -28. The value can\\, however\\, be changed by the server personnel via configuration. Please ask or try the \"TA4 Collider Detector Worker\" block.\n".. - "\n".. - "Only one collider can be operated per player. So it makes no sense to set up two or more colliders. Experience points are credited to the player who owns the collider. The experience points cannot be transferred.\n".. - "\n".. - "A collider consists of a \"ring\" made of tubes and magnets as well as a detector with a cooling system.\n".. - "\n".. - " - The detector is the heart of the system. This is where the scientific experiments take place. The detector is 3x3x7 blocks in size.\n".. - " - 22 TA4 Collider Magnets (not the TA4 Collider Detector Magnets!) must be connected to each other via 5 blocks of the TA4 vacuum tube. Each magnet also requires electricity and a gas connection for cooling. The whole thing forms (as shown in the plan on the right) a square with an edge length of 37 meters.\n".. - "\n".. - "The plan shows the facility from above:\n".. - "\n".. - " - the gray block is the detector with the worker block in the middle\n".. - " - the red blocks are the magnets\\, the blue the vacuum tubes\n".. - "\n".. - "\n".. - "\n", - "The detector is set up automatically with the help of the \"TA4 Collider Detector Worker\" block (similar to the derrick). All of the materials required for this must first be placed in the worker block. The detector is shown symbolically on the worker block. The detector is set up across the worker block.\n".. - "\n".. - "The detector can also be dismantled again with the help of the worker block.\n".. - "\n".. - "The connections for electricity\\, gas and vacuum tubes are located on the two front sides of the detector. A TA4 pump must be connected at the top in order to suck the tube empty / to create the vacuum.\n".. - "\n".. - "The cooling system must be connected to the rear of the detector. The cooling system is shown in the plan on the right. In addition to the TA4 heat exchanger of the energy storage unit (which is used here for cooling)\\, a TA4 cooler block is also required.\n".. - "\n".. - "Note: The arrow on the heat exchanger must point away from the detector. The heat exchanger must also be supplied with electricity.\n".. - "\n".. - "\n".. - "\n".. - " - In addition\\, cooling is required\\, which must also be installed at the detector. Isobutane is required for cooling.\n".. - " - The system requires quite a bit of electricity. Therefore\\, it makes sense to have your own power supply.\n".. - "\n", - "The collider is controlled via a TA4 terminal (not via the TA4 Lua controller terminal).\n".. - "\n".. - "This terminal must be connected to the detector. The number of the detector is displayed as info text on the worker block.\n".. - "\n".. - "The terminal supports the following commands:\n".. - "\n".. - " - 'connect ' (connect to the detector)\n".. - " - 'start' (starting the detector)\n".. - " - 'stop' (stop the detector)\n".. - " - 'test ' (checking a magnet)\n".. - " - 'points' (query of the experience points already achieved)\n".. - "\n".. - "If an error occurs on a magnet during the 'start'\\, the number of the magnet is output. The 'test' command can be used to request further information on the magnet error.\n".. - "\n".. - "\n".. - "\n", - "Each TA4 Collider magnet must also be supplied with electricity (as shown on the right in the plan) and with Isobutane for cooling:\n".. - "\n".. - " - The connection for the power is on the top of the magnet.\n".. - " - The connection for the cooling is on the front of the magnet.\n".. - " - A TA4 pump and a TA4 tank with at least 250 units of isobutane are also required to cool the entire system.\n".. - " - The system also requires a lot of electricity. It therefore makes sense to have your own power supply with at least 145 ku.\n".. - "\n".. - "\n".. - "\n", - "The following sequence is recommended when setting up the collider:\n".. - "\n".. - " - Put a forceload block. Only the detector with the cooling system has to be in the area of ​​the forceload block.\n".. - " - Set the worker block\\, fill it with items and set up the detector via the menu\n".. - " - Build the ring with tubes and magnets\n".. - " - Connect all magnets and the detector with power cables\n".. - " - Connect all magnets and the detector with the yellow tubes and pump the isobutane into the tube system with a pump\n".. - " - Install a TA4 pump as a vacuum pump on the detector and switch it on (no additional tank is required). If the pump goes into \"standby\"\\, the vacuum is established. This will take a few seconds\n".. - " - assemble the cooler (heat exchanger) and connect it to the power cable\n".. - " - Place the TA4 terminal in front of the detector and connect it to the detector via 'connect '\n".. - " - Switch on / connect the power supply\n".. - " - switch on the cooler (heat exchanger)\n".. - " - Switch on the detector via 'start' on the TA4 terminal. After a few test steps\\, the detector goes into normal operation or outputs an error.\n".. - " - The collider has to run continuously and then gradually delivers experience points. For 10 points\\, the collider has to run for a few hours\n".. - "\n".. - "\n".. - "\n", - "", - "Up to 10 recipes can be saved in the recipe block. These recipes can then be called up via a TA4 Autocrafter command. This enables the autocrafter's recipe to be configured using a command. The recipes in the recipe block can also be queried directly using a command.\n".. - "\n".. - "'input ' reads a recipe from the TA4 recipe block. '' is the number of the recipe. The block returns a list of recipe ingredients.\n".. - "\n".. - "Example: '$send_cmnd(1234\\, \"input\"\\, 1)'\n".. - "\n".. - " \n".. - "\n", - "The function corresponds to that of TA3.\n".. - "\n".. - "The processing power is 4 items every 4 s. The autocrafter requires 9 ku of electricity for this.\n".. - "\n".. - "In addition\\, the TA4 Autocrafter supports the selection of different recipes using the following commands:\n".. - "\n".. - "'recipe \".\"' switches the autocrafter to a recipe from the TA4 Recipe Block. '' is the number of the recipe block\\, '' the recipe number. Example: '$send_cmnd(1234\\, \"recipe\"\\, \"5467.1\")'\n".. - "\n".. - "Alternatively\\, a recipe can also be selected via the list of ingredients\\, such as:\n".. - "'$send_cmnd(1234\\, \"recipe\"\\, \"default:coal_lump\\,\\,\\,default:stick\")'\n".. - "All technical names of a recipe must be specified here\\, separated by commas. See also the command 'input' in the TA4 recipe block.\n".. - "\n".. - "The 'flush' command moves all items from the input inventory to the output inventory. The command returns 'true' if the input inventory was completely emptied. If 'false' was returned (output inventory full)\\, the command must be repeated at a later time.\n".. - "\n".. - " \n".. - "\n", - "See TA3 tank.\n".. - "\n".. - "A TA4 tank can hold 2000 units or 200 barrels of liquid.\n".. - "\n".. - "\n".. - "\n", - "See TA3 pump.\n".. - "\n".. - "The TA4 pump pumps 8 units of liquid every two seconds. \n".. - "\n".. - "In the \"Flow limiter\" mode\\, the number of units pumped by the pump can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of units in the menu. Once the configured number of units have been pumped\\, the pump will turn off. When the pump is turned on again\\, it will pump the configured number of units again and then turn off.\n".. - "\n".. - "The flow limiter can also be configured and started using a Lua or Beduino controller.\n".. - "\n".. - "The pump also supports the 'flowrate' command. This allows the total flow rate through the pump to be queried.\n".. - "\n".. - "\n".. - "\n", - "With TA4\\, the industrial furnace also has its electrical heating. The oil burner and the blower can be replaced with the heater.\n".. - "\n".. - "The heater requires 14 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "This block can no longer be crafted and will be replaced by the TA4 water inlet block. \n".. - "\n", - "Some recipes require water. The water must be pumped from the sea with a pump (water at y = 1). A \"pool\" made up of a few water blocks is not sufficient for this! \n".. - "\n".. - "To do this\\, the water inlet block must be placed in the water and connected to the pump via pipes. If the block is placed in the water\\, it must be ensured that there is water under the block (water must be at least 2 blocks deep). \n".. - "\n".. - "\n".. - "\n", - "TA4 also has its own tubes in the TA4 design. These can be used like standard tubes.\n".. - "But: TA4 pushers and TA4 distributors only achieve their full performance when used with TA4 tubes.\n".. - "\n".. - "\n".. - "\n", - "The function basically corresponds to that of TA2 / TA3. In addition\\, a menu can be used to configure which objects should be taken from a TA4 chest and transported further.\n".. - "The processing power is 12 items every 2 s\\, if TA4 tubes are used on both sides. Otherwise there are only 6 items every 2 s.\n".. - "\n".. - "In the \"flow limiter\" mode\\, the number of items that are moved by the pusher can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of items in the menu. As soon as the configured number of items have been moved\\, the pusher switches off. If the pusher is switched on again\\, it moves the configured number of items again and then switches off.\n".. - "\n".. - "The TA4 pusher can also be configured and started using a Lua or Beduino controller.\n".. - "\n".. - "Here are the additional commands for the Lua controller:\n".. - "\n".. - " - 'config' is used to configure the pusher\\, analogous to manual configuration via the menu.\n Example: '$send_cmnd(1234\\, \"config\"\\, \"default:dirt\")'\n With '$send_cmnd(1234\\, \"config\"\\, \"\")' the configuration is deleted\n".. - " - 'limit' is used to set the number of items for the flow limiter mode:\n Example: '$send_cmnd(1234\\, \"init\"\\, 7)'\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA3. The chest can hold more content.\n".. - "\n".. - "In addition\\, the TA4 chest has a shadow inventory for configuration. Here certain stack locations can be pre-assigned with an item. Pre-assigned inventory stacks are only filled with these items when filling. A TA4 pusher or TA4 injector with the appropriate configuration is required to empty a pre-assigned inventory stacks.\n".. - "\n".. - "\n".. - "\n", - "The TA4 8x2000 chest does not have a normal inventory like other chest\\, but has 8 stores\\, whereby each store can hold up to 2000 items of one sort. The orange buttons can be used to move items to or from the store. The box can also be filled or emptied with a pusher (TA2\\, TA3 or TA4) as usual.\n".. - "\n".. - "If the chest is filled with a pusher\\, all stores fill from left to right. If all 8 stores are full and no further items can be added\\, further items are rejected.\n".. - "\n".. - "*Row function*\n".. - "\n".. - "Several TA4 8x2000 chests can be connected to a large chest with more content. To do this\\, the chests must be placed in a row one after the other.\n".. - "\n".. - "First the front chest must be placed\\, then the stacking chests are placed behind with the same direction of view (all boxes have the front towards the player). With 2 chests in a row\\, the size increases to 8x4000\\, etc.\n".. - "\n".. - "The rows of chests can no longer be removed. There are two ways to dismantle the chests:\n".. - "\n".. - " - Empty and remove the front chest. This unlocks the next chest and can be removed.\n".. - " - Empty the front chest so far that all stores contain a maximum of 2000 items. This unlocks the next chest and can be removed.\n".. - "\n".. - "The chests have an \"order\" checkbox. If this checkbox is activated\\, the stores are no longer completely emptied by a pusher. The last item remains in the store as a default. This results in a fixed assignment of items to storage locations.\n".. - "\n".. - "The chest can only be used by players who can build at this location\\, i.e. who have protection rights. It does not matter who sets the chest.\n".. - "\n".. - "The chest has an additional command for the Lua controller:\n".. - "\n".. - " - 'count' is used to request how many items are in the chest.\nExample 1: '$send_cmnd(CHEST\\, \"count\")' -> Sum of items across all 8 stores\nExample 2: '$send_cmnd(CHEST\\, \"count\"\\, 2)' -> number of items in store 2 (second from left)\n".. - " - 'storesize' is used to read the size of one of the eight stores:\nExample: '$send_cmnd(CHEST\\, \"storesize\")' -> function returns e.g. 6000\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 24 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 12 items every 4 s.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of the normal TA4 distributor\\, with two differences:\n".. - "The processing power is 36 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s.\n".. - "Furthermore\\, up to 8 items can be configured per direction.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 4 items every 4 s. The block requires 5 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2.\n".. - "The processing power is 4 items every 4 s. The block requires 9 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function largely corresponds to that of TA2.\n".. - "\n".. - "In addition\\, the hole size can be set between 3x3 and 11x11 blocks.\n".. - "The maximum depth is 80 meters. The quarry requires 14 ku of electricity.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA2\\, only different chips are produced here.\n".. - "The processing power is one chip every 6 s. The block requires 12 ku of electricity for this.\n".. - "\n".. - "\n".. - "\n", - "The function corresponds to that of TA3.\n".. - "\n".. - "The processing power is up to 8 times four items every 4 seconds.\n".. - "\n".. - "\n".. - "\n", - "The recycler is a machine that processes all Techage recipes backwards\\, i.e. it can dismantle machines and blocks back into their components. \n".. - "\n".. - "The machine can disassemble pretty much any Techage and Hyperloop blocks. But not all recipe items/materials can be recycled:\n".. - "\n".. - " - Wood turns into sticks\n".. - " - Stone turns into sand or gravel\n".. - " - Semiconductors / chips cannot be recycled\n".. - " - Tools cannot be recycled\n".. - "\n".. - "The processing power is one item every 8 s. The block requires 16 ku of electricity for this.\n".. - "\n".. - " \n".. - "\n", - }, - images = { - "techage_ta4", - "", - "ta4_windturbine", - "ta4_nacelle", - "ta4_blinklamp", - "ta4_pillar", - "", - "ta4_solarmodule", - "ta4_solarcarrier", - "ta4_solar_inverter", - "ta4_powercable", - "ta4_powerbox", - "ta4_minicell", - "", - "ta4_heatexchanger", - "ta4_turbine", - "ta4_generator", - "ta4_pipeinlet", - "ta4_pipe", - "ta4_transformer", - "ta4_transformer", - "ta4_electricmeter", - "ta4_laser", - "ta4_hydrogen", - "ta4_electrolyzer", - "ta4_fuelcell", - "", - "ta4_doser", - "ta4_reactor", - "ta4_fillerpipe", - "ta4_reactorstand", - "ta4_reactorbase", - "ta4_silo", - "ta4_icta_controller", - "ta4_icta_controller", - "ta4_battery", - "ta4_display", - "ta4_displayXL", - "ta4_signaltower", - "ta4_lua_controller", - "ta4_lua_server", - "ta4_sensor_chest", - "ta4_terminal", - "", - "ta4_button", - "ta4_button_2x", - "ta4_button_4x", - "ta4_signallamp_2x", - "ta4_signallamp_4x", - "ta4_playerdetector", - "ta4_collector", - "ta4_detector", - "ta4_nodedetector", - "ta4_chargedetector", - "ta4_gaze_sensor", - "ta4_sequencer", - "", - "ta4_movecontroller", - "ta4_turncontroller", - "", - "ta4_growlight", - "ta4_streetlamp", - "ta4_industriallamp", - "ta4_liquid_filter", - "", - "", - "", - "", - "", - "ta4_terminal", - "", - "techage_ta4c", - "", - "ta4_recipeblock", - "ta4_autocrafter", - "ta4_tank", - "ta4_pump", - "ta4_furnaceheater", - "", - "ta4_waterinlet", - "ta4_tube", - "ta4_pusher", - "ta4_chest", - "ta4_8x2000_chest", - "ta4_distributor", - "ta4_high_performance_distributor", - "ta4_gravelsieve", - "ta4_grinder", - "ta4_quarry", - "ta4_electronicfab", - "ta4_injector", - "ta4_recycler", - }, - plans = { - "", - "ta4_windturbine", - "", - "", - "", - "", - "ta4_solarplant", - "", - "", - "", - "", - "", - "", - "ta4_storagesystem", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_reactor", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_liquid_filter_base", - "ta4_liquid_filter_gravel", - "ta4_liquid_filter_top", - "techage_collider_plan", - "ta4_cooler", - "", - "techage_collider_plan2", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta4_pt-BR.lua b/techage/doc/manual_ta4_pt-BR.lua deleted file mode 100644 index 51ab2fe..0000000 --- a/techage/doc/manual_ta4_pt-BR.lua +++ /dev/null @@ -1,1054 +0,0 @@ -return { - titles = { - "1,TA4: Presente", - "2,Turbina eólica", - "3,Turbina eólica TA4", - "3,Nacelle da turbina eólica TA4", - "3,Lâmpada de sinalização de turbina eólica TA4", - "3,Pilar TA4", - "2,Sistema Solar", - "3,Módulo solar TA4", - "3,Módulo de transporte solar TA4", - "3,Inversor solar TA4", - "3,Cabo de baixa potência TA4", - "3,Caixa de junção de baixa tensão TA4", - "3,Célula solar para lâmpadas de rua TA4", - "2,Armazenamento de energia térmica", - "3,Trocador de calor TA4", - "3,Turbina TA4", - "3,Gerador TA4", - "3,Entrada do tubo TA4", - "3,Tubo TA4", - "2,Distribuição de energia", - "3,Transformador de isolamento TA4", - "3,Medidor elétrico TA4", - "3,Laser TA4", - "2,Hidrogênio", - "3,Eletrolisador", - "3,Célula de combustível", - "2,Reator químico", - "3,Dosador TA4", - "3,Reator TA4", - "3,Tubo de enchimento TA4", - "3,Suporte do reator TA4", - "3,Base do reator TA4", - "3,Silo TA4", - "2,Controlador ICTA", - "3,Controlador TA4 ICTA", - "3,Bateria", - "3,Exibição do TA4", - "3,TA4 Display XL", - "3,Torre de sinalização TA4", - "2,Controlador TA4 Lua", - "3,Servidor TA4 Lua", - "3,Caixa do sensor TA4 / baú", - "3,Terminal do controlador TA4 Lua", - "2,Módulos de lógica/comutação TA4", - "3,Botão/interruptor TA4", - "3,Botão TA4 2x", - "3,Botão TA4 4x", - "3,Lâmpada de sinalização TA4 2x", - "3,Lâmpada de sinalização TA4 4x", - "3,Detector de jogadores TA4", - "3,Coletor de estado TA4", - "3,Detector TA4", - "3,Detector de nó TA4", - "3,Detector de carga de armazenamento de energia TA4", - "3,Sensor de olhar TA4", - "3,Sequenciador TA4", - "2,Controlador de movimento/volta", - "3,Controlador de movimento TA4", - "3,Controlador de giro TA4", - "2,Lâmpadas TA4", - "3,Luz de cultivo LED TA4", - "3,Lâmpada de rua TA4", - "3,Lâmpada industrial de LED TA4", - "2,Filtro líquido TA4", - "3,Camada de base", - "3,Camada de cascalho", - "3,Camada de enchimento", - "2,Colisor TA4 (acelerador de partículas)", - "3,Detector", - "3,Controle / Terminal TA4", - "3,Resfriamento e energia", - "3,Construção", - "2,Mais blocos TA4", - "3,Bloco de receitas TA4", - "3,TA4 Autocrafter", - "3,Tanque TA4", - "3,Bomba TA4", - "3,Aquecedor de forno TA4", - "3,Bomba d'água TA4 (obsoleta)", - "3,Entrada de água TA4", - "3,Tubo TA4", - "3,TA4 Pusher", - "3,Peito TA4", - "3,Baú TA4 8x2000", - "3,Distribuidor TA4", - "3,Distribuidor de alto desempenho TA4", - "3,Peneira de cascalho TA4", - "3,Moedor TA4", - "3,Pedreira TA4", - "3,Fab. eletrônica TA4", - "3,Injetor TA4", - "3,Reciclador TA4", - }, - texts = { - "Fontes de energia renováveis\\, como vento\\, sol e biocombustíveis\\, ajudam você a sair da era do petróleo. Com tecnologias modernas e máquinas inteligentes\\, você parte para o futuro.\n".. - "\n".. - "\n".. - "\n", - "Uma turbina eólica sempre fornece eletricidade quando há vento. Não há vento no jogo\\, mas o mod simula isso girando as turbinas eólicas somente pela manhã (5:00 - 9:00) e à noite (17:00 - 21:00). Uma turbina eólica só fornece eletricidade se estiver instalada em um local adequado.\n".. - "\n".. - "As usinas eólicas da TA são usinas puramente offshore\\, o que significa que elas precisam ser construídas no mar. Isso significa que as turbinas eólicas só podem ser construídas em um bioma marinho (oceano) e que deve haver água suficiente e uma visão clara ao redor do mastro.\n".. - "\n".. - "Para encontrar um local adequado\\, clique na água com a chave inglesa (TechAge Info Tool). Uma mensagem de bate-papo mostrará se essa posição é adequada para o mastro da turbina eólica.\n".. - "\n".. - "A corrente deve ser conduzida do bloco do rotor até o mastro. Primeiro\\, puxe a linha de energia para cima e\\, em seguida\\, \"engesse\" o cabo de energia com blocos de pilar TA4. Uma plataforma de trabalho pode ser construída abaixo. A planta à direita mostra a estrutura na parte superior.\n".. - "\n".. - "A turbina eólica fornece 70 ku\\, mas apenas 8 horas por dia (veja acima).\n".. - "\n".. - "\n".. - "\n", - "O bloco da turbina eólica (rotor) é o coração da turbina eólica. Esse bloco deve ser colocado no topo do mastro. Idealmente\\, em Y = 15\\, então você fica dentro de um bloco de mapa/carga.\n".. - "Quando você inicia a turbina\\, todas as condições para a operação da turbina eólica são verificadas. Se todas as condições forem atendidas\\, as pás do rotor (asas) aparecerão automaticamente. Caso contrário\\, você receberá uma mensagem de erro.\n".. - "\n".. - "\n".. - "\n", - "Esse bloco deve ser colocado na extremidade preta do bloco da turbina eólica.\n".. - "\n".. - "\n".. - "\n", - "Essa luz intermitente serve apenas para fins decorativos e pode ser colocada na parte superior do bloco da turbina eólica.\n".. - "\n".. - "\n".. - "\n", - "Isso constrói o mastro da turbina eólica. No entanto\\, esses blocos não são fixados manualmente\\, mas devem ser fixados com a ajuda de uma espátula(trowel)\\, de modo que a linha de energia para a ponta do mastro seja substituída por esses blocos (consulte Cabo de energia TA).\n".. - "\n".. - "\n".. - "\n", - "O sistema solar só produz eletricidade quando o sol está brilhando. No jogo\\, isso ocorre todo dia de jogo\\, das 6h às 18h.\n".. - "A mesma energia está sempre disponível durante esse período. Após as 18h00\\, os módulos solares se desligam completamente.\n".. - "\n".. - "A temperatura do bioma é decisiva para o desempenho dos módulos solares. Quanto mais quente for a temperatura\\, maior será o rendimento.\n".. - "A temperatura do bioma pode ser determinada com a Techage Info Tool (chave inglesa). Normalmente\\, ela oscila entre 0 e 100:\n".. - "\n".. - " - a potência total está disponível a 100\n".. - " - a 50\\, metade da potência está disponível\n".. - " - em 0\\, não há serviço disponível\n".. - "\n".. - "Portanto\\, é aconselhável procurar estepes e desertos quentes para o sistema solar.\n".. - "As linhas aéreas estão disponíveis para o transporte de eletricidade.\n".. - "No entanto\\, também é possível produzir hidrogênio\\, que pode ser transportado e convertido novamente em eletricidade no destino.\n".. - "\n".. - "A menor unidade em um sistema solar é composta por dois módulos solares e um módulo de transporte. O módulo de transporte deve ser colocado primeiro\\, com os dois módulos solares à esquerda e à direita próximos a ele (não acima!).\n".. - "\n".. - "A planta à direita mostra 3 unidades\\, cada uma com dois módulos solares e um módulo de suporte\\, conectadas ao inversor por meio de cabos vermelhos.\n".. - "\n".. - "Os módulos solares fornecem tensão CC\\, que não pode ser alimentada diretamente na rede elétrica. Portanto\\, as unidades solares devem primeiro ser conectadas ao inversor por meio do cabo vermelho. Ele consiste em dois blocos\\, um para o cabo vermelho dos módulos solares (CC) e outro para o cabo de alimentação cinza da rede elétrica (CA).\n".. - "\n".. - "A área do mapa onde o sistema solar está localizado deve estar totalmente carregada. Isso também se aplica à posição direta acima do módulo solar\\, pois a intensidade da luz é medida regularmente nesse local. Portanto\\, é aconselhável definir primeiro um bloco de carga e depois colocar os módulos dentro dessa área.\n".. - "\n".. - "\n".. - "\n", - "O módulo solar deve ser colocado no módulo de suporte. São sempre necessários dois módulos solares.\n".. - "Em um par\\, os módulos solares têm desempenho de até 3 ku\\, dependendo da temperatura.\n".. - "Com os módulos solares\\, deve-se tomar cuidado para que eles tenham plena luz do dia e não sejam sombreados por blocos ou árvores. Isso pode ser testado com a Info Tool (wrench ou chave inglesa).\n".. - "\n".. - "\n".. - "\n", - "O módulo de suporte está disponível em duas alturas (1m e 2m). Ambos são funcionalmente idênticos.\n".. - "Os módulos portadores podem ser colocados diretamente um ao lado do outro e\\, assim\\, conectados para formar uma fileira de módulos. A conexão com o inversor ou com outras séries de módulos deve ser feita com os cabos vermelhos de baixa tensão ou com as caixas de junção de baixa tensão.\n".. - "\n".. - "\n".. - "\n", - "O inversor converte a energia solar (CC) em corrente alternada (CA) para que ela possa ser alimentada na rede elétrica.\n".. - "Um inversor pode alimentar um máximo de 100 ku de eletricidade\\, o que corresponde a 33 módulos solares ou mais.\n".. - "\n".. - "\n".. - "\n", - "O cabo de baixa tensão é usado para conectar fileiras de módulos solares ao inversor. O cabo não deve ser usado para outros fins.\n".. - "\n".. - "O comprimento máximo do cabo é de 200 m.\n".. - "\n".. - "\n".. - "\n", - "A caixa de junção deve ser colocada no chão. Ela tem apenas 4 conexões (nas 4 direções).\n".. - "\n".. - "\n".. - "\n", - "Como o nome sugere\\, a célula solar para lâmpadas de rua é usada para alimentar uma lâmpada de rua. Uma célula solar pode alimentar duas lâmpadas (1 ku). A célula solar armazena a energia do sol durante o dia e fornece a eletricidade para a lâmpada à noite. Isso significa que a lâmpada só brilha no escuro.\n".. - "\n".. - "Essa célula solar não pode ser combinada com os outros módulos solares.\n".. - "\n".. - "\n".. - "\n", - "O armazenamento de energia térmica substitui o bloco de baterias do TA3.\n".. - "\n".. - "O armazenamento de energia térmica consiste em uma concha de concreto (blocos de concreto) preenchida com cascalho. São possíveis cinco tamanhos de armazenamento:\n".. - "\n".. - " - Cobertura com blocos de concreto 5x5x5\\, preenchida com 27 cascalhos\\, capacidade de armazenamento: 22\\,5 kud\n".. - " - Cobertura com blocos de concreto 7x7x7\\, preenchidos com cascalho 125\\, capacidade de armazenamento: 104 kud\n".. - " - Cobertura com blocos de concreto 9x9x9\\, preenchida com 343 cascalhos\\, capacidade de armazenamento: 286 kud\n".. - " - Cobertura com blocos de concreto 11x11x11\\, preenchida com 729 cascalhos\\, capacidade de armazenamento: 610 kud\n".. - " - Cobertura com blocos de concreto 13x13x13\\, preenchidos com cascalho 1331\\, capacidade de armazenamento: 1112 kud\n".. - "\n".. - "Uma janela feita de um bloco de vidro de obsidiana pode ser colocada na estrutura de concreto. Ela deve ser colocada bem no meio da parede. Por essa janela\\, é possível ver se o armazenamento está carregado em mais de 80%. Na planta à direita\\, você pode ver a estrutura do trocador de calor TA4\\, que consiste em 3 blocos\\, a turbina TA4 e o gerador TA4. Preste atenção ao alinhamento do trocador de calor (a seta no bloco 1 deve apontar para a turbina).\n".. - "\n".. - "Ao contrário da planta à direita\\, as conexões no bloco de armazenamento devem estar no mesmo nível (dispostas horizontalmente\\, ou seja\\, não abaixo e acima). As entradas de tubulação (TA4 Pipe Inlet) devem estar exatamente no meio da parede e de frente uma para a outra. Os tubos TA4 amarelos são usados como tubos de vapor. Os tubos de vapor TA3 não podem ser usados aqui.\n".. - "Tanto o gerador quanto o trocador de calor têm uma conexão de energia e devem ser conectados à rede elétrica.\n".. - "\n".. - "Em princípio\\, o sistema de armazenamento de calor funciona exatamente da mesma forma que as baterias\\, só que com muito mais capacidade de armazenamento.\n".. - "\n".. - "Para que o sistema de armazenamento de calor funcione\\, todos os blocos (também a casca de concreto e o cascalho) devem ser carregados usando um bloco forceload.\n".. - "\n".. - "\n".. - "\n", - "O trocador de calor consiste em três partes que devem ser colocadas umas sobre as outras\\, com a seta do primeiro bloco apontando para a turbina. Os tubos devem ser construídos com os tubos TA4 amarelos.\n".. - "O trocador de calor deve ser conectado à rede elétrica. O dispositivo de armazenamento de energia é recarregado por meio do trocador de calor\\, desde que haja eletricidade suficiente disponível. \n".. - "\n".. - "\n".. - "\n", - "A turbina faz parte do armazenamento de energia. Ela deve ser colocada ao lado do gerador e conectada ao trocador de calor por meio de tubos TA4\\, conforme mostrado na planta.\n".. - "\n".. - "\n".. - "\n", - "O gerador é usado para gerar eletricidade. Portanto\\, o gerador também deve ser conectado à rede elétrica.\n".. - "O gerador faz parte do armazenamento de energia. Ele é usado para gerar eletricidade e\\, assim\\, liberar a energia da unidade de armazenamento de energia. Portanto\\, o gerador também deve ser conectado à rede elétrica.\n".. - "\n".. - "Importante: Tanto o trocador de calor quanto o gerador devem estar conectados à mesma rede elétrica! \n".. - "\n".. - "\n".. - "\n", - "Um bloco de entrada de tubo deve ser instalado em cada um dos dois lados do bloco de armazenamento. Os blocos devem estar exatamente de frente um para o outro.\n".. - "\n".. - "Os blocos de entrada de tubo *não* podem ser usados como aberturas normais de parede\\; em vez disso\\, use os blocos de entrada de tubo TA3 na parede.\n".. - "\n".. - "\n".. - "\n", - "Com o TA4\\, os tubos amarelos são usados para a transmissão de gás e líquidos.\n".. - "O comprimento máximo do cabo é de 100 m.\n".. - "\n".. - "\n".. - "\n", - "Com a ajuda de cabos de energia e caixas de junção\\, é possível configurar redes de energia de até 1.000 blocos/nós. Entretanto\\, deve-se observar que as caixas de distribuição também devem ser contadas. Isso significa que até 500 geradores/sistemas de armazenamento/máquinas/lâmpadas podem ser conectados a uma rede elétrica.\n".. - "\n".. - "Com a ajuda de um transformador de isolamento e de um medidor de eletricidade\\, as redes podem ser conectadas para formar estruturas ainda maiores.\n".. - "\n".. - "\n".. - "\n", - "Com a ajuda de um transformador de isolamento\\, duas redes de energia podem ser conectadas para formar uma rede maior. O transformador de isolamento pode transmitir eletricidade em ambas as direções.\n".. - "\n".. - "O transformador de isolamento pode transmitir até 300 ku. O valor máximo é ajustável por meio do menu da chave inglesa.\n".. - "\n".. - "\n".. - "\n", - "Com a ajuda de um medidor de eletricidade\\, duas redes de eletricidade podem ser conectadas para formar uma rede maior. O medidor de eletricidade transmite eletricidade somente em uma direção (observe a seta). A quantidade de energia elétrica transmitida (em kud) é medida e exibida. Esse valor também pode ser consultado por um controlador Lua usando o comando 'consumption'. A corrente atual pode ser consultada por meio do comando 'current'.\n".. - "\n".. - "O medidor de eletricidade pode passar até 200 ku. O valor máximo é ajustável por meio do menu da chave inglesa.\n".. - "\n".. - "Uma contagem regressiva da potência de saída também pode ser inserida por meio do menu da chave inglesa. Quando essa contagem regressiva chega a zero\\, o medidor de eletricidade é desligado. A contagem regressiva pode ser consultada com o comando 'countdown'.\n".. - "\n".. - "\n".. - "\n", - "O laser TA4 é usado para transmissão de energia sem fio. Para isso\\, são necessários dois blocos: Emissor de feixe de laser TA4 e Receptor de feixe de laser TA4. Deve haver um espaço de ar entre os dois blocos para que o feixe de laser possa ser construído a partir do emissor até o receptor. Primeiro\\, o emissor deve ser colocado. Isso liga imediatamente o feixe de laser e mostra as possíveis posições do receptor. As possíveis posições do receptor também são exibidas por meio de uma mensagem de bate-papo. \n".. - "\n".. - "Com o laser\\, distâncias de até 96 blocos podem ser superadas. Depois que a conexão é estabelecida (não é necessário haver fluxo de corrente)\\, isso é indicado por meio do texto informativo do emissor e também do receptor. \n".. - "\n".. - "Os blocos de laser em si não requerem eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A eletrólise pode ser usada para dividir a eletricidade em hidrogênio e oxigênio. Por outro lado\\, o hidrogênio pode ser convertido novamente em eletricidade com o oxigênio do ar usando uma célula de combustível.\n".. - "Isso permite que os picos de corrente ou um excesso de fornecimento de eletricidade sejam convertidos em hidrogênio e\\, portanto\\, armazenados.\n".. - "\n".. - "No jogo\\, a eletricidade pode ser convertida novamente em eletricidade por meio da célula de combustível usando o eletrolisador em hidrogênio e hidrogênio.\n".. - "Isso significa que a eletricidade (na forma de hidrogênio) pode não apenas ser armazenada em tanques\\, mas também transportada por meio do carrinho-tanque.\n".. - "\n".. - "No entanto\\, a conversão de eletricidade em hidrogênio e vice-versa é deficitária. De 100 unidades de eletricidade\\, apenas 95 unidades de eletricidade saem após a conversão em hidrogênio e vice-versa.\n".. - "\n".. - "\n".. - "\n", - "O eletrolisador converte eletricidade em hidrogênio.\n".. - "Ele deve ser alimentado pela esquerda. À direita\\, o hidrogênio pode ser extraído por meio de tubos e bombas.\n".. - "\n".. - "O eletrolisador pode consumir até 35 ku de eletricidade e\\, em seguida\\, gera um item de hidrogênio a cada 4 s.\n".. - "200 unidades de hidrogênio cabem no eletrolisador.\n".. - "\n".. - "O eletrolisador tem um menu de chave inglesa para definir o consumo de corrente e o ponto de desligamento.\n".. - "\n".. - "Se a energia armazenada na rede elétrica cair abaixo do valor especificado do ponto de desligamento\\, o eletrolisador se desliga automaticamente. Isso evita que os sistemas de armazenamento fiquem vazios.\n".. - "\n".. - "\n".. - "\n", - "A célula de combustível converte hidrogênio em eletricidade.\n".. - "Ele deve ser abastecido com hidrogênio pela esquerda por meio de uma bomba. A conexão de energia está à direita.\n".. - "\n".. - "A célula de combustível pode fornecer até 34 ku de eletricidade e precisa de um item de hidrogênio a cada 4 s.\n".. - "\n".. - "Normalmente\\, a célula de combustível funciona como um gerador de categoria 2 (como outros sistemas de armazenamento). \n".. - "Nesse caso\\, nenhum outro bloco de categoria 2\\, como o bloco de bateria\\, pode ser carregado. No entanto\\, a célula de combustível também pode ser usada como um gerador de categoria 1 por meio da caixa de seleção.\n".. - "\n".. - "\n".. - "\n", - "O reator é usado para processar os ingredientes obtidos da torre de destilação ou de outras receitas em novos produtos.\n".. - "A planta à esquerda mostra apenas uma variante possível\\, pois a disposição dos silos e tanques depende da receita.\n".. - "\n".. - "O produto primário de saída é sempre descarregado na lateral do suporte do reator\\, independentemente de ser um pó ou um líquido. O produto residual (secundário) é sempre descarregado na parte inferior do suporte do reator.\n".. - "\n".. - "Um reator consiste em:\n".. - "\n".. - " - Vários tanques e silos com os ingredientes que são conectados ao dosador por meio de tubos\n".. - " - opcionalmente\\, uma base do reator\\, que descarrega os resíduos do reator (necessário apenas para receitas com dois produtos de saída)\n".. - " - o suporte do reator\\, que deve ser colocado na base (se disponível). O suporte tem uma conexão de energia e consome 8 ku durante a operação.\n".. - " - O vaso do reator que deve ser colocado no suporte do reator\n".. - " - O tubo de enchimento que deve ser colocado no vaso do reator\n".. - " - O dispositivo de dosagem\\, que deve ser conectado aos tanques ou silos e ao tubo de enchimento por meio de tubos\n".. - "\n".. - "Observação 1: Os líquidos são armazenados somente em tanques e os sólidos e substâncias em pó somente em silos. Isso se aplica a ingredientes e produtos finais.\n".. - "\n".. - "Observação 2: Os tanques ou silos com conteúdos diferentes não devem ser conectados a um sistema de tubulação. Por outro lado\\, vários tanques ou silos com o mesmo conteúdo podem ser pendurados em paralelo em uma linha.\n".. - "\n".. - "O craqueamento quebra cadeias longas de hidrocarbonetos em cadeias curtas usando um catalisador.\n".. - "O pó de gibbsita serve como catalisador (não é consumido). Ele pode ser usado para converter betume em óleo combustível\\, óleo combustível em nafta e nafta em gasolina.\n".. - "\n".. - "Na hidrogenação\\, pares de átomos de hidrogênio são adicionados a uma molécula para converter hidrocarbonetos de cadeia curta em longa.\n".. - "Aqui\\, o pó de ferro é necessário como catalisador (não é consumido). Ele pode ser usado para converter gás (propano) em isobutano\\,\n".. - "isobutano em gasolina\\, gasolina em nafta\\, nafta em óleo combustível e óleo combustível em betume.\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico.\n".. - "As tubulações para materiais de entrada podem ser conectadas em todos os quatro lados do dosador. Os materiais para o reator são descarregados para cima.\n".. - "\n".. - "A receita pode ser definida e o reator pode ser iniciado por meio do dosador.\n".. - "\n".. - "Como em outras máquinas:\n".. - "\n".. - " - se o dosador estiver no modo de espera\\, um ou mais ingredientes estão faltando\n".. - " - se o dosador estiver no estado bloqueado\\, o tanque ou silo de saída está cheio\\, com defeito ou conectado incorretamente\n".. - "\n".. - "O dosador não precisa de eletricidade. Uma receita é processada a cada 10 s.\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico. O reator tem um inventário para os itens de catalisador (para receitas de craqueamento e hidrogenação).\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico. Deve ser colocado no reator. Se isso não funcionar\\, remova o tubo na posição acima e coloque-o novamente.\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico. Aqui também está a conexão de energia para o reator. O reator requer 8 ku de eletricidade.\n".. - "\n".. - "O suporte tem duas conexões de tubulação\\, à direita para o produto inicial e abaixo para os resíduos\\, como a lama vermelha na produção de alumínio.\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico. É necessário para a drenagem do produto residual.\n".. - "\n".. - "\n".. - "\n", - "Parte do reator químico. É necessário para armazenar substâncias em forma de pó ou grânulos.\n".. - "\n".. - "\n".. - "\n", - "O controlador ICTA (ICTA significa \"If Condition Then Action\") é usado para monitorar e controlar máquinas. O controlador pode ser usado para ler dados de máquinas e outros blocos e\\, dependendo disso\\, ligar/desligar outras máquinas e blocos.\n".. - "\n".. - "Os dados da máquina são lidos e os blocos e máquinas são controlados por meio de comandos. O capítulo TA3 -> Blocos lógicos/comutação é importante para entender como os comandos funcionam.\n".. - "\n".. - "O controlador requer uma bateria para funcionar. O visor é usado para emitir dados\\, a torre de sinalização para exibir erros.\n".. - "\n".. - "\n".. - "\n", - "O controlador funciona com base nas regras 'IF THEN '. Podem ser criadas até 8 regras por controlador.\n".. - "\n".. - "Exemplos de regras são:\n".. - "\n".. - " - Se um distribuidor estiver \"bloqueado\"\\, o empurrador na frente dele deve ser desligado\n".. - " - Se uma máquina apresentar um erro\\, isso deverá ser mostrado no visor\n".. - "\n".. - "O controlador verifica essas regras ciclicamente. Para fazer isso\\, um tempo de ciclo em segundos (`` Cycle / s '') deve ser especificado para cada regra (1...1000).\n".. - "\n".. - "Para regras que avaliam uma entrada ligada/desligada\\, por exemplo\\, de um interruptor ou detector\\, o tempo de ciclo 0 deve ser especificado. O valor 0 significa que essa regra deve ser sempre executada quando o sinal de entrada for alterado\\, por exemplo\\, quando o botão enviar um novo valor.\n".. - "\n".. - "Todas as regras devem ser executadas apenas com a frequência necessária. Isso tem duas vantagens:\n".. - "\n".. - " - a bateria do controlador dura mais (cada controlador precisa de uma bateria)\n".. - " - a carga do servidor é menor (portanto\\, menos atrasos)\n".. - "\n".. - "Você deve definir um tempo de atraso ('depois/s') para cada ação. Se a ação tiver que ser executada imediatamente\\, deve-se inserir 0.\n".. - "\n".. - "O controlador tem sua própria ajuda e informações sobre todos os comandos por meio do menu do controlador.\n".. - "\n".. - "\n".. - "\n", - "A bateria deve ser colocada bem próxima ao controlador\\, ou seja\\, em uma das 26 posições ao redor do controlador.\n".. - "\n".. - "\n".. - "\n", - "O display mostra seu número após a colocação. O display pode ser endereçado por meio desse número. Os textos podem ser exibidos no visor\\, sendo que o visor pode exibir 5 linhas e\\, portanto\\, 5 textos diferentes.\n".. - "\n".. - "As linhas de texto são sempre alinhadas à esquerda. Se o texto tiver que ser centralizado horizontalmente\\, deverá ser precedido pelo caractere \"t\" (tabulador).\n".. - "\n".. - "O visor é atualizado no máximo uma vez por segundo.\n".. - "\n".. - "\n".. - "\n", - "O TA4 Display XL tem o dobro do tamanho do display TA4.\n".. - "\n".. - "As linhas de texto são sempre alinhadas à esquerda. Se o texto tiver que ser centralizado horizontalmente\\, deverá ser precedido pelo caractere \"t\" (tabulador).\n".. - "\n".. - "O visor é atualizado a cada dois segundos\\, no máximo.\n".. - "\n".. - "\n".. - "\n", - "A torre de sinalização pode exibir vermelho\\, verde e laranja. Não é possível uma combinação das três cores.\n".. - "\n".. - "\n".. - "\n", - "Como o nome sugere\\, o controlador Lua deve ser programado na linguagem de programação Lua. O manual em inglês está disponível aqui:\n".. - "\n".. - "https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md\n".. - "\n".. - "O controlador Lua também requer uma bateria. A bateria deve ser colocada bem próxima ao controlador\\, ou seja\\, em uma das 26 posições ao redor do controlador.\n".. - "\n".. - "\n".. - "\n", - "O servidor é usado para o armazenamento central de dados de vários controladores Lua. Ele também salva os dados após a reinicialização do servidor.\n".. - "\n".. - "\n".. - "\n", - "A caixa de sensores TA4 é usada para configurar armazéns automáticos ou máquinas de venda automática em conjunto com o controlador Lua.\n".. - "Se algo for colocado na caixa ou removido\\, ou se uma das teclas \"F1\"/\"F2\" for pressionada\\, um sinal de evento será enviado ao controlador Lua.\n".. - "A caixa do sensor suporta os seguintes comandos:\n".. - "\n".. - " - O status da caixa pode ser consultado por meio de 'state = $send_cmnd(\\, \"state\")'. As respostas possíveis são: \"empty\" (vazio)\\, \"loaded\" (carregado)\\, \"full\" (cheio)\n".. - " - A última ação do jogador pode ser consultada por meio de 'name\\, action = $send_cmnd(\\, \"action\")'. 'name' é o nome do jogador. Uma das seguintes opções é retornada como 'action': \"put\"\\, \"take\"\\, \"f1\"\\, \"f2\".\n".. - " - O conteúdo da caixa pode ser lido por meio de 'stacks = $send_cmnd(\\, \"stacks\")'. Consulte: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest\n".. - " - Por meio de '$send_cmnd(\\, \"text\"\\, \"pressione ambos os botões e coloque algo no peito\")'\\, o texto pode ser definido no menu da caixa do sensor.\n".. - "\n".. - "A caixa de seleção \"Allow public chest access\" (Permitir acesso público ao baú) pode ser usada para definir se a caixa pode ser usada por todos ou somente por jogadores que tenham direitos de acesso/proteção aqui.\n".. - "\n".. - "\n".. - "\n", - "O terminal é usado para entrada/saída do controlador Lua.\n".. - "\n".. - "\n".. - "\n", - "", - "Apenas a aparência do botão/chave TA4 foi alterada. A funcionalidade é a mesma do botão/chave TA3. No entanto\\, com o menu da chave inglesa\\, os dados podem ser alterados posteriormente.\n".. - "\n".. - "\n".. - "\n", - "Esse bloco tem dois botões que podem ser configurados individualmente por meio do menu de chave inglesa. A rotulagem e o endereço do bloco de destino podem ser configurados para cada botão. Além disso\\, o comando a ser enviado pode ser configurado para cada botão. \n".. - "\n".. - "\n".. - "\n", - "Esse bloco tem quatro botões que podem ser configurados individualmente por meio do menu de chave inglesa. A rotulagem e o endereço do bloco de destino podem ser configurados para cada botão. Além disso\\, o comando a ser enviado pode ser configurado para cada botão. \n".. - "\n".. - "\n".. - "\n", - "Esse bloco tem duas lâmpadas que podem ser controladas individualmente. Cada lâmpada pode exibir as cores \"vermelho\"\\, \"verde\" e \"âmbar\". A rotulagem de ambas as lâmpadas pode ser configurada por meio do menu de chave inglesa. As lâmpadas podem ser controladas usando os seguintes comandos:\n".. - "\n".. - " - Mudar a lâmpada 1 para vermelho: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Mude a lâmpada 2 para verde: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Mudar a lâmpada 1 para laranja: '$send_cmnd(1234\\, \"amber\"\\, 1)'\n".. - " - Desligar a lâmpada 2: '$send_cmnd(1234\\, \"off\"\\, 2)'\n".. - "\n".. - "\n".. - "\n", - "Esse bloco tem quatro lâmpadas que podem ser controladas individualmente. Cada lâmpada pode exibir as cores \"vermelho\"\\, \"verde\" e \"âmbar\". A rotulagem de todas as lâmpadas pode ser configurada por meio do menu de chave inglesa. As lâmpadas podem ser controladas usando os seguintes comandos:\n".. - "\n".. - " - Mudar a lâmpada 1 para vermelho: '$send_cmnd(1234\\, \"red\"\\, 1)'\n".. - " - Mude a lâmpada 2 para verde: '$send_cmnd(1234\\, \"green \"\\, 2)'\n".. - " - Mudar a lâmpada 3 para laranja: '$send_cmnd(1234\\, \"amber\"\\, 3)'\n".. - " - Desligar a lâmpada 4: '$send_cmnd(1234\\, \"off\"\\, 4)'\n".. - "\n".. - "\n".. - "\n", - "Apenas a aparência do detector de player TA4 foi alterada. A funcionalidade é a mesma do detector de player TA3.\n".. - "\n".. - "\n".. - "\n", - "\n".. - "\n".. - "O coletor de status consulta todas as máquinas configuradas para obter o status. Se uma das máquinas tiver atingido ou excedido um status pré-configurado\\, um comando \"on\" será enviado. Por exemplo\\, muitas máquinas podem ser facilmente monitoradas quanto a falhas a partir de um controlador Lua.\n".. - "\n", - "A funcionalidade é a mesma do detector TA3. Além disso\\, o detector conta os itens passados adiante.\n".. - "Esse contador pode ser consultado com o comando \"count\" e redefinido com \"reset\".\n".. - "\n".. - "\n".. - "\n", - "A funcionalidade é a mesma do TA3 Node Detector.\n".. - "\n".. - "Ao contrário do detector de nós TA3\\, as posições a serem monitoradas podem ser configuradas individualmente aqui. Para fazer isso\\, o botão \"Record\" (Registrar) deve ser pressionado. Em seguida\\, todos os blocos devem ser clicados\\, cuja posição deve ser verificada. Em seguida\\, o botão \"Done\" (Concluído) deve ser pressionado.\n".. - "\n".. - "Podem ser selecionados até 4 blocos.\n".. - "\n".. - "\n".. - "\n", - "O detector de carga mede o estado de carga do armazenamento de energia da rede elétrica a cada 8 s.\n".. - "\n".. - "Se o valor ficar abaixo de um limite configurável (ponto de comutação)\\, um comando (padrão: \"off\") será enviado. Se o valor subir novamente acima desse ponto de comutação\\, um segundo comando (padrão: \"on\") será enviado. Isso permite que os consumidores sejam desconectados da rede quando o nível de carga do dispositivo de armazenamento de energia cair abaixo do ponto de comutação especificado.\n".. - "\n".. - "Para fazer isso\\, o detector de carga deve ser conectado à rede por meio de uma caixa de junção. O detector de carga é configurado por meio do menu da chave de boca.\n".. - "\n".. - "\n".. - "\n", - "O sensor de olhar TA4 gera um comando quando o bloco é visto/focado pelo proprietário ou por outros jogadores configurados e envia um segundo comando quando o bloco não é mais focalizado. Assim\\, ele substitui os botões/interruptores\\, por exemplo\\, para abrir/fechar portas.\n".. - "\n".. - "O TA4 Gaze Sensor só pode ser programado usando o menu da chave de boca. Se você tiver uma chave de boca na mão\\, o sensor não será acionado\\, mesmo que esteja focalizado.\n".. - "\n".. - "\n".. - "\n", - "Processos inteiros podem ser programados usando o sequenciador TA4. Veja um exemplo:\n".. - "\n".. - " -- este é um comentário\n".. - " \\[1\\] send 1234 a2b\n".. - " \\[30\\] send 1234 b2a\n".. - " \\[60\\] goto 1\n".. - "\n".. - " - Cada linha começa com um número que corresponde a um ponto no tempo '\\[\\]'\n".. - " - São permitidos valores de 1 a 50000 para os tempos\n".. - " - 1 corresponde a 100 ms\\, 50000 corresponde a cerca de 4 dias de jogo\n".. - " - Linhas vazias ou comentários são permitidos ('-- comment')\n".. - " - Com 'send '\\, você pode enviar um comando para um bloco\n".. - " - Com 'goto ' você pode pular para outra linha/ponto no tempo\n".. - " - Com 'stop' você pode parar o sequenciador com um atraso para que ele não receba um novo comando\naceita de um botão ou outro bloco (para concluir um movimento)\nSem 'stop'\\, o sequenciador entra no modo parado imediatamente após o último comando.\n".. - "\n".. - "O sequenciador TA4 suporta os seguintes comandos de tecnologia:\n".. - "\n".. - " - 'goto ' Salta para uma linha de comando e inicia o sequenciador\n".. - " - 'stop' Parar o sequenciador\n".. - " - 'on' e 'off' como aliases para 'goto 1' e 'stop'\n".. - "\n".. - "O comando 'goto' só é aceito quando o sequenciador está parado.\n".. - "\n".. - "O tempo de ciclo (padrão: 100 ms) pode ser alterado para o sequenciador por meio do menu da chave de boca.\n".. - "\n".. - "\n".. - "\n", - "", - "O TA4 Move Controller é semelhante ao \"Door Controller 2\"\\, mas os blocos selecionados não são removidos\\, mas podem ser movidos.\n".. - "Como os blocos móveis podem levar consigo os jogadores e as multidões que estão no bloco\\, é possível construir elevadores e sistemas de transporte semelhantes com eles.\n".. - "\n".. - "Instruções:\n".. - "\n".. - " - Defina o controlador e treine os blocos a serem movidos por meio do menu (até 16 blocos podem ser treinados)\n".. - " - A \"rota de voo\" deve ser inserida por meio de uma especificação x\\, y\\, z (relativa) (a distância máxima (x+y+z) é de 200 m)\n".. - " - O movimento pode ser testado com os botões de menu \"Move A-B\" e \"Move B-A\"\n".. - " - Você também pode voar através de paredes ou outros blocos\n".. - " - A posição de destino dos blocos também pode ser ocupada. Nesse caso\\, os blocos são salvos de forma \"invisível\". Isso se destina a portas deslizantes e similares\n".. - "\n".. - "O Move Controller é compatível com os seguintes comandos de tecnologia:\n".. - "\n".. - " - 'a2b' Mover o bloco de A para B.\n".. - " - 'b2a' Mover o bloco de B para A.\n".. - " - 'move' Mover o bloco para o outro lado\n".. - "\n".. - "Você pode alternar para o modo de operação 'move xyz' por meio do menu de chave inglesa. Após a mudança\\, os seguintes comandos técnicos são suportados: \n".. - "\n".. - " - 'move2' Com o comando\\, a rota de voo também deve ser especificada como um vetor x\\,y\\,z.\nExemplo de controlador Lua: '$send_cmnd(MOVE_CTLR\\, \"move2\"\\, \"0\\,12\\,0\")'\n".. - " - 'reset' move o(s) bloco(s) de volta à posição inicial\n".. - "\n".. - "*Instruções importantes:*\n".. - "\n".. - " - Se vários blocos tiverem de ser movidos\\, o bloco que levará os jogadores/mobs deverá ser clicado primeiro durante o treinamento.\n".. - " - Se o bloco que deve levar os jogadores/móbile tiver uma altura reduzida\\, a altura deverá ser definida no controlador usando o menu de chave de boca aberto (por exemplo\\, altura = 0\\,5). Caso contrário\\, o jogador/móbile não será \"encontrado\" e não será levado embora.\n".. - "\n".. - "\n".. - "\n", - "O controlador de giro do TA4 é semelhante ao \"Move Controller\"\\, mas os blocos selecionados não são movidos\\, mas girados em torno de seu centro para a direita ou para a esquerda.\n".. - "\n".. - "Instruções:\n".. - "\n".. - " - Defina o controlador e treine os blocos a serem movidos por meio do menu (até 16 blocos podem ser treinados)\n".. - " - O movimento pode ser testado com os botões de menu \"Turn left\" (Virar à esquerda) e \"Turn right\" (Virar à direita)\n".. - "\n".. - "O controlador de giro suporta os seguintes comandos de tecnologia:\n".. - "\n".. - " - 'left' Vire à esquerda\n".. - " - 'direita' Vire à direita\n".. - " - 'uturn' Girar 180 graus\n".. - "\n".. - "\n".. - "\n", - "O TA4 contém uma série de lâmpadas potentes que permitem uma melhor iluminação ou a realização de tarefas especiais.\n".. - "\n", - "A lâmpada de cultivo TA4 LED permite o crescimento rápido e vigoroso de todas as plantas do modo 'farming'. A lâmpada ilumina um campo de 3x3\\, de modo que as plantas também podem ser cultivadas no subsolo.\n".. - "A lâmpada deve ser colocada um bloco acima do solo no meio do campo 3x3.\n".. - "\n".. - "A lâmpada também pode ser usada para cultivar flores. Se a lâmpada for colocada sobre um canteiro de flores 3x3 feito de \"Garden Soil\" (Mod 'compost')\\, as flores crescerão automaticamente (acima e abaixo do solo).\n".. - "\n".. - "Você pode colher as flores com o Signs Bot\\, que também tem uma placa correspondente que deve ser colocada na frente do campo de flores.\n".. - "\n".. - "A lâmpada requer 1 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A lâmpada de rua de LED TA4 é uma lâmpada com iluminação particularmente forte. A lâmpada consiste no compartimento da lâmpada\\, no braço da lâmpada e nos blocos do poste da lâmpada.\n".. - "\n".. - "A corrente deve ser conduzida de baixo para cima\\, através do mastro\\, até o compartimento da lâmpada. Primeiro\\, puxe o cabo de alimentação para cima e\\, em seguida\\, \"engesse\" o cabo de alimentação com blocos de postes de iluminação.\n".. - "\n".. - "A lâmpada requer 1 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A lâmpada industrial de LED TA4 é uma lâmpada com iluminação particularmente forte. A lâmpada deve ser alimentada por cima.\n".. - "\n".. - "A lâmpada requer 1 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "O filtro de líquidos filtra a lama vermelha.\n".. - "Uma parte da lama vermelha se transforma em soda cáustica\\, que pode ser coletada no fundo de um tanque.\n".. - "A outra parte se transforma em um paralelepípedo do deserto e obstrui o material do filtro.\n".. - "Se o filtro estiver muito entupido\\, ele deverá ser limpo e enchido novamente.\n".. - "O filtro consiste em uma camada de base\\, 7 camadas de filtro idênticas e uma camada de enchimento na parte superior.\n".. - "\n".. - "\n".. - "\n", - "Você pode ver a estrutura dessa camada no plano.\n".. - "\n".. - "A soda cáustica é coletada no tanque.\n".. - "\n".. - "\n".. - "\n", - "Essa camada deve ser preenchida com cascalho\\, conforme mostrado no plano.\n".. - "No total\\, deve haver sete camadas de cascalho.\n".. - "O filtro ficará obstruído com o tempo\\, de modo que precisará ser limpo e preenchido novamente.\n".. - "\n".. - "\n".. - "\n", - "Essa camada é usada para preencher o filtro com lama vermelha.\n".. - "A lama vermelha deve ser bombeada para o tubo de enchimento.\n".. - "\n".. - "\n".. - "\n", - "O Collider é uma instalação de pesquisa que realiza pesquisas básicas. É possível coletar pontos de experiência aqui\\, que são necessários para o TA5 (Future Age).\n".. - "\n".. - "Como seu original no CERN em Genebra\\, o colisor deve ser construído no subsolo. A configuração padrão aqui é Y <= -28. O valor pode\\, no entanto\\, ser alterado pela equipe do servidor por meio da configuração. Pergunte ou tente o bloco \"TA4 Collider Detector Worker\".\n".. - "\n".. - "Somente um colisor pode ser operado por jogador. Portanto\\, não faz sentido configurar dois ou mais colisores. Os pontos de experiência são creditados ao jogador que possui o colisor. Os pontos de experiência não podem ser transferidos.\n".. - "\n".. - "Um colisor consiste em um \"anel\" feito de tubos e ímãs\\, além de um detector com um sistema de resfriamento.\n".. - "\n".. - " - O detector é o coração do sistema. É nele que os experimentos científicos são realizados. O detector tem o tamanho de 3x3x7 blocos.\n".. - " - 22 ímãs do colisor TA4 (não os ímãs do detector do colisor TA4!) devem ser conectados uns aos outros por meio de 5 blocos do tubo de vácuo TA4. Cada ímã também requer eletricidade e uma conexão de gás para resfriamento. O conjunto forma (como mostrado na planta à direita) um quadrado com um comprimento de borda de 37 metros.\n".. - "\n".. - "A planta mostra a instalação vista de cima:\n".. - "\n".. - " - O bloco cinza é o detector com o bloco de trabalho no meio\n".. - " - Os blocos vermelhos são os ímãs\\, os azuis são os tubos de vácuo\n".. - "\n".. - "\n".. - "\n", - "O detector é configurado automaticamente com a ajuda do bloco \"TA4 Collider Detector Worker\" (semelhante à torre). Todos os materiais necessários para isso devem ser colocados primeiro no bloco do trabalhador. O detector é mostrado simbolicamente no bloco do trabalhador. O detector é montado no bloco de trabalho.\n".. - "\n".. - "O detector também pode ser desmontado novamente com a ajuda do bloco de trabalho.\n".. - "\n".. - "As conexões para eletricidade\\, gás e tubos de vácuo estão localizadas nos dois lados frontais do detector. Uma bomba TA4 deve ser conectada na parte superior para sugar o tubo vazio/criar o vácuo.\n".. - "\n".. - "O sistema de resfriamento deve ser conectado à parte traseira do detector. O sistema de resfriamento é mostrado na planta à direita. Além do trocador de calor TA4 da unidade de armazenamento de energia (que é usado aqui para resfriamento)\\, também é necessário um bloco resfriador TA4.\n".. - "\n".. - "Observação: A seta no trocador de calor deve apontar para longe do detector. O trocador de calor também deve ser alimentado com eletricidade.\n".. - "\n".. - "\n".. - "\n".. - " - Além disso\\, é necessário resfriamento\\, que também deve ser instalado no detector. O isobutano é necessário para o resfriamento.\n".. - " - O sistema requer uma quantidade considerável de eletricidade. Portanto\\, faz sentido ter sua própria fonte de alimentação.\n".. - "\n", - "O colisor é controlado por meio de um terminal TA4 (não por meio do terminal do controlador TA4 Lua).\n".. - "\n".. - "Esse terminal deve ser conectado ao detector. O número do detector é exibido como texto informativo no bloco de trabalho.\n".. - "\n".. - "O terminal suporta os seguintes comandos:\n".. - "\n".. - " - 'connect ' (conectar-se ao detector)\n".. - " - 'start' (iniciar o detector)\n".. - " - 'stop' (parar o detector)\n".. - " - 'test ' (verificação de um ímã)\n".. - " - 'points' (consulta dos pontos de experiência já obtidos)\n".. - "\n".. - "Se ocorrer um erro em um ímã durante o 'start'\\, o número do ímã será exibido. O comando 'test' pode ser usado para solicitar mais informações sobre o erro do ímã.\n".. - "\n".. - "\n".. - "\n", - "Cada ímã do Colisor TA4 também deve ser abastecido com eletricidade (conforme mostrado à direita na planta) e com isobutano para resfriamento:\n".. - "\n".. - " - A conexão para a alimentação está na parte superior do ímã.\n".. - " - A conexão para o resfriamento está na parte frontal do ímã.\n".. - " - Uma bomba TA4 e um tanque TA4 com pelo menos 250 unidades de isobutano também são necessários para resfriar todo o sistema.\n".. - " - O sistema também requer muita eletricidade. Portanto\\, faz sentido ter sua própria fonte de alimentação com pelo menos 145 ku.\n".. - "\n".. - "\n".. - "\n", - "A sequência a seguir é recomendada ao configurar o colisor:\n".. - "\n".. - " - Coloque um bloco de carga forçada. Somente o detector com o sistema de resfriamento deve estar na área do bloco de carga forçada.\n".. - " - Defina o bloco de trabalho\\, preencha-o com itens e configure o detector por meio do menu\n".. - " - Construa o anel com tubos e ímãs\n".. - " - Conecte todos os ímãs e o detector com os cabos de alimentação\n".. - " - Conecte todos os ímãs e o detector com os tubos amarelos e bombeie o isobutano no sistema de tubos com uma bomba\n".. - " - Instale uma bomba TA4 como uma bomba de vácuo no detector e ligue-a (não é necessário nenhum tanque adicional). Se a bomba entrar em \"standby\"\\, o vácuo será estabelecido. Isso levará alguns segundos\n".. - " - Monte o resfriador (trocador de calor) e conecte-o ao cabo de alimentação\n".. - " - Coloque o terminal TA4 na frente do detector e conecte-o ao detector por meio de 'connect '\n".. - " - Ligar/conectar a fonte de alimentação\n".. - " - ligar o resfriador (trocador de calor)\n".. - " - Ligue o detector por meio de 'start' no terminal TA4. Após algumas etapas de teste\\, o detector entra em operação normal ou emite um erro.\n".. - " - O colisor precisa ser executado continuamente e\\, em seguida\\, fornece gradualmente pontos de experiência. Para obter 10 pontos\\, o colisor precisa funcionar por algumas horas\n".. - "\n".. - "\n".. - "\n", - "", - "Até 10 receitas podem ser salvas no bloco de receitas. Essas receitas podem então ser chamadas por meio de um comando do TA4 Autocrafter. Isso permite que a receita do autocrafter seja configurada por meio de um comando. As receitas no bloco de receitas também podem ser consultadas diretamente por meio de um comando.\n".. - "\n".. - "'input ' lê uma receita do bloco de receitas do TA4. '' é o número da receita. O bloco retorna uma lista de ingredientes da receita.\n".. - "\n".. - "Exemplo: '$send_cmnd(1234\\, \"input\"\\, 1)'\n".. - "\n".. - " \n".. - "\n", - "A função corresponde à do TA3.\n".. - "\n".. - "A capacidade de processamento é de 4 itens a cada 4 s. O autocrafter requer 9 ku de eletricidade para isso.\n".. - "\n".. - "Além disso\\, o TA4 Autocrafter suporta a seleção de diferentes receitas usando os seguintes comandos:\n".. - "\n".. - "'recipe \".\"' muda o autocrafter para uma receita do bloco de receitas TA4. '' é o número do bloco de receitas\\, '' é o número da receita. Exemplo: '$send_cmnd(1234\\, \"recipe\"\\, \"5467.1\")'\n".. - "\n".. - "Como alternativa\\, uma receita também pode ser selecionada por meio da lista de ingredientes\\, por exemplo:\n".. - "'$send_cmnd(1234\\, \"recipe\"\\, \"default:coal_lump\\,\\,\\,default:stick\")'\n".. - "Todos os nomes técnicos de uma receita devem ser especificados aqui\\, separados por vírgulas. Consulte também o comando 'input' no bloco de receitas do TA4.\n".. - "\n".. - "O comando 'flush' move todos os itens do inventário de entrada para o inventário de saída. O comando retorna 'true' se o inventário de entrada tiver sido completamente esvaziado. Se 'false' for retornado (inventário de saída cheio)\\, o comando deverá ser repetido em um momento posterior.\n".. - "\n".. - " \n".. - "\n", - "Consulte o tanque TA3.\n".. - "\n".. - "Um tanque TA4 pode conter 2.000 unidades ou 200 barris de líquido.\n".. - "\n".. - "\n".. - "\n", - "Consulte a bomba TA3.\n".. - "\n".. - "A bomba TA4 bombeia 8 unidades de líquido a cada dois segundos. \n".. - "\n".. - "No modo \"Flow limiter\" (Limitador de fluxo)\\, o número de unidades bombeadas pela bomba pode ser limitado. O modo de limitador de fluxo pode ser ativado por meio do menu da chave de boca\\, configurando o número de unidades no menu. Quando o número configurado de unidades tiver sido bombeado\\, a bomba será desligada. Quando a bomba for ligada novamente\\, ela bombeará o número configurado de unidades novamente e\\, em seguida\\, será desligada.\n".. - "\n".. - "O limitador de fluxo também pode ser configurado e iniciado usando um controlador Lua ou Beduino.\n".. - "\n".. - "A bomba também é compatível com o comando 'flowrate'. Isso permite que a taxa de fluxo total através da bomba seja consultada.\n".. - "\n".. - "\n".. - "\n", - "Com o TA4\\, o forno industrial também tem seu aquecimento elétrico. O queimador de óleo e o soprador podem ser substituídos pelo aquecedor.\n".. - "\n".. - "O aquecedor requer 14 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "Esse bloco não poderá mais ser fabricado e será substituído pelo bloco de entrada de água TA4. \n".. - "\n", - "Algumas receitas requerem água. A água deve ser bombeada do mar com uma bomba (água em y = 1). Uma \"piscina\" composta de alguns blocos de água não é suficiente para isso! \n".. - "\n".. - "Para fazer isso\\, o bloco de entrada de água deve ser colocado na água e conectado à bomba por meio de tubos. Se o bloco for colocado na água\\, é preciso garantir que haja água sob o bloco (a água deve ter pelo menos 2 blocos de profundidade). \n".. - "\n".. - "\n".. - "\n", - "O TA4 também tem seus próprios tubos no design do TA4. Eles podem ser usados como os tubos padrão.\n".. - "Mas: Os empurradores e distribuidores TA4 só atingem seu desempenho total quando usados com tubos TA4.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde basicamente à do TA2 / TA3. Além disso\\, um menu pode ser usado para configurar quais objetos devem ser retirados de um baú TA4 e transportados posteriormente.\n".. - "A capacidade de processamento é de 12 itens a cada 2 s\\, se forem usados tubos TA4 em ambos os lados. Caso contrário\\, haverá apenas 6 itens a cada 2 s.\n".. - "\n".. - "No modo \"limitador de fluxo\"\\, o número de itens que são movidos pelo empurrador pode ser limitado. O modo limitador de fluxo pode ser ativado por meio do menu da chave de boca\\, configurando o número de itens no menu. Assim que o número configurado de itens tiver sido movido\\, o empurrador se desliga. Se o empurrador for ligado novamente\\, ele moverá o número configurado de itens novamente e depois se desligará.\n".. - "\n".. - "O empurrador TA4 também pode ser configurado e iniciado usando um controlador Lua ou Beduino.\n".. - "\n".. - "Aqui estão os comandos adicionais para o controlador Lua:\n".. - "\n".. - " - O 'config' é usado para configurar o empurrador\\, de forma análoga à configuração manual por meio do menu.\n Exemplo: '$send_cmnd(1234\\, \"config\"\\, \"default:dirt\")'\n Com '$send_cmnd(1234\\, \"config\"\\, \"\")'\\, a configuração é excluída\n".. - " - 'limit' é usado para definir o número de itens para o modo de limitador de fluxo:\n Exemplo: '$send_cmnd(1234\\, \"init\"\\, 7)'\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA3. O baú pode conter mais conteúdo.\n".. - "\n".. - "Além disso\\, o baú do TA4 tem um shadow inventory para configuração. Aqui\\, determinados locais de pilha podem ser pré-atribuídos a um item. As pilhas de inventário pré-atribuídas só são preenchidas com esses itens durante o preenchimento. É necessário um empurrador ou injetor TA4 com a configuração apropriada para esvaziar as pilhas de inventário pré-atribuídas.\n".. - "\n".. - "\n".. - "\n", - "O baú TA4 8x2000 não tem um inventário normal como os outros baús\\, mas tem 8 lojas\\, sendo que cada loja pode armazenar até 2.000 itens de um tipo. Os botões laranja podem ser usados para mover itens de ou para a loja. A caixa também pode ser preenchida ou esvaziada com um empurrador (TA2\\, TA3 ou TA4) como de costume.\n".. - "\n".. - "Se o baú for preenchido com um empurrador\\, todos os depósitos serão preenchidos da esquerda para a direita. Se todos os 8 depósitos estiverem cheios e nenhum outro item puder ser adicionado\\, os itens adicionais serão rejeitados.\n".. - "\n".. - "*Função de linha*\n".. - "\n".. - "Vários baús TA4 8x2000 podem ser conectados a um baú grande com mais conteúdo. Para fazer isso\\, os baús devem ser colocados em uma fileira\\, um após o outro.\n".. - "\n".. - "Primeiro\\, o baú da frente deve ser colocado e\\, em seguida\\, os baús empilhados são colocados atrás com a mesma direção de visão (todas as caixas têm a frente voltada para o jogador). Com 2 baús em uma fileira\\, o tamanho aumenta para 8x4000\\, etc.\n".. - "\n".. - "As fileiras de baús não podem mais ser removidas. Há duas maneiras de desmontar os baús:\n".. - "\n".. - " - Esvazie e remova o baú da frente. Isso desbloqueia o próximo baú e pode ser removido.\n".. - " - Esvazie o baú da frente até o ponto em que todas as lojas contenham no máximo 2.000 itens. Isso desbloqueia o próximo baú e pode ser removido.\n".. - "\n".. - "Os baús têm uma caixa de seleção de \"pedido\". Se essa caixa de seleção for ativada\\, os depósitos não serão mais completamente esvaziados por um empurrador. O último item permanece no depósito como padrão. Isso resulta em uma atribuição fixa de itens aos locais de armazenamento.\n".. - "\n".. - "O baú só pode ser usado por jogadores que podem construir nesse local\\, ou seja\\, que têm direitos de proteção. Não importa quem coloca o baú.\n".. - "\n".. - "O baú tem um comando adicional para o controlador Lua:\n".. - "\n".. - " - 'count' é usado para solicitar quantos itens estão no baú.\nExemplo 1: '$send_cmnd(CHEST\\, \"count\")' -> Soma dos itens em todas as 8 lojas\nExemplo 2: '$send_cmnd(CHEST\\, \"count\"\\, 2)' -> número de itens na loja 2 (segunda a partir da esquerda)\n".. - " - 'storesize' é usado para ler o tamanho de um dos oito armazenamentos:\nExemplo: '$send_cmnd(CHEST\\, \"storesize\")' -> a função retorna\\, por exemplo\\, 6000\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 24 itens a cada 4 s\\, desde que os tubos TA4 sejam usados em todos os lados. Caso contrário\\, haverá apenas 12 itens a cada 4 s.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do distribuidor TA4 normal\\, com duas diferenças:\n".. - "A capacidade de processamento é de 36 itens a cada 4 s\\, desde que os tubos TA4 sejam usados em todos os lados. Caso contrário\\, haverá apenas 18 itens a cada 4 s.\n".. - "Além disso\\, até 8 itens podem ser configurados por direção.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 4 itens a cada 4 s. O bloco requer 5 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2.\n".. - "A capacidade de processamento é de 4 itens a cada 4 s. O bloco requer 9 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde em grande parte à do TA2.\n".. - "\n".. - "Além disso\\, o tamanho do furo pode ser definido entre blocos de 3x3 e 11x11.\n".. - "A profundidade máxima é de 80 metros. A pedreira requer 14 ku de eletricidade.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA2\\, apenas chips diferentes são produzidos aqui.\n".. - "A capacidade de processamento é de um chip a cada 6 s. O bloco requer 12 ku de eletricidade para isso.\n".. - "\n".. - "\n".. - "\n", - "A função corresponde à do TA3.\n".. - "\n".. - "O poder de processamento é de até 8 vezes quatro itens a cada 4 segundos.\n".. - "\n".. - "\n".. - "\n", - "O reciclador é uma máquina que processa todas as receitas de Techage de trás para frente\\, ou seja\\, pode desmontar máquinas e blocos e transformá-los em seus componentes. \n".. - "\n".. - "A máquina pode desmontar praticamente todos os blocos da Techage e do Hyperloop. Mas nem todos os itens/materiais da receita podem ser reciclados:\n".. - "\n".. - " - A madeira se transforma em gravetos\n".. - " - A pedra se transforma em areia ou cascalho\n".. - " - Os semicondutores/chips não podem ser reciclados\n".. - " - As ferramentas não podem ser recicladas\n".. - "\n".. - "A capacidade de processamento é de um item a cada 8 s. O bloco requer 16 ku de eletricidade para isso.\n".. - "\n".. - " \n".. - "\n", - }, - images = { - "techage_ta4", - "", - "ta4_windturbine", - "ta4_nacelle", - "ta4_blinklamp", - "ta4_pillar", - "", - "ta4_solarmodule", - "ta4_solarcarrier", - "ta4_solar_inverter", - "ta4_powercable", - "ta4_powerbox", - "ta4_minicell", - "", - "ta4_heatexchanger", - "ta4_turbine", - "ta4_generator", - "ta4_pipeinlet", - "ta4_pipe", - "ta4_transformer", - "ta4_transformer", - "ta4_electricmeter", - "ta4_laser", - "ta4_hydrogen", - "ta4_electrolyzer", - "ta4_fuelcell", - "", - "ta4_doser", - "ta4_reactor", - "ta4_fillerpipe", - "ta4_reactorstand", - "ta4_reactorbase", - "ta4_silo", - "ta4_icta_controller", - "ta4_icta_controller", - "ta4_battery", - "ta4_display", - "ta4_displayXL", - "ta4_signaltower", - "ta4_lua_controller", - "ta4_lua_server", - "ta4_sensor_chest", - "ta4_terminal", - "", - "ta4_button", - "ta4_button_2x", - "ta4_button_4x", - "ta4_signallamp_2x", - "ta4_signallamp_4x", - "ta4_playerdetector", - "ta4_collector", - "ta4_detector", - "ta4_nodedetector", - "ta4_chargedetector", - "ta4_gaze_sensor", - "ta4_sequencer", - "", - "ta4_movecontroller", - "ta4_turncontroller", - "", - "ta4_growlight", - "ta4_streetlamp", - "ta4_industriallamp", - "ta4_liquid_filter", - "", - "", - "", - "", - "", - "ta4_terminal", - "", - "techage_ta4c", - "", - "ta4_recipeblock", - "ta4_autocrafter", - "ta4_tank", - "ta4_pump", - "ta4_furnaceheater", - "", - "ta4_waterinlet", - "ta4_tube", - "ta4_pusher", - "ta4_chest", - "ta4_8x2000_chest", - "ta4_distributor", - "ta4_high_performance_distributor", - "ta4_gravelsieve", - "ta4_grinder", - "ta4_quarry", - "ta4_electronicfab", - "ta4_injector", - "ta4_recycler", - }, - plans = { - "", - "ta4_windturbine", - "", - "", - "", - "", - "ta4_solarplant", - "", - "", - "", - "", - "", - "", - "ta4_storagesystem", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_reactor", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta4_liquid_filter_base", - "ta4_liquid_filter_gravel", - "ta4_liquid_filter_top", - "techage_collider_plan", - "ta4_cooler", - "", - "techage_collider_plan2", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta5_DE.lua b/techage/doc/manual_ta5_DE.lua deleted file mode 100644 index 55f5d0c..0000000 --- a/techage/doc/manual_ta5_DE.lua +++ /dev/null @@ -1,219 +0,0 @@ -return { - titles = { - "1,TA5: Zukunft", - "2,Energiequellen", - "3,TA5 Fusionsreaktor", - "4,TA5 Fusionreaktor Magnet", - "4,TA5 Pumpe", - "4,TA5 Wärmetauscher", - "4,TA5 Fusionreaktor Controller", - "4,TA5 Fusionreaktor Hülle", - "4,TA5 Fusionreaktor Kern", - "2,Energiespeicher", - "3,TA5 Hybrid-Speicher (geplant)", - "2,Logik Blöcke", - "2,Transport und Verkehr", - "3,TA5 Flug Controller", - "3,TA5 Hyperloop Kiste / TA5 Hyperloop Chest", - "3,TA5 Hyperloop Tank / TA5 Hyperloop Tank", - "3,TA5-Raumgleiter (geplant)", - "2,Teleport Blöcke", - "3,TA5 Teleport Block Gegenstände / TA5 Teleport Block Items", - "3,TA5 Teleport Block Flüssigkeiten / TA5 Teleport Block Liquids", - "3,Hyperloop Teleport Blöcke (geplant)", - "2,Weitere TA5 Blöcke/Items", - "3,TA5 Container (geplant)", - "3,TA5 KI Chip / TA5 AI Chip", - "3,TA5 KI Chip II / TA5 AI Chip II", - }, - texts = { - "Maschinen zur Überwindung von Raum und Zeit\\, neue Energiequellen und andere Errungenschaften prägen dein Leben. \n".. - "\n".. - "Für die Herstellung und Nutzung von TA5 Maschinen und Blöcken sind Erfahrungspunkte (experience points) notwendig. Diese können nur über den Teilchenbeschleuniger aus TA4 erarbeitet werden.\n".. - "\n".. - "\n".. - "\n", - "", - "Kernfusion bedeutet das Verschmelzen zweier Atomkerne. Dabei können\\, je nach Reaktion\\, große Mengen von Energie freigesetzt werden. Kernfusionen\\, bei denen Energie frei wird\\, laufen in Form von Kettenreaktionen ab. Sie sind die Quelle der Energie der Sterne\\, zum Beispiel auch unserer Sonne. Ein Fusionsreaktor wandelt die Energie\\, die bei einer kontrollierten Kernfusion frei wird\\, in elektrischen Strom um.\n".. - "\n".. - "*Wie funktionieren ein Fusionsreaktor?*\n".. - "\n".. - "Ein Fusionsreaktor funktioniert nach dem klassischen Prinzip eines Wärmekraftwerks: Wasser wird erhitzt und treibt eine Dampfturbine an\\, deren Bewegungsenergie von einem Generator in Strom gewandelt wird.\n".. - "\n".. - "Ein Fusionskraftwerk benötigt zunächst eine hohe Menge an Energie\\, da ein Plasma erzeugt werden muss. „Plasma“ nennt man den vierten Zustand von Stoffen\\, nach fest\\, flüssig und gasförmig. Dafür wird viel Strom benötigt. Erst durch diese extreme Energiekonzentration zündet die Fusionsreaktion und mit der abgegebenen Wärme wird über den Wärmetauscher Strom erzeugt. Der Generator liefert dann 800 ku an Strom.\n".. - "\n".. - "Der Plan rechts zeigt einen Schnitt durch den Fusionsreaktor.\n".. - "\n".. - "Für den Betrieb des Fusionsreaktors werden 60 Erfahrungspunkte benötigt. Der Fusionsreaktur muss komplett in einem Forceload Block Bereich aufgebaut werden.\n".. - "\n".. - "\n".. - "\n", - "Für den Aufbau des Fusionsreaktor werden insgesamt 60 TA5 Fusionreaktor Magnete benötigt. Diese bilden den Ring\\, in dem sich das Plasma bildet. Der TA5 Fusionsreaktor Magnete benötigt Strom und hat zwei Anschlüsse für die Kühlung.\n".. - "\n".. - "Es gibt zwei Typen von Magneten\\, so dass auch alle Seiten des Magnets\\, die zum Plasmaring zeigen\\, mit einem Hitzeschild geschützt werden können.\n".. - "\n".. - "Bei den Eckmagneten auf der Innenseite des Rings ist jeweils eine Anschlussseite verdeckt (Strom oder Kühlung) und kann daher nicht angeschlossen werden. Dies ist technisch nicht machbar und hat daher keinen Einfluß auf die Funktion des Fusionsreaktor. \n".. - "\n".. - "\n".. - "\n", - "Die Pumpe wird benötigt\\, um den Kühlkreislauf mit Isobutan zu füllen. Es werden ca. 350 Einheiten Isobutan benötigt.\n".. - "\n".. - "Hinweis: Die TA5 Pumpe kann nur zum Füllen des Kühlkreislaufs genutzt werden\\, ein Abpumpen des Kühlmittels ist nicht möglich. Daher sollte die Pumpe erst eingeschaltet werden\\, wenn die Magnete korrekt platziert und alle Strom- und Kühlleitungen angeschlossen sind.\n".. - "\n".. - "\n".. - "\n", - "Der TA5 Wärmetauscher wird benötigt\\, um die im Fusionsreaktor erzeugte Hitze zuerst in Dampf und dann in Strom umzuwandeln. Der Wärmetauscher selbst benötigt dazu 5 ku Strom. Der Aufbau gleicht dem Wärmetauscher des Energiespeichers aus TA4.\n".. - "\n".. - "Hinweis: Der TA5 Wärmetauscher hat zwei Anschlüsse (blau und grün) für den Kühlkreislauf. Über die grünen und blauen Röhren müssen der Wärmetauscher und alle Magnete zu einem Kühlkreislauf verbunden werden.\n".. - "\n".. - "Über den Start-Button des Wärmetauschers kann der Kühlkreislauf auf Vollständigkeit geprüft werden\\, auch wenn noch kein Kühlmittel eingefüllt wurde.\n".. - "\n".. - "\n".. - "\n", - "Über den TA5 Fusionreaktor Controller wird der Fusionreaktors eingeschaltet. Dabei muss zuerst die Kühlung/Wärmetauscher und dann der Controller eingeschaltet werden. Es dauert ca. 2 min\\, bis der Reaktor in Gang kommt und Strom liefert. Der Fusionreaktor und damit der Controller benötigt 400 ku an Strom\\, um das Plasma aufrecht zu erhalten.\n".. - "\n".. - "\n".. - "\n", - "Der komplette Reaktor muss mit einer Hülle umgeben werden\\, die den enormen Druck\\, den die Magnete auf das Plasma ausüben\\, abfängt und die Umgebung vor Strahlung schützt. Ohne diese Hülle kann der Reaktor nicht gestartet werden. Mit der TechAge Kelle können auch Stromkabel und Kühlleitungen des Fusionreaktors in die Hülle integriert werden.\n".. - "\n".. - "\n".. - "\n", - "Der Kern muss in der Mitte des Reaktors sitzen. Siehe Abbildung unter \"TA5 Fusionsreaktor\". Auch hierfür wird die TechAge Kelle benötigt.\n".. - "\n".. - "\n".. - "\n", - "", - "", - "", - "", - "Der TA5 Flug Controller ist ähnlich zum TA4 Move Controller. Im Gegensatz zum TA4 Move Controller können hier mehrere Bewegungen zu einer Flugstrecke kombiniert werden. Diese Flugstrecke kann im Eingabefeld über mehrere x\\,y\\,z Angaben definiert werden (eine Bewegung pro Zeile). Über \"Speichern\" wird die Flugstrecke geprüft und gespeichert. Bei einem Fehler wird eine Fehlermeldung ausgegeben.\n".. - "\n".. - "Mit der Taste \"Test\" wird die Flugstrecke mit den absoluten Koordinaten zur Überprüfung im Chat ausgegeben.\n".. - "\n".. - "Die maximale Distanz für die gesammte Flugstrecke beträgt 1500 m. Es können bis zu 32 Blöcke antrainiert werden.\n".. - "\n".. - "Die Nutzung des TA5 Flug Controllers benötigt 40 Erfahrungspunkte.\n".. - "\n".. - "*Teleport Mode*\n".. - "\n".. - "Wird der 'Teleport Mode' aktiviert (auf 'enable' gesetzt)\\, kann ein Spieler auch ohne Blöcke bewegt werden. Dazu muss die Startposition über die Taste \"Aufzeichnen\" konfiguriert werden. Es kann hier nur eine Position konfiguriert werden. Das Spieler\\, der bewegt werden soll\\, muss dazu auf dieser Position stehen. \n".. - "\n".. - "\n".. - "\n", - "Die TA5 Hyperloop Kiste erlaubt den Transport von Gegenständen über ein Hyperloop Netzwerk.\n".. - "\n".. - "Die TA5 Hyperloop Kiste muss man dazu auf eine Hyperloop Junction stellen. Die Kiste besitzt ein spezielles Menü\\, mit dem man das Pairing von zwei Kisten durchführen kann. Dinge\\, die in der Kiste sind\\, werden zur Gegenstelle teleportiert. Die Kiste kann auch mit einem Schieber gefüllt/geleert werden.\n".. - "\n".. - "Für das Pairing musst du zuerst auf der einen Seite einen Namen für die Kiste eingeben\\, dann kannst du bei der anderen Kiste diesen Namen auswählen und so die beiden Blöcke verbinden.\n".. - "\n".. - "Die Nutzung der TA5 Hyperloop Kiste benötigt 15 Erfahrungspunkte.\n".. - "\n".. - "\n".. - "\n", - "Der TA5 Hyperloop Tank erlaubt den Transport von Flüssigkeiten über ein Hyperloop Netzwerk.\n".. - "\n".. - "Den TA5 Hyperloop Tank muss man dazu auf eine Hyperloop Junction stellen. Der Tank besitzt ein spezielles Menü\\, mit dem man das Pairing von zwei Tanks durchführen kann. Flüssigkeiten\\, die in dem Tank sind\\, werden zur Gegenstelle teleportiert. Der Tank kann auch mit einer Pumpe gefüllt/geleert werden.\n".. - "\n".. - "Für das Pairing musst du zuerst auf der einen Seite einen Namen für den Tank eingeben\\, dann kannst du bei dem anderen Tank diesen Namen auswählen und so die beiden Blöcke verbinden.\n".. - "\n".. - "Die Nutzung des TA5 Hyperloop Tanks benötigt 15 Erfahrungspunkte.\n".. - "\n".. - "\n".. - "\n", - "Dank einem Spezialantrieb für Lichtgeschwindigkeit können mit dem Raumgleiter auch große Entfernungen sehr schnell überwunden werden.\n".. - "\n", - "Mit Teleport-Blöcken können Dinge zwischen zwei Teleport-Blöcken übertragen werden\\, ohne dass sich dazwischen eine Röhre oder Leitung befinden muss. Für das Pairing der Blöcke musst du zuerst auf der einen Seite einen Namen für den Block eingeben\\, dann kannst du bei dem anderen Block diesen Namen auswählen und so die beiden Blöcke verbinden. Das Pairung kann nur von einem Spieler durchgeführt werden (Spielername wird geprüft) und muss vor einem Server-Neustart abgeschlossen sein. Anderenfalls gehen die Pairing-Daten verloren.\n".. - "\n".. - "Der Plan rechts zeigt\\, wie die Blöcke genutzt werden können.\n".. - "\n".. - "\n".. - "\n", - "Diese Teleport-Blöcke erlauben die Übertragung von Gegenständen und ersetzen somit eine Röhre. Dabei können Entfernungen von bis zu 500 Blöcken überbrückt werden.\n".. - "\n".. - "Ein Teleport-Block benötigt 12 ku Strom.\n".. - "\n".. - "Für die Nutzung der Teleport-Blöcke werden 30 Erfahrungspunkte benötigt.\n".. - "\n".. - "\n".. - "\n", - "Diese Teleport-Blöcke erlauben die Übertragung von Flüssigkeiten und ersetzen somit eine gelbe Leitung. Dabei können Entfernungen von bis zu 500 Blöcken überbrückt werden.\n".. - "\n".. - "Ein Teleport-Block benötigt 12 ku Strom.\n".. - "\n".. - "Für die Nutzung der Teleport-Blöcke werden 30 Erfahrungspunkte benötigt.\n".. - "\n".. - "\n".. - "\n", - "Die Hyperloop Teleport Blöcke erlauben den Aufbau von Hyperloop Netzwerk ohne Hyperloop-Röhren.\n".. - "\n".. - "Die Nutzung der Hyperloop Teleport Blöcke benötigt 60 Erfahrungspunkte.\n".. - "\n", - "", - "Der TA5 Container erlaubt Techage Anlagen ein- und an einer anderen Stelle wieder auszupacken.\n".. - "\n".. - "Für die Nutzung des TA5 Containers werden 80 Erfahrungspunkte benötigt.\n".. - "\n", - "Der TA5 KI Chip wird teilweise zur Herstellung von TA5 Blöcken benötigt. Der TA5 KI Chip kann nur auf der TA4 Elektronik Fab hergestellt werden. Dazu werden 10 Erfahrungspunkte benötigt.\n".. - "\n".. - "\n".. - "\n", - "Der TA5 KI Chip II wird zur Herstellung des TA5 Fusionsreaktors benötigt. Der TA5 KI Chip II kann nur auf der TA4 Elektronik Fab hergestellt werden. Dazu werden 25 Erfahrungspunkte benötigt.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta5", - "", - "", - "ta5_magnet", - "ta5_pump", - "", - "ta5_fr_controller", - "ta5_fr_shell", - "ta5_fr_nucleus", - "", - "", - "", - "", - "ta5_flycontroller", - "ta5_chest", - "ta5_tank", - "", - "", - "ta5_tele_tube", - "ta5_tele_pipe", - "", - "", - "", - "ta5_aichip", - "ta5_aichip2", - }, - plans = { - "", - "", - "ta5_fusion_reactor", - "", - "", - "ta5_heatexchanger", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta5_teleport", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta5_EN.lua b/techage/doc/manual_ta5_EN.lua deleted file mode 100644 index 21924bd..0000000 --- a/techage/doc/manual_ta5_EN.lua +++ /dev/null @@ -1,214 +0,0 @@ -return { - titles = { - "1,TA5: Future", - "2,Energy Sources", - "3,TA5 Fusion Reactor", - "4,TA5 Fusion Reactor Magnet", - "4,TA5 Pump", - "4,TA5 Heat Exchanger", - "4,TA5 Fusion Reactor Controller", - "4,TA5 Fusion Reactor Shell", - "4,TA5 Fusion Reactor Core", - "2,Energy Storage", - "3,TA5 Hybrid Storage (planned)", - "2,Logic blocks", - "2,Transport and Traffic", - "3,TA5 Flight Controller", - "3,TA5 Hyperloop Chest", - "3,TA5 Hyperloop Tank", - "2,Teleport Blocks", - "3,TA5 Teleport Block Items", - "3,TA5 Teleport Block Liquids", - "3,Hyperloop Teleport Blocks (planned)", - "2,More TA5 Blocks/Items", - "3,TA5 Container (planned)", - "3,TA5 AI Chip", - "3,TA5 AI Chip II", - }, - texts = { - "Machines to overcome space and time\\, new sources of energy and other achievements shape your life.\n".. - "\n".. - "Experience points are required for the manufacture and use of TA5 machines and blocks. These can only be worked out using the collider from TA4.\n".. - "\n".. - "\n".. - "\n", - "", - "Nuclear fusion means the fusing of two atomic nuclei. Depending on the reaction\\, large amounts of energy can be released. Nuclear fusions\\, in which energy is released\\, take place in the form of chain reactions. They are the source of the energy of the stars\\, including our sun\\, for example. A fusion reactor converts the energy released during controlled nuclear fusion into electricity.\n".. - "\n".. - "*How ​​do fusion reactors work?*\n".. - "\n".. - "A fusion reactor works according to the classic principle of a thermal power plant: water is heated and drives a steam turbine\\, whose kinetic energy is converted into electricity by a generator.\n".. - "\n".. - "A fusion power plant initially requires a large amount of energy\\, since a plasma has to be generated. \"Plasma\" is the name given to the fourth state of matter\\, after solid\\, liquid and gaseous. This requires a lot of electricity. Only through this extreme concentration of energy does the fusion reaction ignite and the heat given off is used to generate electricity via the heat exchanger. The generator then delivers 800 ku of electricity.\n".. - "\n".. - "The plan on the right shows a section through the fusion reactor.\n".. - "\n".. - "60 experience points are required to operate the fusion reactor. The fusion reactor must be built entirely in a forceload block area.\n".. - "\n".. - "\n".. - "\n", - "A total of 60 TA5 Fusion Reactor Magnets are required to set up the fusion reactor. These form the ring in which the plasma forms. The TA5 Fusion Reactor Magnets requires power and has two ports for cooling.\n".. - "\n".. - "There are two types of magnets\\, so all sides of the magnet that face the plasma ring can also be protected with a heat shield.\n".. - "\n".. - "With the corner magnets on the inside of the ring\\, one connection side is covered (power or cooling) and can therefore not be connected. This is technically not feasible and therefore has no influence on the function of the fusion reactor. \n".. - "\n".. - "\n".. - "\n", - "The pump is required to fill the cooling circuit with isobutane. About 350 units of isobutane are required.\n".. - "\n".. - "Note: The TA5 pump can only be used to fill the cooling circuit\\, pumping out the coolant is not possible. Therefore\\, the pump should not be switched on until the magnets are correctly placed and all power and cooling lines are connected.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Heat Exchanger is required to convert the heat generated in the fusion reactor first to steam and then to electricity. The Heat Exchanger itself requires 5 ku electricity. The structure is similar to the Heat Exchanger of the energy store from TA4.\n".. - "\n".. - "Note: The TA5 Heat Exchanger has two connections (blue and green) for the cooling circuit. The heat exchanger and all magnets must be connected to form a cooling circuit via the green and blue pipes.\n".. - "\n".. - "The cooling circuit can be checked for completeness using the start button on the heat exchanger\\, even if no coolant has yet been filled in.\n".. - "\n".. - "\n".. - "\n", - "The fusion reactor is switched on via the TA5 Fusion Reactor Controller. The cooling/Heat Exchanger must be switched on first and then the controller. It takes about 2 minutes for the reactor to start up and supply electricity. The fusion reactor and thus the controller requires 400 ku of electricity to maintain the plasma.\n".. - "\n".. - "\n".. - "\n", - "The entire reactor must be surrounded by a shell that absorbs the enormous pressure that the magnets exert on the plasma and protects the environment from radiation. Without this shell\\, the reactor cannot be started. With the TechAge Trowel\\, power cables and cooling pipes of the fusion reactor can also be integrated into the shell.\n".. - "\n".. - "\n".. - "\n", - "The core must sit in the center of the reactor. See illustration under \"TA5 Fusion Reactor\". The TechAge Trowel is also required for this.\n".. - "\n".. - "\n".. - "\n", - "", - "", - "", - "", - "The TA5 Flight Controller is similar to the TA4 Move Controller. In contrast to the TA4 Move Controller\\, several movements can be combined into one flight route. This flight route can be defined in the input field using several x\\,y\\,z entries (one movement per line). The flight route is checked and saved via \"Save\". In the event of an error\\, an error message is issued.\n".. - "\n".. - "With the \"Test\" button\\, the flight route with the absolute coordinates is output for checking in the chat.\n".. - "\n".. - "The maximum distance for the entire flight distance is 1500 m. Up to 32 blocks can be trained.\n".. - "\n".. - "The use of the TA5 Flight Controller requires 40 experience points.\n".. - "\n".. - "*Teleport mode*\n".. - "\n".. - "If the 'Teleport Mode' is enabled\\, a player can also be moved without blocks. To do this\\, the start position must be configured using the \"Record\" button. Only one position can be configured here. The player to be moved must be in that position.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Hyperloop Chest allows objects to be transported over a Hyperloop network.\n".. - "\n".. - "The TA5 Hyperloop Chest has to be placed on a Hyperloop Junction. The chest has a special menu\\, with which you can pair two chests. Things that are in the chest are teleported to the remote station. The chest can also be filled/emptied with a pusher.\n".. - "\n".. - "For pairing you first have to enter a name for the chest on one side\\, then you can select this name for the other chest and thus connect the two blocks.\n".. - "\n".. - "The use of the TA5 Hyperloop Chest requires 15 experience points.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Hyperloop Tank allows liquids to be transported over a Hyperloop network.\n".. - "\n".. - "The TA5 Hyperloop Tank has to be placed on a Hyperloop Junction.The tank has a special menu\\, with which you can pair two tanks. Liquids in the tank will be teleported to the remote station. The tank can also be filled/emptied with a pump.\n".. - "\n".. - "For pairing you first have to enter a name for the tank on one side\\, then you can select this name for the other tank and thus connect the two blocks.\n".. - "\n".. - "The use of the TA5 Hyperloop Tank requires 15 experience points.\n".. - "\n".. - "\n".. - "\n", - "Teleport blocks allow things to be transferred between two teleport blocks without the need for a pipe or tube in between. To pair the blocks\\, you first have to enter a name for the block on one side\\, then you can select this name for the other block and thus connect the two blocks. Pairing can only be carried out by one player (player name is checked) and must be completed before the server is restarted. Otherwise the pairing data will be lost.\n".. - "\n".. - "The map on the right shows how the blocks can be used. \n".. - "\n".. - "\n".. - "\n", - "These teleport blocks allow the transfer of items and thus replace a tube. Distances of up to 500 blocks can be bridged.\n".. - "\n".. - "Each Teleport blocks requires 12 ku of electricity.\n".. - "\n".. - "30 experience points are required to use the teleport blocks. \n".. - "\n".. - "\n".. - "\n", - "These teleport blocks allow the transfer of liquids and thus replace a pipe. Distances of up to 500 blocks can be bridged.\n".. - "\n".. - "Each Teleport blocks requires 12 ku of electricity.\n".. - "\n".. - "30 experience points are required to use the teleport blocks. \n".. - "\n".. - "\n".. - "\n", - "The Hyperloop Teleport Blocks allow the construction of a Hyperloop network without Hyperloop tubes.\n".. - "\n".. - "The use of the Hyperloop Teleport Blocks requires 60 experience points.\n".. - "\n", - "", - "The TA5 container allows Techage systems to be packed and unpacked at another location.\n".. - "\n".. - "80 experience points are required to use the TA5 container.\n".. - "\n", - "The TA5 AI Chip is partly required for the production of TA5 blocks. The TA5 AI Chip can only be manufactured at the TA4 Electronics Fab. This requires 10 experience points.\n".. - "\n".. - "\n".. - "\n", - "The TA5 AI Chip II is required to build the TA5 Fusion Reactor. The TA5 AI Chip II can only be manufactured at the TA4 Electronics Fab. This requires 25 experience points.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta5", - "", - "", - "ta5_magnet", - "ta5_pump", - "", - "ta5_fr_controller", - "ta5_fr_shell", - "ta5_fr_nucleus", - "", - "", - "", - "", - "ta5_flycontroller", - "ta5_chest", - "ta5_tank", - "", - "ta5_tele_tube", - "ta5_tele_pipe", - "", - "", - "", - "ta5_aichip", - "ta5_aichip2", - }, - plans = { - "", - "", - "ta5_fusion_reactor", - "", - "", - "ta5_heatexchanger", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta5_teleport", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta5_RU.lua b/techage/doc/manual_ta5_RU.lua deleted file mode 100644 index 21924bd..0000000 --- a/techage/doc/manual_ta5_RU.lua +++ /dev/null @@ -1,214 +0,0 @@ -return { - titles = { - "1,TA5: Future", - "2,Energy Sources", - "3,TA5 Fusion Reactor", - "4,TA5 Fusion Reactor Magnet", - "4,TA5 Pump", - "4,TA5 Heat Exchanger", - "4,TA5 Fusion Reactor Controller", - "4,TA5 Fusion Reactor Shell", - "4,TA5 Fusion Reactor Core", - "2,Energy Storage", - "3,TA5 Hybrid Storage (planned)", - "2,Logic blocks", - "2,Transport and Traffic", - "3,TA5 Flight Controller", - "3,TA5 Hyperloop Chest", - "3,TA5 Hyperloop Tank", - "2,Teleport Blocks", - "3,TA5 Teleport Block Items", - "3,TA5 Teleport Block Liquids", - "3,Hyperloop Teleport Blocks (planned)", - "2,More TA5 Blocks/Items", - "3,TA5 Container (planned)", - "3,TA5 AI Chip", - "3,TA5 AI Chip II", - }, - texts = { - "Machines to overcome space and time\\, new sources of energy and other achievements shape your life.\n".. - "\n".. - "Experience points are required for the manufacture and use of TA5 machines and blocks. These can only be worked out using the collider from TA4.\n".. - "\n".. - "\n".. - "\n", - "", - "Nuclear fusion means the fusing of two atomic nuclei. Depending on the reaction\\, large amounts of energy can be released. Nuclear fusions\\, in which energy is released\\, take place in the form of chain reactions. They are the source of the energy of the stars\\, including our sun\\, for example. A fusion reactor converts the energy released during controlled nuclear fusion into electricity.\n".. - "\n".. - "*How ​​do fusion reactors work?*\n".. - "\n".. - "A fusion reactor works according to the classic principle of a thermal power plant: water is heated and drives a steam turbine\\, whose kinetic energy is converted into electricity by a generator.\n".. - "\n".. - "A fusion power plant initially requires a large amount of energy\\, since a plasma has to be generated. \"Plasma\" is the name given to the fourth state of matter\\, after solid\\, liquid and gaseous. This requires a lot of electricity. Only through this extreme concentration of energy does the fusion reaction ignite and the heat given off is used to generate electricity via the heat exchanger. The generator then delivers 800 ku of electricity.\n".. - "\n".. - "The plan on the right shows a section through the fusion reactor.\n".. - "\n".. - "60 experience points are required to operate the fusion reactor. The fusion reactor must be built entirely in a forceload block area.\n".. - "\n".. - "\n".. - "\n", - "A total of 60 TA5 Fusion Reactor Magnets are required to set up the fusion reactor. These form the ring in which the plasma forms. The TA5 Fusion Reactor Magnets requires power and has two ports for cooling.\n".. - "\n".. - "There are two types of magnets\\, so all sides of the magnet that face the plasma ring can also be protected with a heat shield.\n".. - "\n".. - "With the corner magnets on the inside of the ring\\, one connection side is covered (power or cooling) and can therefore not be connected. This is technically not feasible and therefore has no influence on the function of the fusion reactor. \n".. - "\n".. - "\n".. - "\n", - "The pump is required to fill the cooling circuit with isobutane. About 350 units of isobutane are required.\n".. - "\n".. - "Note: The TA5 pump can only be used to fill the cooling circuit\\, pumping out the coolant is not possible. Therefore\\, the pump should not be switched on until the magnets are correctly placed and all power and cooling lines are connected.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Heat Exchanger is required to convert the heat generated in the fusion reactor first to steam and then to electricity. The Heat Exchanger itself requires 5 ku electricity. The structure is similar to the Heat Exchanger of the energy store from TA4.\n".. - "\n".. - "Note: The TA5 Heat Exchanger has two connections (blue and green) for the cooling circuit. The heat exchanger and all magnets must be connected to form a cooling circuit via the green and blue pipes.\n".. - "\n".. - "The cooling circuit can be checked for completeness using the start button on the heat exchanger\\, even if no coolant has yet been filled in.\n".. - "\n".. - "\n".. - "\n", - "The fusion reactor is switched on via the TA5 Fusion Reactor Controller. The cooling/Heat Exchanger must be switched on first and then the controller. It takes about 2 minutes for the reactor to start up and supply electricity. The fusion reactor and thus the controller requires 400 ku of electricity to maintain the plasma.\n".. - "\n".. - "\n".. - "\n", - "The entire reactor must be surrounded by a shell that absorbs the enormous pressure that the magnets exert on the plasma and protects the environment from radiation. Without this shell\\, the reactor cannot be started. With the TechAge Trowel\\, power cables and cooling pipes of the fusion reactor can also be integrated into the shell.\n".. - "\n".. - "\n".. - "\n", - "The core must sit in the center of the reactor. See illustration under \"TA5 Fusion Reactor\". The TechAge Trowel is also required for this.\n".. - "\n".. - "\n".. - "\n", - "", - "", - "", - "", - "The TA5 Flight Controller is similar to the TA4 Move Controller. In contrast to the TA4 Move Controller\\, several movements can be combined into one flight route. This flight route can be defined in the input field using several x\\,y\\,z entries (one movement per line). The flight route is checked and saved via \"Save\". In the event of an error\\, an error message is issued.\n".. - "\n".. - "With the \"Test\" button\\, the flight route with the absolute coordinates is output for checking in the chat.\n".. - "\n".. - "The maximum distance for the entire flight distance is 1500 m. Up to 32 blocks can be trained.\n".. - "\n".. - "The use of the TA5 Flight Controller requires 40 experience points.\n".. - "\n".. - "*Teleport mode*\n".. - "\n".. - "If the 'Teleport Mode' is enabled\\, a player can also be moved without blocks. To do this\\, the start position must be configured using the \"Record\" button. Only one position can be configured here. The player to be moved must be in that position.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Hyperloop Chest allows objects to be transported over a Hyperloop network.\n".. - "\n".. - "The TA5 Hyperloop Chest has to be placed on a Hyperloop Junction. The chest has a special menu\\, with which you can pair two chests. Things that are in the chest are teleported to the remote station. The chest can also be filled/emptied with a pusher.\n".. - "\n".. - "For pairing you first have to enter a name for the chest on one side\\, then you can select this name for the other chest and thus connect the two blocks.\n".. - "\n".. - "The use of the TA5 Hyperloop Chest requires 15 experience points.\n".. - "\n".. - "\n".. - "\n", - "The TA5 Hyperloop Tank allows liquids to be transported over a Hyperloop network.\n".. - "\n".. - "The TA5 Hyperloop Tank has to be placed on a Hyperloop Junction.The tank has a special menu\\, with which you can pair two tanks. Liquids in the tank will be teleported to the remote station. The tank can also be filled/emptied with a pump.\n".. - "\n".. - "For pairing you first have to enter a name for the tank on one side\\, then you can select this name for the other tank and thus connect the two blocks.\n".. - "\n".. - "The use of the TA5 Hyperloop Tank requires 15 experience points.\n".. - "\n".. - "\n".. - "\n", - "Teleport blocks allow things to be transferred between two teleport blocks without the need for a pipe or tube in between. To pair the blocks\\, you first have to enter a name for the block on one side\\, then you can select this name for the other block and thus connect the two blocks. Pairing can only be carried out by one player (player name is checked) and must be completed before the server is restarted. Otherwise the pairing data will be lost.\n".. - "\n".. - "The map on the right shows how the blocks can be used. \n".. - "\n".. - "\n".. - "\n", - "These teleport blocks allow the transfer of items and thus replace a tube. Distances of up to 500 blocks can be bridged.\n".. - "\n".. - "Each Teleport blocks requires 12 ku of electricity.\n".. - "\n".. - "30 experience points are required to use the teleport blocks. \n".. - "\n".. - "\n".. - "\n", - "These teleport blocks allow the transfer of liquids and thus replace a pipe. Distances of up to 500 blocks can be bridged.\n".. - "\n".. - "Each Teleport blocks requires 12 ku of electricity.\n".. - "\n".. - "30 experience points are required to use the teleport blocks. \n".. - "\n".. - "\n".. - "\n", - "The Hyperloop Teleport Blocks allow the construction of a Hyperloop network without Hyperloop tubes.\n".. - "\n".. - "The use of the Hyperloop Teleport Blocks requires 60 experience points.\n".. - "\n", - "", - "The TA5 container allows Techage systems to be packed and unpacked at another location.\n".. - "\n".. - "80 experience points are required to use the TA5 container.\n".. - "\n", - "The TA5 AI Chip is partly required for the production of TA5 blocks. The TA5 AI Chip can only be manufactured at the TA4 Electronics Fab. This requires 10 experience points.\n".. - "\n".. - "\n".. - "\n", - "The TA5 AI Chip II is required to build the TA5 Fusion Reactor. The TA5 AI Chip II can only be manufactured at the TA4 Electronics Fab. This requires 25 experience points.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta5", - "", - "", - "ta5_magnet", - "ta5_pump", - "", - "ta5_fr_controller", - "ta5_fr_shell", - "ta5_fr_nucleus", - "", - "", - "", - "", - "ta5_flycontroller", - "ta5_chest", - "ta5_tank", - "", - "ta5_tele_tube", - "ta5_tele_pipe", - "", - "", - "", - "ta5_aichip", - "ta5_aichip2", - }, - plans = { - "", - "", - "ta5_fusion_reactor", - "", - "", - "ta5_heatexchanger", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta5_teleport", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/manual_ta5_pt-BR.lua b/techage/doc/manual_ta5_pt-BR.lua deleted file mode 100644 index a46e082..0000000 --- a/techage/doc/manual_ta5_pt-BR.lua +++ /dev/null @@ -1,214 +0,0 @@ -return { - titles = { - "1,TA5: Futuro", - "2,Fontes de energia", - "3,Reator de fusão TA5", - "4,Ímã do reator de fusão TA5", - "4,Bomba TA5", - "4,Trocador de calor TA5", - "4,Controlador do reator de fusão TA5", - "4,Carcaça do reator de fusão TA5", - "4,Núcleo do reator de fusão TA5", - "2,Armazenamento de energia", - "3,Armazenamento híbrido TA5 (planejado)", - "2,Blocos lógicos", - "2,Transporte e tráfego", - "3,Controlador de voo TA5", - "3,TA5 Hyperloop Chest", - "3,Tanque de hyperloop TA5", - "2,Blocos de teletransporte", - "3,Itens do bloco de teletransporte TA5", - "3,Líquidos do bloco de teletransporte TA5", - "3,Blocos de teletransporte Hyperloop (planejados)", - "2,Mais blocos/itens TA5", - "3,Contêiner TA5 (planejado)", - "3,Chip TA5 AI", - "3,Chip TA5 AI II", - }, - texts = { - "Máquinas para superar o espaço e o tempo\\, novas fontes de energia e outras conquistas moldam sua vida.\n".. - "\n".. - "São necessários pontos de experiência para a fabricação e o uso de máquinas e blocos TA5. Eles só podem ser calculados usando o colisor do TA4.\n".. - "\n".. - "\n".. - "\n", - "", - "A fusão nuclear significa a fusão de dois núcleos atômicos. Dependendo da reação\\, grandes quantidades de energia podem ser liberadas. As fusões nucleares\\, nas quais a energia é liberada\\, ocorrem na forma de reações em cadeia. Elas são a fonte de energia das estrelas\\, inclusive do nosso sol\\, por exemplo. Um reator de fusão converte a energia liberada durante a fusão nuclear controlada em eletricidade.\n".. - "\n".. - "*Como funcionam os reatores de fusão?*\n".. - "\n".. - "Um reator de fusão funciona de acordo com o princípio clássico de uma usina de energia térmica: a água é aquecida e aciona uma turbina a vapor\\, cuja energia cinética é convertida em eletricidade por um gerador.\n".. - "\n".. - "Uma usina de fusão requer inicialmente uma grande quantidade de energia\\, pois é necessário gerar um plasma. \"Plasma\" é o nome dado ao quarto estado da matéria\\, depois do sólido\\, líquido e gasoso. Isso requer uma grande quantidade de eletricidade. Somente por meio dessa concentração extrema de energia é que a reação de fusão se inflama e o calor liberado é usado para gerar eletricidade por meio do trocador de calor. O gerador fornece então 800 ku de eletricidade.\n".. - "\n".. - "A planta à direita mostra uma seção do reator de fusão.\n".. - "\n".. - "São necessários 60 pontos de experiência para operar o reator de fusão. O reator de fusão deve ser construído inteiramente em uma área de bloco de carga.\n".. - "\n".. - "\n".. - "\n", - "Um total de 60 ímãs de reator de fusão TA5 é necessário para configurar o reator de fusão. Eles formam o anel no qual o plasma se forma. O TA5 Fusion Reactor Magnets requer energia e tem duas portas para resfriamento.\n".. - "\n".. - "Há dois tipos de ímãs\\, portanto\\, todos os lados do ímã voltados para o anel de plasma também podem ser protegidos com um protetor térmico.\n".. - "\n".. - "Com os ímãs de canto na parte interna do anel\\, um lado da conexão é coberto (energia ou resfriamento) e\\, portanto\\, não pode ser conectado. Isso não é tecnicamente viável e\\, portanto\\, não influencia a função do reator de fusão. \n".. - "\n".. - "\n".. - "\n", - "A bomba é necessária para encher o circuito de resfriamento com isobutano. São necessárias cerca de 350 unidades de isobutano.\n".. - "\n".. - "Observação: A bomba TA5 só pode ser usada para encher o circuito de resfriamento\\; não é possível bombear o líquido de arrefecimento para fora. Portanto\\, a bomba não deve ser ligada até que os ímãs estejam corretamente posicionados e todas as linhas de alimentação e resfriamento estejam conectadas.\n".. - "\n".. - "\n".. - "\n", - "O trocador de calor TA5 é necessário para converter o calor gerado no reator de fusão primeiro em vapor e depois em eletricidade. O próprio trocador de calor requer 5 ku de eletricidade. A estrutura é semelhante à do trocador de calor do depósito de energia do TA4.\n".. - "\n".. - "Observação: O trocador de calor TA5 tem duas conexões (azul e verde) para o circuito de resfriamento. O trocador de calor e todos os ímãs devem ser conectados para formar um circuito de resfriamento por meio dos tubos verde e azul.\n".. - "\n".. - "É possível verificar se o circuito de resfriamento está completo usando o botão de partida no trocador de calor\\, mesmo que o líquido de arrefecimento ainda não tenha sido abastecido.\n".. - "\n".. - "\n".. - "\n", - "O reator de fusão é ligado por meio do controlador do reator de fusão TA5. O resfriamento/trocador de calor deve ser ligado primeiro e depois o controlador. Leva cerca de 2 minutos para o reator iniciar e fornecer eletricidade. O reator de fusão e\\, portanto\\, o controlador requerem 400 ku de eletricidade para manter o plasma.\n".. - "\n".. - "\n".. - "\n", - "O reator inteiro deve ser cercado por um invólucro que absorva a enorme pressão que os ímãs exercem sobre o plasma e proteja o ambiente da radiação. Sem esse invólucro\\, o reator não pode ser iniciado. Com a TechAge Trowel\\, os cabos de energia e os tubos de resfriamento do reator de fusão também podem ser integrados à carcaça.\n".. - "\n".. - "\n".. - "\n", - "O núcleo deve ficar no centro do reator. Veja a ilustração em \"TA5 Fusion Reactor\". A espátula TechAge também é necessária para isso.\n".. - "\n".. - "\n".. - "\n", - "", - "", - "", - "", - "O controlador de voo TA5 é semelhante ao controlador de movimento TA4. Ao contrário do TA4 Move Controller\\, vários movimentos podem ser combinados em uma rota de voo. Essa rota de voo pode ser definida no campo de entrada usando várias entradas x\\,y\\,z (um movimento por linha). A rota de voo é verificada e salva por meio de \"Save\" (Salvar). Em caso de erro\\, é emitida uma mensagem de erro.\n".. - "\n".. - "Com o botão \"Test\" (Testar)\\, a rota de voo com as coordenadas absolutas é emitida para verificação no bate-papo.\n".. - "\n".. - "A distância máxima para toda a distância de voo é de 1.500 m. Até 32 blocos podem ser treinados.\n".. - "\n".. - "O uso do controlador de voo TA5 requer 40 pontos de experiência.\n".. - "\n".. - "*Modo teletransporte*\n".. - "\n".. - "Se o \"Teleport Mode\" (Modo de teletransporte) estiver ativado\\, o jogador também poderá ser movido sem blocos. Para fazer isso\\, a posição inicial deve ser configurada usando o botão \"Record\" (Registrar). Somente uma posição pode ser configurada aqui. O jogador a ser movido deve estar nessa posição.\n".. - "\n".. - "\n".. - "\n", - "O TA5 Hyperloop Chest permite que objetos sejam transportados em uma rede Hyperloop.\n".. - "\n".. - "O Baú Hyperloop TA5 deve ser colocado em uma Junção Hyperloop. O baú tem um menu especial\\, com o qual você pode emparelhar dois baús. Os itens que estão no baú são teletransportados para a estação remota. O baú também pode ser preenchido/esvaziado com um empurrador.\n".. - "\n".. - "Para fazer o emparelhamento\\, primeiro você precisa inserir um nome para o baú de um lado e\\, em seguida\\, selecionar esse nome para o outro baú e\\, assim\\, conectar os dois blocos.\n".. - "\n".. - "O uso do Baú do Hyperloop TA5 requer 15 pontos de experiência.\n".. - "\n".. - "\n".. - "\n", - "O TA5 Hyperloop Tank permite o transporte de líquidos em uma rede Hyperloop.\n".. - "\n".. - "O TA5 Hyperloop Tank deve ser colocado em um Hyperloop Junction. O tanque tem um menu especial\\, com o qual você pode emparelhar dois tanques. Os líquidos no tanque serão teletransportados para a estação remota. O tanque também pode ser enchido/esvaziado com uma bomba.\n".. - "\n".. - "Para fazer o emparelhamento\\, primeiro é necessário inserir um nome para o tanque de um lado e\\, em seguida\\, selecionar esse nome para o outro tanque e\\, assim\\, conectar os dois blocos.\n".. - "\n".. - "O uso do TA5 Hyperloop Tank requer 15 pontos de experiência.\n".. - "\n".. - "\n".. - "\n", - "Os blocos de teletransporte permitem a transferência de objetos entre dois blocos de teletransporte sem a necessidade de um cano ou tubo entre eles. Para emparelhar os blocos\\, primeiro é preciso digitar um nome para o bloco de um lado e\\, em seguida\\, selecionar esse nome para o outro bloco e\\, assim\\, conectar os dois blocos. O emparelhamento só pode ser realizado por um jogador (o nome do jogador é verificado) e deve ser concluído antes de o servidor ser reiniciado. Caso contrário\\, os dados de emparelhamento serão perdidos.\n".. - "\n".. - "O mapa à direita mostra como os blocos podem ser usados. \n".. - "\n".. - "\n".. - "\n", - "Esses blocos de teletransporte permitem a transferência de itens e\\, portanto\\, substituem um tubo. Distâncias de até 500 blocos podem ser transpostas.\n".. - "\n".. - "Cada bloco de teletransporte requer 12 ku de eletricidade.\n".. - "\n".. - "São necessários 30 pontos de experiência para usar os blocos de teletransporte. \n".. - "\n".. - "\n".. - "\n", - "Esses blocos de teletransporte permitem a transferência de líquidos e\\, portanto\\, substituem um cano. Distâncias de até 500 blocos podem ser transpostas.\n".. - "\n".. - "Cada bloco de teletransporte requer 12 ku de eletricidade.\n".. - "\n".. - "São necessários 30 pontos de experiência para usar os blocos de teletransporte. \n".. - "\n".. - "\n".. - "\n", - "Os blocos de teletransporte Hyperloop permitem a construção de uma rede Hyperloop sem tubos Hyperloop.\n".. - "\n".. - "O uso dos blocos de teletransporte Hyperloop requer 60 pontos de experiência.\n".. - "\n", - "", - "O contêiner TA5 permite que os sistemas Techage sejam embalados e desembalados em outro local.\n".. - "\n".. - "São necessários 80 pontos de experiência para usar o contêiner TA5.\n".. - "\n", - "O chip TA5 AI é parcialmente necessário para a produção de blocos TA5. O chip de IA TA5 só pode ser fabricado na fábrica de eletrônicos TA4. Isso requer 10 pontos de experiência.\n".. - "\n".. - "\n".. - "\n", - "O TA5 AI Chip II é necessário para construir o Reator de Fusão TA5. O TA5 AI Chip II só pode ser fabricado na fábrica de eletrônicos TA4. Isso requer 25 pontos de experiência.\n".. - "\n".. - "\n".. - "\n", - }, - images = { - "techage_ta5", - "", - "", - "ta5_magnet", - "ta5_pump", - "", - "ta5_fr_controller", - "ta5_fr_shell", - "ta5_fr_nucleus", - "", - "", - "", - "", - "ta5_flycontroller", - "ta5_chest", - "ta5_tank", - "", - "ta5_tele_tube", - "ta5_tele_pipe", - "", - "", - "", - "ta5_aichip", - "ta5_aichip2", - }, - plans = { - "", - "", - "ta5_fusion_reactor", - "", - "", - "ta5_heatexchanger", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "ta5_teleport", - "", - "", - "", - "", - "", - "", - "", - } -} \ No newline at end of file diff --git a/techage/doc/plans.lua b/techage/doc/plans.lua deleted file mode 100644 index 3122f4d..0000000 --- a/techage/doc/plans.lua +++ /dev/null @@ -1,608 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Constructioon Plans for TA machines - -]]-- - -local plans = {} - - -local IMG_1 = {"", "techage_ta1.png"} -local IMG_2 = {"", "techage_ta2.png"} -local IMG_3 = {"", "techage_ta3.png"} -local IMG31 = {"", "techage_ta3b.png"} -local IMG_4 = {"", "techage_ta4.png"} -local IMG41 = {"", "techage_ta4_tes.png"} -local IMG42 = {"", "techage_ta4_solar.png"} -local IMG43 = {"", "techage_reactor_inv.png"} -local IMG44 = {"", "techage_ta4_filter.png"} -local IMG45 = {"10x10", "techage_collider_plan.png"} -local IMG46 = {"5x4", "techage_fusion_reactor.png"} -local IMG47 = {"5x4", "techage_collider_plan2.png"} - -local TOP_V = {"top_view", ""} -local SIDEV = {"side_view", ""} -local SECTV = {"sectional_view", ""} - --- --- TA1: Coal Pile --- -local DDIRT = {"default_dirt.png", "default:dirt"} -local DWOOD = {"default_wood.png" , "default:wood"} -local LIGTR = {"techage_lighter.png", "techage:lighter"} - -plans["coalpile"] = { - {false, false, SIDEV, false, false, false, false, false, TOP_V, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, false, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT}, - {DDIRT, DWOOD, DWOOD, DWOOD, DDIRT, false, DDIRT, DWOOD, DWOOD, DWOOD, DDIRT}, - {DDIRT, DWOOD, DWOOD, DWOOD, DDIRT, false, DDIRT, DWOOD, LIGTR, DWOOD, DDIRT}, - {DDIRT, DWOOD, LIGTR, DWOOD, DDIRT, false, DDIRT, DWOOD, DWOOD, DWOOD, DDIRT}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, false, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT}, - {false, false, false, false, false, false, false, false, false, false, false}, -} - --- --- TA1: Coal Burner --- -local COBBL = {"default_cobble.png", "default:cobble"} -local CCOAL = {"techage_charcoal.png", "techage:charcoal"} -local MEPOT = {"default_cobble.png^techage_meltingpot.png", "techage:meltingpot"} -local FLAME = {"techage_flame.png", nil} - -plans["coalburner"] = { - {false, false, SIDEV, false, false, false, false}, - {false, false, MEPOT, false, false, IMG_1, false}, - {false, false, FLAME, false}, - {false, COBBL, CCOAL, COBBL}, - {false, COBBL, CCOAL, COBBL}, - {false, COBBL, CCOAL, COBBL}, - {false, COBBL, CCOAL, COBBL}, - {false, false, LIGTR, COBBL}, - {false, COBBL, COBBL, COBBL}, -} - --- --- Hopper + Sieve --- -local CHEST = {"default_chest_lock.png", "default:chest_locked"} -local HOPPR = {"techage_hopper.png^[transformFX", "minecart:hopper"} -local SIEVE = {"techage_sieve_sieve_ta1.png", "techage:sieve3"} - -plans["hoppersieve"] = { - {false, false, false, false, false}, - {false, false, false, false, false}, - {false, CHEST, false, false, false}, - {false, HOPPR, SIEVE, false, false}, - {false, false, HOPPR, CHEST, false}, -} - --- --- TA1: Watermill --- -local WATR1 = {"default_water.png" , "techage:water_flowing"} -local WATR3 = {"techage_water_flowing.png" , "techage:water_flowing"} -local WATR4 = {"default_water.png" , "default:water_source"} -local WMILL = {"default_wood.png" , "techage:ta1_board1_apple"} -local SLUC1 = {"techage_sluice2_inv.png" , "techage:ta1_sluice_closed"} -local SLUC2 = {"techage_sluice1_inv.png" , "techage:ta1_sluice_handle_closed"} -local MIL11 = {"techage_watermill1_inv.png" , "techage:ta1_watermill"} -local MIL12 = {"techage_watermill1_inv.png^[transformR90" , "techage:ta1_watermill"} -local MIL13 = {"techage_watermill1_inv.png^[transformR180" , "techage:ta1_watermill"} -local MIL14 = {"techage_watermill1_inv.png^[transformR270" , "techage:ta1_watermill"} -local MIL21 = {"techage_watermill2_inv.png" , "techage:ta1_watermill"} -local MIL22 = {"techage_watermill2_inv.png^[transformR90" , "techage:ta1_watermill"} -local MIL23 = {"techage_watermill2_inv.png^[transformR180" , "techage:ta1_watermill"} -local MIL24 = {"techage_watermill2_inv.png^[transformR270" , "techage:ta1_watermill"} -local MIL31 = {"techage_watermill3_inv.png" , "techage:ta1_watermill"} -local MIL32 = {"techage_watermill3_inv.png^[transformR90" , "techage:ta1_watermill"} -local MIL33 = {"techage_watermill3_inv.png^[transformR180" , "techage:ta1_watermill"} -local MIL34 = {"techage_watermill3_inv.png^[transformR270" , "techage:ta1_watermill"} -local MIL40 = {"techage_watermill4_inv.png" , "techage:ta1_watermill"} -local BEARG = {"default_stone_brick.png^techage_axle_bearing_front.png", "techage:ta1_axle_bearing2"} -local BRICK = {"default_stone_brick.png", "default:stonebrick"} - - -plans["watermill1"] = { - {false, false, false, false, false, false, false, false, false, false, false, false}, - {false, false, SLUC2, false, false, false, false, false, false, false, false, false}, - {WATR4, WATR4, SLUC1, WMILL, WMILL, WMILL, WMILL, WMILL, WATR3, false, false, false}, - {WATR4, WATR4, DDIRT, false, false, MIL31, MIL21, MIL11, MIL21, MIL34, false, false}, - {WATR4, DDIRT, DDIRT, false, false, MIL22, MIL40, MIL40, MIL40, MIL24, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, false, MIL12, MIL40, BEARG, MIL40, MIL14, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, false, MIL22, MIL40, BRICK, MIL40, MIL24, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, MIL32, MIL23, BRICK, MIL23, MIL33, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, WATR1, WATR1, WATR1, WATR1}, -} - - -local MILLF = {"default_wood.png" , "techage:ta1_watermill"} -local AXLE1 = {"techage_axle_bearing.png", "techage:ta1_axle"} -local MILLG = {"techage_wood50.png^techage_axle_bearing.png", "techage:ta1_mill_gear"} -local MILL_ = {"techage_mill_side.png", "techage:ta1_mill"} -local MILLB = {"default_stone_brick.png", "techage:ta1_mill_base"} -local FURNE = {"default_furnace_front.png", "default:furnace"} -local HOPER = {"techage_hopper.png", "minecart:hopper"} - -plans["watermill2"] = { - {false, false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, MILLF, false, false, false}, - {false, false, false, false, false, false, false, false, MILLF, false, false, false}, - {false, false, false, false, false, MILLG, AXLE1, BEARG, MILLF, BEARG, false, false}, - {false, false, false, false, false, MILL_, false, BRICK, MILLF, BRICK, false, false}, - {false, CHEST, HOPER, FURNE, HOPER, MILLB, false, BRICK, MILLF, BRICK, false, false}, - {DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, DDIRT, WATR1, DDIRT, DDIRT, DDIRT}, -} - --- --- Steam Engine --- -local PK000 = {"techage_steam_knee.png", "techage:steam_pipeS"} -local PK090 = {"techage_steam_knee.png^[transformR90", "techage:steam_pipeS"} -local PK270 = {"techage_steam_knee.png^[transformR270", "techage:steam_pipeS"} -local PI000 = {"techage_steam_pipe.png", "techage:steam_pipeS"} -local PI090 = {'techage_steam_pipe.png^[transformR90', "techage:steam_pipeS"} -local BOIL1 = {"techage:boiler1", "techage:boiler1"} -local BOIL2 = {"techage:boiler2", "techage:boiler2"} -local FIBOX = {"techage_firebox.png^techage_appl_firehole.png^techage_frame_ta2.png", "techage:firebox"} -local CYLIN = {"techage_filling_ta2.png^techage_cylinder.png^techage_frame_ta2.png", "techage:cylinder"} -local FLYWH = {"techage_filling_ta2.png^techage_frame_ta2.png^techage_flywheel.png^[transformFX]", "techage:flywheel"} - -plans["steamengine"] = { - {false, false, false, false, false, IMG_2, false}, - {false, false, false, false, false, false, false}, - {false, PK000, PI000, PK270, false, false, false}, - {false, BOIL2, false, PI090, false, false, false}, - {false, BOIL1, false, PI090, false, false, false}, - {false, FIBOX, false, PK090, CYLIN, FLYWH, false}, -} - --- --- TA2 Storage --- -local GRBOX = {"techage_filling_ta2.png^techage_axle_gearbox.png^techage_frame_ta2.png", "techage:gearbox"} -local AXL00 = {"techage_axle.png", "techage:axle"} -local AXL90 = {"techage_axle.png^[transformR90", "techage:axle"} -local WINCH = {"techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", "techage:ta2_winch"} -local ROPE_ = {"techage_rope_inv.png", "techage:ta2_rope"} -local WCHST = {"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", "techage:ta2_weight_chest"} -local CLTCH = {"techage_filling_ta2.png^techage_appl_clutch.png^techage_frame_ta2.png", "techage:ta2_clutch_off"} - -plans["ta2_storage"] = { - {false, false, false, GRBOX, WINCH, false, SIDEV}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, ROPE_, false, false}, - {false, false, false, AXL90, WCHST, false, false}, - {false, false, false, AXL90, false, false, false}, - {AXL00, CLTCH, AXL00, GRBOX, false, false, false}, -} - --- --- Item Transport --- -local PUSHR = {"techage_appl_pusher.png^techage_frame_ta2.png", "techage:ta2_pusher_pas"} -local TB000 = {"techage_tube_tube.png", "techage:tubeS"} -local GRIND = {"techage_filling_ta2.png^techage_appl_grinder2.png^techage_frame_ta2.png", "techage:ta2_grinder_pas"} -local DISTR = {"techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_distri_blue.png", "techage:ta2_distributor_pas"} -local SIEV2 = {"techage_filling_ta2.png^techage_appl_sieve.png^techage_frame_ta2.png", "techage:ta2_gravelsieve_pas"} - -plans["itemtransport"] = { - {false, false, false, false, false, false, false, false, false, false, false}, - {false}, - {false}, - {CHEST, PUSHR, TB000, GRIND, PUSHR, DISTR, TB000, SIEV2, PUSHR, TB000, CHEST}, -} - --- --- Gravel Rinser --- -local RINSR = {"techage_filling_ta2.png^techage_appl_rinser.png^techage_frame_ta2.png", "techage:ta2_rinser_pas"} -local GLASS = {"default_glass.png", "default:glass"} -local WATER = {"default_water.png^default_glass.png", "default:water_source"} -local WATR2 = {"default_water.png", "default:water_source"} -local TK000 = {"techage_tube_knee.png", "techage:tubeS"} -- like 'r' -local TK090 = {"techage_tube_knee.png^[transformR90", "techage:tubeS"} -- '7' -local TK180 = {"techage_tube_knee.png^[transformR180", "techage:tubeS"} -local TK270 = {"techage_tube_knee.png^[transformR270", "techage:tubeS"} - -plans["gravelrinser"] = { - {false, false, false, SIDEV, false, false, false, false}, - {false, GLASS, WATER, GLASS, GLASS, GLASS, GLASS, GLASS}, - {false, DDIRT, DDIRT, TK000, RINSR, TK270, HOPPR, CHEST}, - {false, false, false, false, false, false, false, false}, - {false, false, false, TOP_V, false, false, false, false}, - {false, GLASS, GLASS, GLASS, GLASS, GLASS, GLASS, GLASS}, - {false, GLASS, WATR2, TK000, RINSR, TK270, HOPPR, GLASS}, - {false, GLASS, GLASS, GLASS, GLASS, GLASS, GLASS, GLASS}, -} - --- --- Coal Power Station --- -local BOIL3 = {"techage:coalboiler_top", "techage:coalboiler_top"} -local BOIL4 = {"techage:coalboiler_base", "techage:coalboiler_base"} -local FBOX3 = {"techage:coalfirebox", "techage:coalfirebox"} -local TURB3 = {"techage_filling_ta3.png^techage_appl_turbine.png^techage_frame_ta3.png", "techage:turbine"} -local GENE3 = {"techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_generator.png", "techage:generator"} -local COOL3 = {"techage_filling_ta3.png^techage_frame_ta3.png^techage_cooler.png", "techage:cooler"} -local PK180 = {"techage_steam_knee.png^[transformR180", "techage:steam_pipeS"} - -plans["coalpowerstation"] = { - {false, false, false, false, false, false, false, false}, - {false, PK000, PI000, PI000, PI000, PI000, PI000, PK270}, - {false, PI090, BOIL3, PI000, PK270, PK000, COOL3, PK180}, - {false, PK090, BOIL4, false, PI090, PI090}, - {false, false, FBOX3, false, PK090, TURB3, GENE3}, -} - - --- --- TA3 Industrial Furnace --- -local Cable = {"techage_electric_cable_inv.png", "techage:electric_cableS"} -local Tubes = {"techage_tube_tube.png", "techage:tubeS"} -local PushR = {"techage_appl_pusher.png^techage_frame_ta3.png", "techage:ta3_pusher_pas"} -local PushL = {"techage_appl_pusher.png^techage_frame_ta3.png^[transformFX", "techage:ta3_pusher_pas"} -local Boost = {"techage_filling_ta3.png^techage_appl_compressor.png^[transformFX^techage_frame_ta3.png", "techage:ta3_booster"} -local Fibox = {"techage_concrete.png^techage_appl_firehole.png^techage_frame_ta3.png", "techage:furnace_firebox"} -local Furnc = {"techage_concrete.png^techage_appl_furnace.png^techage_frame_ta3.png", "techage:ta3_furnace_pas"} - -plans["ta3_furnace"] = { - {false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false}, - {false, Tubes, PushR, Tubes, Furnc, Tubes, PushR, Tubes}, - {false, false, Cable, Boost, Fibox, false, false, false}, -} - - --- --- TA3 Tank Pump Pusher --- -local Pump = {"techage_filling_ta3.png^techage_appl_pump.png^techage_frame_ta3.png", "techage:t3_pump"} -local TANK3 = {"techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_tank.png", "techage:ta3_tank"} -local Fillr = {"techage_filling_ta3.png^techage_appl_liquid_hopper.png^techage_frame_ta3.png", "techage:filler"} -local PIPEH = {"techage_gaspipe.png", "techage:ta4_pipeS"} -local PIPEV = {"techage_gaspipe.png^[transformR90", "techage:ta4_pipeS"} -local PN000 = {"techage_gaspipe_knee.png", "techage:ta4_pipeS"} -- r -local PN090 = {"techage_gaspipe_knee.png^[transformR90", "techage:ta4_pipeS"} -- L -local PN180 = {"techage_gaspipe_knee.png^[transformR180", "techage:ta4_pipeS"} -- J -local PN270 = {"techage_gaspipe_knee.png^[transformR270", "techage:ta4_pipeS"} -- 7 - -plans["ta3_tank"] = { - {false, false, false, false, SIDEV, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false}, - {false, Tubes, PushR, Tubes, Fillr, Tubes, PushR, Tubes, false, false}, - {false, false, false, false, TANK3, PIPEH, PIPEH, Pump, PIPEH, false}, - {false, false, false, false, false, false, false, false, false, false}, -} - - --- --- TA3 Oil Loading station --- -local MCART = {minetest.inventorycube("carts_cart_top.png", - "carts_cart_side.png^minecart_logo.png", "carts_cart_side.png^minecart_logo.png"), - "minecart:cart"} -local PRAIL = {"carts_rail_straight_pwr.png", "carts:powerrail"} -local PRAIH = {"carts_rail_straight_pwr.png^[transformR90", "carts:powerrail"} -local TRAIL = {"carts_rail_t_junction.png^[transformR90", "carts:rail"} -local RAILH = {"carts_rail_straight.png^[transformR90", "carts:rail"} -local CRAIL = {"carts_rail_curved.png^[transformR90", "carts:rail"} -local BUFFR = {"default_junglewood.png^minecart_buffer.png", "minecart:buffer"} - -plans["ta3_loading"] = { - {false, false, PIPEH, Pump, PIPEH, PN270, SIDEV, false, false, false, false}, - {false, false, false, false, false, PIPEV, false, false, false, false, false}, - {false, MCART, false, false, false, PN090, TANK3, false, false, false, false}, - {false, HOPPR, CHEST, Tubes, PushR, Tubes, Fillr, PushR, Tubes, MCART, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, BUFFR, false, false, false, TOP_V, false, false, false, BUFFR, false}, - {false, PRAIL, false, false, false, false, false, false, false, PRAIL, false}, - {false, CRAIL, RAILH, PRAIH, RAILH, RAILH, PRAIH, RAILH, RAILH, TRAIL, RAILH}, -} - - --- --- Distiller --- -local DIST4 = {"techage_distiller_inv.png", "techage:ta3_distiller4"} -local DIST3 = {"techage_distiller_inv.png", "techage:ta3_distiller3"} -local DIST2 = {"techage_distiller_inv.png", "techage:ta3_distiller2"} -local DIST1 = {"techage_distiller_inv.png", "techage:ta3_distiller1"} -local DBASE = {"techage_concrete.png", "techage:ta3_distiller_base"} -local REBIO = {"techage_filling_ta3.png^techage_appl_reboiler.png^techage_frame_ta3.png", "techage:ta3_reboiler"} - -plans["ta3_distiller"] = { - {false, false, false, false, false, SIDEV, false, PN000, PIPEH, TANK3, false}, - {false, IMG31, false, false, false, false, false, DIST4, false, false, false}, - {false, false, false, false, false, false, false, DIST3, PIPEH, TANK3, false}, - {false, false, false, false, false, false, false, DIST2, false, false, false}, - {false, false, false, false, false, false, false, DIST3, PIPEH, TANK3, false}, - {false, false, false, false, false, false, false, DIST2, false, false, false}, - {false, false, false, false, false, false, false, DIST3, PIPEH, TANK3, false}, - {false, false, false, false, false, false, false, DIST2, false, false, false}, - {false, TANK3, PIPEH, Pump, PIPEH, REBIO, PIPEH, DIST1, false, false, false}, - {false, false, false, false, false, false, false, DBASE, PIPEH, TANK3, false}, -} - --- --- Chemical Reactor --- -local RBASE = {"techage_concrete.png", "techage:ta4_reactor_base"} -local STAND = {"techage_reactor_stand_side.png", "techage:ta4_reactor_stand"} -local REACT = {"techage_reactor_plan.png", "techage:ta4_reactor"} -local FILLR = {"techage_reactor_filler_plan.png", "techage:ta4_reactor_fillerpipe"} -local DOSER = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_pump_up.png", "techage:ta4_doser"} -local SILO4 = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_silo.png", "techage:ta4_silo"} -local TANK4 = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", "techage:ta4_tank"} - -plans["ta4_reactor"] = { - {false, false, false, false, false, false, SIDEV, false, false, false, false}, - {false, IMG43, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, PN000, PIPEH, PIPEH, PN270, false, false, false}, - {false, false, false, false, PIPEV, false, false, FILLR, false, false, false}, - {false, false, false, false, PIPEV, false, false, REACT, false, false, false}, - {false, false, false, false, PIPEV, false, false, STAND, PIPEH, PIPEH, SILO4}, - {false, TANK4, PIPEH, PIPEH, DOSER, PN270, false, RBASE, PIPEH, PIPEH, TANK4}, - {false, SILO4, PIPEH, PIPEH, PIPEH, PN180, false, false, false, false, false}, -} - --- --- Wind Turbine --- -local ROTOR = {"techage_wind_turbine_inv.png", "techage:ta4_wind_turbine"} -local NCLLE = {"techage_rotor.png", "techage:ta4_wind_turbine_nacelle"} -local PILLR = {"techage:pillar", "techage:pillar"} -local SLAMP = {"techage:rotor_signal_lamp_off", "techage:rotor_signal_lamp_off"} - -plans["ta4_windturbine"] = { - {false, false, false, SIDEV, false, false, false}, - {false, false, false, SLAMP, false, false, IMG_4, false}, - {false, false, false, ROTOR, NCLLE, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, - {false, false, false, PILLR, false, false, false}, -} - --- --- Thermal Storage System --- -local CONCR = {"basic_materials_concrete_block.png", "basic_materials:concrete_block"} -local HEXR1 = {"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png", "techage:heatexchanger3"} -local HEXR2 = {"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", "techage:heatexchanger2"} -local HEXR3 = {"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", "techage:heatexchanger1"} -local TURBN = {"techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta4.png", "techage:ta4_turbine"} -local GENER = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png^[transformFX]", "techage:ta4_generator"} -local GRAVL = {"default_gravel.png", "default:gravel"} -local INLET = {"basic_materials_concrete_block.png^techage_gaspipe.png^[transformR90", "techage:ta4_pipe_inlet"} -local OGLAS = {"default_obsidian_glass.png", "default:obsidian_glass"} - -plans["ta4_storagesystem"] = { - {false, false, TOP_V, false, false, false, false, SIDEV, false, IMG41, false}, - {false, false, PN000, PIPEH, PIPEH, PIPEH, PN270, false, false, false, false}, - {CONCR, CONCR, INLET, CONCR, CONCR, false, PIPEV, false, false, false, false}, - {CONCR, GRAVL, GRAVL, GRAVL, CONCR, false, PN090, HEXR1, PIPEH, PN270, false}, - {OGLAS, GRAVL, GRAVL, GRAVL, CONCR, false, false, HEXR2, false, PIPEV, false}, - {CONCR, GRAVL, GRAVL, GRAVL, CONCR, false, PN000, HEXR3, PIPEH, TURBN, GENER}, - {CONCR, CONCR, INLET, CONCR, CONCR, false, PIPEV, false, false, false, false}, - {false, false, PN090, PIPEH, PIPEH, PIPEH, PN180, false, false, false, false}, -} - --- --- Solar Plant --- - -local SOLAR = {"techage_solar_module_top.png", "techage:ta4_solar_module"} -local RCBLE = {"techage_ta4_cable_inv.png", "techage:ta4_power_cableS"} -local CARRI = {"techage:ta4_solar_carrier", "techage:ta4_solar_carrier"} -local INVAC = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inverter.png", "techage:ta4_solar_inverter"} - -plans["ta4_solarplant"] = { - {false, false, false, false, false, false, false, false, false, IMG42, false}, - {false, false, TOP_V, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, SOLAR, SOLAR, SOLAR}, - {false, CARRI, CARRI, CARRI, RCBLE, RCBLE, RCBLE, INVAC, Cable}, - {false, SOLAR, SOLAR, SOLAR}, -} - - --- --- Liquid Filter --- - -local LFSNK = {"basic_materials_concrete_block.png^techage_appl_arrow.png", "techage:ta4_liquid_filter_sink"} -local PWETR = {"basic_materials_concrete_block.png^techage_gaspipe.png", "techage:ta3_pipe_wall_entry"} -local TANK4 = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", "techage:ta4_tank"} -local LFFIL = {"basic_materials_concrete_block.png^techage_gaspipe_hole.png", "techage:ta4_liquid_filter_filler"} - -plans["ta4_liquid_filter_base"] = { - {false, false, false, false, false, false, false, false, IMG44, false}, - {false, false, false, TOP_V, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, - {false, CONCR, CONCR, LFSNK, PWETR, PWETR, PIPEH, PIPEH, TANK4}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, -} - -plans["ta4_liquid_filter_gravel"] = { - {false, false, false, false, false, false, false, false, IMG44, false}, - {false, false, false, TOP_V, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false}, - {false, CONCR, OGLAS, OGLAS, OGLAS, CONCR}, - {false, OGLAS, GRAVL, GRAVL, GRAVL, OGLAS}, - {false, OGLAS, GRAVL, GRAVL, GRAVL, OGLAS}, - {false, OGLAS, GRAVL, GRAVL, GRAVL, OGLAS}, - {false, CONCR, OGLAS, OGLAS, OGLAS, CONCR}, -} - -plans["ta4_liquid_filter_top"] = { - {false, false, false, false, false, false, false, false, IMG44, false}, - {false, false, false, TOP_V, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, - {false, CONCR, false, false, false, CONCR}, - {false, CONCR, false, LFFIL, false, CONCR}, - {false, CONCR, false, false, false, CONCR}, - {false, CONCR, CONCR, CONCR, CONCR, CONCR}, -} - --- --- TA4 Collider --- -local STEEL = {"default_steel_block.png", "techage:ta4_colliderblock"} -local COOL4 = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_cooler.png", "techage:ta4_collider_cooler"} - -plans["techage_collider_plan"] = { - {IMG45, false, false, false}, - {false, false, false, false}, - {false, false, false, false}, - {false, false, false, false}, - {false, false, false, false}, - {false, false, false, false}, -} - -plans["techage_collider_plan2"] = { - {false, false, false, false}, - {false, false, false, false}, - {false, false, IMG47, false}, - {false, false, false, false}, - {false, false, false, false}, - {false, false, false, false}, -} - --- --- TA4 Detector Cooler --- -local STEEL = {"default_steel_block.png", "techage:ta4_colliderblock"} -local COOL4 = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_cooler.png", "techage:ta4_collider_cooler"} - -plans["ta4_cooler"] = { - {false, false, false, SIDEV, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false}, - {false, STEEL, PIPEH, HEXR1, PIPEH, COOL4, PN270, false, false}, - {false, STEEL, false, HEXR2, false, false, PIPEV, false, false}, - {false, STEEL, PIPEH, HEXR3, PIPEH, PIPEH, PN180, false, false}, - {false, false, false, false, false, false, false, false, false}, -} - --- --- TA5 Teleport Blocks --- -local TELEP = {"techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", "techage:ta5_tele_pipe"} -local TELET = {"techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", "techage:ta5_tele_tube"} -local PUMP4 = {"techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta4.png", "techage:t4_pump"} -local ARROW = {"techage_form_arrow.png"} - -plans["ta5_teleport"] = { - {false, false, false, false, false, false, false, false, false, false, false}, - {false, CHEST, PushR, TELET, false, ARROW, false, TELET, Tubes, CHEST, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, CHEST, Tubes, TELET, false, ARROW, false, TELET, PushR, CHEST, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, TANK4, PUMP4, TELEP, false, ARROW, false, TELEP, PIPEH, TANK4, false}, -} - --- --- TA5 Fusion Reactor --- -local SHELL = {"techage_reactor_shell.png", "techage:ta5_fr_shell"} -local NUCLS = {"techage_reactor_shell.png^techage_collider_detector_core.png", "techage:ta5_fr_nucleus"} -local MAGN1 = {"techage_collider_magnet.png^techage_steel_tiles_top3.png", "techage:ta5_magnet1"} -local MAGN2 = {"techage_collider_magnet.png^techage_steel_tiles_top3.png^[transformR90]", "techage:ta5_magnet1"} -local MAGN3 = {"techage_collider_magnet.png^techage_steel_tiles_top3.png^[transformR180]", "techage:ta5_magnet1"} -local MAGN4 = {"techage_collider_magnet.png^techage_steel_tiles_top3.png^[transformR270]", "techage:ta5_magnet1"} - -plans["ta5_fusion_reactor"] = { - {false, false, false, false, false, false, IMG46, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false, false, false, false}, - {false, SECTV, false, false, false, false, false, false, false, false, false}, - {false, false, SHELL, SHELL, SHELL, false, SHELL, SHELL, SHELL, false, false}, - {false, SHELL, SHELL, MAGN3, SHELL, SHELL, SHELL, MAGN3, SHELL, SHELL, false}, - {false, SHELL, MAGN4, false, MAGN2, NUCLS, MAGN4, false, MAGN2, SHELL, false}, - {false, SHELL, SHELL, MAGN1, SHELL, SHELL, SHELL, MAGN1, SHELL, SHELL, false}, - {false, false, SHELL, SHELL, SHELL, false, SHELL, SHELL, SHELL, false, false}, -} - --- --- TA5 Heat Exchanger --- -local PIPEG = {"techage_ta5_gaspipe.png", "techage:ta5_pipe1S"} -local PIPEB = {"techage_ta5_gaspipeB.png", "techage:ta5_pipe2S"} -local HEX51 = {"techage_filling_ta4.png^techage_frameT_ta5.png^techage_appl_ribsT.png", "techage:ta5_heatexchanger3"} -local HEX52 = {"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", "techage:ta5_heatexchanger2"} -local HEX53 = {"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", "techage:ta5_heatexchanger1"} -local TURB5 = {"techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta5.png", "techage:ta5_turbine"} -local GENE5 = {"techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_generator.png^[transformFX]", "techage:ta5_generator"} - -plans["ta5_heatexchanger"] = { - {false, false, false, false, SIDEV, false, false, false}, - {false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false}, - {false, false, PIPEG, PIPEG, HEX51, PIPEH, PN270, false}, - {false, false, false, false, HEX52, false, PIPEV, false}, - {false, false, PIPEB, PIPEB, HEX53, PIPEH, TURB5, GENE5}, - {false, false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false, false}, -} - --- Bring into legacy format -local function reformat(plan) - for y=1,#plan do - for x=1,#plan[1] do - local item = plan[y][x] or false - if item ~= false then - local var1, var2 = item[1], item[2] - - if var1 == "top_view" then - plan[y][x] = {"text", var1} - elseif var1 == "side_view" then - plan[y][x] = {"text", var1} - elseif var1 == "sectional_view" then - plan[y][x] = {"text", var1} - elseif var1 == "" then - plan[y][x] = {"img", var2, "2.2,2.2"} - elseif var1 == "10x10" then - plan[y][x] = {"img", var2, "10,10"} - elseif var1 == "5x4" then - plan[y][x] = {"img", var2, "5,4"} - else - plan[y][x] = {"item", var1, var2} - end - end - end - end - return plan -end - -for name, plan in pairs(plans) do - local plan2 = reformat(plan) - doclib.add_manual_plan("techage", "EN", name, plan2) - doclib.add_manual_plan("techage", "DE", name, plan2) - doclib.add_manual_plan("techage", "RU", name, plan2) - doclib.add_manual_plan("techage", "pt-BR", name, plan2) -end diff --git a/techage/energy_storage/generator.lua b/techage/energy_storage/generator.lua deleted file mode 100644 index 10ab0a7..0000000 --- a/techage/energy_storage/generator.lua +++ /dev/null @@ -1,130 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 TES Generator (dummy) - - can be started and stopped - - provides netID of cable network -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -minetest.register_node("techage:ta4_generator", { - description = S("TA4 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png^[transformFX]", - }, - - after_place_node = function(pos) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Cable:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_generator_on", { - description = S("TA4 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", - { - name = "techage_filling4_ta4.png^techage_appl_generator4.png^techage_frame4_ta4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - { - name = "techage_filling4_ta4.png^techage_appl_generator4.png^[transformFX]^techage_frame4_ta4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - }, - - paramtype2 = "facedir", - drop = "", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - --- The generator is a dummy, it only has to network connection to check the netID -power.register_nodes({"techage:ta4_generator", "techage:ta4_generator_on"}, Cable, "con", {"R"}) - --- controlled by the turbine -techage.register_node({"techage:ta4_generator", "techage:ta4_generator_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "netID" then - local outdir = M(pos):get_int("outdir") - return networks.determine_netID(pos, Cable, outdir) - elseif topic == "start" then - swap_node(pos, "techage:ta4_generator_on") - elseif topic == "stop" then - swap_node(pos, "techage:ta4_generator") - end - end, - on_recv_message = function(pos, src, topic, payload) - return "unsupported" - end, - on_node_load = function(pos) - -- remove legacy formspec - M(pos):set_string("formspec", "") - end, -}) - -minetest.register_craft({ - output = "techage:ta4_generator", - recipe = { - {"", "dye:blue", ""}, - {"", "techage:generator", ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) diff --git a/techage/energy_storage/heatexchanger1.lua b/techage/energy_storage/heatexchanger1.lua deleted file mode 100644 index 6efc2bb..0000000 --- a/techage/energy_storage/heatexchanger1.lua +++ /dev/null @@ -1,101 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Heat Exchanger1 (bottom part) - - has a connection to storage and turbine (via pipes) - - acts as a cable junction for Exchanger2 -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local Pipe = techage.LiquidPipe -local power = networks.power - -local function turbine_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, Pipe, - {"techage:ta4_turbine", "techage:ta4_turbine_on", "techage:ta4_collider_cooler"}) -end - -local function inlet_cmnd(pos, topic, payload) - return techage.transfer(pos, "L", topic, payload, Pipe, - {"techage:ta4_pipe_inlet", "techage:ta4_collider_pipe_inlet"}) -end - -minetest.register_node("techage:heatexchanger1", { - description = S("TA4 Heat Exchanger 1"), - tiles = { - -- up, down, right, left, back, front - "techage_hole_ta4.png^techage_appl_arrow_white.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - Cable:after_place_node(pos) - Pipe:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, outdir, tlib2, node) - if tlib2 == Cable then - power.update_network(pos, 0, tlib2, node) - end - end, - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - pos.y = pos.y + 1 - return minetest.get_node(pos).name ~= "techage:heatexchanger2" - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - Pipe:after_dig_node(pos) - end, - networks = {}, - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:heatexchanger1"}) -Pipe:set_valid_sides("techage:heatexchanger1", {"R", "L"}) - -power.register_nodes({"techage:heatexchanger1"}, Cable, "junc", {"F", "B", "U"}) - --- command interface -techage.register_node({"techage:heatexchanger1"}, { - on_transfer = function(pos, indir, topic, payload) - local nvm = techage.get_nvm(pos) - -- used by heatexchanger2 - if topic == "diameter" or topic == "volume" or topic == "window" or topic == "detector" then - return inlet_cmnd(pos, topic, payload) - else - return turbine_cmnd(pos, topic, payload) - end - end, -}) - -minetest.register_craft({ - output = "techage:heatexchanger1", - recipe = { - {"default:tin_ingot", "techage:electric_cableS", "default:steel_ingot"}, - {"techage:ta4_pipeS", "basic_materials:gear_steel", "techage:ta4_pipeS"}, - {"", "techage:baborium_ingot", ""}, - }, -}) diff --git a/techage/energy_storage/heatexchanger2.lua b/techage/energy_storage/heatexchanger2.lua deleted file mode 100644 index cfa854e..0000000 --- a/techage/energy_storage/heatexchanger2.lua +++ /dev/null @@ -1,436 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Heat Exchanger2 (middle part) - (alternatively used as cooler for the TA4 collider) - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local Pipe = techage.LiquidPipe -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local GRVL_CAPA = 500 -local PWR_CAPA = { - [5] = GRVL_CAPA * 3 * 3 * 3, -- 13500 Cyc = 450 min = 22.5 kud - [7] = GRVL_CAPA * 5 * 5 * 5, -- 104 kud - [9] = GRVL_CAPA * 7 * 7 * 7, -- 286 kuh - [11] = GRVL_CAPA * 9 * 9 * 9, -- 610 kuh - [13] = GRVL_CAPA * 11 * 11 * 11, -- 1112 kuh -} -local DOWN = 5 -local PWR_NEEDED = 5 - -local function heatexchanger1_cmnd(pos, topic, payload) - return techage.transfer({x = pos.x, y = pos.y - 1, z = pos.z}, - nil, topic, payload, nil, - {"techage:heatexchanger1"}) -end - -local function heatexchanger3_cmnd(pos, topic, payload) - return techage.transfer({x = pos.x, y = pos.y + 1, z = pos.z}, - nil, topic, payload, nil, - {"techage:heatexchanger3"}) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_booster", { - pos = pos, - gain = 0.3, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function cooler_formspec(self, pos, nvm) - return "size[4,2]".. - "box[0,-0.1;3.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("TA4 Heat Exchanger")) .. "]" .. - "image_button[1.5,1;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[1.5,1;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local function can_start(pos, nvm) - -- Used as cooler for the collider? - if heatexchanger1_cmnd(pos, "detector") then - if power.power_available(pos, Cable, DOWN) then - nvm.used_as_cooler = true - return true - else - return S("No power") - end - end - -- Used as heat exchanger - local netID = networks.determine_netID(pos, Cable, DOWN) - if heatexchanger1_cmnd(pos, "netID") ~= netID then - return S("Power network connection error") - end - local diameter = heatexchanger1_cmnd(pos, "diameter") - if diameter then - nvm.capa_max = PWR_CAPA[tonumber(diameter)] or 0 - if nvm.capa_max ~= 0 then - nvm.capa = math.min(nvm.capa or 0, nvm.capa_max) - local owner = M(pos):get_string("owner") or "" - return heatexchanger1_cmnd(pos, "volume", owner) - else - return S("wrong storage diameter") .. ": " .. diameter - end - else - return S("inlet/pipe error") - end - return S("did you check the plan?") -end - -local function start_node(pos, nvm) - if nvm.used_as_cooler then - play_sound(pos) - else - nvm.win_pos = heatexchanger1_cmnd(pos, "window") - power.start_storage_calc(pos, Cable, DOWN) - play_sound(pos) - heatexchanger1_cmnd(pos, "start") - end -end - -local function stop_node(pos, nvm) - if nvm.used_as_cooler then - stop_sound(pos) - else - power.start_storage_calc(pos, Cable, DOWN) - stop_sound(pos) - heatexchanger1_cmnd(pos, "stop") - end -end - -local function formspec(self, pos, nvm) - local data - - if nvm.used_as_cooler then - return cooler_formspec(self, pos, nvm) - end - if techage.is_running(nvm) then - data = power.get_network_data(pos, Cable, DOWN) - end - return techage.storage_formspec(self, pos, nvm, S("TA4 Heat Exchanger"), data, nvm.capa, nvm.capa_max) -end - -local function glowing(pos, nvm, should_glow) - if nvm.win_pos then - if should_glow then - swap_node(nvm.win_pos, "techage:glow_gravel") - else - swap_node(nvm.win_pos, "default:gravel") - end - end -end - -local function check_TES_integrity(pos, nvm) - nvm.ticks = (nvm.ticks or 0) + 1 - if (nvm.ticks % 5) == 0 then -- every 10 sec - if techage.is_running(nvm) then - glowing(pos, nvm, (nvm.capa or 0) / (nvm.capa_max or 1) > 0.8) - end - end - if (nvm.ticks % 30) == 0 then -- every minute - return heatexchanger1_cmnd(pos, "volume") - elseif (nvm.ticks % 30) == 10 then -- every minute - return heatexchanger1_cmnd(pos, "diameter") ~= nil or S("inlet/pipe error") - elseif (nvm.ticks % 30) == 20 then -- every minute - return heatexchanger3_cmnd(pos, "diameter") ~= nil or S("inlet/pipe error") - end - local netID = networks.determine_netID(pos, Cable, DOWN) - if heatexchanger1_cmnd(pos, "netID") ~= netID then - if nvm.check_once_again then - nvm.check_once_again = false - return true - else - return S("Power network connection error") - end - end - nvm.check_once_again = true - return true -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:heatexchanger2", - cycle_time = CYCLE_TIME, - infotext_name = S("TA4 Heat Exchanger"), - standby_ticks = 0, - can_start = can_start, - start_node = start_node, - stop_node = stop_node, - formspec_func = formspec, -}) - -local function cooler_timer(pos, nvm) - local err = false - if power.consume_power(pos, Cable, DOWN, PWR_NEEDED) ~= PWR_NEEDED then - State:fault(pos, nvm, "No power") - stop_sound(pos) - return true - end - - -- Cyclically check pipe connections - nvm.ticks = (nvm.ticks or 0) + 1 - if (nvm.ticks % 5) == 0 then -- every 10 s - err = heatexchanger1_cmnd(pos, "detector") ~= true - elseif (nvm.ticks % 5) == 1 then -- every 10 s - err = heatexchanger3_cmnd(pos, "detector") ~= true - elseif (nvm.ticks % 5) == 2 then -- every 10 s - err = heatexchanger1_cmnd(pos, "cooler") ~= true - elseif (nvm.ticks % 5) == 3 then -- every 10 s - err = heatexchanger3_cmnd(pos, "cooler") ~= true - end - if err then - State:fault(pos, nvm, "Pipe connection error") - stop_sound(pos) - end - return true -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.used_as_cooler then - cooler_timer(pos, nvm) - return true - end - local res = check_TES_integrity(pos, nvm) - if res ~= true then - State:fault(pos, nvm, res) - heatexchanger1_cmnd(pos, "stop") - power.start_storage_calc(pos, Cable, DOWN) - end - - if techage.is_running(nvm) then - local capa = power.get_storage_load(pos, Cable, DOWN, nvm.capa_max) or 0 - if capa > 0 then - nvm.capa = capa - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return true -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - return not techage.is_running(nvm) -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos, placer) - if techage.orientate_node(pos, "techage:heatexchanger1") then - return true - end - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local own_num = techage.add_node(pos, "techage:heatexchanger1") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA4 Heat Exchanger")..": "..own_num) - meta:set_string("formspec", formspec(State, pos, nvm)) - Cable:after_place_node(pos, {DOWN}) - State:node_init(pos, nvm, own_num) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_storage_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - nvm.capa_max = nvm.capa_max or 1 - if techage.is_running(nvm) then - return {level = (nvm.capa or 0) / nvm.capa_max, capa = nvm.capa_max} - end -end - --- Middle node with the formspec from the bottom node -minetest.register_node("techage:heatexchanger2", { - description = S("TA4 Heat Exchanger 2"), - tiles = { - -- up, down, right, left, back, front - "techage_hole_ta4.png", - "techage_hole_ta4.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_tes_turb.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_tes_core.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", - }, - - selection_box = { - type = "fixed", - fixed = {-1/2, -1.5/2, -1/2, 1/2, 1/2, 1/2}, - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - can_dig = can_dig, - after_dig_node = after_dig_node, - get_storage_data = get_storage_data, - - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -power.register_nodes({"techage:heatexchanger2"}, Cable, "sto", {"D"}) - -techage.register_node({"techage:heatexchanger2"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - if techage.is_running(nvm) then - return "running" - else - return "stopped" - end - elseif topic == "delivered" then - local data = power.get_network_data(pos, Cable, DOWN) - return data.consumed - data.provided - elseif topic == "load" then - return techage.power.percent(nvm.capa_max, nvm.capa) - elseif topic == "on" then - State:start(pos, nvm) - return true - elseif topic == "off" then - State:stop(pos, nvm) - return true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 1 and payload[1] == 1 then - State:start(pos, nvm) - return 0 - elseif topic == 1 and payload[1] == 0 then - State:stop(pos, nvm) - return 0 - else - return 2, "" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then -- State - if techage.is_running(nvm) then - return 0, {techage.RUNNING} - else - return 0, {techage.STOPPED} - end - elseif topic == 135 then -- Delivered Power - local data = power.get_network_data(pos, Cable, DOWN) - return 0, {data.consumed - data.provided} - elseif topic == 134 then -- Tank Load Percent - local value = techage.power.percent(nvm.capa_max, nvm.capa) - return 0, {math.floor(value + 0.5)} - else - return 2, "" - end - end, - on_node_load = function(pos, node) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - play_sound(pos) - else - stop_sound(pos) - end - -- Attempt to restart the system as the heat exchanger goes into error state - -- when parts of the storage block are unloaded. - if nvm.techage_state == techage.FAULT then - start_node(pos, nvm) - end - end, -}) - -control.register_nodes({"techage:heatexchanger2"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - return { - type = S("TA4 Heat Exchanger"), - number = M(pos):get_string("node_number") or "", - running = techage.is_running(nvm) or false, - capa = nvm.capa_max or 1, - load = nvm.capa or 0, - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:heatexchanger2", - recipe = { - {"default:tin_ingot", "", "default:steel_ingot"}, - {"", "techage:ta4_wlanchip", ""}, - {"", "techage:baborium_ingot", ""}, - }, -}) diff --git a/techage/energy_storage/heatexchanger3.lua b/techage/energy_storage/heatexchanger3.lua deleted file mode 100644 index 9c5c2e5..0000000 --- a/techage/energy_storage/heatexchanger3.lua +++ /dev/null @@ -1,102 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Heat Exchanger3 (top part) - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe - -local function orientate_node(pos, name) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node.name == name then - local param2 = node.param2 - node = minetest.get_node(pos) - node.param2 = param2 - minetest.swap_node(pos, node) - else - minetest.remove_node(pos) - return true - end -end - -local function after_place_node(pos) - if orientate_node(pos, "techage:heatexchanger2") then - return true - end - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) -end - -local function cooler_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, Pipe, - {"techage:ta4_collider_cooler"}) -end - -local function inlet_cmnd(pos, topic, payload) - return techage.transfer(pos, "L", topic, payload, Pipe, - {"techage:ta4_pipe_inlet", "techage:ta4_collider_pipe_inlet"}) -end - -minetest.register_node("techage:heatexchanger3", { - description = S("TA4 Heat Exchanger 3"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_hole_ta4.png", - "techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png", - "techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:heatexchanger3"}) - --- command interface, used by heatexchanger2 -techage.register_node({"techage:heatexchanger3"}, { - on_transfer = function(pos, indir, topic, payload) - if topic == "cooler" then - return cooler_cmnd(pos, topic, payload) - else - return inlet_cmnd(pos, topic, payload) - end - end, -}) - -minetest.register_craft({ - output = "techage:heatexchanger3", - recipe = { - {"default:tin_ingot", "dye:blue", "default:steel_ingot"}, - {"techage:ta4_pipeS", "basic_materials:gear_steel", "techage:ta4_pipeS"}, - {"", "techage:baborium_ingot", ""}, - }, -}) - -techage.orientate_node = orientate_node diff --git a/techage/energy_storage/inlet.lua b/techage/energy_storage/inlet.lua deleted file mode 100644 index e5dc23d..0000000 --- a/techage/energy_storage/inlet.lua +++ /dev/null @@ -1,196 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Pipe Inlet - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe - -local function after_place_node(pos, placer, itemstack) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) -end - -minetest.register_node("techage:ta4_pipe_inlet", { - description = S("TA4 Pipe Inlet"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_tes_inlet.png", - "basic_materials_concrete_block.png^techage_tes_inlet.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - groups = {crumbly = 2, cracky = 2, snappy = 2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:ta4_pipe_inlet"}) - -local Numbers = { - shell = { - [2] = 96, -- 5x5x2 + 3x5x2 + 3x3x2 - 2 - [3] = 216, -- 7x7x2 + 5x7x2 + 5x5x2 - 2 - [4] = 384, -- 9x9x2 + 7x9x2 + 7x7x2 - 2 - [5] = 600, -- 11x11x2 + 9x11x2 + 9x9x2 - 2 - [6] = 864, -- 13x13x2 + 11x13x2 + 11x11x2 - 2 - }, - filling = { - [2] = 27, -- 3x3x3 - [3] = 125, -- 5x5x5 - [4] = 343, -- 7x7x7 - [5] = 729, -- 9x9x9 - [6] = 1331, -- 11x11x11 - } -} - -local function get_diameter(pos, in_dir) - local dir = tubelib2.Dir6dToVector[in_dir] - local pos2, node - - pos2 = vector.add(pos, vector.multiply(dir, 4)) - node = minetest.get_node(pos2) - if node.name == "techage:ta3_pipe_wall_entry" then - return - end - if node.name == "techage:ta4_pipe_inlet" then - return 5 - end - - pos2 = vector.add(pos, vector.multiply(dir, 6)) - node = minetest.get_node(pos2) - if node.name == "techage:ta3_pipe_wall_entry" then - return - end - if node.name == "techage:ta4_pipe_inlet" then - return 7 - end - - pos2 = vector.add(pos, vector.multiply(dir, 8)) - node = minetest.get_node(pos2) - if node.name == "techage:ta3_pipe_wall_entry" then - return - end - if node.name == "techage:ta4_pipe_inlet" then - return 9 - end - - pos2 = vector.add(pos, vector.multiply(dir, 10)) - node = minetest.get_node(pos2) - if node.name == "techage:ta3_pipe_wall_entry" then - return - end - if node.name == "techage:ta4_pipe_inlet" then - return 11 - end - - pos2 = vector.add(pos, vector.multiply(dir, 12)) - node = minetest.get_node(pos2) - if node.name == "techage:ta3_pipe_wall_entry" then - return - end - if node.name == "techage:ta4_pipe_inlet" then - return 13 - end - - pos2 = vector.add(pos, vector.multiply(dir, 14)) - local poses = minetest.find_nodes_in_area(pos, pos2, {"techage:ta4_pipe_inlet"}) - if #poses > 1 then - return vector.distance(pos, poses[2]) + 1 - end -end - -local function check_volume(pos, in_dir, owner) - local diameter = get_diameter(pos, in_dir) - if diameter then - local radius = (diameter - 1) / 2 - local dir = tubelib2.Dir6dToVector[in_dir] - local cpos = vector.add(pos, vector.multiply(dir, radius)) - -- calculate size - local pos1 = {x = cpos.x - radius, y = cpos.y - radius, z = cpos.z - radius} - local pos2 = {x = cpos.x + radius, y = cpos.y + radius, z = cpos.z + radius} - local _, node_tbl = minetest.find_nodes_in_area(pos1, pos2, - {"default:gravel", "techage:ta4_pipe_inlet", - "basic_materials:concrete_block", "default:obsidian_glass", - "techage:glow_gravel"}) - if node_tbl["default:obsidian_glass"] > 1 then - return S("one window maximum") - elseif node_tbl["default:obsidian_glass"] + node_tbl["basic_materials:concrete_block"] ~= Numbers.shell[radius] then - return S("wrong number of shell nodes") - elseif node_tbl["default:gravel"] + node_tbl["techage:glow_gravel"] ~= Numbers.filling[radius] then - return S("wrong number of gravel nodes") - end - else - return S("wrong diameter (should be 5, 7, or 9)") - end - return true -end - --- provide position behind the obsidian_glass -local function check_window(pos, in_dir) - local diameter = get_diameter(pos, in_dir) - if diameter then - local radius = (diameter - 1) / 2 - local dir = tubelib2.Dir6dToVector[in_dir] - local cpos = vector.add(pos, vector.multiply(dir, radius)) - -- calculate size - local pos1 = {x = cpos.x - radius, y = cpos.y - radius, z = cpos.z - radius} - local pos2 = {x = cpos.x + radius, y = cpos.y + radius, z = cpos.z + radius} - local poses,_ = minetest.find_nodes_in_area(pos1, pos2, {"default:obsidian_glass"}) - if #poses == 1 then - local ndir = vector.direction(poses[1], cpos) - ndir = vector.normalize(ndir) - local npos = vector.add(poses[1], ndir) - return npos - end - end -end - --- for logical communication -techage.register_node({"techage:ta4_pipe_inlet"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "diameter" then - return get_diameter(pos, in_dir) - elseif topic == "volume" then - return check_volume(pos, in_dir, payload) - elseif topic == "window" then - return check_window(pos, in_dir) - end - return false - end -}) - -minetest.register_craft({ - type = 'shapeless', - output = "techage:ta4_pipe_inlet", - recipe = {"basic_materials:concrete_block", "techage:ta4_pipeS"}, -}) diff --git a/techage/energy_storage/nodes.lua b/techage/energy_storage/nodes.lua deleted file mode 100644 index 6e48972..0000000 --- a/techage/energy_storage/nodes.lua +++ /dev/null @@ -1,36 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Nodes - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -minetest.register_node("techage:glow_gravel", { - description = S("TechAge Gravel"), - tiles = {{ - name = "techage_gravel4.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 0.2, - }, - }}, - paramtype = "light", - light_source = 8, - groups = {crumbly = 2, falling_node = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_gravel_defaults(), - drop = "", -}) diff --git a/techage/energy_storage/turbine.lua b/techage/energy_storage/turbine.lua deleted file mode 100644 index 3de46e7..0000000 --- a/techage/energy_storage/turbine.lua +++ /dev/null @@ -1,165 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 TES Gas Turbine - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe - -local function generator_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, nil, - {"techage:ta4_generator", "techage:ta4_generator_on"}) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_turbine", { - pos = pos, - gain = 0.4, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -minetest.register_node("techage:ta4_turbine", { - description = S("TA4 Turbine"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta4.png^[transformFX", - "techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta4.png", - }, - - after_place_node = function(pos) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - stop_sound(pos) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_turbine_on", { - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - { - name = "techage_filling4_ta4.png^techage_appl_turbine4.png^techage_frame4_ta4.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta4.png^techage_appl_turbine4.png^techage_frame4_ta4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - - tubelib2_on_update2 = function(pos, outdir, tlib2, node) - swap_node(pos, "techage:ta4_turbine") - stop_sound(pos) - generator_cmnd(pos, "stop") - end, - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:ta4_turbine", "techage:ta4_turbine_on"}) -Pipe:set_valid_sides("techage:ta4_turbine", {"L", "U"}) -Pipe:set_valid_sides("techage:ta4_turbine_on", {"L", "U"}) - -techage.register_node({"techage:ta4_turbine", "techage:ta4_turbine_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "start" then -- used by heatexchanger1 - swap_node(pos, "techage:ta4_turbine_on") - play_sound(pos) - return generator_cmnd(pos, topic, payload) - elseif topic == "stop" then -- used by heatexchanger1 - swap_node(pos, "techage:ta4_turbine") - stop_sound(pos) - return generator_cmnd(pos, topic, payload) - else -- used by heatexchanger1 - return generator_cmnd(pos, topic, payload) - end - end, - on_node_load = function(pos, node) - if node.name == "techage:ta4_turbine_on" then - play_sound(pos) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_turbine", - recipe = { - {"", "dye:blue", ""}, - {"", "techage:turbine", ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) diff --git a/techage/fermenter/gasflare.lua b/techage/fermenter/gasflare.lua deleted file mode 100644 index c11b38d..0000000 --- a/techage/fermenter/gasflare.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Biogas flare - -]]-- - - -local HEIGHT = 7 - -local function remove_flame(pos) - local idx - for idx=HEIGHT,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - local node = minetest.get_node(pos) - if string.find(node.name, "techage:flame") then - minetest.remove_node(pos) - end - end -end - -local function flame(pos) - local idx - for idx=HEIGHT,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - idx = math.min(idx, 12) - local node = minetest.get_node(pos) - if node.name ~= "air" then - return - end - minetest.add_node(pos, {name = "techage:flame"..math.min(idx,7)}) - local meta = minetest.get_meta(pos) - end -end - - -local lRatio = {120, 110, 95, 75, 55, 28, 0} -local lColor = {"000080", "400040", "800000", "800000", "800000", "800000", "800000"} -for idx,ratio in ipairs(lRatio) do - local color = "techage_flame_animated.png^[colorize:#"..lColor[idx].."B0:"..ratio - minetest.register_node("techage:flame"..idx, { - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/8, -4/8, -2/8, 3/8, 4/8, 2/8}, - {-2/8, -4/8, -3/8, 2/8, 4/8, 3/8}, - }, - }, - tiles = { - { - name = color, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 1 - }, - }, - }, - - after_destruct = function(pos, oldnode) - pos.y = pos.y + 1 - local node = minetest.get_node(pos) - if minetest.get_item_group(node.name, "techage_flame") > 0 then - minetest.remove_node(pos) - end - end, - - use_texture_alpha = techage.BLEND, - inventory_image = "techage_flame.png", - paramtype = "light", - light_source = 13, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - damage_per_second = 4 + idx, - groups = {igniter = 2, dig_immediate = 3, techage_flame=1, not_in_creative_inventory=1}, - drop = "", - }) -end - -local function start_flarestack(pos, playername) - if minetest.is_protected( - {x=pos.x, y=pos.y+1, z=pos.z}, - playername) then - return - end - local meta = minetest.get_meta(pos) - flame({x=pos.x, y=pos.y+1, z=pos.z}) - local handle = minetest.sound_play("gasflare", { - pos = pos, - max_hear_distance = 20, - gain = 1, - loop = true}) - --print("handle", handle) - meta:set_int("handle", handle) -end - -local function stop_flarestack(pos, handle) - remove_flame({x=pos.x, y=pos.y+1, z=pos.z}) - minetest.sound_stop(handle) -end - -minetest.register_node("techage:gasflare", { - description = "gas flare", - tiles = { - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png^techage_appl_hole2.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local node = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) - if node.name ~= "air" then - return - end - minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "techage:gasflare2"}) - end, - - on_punch = function(pos, node, puncher) - local meta = minetest.get_meta(pos) - local handle = meta:get_int("handle") - minetest.sound_stop(handle) - start_flarestack(pos, puncher:get_player_name()) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - --print(dump(oldmetadata)) - stop_flarestack(pos, oldmetadata.fields.handle) - local node = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) - if node.name == "techage:gasflare2" then - minetest.remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:gasflare2", { - description = "", - tiles = { - "techage_gasflare.png^techage_appl_hole2.png", - "techage_gasflare.png" - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -4/8, -1/8, 1/8, 4/8, 1/8}, - {-4/8, 3/8, -4/8, 4/8, 4/8, 4/8}, - }, - }, - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - diggable = false, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) diff --git a/techage/furnace/booster.lua b/techage/furnace/booster.lua deleted file mode 100644 index 87b1736..0000000 --- a/techage/furnace/booster.lua +++ /dev/null @@ -1,199 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Booster - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local PWR_NEEDED = 3 -local CYCLE_TIME = 2 - -local Cable = techage.ElectricCable -local power = networks.power - -local function infotext(pos, state) - M(pos):set_string("infotext", S("TA3 Booster")..": "..state) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_booster", { - pos = pos, - gain = 1, - max_hear_distance = 7, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - Cable:after_place_node(pos) - local node = minetest.get_node(pos) - local indir = techage.side_to_indir("R", node.param2) - M(pos):set_int("indir", indir) - infotext(pos, "stopped") -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:ta3_booster", { - description = S("TA3 Booster"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_appl_arrow.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_compressor.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_compressor.png^[transformFX^techage_frame_ta3.png", - }, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - swap_node(pos, "techage:ta3_booster_on") - infotext(pos, "running") - play_sound(pos) - end - return true - end, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_booster_on", { - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_appl_arrow.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - { - name = "techage_filling4_ta3.png^techage_appl_compressor4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.2, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_compressor4.png^[transformFX]^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.2, - }, - }, - }, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - swap_node(pos, "techage:ta3_booster") - infotext(pos, "no power") - stop_sound(pos) - end - return true - end, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:ta3_booster", "techage:ta3_booster_on"}, Cable, "con", {"B", "F", "L", "D", "U"}) - --- for intra machine communication -techage.register_node({"techage:ta3_booster", "techage:ta3_booster_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - if M(pos):get_int("indir") == in_dir then - local nvm = techage.get_nvm(pos) - if topic == "power" then - return techage.get_node_lvm(pos).name == "techage:ta3_booster_on" or - power.power_available(pos, Cable) - elseif topic == "running" then - return techage.get_node_lvm(pos).name == "techage:ta3_booster_on" - elseif topic == "start" and not nvm.running then - if power.power_available(pos, Cable) then - nvm.running = true - minetest.get_node_timer(pos):start(CYCLE_TIME) - swap_node(pos, "techage:ta3_booster_on") - infotext(pos, "running") - play_sound(pos) - else - infotext(pos, "no power") - end - elseif topic == "stop" then - nvm.running = false - swap_node(pos, "techage:ta3_booster") - minetest.get_node_timer(pos):stop() - infotext(pos, "stopped") - stop_sound(pos) - end - end - end, - on_node_load = function(pos, node) - if node.name == "techage:ta3_booster_on" then - play_sound(pos) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta3_booster", - recipe = { - {"basic_materials:steel_bar", "default:wood", "basic_materials:steel_bar"}, - {"", "basic_materials:gear_steel", ""}, - {"basic_materials:steel_bar", "default:wood", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/furnace/cooking.lua b/techage/furnace/cooking.lua deleted file mode 100644 index 54304c4..0000000 --- a/techage/furnace/cooking.lua +++ /dev/null @@ -1,228 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Cooking routines for furnace - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local range = techage.in_range - -local Recipes = {} -- registered recipes {output = {recipe, ...},} -local Ingredients = {} -- {{input = output}, -local KeyList = {} -- index to Recipes key translation - -techage.furnace = {} - - -local function all_ingredients_available(output, ingr) - if Recipes[output] then - for idx,recipe in ipairs(Recipes[output]) do - local not_in_list = false - for _,item in ipairs(recipe.input) do - if not techage.in_list(ingr, item) then - not_in_list = true - end - end - if not_in_list == false then - return idx -- list number of the recipe - end - end - end -end - --- Return a list with all outputs of the given list of ingredients -local function get_recipes(ingr) - if #ingr > 0 then - local tbl = {} - for _,item in ipairs(ingr) do - if Ingredients[item] then - for _,output in ipairs(Ingredients[item]) do - if all_ingredients_available(output, ingr) then - techage.add_to_set(tbl, output) - end - end - end - end - return tbl - else - return KeyList - end -end - -function techage.furnace.get_ingredients(pos) - local inv = M(pos):get_inventory() - local tbl = {} - for _,stack in ipairs(inv:get_list('src')) do - if stack:get_name() ~= "" then - tbl[#tbl+1] = stack:get_name() - end - end - return tbl -end - -local function remove_item_from_list(list, item) - for _,stack in ipairs(list) do - if stack:get_name() == item then - stack:set_count(stack:get_count() - 1) - return true - end - end - return false -end - --- move recipe src items to output inventory -local function process(inv, recipe, output) - -- check dst inv - local stack = ItemStack(output) - stack:set_count(recipe.number) - if not inv:room_for_item("dst", stack) then - return techage.BLOCKED - end - -- handle waste - if recipe.waste then - if not inv:room_for_item("dst", ItemStack(recipe.waste)) then - return techage.BLOCKED - end - end - -- remove items - local list = inv:get_list("src") - for _,item in ipairs(recipe.input) do - if not remove_item_from_list(list, item) then - return techage.STANDBY - end - end - -- store changes on scr - inv:set_list("src", list) - -- add output to dst - inv:add_item("dst", stack) - -- add waste to dst - if recipe.waste then - local leftover = inv:add_item("dst", ItemStack(recipe.waste)) - if leftover:get_count() > 0 then - inv:add_item("src", leftover) - return techage.BLOCKED - end - end - return techage.RUNNING -end - -function techage.furnace.check_if_worth_to_wakeup(pos, nvm) - local inv = M(pos):get_inventory() - if not nvm.output or not nvm.num_recipe then - return false - end - local recipe = Recipes[nvm.output] and Recipes[nvm.output][nvm.num_recipe] - if not recipe then - return false - end - -- check dst inv - local stack = ItemStack(nvm.output) - stack:set_count(recipe.number) - if not inv:room_for_item("dst", stack) then - return false - end - -- check src inv - local list = inv:get_list("src") - for _,item in ipairs(recipe.input) do - if not remove_item_from_list(list, item) then - return false - end - end - return true -end - -function techage.furnace.smelting(pos, nvm, elapsed) - local inv = M(pos):get_inventory() - local state = techage.RUNNING - if inv and not inv:is_empty("src") then - if not nvm.output or not nvm.num_recipe then - return techage.FAULT, "recipe error" - end - local recipe = Recipes[nvm.output] and Recipes[nvm.output][nvm.num_recipe] - if not recipe then - return techage.FAULT, "recipe error" - end - - elapsed = elapsed + (nvm.leftover or 0) - while elapsed >= recipe.time do - state = process(inv, recipe, nvm.output) - if state ~= techage.RUNNING then - return state - end - elapsed = elapsed - recipe.time - end - nvm.leftover = elapsed - if recipe.time >= 10 then - nvm.item_percent = math.min(math.floor((nvm.leftover * 100.0) / recipe.time), 100) - else - nvm.item_percent = 100 - end - return state - end - return techage.STANDBY -end - -function techage.furnace.get_output(nvm, ingr, idx) - local tbl = get_recipes(ingr) - idx = range(idx, 1, #tbl) - nvm.output = tbl[idx] or tbl[1] - nvm.num_recipe = all_ingredients_available(nvm.output, ingr) - return nvm.output -end - -function techage.furnace.get_num_recipes(ingr) - return #get_recipes(ingr) -end - -function techage.furnace.reset_cooking(nvm) - nvm.leftover = 0 - nvm.item_percent = 0 -end - - -techage.recipes.register_craft_type("ta3_melting", { - description = S("TA3 Melting"), - icon = "techage_concrete.png^techage_appl_furnace.png^techage_frame_ta3.png", - width = 2, - height = 2, -}) - -function techage.furnace.register_recipe(recipe) - local words = string.split(recipe.output, " ") - local output = words[1] - local number = tonumber(words[2] or 1) - table.insert(KeyList, output) - --print(recipe.output, dump(recipe.recipe)) - if not Recipes[output] then - Recipes[output] = {} - end - table.insert(Recipes[output], { - input = recipe.recipe, - waste = recipe.waste, - number = number, - time = math.max((recipe.time or 3) * number, 2), - }) - for _,item in ipairs(recipe.recipe) do - if Ingredients[item] then - techage.add_to_set(Ingredients[item], output) - else - Ingredients[item] = {output} - end - end - - recipe.items = recipe.recipe - recipe.type = "ta3_melting" - techage.recipes.register_craft(recipe) -end diff --git a/techage/furnace/firebox.lua b/techage/furnace/firebox.lua deleted file mode 100644 index 608df67..0000000 --- a/techage/furnace/firebox.lua +++ /dev/null @@ -1,226 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Industrial Furnace Firebox - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local firebox = techage.firebox -local fuel = techage.fuel -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local CYCLE_TIME = 2 -local EFFICIENCY = 2 -- burn cycles -local CATEGORY = 3 - -local function has_fuel(pos, nvm) - return (nvm.burn_cycles or 0) > 0 or (nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0) -end - -local function stop_firebox(pos, nvm) - nvm.running = false - firebox.swap_node(pos, "techage:furnace_firebox") - minetest.get_node_timer(pos):stop() - M(pos):set_string("formspec", fuel.formspec(nvm)) -end - -local function furnace_active(pos) - -- Check if furnace is not in standby mode - return techage.get_node_lvm({x=pos.x, y=pos.y+1, z=pos.z}).name == "techage:ta3_furnace_act" -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - if nvm.running and furnace_active(pos) then - nvm.burn_cycles = (nvm.burn_cycles or 0) - 1 - if nvm.burn_cycles <= 0 then - if nvm.liquid.amount > 0 then - nvm.liquid.amount = nvm.liquid.amount - 1 - nvm.burn_cycles = fuel.burntime(nvm.liquid.name) * EFFICIENCY / CYCLE_TIME - nvm.burn_cycles_total = nvm.burn_cycles - else - nvm.liquid.name = nil - stop_firebox(pos, nvm) - return false - end - end - else - stop_firebox(pos, nvm) - return false - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", fuel.formspec(nvm)) - end - return true -end - -local function start_firebox(pos, nvm) - - if not nvm.running and furnace_active(pos) then - nvm.running = true - node_timer(pos, 0) - firebox.swap_node(pos, "techage:furnace_firebox_on") - minetest.get_node_timer(pos):start(CYCLE_TIME) - M(pos):set_string("formspec", fuel.formspec(nvm)) - end -end - -local function booster_cmnd(pos, cmnd) - return techage.transfer( - pos, - "L", -- outdir - cmnd, -- topic - nil, -- payload - nil, -- network - {"techage:ta3_booster", "techage:ta3_booster_on"}) -end - -minetest.register_node("techage:furnace_firebox", { - description = S("TA3 Furnace Oil Burner"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_appl_firehole.png^techage_frame_ta3.png", - }, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - - on_timer = node_timer, - can_dig = fuel.can_dig, - on_punch = fuel.on_punch, - on_receive_fields = fuel.on_receive_fields, - on_rightclick = fuel.on_rightclick, - - on_construct = function(pos) - local nvm = techage.get_nvm(pos) - techage.add_node(pos, "techage:furnace_firebox", true) - nvm.running = false - nvm.burn_cycles = 0 - nvm.liquid = {} - nvm.liquid.amount = 0 - local meta = M(pos) - meta:set_string("formspec", fuel.formspec(nvm)) - local inv = meta:get_inventory() - inv:set_size('fuel', 1) - end, -}) - -minetest.register_node("techage:furnace_firebox_on", { - description = S("TA3 Furnace Oil Burner"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - { - name = "techage_concrete4.png^techage_appl_firehole4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - paramtype2 = "facedir", - light_source = 8, - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - drop = "techage:furnace_firebox", - - on_timer = node_timer, - can_dig = fuel.can_dig, - on_receive_fields = fuel.on_receive_fields, - on_punch = fuel.on_punch, - on_rightclick = fuel.on_rightclick, -}) - -minetest.register_craft({ - output = "techage:furnace_firebox", - recipe = { - {'techage:basalt_stone', 'techage:basalt_stone', 'techage:basalt_stone'}, - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'techage:basalt_stone', 'techage:basalt_stone', 'techage:basalt_stone'}, - }, -}) - -techage.register_node({"techage:furnace_firebox", "techage:furnace_firebox_on"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - return nvm.running and "running" or "stopped" - elseif topic == "fuel" then - return fuel.get_fuel_amount(nvm) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then -- State - return 0, {nvm.running and techage.RUNNING or techage.STOPPED} - elseif topic == 132 then -- Fuel Level - return 0, {fuel.get_fuel_amount(nvm)} - else - return 2, "" - end - end, - -- called from furnace_top - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "fuel" then - return has_fuel(pos, nvm) and booster_cmnd(pos, "power") - elseif topic == "running" then - return nvm.running and booster_cmnd(pos, "running") - elseif topic == "start" then - start_firebox(pos, nvm) - booster_cmnd(pos, "start") - elseif topic == "stop" then - stop_firebox(pos, nvm) - booster_cmnd(pos, "stop") - end - end, - on_node_load = function(pos, node) - local inv = M(pos):get_inventory() - if not inv:is_empty("fuel") then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - local count = inv:get_stack("fuel", 1):get_count() - nvm.liquid.amount = (nvm.liquid.amount or 0) + count - nvm.liquid.name = "techage:gasoline" - inv:set_stack("fuel", 1, nil) - end - end, -}) - -liquid.register_nodes({"techage:furnace_firebox", "techage:furnace_firebox_on"}, - Pipe, "tank", nil, fuel.get_liquid_table(fuel.BT_OIL, fuel.CAPACITY, start_firebox)) diff --git a/techage/furnace/furnace_top.lua b/techage/furnace/furnace_top.lua deleted file mode 100644 index 1838088..0000000 --- a/techage/furnace/furnace_top.lua +++ /dev/null @@ -1,339 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Industrial Furnace Top - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 6 -local COUNTDOWN_TICKS = 6 -local CYCLE_TIME = 2 - -local smelting = techage.furnace.smelting -local get_output = techage.furnace.get_output -local num_recipes = techage.furnace.get_num_recipes -local reset_cooking = techage.furnace.reset_cooking -local get_ingredients = techage.furnace.get_ingredients -local check_if_worth_to_wakeup = techage.furnace.check_if_worth_to_wakeup -local range = techage.in_range -local MP = minetest.get_modpath(minetest.get_current_modname()) -local mConf = assert(loadfile(MP .. "/basis/conf_inv.lua"))("cfg") - -local WRENCH_MENU3 = { - { - type = "items", - name = "config", - label = S("Pre-Assignment Input Inv."), - tooltip = S("Stack locations can be pre-assigned to specific items,\nto be filled only with those items."), - width = 2, - height = 2, - } -} - -local function update_recipe_menu(pos, nvm) - local ingr = get_ingredients(pos) - nvm.rp_num = num_recipes(ingr) - nvm.rp_idx = range(nvm.rp_idx or 1, 0, nvm.rp_num) - nvm.rp_outp = get_output(nvm, ingr, nvm.rp_idx) -end - -local function formspec(self, pos, nvm) - local idx = nvm.rp_idx or 1 - local num = nvm.rp_num or 1 - local outp = nvm.rp_outp or "" - return "size[8,7.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - techage.wrench_image(7.6, -0.2) .. - "list[context;src;0,0;2,2;]".. - mConf.preassigned_stacks(pos, 2, 2).. - "image[2,0.5;1,1;techage_form_arrow_bg.png^[lowpart:".. - (nvm.item_percent or 0)..":techage_form_arrow_fg.png^[transformR270]".. - "image_button[2,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2,2;1,1;"..self:get_state_tooltip(nvm).."]".. - - "list[context;dst;3,0;2,2;]".. - - "label[6,0;"..S("Outp")..": "..idx.."/"..num.."]".. - "item_image_button[6.5,0.5;1,1;"..outp..";b1;]".. - "button[6,1.5;1,1;priv;<<]".. - "button[7,1.5;1,1;next;>>]".. - - "list[current_player;main;0,3.5;8,4;]" .. - "listring[current_player;main]".. - "listring[context;src]" .. - "listring[current_player;main]".. - "listring[context;dst]" .. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 3.5) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) -end - -local function firebox_cmnd(pos, cmnd) - return techage.transfer( - {x=pos.x, y=pos.y-1, z=pos.z}, - nil, -- outdir - cmnd, -- topic - nil, -- payload - nil, -- network - {"techage:furnace_firebox", "techage:furnace_firebox_on", - "techage:furnace_heater", "techage:furnace_heater_on"}) -end - -local function firebox_has_fuel(nvm, pos) - if nvm.techage_state == techage.RUNNING then - return firebox_cmnd(pos, "running") - else - return firebox_cmnd(pos, "fuel") - end -end - -local function cooking(pos, crd, nvm, elapsed) - if nvm.techage_state == techage.RUNNING or check_if_worth_to_wakeup(pos, nvm) then - if firebox_has_fuel(nvm, pos) then - local state, err = smelting(pos, nvm, elapsed) - if state == techage.RUNNING then - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - elseif state == techage.BLOCKED then - crd.State:blocked(pos, nvm) - elseif state == techage.FAULT then - crd.State:fault(pos, nvm, err) - elseif state == techage.STANDBY then - crd.State:idle(pos, nvm) - end - else - crd.State:standby(pos, nvm, S("no fuel or no power")) - end - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - cooking(pos, crd, nvm, elapsed) - nvm.toggle = not nvm.toggle - if nvm.toggle then -- progress bar/arrow - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) - end -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - local nvm = techage.get_nvm(pos) - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function on_metadata_inventory(pos) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - nvm.rp_idx = nvm.rp_idx or 1 - if fields.next == ">>" then - local ingr = get_ingredients(pos) - nvm.rp_idx = math.min(nvm.rp_idx + 1, num_recipes(ingr)) - update_recipe_menu(pos, nvm) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - reset_cooking(nvm) - elseif fields.priv == "<<" then - local ingr = get_ingredients(pos) - nvm.rp_idx = range(nvm.rp_idx - 1, 1, num_recipes(ingr)) - update_recipe_menu(pos, nvm) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - reset_cooking(nvm) - end - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local function can_start(pos, nvm, state) - if not firebox_cmnd(pos, "fuel") then - return S("no fuel or no power") - end - return true -end - -local function on_node_state_change(pos, old_state, new_state) - local pwr1 = techage.needs_power2(old_state) - local pwr2 = techage.needs_power2(new_state) - if pwr1 ~= pwr2 then - if pwr2 then - firebox_cmnd(pos, "start") - else - firebox_cmnd(pos, "stop") - end - end - local nvm = techage.get_nvm(pos) - reset_cooking(nvm) -end - -local tiles = {} - --- '#' will be replaced by the stage number -tiles.pas = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_frame_ta#_top.png", - "techage_concrete.png^techage_frame_ta#_top.png", - "techage_concrete.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_concrete.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_concrete.png^techage_frame_ta#.png", - "techage_concrete.png^techage_appl_furnace.png^techage_frame_ta#.png", -} -tiles.act = tiles.pas - -local tubing = { - on_inv_request = function(pos, in_dir, access_type) - if access_type == "push" then - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - return meta:get_inventory(), "src" - end - end - end, - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack, idx) - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir or in_dir == 5 then - local inv = M(pos):get_inventory() - local mem = techage.get_mem(pos) - - mem.filter = mem.filter or mConf.item_filter(pos, 4) - mem.chest_configured = mem.chest_configured or not inv:is_empty("cfg") - - if mem.chest_configured then - local name = stack:get_name() - local stacks = mem.filter[name] or mem.filter["unconfigured"] - return mConf.put_items(pos, inv, "src", stack, stacks, idx) - else - return techage.put_items(inv, "src", stack, idx) - end - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "output" then - local nvm = techage.get_nvm(pos) - return string.split(nvm.output or "unknown", " ")[1] - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 141 then -- Furnace Output - local nvm = techage.get_nvm(pos) - return 0, string.split(nvm.output or "unknown", " ")[1] - else - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end - end, -} - -local _, node_name_ta3, _ = - techage.register_consumer("furnace", S("Furnace Top"), tiles, { - drawtype = "normal", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - can_start = can_start, - on_state_change = on_node_state_change, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size("src", 2*2) - inv:set_size("dst", 2*2) - inv:set_size("cfg", 2*2) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_metadata_inventory_put = on_metadata_inventory, - on_metadata_inventory_take = on_metadata_inventory, - on_metadata_inventory_move = on_metadata_inventory, - ta3_formspec = WRENCH_MENU3, - on_rightclick = on_rightclick, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - }, - {false, false, true, false}) -- TA3 only - - - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"", "techage:usmium_nuggets", ""}, - {"default:steel_ingot", "default:furnace", "default:steel_ingot"}, - {"", "techage:vacuum_tube", ""}, - }, -}) diff --git a/techage/furnace/heater.lua b/techage/furnace/heater.lua deleted file mode 100644 index 2037d53..0000000 --- a/techage/furnace/heater.lua +++ /dev/null @@ -1,136 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Industrial Furnace Heater - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local PWR_NEEDED = 14 -local CYCLE_TIME = 2 - -local Cable = techage.ElectricCable -local power = networks.power - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - - -local function after_place_node(pos) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:furnace_heater", { - description = S("TA4 Furnace Heater"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png^techage_appl_hole_electric.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_appl_heater.png^techage_frame_ta3.png", - }, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - swap_node(pos, "techage:furnace_heater_on") - end - return true - end, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_node("techage:furnace_heater_on", { - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_appl_open.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_frame_ta3.png^techage_appl_hole_electric.png", - "techage_concrete.png^techage_frame_ta3.png", - "techage_concrete.png^techage_appl_heater_on.png^techage_frame_ta3.png", - }, - - on_timer = function(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - swap_node(pos, "techage:furnace_heater") - end - return true - end, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - light_source = 8, - paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:furnace_heater", "techage:furnace_heater_on"}, Cable, "con", {"B", "F", "L", "D", "U"}) - -techage.register_node({"techage:furnace_heater", "techage:furnace_heater_on"}, { - -- called from furnace_top - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "fuel" then - return power.power_available(pos, Cable) - elseif topic == "running" then - return techage.get_node_lvm(pos).name == "techage:furnace_heater_on" - elseif topic == "start" and not nvm.running then - if power.power_available(pos, Cable) then - nvm.running = true - minetest.get_node_timer(pos):start(CYCLE_TIME) - return true - end - elseif topic == "stop" and nvm.running then - nvm.running = false - swap_node(pos, "techage:furnace_heater") - minetest.get_node_timer(pos):stop() - return true - end - end -}) - -minetest.register_craft({ - output = "techage:furnace_heater", - recipe = { - {'techage:aluminum', 'default:steel_ingot', 'techage:aluminum'}, - {'techage:basalt_stone', 'basic_materials:heating_element', 'techage:basalt_stone'}, - {'techage:aluminum', 'techage:ta4_furnace_ceramic', 'techage:aluminum'}, - }, -}) diff --git a/techage/furnace/recipes.lua b/techage/furnace/recipes.lua deleted file mode 100644 index 47a98b2..0000000 --- a/techage/furnace/recipes.lua +++ /dev/null @@ -1,170 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Cooking recipes for furnace - -]]-- - - -techage.furnace.register_recipe({ - output = "techage:iron_ingot", - recipe = {"default:iron_lump"}, - time = 2, -}) - -techage.furnace.register_recipe({ - output = "default:obsidian", - recipe = {"default:cobble"}, - time = 8, -}) - -if techage.modified_recipes_enabled then - techage.furnace.register_recipe({ - output = "default:bronze_ingot 4", - recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"}, - time = 2, - }) - - techage.furnace.register_recipe({ - output = "default:steel_ingot 4", - recipe = {"default:coal_lump", "default:iron_lump", "default:iron_lump", "default:iron_lump"}, - time = 4, - }) -end - -if minetest.global_exists("wielded_light") then - techage.furnace.register_recipe({ - output = "techage:meridium_ingot", - recipe = {"default:steel_ingot", "default:mese_crystal_fragment"}, - heat = 4, - time = 3, - }) -end - -local function node_group(group) - local tbl = {} - for key,_ in pairs(minetest.registered_items) do - if minetest.get_item_group(key, group) > 0 then - tbl[#tbl + 1] = key - end - end - return tbl -end - -minetest.after(1, function() - for key,_ in pairs(minetest.registered_items) do - if key ~= "" then - local tbl = minetest.get_all_craft_recipes(key) - if tbl then - for _,recipe in ipairs(tbl) do - if recipe and recipe.method == "cooking" then - if recipe.items[1] and string.split(recipe.items[1], ":")[1] == "group" then - for _,item in ipairs(node_group(string.split(recipe.items[1], ":")[2])) do - techage.furnace.register_recipe({ - output = recipe.output, - recipe = {item}, - time = math.floor((recipe.width + 1) / 2), - }) - end - else - techage.furnace.register_recipe({ - output = recipe.output, - recipe = recipe.items, - time = math.floor((recipe.width + 1) / 2), - }) - end - end - end - end - end - end -end) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass2", - recipe = { - "techage:basalt_gravel", - "techage:basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass", - recipe = { - "techage:sieved_basalt_gravel", - "techage:sieved_basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass_thin2 2", - recipe = { - "techage:basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass_thin 2", - recipe = { - "techage:sieved_basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass_thin_xl2", - recipe = { - "techage:basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "techage:basalt_glass_thin_xl", - recipe = { - "techage:sieved_basalt_gravel", - }, - time = 4, -}) - -techage.furnace.register_recipe({ - output = "basic_materials:concrete_block 4", - recipe = { - "basic_materials:wet_cement", - "default:sand", - "default:gravel", - "techage:steelmat", - }, - time = 4, -}) - -if minetest.global_exists("moreores") then - - if techage.modified_recipes_enabled then - minetest.clear_craft({output = "moreores:mithril_ingot"}) - minetest.clear_craft({output = "moreores:silver_ingot"}) - end - - techage.furnace.register_recipe({ - output = 'moreores:silver_ingot', - recipe = {'moreores:silver_lump'}, - time = 2, - }) - - techage.furnace.register_recipe({ - output = 'moreores:mithril_ingot', - recipe = {'moreores:mithril_lump'}, - time = 5, - }) - -end diff --git a/techage/fusion_reactor/controller.lua b/techage/fusion_reactor/controller.lua deleted file mode 100644 index 641ba92..0000000 --- a/techage/fusion_reactor/controller.lua +++ /dev/null @@ -1,288 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Fusion Reactor Controller - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local sched = techage.scheduler -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 1 -local COUNTDOWN_TICKS = 1 -local PWR_NEEDED = 400 -local EXPECTED_PLASMA_NUM = 56 -local EXPECTED_SHELL_NUM = 56 -local EXPECTED_MAGNET_NUM = 56 -local CALL_RATE1 = 16 -- 2s * 16 = 32s -local CALL_RATE2 = 8 -- 2s * 8 = 16s -local DESCRIPTION = S("TA5 Fusion Reactor Controller") -local EX_POINTS = 60 - -local function count_trues(t) - local cnt = 0 - for _,v in ipairs(t) do - if v then - cnt = cnt + 1 - end - end - return cnt -end - -local function nucleus(t) - t = techage.tbl_filter(t, function(v, k, t) return type(v) == "table" end) - if #t == 4 then - if vector.equals(t[1], t[2]) and vector.equals(t[3], t[4]) then - return true - end - end - return S("Nucleus detection error") -end - -local tSched = {} - -sched.register(tSched, CALL_RATE1, 0, function(pos, outdir) - local resp = control.request(pos, Cable, outdir, "con", "connect") - local cnt = count_trues(resp) - if cnt ~= EXPECTED_MAGNET_NUM then - return S("Magnet detection error\n(@1% found / 100% expected)", math.floor(cnt* 100 / EXPECTED_MAGNET_NUM)) - end - return true - end) - -sched.register(tSched, CALL_RATE1, 1, function(pos, outdir) - local resp = control.request(pos, Cable, outdir, "con", "test_plasma") - local cnt = count_trues(resp) - if cnt ~= EXPECTED_PLASMA_NUM then - return S("Plasma ring shape error") - end - return true - end) - -sched.register(tSched, CALL_RATE1, 2, function(pos, outdir) - local resp = control.request(pos, Cable, outdir, "con", "test_shell") - local cnt = count_trues(resp) - if cnt ~= EXPECTED_SHELL_NUM then - return S("Shell shape error\n(@1% found / 100% expected)", math.floor(cnt* 100 / EXPECTED_SHELL_NUM)) - end - return true - end) - -sched.register(tSched, CALL_RATE1, 3, function(pos, outdir) - local resp = control.request(pos, Cable, outdir, "con", "test_nucleus") - return nucleus(resp) - end) - -sched.register(tSched, CALL_RATE2, 4, function(pos, outdir) - local resp = control.request(pos, Cable, outdir, "con", "inc_power") - local cnt = count_trues(resp) - --print("inc_power", cnt) - if cnt < 52 then - return S("Cooling failed") - end - return true - end) - -local function can_start(pos, nvm) - local outdir = networks.side_to_outdir(pos, "L") - if not power.power_available(pos, Cable, outdir) then - return S("No power") - end - outdir = networks.side_to_outdir(pos, "R") - control.request(pos, Cable, outdir, "con", "rst_power") - for i = 0,4 do - local res = tSched[i](pos, outdir) - if res ~= true then return res end - end - return true -end - -local function start_node(pos, nvm) - sched.init(pos) - local outdir = networks.side_to_outdir(pos, "R") - control.send(pos, Cable, outdir, "con", "on") - sched.init(pos) -end - -local function stop_node(pos, nvm) - local outdir = networks.side_to_outdir(pos, "R") - control.send(pos, Cable, outdir, "con", "off") -end - -local function formspec(self, pos, nvm) - return "size[5,3]".. - "box[0,-0.1;4.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", DESCRIPTION) .. "]" .. - "image_button[2,1.5;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2,1.5;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_fr_controller_pas", - node_name_active = "techage:ta5_fr_controller_act", - cycle_time = CYCLE_TIME, - infotext_name = DESCRIPTION, - standby_ticks = STANDBY_TICKS, - can_start = can_start, - start_node = start_node, - stop_node = stop_node, - formspec_func = formspec, -}) - -local function after_place_node(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - local meta = M(pos) - local own_num = techage.add_node(pos, "techage:ta5_fr_controller_pas") - State:node_init(pos, nvm, own_num) - meta:set_string("owner", placer:get_player_name()) - Cable:after_place_node(pos) -end - -local function consume_power(pos, nvm, outdir) - if techage.needs_power(nvm) then - local taken = power.consume_power(pos, Cable, outdir, PWR_NEEDED) - if techage.is_running(nvm) then - if taken < PWR_NEEDED then - State:nopower(pos, nvm, "No power") - stop_node(pos, nvm) - else - return true -- keep running - end - end - end -end - -local function node_timer(pos) - local nvm = techage.get_nvm(pos) - local outdir = networks.side_to_outdir(pos, "L") - if consume_power(pos, nvm, outdir) then - local resp = sched.get(pos, tSched, function() - return true end)(pos, networks.Flip[outdir]) - if resp ~= true then - State:fault(pos, nvm, resp) - stop_node(pos, nvm) - else - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - end - return State:is_active(nvm) -end - -local function after_dig_node(pos, oldnode, oldmetadata) - Cable:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - if techage.get_expoints(player) >= EX_POINTS then - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - --M(pos):set_string("formspec", formspec(State, pos, nvm)) - end -end - -minetest.register_node("techage:ta5_fr_controller_pas", { - description = S("TA5 Fusion Reactor Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_appl_plasma.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_plasma.png^techage_frame_ta5.png", - }, - after_place_node = after_place_node, - on_timer = node_timer, - after_dig_node = after_dig_node, - on_receive_fields = on_receive_fields, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta5_fr_controller_act", { - description = S("TA5 Fusion Reactor Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_electric.png", - { - name = "techage_filling4_ta4.png^techage_appl_plasma4.png^techage_frame4_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 64, - aspect_h = 64, - length = 0.5, - }, - }, - { - name = "techage_filling4_ta4.png^techage_appl_plasma4.png^techage_frame4_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 64, - aspect_h = 64, - length = 0.5, - }, - }, - }, - after_place_node = after_place_node, - on_timer = node_timer, - after_dig_node = after_dig_node, - on_receive_fields = on_receive_fields, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - drop = "", - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -techage.register_node({"techage:ta5_fr_controller_pas", "techage:ta5_fr_controller_act"}, { - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - -power.register_nodes({"techage:ta5_fr_controller_pas", "techage:ta5_fr_controller_act"}, Cable, "con", {"L", "R"}) - -minetest.register_craft({ - output = "techage:ta5_fr_controller_pas", - recipe = { - {'techage:aluminum', 'basic_materials:gold_wire', 'default:steel_ingot'}, - {'techage:electric_cableS', 'techage:ta5_aichip2', 'techage:electric_cableS'}, - {'default:steel_ingot', 'default:diamond', 'techage:aluminum'}, - }, -}) - diff --git a/techage/fusion_reactor/gas_pipe.lua b/techage/fusion_reactor/gas_pipe.lua deleted file mode 100644 index 108164d..0000000 --- a/techage/fusion_reactor/gas_pipe.lua +++ /dev/null @@ -1,331 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Gas Pipes - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local MAX_PIPE_LENGHT = 100 - -local liquid = networks.liquid - -local Pipe = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = MAX_PIPE_LENGHT, - show_infotext = false, - force_to_use_tubes = false, - tube_type = "pipe3", - primary_node_names = { - "techage:ta5_pipe1S", "techage:ta5_pipe1A", - "techage:ta5_pipe2S", "techage:ta5_pipe2A", - }, - secondary_node_names = {}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - local name = minetest.get_node(pos).name - if not networks.hidden_name(pos) then - local name = minetest.get_node(pos).name - if name == "techage:ta5_pipe1S" or name == "techage:ta5_pipe1A" then - minetest.swap_node(pos, {name = "techage:ta5_pipe1"..tube_type, param2 = param2 % 32}) - else - minetest.swap_node(pos, {name = "techage:ta5_pipe2"..tube_type, param2 = param2 % 32}) - end - end - M(pos):set_int("netw_param2", param2) - end, -}) - --- Enable hidden cables -networks.use_metadata(Pipe) - --- Use global callback instead of node related functions -Pipe:register_on_tube_update2(function(pos, outdir, tlib2, node) - liquid.update_network(pos, outdir, tlib2, node) -end) - -minetest.register_node("techage:ta5_pipe1S", { - description = S("TA5 Pipe"), - tiles = { - "techage_ta5_gaspipe.png^[transformR90^[colorize:#000080:160", - "techage_ta5_gaspipe.png^[transformR90^[colorize:#000080:160", - "techage_ta5_gaspipe.png^[colorize:#000080:160", - "techage_ta5_gaspipe.png^[colorize:#000080:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#000080:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#000080:160", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -1/16, -8/16, 1/16, 1/16, 8/16}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta5_pipe1A", { - description = S("TA5 Pipe"), - tiles = { - "techage_ta5_gaspipe_knee2.png^[colorize:#000080:160", - "techage_ta5_gaspipe_hole2.png^[transformR180^[colorize:#000080:160", - "techage_ta5_gaspipe_knee.png^[transformR270^[colorize:#000080:160", - "techage_ta5_gaspipe_knee.png^[colorize:#000080:160", - "techage_ta5_gaspipe_knee2.png^[colorize:#000080:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#000080:160", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -8/16, -1/16, 1/16, 1/16, 1/16}, - {-2/16, -0.5, -2/16, 2/16, -13/32, 2/16}, - {-1/16, -1/16, -8/16, 1/16, 1/16, -1/16}, - {-2/16, -2/16, -0.5, 2/16, 2/16, -13/32}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, - not_in_creative_inventory=1, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta5_pipe1S", -}) - -minetest.register_node("techage:ta5_pipe2S", { - description = S("TA5 Pipe"), - tiles = { - "techage_ta5_gaspipe.png^[transformR90^[colorize:#008000:160", - "techage_ta5_gaspipe.png^[transformR90^[colorize:#008000:160", - "techage_ta5_gaspipe.png^[colorize:#008000:160", - "techage_ta5_gaspipe.png^[colorize:#008000:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#008000:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#008000:160", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -1/16, -8/16, 1/16, 1/16, 8/16}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta5_pipe2A", { - description = S("TA5 Pipe"), - tiles = { - "techage_ta5_gaspipe_knee2.png^[colorize:#008000:160", - "techage_ta5_gaspipe_hole2.png^[transformR180^[colorize:#008000:160", - "techage_ta5_gaspipe_knee.png^[transformR270^[colorize:#008000:160", - "techage_ta5_gaspipe_knee.png^[colorize:#008000:160", - "techage_ta5_gaspipe_knee2.png^[colorize:#008000:160", - "techage_ta5_gaspipe_hole2.png^[colorize:#008000:160", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -8/16, -1/16, 1/16, 1/16, 1/16}, - {-2/16, -0.5, -2/16, 2/16, -13/32, 2/16}, - {-1/16, -1/16, -8/16, 1/16, 1/16, -1/16}, - {-2/16, -2/16, -0.5, 2/16, 2/16, -13/32}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, - not_in_creative_inventory=1, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta5_pipe2S", -}) - -local size1 = 1/16 -local size2 = 2/16 -local size3 = 13/32 -local Boxes = { - { - {-size1, -size1, size1, size1, size1, 0.5 }, -- z+ - {-size2, -size2, size3, size2, size2, 0.5 }, -- z+ - }, - { - {-size1, -size1, -size1, 0.5, size1, size1}, -- x+ - { size3, -size2, -size2, 0.5, size2, size2}, -- x+ - }, - { - {-size1, -size1, -0.5, size1, size1, size1}, -- z- - {-size2, -size2, -0.5, size2, size2, -size3}, -- z- - }, - { - {-0.5, -size1, -size1, size1, size1, size1}, -- x- - {-0.5, -size2, -size2, -size3, size2, size2}, -- x- - }, - { - {-size1, -0.5, -size1, size1, size1, size1}, -- y- - {-size2, -0.5, -size2, size2, -size3, size2}, -- y- - }, - { - {-size1, -size1, -size1, size1, 0.5, size1}, -- y+ - {-size2, size3, -size2, size2, 0.5, size2}, -- y+ - } -} - -local names1 = networks.register_junction("techage:ta5_junctionpipe1", 1/8, Boxes, Pipe, { - description = S("TA5 Junction Pipe"), - tiles = {"techage_ta5_gaspipe_junction.png^[colorize:#000080:160"}, - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local name = "techage:ta5_junctionpipe1" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - Pipe:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - if not networks.hidden_name(pos) then - local name = "techage:ta5_junctionpipe1" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - end - liquid.update_network(pos, 0, tlib2, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, -}, 25) - -local names2 = networks.register_junction("techage:ta5_junctionpipe2", 1/8, Boxes, Pipe, { - description = S("TA5 Junction Pipe"), - tiles = {"techage_ta5_gaspipe_junction.png^[colorize:#008000:160"}, - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local name = "techage:ta5_junctionpipe2" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - Pipe:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - if not networks.hidden_name(pos) then - local name = "techage:ta5_junctionpipe2" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - end - liquid.update_network(pos, 0, tlib2, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, -}, 25) - -liquid.register_nodes(names1, Pipe, "junc") -liquid.register_nodes(names2, Pipe, "junc") - -minetest.register_craft({ - output = "techage:ta5_pipe1S 6", - recipe = { - {'', '', "default:steel_ingot"}, - {'', 'dye:blue', 'techage:ta4_carbon_fiber'}, - {"", '', 'techage:aluminum'}, - }, -}) - -minetest.register_craft({ - output = "techage:ta5_pipe2S 6", - recipe = { - {'', '', "default:steel_ingot"}, - {'', 'dye:green', 'techage:ta4_carbon_fiber'}, - {"", '', 'techage:aluminum'}, - }, -}) - -minetest.register_craft({ - output = "techage:ta5_junctionpipe125 2", - recipe = { - {"", "techage:ta5_pipe1S", ""}, - {"techage:ta5_pipe1S", "", "techage:ta5_pipe1S"}, - {"", "techage:ta5_pipe1S", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta5_junctionpipe225 2", - recipe = { - {"", "techage:ta5_pipe2S", ""}, - {"techage:ta5_pipe2S", "", "techage:ta5_pipe2S"}, - {"", "techage:ta5_pipe2S", ""}, - }, -}) - -techage.GasPipe = Pipe diff --git a/techage/fusion_reactor/generator.lua b/techage/fusion_reactor/generator.lua deleted file mode 100644 index e61735a..0000000 --- a/techage/fusion_reactor/generator.lua +++ /dev/null @@ -1,278 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Fusion Reactor Generator -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 1 -local COUNTDOWN_TICKS = 2 -local PWR_PERF = 800 - -local function formspec(self, pos, nvm) - return techage.generator_formspec(self, pos, nvm, S("TA5 Generator"), nvm.provided, PWR_PERF) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function can_start(pos, nvm, state) - if nvm.alive_cnt and nvm.alive_cnt > 0 then - return true - end - return S("no steam") -end - -local function start_node(pos, nvm) - local meta = M(pos) - nvm.provided = 0 - nvm.alive_cnt = 5 - techage.evaluate_charge_termination(nvm, meta) - local outdir = meta:get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local function stop_node(pos, nvm) - nvm.provided = 0 - nvm.alive_cnt = 0 - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_generator", - node_name_active = "techage:ta5_generator_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = S("TA5 Generator"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if (nvm.alive_cnt or 0) > 0 then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - nvm.alive_cnt = (nvm.alive_cnt or 0) - 1 - local alive = nvm.alive_cnt > 0 - if running and not alive then - State:standby(pos, nvm, S("no steam")) - stop_node(pos, nvm, State) - elseif not running and alive then - State:start(pos, nvm) - elseif running then - local meta = M(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) - local val = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - if val > 0 then - nvm.load = val - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -minetest.register_node("techage:ta5_generator", { - description = S("TA5 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_generator.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_generator.png^[transformFX]", - }, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta5_generator") - State:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - Cable:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - get_generator_data = get_generator_data, - ta4_formspec = techage.generator_settings("ta4", PWR_PERF), - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta5_generator_on", { - description = S("TA5 Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", - { - name = "techage_filling4_ta4.png^techage_appl_generator4.png^techage_frame4_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - { - name = "techage_filling4_ta4.png^techage_appl_generator4.png^[transformFX]^techage_frame4_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - }, - - get_generator_data = get_generator_data, - ta4_formspec = techage.generator_settings("ta4", PWR_PERF), - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - paramtype2 = "facedir", - drop = "", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:ta5_generator", "techage:ta5_generator_on"}, Cable, "gen", {"R"}) - --- controlled by the turbine -techage.register_node({"techage:ta5_generator", "techage:ta5_generator_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then - nvm.alive_cnt = 5 - elseif topic == "start" then - --start_node(pos, nvm) - elseif topic == "stop" then - stop_node(pos, nvm) - end - end, - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "delivered" then - return nvm.provided or 0 - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 135 then - return 0, {nvm.provided or 0} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos) - -- Add node number if missing - local number = M(pos):get_string("node_number") - if number == "" then - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta5_generator") - State:node_init(pos, nvm, number) - State:start(pos, nvm) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - end, -}) - -control.register_nodes({"techage:ta5_generator", "techage:ta5_generator_on"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA5 Generator"), - number = "-", - running = (nvm.alive_cnt or 0) > 0, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta5_generator", - recipe = { - {"", "dye:red", ""}, - {"", "techage:ta4_generator", ""}, - {"", "techage:baborium_ingot", ""}, - }, -}) diff --git a/techage/fusion_reactor/heatexchanger1.lua b/techage/fusion_reactor/heatexchanger1.lua deleted file mode 100644 index e4f7717..0000000 --- a/techage/fusion_reactor/heatexchanger1.lua +++ /dev/null @@ -1,109 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Heat Exchanger1 (bottom part) - - has a connection to storage and turbine (via pipes) - - acts as a cable junction for Exchanger2 -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local Pipe2 = techage.LiquidPipe -local Pipe3 = techage.GasPipe -local power = networks.power -local liquid = networks.liquid -local control = networks.control - -local function turbine_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, Pipe2, - {"techage:ta5_turbine", "techage:ta5_turbine_on"}) -end - --- Send to the magnets -local function control_cmnd(pos, topic) - local outdir = networks.side_to_outdir(pos, "L") - return control.request(pos, Pipe3, outdir, "tank", topic) -end - -minetest.register_node("techage:ta5_heatexchanger1", { - description = S("TA5 Heat Exchanger 1"), - tiles = { - -- up, down, right, left, back, front - "techage_hole_ta4.png^techage_appl_arrow_white.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_ta5_pipe2.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - Cable:after_place_node(pos) - Pipe2:after_place_node(pos) - Pipe3:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, outdir, tlib2, node) - if tlib2 == Cable then - power.update_network(pos, 0, Cable, node) -- junction!!! - elseif tlib2 == Pipe2 then - power.update_network(pos, outdir, Pipe2, node) - else - power.update_network(pos, outdir, Pipe3, node) - end - end, - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - pos.y = pos.y + 1 - return minetest.get_node(pos).name ~= "techage:ta5_heatexchanger2" - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - Pipe2:after_dig_node(pos) - Pipe3:after_dig_node(pos) - end, - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta5_heatexchanger1"}, Pipe2, "tank", {"R"}, {}) -liquid.register_nodes({"techage:ta5_heatexchanger1"}, Pipe3, "tank", {"L"}, {}) -power.register_nodes({"techage:ta5_heatexchanger1"}, Cable, "junc", {"F", "B", "U"}) - --- command interface -techage.register_node({"techage:ta5_heatexchanger1"}, { - on_transfer = function(pos, indir, topic, payload) - local nvm = techage.get_nvm(pos) - -- used by heatexchanger2 - if topic == "test_pipe_blue" or topic == "test_gas_blue" then - return control_cmnd(pos, topic) - else - return turbine_cmnd(pos, topic, payload) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta5_heatexchanger1", - recipe = { - {"default:tin_ingot", "techage:electric_cableS", "default:steel_ingot"}, - {"techage:ta5_pipe1S", "basic_materials:gear_steel", "techage:ta4_pipeS"}, - {"", "techage:baborium_ingot", ""}, - }, -}) diff --git a/techage/fusion_reactor/heatexchanger2.lua b/techage/fusion_reactor/heatexchanger2.lua deleted file mode 100644 index 6408263..0000000 --- a/techage/fusion_reactor/heatexchanger2.lua +++ /dev/null @@ -1,426 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Heat Exchanger2 (middle part) - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control -local sched = techage.scheduler - -local CYCLE_TIME = 2 -local PWR_NEEDED = 5 -local COUNTDOWN_TICKS = 1 -local DOWN = 5 -- dir -local DESCRIPTION = S("TA5 Heat Exchanger 2") -local EXPECT_BLUE = 56 -local EXPECT_GREEN = 52 -local CALL_RATE1 = 16 -- 2s * 16 = 32s -local CALL_RATE2 = 8 -- 2s * 8 = 16s -local EX_POINTS = 60 - -local function heatexchanger1_cmnd(pos, topic, payload) - return techage.transfer({x = pos.x, y = pos.y - 1, z = pos.z}, - nil, topic, payload, nil, - {"techage:ta5_heatexchanger1"}) -end - -local function heatexchanger3_cmnd(pos, topic, payload) - return techage.transfer({x = pos.x, y = pos.y + 1, z = pos.z}, - nil, topic, payload, nil, - {"techage:ta5_heatexchanger3"}) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_booster", { - pos = pos, - gain = 0.3, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function count_trues(t) - local cnt = 0 - for _,v in ipairs(t) do - if v then - cnt = cnt + 1 - end - end - return cnt -end - -local tSched = {} - -sched.register(tSched, CALL_RATE1, 0, function(pos) - if not heatexchanger1_cmnd(pos, "turbine") then - return S("Turbine error") - end - return true - end) -sched.register(tSched, CALL_RATE1, 1, function(pos) - if not heatexchanger3_cmnd(pos, "turbine") then - return S("Cooler error") - end - return true - end) -sched.register(tSched, CALL_RATE1, 2, function(pos) - local resp = heatexchanger1_cmnd(pos, "test_pipe_blue") - if type(resp) ~= "table" then - return DESCRIPTION .. S(" Error!") - end - local cnt = count_trues(resp) - if cnt ~= EXPECT_BLUE then - return S("Blue pipe connection error\n(@1 found / @2 expected)", cnt, EXPECT_BLUE) - end - return true - end) -sched.register(tSched, CALL_RATE1, 3, function(pos) - local resp = heatexchanger3_cmnd(pos, "test_pipe_green") - local cnt = count_trues(resp) - if cnt ~= EXPECT_GREEN then - return S("Green pipe connection error\n(@1 found / @2 expected)", cnt, EXPECT_GREEN) - end - return true - end) -sched.register(tSched, CALL_RATE1, 4, function(pos) - local resp = heatexchanger1_cmnd(pos, "test_gas_blue") - local cnt = count_trues(resp) - if cnt ~= EXPECT_BLUE then - return S("Blue pipe coolant missing\n(@1 found / @2 expected)", cnt, EXPECT_BLUE) - end - return true - end) -sched.register(tSched, CALL_RATE1, 5, function(pos) - local resp = heatexchanger3_cmnd(pos, "test_gas_green") - local cnt = count_trues(resp) - if cnt ~= EXPECT_GREEN then - return S("Green pipe coolant missing\n(@1 found / @2 expected)", cnt, EXPECT_GREEN) - end - return true - end) -sched.register(tSched, CALL_RATE2, 6, function(pos) - local resp = heatexchanger3_cmnd(pos, "dec_power") - local cnt = count_trues(resp) - --print("dec_power", cnt) - if cnt < 52 then - return 0 - end - return 1 - end) - -local function can_start(pos, nvm) - if not power.power_available(pos, Cable, DOWN) then - return S("No power") - end - heatexchanger3_cmnd(pos, "rst_power") - for i = 0,6 do - local res = tSched[i](pos) - if res ~= true and res ~= 1 then return res end - end - return true -end - -local function start_node(pos, nvm) - play_sound(pos) - sched.init(pos) - nvm.temperature = nvm.temperature or 0 - local mem = techage.get_mem(pos) - local t = minetest.get_gametime() - (mem.stopped_at or 0) - nvm.temperature = math.max(nvm.temperature - math.floor(t/2), 0) - nvm.temperature = math.min(nvm.temperature, 70) -end - -local function stop_node(pos, nvm) - stop_sound(pos) - heatexchanger1_cmnd(pos, "stop") - local mem = techage.get_mem(pos) - mem.stopped_at = minetest.get_gametime() -end - -local function temp_indicator (nvm, x, y) - local temp = techage.is_running(nvm) and nvm.temperature or 0 - return "image[" .. x .. "," .. y .. ";1,2;techage_form_temp_bg.png^[lowpart:" .. - temp .. ":techage_form_temp_fg.png]" .. - "tooltip[" .. x .. "," .. y .. ";1,2;" .. S("water temperature") .. ";#0C3D32;#FFFFFF]" -end - -local function formspec(self, pos, nvm) - return "size[5,3]".. - "box[0,-0.1;4.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", DESCRIPTION) .. "]" .. - temp_indicator (nvm, 1, 1) .. - "image_button[3.2,1.5;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.2,1.5;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_heatexchanger2", - cycle_time = CYCLE_TIME, - infotext_name = DESCRIPTION, - standby_ticks = 1, - can_start = can_start, - start_node = start_node, - stop_node = stop_node, - formspec_func = formspec, -}) - -local function steam_management(pos, nvm) - local resp = sched.get(pos, tSched, function() return true end)(pos) - - if resp == 0 then -- has no power - nvm.temperature = math.max(nvm.temperature - 10, 0) - elseif resp == 1 then -- has power - nvm.temperature = math.min(nvm.temperature + 10, 100) - elseif resp ~= true then - State:fault(pos, nvm, resp) - State:stop(pos, nvm) - return false - end - - if resp == 0 and nvm.temperature == 70 then - heatexchanger1_cmnd(pos, "stop") - elseif nvm.temperature == 80 then - if resp == 1 then - heatexchanger1_cmnd(pos, "start") - local owner = M(pos):get_string("owner") - minetest.log("action", "[techage] " .. owner .. " starts the TA5 Fusion Reactor at " .. P2S(pos)) - else - heatexchanger1_cmnd(pos, "trigger") - end - elseif nvm.temperature > 80 then - heatexchanger1_cmnd(pos, "trigger") - end - return true -end - -local function consume_power(pos, nvm) - if techage.needs_power(nvm) then - local taken = power.consume_power(pos, Cable, DOWN, PWR_NEEDED) - if techage.is_running(nvm) then - if taken < PWR_NEEDED then - State:nopower(pos, nvm, S("No power")) - stop_sound(pos) - heatexchanger1_cmnd(pos, "stop") - else - return true -- keep running - end - end - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.temperature = nvm.temperature or 0 - --print("node_timer", nvm.temperature) - if consume_power(pos, nvm) then - if steam_management(pos, nvm) then - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) or nvm.temperature > 0 -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - return not techage.is_running(nvm) -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos, placer) - if techage.orientate_node(pos, "techage:ta5_heatexchanger1") then - return true - end - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local own_num = techage.add_node(pos, "techage:ta5_heatexchanger2") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", DESCRIPTION..": "..own_num) - meta:set_string("formspec", formspec(State, pos, nvm)) - Cable:after_place_node(pos, {DOWN}) - State:node_init(pos, nvm, own_num) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - if techage.get_expoints(player) >= EX_POINTS then - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - --M(pos):set_string("formspec", formspec(State, pos, nvm)) - end -end - --- Middle node with the formspec from the bottom node -minetest.register_node("techage:ta5_heatexchanger2", { - description = DESCRIPTION, - tiles = { - -- up, down, right, left, back, front - "techage_hole_ta4.png", - "techage_hole_ta4.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_tes_turb.png", - "techage_filling_ta4.png^techage_frameM_ta4.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", - "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", - }, - - selection_box = { - type = "fixed", - fixed = {-1/2, -1.5/2, -1/2, 1/2, 1/2, 1/2}, - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - can_dig = can_dig, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -power.register_nodes({"techage:ta5_heatexchanger2"}, Cable, "con", {"D"}) - -techage.register_node({"techage:ta5_heatexchanger2"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - if techage.is_running(nvm) then - return "running" - else - return "stopped" - end - elseif topic == "delivered" then - local data = power.get_network_data(pos, Cable, DOWN) - return data.consumed - data.provided - elseif topic == "on" then - State:start(pos, nvm) - return true - elseif topic == "off" then - State:stop(pos, nvm) - return true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 1 and payload[1] == 1 then - start_node(pos, techage.get_nvm(pos)) - return 0 - elseif topic == 1 and payload[1] == 0 then - stop_node(pos, techage.get_nvm(pos)) - return 0 - else - return 2, "" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 128 then - return 0, techage.get_node_lvm(pos).name - elseif topic == 129 then -- State - if techage.is_running(nvm) then - return 0, {techage.RUNNING} - else - return 0, {techage.STOPPED} - end - elseif topic == 135 then -- Delivered Power - local data = power.get_network_data(pos, Cable, DOWN) - return 0, {data.consumed - data.provided} - else - return 2, "" - end - end, - on_node_load = function(pos, node) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - play_sound(pos) - else - stop_sound(pos) - end - -- Attempt to restart the system as the heat exchanger goes into error state - -- when parts of the storage block are unloaded. - if nvm.techage_state == techage.FAULT then - State:start(pos, nvm) - end - end, -}) - -control.register_nodes({"techage:ta5_heatexchanger2"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - return { - type = DESCRIPTION, - number = M(pos):get_string("node_number") or "", - running = techage.is_running(nvm) or false, - capa = nvm.capa_max or 1, - load = nvm.capa or 0, - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta5_heatexchanger2", - recipe = { - {"default:tin_ingot", "", "default:steel_ingot"}, - {"", "techage:ta5_aichip2", ""}, - {"", "techage:baborium_ingot", ""}, - }, -}) diff --git a/techage/fusion_reactor/heatexchanger3.lua b/techage/fusion_reactor/heatexchanger3.lua deleted file mode 100644 index dd8ee47..0000000 --- a/techage/fusion_reactor/heatexchanger3.lua +++ /dev/null @@ -1,106 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Heat Exchanger3 (top part) - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe2 = techage.LiquidPipe -local Pipe3 = techage.GasPipe -local liquid = networks.liquid -local control = networks.control - -local function orientate_node(pos, name) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node.name == name then - local param2 = node.param2 - node = minetest.get_node(pos) - node.param2 = param2 - minetest.swap_node(pos, node) - else - minetest.remove_node(pos) - return true - end -end - -local function after_place_node(pos) - if orientate_node(pos, "techage:ta5_heatexchanger2") then - return true - end - Pipe2:after_place_node(pos) - Pipe3:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Pipe2:after_dig_node(pos) - Pipe3:after_dig_node(pos) -end - -local function turbine_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, Pipe2, - {"techage:ta5_turbine", "techage:ta5_turbine_on"}) -end - --- Send to the magnets -local function control_cmnd(pos, topic) - local outdir = networks.side_to_outdir(pos, "L") - return control.request(pos, Pipe3, outdir, "tank", topic) -end - -minetest.register_node("techage:ta5_heatexchanger3", { - description = S("TA5 Heat Exchanger 3"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_hole_ta4.png", - "techage_filling_ta4.png^techage_frameT_ta5.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frameT_ta5.png^techage_appl_hole_ta5_pipe1.png", - "techage_filling_ta4.png^techage_frameT_ta5.png^techage_appl_ribsT.png", - "techage_filling_ta4.png^techage_frameT_ta5.png^techage_appl_ribsT.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - groups = {crumbly = 2, cracky = 2, snappy = 2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta5_heatexchanger3"}, Pipe2, "tank", {"R"}, {}) -liquid.register_nodes({"techage:ta5_heatexchanger3"}, Pipe3, "tank", {"L"}, {}) - --- command interface, used by heatexchanger2 -techage.register_node({"techage:ta5_heatexchanger3"}, { - on_transfer = function(pos, indir, topic, payload) - if topic == "turbine" then - return turbine_cmnd(pos, topic, payload) - else - return control_cmnd(pos, topic) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta5_heatexchanger3", - recipe = { - {"default:tin_ingot", "dye:red", "default:steel_ingot"}, - {"techage:ta5_pipe2S", "basic_materials:gear_steel", "techage:ta4_pipeS"}, - {"", "techage:baborium_ingot", ""}, - }, -}) - -techage.orientate_node = orientate_node diff --git a/techage/fusion_reactor/magnet.lua b/techage/fusion_reactor/magnet.lua deleted file mode 100644 index 6e4dfa0..0000000 --- a/techage/fusion_reactor/magnet.lua +++ /dev/null @@ -1,271 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Fusion Reactor Magnet - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local Pipe = techage.GasPipe -local power = networks.power -local liquid = networks.liquid -local control = networks.control - -local CAPACITY = 6 -local SHELLBLOCKS = {"techage:ta5_fr_shell", "techage:ta5_fr_nucleus", "techage:ta5_magnet1", "techage:ta5_magnet2"} - -minetest.register_node("techage:ta5_magnet1", { - description = S("TA5 Fusion Reactor Magnet 1"), - tiles = { - -- up, down, right, left, back, front - "techage_collider_magnet.png^techage_appl_hole_ta5_pipe1.png^techage_steel_tiles_top.png^[transformR180]", - "techage_collider_magnet.png^techage_appl_hole_ta5_pipe2.png^techage_steel_tiles_top.png", - "techage_collider_magnet.png^techage_steel_tiles_side.png", - "techage_collider_magnet.png^techage_steel_tiles_side.png^[transformR180]", - "techage_collider_magnet.png^techage_appl_hole_electric.png", - "techage_steel_tiles.png", - }, - after_place_node = function(pos, placer, itemstack) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - ta_rotate_node = function(pos, node, new_param2) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta5_magnet2", { - description = S("TA5 Fusion Reactor Magnet 2"), - tiles = { - -- up, down, right, left, back, front - "techage_collider_magnet.png^techage_appl_hole_ta5_pipe1.png^techage_steel_tiles_top2.png^[transformR180]", - "techage_collider_magnet.png^techage_appl_hole_ta5_pipe2.png^techage_steel_tiles_top2.png^[transformR270]", - "techage_steel_tiles.png", - "techage_collider_magnet.png^techage_steel_tiles_side.png^[transformR180]", - "techage_collider_magnet.png^techage_steel_tiles_side.png", - "techage_steel_tiles.png", - }, - after_place_node = function(pos, placer, itemstack) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - ta_rotate_node = function(pos, node, new_param2) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -power.register_nodes({"techage:ta5_magnet1"}, Cable, "con", {"B"}) -liquid.register_nodes({"techage:ta5_magnet1", "techage:ta5_magnet2"}, Pipe, "tank", {"U", "D"}, { - capa = CAPACITY, - peek = function(pos, indir) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_put(nvm, name, amount, CAPACITY) - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - return liquid.srv_take(nvm, name, amount) - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - liquid.srv_put(nvm, name, amount, CAPACITY) - end, -}) - -local function check_plasma(pos, param2) - local pos1 = networks.get_relpos(pos, "F", param2) - local node = minetest.get_node(pos1) or {} - return node.name == "air" -end - -local function swap_plasma(pos, name, param2) - local pos1 = networks.get_relpos(pos, "F", param2) - minetest.swap_node(pos1, {name = name, param2 = param2}) -end - -local function check_shell(pos, param2) - local pos1 = networks.get_relpos(pos, "D", param2) - local pos2 = networks.get_relpos(pos, "BU", param2) - local _,t = minetest.find_nodes_in_area(pos1, pos2, SHELLBLOCKS) - local cnt = 0 - for k,v in pairs(t) do - cnt = cnt + v - end - return cnt == 6 -end - -local function check_nucleus(pos, param2) - local pos1 = networks.get_relpos(pos, "B", param2) - local node = minetest.get_node(pos1) or {} - if node.name == "techage:ta5_fr_nucleus" then - return pos1 - end -end - -local function on_receive(pos, tlib2, topic, payload) - --print("on_receive", topic) - local nvm = techage.get_nvm(pos) - if topic == "on" then - nvm.running = true - elseif topic == "off" then - nvm.running = false - end -end - -local function rst_power(nvm) - nvm.power = 0 - return true -end - -local function inc_power(nvm) - nvm.power = nvm.power or 0 - if nvm.power < 0 then nvm.power = 0 end - nvm.power = nvm.power + 1 - return nvm.power <= 2 -end - -local function dec_power(nvm) - nvm.power = nvm.power or 0 - if nvm.power > 0 then nvm.power = 0 end - nvm.power = nvm.power - 1 - return nvm.power >= -2 -end - -local function on_request(pos, tlib2, topic) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - if tlib2 == Cable then - if topic == "connect" then - return true - elseif topic == "inc_power" then - return inc_power(nvm) - elseif topic == "test_plasma" then - local node = minetest.get_node(pos) or {} - return check_plasma(pos, node.param2) - elseif topic == "test_shell" then - local node = minetest.get_node(pos) or {} - return check_shell(pos, node.param2) - elseif topic == "test_nucleus" then - local node = minetest.get_node(pos) or {} - return check_nucleus(pos, node.param2) - elseif topic == "no_gas" then - nvm.liquid.amount = 0 - return true - end - else -- Pipe - if topic == "dec_power" then - return dec_power(nvm) - elseif topic == "test_pipe_blue" then - nvm.test_pipe = true - return true - elseif topic == "test_pipe_green" then - local res = nvm.test_pipe - nvm.test_pipe = false - return res - elseif topic == "test_gas_blue" then - nvm.has_gas = true - return nvm.liquid.amount == CAPACITY - elseif topic == "test_gas_green" then - local res = nvm.has_gas - nvm.has_gas = false - return res - end - end - if topic == "rst_power" then - return rst_power(nvm) - end - return false -end - -control.register_nodes({"techage:ta5_magnet1", "techage:ta5_magnet2"}, { - on_receive = on_receive, - on_request = on_request, - } -) - -minetest.register_craftitem("techage:ta5_magnet_blank", { - description = S("TA5 Fusion Reactor Magnet Blank"), - inventory_image = "techage_collider_magnet.png^techage_appl_hole_electric.png", -}) - -minetest.register_craftitem("techage:ta5_magnet_shield", { - description = S("TA5 Fusion Reactor Magnet Shield"), - inventory_image = "techage_steel_tiles.png", -}) - -techage.furnace.register_recipe({ - output = "techage:ta5_magnet_shield 2", - recipe = {"default:steel_ingot", "techage:usmium_powder", "techage:graphite_powder"}, - time = 2, - -}) - -minetest.register_craft({ - output = "techage:ta5_magnet_blank 2", - recipe = { - {'default:steel_ingot', 'techage:electric_cableS', 'techage:aluminum'}, - {'techage:ta5_pipe1S', 'basic_materials:gold_wire', 'techage:ta5_pipe2S'}, - {'techage:aluminum', 'dye:brown', 'default:steel_ingot'}, - }, -}) - -minetest.register_craft({ - output = "techage:ta5_magnet1", - recipe = { - {'', 'techage:ta5_magnet_shield', 'techage:ta5_magnet_blank'}, - {'', '', ''}, - {'', '', ''}, - }, -}) - -minetest.register_craft({ - output = "techage:ta5_magnet2", - recipe = { - {'', 'techage:ta5_magnet_shield', 'techage:ta5_magnet_blank'}, - {'', '', 'techage:ta5_magnet_shield'}, - {'', '', ''}, - }, -}) diff --git a/techage/fusion_reactor/shell.lua b/techage/fusion_reactor/shell.lua deleted file mode 100644 index b2f1fcc..0000000 --- a/techage/fusion_reactor/shell.lua +++ /dev/null @@ -1,63 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Fusion Reactor Shell - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -minetest.register_node("techage:ta5_fr_shell", { - description = S("TA5 Fusion Reactor Shell"), - tiles = { - "techage_reactor_shell.png", - }, - drawtype = "nodebox", - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = "blend", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta5_fr_nucleus", { - description = S("TA5 Fusion Reactor Nucleus"), - tiles = { - "techage_reactor_shell.png^techage_collider_detector_core.png", - }, - drawtype = "nodebox", - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = "blend", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -techage.furnace.register_recipe({ - output = "techage:ta5_fr_shell 3", - recipe = {'techage:ta4_colliderblock', 'techage:ta4_colliderblock', "techage:graphite_powder"}, - time = 24, -}) - -minetest.register_craft({ - output = "techage:ta5_fr_nucleus", - recipe = { - {"", "techage:ta5_aichip2", ""}, - {"techage:electric_cableS", "techage:cylinder_large_hydrogen", "techage:ta3_valve_open"}, - {"", "techage:ta5_fr_shell", ""}, - }, -}) - diff --git a/techage/fusion_reactor/ta5_pump.lua b/techage/fusion_reactor/ta5_pump.lua deleted file mode 100644 index 9a8a299..0000000 --- a/techage/fusion_reactor/ta5_pump.lua +++ /dev/null @@ -1,224 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Pump - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe2 = techage.LiquidPipe -local Pipe3 = techage.GasPipe -local liquid = networks.liquid -local Flip = networks.Flip - -local STANDBY_TICKS = 16 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 -local CAPA = 4 - -local WRENCH_MENU = {{ - type = "output", - name = "flowrate", - label = S("Total flow rate"), - tooltip = S("Total flow rate in liquid units"), -},{ - type = "dropdown", - choices = "normal,reverse", - name = "operation", - label = S("Operation"), - tooltip = S("Pump direction"), - values = {0, 1}, - default = "1", -}} - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_pump", - node_name_active = "techage:ta5_pump_on", - infotext_name = S("TA5 Pump"), - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, -}) - -local function pumping(pos, nvm) - local outdir = M(pos):get_int("outdir") - local reverse = M(pos):get_int("operation") - if reverse == 1 then - local taken, name = liquid.take(pos, Pipe3, outdir, nil, CAPA) - if taken > 0 then - local leftover = liquid.put(pos, Pipe2, Flip[outdir], name, taken) - if leftover and leftover > 0 then - liquid.untake(pos, Pipe3, outdir, name, leftover) - if leftover == taken then - State:blocked(pos, nvm) - return 0 - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return taken - leftover - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return taken - end - else - local taken, name = liquid.take(pos, Pipe2, Flip[outdir], nil, CAPA) - if taken > 0 then - local leftover = liquid.put(pos, Pipe3, outdir, name, taken) - if leftover and leftover > 0 then - liquid.untake(pos, Pipe2, Flip[outdir], name, leftover) - if leftover == taken then - State:blocked(pos, nvm) - return 0 - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return taken - leftover - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return taken - end - end - State:idle(pos, nvm) - return 0 -end - -local function after_place_node(pos, placer) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta5_pump") - State:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe2:after_place_node(pos) - Pipe3:after_place_node(pos) -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.flowrate = (nvm.flowrate or 0) + pumping(pos, nvm) - return State:is_active(nvm) -end - -local function on_rightclick(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - if node.name == "techage:ta5_pump" then - State:start(pos, nvm) - elseif node.name == "techage:ta5_pump_on" then - State:stop(pos, nvm) - end -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe2:after_dig_node(pos) - Pipe3:after_dig_node(pos) - techage.del_mem(pos) -end - -local tiles_pas = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_hole_ta5_pipe2.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta5.png^[transformFX", - "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta5.png", -} - -local tiles_act = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_hole_ta5_pipe2.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta5.png", - { - name = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta5.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, -} - -minetest.register_node("techage:ta5_pump", { - description = S("TA5 Pump"), - tiles = tiles_pas, - after_place_node = after_place_node, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_dig_node = after_dig_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - ta4_formspec = WRENCH_MENU, -}) - -minetest.register_node("techage:ta5_pump_on", { - description = S("TA5 Pump"), - tiles = tiles_act, - --after_place_node = after_place_node4, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_dig_node = after_dig_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -techage.register_node({"techage:ta5_pump", "techage:ta5_pump_on"}, { - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - --- Pumps have to provide one output and one input side -liquid.register_nodes({ - "techage:ta5_pump", "techage:ta5_pump_on", -}, Pipe2, "pump", {"L"}, {}) - -liquid.register_nodes({ - "techage:ta5_pump", "techage:ta5_pump_on", -}, Pipe3, "pump", {"R"}, {}) - -minetest.register_craft({ - output = "techage:ta5_pump", - recipe = { - {"techage:aluminum", "dye:red", "default:steel_ingot"}, - {"techage:ta4_pipeS", "techage:ta5_ceramic_turbine", "techage:ta5_pipe1S"}, - {"default:steel_ingot", "basic_materials:motor", "techage:aluminum"}, - }, -}) diff --git a/techage/fusion_reactor/turbine.lua b/techage/fusion_reactor/turbine.lua deleted file mode 100644 index 1f5a6fa..0000000 --- a/techage/fusion_reactor/turbine.lua +++ /dev/null @@ -1,170 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Gas Turbine - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe - -local function generator_cmnd(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, nil, - {"techage:ta5_generator", "techage:ta5_generator_on"}) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_turbine", { - pos = pos, - gain = 0.4, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -minetest.register_node("techage:ta5_turbine", { - description = S("TA5 Turbine"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta5.png^[transformFX", - "techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta5.png", - }, - - after_place_node = function(pos) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode) - stop_sound(pos) - Pipe:after_dig_node(pos) - techage.del_mem(pos) - end, - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta5_turbine_on", { - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_pipe.png", - { - name = "techage_filling4_ta4.png^techage_appl_turbine4.png^techage_frame4_ta5.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta4.png^techage_appl_turbine4.png^techage_frame4_ta5.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - - tubelib2_on_update2 = function(pos, outdir, tlib2, node) - swap_node(pos, "techage:ta5_turbine") - stop_sound(pos) - generator_cmnd(pos, "stop") - end, - networks = { - pipe2 = {}, - }, - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:ta5_turbine", "techage:ta5_turbine_on"}) -Pipe:set_valid_sides("techage:ta5_turbine", {"L", "U"}) -Pipe:set_valid_sides("techage:ta5_turbine_on", {"L", "U"}) - -techage.register_node({"techage:ta5_turbine", "techage:ta5_turbine_on"}, { - -- used by heatexchanger1 - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then - return generator_cmnd(pos, topic, payload) - elseif topic == "start" then - swap_node(pos, "techage:ta5_turbine_on") - play_sound(pos) - return generator_cmnd(pos, topic, payload) - elseif topic == "stop" then - swap_node(pos, "techage:ta5_turbine") - stop_sound(pos) - return generator_cmnd(pos, topic, payload) - elseif topic == "turbine" then - return true - else - return generator_cmnd(pos, topic, payload) - end - end, - on_node_load = function(pos, node) - if node.name == "techage:ta5_turbine_on" then - play_sound(pos) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta5_turbine", - recipe = { - {"", "dye:red", ""}, - {"", "techage:turbine", ""}, - {"", "techage:ta5_ceramic_turbine", ""}, - }, -}) diff --git a/techage/hydrogen/electrolyzer.lua b/techage/hydrogen/electrolyzer.lua deleted file mode 100644 index b9f256b..0000000 --- a/techage/hydrogen/electrolyzer.lua +++ /dev/null @@ -1,370 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Electrolyzer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 3 -local PWR_NEEDED = 35 -local PWR_UNITS_PER_HYDROGEN_ITEM = 80 -local CAPACITY = 200 -local TURNOFF_THRESHOLD = "40%" - -local function evaluate_percent(s) - return (tonumber(s:sub(1, -2)) or 0) / 100 -end - -local function formspec(self, pos, nvm) - local amount = (nvm.liquid and nvm.liquid.amount) or 0 - local lqd_name = (nvm.liquid and nvm.liquid.name) or "techage:liquid" - local arrow = "image[3,1.5;1,1;techage_form_arrow_bg.png^[transformR270]" - if techage.is_running(nvm) then - arrow = "image[3,1.5;1,1;techage_form_arrow_fg.png^[transformR270]" - end - if amount > 0 then - lqd_name = lqd_name .. " " .. amount - end - return "size[6,4]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;5.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("Electrolyzer")) .. "]" .. - techage.wrench_tooltip(5.4, -0.1).. - techage.formspec_power_bar(pos, 0.1, 0.8, S("Electricity"), nvm.taken, PWR_NEEDED) .. - arrow .. - "image_button[3,2.5;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3,2.5;1,1;" .. self:get_state_tooltip(nvm) .. "]" .. - techage.item_image(4.5,2, lqd_name) -end - -local function can_start(pos, nvm, state) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - - if nvm.liquid.amount < CAPACITY then - return true - end - return S("Storage full") -end - -local function start_node(pos, nvm, state) - nvm.taken = 0 - nvm.reduction = evaluate_percent(M(pos):get_string("reduction")) - nvm.turnoff = evaluate_percent(M(pos):get_string("turnoff")) -end - -local function stop_node(pos, nvm, state) - nvm.taken = 0 - nvm.running = nil -- legacy -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_electrolyzer", - node_name_active = "techage:ta4_electrolyzer_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = S("TA4 Electrolyzer"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function generating(pos, nvm) - nvm.num_pwr_units = nvm.num_pwr_units or 0 - nvm.countdown = nvm.countdown or 0 - if nvm.taken > 0 then - nvm.num_pwr_units = nvm.num_pwr_units + (nvm.taken or 0) - if nvm.num_pwr_units >= PWR_UNITS_PER_HYDROGEN_ITEM then - nvm.liquid.amount = nvm.liquid.amount + 1 - nvm.liquid.name = "techage:hydrogen" - nvm.num_pwr_units = nvm.num_pwr_units - PWR_UNITS_PER_HYDROGEN_ITEM - end - end -end - --- converts power into hydrogen -local function node_timer(pos, elapsed) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - - if nvm.liquid.amount < CAPACITY then - local in_dir = meta:get_int("in_dir") - local curr_load = power.get_storage_load(pos, Cable, in_dir, 1) - if curr_load > (nvm.turnoff or 0) then - local to_be_taken = PWR_NEEDED * (nvm.reduction or 1) - nvm.taken = power.consume_power(pos, Cable, in_dir, to_be_taken) or 0 - local running = techage.is_running(nvm) - if not running and nvm.taken == to_be_taken then - State:start(pos, nvm) - elseif running and nvm.taken < to_be_taken then - State:nopower(pos, nvm) - elseif running then - generating(pos, nvm) - State:keep_running(pos, nvm, 1) - end - elseif curr_load == 0 then - nvm.taken = 0 - State:nopower(pos, nvm) - else - nvm.taken = 0 - State:standby(pos, nvm, S("Turnoff point reached")) - end - else - nvm.taken = 0 - State:blocked(pos, nvm, S("Storage full")) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return true -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, player) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - nvm.running = false - nvm.num_pwr_units = 0 - local number = techage.add_node(pos, "techage:ta4_electrolyzer") - State:node_init(pos, nvm, number) - local node = minetest.get_node(pos) - M(pos):set_int("in_dir", techage.side_to_indir("R", node.param2)) - M(pos):set_string("reduction", "100%") - M(pos):set_string("turnoff", TURNOFF_THRESHOLD) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) -end - -local function put(pos, indir, name, amount) - local leftover = liquid.srv_put(pos, indir, name, amount) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover -end - -local tool_config = { - { - type = "const", - name = "needed", - label = S("Maximum power consumption [ku]"), - tooltip = S("Maximum possible\ncurrent consumption"), - value = PWR_NEEDED, - }, - { - type = "dropdown", - choices = "20%,40%,60%,80%,100%", - name = "reduction", - label = S("Current limitation"), - tooltip = S("Configurable value\nfor the current limit"), - default = "100%", - }, - { - type = "dropdown", - choices = "0%,20%,40%,60%,80%,98%", - name = "turnoff", - label = S("Turnoff point"), - tooltip = S("If the charge of the storage\nsystem falls below the configured value,\nthe block switches off"), - default = TURNOFF_THRESHOLD, - }, -} - -minetest.register_node("techage:ta4_electrolyzer", { - description = S("TA4 Electrolyzer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_electrolyzer.png^techage_appl_ctrl_unit.png^[transformFX", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_electrolyzer.png^techage_appl_ctrl_unit.png", - }, - - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - return liquid.is_empty(pos) - end, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_punch = liquid.on_punch, - on_receive_fields = on_receive_fields, - on_timer = node_timer, - on_rightclick = on_rightclick, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - ta3_formspec = tool_config, -}) - -minetest.register_node("techage:ta4_electrolyzer_on", { - description = S("TA4 Electrolyzer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - { - name = "techage_filling4_ta4.png^techage_frame4_ta4.png^techage_appl_electrolyzer4.png^techage_appl_ctrl_unit4.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - { - name = "techage_filling4_ta4.png^techage_frame4_ta4.png^techage_appl_electrolyzer4.png^techage_appl_ctrl_unit4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - }, - - on_receive_fields = on_receive_fields, - on_punch = liquid.on_punch, - on_timer = node_timer, - on_rightclick = on_rightclick, - - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - diggable = false, - paramtype = "light", - light_source = 6, - ta3_formspec = tool_config, -}) - -local liquid_def = { - capa = CAPACITY, - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return amount, name - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end, -} - -liquid.register_nodes({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"}, Pipe, "tank", {"R"}, liquid_def) -power.register_nodes({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"}, Cable, "con", {"L"}) - -techage.register_node({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "load" then - return techage.power.percent(CAPACITY, (nvm.liquid and nvm.liquid.amount) or 0) - elseif topic == "delivered" then - return -math.floor((nvm.taken or 0) + 0.5) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 134 and payload[1] == 1 then - return 0, {techage.power.percent(CAPACITY, (nvm.liquid and nvm.liquid.amount) or 0)} - elseif topic == 135 then - return 0, {math.floor((nvm.provided or 0) + 0.5)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos, node) - local meta = M(pos) - if not meta:contains("reduction") then - meta:set_string("reduction", "100%") - meta:set_string("turnoff", TURNOFF_THRESHOLD) - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_electrolyzer", - recipe = { - {'default:steel_ingot', 'dye:blue', 'default:steel_ingot'}, - {'techage:electric_cableS', 'default:glass', 'techage:ta3_pipeS'}, - {'default:steel_ingot', "techage:ta4_wlanchip", 'default:steel_ingot'}, - }, -}) diff --git a/techage/hydrogen/fuelcell.lua b/techage/hydrogen/fuelcell.lua deleted file mode 100644 index 1a583dd..0000000 --- a/techage/hydrogen/fuelcell.lua +++ /dev/null @@ -1,350 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Fuel Cell - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local control = networks.control - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 2 -local PWR_PERF = 34 -local PWR_UNITS_PER_HYDROGEN_ITEM = 75 -local CAPACITY = 100 - -local function formspec(self, pos, nvm) - local amount = (nvm.liquid and nvm.liquid.amount) or 0 - local lqd_name = (nvm.liquid and nvm.liquid.name) or "techage:liquid" - local arrow = "image[2,1.5;1,1;techage_form_arrow_bg.png^[transformR270]" - if techage.is_running(nvm) then - arrow = "image[2,1.5;1,1;techage_form_arrow_fg.png^[transformR270]" - end - if amount > 0 then - lqd_name = lqd_name.." "..amount - end - return "size[6,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;5.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize( "#000000", S("Fuel Cell")).."]".. - techage.item_image(0.5,2, lqd_name).. - arrow.. - "image_button[2,2.5;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2,2.5;1,1;"..self:get_state_tooltip(nvm).."]".. - techage.formspec_power_bar(pos, 3.5, 0.8, S("Electricity"), nvm.provided, PWR_PERF) -end - -local function has_hydrogen(nvm) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - nvm.num_pwr_units = nvm.num_pwr_units or 0 - return nvm.num_pwr_units > 0 or (nvm.liquid.amount > 0 and nvm.liquid.name == "techage:hydrogen") -end - -local function can_start(pos, nvm, state) - if has_hydrogen(nvm) then - return true - end - return S("no hydrogen") -end - - -local function consuming(pos, nvm) - if nvm.num_pwr_units <= 0 then - nvm.num_pwr_units = nvm.num_pwr_units + PWR_UNITS_PER_HYDROGEN_ITEM - nvm.liquid.amount = nvm.liquid.amount - 1 - end - nvm.num_pwr_units = nvm.num_pwr_units - nvm.provided -end - -local function start_node(pos, nvm, state) - local meta = M(pos) - nvm.provided = 0 - local outdir = meta:get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) - techage.evaluate_charge_termination(nvm, meta) -end - -local function stop_node(pos, nvm, state) - nvm.provided = 0 - nvm.running = nil -- legacy - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_fuelcell", - node_name_active = "techage:ta4_fuelcell_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = S("TA4 Fuel Cell"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - local hydro = has_hydrogen(nvm) - if running and not hydro then - State:standby(pos, nvm, S("no hydrogen")) - stop_node(pos, nvm, State) - elseif not running and hydro then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local meta = M(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) - local val = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - if val > 0 then - nvm.load = val - end - consuming(pos, nvm) - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - nvm.num_pwr_units = 0 - local number = techage.add_node(pos, "techage:ta4_fuelcell") - State:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - local inv = M(pos):get_inventory() - inv:set_size('src', 4) - inv:set_stack('src', 2, {name = "techage:gasoline", count = 60}) - inv:set_stack('src', 4, {name = "techage:gasoline", count = 60}) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -minetest.register_node("techage:ta4_fuelcell", { - description = S("TA4 Fuel Cell"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_fuelcell.png^techage_appl_ctrl_unit.png^[transformFX", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_fuelcell.png^techage_appl_ctrl_unit.png", - }, - - can_dig = function(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - return liquid.is_empty(pos) - end, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - on_punch = liquid.on_punch, - on_receive_fields = on_receive_fields, - on_timer = node_timer, - on_rightclick = on_rightclick, - ta4_formspec = techage.generator_settings("ta4", PWR_PERF), - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, -}) - -minetest.register_node("techage:ta4_fuelcell_on", { - description = S("TA4 Fuel Cell"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_pipe.png", - { - name = "techage_filling4_ta4.png^techage_frame4_ta4.png^techage_appl_fuelcell4.png^techage_appl_ctrl_unit4.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - { - name = "techage_filling4_ta4.png^techage_frame4_ta4.png^techage_appl_fuelcell4.png^techage_appl_ctrl_unit4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - }, - - get_generator_data = get_generator_data, - on_receive_fields = on_receive_fields, - on_punch = liquid.on_punch, - on_timer = node_timer, - on_rightclick = on_rightclick, - ta4_formspec = techage.generator_settings("ta4", PWR_PERF), - - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - diggable = false, - paramtype = "light", - light_source = 6, -}) - -local liquid_def = { - capa = CAPACITY, - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return amount, name - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end, -} - -liquid.register_nodes({"techage:ta4_fuelcell", "techage:ta4_fuelcell_on"}, Pipe, "tank", {"L"}, liquid_def) -power.register_nodes({"techage:ta4_fuelcell", "techage:ta4_fuelcell_on"}, Cable, "gen", {"R"}) - -minetest.register_alias_force("techage:ta4_fuelcell2", "techage:ta4_fuelcell") -minetest.register_alias_force("techage:ta4_fuelcell2_on", "techage:ta4_fuelcell_on") - -techage.register_node({"techage:ta4_fuelcell", "techage:ta4_fuelcell_on"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "load" then - return techage.power.percent(CAPACITY, (nvm.liquid and nvm.liquid.amount) or 0) - elseif topic == "delivered" then - return math.floor((nvm.provided or 0) + 0.5) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 134 and payload[1] == 1 then - return 0, {techage.power.percent(CAPACITY, (nvm.liquid and nvm.liquid.amount) or 0)} - elseif topic == 135 then - return 0, {math.floor((nvm.provided or 0) + 0.5)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, -}) - -control.register_nodes({"techage:ta4_fuelcell", "techage:ta4_fuelcell_on"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Fuel Cell"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_fuelcell", - recipe = { - {'default:steel_ingot', 'dye:blue', 'default:steel_ingot'}, - {'techage:ta3_pipeS', 'techage:ta4_fuelcellstack', 'techage:electric_cableS'}, - {'default:steel_ingot', "techage:ta4_wlanchip", 'default:steel_ingot'}, - }, -}) diff --git a/techage/hydrogen/fuelcellstack.lua b/techage/hydrogen/fuelcellstack.lua deleted file mode 100644 index 6bc14f7..0000000 --- a/techage/hydrogen/fuelcellstack.lua +++ /dev/null @@ -1,33 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Hydrogen - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:ta4_fuelcellstack", { - description = S("TA4 Fuel Cell Stack"), - inventory_image = "techage_fc_stack_inv.png", -}) - -minetest.register_craft({ - output = "techage:ta4_fuelcellstack", - recipe = { - {'default:copper_ingot', 'techage:ta4_carbon_fiber', 'default:copper_ingot'}, - {'techage:baborium_ingot', 'techage:ta4_carbon_fiber', 'techage:baborium_ingot'}, - {"techage:canister_lye", 'techage:ta4_carbon_fiber', "techage:canister_lye"}, - }, - replacements = { - {"techage:canister_lye", "techage:ta3_canister_empty"}, - {"techage:canister_lye", "techage:ta3_canister_empty"}, - } -}) diff --git a/techage/i18n.py b/techage/i18n.py deleted file mode 100755 index e66de31..0000000 --- a/techage/i18n.py +++ /dev/null @@ -1,459 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Script to generate the template file and update the translation files. -# Copy the script into the mod or modpack root folder and run it there. -# -# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer -# LGPLv2.1+ -# -# See https://github.com/minetest-tools/update_translations for -# potential future updates to this script. - -from __future__ import print_function -import os, fnmatch, re, shutil, errno -from sys import argv as _argv -from sys import stderr as _stderr - -# Running params -params = {"recursive": False, - "help": False, - "mods": False, - "verbose": False, - "folders": [], - "no-old-file": False, - "break-long-lines": False, - "sort": False -} -# Available CLI options -options = {"recursive": ['--recursive', '-r'], - "help": ['--help', '-h'], - "mods": ['--installed-mods', '-m'], - "verbose": ['--verbose', '-v'], - "no-old-file": ['--no-old-file', '-O'], - "break-long-lines": ['--break-long-lines', '-b'], - "sort": ['--sort', '-s'] -} - -# Strings longer than this will have extra space added between -# them in the translation files to make it easier to distinguish their -# beginnings and endings at a glance -doublespace_threshold = 80 - -def set_params_folders(tab: list): - '''Initialize params["folders"] from CLI arguments.''' - # Discarding argument 0 (tool name) - for param in tab[1:]: - stop_param = False - for option in options: - if param in options[option]: - stop_param = True - break - if not stop_param: - params["folders"].append(os.path.abspath(param)) - -def set_params(tab: list): - '''Initialize params from CLI arguments.''' - for option in options: - for option_name in options[option]: - if option_name in tab: - params[option] = True - break - -def print_help(name): - '''Prints some help message.''' - print(f'''SYNOPSIS - {name} [OPTIONS] [PATHS...] -DESCRIPTION - {', '.join(options["help"])} - prints this help message - {', '.join(options["recursive"])} - run on all subfolders of paths given - {', '.join(options["mods"])} - run on locally installed modules - {', '.join(options["no-old-file"])} - do not create *.old files - {', '.join(options["sort"])} - sort output strings alphabetically - {', '.join(options["break-long-lines"])} - add extra line breaks before and after long strings - {', '.join(options["verbose"])} - add output information -''') - - -def main(): - '''Main function''' - set_params(_argv) - set_params_folders(_argv) - if params["help"]: - print_help(_argv[0]) - elif params["recursive"] and params["mods"]: - print("Option --installed-mods is incompatible with --recursive") - else: - # Add recursivity message - print("Running ", end='') - if params["recursive"]: - print("recursively ", end='') - # Running - if params["mods"]: - print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") - run_all_subfolders("~/.minetest/mods") - elif len(params["folders"]) >= 2: - print("on folder list:", params["folders"]) - for f in params["folders"]: - if params["recursive"]: - run_all_subfolders(f) - else: - update_folder(f) - elif len(params["folders"]) == 1: - print("on folder", params["folders"][0]) - if params["recursive"]: - run_all_subfolders(params["folders"][0]) - else: - update_folder(params["folders"][0]) - else: - print("on folder", os.path.abspath("./")) - if params["recursive"]: - run_all_subfolders(os.path.abspath("./")) - else: - update_folder(os.path.abspath("./")) - -#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') -#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote -pattern_lua_s = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) -pattern_lua_fs = re.compile(r'[\.=^\t,{\(\s]N?FS\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) -pattern_lua_bracketed_s = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) -pattern_lua_bracketed_fs = re.compile(r'[\.=^\t,{\(\s]N?FS\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) - -# Handles "concatenation" .. " of strings" -pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) - -pattern_tr = re.compile(r'(.*?[^@])=(.*)') -pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') -pattern_tr_filename = re.compile(r'\.tr$') -pattern_po_language_code = re.compile(r'(.*)\.po$') - -#attempt to read the mod's name from the mod.conf file. Returns None on failure -def get_modname(folder): - try: - with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: - for line in mod_conf: - match = pattern_name.match(line) - if match: - return match.group(1) - except FileNotFoundError: - pass - return None - -#If there are already .tr files in /locale, returns a list of their names -def get_existing_tr_files(folder): - out = [] - for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): - for name in files: - if pattern_tr_filename.search(name): - out.append(name) - return out - -# A series of search and replaces that massage a .po file's contents into -# a .tr file's equivalent -def process_po_file(text): - # The first three items are for unused matches - text = re.sub(r'#~ msgid "', "", text) - text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) - text = re.sub(r'"\n#~ msgstr "', "=", text) - # comment lines - text = re.sub(r'#.*\n', "", text) - # converting msg pairs into "=" pairs - text = re.sub(r'msgid "', "", text) - text = re.sub(r'"\nmsgstr ""\n"', "=", text) - text = re.sub(r'"\nmsgstr "', "=", text) - # various line breaks and escape codes - text = re.sub(r'"\n"', "", text) - text = re.sub(r'"\n', "\n", text) - text = re.sub(r'\\"', '"', text) - text = re.sub(r'\\n', '@n', text) - # remove header text - text = re.sub(r'=Project-Id-Version:.*\n', "", text) - # remove double-spaced lines - text = re.sub(r'\n\n', '\n', text) - return text - -# Go through existing .po files and, if a .tr file for that language -# *doesn't* exist, convert it and create it. -# The .tr file that results will subsequently be reprocessed so -# any "no longer used" strings will be preserved. -# Note that "fuzzy" tags will be lost in this process. -def process_po_files(folder, modname): - for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): - for name in files: - code_match = pattern_po_language_code.match(name) - if code_match == None: - continue - language_code = code_match.group(1) - tr_name = modname + "." + language_code + ".tr" - tr_file = os.path.join(root, tr_name) - if os.path.exists(tr_file): - if params["verbose"]: - print(f"{tr_name} already exists, ignoring {name}") - continue - fname = os.path.join(root, name) - with open(fname, "r", encoding='utf-8') as po_file: - if params["verbose"]: - print(f"Importing translations from {name}") - text = process_po_file(po_file.read()) - with open(tr_file, "wt", encoding='utf-8') as tr_out: - tr_out.write(text) - -# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 -# Creates a directory if it doesn't exist, silently does -# nothing if it already exists -def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(path): - pass - else: raise - -# Converts the template dictionary to a text to be written as a file -# dKeyStrings is a dictionary of localized string to source file sets -# dOld is a dictionary of existing translations and comments from -# the previous version of this text -def strings_to_text(dkeyStrings, dOld, mod_name, header_comments): - lOut = [f"# textdomain: {mod_name}\n"] - if header_comments is not None: - lOut.append(header_comments) - - dGroupedBySource = {} - - for key in dkeyStrings: - sourceList = list(dkeyStrings[key]) - if params["sort"]: - sourceList.sort() - sourceString = "\n".join(sourceList) - listForSource = dGroupedBySource.get(sourceString, []) - listForSource.append(key) - dGroupedBySource[sourceString] = listForSource - - lSourceKeys = list(dGroupedBySource.keys()) - lSourceKeys.sort() - for source in lSourceKeys: - localizedStrings = dGroupedBySource[source] - if params["sort"]: - localizedStrings.sort() - lOut.append("") - lOut.append(source) - lOut.append("") - for localizedString in localizedStrings: - val = dOld.get(localizedString, {}) - translation = val.get("translation", "") - comment = val.get("comment") - if params["break-long-lines"] and len(localizedString) > doublespace_threshold and not lOut[-1] == "": - lOut.append("") - if comment != None: - lOut.append(comment) - lOut.append(f"{localizedString}={translation}") - if params["break-long-lines"] and len(localizedString) > doublespace_threshold: - lOut.append("") - - - unusedExist = False - for key in dOld: - if key not in dkeyStrings: - val = dOld[key] - translation = val.get("translation") - comment = val.get("comment") - # only keep an unused translation if there was translated - # text or a comment associated with it - if translation != None and (translation != "" or comment): - if not unusedExist: - unusedExist = True - lOut.append("\n\n##### not used anymore #####\n") - if params["break-long-lines"] and len(key) > doublespace_threshold and not lOut[-1] == "": - lOut.append("") - if comment != None: - lOut.append(comment) - lOut.append(f"{key}={translation}") - if params["break-long-lines"] and len(key) > doublespace_threshold: - lOut.append("") - return "\n".join(lOut) + '\n' - -# Writes a template.txt file -# dkeyStrings is the dictionary returned by generate_template -def write_template(templ_file, dkeyStrings, mod_name): - # read existing template file to preserve comments - existing_template = import_tr_file(templ_file) - - text = strings_to_text(dkeyStrings, existing_template[0], mod_name, existing_template[2]) - mkdir_p(os.path.dirname(templ_file)) - with open(templ_file, "wt", encoding='utf-8') as template_file: - template_file.write(text) - - -# Gets all translatable strings from a lua file -def read_lua_file_strings(lua_file): - lOut = [] - with open(lua_file, encoding='utf-8') as text_file: - text = text_file.read() - #TODO remove comments here - - text = re.sub(pattern_concat, "", text) - - strings = [] - for s in pattern_lua_s.findall(text): - strings.append(s[1]) - for s in pattern_lua_bracketed_s.findall(text): - strings.append(s) - for s in pattern_lua_fs.findall(text): - strings.append(s[1]) - for s in pattern_lua_bracketed_fs.findall(text): - strings.append(s) - - for s in strings: - s = re.sub(r'"\.\.\s+"', "", s) - s = re.sub("@[^@=0-9]", "@@", s) - s = s.replace('\\"', '"') - s = s.replace("\\'", "'") - s = s.replace("\n", "@n") - s = s.replace("\\n", "@n") - s = s.replace("=", "@=") - lOut.append(s) - return lOut - -# Gets strings from an existing translation file -# returns both a dictionary of translations -# and the full original source text so that the new text -# can be compared to it for changes. -# Returns also header comments in the third return value. -def import_tr_file(tr_file): - dOut = {} - text = None - header_comment = None - if os.path.exists(tr_file): - with open(tr_file, "r", encoding='utf-8') as existing_file : - # save the full text to allow for comparison - # of the old version with the new output - text = existing_file.read() - existing_file.seek(0) - # a running record of the current comment block - # we're inside, to allow preceeding multi-line comments - # to be retained for a translation line - latest_comment_block = None - for line in existing_file.readlines(): - line = line.rstrip('\n') - if line[:3] == "###": - if header_comment is None: - # Save header comments - header_comment = latest_comment_block - # Stip textdomain line - tmp_h_c = "" - for l in header_comment.split('\n'): - if not l.startswith("# textdomain:"): - tmp_h_c += l + '\n' - header_comment = tmp_h_c - - # Reset comment block if we hit a header - latest_comment_block = None - continue - if line[:1] == "#": - # Save the comment we're inside - if not latest_comment_block: - latest_comment_block = line - else: - latest_comment_block = latest_comment_block + "\n" + line - continue - match = pattern_tr.match(line) - if match: - # this line is a translated line - outval = {} - outval["translation"] = match.group(2) - if latest_comment_block: - # if there was a comment, record that. - outval["comment"] = latest_comment_block - latest_comment_block = None - dOut[match.group(1)] = outval - return (dOut, text, header_comment) - -# Walks all lua files in the mod folder, collects translatable strings, -# and writes it to a template.txt file -# Returns a dictionary of localized strings to source file sets -# that can be used with the strings_to_text function. -def generate_template(folder, mod_name): - dOut = {} - for root, dirs, files in os.walk(folder): - for name in files: - if fnmatch.fnmatch(name, "*.lua"): - fname = os.path.join(root, name) - found = read_lua_file_strings(fname) - if params["verbose"]: - print(f"{fname}: {str(len(found))} translatable strings") - - for s in found: - sources = dOut.get(s, set()) - sources.add(f"### {os.path.basename(fname)} ###") - dOut[s] = sources - - if len(dOut) == 0: - return None - templ_file = os.path.join(folder, "locale/template.txt") - write_template(templ_file, dOut, mod_name) - return dOut - -# Updates an existing .tr file, copying the old one to a ".old" file -# if any changes have happened -# dNew is the data used to generate the template, it has all the -# currently-existing localized strings -def update_tr_file(dNew, mod_name, tr_file): - if params["verbose"]: - print(f"updating {tr_file}") - - tr_import = import_tr_file(tr_file) - dOld = tr_import[0] - textOld = tr_import[1] - - textNew = strings_to_text(dNew, dOld, mod_name, tr_import[2]) - - if textOld and textOld != textNew: - print(f"{tr_file} has changed.") - if not params["no-old-file"]: - shutil.copyfile(tr_file, f"{tr_file}.old") - - with open(tr_file, "w", encoding='utf-8') as new_tr_file: - new_tr_file.write(textNew) - -# Updates translation files for the mod in the given folder -def update_mod(folder): - modname = get_modname(folder) - if modname is not None: - process_po_files(folder, modname) - print(f"Updating translations for {modname}") - data = generate_template(folder, modname) - if data == None: - print(f"No translatable strings found in {modname}") - else: - for tr_file in get_existing_tr_files(folder): - update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) - else: - print(f"\033[31mUnable to find modname in folder {folder}.\033[0m", file=_stderr) - exit(1) - -# Determines if the folder being pointed to is a mod or a mod pack -# and then runs update_mod accordingly -def update_folder(folder): - is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) - if is_modpack: - subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] - for subfolder in subfolders: - update_mod(subfolder + "/") - else: - update_mod(folder) - print("Done.") - -def run_all_subfolders(folder): - for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: - update_folder(modfolder + "/") - - -_argv.append("--sort") -main() diff --git a/techage/icta_controller/action.lua b/techage/icta_controller/action.lua deleted file mode 100644 index 89ee53b..0000000 --- a/techage/icta_controller/action.lua +++ /dev/null @@ -1,107 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Action Registration - -]]-- - - -- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic - - - - --- tables with all data from action registrations -local kvRegisteredActn = {} - --- list of keys for actions -local aActnTypes = {} - --- list of titles for actions -local aActnTitles = {} - --- --- API function for action registrations --- -function techage.icta_register_action(key, tData) - table.insert(aActnTypes, key) - table.insert(aActnTitles, tData.title) - tData.__idx__ = #aActnTypes - if kvRegisteredActn[key] ~= nil then - print("[Techage] Action registration error "..key) - return - end - kvRegisteredActn[key] = tData - for _,item in ipairs(tData.formspec) do - if item.type == "textlist" then - item.tChoices = string.split(item.choices, ",") - item.num_choices = #item.tChoices - end - end -end - --- return formspec string -function techage.actn_formspec(row, kvSelect) - return techage.submenu_generate_formspec( - row, "actn", "Action type", aActnTypes, aActnTitles, kvRegisteredActn, kvSelect) -end - --- evaluate the row action input --- and return new data -function techage.actn_eval_input(kvSelect, fields) - kvSelect = techage.submenu_eval_input(kvRegisteredActn, aActnTypes, aActnTitles, kvSelect, fields) - return kvSelect -end - - --- return the Lua code -function techage.code_action(kvSelect, environ) - if kvSelect and kvRegisteredActn[kvSelect.choice] then - if techage.submenu_verify(environ.owner, kvRegisteredActn, kvSelect) then - return kvRegisteredActn[kvSelect.choice].code(kvSelect, environ) - end - end - return nil -end - -techage.icta_register_action("default", { - title = "", - formspec = {}, - code = function(data, environ) return false, false end, - button = function(data, environ) return "..." end, -}) - -techage.icta_register_action("print", { - title = "print to output window", - formspec = { - { - type = "ascii", - name = "text", - label = "Output the following text", - default = "", - }, - { - type = "label", - name = "lbl", - label = "Use a '*' character as reference to any\ncondition state", - }, - }, - button = function(data, environ) - return 'print("'..data.text:sub(1,12)..'")' - end, - code = function(data, environ) - return function(env, output, idx) - local text = string.gsub(data.text, "*", tostring(env.result[idx])) - output(env.pos, text) - end - end, -}) diff --git a/techage/icta_controller/battery.lua b/techage/icta_controller/battery.lua deleted file mode 100644 index 1b4082e..0000000 --- a/techage/icta_controller/battery.lua +++ /dev/null @@ -1,187 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Battery - -]]-- - - -- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local BATTERY_CAPACITY = 10000000 - -local function calc_percent(content) - local val = (BATTERY_CAPACITY - math.min(content or 0, BATTERY_CAPACITY)) - return 100 - math.floor((val * 100.0 / BATTERY_CAPACITY)) -end - -local function on_timer(pos, elapsed) - local meta = minetest.get_meta(pos) - local number = meta:get_string("node_number") - local percent = calc_percent(meta:get_int("content")) - meta:set_string("infotext", S("Battery").." "..number..": "..percent.." %") - if percent == 0 then - local node = minetest.get_node(pos) - node.name = "techage:ta4_battery_empty" - minetest.swap_node(pos, node) - return false - end - return true -end - -minetest.register_alias("techage:ta4_battery75", "techage:ta4_battery") -minetest.register_alias("techage:ta4_battery50", "techage:ta4_battery") -minetest.register_alias("techage:ta4_battery25", "techage:ta4_battery") - -minetest.register_node("techage:ta4_battery", { - description = S("Battery"), - inventory_image = 'techage_battery_inventory.png', - wield_image = 'techage_battery_inventory.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_battery_green.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer, itemstack) - local content = BATTERY_CAPACITY - if itemstack then - local stack_meta = itemstack:get_meta() - if stack_meta then - -- This ensures that dug batteries of the old system are considered full. - local string_content = stack_meta:get_string("content") - if string_content ~= "" then - -- Batteries dug in the new system are handled correctly. - content = techage.in_range(stack_meta:get_int("content"), 0, BATTERY_CAPACITY) - end - end - end - M(pos):set_int("content", content) - local number = techage.add_node(pos, "techage:ta4_battery") - M(pos):set_string("node_number", number) - on_timer(pos, 1) - minetest.get_node_timer(pos):start(30) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - on_timer = on_timer, - - preserve_metadata = function(pos, oldnode, oldmetadata, drops) - local content = M(pos):get_int("content") - - local meta = drops[1]:get_meta() - meta:set_int("content", content) - local percent = calc_percent(content) - local text = S("Battery").." ("..percent.." %)" - meta:set_string("description", text) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=1, cracky=1, crumbly=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:ta4_battery_empty", { - description = S("Battery"), - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_battery_red.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - meta:set_int("content", 0) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=1, cracky=1, crumbly=1, not_in_creative_inventory=1}, - drop = "", - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - - -if minetest.global_exists("moreores") then - minetest.register_craft({ - output = "techage:ta4_battery 2", - recipe = { - {"", "moreores:silver_ingot", ""}, - {"", "default:copper_ingot", ""}, - {"", "moreores:silver_ingot", ""}, - } - }) -else - minetest.register_craft({ - output = "techage:ta4_battery 2", - recipe = { - {"", "default:tin_ingot", ""}, - {"", "default:copper_ingot", ""}, - {"", "default:tin_ingot", ""}, - } - }) -end - -techage.register_node({"techage:ta4_battery"}, { - on_node_load = function(pos) - minetest.get_node_timer(pos):start(30) - end, - - on_recv_message = function(pos, src, topic, payload) - if topic == "load" then - local meta = minetest.get_meta(pos) - return calc_percent(meta:get_int("content")) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 134 then - local meta = minetest.get_meta(pos) - return 0, {calc_percent(meta:get_int("content"))} - else - return 2, "" - end - end, -}) diff --git a/techage/icta_controller/commands.lua b/techage/icta_controller/commands.lua deleted file mode 100644 index f6c31f5..0000000 --- a/techage/icta_controller/commands.lua +++ /dev/null @@ -1,958 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Register all controller commands - -]]-- - - -- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic - -function techage.compare(op1, op2, method) - if method == "is" then - return op1 == op2 - elseif method == "is not" then - return op1 ~= op2 - elseif method == "greater" then - return op1 > op2 - elseif method == "less" then - return op1 < op2 - end -end - -function techage.fmt_number(num) - local mtch = num:match('^(%d+).*') - if mtch and num ~= mtch then - return mtch.."..." - end - return num -end - - -techage.icta_register_condition("initial", { - title = "initial", - formspec = { - { - type = "label", - name = "lbl", - label = "Condition is true only after\ncontroller start.", - }, - }, - -- Return two chunks of executable Lua code for the controller, according: - -- return , - code = function(data, environ) - local condition = function(env, idx) - return env.ticks - end - local result = function(val) - return val == 1 - end - return condition, result - end, - button = function(data, environ) return "Initial after start" end, -}) - -techage.icta_register_condition("true", { - title = "true", - formspec = { - { - type = "label", - name = "lbl", - label = "Condition is always true.", - }, - }, - code = function(data, environ) - local condition = function(env, idx) - return true - end - local result = function(val) - return val == true - end - return condition, result - end, - button = function(data, environ) return "true" end, -}) - -techage.icta_register_condition("condition", { - title = "condition", - formspec = { - { - type = "textlist", - name = "condition", - label = "condition row number", - choices = "1,2,3,4,5,6,7,8", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "condition", - choices = "was true, was not true", - default = "was true", - }, - { - type = "label", - name = "lbl", - label = "Used to execute two or more\nactions based on one condition.", - }, - }, - code = function(data, environ) - local condition = function(env, idx) - local index = data.condition:byte(-1) - 0x30 - return env.condition[index] - end - local result = function(val) - return val == (data.operand == "was true") - end - return condition, result - end, - button = function(data, environ) return "cond("..data.condition:sub(-1,-1)..","..data.operand..")" end, -}) - -techage.icta_register_condition("input", { - title = "inputs", - formspec = { - { - type = "digits", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "operand", - choices = "is,is not", - default = "is", - }, - { - type = "textlist", - name = "value", - choices = "on,off,invalid", - default = "on", - }, - { - type = "label", - name = "lbl", - label = "An input is only available,\nif a block sends on/off\ncommands to the controller.", - }, - }, - button = function(data, environ) -- default button label - return 'inp('..techage.fmt_number(data.number)..','..data.operand.." "..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return env.input[data.number] - end - local result = function(val) - return techage.compare(val, data.value or "invalid", data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("state", { - title = "read block state", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "is,is not", - default = "is", - }, - { - type = "textlist", - name = "value", - label = "", - choices = "stopped,running,standby,blocked,nopower,fault,unloaded,invalid,on,off,empty,loaded,loading,full", - default = "stopped", - }, - { - type = "label", - name = "lbl", - label = "Read the state of a TA3/TA4 machine.\n", - }, - }, - button = function(data, environ) -- default button label - return 'sts('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "state") - end - local result = function(val) - return techage.compare(val, data.value or "invalid", data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("fuel", { - title = "read amount of fuel", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "greater,less", - default = "greater", - }, - { - type = "digits", - name = "value", - label = "than", - default = "" - }, - { - type = "label", - name = "lbl", - label = "Read and evaluate the fuel value\nof a fuel consuming block.", - }, - }, - button = function(data, environ) - return 'fuel('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "fuel") - end - local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("load", { - title = "read power/liquid load", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "greater,less", - default = "greater", - }, - { - type = "digits", - name = "value", - label = "than", - default = "" - }, - { - type = "label", - name = "lbl", - label = "Read and evaluate the load (0..100)\nof a tank/storage block.", - }, - }, - button = function(data, environ) - return 'load('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "load") - end - local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("depth", { - title = "read quarry depth", - formspec = { - { - type = "number", - name = "number", - label = "quarry number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "greater,less", - default = "greater", - }, - { - type = "digits", - name = "value", - label = "than", - default = "" - }, - { - type = "label", - name = "lbl", - label = "Read and evaluate the current\ndepth of a quarry block.", - }, - }, - button = function(data, environ) - return 'depth('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "depth") - end - local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("delivered", { - title = "read delivered power", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "greater,less", - default = "greater", - }, - { - type = "digits", - name = "value", - label = "than", - default = "" - }, - { - type = "label", - name = "lbl", - label = "Read and evaluate the delivered\npower of a generator block.\nPower consuming blocks like accus\ncould also provide a negative value.", - }, - }, - button = function(data, environ) - return 'deliv('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "delivered") - end - local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("chest", { - title = "read chest state", - formspec = { - { - type = "number", - name = "number", - label = "chest number", - default = "", - }, - { - type = "textlist", - name = "operand", - label = "", - choices = "is,is not", - default = "is", - }, - { - type = "textlist", - name = "value", - label = "", - choices = "empty,loaded,full,invalid", - default = "empty", - }, - { - type = "label", - name = "lbl", - label = "Read the state from a Techage chest\n".. - "and other similar blocks.", - }, - }, - button = function(data, environ) -- default button label - return 'chest('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "state") - end - local result = function(val) - return techage.compare(val, data.value or "invalid", data.operand) - end - return condition, result - end, -}) - -techage.icta_register_condition("signaltower", { - title = "read Signal Tower state", - formspec = { - { - type = "number", - name = "number", - label = "Signal Tower number", - default = "", - }, - { - type = "textlist", - name = "operand", - choices = "is,is not", - default = "is", - }, - { - type = "textlist", - name = "value", - choices = "off,green,amber,red,invalid", - default = "off", - }, - { - type = "label", - name = "lbl", - label = "Read the color state\nof a Signal Tower.", - }, - }, - button = function(data, environ) -- default button label - return 'tower('..techage.fmt_number(data.number)..","..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "state") - end - local result = function(val) - return techage.compare(val, data.value or "invalid", data.operand) - end - return condition, result - end, -}) - -techage.icta_register_action("signaltower", { - title = "TA4 Signal Tower", - formspec = { - { - type = "numbers", - name = "number", - label = "Signal Tower number", - default = "", - }, - { - type = "textlist", - name = "value", - label = "lamp color", - choices = "off,green,amber,red", - default = "red", - }, - { - type = "label", - name = "lbl", - label = "Turn on/off a Signal Tower lamp.", - }, - }, - button = function(data, environ) - return 'tower('..techage.fmt_number(data.number)..","..data.value..')' - end, - code = function(data, environ) - return function(env, output, idx) - techage.send_multi(environ.number, data.number, data.value) - end - end, -}) - -techage.icta_register_action("signallamp", { - title = "TA4 Signal Lamp", - formspec = { - { - type = "numbers", - name = "number", - label = "Signal Tower number", - default = "", - }, - { - type = "textlist", - name = "payload", - label = "lamp number", - choices = "1,2,3,4", - default = "1", - }, - { - type = "textlist", - name = "value", - label = "lamp color", - choices = "off,green,amber,red", - default = "red", - }, - { - type = "label", - name = "lbl", - label = "Turn on/off a Signal Tower lamp.", - }, - }, - button = function(data, environ) - return 'tower('..techage.fmt_number(data.number)..","..data.payload..","..data.value..')' - end, - code = function(data, environ) - return function(env, output, idx) - techage.send_multi(environ.number, data.number, data.value, tonumber(data.payload)) - end - end, -}) - -techage.icta_register_action("switch", { - title = "turn block on/off", - formspec = { - { - type = "numbers", - name = "number", - label = "block number(s)", - default = "", - }, - { - type = "textlist", - name = "value", - label = "state", - choices = "on,off", - default = "on", - }, - { - type = "label", - name = "lbl", - label = "Used for lamps, machines, gates,...", - }, - }, - button = function(data, environ) - return 'turn('..techage.fmt_number(data.number)..","..data.value..')' - end, - code = function(data, environ) - return function(env, output, idx) - techage.send_multi(environ.number, data.number, data.value) - end - end, -}) - -techage.icta_register_action("display", { - title = "Display: overwrite one line", - formspec = { - { - type = "numbers", - name = "number", - label = "Display number", - default = "", - }, - { - type = "textlist", - name = "row", - label = "Display line", - choices = "1,2,3,4,5", - default = "1", - }, - { - type = "ascii", - name = "text", - label = "text", - default = "", - }, - { - type = "label", - name = "lbl", - label = "Use a '*' character as reference\nto any condition result", - }, - }, - code = function(data, environ) - return function(env, output, idx) - local text = string.gsub(data.text, "*", tostring(env.result[idx])) - local payload = safer_lua.Store() - payload.set("row", data.row) - payload.set("str", text) - techage.send_multi(environ.number, data.number, "set", payload) - end - end, - button = function(data, environ) - return "lcd("..techage.fmt_number(data.number)..","..data.row..',"'..data.text..'")' - end, -}) - -techage.icta_register_action("cleardisplay", { - title = "Display: Clear screen", - formspec = { - { - type = "number", - name = "number", - label = "Display number", - default = "", - }, - }, - code = function(data, environ) - return function(env, output, idx) - techage.send_multi(environ.number, data.number, "clear") - end - end, - button = function(data, environ) - return "clear lcd("..techage.fmt_number(data.number)..")" - end, -}) - -techage.icta_register_action("chat", { - title = "send chat message", - formspec = { - { - type = "ascii", - name = "text", - label = "message", - default = "", - }, - { - type = "label", - name = "lbl", - label = "The chat message is send to the\nController owner, only.", - }, - }, - code = function(data, environ) - return function(env, output, idx) - minetest.chat_send_player(environ.owner, "[TA4 ICTA Controller] "..data.text) - end - end, - button = function(data, environ) - return 'chat("'..data.text:sub(1,12)..'")' - end, -}) - -function techage.icta_door_toggle(pos, owner, state) - pos = minetest.string_to_pos("("..pos..")") - if pos then - local door = doors.get(pos) - if door then - local player = { - get_player_name = function() return owner end, - is_player = function() return true end, - } - if state == "open" then - door:open(player) - elseif state == "close" then - door:close(player) - end - end - end -end - -techage.icta_register_action("door", { - title = "open/close door", - formspec = { - { - type = "digits", - name = "pos", - label = "door position like: 123,7,-1200", - default = "", - }, - { - type = "textlist", - name = "door_state", - label = "door state", - choices = "open,close", - default = "open", - }, - { - type = "label", - name = "lbl", - label = "For standard doors like the Steel Doors.\n".. - "Use the Techage Info Tool to\neasily determine a door position.", - }, - }, - code = function(data, environ) - return function(env, output, idx) - techage.icta_door_toggle(data.pos, environ.owner, data.door_state) - end - end, - button = function(data, environ) - return 'door("'..data.pos..'",'..data.door_state..")" - end, -}) - -techage.icta_register_action("move", { - title = "TA4 Move Controller", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "cmnd", - label = "command", - choices = "a2b,b2a,move", - default = "a2b", - }, - }, - button = function(data, environ) -- default button label - return 'move('..techage.fmt_number(data.number)..","..data.cmnd..')' - end, - code = function(data, environ) - return function(env, output, idx) - return techage.send_single(environ.number, data.number, data.cmnd) - end - end, -}) - -techage.icta_register_action("turn", { - title = "TA4 Turn Controller", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "cmnd", - label = "command", - choices = "left,right,uturn", - default = "left", - }, - }, - button = function(data, environ) -- default button label - return 'move('..techage.fmt_number(data.number)..","..data.cmnd..')' - end, - code = function(data, environ) - return function(env, output, idx) - return techage.send_single(environ.number, data.number, data.cmnd) - end - end, -}) - -techage.icta_register_action("goto", { - title = "TA4 Sequencer", - formspec = { - { - type = "number", - name = "number", - label = "block number", - default = "", - }, - { - type = "textlist", - name = "cmnd", - label = "command", - choices = "goto,stop", - default = "left", - }, - { - type = "number", - name = "slot", - label = "time slot", - default = "1", - }, - { - type = "label", - name = "lbl", - label = "The 'stop' command needs no time slot.", - }, - }, - button = function(data, environ) -- default button label - return data.cmnd..'('..techage.fmt_number(data.number)..","..data.slot..')' - end, - code = function(data, environ) - return function(env, output, idx) - return techage.send_single(environ.number, data.number, data.cmnd, tonumber(data.slot or "1") or 1) - end - end, -}) - -function techage.icta_player_detect(own_num, number, name) - local state = techage.send_single(own_num, number, "name", nil) - if state ~= "" then - if name == "*" or string.find(name, state) then - return state - end - elseif name == "-" then - return state - end - return nil -end - -techage.icta_register_condition("playerdetector", { - title = "read Player Detector", - formspec = { - { - type = "number", - name = "number", - label = "Player Detector number", - default = "", - }, - { - type = "ascii", - name = "name", - label = "player name(s) or * for all", - default = "", - }, - { - type = "label", - name = "lbl", - label = "Read and check the name\nof a Player Detector.\nUse a '*' character for all player names.\n Use a '-' character for no player.", - }, - }, - - code = function(data, environ) - local condition = function(env, idx) - return techage.icta_player_detect(environ.number, data.number, data.name) - end - local result = function(val) - return val ~= nil - end - return condition, result - end, - button = function(data, environ) - return "detector("..techage.fmt_number(data.number)..","..data.name:sub(1,8)..")" - end, -}) - -techage.icta_register_action("set_filter", { - title = "turn Distributor filter on/off", - formspec = { - { - type = "number", - name = "number", - label = "distri number", - default = "", - }, - { - type = "textlist", - name = "color", - label = "filter port", - choices = "red,green,blue,yellow", - default = "red", - }, - { - type = "textlist", - name = "value", - label = "state", - choices = "on,off", - default = "on", - }, - { - type = "label", - name = "lbl", - label = "turn Distributor filter port on/off\n", - }, - }, - button = function(data, environ) - return 'turn('..techage.fmt_number(data.number)..","..data.color..","..data.value..')' - end, - code = function(data, environ) - return function(env, output, idx) - local payload = data.color.."="..data.value - techage.send_single(environ.number, data.number, "port", payload) - end - end, -}) - -techage.icta_register_condition("get_filter", { - title = "read state of a Distributor filter slot", - formspec = { - { - type = "number", - name = "number", - label = "distri number", - default = "", - }, - { - type = "textlist", - name = "color", - label = "filter port", - choices = "red,green,blue,yellow", - default = "red", - }, - { - type = "textlist", - name = "operand", - choices = "is,is not", - default = "is", - }, - { - type = "textlist", - name = "value", - label = "state", - choices = "on,off", - default = "off", - }, - { - type = "label", - name = "lbl", - label = "Read state of a Distributor filter slot.\n", - }, - }, - button = function(data, environ) -- default button label - return 'fltr('..techage.fmt_number(data.number)..","..data.color..' '..data.operand..' '..data.value..')' - end, - code = function(data, environ) - local condition = function(env, idx) - return techage.send_single(environ.number, data.number, "port", data.color) - end - local result = function(val) - return techage.compare(val, data.value or "invalid", data.operand) - end - return condition, result - end, -}) - -techage.icta_register_action("exchange", { - title = "place/remove a block via the Door Controller II", - formspec = { - { - type = "number", - name = "number", - label = "number", - default = "", - }, - { - type = "number", - name = "slot", - label = "slot no", - default = "1", - }, - { - type = "label", - name = "lbl", - label = "place/remove a block via\nthe Door Controller II\n", - }, - }, - button = function(data, environ) - return 'exch('..techage.fmt_number(data.number)..","..data.slot..')' - end, - code = function(data, environ) - return function(env, output, idx) - local payload = data.slot - techage.send_single(environ.number, data.number, "exchange", payload) - end - end, -}) diff --git a/techage/icta_controller/condition.lua b/techage/icta_controller/condition.lua deleted file mode 100644 index b407d74..0000000 --- a/techage/icta_controller/condition.lua +++ /dev/null @@ -1,84 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Condition Registration - -]]-- - - -- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic - --- tables with all data from condition registrations -local kvRegisteredCond = {} - --- list of keys for conditions -local aCondTypes = {} - --- list of titles for conditions -local aCondTitles = {} - --- --- API functions for condition registrations --- -function techage.icta_register_condition(key, tData) - table.insert(aCondTypes, key) - table.insert(aCondTitles, tData.title) - if kvRegisteredCond[key] ~= nil then - print("[Techage] Condition registration error "..key) - return - end - kvRegisteredCond[key] = tData - for _,item in ipairs(tData.formspec) do - if item.type == "textlist" then - item.tChoices = string.split(item.choices, ",") - item.num_choices = #item.tChoices - end - end -end - --- return formspec string -function techage.cond_formspec(row, kvSelect) - return techage.submenu_generate_formspec( - row, "cond", "Condition type", aCondTypes, aCondTitles, kvRegisteredCond, kvSelect) -end - --- evaluate the row condition input --- and return new data -function techage.cond_eval_input(kvSelect, fields) - kvSelect = techage.submenu_eval_input(kvRegisteredCond, aCondTypes, aCondTitles, kvSelect, fields) - return kvSelect -end - --- return the Lua code -function techage.code_condition(kvSelect, environ) - if kvSelect and kvRegisteredCond[kvSelect.choice] then - if techage.submenu_verify(environ.owner, kvRegisteredCond, kvSelect) then - return kvRegisteredCond[kvSelect.choice].code(kvSelect, environ) - end - end - return nil, nil -end - -techage.icta_register_condition("default", { - title = "", - formspec = {}, - code = function(data, environ) - local condition = function(env, idx) - return false - end - local result = function(val) - return false - end - return condition, result - end, - button = function(data, environ) return "..." end, -}) diff --git a/techage/icta_controller/controller.lua b/techage/icta_controller/controller.lua deleted file mode 100644 index e076354..0000000 --- a/techage/icta_controller/controller.lua +++ /dev/null @@ -1,472 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - -]]-- - - -- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic - --- --- Helper functions --- -local function gen_table(size, val) - local tbl = {} - for idx = 1,size do - if type(val) == "table" then - tbl[idx] = table.copy(val) - else - tbl[idx] = val - end - end - return tbl -end - -local function integer(s, min, max) - if s and s ~= "" and s:find("^%d+$") then - local num = tonumber(s) - if num < min then num = min end - if num > max then num = max end - return num - end - return min -end - -local sOUTPUT = "Edit commands (see help)" -local Cache = {} -local FS_DATA = gen_table(techage.NUM_RULES, {}) - - -local function output(pos, text, flush_buffer) - local meta = minetest.get_meta(pos) - if not flush_buffer then - text = meta:get_string("output") .. "\n" .. (text or "") - text = text:sub(-500,-1) - end - meta:set_string("output", text) - meta:set_string("formspec", techage.formspecOutput(meta)) -end - --- cyclic execution (cycle, cond, result, after, actn) -local function TemplCyc(cycle, cond, result, after, actn, idx) - return function(env, output) - if env.blocked[idx] == false and env.ticks % cycle == 0 then - env.result[idx] = cond(env, idx) - env.blocked[idx] = result(env.result[idx]) - if env.blocked[idx] then - env.timer[idx] = env.ticks + after - end - env.condition[idx] = env.blocked[idx] - else - env.condition[idx] = false - end - if env.blocked[idx] and env.timer[idx] == env.ticks then - actn(env, output, idx) - env.blocked[idx] = false - end - end -end - --- event based execution -local function TemplEvt(cond, result, after, actn, idx) - return function(env, output) - if env.blocked[idx] == false and env.event then - env.result[idx] = cond(env, idx) - env.blocked[idx] = result(env.result[idx]) - if env.blocked[idx] then - env.timer[idx] = env.ticks + after - end - env.condition[idx] = env.blocked[idx] - else - env.condition[idx] = false - end - if env.blocked[idx] and env.timer[idx] == env.ticks then - actn(env, output, idx) - env.blocked[idx] = false - end - end - -end - --- generate the Lua code from the NUM_RULES rules -local function generate(pos, meta, environ) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - local tbl = {} - for idx = 1,techage.NUM_RULES do - local cycle = integer(fs_data[idx].cycle, 0, 1000) - local cond, result = techage.code_condition(fs_data[idx].cond, environ) - local after = integer(fs_data[idx].after, 0, 1000) - local actn = techage.code_action(fs_data[idx].actn, environ) - -- valid rule? - if cycle and cond and after and actn then - -- add rule number - local f - if cycle == 0 then -- event - f = TemplEvt(cond, result, after, actn, idx) - else -- cyclic - f = TemplCyc(cycle, cond, result, after, actn, idx) - end - -- add to list of rules - tbl[#tbl+1] = f - elseif cond ~= nil and actn == nil then - output(pos, "Error in action in rule "..idx) - elseif cond == nil and actn ~= nil then - output(pos, "Error in condition in rule "..idx) - end - end - return tbl -end - -local function runtime_environ(pos) - return { - ticks = 0, - pos = pos, - timer = gen_table(8, 0), - blocked = gen_table(8, false), - result = gen_table(8, false), - condition = gen_table(8, false), - input = {}, -- node number is key - } -end - -local function compile(pos, meta, number) - local gen_environ = { - meta = meta, - pos = pos, - number = number, - owner = meta:get_string("owner"), - } - local functions = generate(pos, meta, gen_environ) - Cache[number] = { - code = functions, - env = runtime_environ(pos), - } - return true -end - -local function execute(pos, number, event) - local code = Cache[number].code - local env = Cache[number].env - if event then - env.event = true - else - env.event = false - env.ticks = env.ticks + 1 - end - for _,func in ipairs(code) do - local res, err = pcall(func, env, output) - if not res then - output(pos, err) - return false - end - end - return true -end - - -local function battery(pos) - local battery_pos = minetest.find_node_near(pos, 1, {"techage:ta4_battery"}) - if battery_pos then - local meta = minetest.get_meta(pos) - meta:set_string("battery", minetest.pos_to_string(battery_pos)) - return true - end - return false -end - -local function start_controller(pos, meta) - local number = meta:get_string("number") - if not battery(pos) then - meta:set_string("formspec", techage.formspecError(meta)) - return false - end - - meta:set_string("output", "") - meta:set_int("cpu", 0) - - if compile(pos, meta, number) then - meta:set_int("state", techage.RUNNING) - minetest.get_node_timer(pos):start(1) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - meta:set_string("formspec", techage.formspecRules(meta, fs_data, sOUTPUT)) - meta:set_string("infotext", "Controller "..number..": running") - return true - end - return false -end - -local function stop_controller(pos, meta) - local number = meta:get_string("number") - meta:set_int("state", techage.STOPPED) - minetest.get_node_timer(pos):stop() - meta:set_string("infotext", "Controller "..number..": stopped") - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - meta:set_string("formspec", techage.formspecRules(meta, fs_data, sOUTPUT)) -end - -local function no_battery(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - meta:set_int("state", techage.STOPPED) - minetest.get_node_timer(pos):stop() - meta:set_string("infotext", "Controller "..number..": No battery") - meta:set_string("formspec", techage.formspecError(meta)) -end - -local function update_battery(meta, cpu) - local pos = minetest.string_to_pos(meta:get_string("battery")) - if pos then - meta = minetest.get_meta(pos) - local content = meta:get_int("content") - cpu - if content <= 0 then - meta:set_int("content", 0) - return false - end - meta:set_int("content", content) - return true - end -end - -local function on_timer(pos, elapsed) - local meta = minetest.get_meta(pos) - local t = minetest.get_us_time() - local number = meta:get_string("number") - if Cache[number] or compile(pos, meta, number) then - local res = execute(pos, number, elapsed == -1) - if res then - t = minetest.get_us_time() - t - if not update_battery(meta, t) then - no_battery(pos) - return false - end - end - --print("on_timer", t) - return res - end - return false -end - -local function on_receive_fields(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") - if not player or not player:is_player() then - return - end - if player:get_player_name() ~= owner then - return - end - - --print("fields", dump(fields)) - if fields.quit then -- cancel button - return - end - if fields.notes then -- notes tab? - meta:set_string("notes", fields.notes) - end - if fields.go then - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - local output = techage.edit_command(fs_data, fields.cmnd) - stop_controller(pos, meta) - meta:set_string("formspec", techage.formspecRules(meta, fs_data, output)) - meta:set_string("fs_data", minetest.serialize(fs_data)) - end - if fields._type_ == "main" then - techage.store_main_form_data(meta, fields) - local key = techage.main_form_button_pressed(fields) - if key then - -- store data before going into sub-menu - meta:set_string("fs_old", meta:get_string("fs_data")) - meta:set_string("formspec", techage.formspecSubMenu(meta, key)) - end - elseif fields._col_ == "cond" then - techage.cond_formspec_update(meta, fields) - elseif fields._col_ == "actn" then - techage.actn_formspec_update(meta, fields) - end - if fields._exit_ == "ok" then -- exit from sub-menu? - if fields._button_ then - techage.formspec_button_update(meta, fields) - end - -- simulate tab selection - fields.tab = "1" - elseif fields._cancel_ == "cancel" then -- abort from sub-menu? - -- restore old data - meta:set_string("fs_data", meta:get_string("fs_old")) - -- simulate tab selection - fields.tab = "1" - elseif fields.save == "Save" then -- abort from sub-menu? - -- store as old data - meta:set_string("fs_old", meta:get_string("fs_data")) - -- simulate tab selection - fields.tab = "1" - elseif fields.sb_help then - local evt = minetest.explode_scrollbar_event(fields.sb_help) - meta:set_string("formspec", techage.formspecHelp(evt.value)) - end - if fields.update then - meta:set_string("formspec", techage.formspecOutput(meta)) - elseif fields.clear then - meta:set_string("output", "") - meta:set_string("formspec", techage.formspecOutput(meta)) - elseif fields.list then - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - local s = techage.listing(fs_data) - output(pos, s, true) - elseif fields.tab == "1" then - local fs_data = minetest.deserialize(meta:get_string("fs_data")) or FS_DATA - meta:set_string("formspec", techage.formspecRules(meta, fs_data, sOUTPUT)) - elseif fields.tab == "2" then - meta:set_string("formspec", techage.formspecOutput(meta)) - elseif fields.tab == "3" then - meta:set_string("formspec", techage.formspecNotes(meta)) - elseif fields.tab == "4" then - meta:set_string("formspec", techage.formspecHelp(1)) - elseif fields.start == "Start" then - local environ = { - meta = meta, - pos = pos, - number = meta:get_string("number"), - owner = meta:get_string("owner"), - } - --print("CODE:", generate(pos, meta, environ)) - start_controller(pos, meta) - minetest.log("action", player:get_player_name() .. - " starts the ta4_controller at ".. minetest.pos_to_string(pos)) - elseif fields.stop == "Stop" then - stop_controller(pos, meta) - end -end - -minetest.register_node("techage:ta4_icta_controller", { - description = "TA4 ICTA Controller", - inventory_image = "techage_ta4_controller_inventory.png", - wield_image = "techage_ta4_controller_inventory.png", - stack_max = 1, - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_ta4_controller.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local number = techage.add_node(pos, "techage:ta4_icta_controller") - local fs_data = FS_DATA - meta:set_string("fs_data", minetest.serialize(fs_data)) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("number", number) - meta:set_int("state", techage.STOPPED) - meta:set_string("formspec", techage.formspecRules(meta, fs_data, sOUTPUT)) - meta:set_string("infotext", "TA4 ICTA Controller "..number..": stopped") - end, - - on_receive_fields = on_receive_fields, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_timer = on_timer, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - use_texture_alpha = techage.CLIP, - groups = {choppy=1, cracky=1, crumbly=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_icta_controller", - recipe = { - {"basic_materials:plastic_sheet", "dye:blue", "basic_materials:plastic_sheet"}, - {"", "default:copper_ingot", ""}, - {"techage:ta4_wlanchip", "techage:ta4_ramchip", "techage:ta4_ramchip"}, - }, -}) - --- write inputs from remote nodes -local function set_input(pos, own_number, rmt_number, val) - if rmt_number then - if Cache[own_number] and Cache[own_number].env.input then - local t = minetest.get_us_time() - Cache[own_number].env.input[rmt_number] = val - Cache[own_number].env.last_event = t - -- only two events per second - if not Cache[own_number].last_event or Cache[own_number].last_event < t then - minetest.after(0.01, on_timer, pos, -1) - Cache[own_number].last_event = t + 500000 -- add 500 ms - end - end - end -end - -techage.register_node({"techage:ta4_icta_controller"}, { - on_recv_message = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - local state = meta:get_int("state") - - if state == techage.RUNNING and topic == "on" then - set_input(pos, number, src, topic) - elseif state == techage.RUNNING and topic == "off" then - set_input(pos, number, src, topic) - elseif topic == "state" then - local state = meta:get_int("state") or 0 - return techage.StateStrings[state] or "stopped" - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - local state = meta:get_int("state") - - if state == techage.RUNNING and topic == 1 and payload[1] == 1 then - set_input(pos, number, src, topic) - elseif state == techage.RUNNING and topic == 1 and payload[1] == 0 then - set_input(pos, number, src, topic) - else - return 2 - end - return 0 - end, - on_beduino_request_data = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - local state = meta:get_int("state") - - if topic == 129 then - local state = meta:get_int("state") or 0 - return 0, {state or techage.STOPPED} - else - return 2, "" - end - end, -}) diff --git a/techage/icta_controller/display.lua b/techage/icta_controller/display.lua deleted file mode 100644 index 19295b5..0000000 --- a/techage/icta_controller/display.lua +++ /dev/null @@ -1,304 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Display - -]]-- - -local S = techage.S - -techage.display = {} - -local NUM_ROWS = 5 -local RADIUS = 6 -local Param2ToFacedir = {[0] = 0, 0, 3, 1, 2, 0} - -local function lcdlib_bugfix(text_tbl) - if text_tbl and next(text_tbl) then - local t = {} - for _,txt in ipairs(text_tbl) do - if txt == "" then - t[#t+1] = " " - else - t[#t+1] = txt - end - end - return table.concat(t, "\n") - end - return "" -end - -function techage.display.display_update(pos, objref) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - local text = lcdlib_bugfix(nvm.text) - local texture = lcdlib.make_multiline_texture( - "default", text, - 70, 70, NUM_ROWS, "top", "#000", nil, true) - objref:set_properties({ textures = {texture}, - visual_size = {x=0.94, y=0.94} }) -end - -function techage.display.display_updateXL(pos, objref) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - local text = lcdlib_bugfix(nvm.text) - local texture = lcdlib.make_multiline_texture( - "default", text, - 126, 70, NUM_ROWS, "top", "#000", nil, true) - objref:set_properties({ textures = {texture}, - visual_size = {x=0.94*1.9, y=0.94} }) -end - -function techage.display.on_timer(pos) - local mem = techage.get_mem(pos) - mem.ticks = mem.ticks or 0 - - if mem.ticks > 0 then - local node = minetest.get_node(pos) - -- check if display is loaded and a player in front of the display - if node.name ~= "ignore" then - local dir = minetest.facedir_to_dir(Param2ToFacedir[node.param2 % 6]) - dir.y = 0 - local pos2 = vector.add(pos, vector.multiply(dir, RADIUS)) - for _, obj in pairs(minetest.get_objects_inside_radius(pos2, RADIUS)) do - if obj:is_player() then - lcdlib.update_entities(pos) - mem.ticks = mem.ticks - 1 - break - end - end - end - end - return true -end - -techage.display.lcd_box = { - type = "wallmounted", - wall_top = {-8/16, 15/32, -8/16, 8/16, 8/16, 8/16} -} - -minetest.register_node("techage:ta4_display", { - description = S("TA4 Display"), - inventory_image = 'techage_display_inventory.png', - tiles = {"techage_display.png"}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - node_box = techage.display.lcd_box, - selection_box = techage.display.lcd_box, - light_source = 6, - - display_entities = { - ["techage:display_entity"] = { depth = 0.42, - on_display_update = techage.display.display_update}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_display") - local meta = minetest.get_meta(pos) - meta:set_string("number", number) - meta:set_string("infotext", S("Display no: ")..number) - local nvm = techage.get_nvm(pos) - nvm.text = {"My", "Techage","TA4", "Display", "No: "..number} - lcdlib.update_entities(pos) - minetest.get_node_timer(pos):start(1) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - on_timer = techage.display.on_timer, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -techage.display.lcd_boxXL = { - type = "fixed", - fixed = {-0.9, -8/16, -8/16, 0.9, -15/32, 8/16} -} - -minetest.register_node("techage:ta4_displayXL", { - description = S("TA4 Display XL"), - inventory_image = 'techage_display_inventoryXL.png', - tiles = {"techage_displayXL.png"}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - node_box = techage.display.lcd_boxXL, - selection_box = techage.display.lcd_boxXL, - light_source = 6, - - display_entities = { - ["techage:display_entityXL"] = { depth = 0.42, - on_display_update = techage.display.display_updateXL}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_displayXL") - local meta = minetest.get_meta(pos) - meta:set_string("number", number) - meta:set_string("infotext", S("Display no: ")..number) - local nvm = techage.get_nvm(pos) - nvm.text = {"My", "Techage","TA4", "Display", "No: "..number} - lcdlib.update_entities(pos) - minetest.get_node_timer(pos):start(2) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - on_timer = techage.display.on_timer, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_display", - recipe = { - {"", "", ""}, - {"techage:basalt_glass_thin", "dye:green", "techage:ta4_wlanchip"}, - {"", "default:copper_ingot", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_displayXL", - recipe = { - {"techage:ta4_display", "techage:ta4_display"}, - {"", ""}, - }, -}) - -function techage.display.add_line(pos, payload, cycle_time) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - nvm.text = nvm.text or {} - mem.ticks = mem.ticks or 0 - local str = tostring(payload) or "oops" - - if mem.ticks == 0 then - mem.ticks = cycle_time - end - - while #nvm.text >= NUM_ROWS do - table.remove(nvm.text, 1) - end - table.insert(nvm.text, str) -end - -function techage.display.write_row(pos, payload, cycle_time, beduino) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - local str, row - - nvm.text = nvm.text or {} - mem.ticks = mem.ticks or 0 - - if beduino or type(payload) == "string" then - row = tonumber(payload:sub(1,1) or "1") or 1 - str = payload:sub(2) or "oops" - else - str = tostring(payload.get("str")) or "oops" - row = tonumber(payload.get("row")) or 1 - end - - if mem.ticks == 0 then - mem.ticks = cycle_time - end - - if row < 1 then row = 1 end - if row > NUM_ROWS then row = NUM_ROWS end - - while #nvm.text < row do - table.insert(nvm.text, "") - end - nvm.text[row] = str -end - -function techage.display.clear_screen(pos, cycle_time) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.ticks = mem.ticks or 0 - - if mem.ticks == 0 then - mem.ticks = cycle_time - end - - nvm.text = {} -end - -techage.register_node({"techage:ta4_display"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "add" then -- add one line and scroll if necessary - techage.display.add_line(pos, payload, 1) - elseif topic == "set" then -- overwrite the given row - techage.display.write_row(pos, payload, 1) - elseif topic == "clear" then -- clear the screen - techage.display.clear_screen(pos, 1) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 67 then -- add one line and scroll if necessary - techage.display.add_line(pos, payload, 1) - elseif topic == 68 then -- overwrite the given row - techage.display.write_row(pos, payload, 1, true) - elseif topic == 17 then -- clear the screen - techage.display.clear_screen(pos, 1) - else - return 2 - end - return 0 - end, -}) - -techage.register_node({"techage:ta4_displayXL"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "add" then -- add one line and scroll if necessary - techage.display.add_line(pos, payload, 2) - elseif topic == "set" then -- overwrite the given row - techage.display.write_row(pos, payload, 2) - elseif topic == "clear" then -- clear the screen - techage.display.clear_screen(pos, 2) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 67 then -- add one line and scroll if necessary - techage.display.add_line(pos, payload, 2) - elseif topic == 68 then -- overwrite the given row - techage.display.write_row(pos, payload, 2, true) - elseif topic == 17 then -- clear the screen - techage.display.clear_screen(pos, 2) - else - return 2 - end - return 0 - end, -}) - -lcdlib.register_display_entity("techage:display_entity") -lcdlib.register_display_entity("techage:display_entityXL") diff --git a/techage/icta_controller/edit.lua b/techage/icta_controller/edit.lua deleted file mode 100644 index 55a89db..0000000 --- a/techage/icta_controller/edit.lua +++ /dev/null @@ -1,40 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Formspec edit command - -]]-- - -function techage.edit_command(fs_data, text) - local cmnd, pos1, pos2 = text:match('^(%S)%s(%d+)%s(%d+)$') - if pos2 == nil then - cmnd, pos1 = text:match('^(%S)%s(%d+)$') - end - if cmnd and pos1 and pos2 then - pos1 = math.max(1, math.min(pos1, techage.NUM_RULES)) - pos2 = math.max(1, math.min(pos2, techage.NUM_RULES)) - - if cmnd == "x" then - local temp = fs_data[pos1] - fs_data[pos1] = fs_data[pos2] - fs_data[pos2] = temp - return "rows "..pos1.." and "..pos2.." exchanged" - end - if cmnd == "c" then - fs_data[pos2] = table.copy(fs_data[pos1]) - return "row "..pos1.." copied to "..pos2 - end - elseif cmnd == "d" and pos1 then - pos1 = math.max(1, math.min(pos1, techage.NUM_RULES)) - fs_data[pos1] = {} - return "row "..pos1.." deleted" - end - return "Invalid command '"..text.."'" -end diff --git a/techage/icta_controller/formspec.lua b/techage/icta_controller/formspec.lua deleted file mode 100644 index 13d682c..0000000 --- a/techage/icta_controller/formspec.lua +++ /dev/null @@ -1,243 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Formspec - -]]-- - -techage.NUM_RULES = 8 - -local SIZE = "size[13,8]" - -local sHELP = [[ICTA Controller Help - -Control other nodes by means of rules like: - IF THEN - -These rules allow to execute actions based on conditions. -Examples for conditions are: - - the Player Detector detects a player - - a button is pressed - - a machine is fault, blocked, standby,... - -Actions are: - - switch on/off lamps and machines - - send chat messages to the owner - - output a text message to the display - -The controller executes all rules cyclically. -The cycle time for each rule is configurable -(1..1000 sec). -0 means, the rule will only be called, if -the controller received a command from -another blocks, such as buttons. - -Actions can be delayed. Therefore, the -'after' value can be set (0..1000 sec). - -Edit command examples: - - 'x 1 8' exchange rows 1 with row 8 - - 'c 1 2' copy row 1 to 2 - - 'd 3' delete row 3 - -The 'outp' tab is for debugging outputs via 'print' -The 'notes' tab for your notes. - -The controller needs battery power to work. -The battery pack has to be placed near the -controller (1 node distance). -The needed battery power is directly dependent -on the CPU time the controller consumes. - - The Manual in German: - https://github.com/joe7575/techage/blob/master/manuals/ta4_icta_controller_DE.md - - Or the same as PDF: - https://github.com/joe7575/techage/blob/master/manuals/ta4_icta_controller_DE.pdf - -]] - --- to simplify the search for a pressed main form button (condition/action) -local lButtonKeys = {} - -for idx = 1,techage.NUM_RULES do - lButtonKeys[#lButtonKeys+1] = "cond"..idx - lButtonKeys[#lButtonKeys+1] = "actn"..idx -end - -local function buttons(s) - return "button_exit[7.4,7.5;1.8,1;cancel;Cancel]".. - "button[9.3,7.5;1.8,1;save;Save]".. - "button[11.2,7.5;1.8,1;"..s.."]" -end - -function techage.formspecError(meta) - local running = meta:get_int("state") == techage.RUNNING - local cmnd = running and "stop;Stop" or "start;Start" - local init = meta:get_string("init") - init = minetest.formspec_escape(init) - return "size[4,3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[0,0;No Battery?]".. - "button[1,2;1.8,1;start;Start]" -end - -local function button(data) - if data then - return data.button - else - return "..." - end -end - -function techage.listing(fs_data) - local tbl = {} - - for idx = 1,techage.NUM_RULES do - tbl[#tbl+1] = idx.." ("..fs_data[idx].cycle.."s): IF "..button(fs_data[idx].cond) - tbl[#tbl+1] = " THEN "..button(fs_data[idx].actn).." after "..fs_data[idx].after.."s\n" - end - return table.concat(tbl) -end - -local function formspec_rules(fs_data) - local tbl = {"field[0,0;0,0;_type_;;main]".. - "label[0.4,0;Cycle/s:]label[2.5,0;IF cond:]label[7,0;THEN action:]label[11.5,0;after/s:]"} - - for idx = 1,techage.NUM_RULES do - local ypos = idx * 0.75 - 0.4 - tbl[#tbl+1] = "label[0,"..(0.2+ypos)..";"..idx.."]" - tbl[#tbl+1] = "field[0.7,"..(0.3+ypos)..";1.4,1;cycle"..idx..";;"..(fs_data[idx].cycle or "").."]" - tbl[#tbl+1] = "button[1.9,"..ypos..";4.9,1;cond"..idx..";"..minetest.formspec_escape(button(fs_data[idx].cond)).."]" - tbl[#tbl+1] = "button[6.8,"..ypos..";4.9,1;actn"..idx..";"..minetest.formspec_escape(button(fs_data[idx].actn)).."]" - tbl[#tbl+1] = "field[12,"..(0.3+ypos)..";1.4,1;after"..idx..";;"..(fs_data[idx].after or "").."]" - end - return table.concat(tbl) -end - -function techage.store_main_form_data(meta, fields) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) - for idx = 1,techage.NUM_RULES do - fs_data[idx].cycle = fields["cycle"..idx] or "" - fs_data[idx].after = fields["after"..idx] or "0" - end - meta:set_string("fs_data", minetest.serialize(fs_data)) -end - -function techage.main_form_button_pressed(fields) - for _,key in ipairs(lButtonKeys) do - if fields[key] then - return key - end - end - return nil -end - -function techage.formspecSubMenu(meta, key) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) - if key:sub(1,4) == "cond" then - local row = tonumber(key:sub(5,5)) - return techage.cond_formspec(row, fs_data[row].cond) - else - local row = tonumber(key:sub(5,5)) - return techage.actn_formspec(row, fs_data[row].actn) - end -end - -function techage.formspec_button_update(meta, fields) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) - local row = tonumber(fields._row_ or 1) - if fields._col_ == "cond" then - fs_data[row].cond = techage.cond_eval_input(fs_data[row].cond, fields) - elseif fields._col_ == "actn" then - fs_data[row].actn = techage.actn_eval_input(fs_data[row].actn, fields) - end - meta:set_string("fs_data", minetest.serialize(fs_data)) -end - -function techage.cond_formspec_update(meta, fields) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) - local row = tonumber(fields._row_ or 1) - fs_data[row].cond = techage.cond_eval_input(fs_data[row].cond, fields) - meta:set_string("formspec", techage.cond_formspec(row, fs_data[row].cond)) - meta:set_string("fs_data", minetest.serialize(fs_data)) -end - -function techage.actn_formspec_update(meta, fields) - local fs_data = minetest.deserialize(meta:get_string("fs_data")) - local row = tonumber(fields._row_ or 1) - fs_data[row].actn = techage.actn_eval_input(fs_data[row].actn, fields) - meta:set_string("formspec", techage.actn_formspec(row, fs_data[row].actn)) - meta:set_string("fs_data", minetest.serialize(fs_data)) -end - - -function techage.formspecRules(meta, fs_data, output) - local running = meta:get_int("state") == techage.RUNNING - local cmnd = running and "stop;Stop" or "start;Start" - local init = meta:get_string("init") - init = minetest.formspec_escape(init) - return SIZE.. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;rules,outp,notes,help;1;;true]".. - formspec_rules(fs_data).. - "label[0.2,7.0;"..output.."]".. - "field[0.3,7.8;4,1;cmnd;;]".. - "button[4.0,7.5;1.5,1;go;GO]".. - buttons(cmnd) -end - -function techage.formspecOutput(meta) - local running = meta:get_int("state") == techage.RUNNING - local cmnd = running and "stop;Stop" or "start;Start" - local output = meta:get_string("output") - output = minetest.formspec_escape(output) - return SIZE.. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;rules,outp,notes,help;2;;true]".. - "textarea[0.3,0.2;13,8.3;output;Output:;"..output.."]".. - "button[5.5,7.5;1.8,1;list;List]".. - "button[7.4,7.5;1.8,1;clear;Clear]".. - "button[9.3,7.5;1.8,1;update;Update]".. - "button[11.2,7.5;1.8,1;"..cmnd.."]" -end - -function techage.formspecNotes(meta) - local running = meta:get_int("state") == techage.RUNNING - local cmnd = running and "stop;Stop" or "start;Start" - local notes = meta:get_string("notes") or "" - if notes == "" then notes = "" end - notes = minetest.formspec_escape(notes) - return SIZE.. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;rules,outp,notes,help;3;;true]".. - "textarea[0.3,0.2;13,8.3;notes;Notepad:;"..notes.."]".. - buttons(cmnd) -end - -function techage.formspecHelp(offs) - return SIZE.. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;rules,outp,notes,help;4;;true]".. - "field[0,0;0,0;_type_;;help]".. - "label[0,"..(-offs/50)..";"..sHELP.."]".. - --"label[0.2,0;test]".. - "scrollbar[12,1;0.5,7;vertical;sb_help;"..offs.."]" -end diff --git a/techage/icta_controller/signaltower.lua b/techage/icta_controller/signaltower.lua deleted file mode 100644 index 13b0d8e..0000000 --- a/techage/icta_controller/signaltower.lua +++ /dev/null @@ -1,158 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Signal Tower - -]]-- - - -local function switch_on(pos, node, color) - local meta = minetest.get_meta(pos) - meta:set_string("state", color) - node.name = "techage:ta4_signaltower_"..color - minetest.swap_node(pos, node) -end - -local function switch_off(pos, node) - local meta = minetest.get_meta(pos) - meta:set_string("state", "off") - node.name = "techage:ta4_signaltower" - minetest.swap_node(pos, node) -end - -minetest.register_node("techage:ta4_signaltower", { - description = "TA4 Signal Tower", - tiles = { - 'techage_signaltower_top.png', - 'techage_signaltower_top.png', - 'techage_signaltower.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -5/32, -16/32, -5/32, 5/32, 16/32, 5/32}, - }, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_signaltower") - local meta = minetest.get_meta(pos) - meta:set_string("state", "off") - meta:set_string("infotext", "TA4 Signal Tower "..number) - end, - - on_rightclick = function(pos, node, clicker) - if not minetest.is_protected(pos, clicker:get_player_name()) then - switch_on(pos, node, "green") - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -for _,color in ipairs({"green", "amber", "red"}) do - minetest.register_node("techage:ta4_signaltower_"..color, { - description = "TA4 Signal Tower", - tiles = { - 'techage_signaltower_top.png', - 'techage_signaltower_top.png', - 'techage_signaltower_'..color..'.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -5/32, -16/32, -5/32, 5/32, 16/32, 5/32}, - }, - }, - on_rightclick = function(pos, node, clicker) - if not minetest.is_protected(pos, clicker:get_player_name()) then - switch_off(pos, node) - end - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - light_source = 10, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {crumbly=0, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), - drop = "techage:ta4_signaltower", - }) -end - -minetest.register_craft({ - output = "techage:ta4_signaltower", - recipe = { - {"dye:red", "default:copper_ingot", ""}, - {"dye:orange", "default:glass", ""}, - {"dye:green", "techage:ta4_wlanchip", ""}, - }, -}) - -techage.register_node({"techage:ta4_signaltower", - "techage:ta4_signaltower_green", - "techage:ta4_signaltower_amber", - "techage:ta4_signaltower_red"}, { - on_recv_message = function(pos, src, topic, payload) - local node = minetest.get_node(pos) - if topic == "green" then - switch_on(pos, node, "green") - elseif topic == "amber" then - switch_on(pos, node, "amber") - elseif topic == "red" then - switch_on(pos, node, "red") - elseif topic == "off" then - switch_off(pos, node) - elseif topic == "state" then - local meta = minetest.get_meta(pos) - return meta:get_string("state") - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 2 then - local color = ({"green", "amber", "red"})[payload[1]] - local node = minetest.get_node(pos) - if color then - switch_on(pos, node, color) - else - switch_off(pos, node) - end - return 0 - else - return 2 -- unknown or invalid topic - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 130 then - local meta = minetest.get_meta(pos) - local color = ({off = 0, green = 1, amber = 2, red = 3})[meta:get_string("state")] or 1 - return 0, {color} - else - return 2, "" -- unknown or invalid topic - end - end, -}) diff --git a/techage/icta_controller/submenu.lua b/techage/icta_controller/submenu.lua deleted file mode 100644 index 0e690bd..0000000 --- a/techage/icta_controller/submenu.lua +++ /dev/null @@ -1,213 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - ICTA Controller - Formspec - - A sub-menu control to generate a formspec sting for conditions and actions -]]-- - -local function index(list, x) - for idx, v in ipairs(list) do - if v == x then return idx end - end - return nil -end - --- generate the choice dependent part of the form -local function add_controls_to_table(tbl, kvDefinition, kvSelect) - local offs = 1.4 - if kvDefinition[kvSelect.choice] then - local lControls = kvDefinition[kvSelect.choice].formspec - for _,elem in ipairs(lControls) do - if elem.type == "label" then - tbl[#tbl+1] = "label[0,"..offs..";Description:\n"..elem.label.."]" - offs = offs + 0.4 - elseif elem.label and elem.label ~= "" then - tbl[#tbl+1] = "label[0,"..offs..";"..elem.label..":]" - offs = offs + 0.4 - end - if elem.type == "numbers" or elem.type == "number" or elem.type == "digits" or elem.type == "letters" - or elem.type == "ascii" then - local val = kvSelect[elem.name] or elem.default - tbl[#tbl+1] = "field[0.3,"..(offs+0.2)..";8,1;"..elem.name..";;"..val.."]" - offs = offs + 0.9 - elseif elem.type == "textlist" then - local l = elem.choices:split(",") - local val = index(l, kvSelect[elem.name]) or elem.default - tbl[#tbl+1] = "dropdown[0.0,"..(offs)..";8.5,1.4;"..elem.name..";"..elem.choices..";"..val.."]" - offs = offs + 0.9 - end - end - end - return tbl -end - -local function default_data(kvDefinition, kvSelect) - local lControls = kvDefinition[kvSelect.choice].formspec - for _,elem in ipairs(lControls) do - kvSelect[elem.name] = elem.default - end - kvSelect.button = kvDefinition[kvSelect.choice].button(kvSelect) - return kvSelect -end - --- Copy field/formspec data to the table kvSelect --- kvDefinition: submenu formspec definition --- kvSelect: form data --- fields: formspec input -local function field_to_kvSelect(kvDefinition, kvSelect, fields) - local error = false - local lControls = kvDefinition[kvSelect.choice].formspec - for _,elem in ipairs(lControls) do - if elem.type == "numbers" then - if fields[elem.name] then - if fields[elem.name]:find("^[%d ]+$") then - kvSelect[elem.name] = fields[elem.name] - else - kvSelect[elem.name] = elem.default - error = true - end - end - elseif elem.type == "number" then - if fields[elem.name] then - if fields[elem.name]:find("^[%d ]+$") then - kvSelect[elem.name] = fields[elem.name] - else - kvSelect[elem.name] = elem.default - error = true - end - end - elseif elem.type == "digits" then -- including positions - if fields[elem.name] then - if fields[elem.name]:find("^[+%%-,%d]+$") then - kvSelect[elem.name] = fields[elem.name] - else - kvSelect[elem.name] = elem.default - error = true - end - end - elseif elem.type == "letters" then - if fields[elem.name] then - if fields[elem.name]:find("^[+-]?%a+$") then - kvSelect[elem.name] = fields[elem.name] - else - kvSelect[elem.name] = elem.default - error = true - end - end - elseif elem.type == "ascii" then - if fields[elem.name] then - kvSelect[elem.name] = fields[elem.name] - end - elseif elem.type == "textlist" then - if fields[elem.name] ~= nil then - kvSelect[elem.name] = fields[elem.name] - end - end - end - -- store user input of button text - if fields._button_ then - kvSelect._button_ = fields._button_ - end - -- select button text - if error then - kvSelect.button = "invalid" - elseif kvSelect._button_ and kvSelect._button_ ~= "" then - kvSelect.button = kvSelect._button_ - else - kvSelect.button = kvDefinition[kvSelect.choice].button(kvSelect) - end - return kvSelect -end - -function techage.submenu_verify(owner, kvDefinition, kvSelect) - local error = false - local lControls = kvDefinition[kvSelect.choice].formspec - for _,elem in ipairs(lControls) do - if elem.type == "numbers" then - if not kvSelect[elem.name]:find("^[%d ]+$") then - error = true - end - if not techage.check_numbers(kvSelect[elem.name], owner) then - error = true - end - elseif elem.type == "number" then - if not kvSelect[elem.name]:find("^[%d]+$") then - error = true - end - if not techage.check_numbers(kvSelect[elem.name], owner) then - error = true - end - elseif elem.type == "digits" then -- including positions - if not kvSelect[elem.name]:find("^[+%%-,%d]+$") then - error = true - end - elseif elem.type == "letters" then - if not kvSelect[elem.name]:find("^[+-]?%a+$") then - error = true - end - elseif elem.type == "ascii" then - if kvSelect[elem.name] == "" or kvSelect[elem.name] == nil then - error = true - end - elseif elem.type == "textlist" then - if kvSelect[elem.name] == "" or kvSelect[elem.name] == nil then - error = true - end - end - end - return (error == false) -end - --- generate a formspec string from the given control definition --- row, col: numbers to identify the control --- title: Title text for the control --- lKeys: list of keywords of selected choices according to fields --- lChoice: list of possible choices for the control --- kvDefinition: definitions of the choice dependent controls --- kvSelect: data of the last selected item {choice, number, value, ...} -function techage.submenu_generate_formspec(row, col, title, lKeys, lChoice, kvDefinition, kvSelect) - if kvSelect == nil or next(kvSelect) == nil then - kvSelect = {choice = "default"} - end - local tbl = {"size[8.2,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0,0;0,0;_row_;;"..row.."]".. - "field[0,0;0,0;_col_;;"..col.."]"} - - local sChoice = table.concat(lChoice, ",") - local idx = index(lKeys, kvSelect.choice) or 1 - tbl[#tbl+1] = "label[0,0;"..title..":]" - tbl[#tbl+1] = "dropdown[0,0.5;8.5,1;choice;"..sChoice..";"..idx.."]" - tbl = add_controls_to_table(tbl, kvDefinition, kvSelect) - tbl[#tbl+1] = "field[0.2,8.7;4,1;_button_;Alternative button text;"..(kvSelect._button_ or "").."]" - tbl[#tbl+1] = "button[4,8.4;2,1;_cancel_;cancel]" - tbl[#tbl+1] = "button[6,8.4;2,1;_exit_;ok]" - return table.concat(tbl) -end - - --- return the selected and configured menu item based on user inputs (fields) -function techage.submenu_eval_input(kvDefinition, lKeys, lChoice, kvSelect, fields) - -- determine selected choice - if fields.choice then - -- load with default values - local idx = index(lChoice, fields.choice) or 1 - kvSelect = {choice = lKeys[idx]} - kvSelect = default_data(kvDefinition, kvSelect) - kvSelect = field_to_kvSelect(kvDefinition, kvSelect, fields) - else - -- add real data - kvSelect = field_to_kvSelect(kvDefinition, kvSelect, fields) - end - return kvSelect -end diff --git a/techage/images/chemical_reactor.png b/techage/images/chemical_reactor.png deleted file mode 100644 index 6fbc83e..0000000 Binary files a/techage/images/chemical_reactor.png and /dev/null differ diff --git a/techage/images/distillation_tower.png b/techage/images/distillation_tower.png deleted file mode 100644 index aa8e1db..0000000 Binary files a/techage/images/distillation_tower.png and /dev/null differ diff --git a/techage/images/drilling_tower.png b/techage/images/drilling_tower.png deleted file mode 100644 index 06945dc..0000000 Binary files a/techage/images/drilling_tower.png and /dev/null differ diff --git a/techage/images/fusion_reactor.png b/techage/images/fusion_reactor.png deleted file mode 100644 index 5b0f353..0000000 Binary files a/techage/images/fusion_reactor.png and /dev/null differ diff --git a/techage/images/melting_furnace.png b/techage/images/melting_furnace.png deleted file mode 100644 index 2c5f614..0000000 Binary files a/techage/images/melting_furnace.png and /dev/null differ diff --git a/techage/images/solar_plant.png b/techage/images/solar_plant.png deleted file mode 100644 index e17ef73..0000000 Binary files a/techage/images/solar_plant.png and /dev/null differ diff --git a/techage/images/steam_engine.png b/techage/images/steam_engine.png deleted file mode 100644 index 8faaa33..0000000 Binary files a/techage/images/steam_engine.png and /dev/null differ diff --git a/techage/images/tank_cart.png b/techage/images/tank_cart.png deleted file mode 100644 index c1273a9..0000000 Binary files a/techage/images/tank_cart.png and /dev/null differ diff --git a/techage/images/thermal_energy_storage.png b/techage/images/thermal_energy_storage.png deleted file mode 100644 index 23527fb..0000000 Binary files a/techage/images/thermal_energy_storage.png and /dev/null differ diff --git a/techage/images/watermill.png b/techage/images/watermill.png deleted file mode 100644 index 69ac560..0000000 Binary files a/techage/images/watermill.png and /dev/null differ diff --git a/techage/images/wind_plant.png b/techage/images/wind_plant.png deleted file mode 100644 index 1507582..0000000 Binary files a/techage/images/wind_plant.png and /dev/null differ diff --git a/techage/init.lua b/techage/init.lua deleted file mode 100644 index 1dfd234..0000000 --- a/techage/init.lua +++ /dev/null @@ -1,430 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2024 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - -]]-- - -techage = {} - --- Version for compatibility checks, see readme.md/history -techage.version = 1.18 - -if minetest.global_exists("tubelib") then - minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!") - return -elseif minetest.global_exists("ironage") then - minetest.log("error", "[techage] Techage can't be used together with the mod ironage!") - return -elseif minetest.global_exists("techpack") then - minetest.log("error", "[techage] Techage can't be used together with the modpack techpack!") - return -elseif minetest.global_exists("tubelib2") and tubelib2.version < 2.2 then - minetest.log("error", "[techage] Techage requires tubelib2 version 2.2 or newer!") - return -elseif minetest.global_exists("minecart") and minecart.version < 2.04 then - minetest.log("error", "[techage] Techage requires minecart version 2.04 or newer!") - return -elseif minetest.global_exists("lcdlib") and lcdlib.version < 1.03 then - minetest.log("error", "[techage] Techage requires lcdlib version 1.03 or newer!") - return -elseif minetest.global_exists("safer_lua") and safer_lua.version < 1.01 then - minetest.log("error", "[techage] Techage requires safer_lua version 1.01 or newer!") - return -elseif minetest.global_exists("networks") and networks.version < 0.13 then - minetest.log("error", "[techage] Techage requires networks version 0.13 or newer!") - return -elseif minetest.global_exists("hyperloop") and hyperloop.version < 2.07 then - minetest.log("error", "[techage] Techage requires hyperloop version 2.07 or newer!") - return -end - --- Test MT 5.4 new string mode -techage.CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or false -techage.BLEND = minetest.features.use_texture_alpha_string_modes and "blend" or true - -techage.NodeDef = {} -- node registration info - -techage.max_num_forceload_blocks = tonumber(minetest.settings:get("techage_max_num_forceload_blocks")) or 24 - -techage.ore_rarity = tonumber(minetest.settings:get("techage_ore_rarity")) or 1 -techage.modified_recipes_enabled = minetest.settings:get_bool("techage_modified_recipes_enabled") ~= false -techage.collider_min_depth = tonumber(minetest.settings:get("techage_collider_min_depth")) or -28 -techage.recipe_checker_enabled = minetest.settings:get_bool("techage_recipe_checker_enabled") ~= false -techage.stair_aliases_enabled = minetest.settings:get_bool("techage_stair_aliases_enabled") ~= false - --- allow to load marshal and sqlite3 -techage.IE = minetest.request_insecure_environment() - --- Load support for I18n. -techage.S = minetest.get_translator("techage") - --- Load mod storage -techage.storage = minetest.get_mod_storage() - --- Ensure compatibility with older Minetest versions by providing --- a dummy implementation of `minetest.get_translated_string`. -if not minetest.get_translated_string then - minetest.get_translated_string = function(lang_code, string) - return string - end -end - --- Basis features -local MP = minetest.get_modpath("techage") -dofile(MP.."/basis/lib.lua") -- helper functions -dofile(MP.."/basis/counting.lua") -- command counting -dofile(MP.."/basis/fake_player.lua") -- dummy player object -dofile(MP.."/basis/node_store.lua") -dofile(MP.."/basis/gravel_lib.lua") -- ore probability -dofile(MP.."/basis/node_states.lua") -- state model -dofile(MP.."/basis/tubes.lua") -- tubes for item transport -dofile(MP.."/basis/tubes_ta4.lua") -- TA4 tubes for item transport -dofile(MP.."/basis/tube_wall_entry.lua") -dofile(MP.."/basis/command.lua") -- command API -dofile(MP.."/basis/firebox_lib.lua") -- common firebox functions -dofile(MP.."/basis/boiler_lib.lua") -- common boiler functions -dofile(MP.."/basis/liquid_lib.lua") -- common liquids functions -dofile(MP.."/basis/fuel_lib.lua") -- common fuel functions -dofile(MP.."/basis/mark.lua") -dofile(MP.."/basis/mark2.lua") -dofile(MP.."/basis/assemble.lua") -dofile(MP.."/basis/recipe_lib.lua") -dofile(MP.."/basis/formspec_update.lua") -dofile(MP.."/basis/windturbine_lib.lua") -dofile(MP.."/basis/laser_lib.lua") -dofile(MP.."/basis/legacy.lua") -dofile(MP.."/basis/hyperloop.lua") -dofile(MP.."/basis/oggfiles.lua") -dofile(MP.."/basis/submenu.lua") -dofile(MP.."/basis/shared_inv.lua") -dofile(MP.."/basis/shared_tank.lua") -dofile(MP.."/basis/teleport.lua") -dofile(MP.."/basis/fly_lib.lua") -dofile(MP.."/basis/pack_lib.lua") - --- Main doc -dofile(MP.."/doc/guide.lua") -dofile(MP.."/doc/plans.lua") -dofile(MP.."/doc/items.lua") - -dofile(MP.."/items/filling.lua") - --- Power networks -dofile(MP.."/power/formspecs.lua") -dofile(MP.."/power/drive_axle.lua") -dofile(MP.."/power/gearbox.lua") -dofile(MP.."/power/steam_pipe.lua") -dofile(MP.."/power/electric_cable.lua") -dofile(MP.."/power/junctionbox.lua") -dofile(MP.."/power/power_terminal.lua") -dofile(MP.."/power/power_terminal2.lua") -dofile(MP.."/power/powerswitchbox_legacy.lua") -dofile(MP.."/power/powerswitchbox.lua") -dofile(MP.."/power/powerswitch.lua") -dofile(MP.."/power/protection.lua") -dofile(MP.."/power/power_line.lua") -dofile(MP.."/power/ta4_cable.lua") -dofile(MP.."/power/ta4_cable_wall_entry.lua") - --- Iron Age -dofile(MP.."/iron_age/main.lua") -dofile(MP.."/iron_age/gravelsieve.lua") -dofile(MP.."/iron_age/hopper.lua") -dofile(MP.."/iron_age/hammer.lua") -dofile(MP.."/iron_age/lighter.lua") -dofile(MP.."/iron_age/charcoalpile.lua") -dofile(MP.."/iron_age/coalburner.lua") -dofile(MP.."/iron_age/meltingpot.lua") -if techage.modified_recipes_enabled then - dofile(MP.."/iron_age/tools.lua") -end - --- TA1 Watermill -dofile(MP.."/ta1_watermill/ta1_axle.lua") -dofile(MP.."/ta1_watermill/watermill.lua") -dofile(MP.."/ta1_watermill/sluice.lua") -dofile(MP.."/ta1_watermill/millboard.lua") -dofile(MP.."/ta1_watermill/mill.lua") - -dofile(MP.."/iron_age/recipes.lua") -if minetest.global_exists("wielded_light") or minetest.global_exists("illumination") then - dofile(MP.."/iron_age/meridium.lua") -end - --- Steam Engine -dofile(MP.."/steam_engine/firebox.lua") -dofile(MP.."/steam_engine/boiler.lua") -dofile(MP.."/steam_engine/cylinder.lua") -dofile(MP.."/steam_engine/flywheel.lua") - --- TA2 gravity-based energy storage -dofile(MP.."/ta2_energy_storage/ta2_rope.lua") -dofile(MP.."/ta2_energy_storage/ta2_winch.lua") -dofile(MP.."/ta2_energy_storage/ta2_weight_chest.lua") -dofile(MP.."/ta2_energy_storage/ta2_clutch.lua") - --- Liquids I -dofile(MP.."/liquids/liquid_pipe.lua") -dofile(MP.."/liquids/valve.lua") -dofile(MP.."/liquids/pipe_wall_entry.lua") -dofile(MP.."/fusion_reactor/gas_pipe.lua") - - --- Basic Machines -dofile(MP.."/basic_machines/consumer.lua") -- consumer base model -dofile(MP.."/basic_machines/source.lua") -dofile(MP.."/basic_machines/pusher.lua") -dofile(MP.."/basic_machines/foreign_nodes.lua") -dofile(MP.."/basic_machines/mods_support.lua") -dofile(MP.."/basic_machines/grinder.lua") -dofile(MP.."/basic_machines/distributor.lua") -dofile(MP.."/basic_machines/gravelsieve.lua") -dofile(MP.."/basic_machines/gravelrinser.lua") -dofile(MP.."/basic_machines/chest.lua") -dofile(MP.."/basic_machines/autocrafter.lua") -dofile(MP.."/basic_machines/electronic_fab.lua") -dofile(MP.."/basic_machines/liquidsampler.lua") -dofile(MP.."/basic_machines/quarry.lua") -dofile(MP.."/basic_machines/ta4_chest.lua") -dofile(MP.."/basic_machines/ta4_injector.lua") -dofile(MP.."/basic_machines/itemsource.lua") -dofile(MP.."/basic_machines/recycler.lua") -dofile(MP.."/basic_machines/concentrator.lua") -dofile(MP.."/basic_machines/recipeblock.lua") -dofile(MP.."/basic_machines/ta5_chest.lua") - --- Liquids II -dofile(MP.."/liquids/tank.lua") -dofile(MP.."/liquids/filler.lua") -dofile(MP.."/liquids/silo.lua") -dofile(MP.."/liquids/pump.lua") -dofile(MP.."/liquids/waterpump.lua") -dofile(MP.."/liquids/waterinlet.lua") -dofile(MP.."/liquids/ta5_tank.lua") - --- Coal power station -dofile(MP.."/coal_power_station/firebox.lua") -dofile(MP.."/coal_power_station/boiler_base.lua") -dofile(MP.."/coal_power_station/boiler_top.lua") -dofile(MP.."/coal_power_station/generator.lua") -dofile(MP.."/coal_power_station/turbine.lua") -dofile(MP.."/coal_power_station/cooler.lua") -dofile(MP.."/coal_power_station/oilfirebox.lua") - --- Industrial Furnace -dofile(MP.."/furnace/firebox.lua") -dofile(MP.."/furnace/cooking.lua") -dofile(MP.."/furnace/furnace_top.lua") -dofile(MP.."/furnace/booster.lua") -dofile(MP.."/furnace/heater.lua") -dofile(MP.."/furnace/recipes.lua") - --- Tools -dofile(MP.."/tools/trowel.lua") -dofile(MP.."/tools/end_wrench.lua") -dofile(MP.."/tools/assembly_tool.lua") -dofile(MP.."/tools/pipe_wrench.lua") -dofile(MP.."/basic_machines/blackhole.lua") -dofile(MP.."/basic_machines/forceload.lua") -dofile(MP.."/tools/screwdriver.lua") - --- Lamps -dofile(MP.."/lamps/lib.lua") -dofile(MP.."/lamps/lightblock.lua") -dofile(MP.."/lamps/simplelamp.lua") -dofile(MP.."/lamps/streetlamp.lua") -dofile(MP.."/lamps/streetlamp2.lua") -dofile(MP.."/lamps/ceilinglamp.lua") -dofile(MP.."/lamps/industriallamp1.lua") -dofile(MP.."/lamps/industriallamp2.lua") -dofile(MP.."/lamps/industriallamp3.lua") -dofile(MP.."/lamps/industriallamp4.lua") -dofile(MP.."/lamps/growlight.lua") -dofile(MP.."/lamps/lampholder.lua") - --- Oil -dofile(MP.."/oil/explore.lua") -dofile(MP.."/oil/tower.lua") -dofile(MP.."/oil/drillbox.lua") -dofile(MP.."/oil/pumpjack.lua") -dofile(MP.."/oil/distiller.lua") -dofile(MP.."/oil/reboiler.lua") --- dofile(MP.."/oil/gasflare.lua") - --- TA3 power based -dofile(MP.."/ta3_power/tiny_generator.lua") -dofile(MP.."/ta3_power/akkubox.lua") -dofile(MP.."/ta3_power/axle2power.lua") -dofile(MP.."/ta3_power/power2axle.lua") - --- TA4 power based -dofile(MP.."/ta4_power/laser.lua") -dofile(MP.."/ta4_power/transformer.lua") -dofile(MP.."/ta4_power/electricmeter.lua") - --- Digtron -if minetest.global_exists("digtron") then - dofile(MP.."/digtron/battery.lua") -end - --- Logic -dofile(MP.."/logic/lib.lua") -dofile(MP.."/logic/terminal.lua") -dofile(MP.."/logic/button.lua") -dofile(MP.."/logic/detector.lua") -dofile(MP.."/logic/repeater.lua") -dofile(MP.."/logic/programmer.lua") -dofile(MP.."/logic/signallamp.lua") -dofile(MP.."/logic/sequencer.lua") -dofile(MP.."/logic/sequencer2.lua") -dofile(MP.."/logic/timer.lua") -dofile(MP.."/logic/lua_logic.lua") -- old -dofile(MP.."/logic/logic_block.lua") -- new -dofile(MP.."/logic/node_detector.lua") -dofile(MP.."/logic/light_detector.lua") -dofile(MP.."/logic/player_detector.lua") -dofile(MP.."/logic/gaze_sensor.lua") -dofile(MP.."/logic/command_converter.lua") -dofile(MP.."/logic/flipflop.lua") -dofile(MP.."/logic/mba_detector.lua") -dofile(MP.."/logic/cart_detector.lua") -dofile(MP.."/logic/charge_detector.lua") -dofile(MP.."/logic/collector.lua") -dofile(MP.."/logic/button_2x.lua") -dofile(MP.."/logic/button_4x.lua") -dofile(MP.."/logic/signallamp_2x.lua") -dofile(MP.."/logic/signallamp_4x.lua") -if minetest.global_exists("mesecon") then - dofile(MP.."/logic/mesecons_converter.lua") -end - --- move_controller -dofile(MP.."/move_controller/gateblock.lua") -dofile(MP.."/move_controller/doorblock.lua") -dofile(MP.."/move_controller/doorcontroller.lua") -- old -dofile(MP.."/move_controller/doorcontroller2.lua") -- new -dofile(MP.."/move_controller/movecontroller.lua") -dofile(MP.."/move_controller/turncontroller.lua") -dofile(MP.."/move_controller/flycontroller.lua") -dofile(MP.."/move_controller/soundblock.lua") - - --- Test -if techage.recipe_checker_enabled then - dofile(MP.."/recipe_checker.lua") -end -dofile(MP.."/.test/sink.lua") -dofile(MP.."/.test/testblock.lua") - --- Solar -dofile(MP.."/solar/minicell.lua") -dofile(MP.."/solar/solarcell.lua") -dofile(MP.."/solar/inverter.lua") - --- Wind -dofile(MP.."/wind_turbine/rotor.lua") -dofile(MP.."/wind_turbine/pillar.lua") -dofile(MP.."/wind_turbine/signallamp.lua") - --- TA4 Energy Storage -dofile(MP.."/energy_storage/heatexchanger3.lua") -dofile(MP.."/energy_storage/heatexchanger2.lua") -dofile(MP.."/energy_storage/heatexchanger1.lua") -dofile(MP.."/energy_storage/generator.lua") -dofile(MP.."/energy_storage/turbine.lua") -dofile(MP.."/energy_storage/inlet.lua") -dofile(MP.."/energy_storage/nodes.lua") - --- Chemistry -dofile(MP.."/chemistry/ta4_reactor.lua") -dofile(MP.."/chemistry/ta4_stand.lua") -dofile(MP.."/chemistry/ta4_doser.lua") -dofile(MP.."/chemistry/ta4_liquid_filter.lua") - --- Hydrogen -dofile(MP.."/hydrogen/fuelcellstack.lua") -dofile(MP.."/hydrogen/electrolyzer.lua") -dofile(MP.."/hydrogen/fuelcell.lua") - --- ICTA Controller -dofile(MP.."/icta_controller/submenu.lua") -dofile(MP.."/icta_controller/condition.lua") -dofile(MP.."/icta_controller/action.lua") -dofile(MP.."/icta_controller/formspec.lua") -dofile(MP.."/icta_controller/controller.lua") -dofile(MP.."/icta_controller/commands.lua") -dofile(MP.."/icta_controller/edit.lua") -dofile(MP.."/icta_controller/battery.lua") -dofile(MP.."/icta_controller/display.lua") -dofile(MP.."/icta_controller/signaltower.lua") - --- Lua Controller -dofile(MP.."/lua_controller/controller.lua") -dofile(MP.."/lua_controller/commands.lua") -dofile(MP.."/lua_controller/server.lua") -dofile(MP.."/lua_controller/sensorchest.lua") -dofile(MP.."/lua_controller/terminal.lua") - --- Items -dofile(MP.."/items/registered_nodes.lua") -dofile(MP.."/items/barrel.lua") -dofile(MP.."/items/baborium.lua") -dofile(MP.."/items/usmium.lua") -dofile(MP.."/items/lye.lua") -dofile(MP.."/items/oil.lua") -dofile(MP.."/items/petroleum.lua") -dofile(MP.."/items/bauxit.lua") -dofile(MP.."/items/silicon.lua") -dofile(MP.."/items/steelmat.lua") -dofile(MP.."/items/aluminium.lua") -dofile(MP.."/items/powder.lua") -dofile(MP.."/items/epoxy.lua") -dofile(MP.."/items/plastic.lua") -dofile(MP.."/items/hydrogen.lua") -dofile(MP.."/items/electronic.lua") -dofile(MP.."/items/redstone.lua") -dofile(MP.."/items/cement.lua") -dofile(MP.."/items/cracking.lua") -dofile(MP.."/items/ceramic.lua") -dofile(MP.."/items/basalt.lua") -dofile(MP.."/items/moreblocks.lua") -dofile(MP.."/items/salt.lua") - --- Carts -dofile(MP.."/carts/tank_cart.lua") -dofile(MP.."/carts/chest_cart.lua") - --- TA4 Collider -dofile(MP.."/collider/vacuumtube.lua") -dofile(MP.."/collider/magnet.lua") -dofile(MP.."/collider/inlets.lua") -dofile(MP.."/collider/cooler.lua") -dofile(MP.."/collider/detector.lua") -dofile(MP.."/collider/worker.lua") - --- TA5 Teleport -dofile(MP.."/teleport/teleport_tube.lua") -dofile(MP.."/teleport/teleport_pipe.lua") - --- TA5 Fusion Reactor -dofile(MP.."/fusion_reactor/shell.lua") -dofile(MP.."/fusion_reactor/magnet.lua") -dofile(MP.."/fusion_reactor/controller.lua") -dofile(MP.."/fusion_reactor/heatexchanger3.lua") -dofile(MP.."/fusion_reactor/heatexchanger2.lua") -dofile(MP.."/fusion_reactor/heatexchanger1.lua") -dofile(MP.."/fusion_reactor/generator.lua") -dofile(MP.."/fusion_reactor/turbine.lua") -dofile(MP.."/fusion_reactor/ta5_pump.lua") - --- Beduino extensions -dofile(MP.."/beduino/kv_store.lua") - --- Prevent other mods from using IE -techage.IE = nil diff --git a/techage/iron_age/charcoalpile.lua b/techage/iron_age/charcoalpile.lua deleted file mode 100644 index f344069..0000000 --- a/techage/iron_age/charcoalpile.lua +++ /dev/null @@ -1,227 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Charcoalpile to produce charcoal - -]]-- - -local S = techage.S - -local PILE_BURN_TIME = 1200 -local COAL_BURN_TIME = 300 - --- determine the number of wood nodes -local function num_wood(pos) - local pos1 = {x=pos.x-1, y=pos.y, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+2, z=pos.z+1} - local nodes = minetest.find_nodes_in_area(pos1, pos2, "group:wood") - return #nodes -end - --- determine the number of dirt nodes (around wood) -local function num_dirt(pos) - local pos1 = {x=pos.x-2, y=pos.y-1, z=pos.z-2} - local pos2 = {x=pos.x+2, y=pos.y+3, z=pos.z+2} - local nodes = minetest.find_nodes_in_area(pos1, pos2, techage.aAnyKindOfDirtBlocks) - return #nodes -end - --- determine the number of ignore nodes -local function num_ignore(pos) - local pos1 = {x=pos.x-2, y=pos.y-1, z=pos.z-2} - local pos2 = {x=pos.x+2, y=pos.y+3, z=pos.z+2} - local nodes = minetest.find_nodes_in_area(pos1, pos2, "ignore") - return #nodes -end - --- replace pile top nodes -local function make_dirt_with_dry_grass(pos) - local pos1 = {x=pos.x-2, y=pos.y+3, z=pos.z-2} - local pos2 = {x=pos.x+2, y=pos.y+3, z=pos.z+2} - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, { - "default:dirt_with_grass", - "default:dirt_with_coniferous_litter", - "default:dirt_with_rainforest_litter", - })) do - minetest.swap_node(p, {name = "default:dirt_with_dry_grass"}) - end - if minetest.global_exists("ethereal") then - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, techage.aEtherealDirts)) do - minetest.swap_node(p, {name = "default:dirt_with_dry_grass"}) - end - end -end - --- replace pile bottom nodes -local function make_dirt_with_ash(pos) - local pos1 = {x=pos.x-1, y=pos.y-1, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y-1, z=pos.z+1} - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, "default:dirt")) do - minetest.swap_node(p, {name = "techage:dirt_with_ash"}) - end -end - -local function start_smoke(pos) - local meta = minetest.get_meta(pos) - pos = {x=pos.x, y=pos.y+3.6, z=pos.z} - local id = meta:get_int("smoke") - local above = minetest.get_node(pos).name - - if id ~= 0 then - minetest.delete_particlespawner(id) - meta:set_int("smoke", 0) - end - - if above == "air" then - id = minetest.add_particlespawner({ - amount = 4, time = 0, collisiondetection = true, - minpos = {x=pos.x-0.25, y=pos.y+0.1, z=pos.z-0.25}, - maxpos = {x=pos.x+0.25, y=pos.y+5, z=pos.z+0.25}, - minvel = {x=-0.2, y=0.3, z=-0.2}, maxvel = {x=0.2, y=1, z=0.2}, - minacc = {x=0,y=0,z=0}, maxacc = {x=0,y=0.5,z=0}, - minexptime = 2, maxexptime = 4, - minsize = 6, maxsize = 12, - texture = "techage_smoke.png", - }) - meta:set_int("smoke", id) - end -end - -local function stop_smoke(pos) - local meta = minetest.get_meta(pos) - local id = meta:get_int("smoke") - if id ~= 0 then - minetest.delete_particlespawner(id) - end - meta:set_int("smoke", 0) -end - --- replace wood by burning coal -local function collapse_pile(pos) - local pos1 = {x=pos.x-1, y=pos.y, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+2, z=pos.z+1} - techage.ironage_swap_nodes(pos1, pos2, "group:wood", "techage:charcoal_burn") - stop_smoke(pos) - make_dirt_with_ash(pos) -end - --- replace wood by coal -local function convert_to_coal(pos) - local pos1 = {x=pos.x-1, y=pos.y+1, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+2, z=pos.z+1} - techage.ironage_swap_nodes(pos1, pos2, "group:wood", "air") - pos1 = {x=pos.x-1, y=pos.y+0, z=pos.z-1} - pos2 = {x=pos.x+1, y=pos.y+1, z=pos.z+1} - techage.ironage_swap_nodes(pos1, pos2, "group:wood", "techage:charcoal") - stop_smoke(pos) - minetest.swap_node(pos, {name = "techage:charcoal"}) - make_dirt_with_ash(pos) - make_dirt_with_dry_grass(pos) -end - -function techage.start_pile(pos) - local meta = minetest.get_meta(pos) - meta:set_int("ignite", minetest.get_gametime()) - minetest.get_node_timer(pos):start(20) -end - --- node timer function -function techage.keep_running_pile(pos) - local meta = minetest.get_meta(pos) - if meta:get_int("running") == 0 then - if num_wood(pos) == 26 and num_dirt(pos) == 98 then - meta:set_int("running", 1) - start_smoke(pos) - elseif minetest.get_gametime() > (meta:get_int("ignite") + 10) then - collapse_pile(pos) - minetest.remove_node(pos) - return false - end - else - if num_ignore(pos) == 0 and (num_wood(pos) ~= 26 or num_dirt(pos) ~= 98) then - collapse_pile(pos) - minetest.remove_node(pos) - return false - elseif minetest.get_gametime() > (meta:get_int("ignite") + PILE_BURN_TIME) then - convert_to_coal(pos) - return false - end - end - return true -end - -function techage.stop_pile(pos) - collapse_pile(pos) -end - - -minetest.register_node("techage:dirt_with_ash", { - description = S("Dirt with Ash"), - tiles = { - "techage_ash.png", - "default_dirt.png", - {name = "default_dirt.png^techage_ash_side.png", - tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, not_in_creative_inventory=1}, - drop = 'default:dirt', - sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_grass_footstep", gain = 0.4}, - }), -}) - - -minetest.register_node("techage:charcoal_burn", { - tiles = {"techage_charcoal_burn.png"}, - after_place_node = function(pos) - minetest.get_node_timer(pos):start(math.random(COAL_BURN_TIME, COAL_BURN_TIME*1.2)) - end, - on_timer = function(pos) - minetest.remove_node(pos) - return false - end, - drop = "", - paramtype = "light", - light_source = 10, - is_ground_content = false, - groups = {crumbly = 2, falling_node = 1, not_in_creative_inventory=1}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node("techage:charcoal", { - description = S("TA1 Charcoal"), - tiles = {"techage_charcoal.png"}, - on_ignite = function(pos, igniter) - minetest.after(2, minetest.swap_node, pos, {name = "techage:charcoal_burn"}) - minetest.after(COAL_BURN_TIME/2, minetest.remove_node, pos) - end, - is_ground_content = false, - groups = {crumbly = 2, falling_node = 1}, - sounds = default.node_sound_dirt_defaults(), -}) - - -minetest.register_craft({ - type = "fuel", - recipe = "techage:charcoal", - burntime = 120, -}) - -minetest.register_lbm({ - label = "[techage] Lighter update", - name = "techage:lighter_update", - nodenames = {"techage:lighter_burn"}, - run_at_every_load = true, - action = function(pos, node) - local meta = minetest.get_meta(pos) - if meta:get_int("running") == 1 then - start_smoke(pos) - end - end -}) diff --git a/techage/iron_age/coalburner.lua b/techage/iron_age/coalburner.lua deleted file mode 100644 index d1e9523..0000000 --- a/techage/iron_age/coalburner.lua +++ /dev/null @@ -1,248 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Coalburner as heater for the Meltingpot - -]]-- - -local S = techage.S - -local COAL_BURN_TIME = 1200 -local CYCLE_TIME = 5 - -local function num_coal(pos) - local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} - local pos2 = {x=pos.x, y=pos.y+32, z=pos.z} - local nodes = minetest.find_nodes_in_area(pos1, pos2, {"techage:charcoal", "techage:charcoal_burn"}) - return #nodes -end - -local function num_cobble(pos, height) - local pos1 = {x=pos.x-1, y=pos.y+1, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+height, z=pos.z+1} - local nodes = minetest.find_nodes_in_area(pos1, pos2, {"default:cobble", "default:desert_cobble", "default:mossycobble", "techage:basalt_cobble", "techage:bauxite_cobble"}) - return #nodes -end - -local function num_air(pos) - local pos1 = {x=pos.x-1, y=pos.y, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y, z=pos.z+1} - local nodes = minetest.find_nodes_in_area(pos1, pos2, {"air"}) - return #nodes -end - -local function start_burner(pos, height) - local pos1 = {x=pos.x-1, y=pos.y+1, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+height, z=pos.z+1} - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, "techage:charcoal")) do - minetest.swap_node(p, {name = "techage:charcoal_burn"}) - end -end - -local function remove_coal(pos, height) - local pos1 = {x=pos.x-1, y=pos.y+1, z=pos.z-1} - local pos2 = {x=pos.x+1, y=pos.y+height, z=pos.z+1} - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, "techage:charcoal_burn")) do - minetest.remove_node(p) - end -end - -local function remove_flame(pos, height) - local idx - pos = {x=pos.x, y=pos.y+height, z=pos.z} - for idx=height,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - local node = techage.get_node_lvm(pos) - if string.find(node.name, "techage:flame") then - minetest.remove_node(pos) - elseif node.name == "techage:meltingpot" then - techage.update_heat(pos) - end - end -end - -local function calc_num_coal(height, burn_time) - local num = height - if burn_time < 0 then - local x = (COAL_BURN_TIME * 0.2) / height - num = math.max(height + math.floor(burn_time/x), 0) - end - return num -end - -local function flame(pos, height, heat, first_time) - local idx - local playername = minetest.get_meta(pos):get_string("playername") - pos = {x=pos.x, y=pos.y+height, z=pos.z} - for idx=heat,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - idx = math.min(idx, 12) - local node = techage.get_node_lvm(pos) - if node.name == "techage:meltingpot_active" or node.name == "ignore" then - return - end - if node.name == "techage:meltingpot" then - if first_time then - techage.switch_to_active(pos) - else - techage.update_heat(pos) - end - return - end - if minetest.is_protected(pos, playername) then - return - end - minetest.add_node(pos, {name = "techage:flame"..math.min(idx,7)}) - local meta = minetest.get_meta(pos) - meta:set_int("heat", idx) - end -end - - -local lRatio = {120, 110, 95, 75, 55, 28, 0} -local lColor = {"000080", "400040", "800000", "800000", "800000", "800000", "800000"} - -for idx,ratio in ipairs(lRatio) do - local color = "techage_flame_animated.png^[colorize:#"..lColor[idx].."B0:"..ratio - minetest.register_node("techage:flame"..idx, { - tiles = { - { - name = color, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 1 - }, - }, - }, - - after_destruct = function(pos, oldnode) - pos.y = pos.y + 1 - local node = techage.get_node_lvm(pos) - if minetest.get_item_group(node.name, "techage_flame") > 0 then - minetest.remove_node(pos) - end - end, - - drawtype = "glasslike", - use_texture_alpha = techage.BLEND, - inventory_image = "techage_flame.png", - paramtype = "light", - light_source = 13, - walkable = false, - buildable_to = true, - floodable = true, - sunlight_propagates = true, - damage_per_second = 4 + idx, - groups = {igniter = 2, dig_immediate = 3, techage_flame=1, not_in_creative_inventory=1}, - drop = "", - }) -end - -minetest.register_node("techage:ash", { - description = S("Ash"), - tiles = {"techage_ash.png"}, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-4/8, -4/8, -4/8, 4/8, -3/8, 4/8}, - }, - }, - is_ground_content = false, - groups = {crumbly = 3, not_in_creative_inventory=1}, - drop = "", - sounds = default.node_sound_defaults(), -}) - -function techage.start_burner(pos, playername) - local height = num_coal(pos) - if minetest.is_protected( - {x=pos.x, y=pos.y+height, z=pos.z}, - playername) then - return - end - if num_cobble(pos, height) == height * 8 then - local meta = minetest.get_meta(pos) - --meta:set_int("ignite", minetest.get_gametime()) - meta:set_int("burn_time", COAL_BURN_TIME) - meta:set_int("height", height) - start_burner(pos, height) - flame(pos, height, height, true) - local handle = minetest.sound_play("techage_gasflare", { - pos = {x=pos.x, y=pos.y+height, z=pos.z}, - max_hear_distance = 20, - gain = height/12.0, - loop = true}) - meta:set_int("handle", handle) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end -end - -function techage.keep_running_burner(pos) - local meta = minetest.get_meta(pos) - local height = meta:get_int("height") - remove_flame(pos, height) - local handle = meta:get_int("handle") - if handle then - minetest.sound_stop(handle) - meta:set_int("handle", 0) - end - local burn_time = meta:get_int("burn_time") - -- burner hole is open - if num_air(pos) == 1 then - meta:set_int("burn_time", burn_time - CYCLE_TIME) - -- tower intact - if num_cobble(pos, height) == height * 8 then - local num_coal = calc_num_coal(height, burn_time) - if num_coal > 0 then - if meta:get_int("paused") == 1 then - flame(pos, height, num_coal, true) - meta:set_int("paused", 0) - else - flame(pos, height, num_coal, false) - end - handle = minetest.sound_play("techage_gasflare", { - pos = {x=pos.x, y=pos.y+height, z=pos.z}, - max_hear_distance = 32, - gain = num_coal/12.0, - loop = true}) - meta:set_int("handle", handle) - else - minetest.swap_node(pos, {name="techage:ash"}) - remove_coal(pos, height) - local handle = meta:get_int("handle") - minetest.sound_stop(handle) - return false - end - else - minetest.swap_node(pos, {name="techage:ash"}) - remove_coal(pos, height) - local handle = meta:get_int("handle") - minetest.sound_stop(handle) - return false - end - else - meta:set_int("paused", 1) - end - return true -end - -function techage.stop_burner(pos) - local meta = minetest.get_meta(pos) - local height = meta:get_int("height") - remove_flame(pos, height) - remove_coal(pos, height) - local handle = meta:get_int("handle") - minetest.sound_stop(handle) - meta:set_int("burn_time", 0) -end diff --git a/techage/iron_age/gravelsieve.lua b/techage/iron_age/gravelsieve.lua deleted file mode 100644 index 3bec992..0000000 --- a/techage/iron_age/gravelsieve.lua +++ /dev/null @@ -1,212 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Gravel Sieve, sieving gravel to find ores - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local get_random_gravel_ore = techage.gravelsieve_get_random_gravel_ore -local get_random_basalt_ore = techage.gravelsieve_get_random_basalt_ore - --- handle the sieve animation -local function swap_node(pos) - local node = techage.get_node_lvm(pos) - local idx = string.byte(node.name, -1) - 48 - idx = (idx + 1) % 4 - minetest.swap_node(pos, {name = "techage:sieve"..idx, param2 = node.param2}) - return idx == 3 -- true if done -end - -local function push_items(pos, items) - local pos1 = {x=pos.x, y=pos.y-1, z=pos.z} - local node = techage.get_node_lvm(pos1) - minetest.add_item({x=pos.x, y=pos.y-0.4, z=pos.z}, items) -end - -local function minecart_hopper_takeitem(pos, num) - for _, obj in pairs(minetest.get_objects_inside_radius({x=pos.x, y=pos.y-0.4, z=pos.z}, 0.2)) do - local entity = obj:get_luaentity() - if not obj:is_player() and entity and entity.name == "__builtin:item" then - obj:remove() - return ItemStack(entity.itemstring or "air") - end - end -end - -local function minecart_hopper_untakeitem(pos, in_dir, stack) - push_items(pos, stack) -end - -local function keep_running(pos, elapsed) - if swap_node(pos) then - local inv = M(pos):get_inventory() - local src, dst - - if inv:contains_item("src", ItemStack("techage:basalt_gravel")) then - dst, src = get_random_basalt_ore(), ItemStack("techage:basalt_gravel") - elseif inv:contains_item("src", ItemStack("default:gravel")) then - dst, src = get_random_gravel_ore(), ItemStack("default:gravel") - elseif not inv:is_empty("src") then - src = inv:get_stack("src", 1):take_item(1) - dst = src - else - return false - end - push_items(pos, dst) - inv:remove_item("src", src) - end - local inv = M(pos):get_inventory() - return not inv:is_empty("src") -end - -local function on_construct(pos) - local meta = minetest.get_meta(pos) - meta:set_string("infotext", S("TA1 Gravel Sieve")) - local inv = meta:get_inventory() - inv:set_size('src', 1) -end - -local function on_punch(pos, node, puncher, pointed_thing) - local wielded_item = puncher:get_wielded_item():get_name() - if wielded_item == "default:gravel" or wielded_item == "techage:basalt_gravel" then - local inv = M(pos):get_inventory() - local stack = ItemStack(wielded_item) - if inv:room_for_item("src", stack) then - inv:add_item("src", stack) - minetest.swap_node(pos, {name = "techage:sieve0"}) - minetest.get_node_timer(pos):start(1.5) - local w = puncher:get_wielded_item() - if not minetest.is_creative_enabled(puncher:get_player_name()) then - w:take_item(1) - puncher:set_wielded_item(w) - end - end - end -end - -local tiles_data = { - -- up, down, right, left, back, front - "techage_sieve_gravel_ta1.png", - "techage_sieve_gravel_ta1.png", - "techage_sieve_sieve_ta1.png", - "techage_sieve_sieve_ta1.png", - "techage_sieve_sieve_ta1.png", - "techage_sieve_sieve_ta1.png", -} - -local nodebox_data = { - { -8/16, -3/16, -8/16, 8/16, 4/16, -6/16 }, - { -8/16, -3/16, 6/16, 8/16, 4/16, 8/16 }, - { -8/16, -3/16, -8/16, -6/16, 4/16, 8/16 }, - { 6/16, -3/16, -8/16, 8/16, 4/16, 8/16 }, - - { -8/16, -8/16, -8/16, -6/16, -3/16, -6/16 }, - { 6/16, -8/16, -8/16, 8/16, -3/16, -6/16 }, - { -8/16, -8/16, 6/16, -6/16, -3/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, -3/16, 8/16 }, - - { -6/16, -2/16, -6/16, 6/16, 8/16, 6/16 }, -} - -for idx = 0,3 do - nodebox_data[9][5] = (8 - 2*idx) / 16 - if idx == 3 then - tiles_data[1] = "techage_sieve_top_ta1.png" - end - - minetest.register_node("techage:sieve"..idx, { - description = S("TA1 Gravel Sieve"), - tiles = table.copy(tiles_data), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = table.copy(nodebox_data), - }, - selection_box = { - type = "fixed", - fixed = { -8/16, -3/16, -8/16, 8/16, 4/16, 8/16 }, - }, - - on_construct = idx == 3 and on_construct or nil, - on_punch = idx == 3 and on_punch or nil, - on_timer = keep_running, - - minecart_hopper_takeitem = minecart_hopper_takeitem, - minecart_hopper_untakeitem = minecart_hopper_untakeitem, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sounds = default.node_sound_wood_defaults(), - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, not_in_creative_inventory = (idx == 3) and 0 or 1}, - drop = "techage:sieve3", - }) -end - -techage.register_node({"techage:sieve0", "techage:sieve1", "techage:sieve2", "techage:sieve3"}, { - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if inv:room_for_item("src", stack) then - inv:add_item("src", stack) - minetest.get_node_timer(pos):start(1.5) - return true - end - return false - end, -}) - -minetest.register_node("techage:sieved_gravel", { - description = S("Sieved Gravel"), - tiles = {"default_gravel.png"}, - groups = {crumbly=2, falling_node=1, not_in_creative_inventory=1}, - sounds = default.node_sound_gravel_defaults(), -}) - -minetest.register_node("techage:compressed_gravel", { - description = S("Compressed Gravel"), - tiles = {"techage_compressed_gravel.png"}, - groups = {cracky=2, crumbly = 2}, - sounds = default.node_sound_gravel_defaults(), -}) - -minetest.register_craft({ - output = "techage:sieve", - recipe = { - {"group:wood", "", "group:wood"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - {"group:wood", "", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = "techage:compressed_gravel", - recipe = { - {"techage:sieved_gravel", "techage:sieved_gravel"}, - {"techage:sieved_gravel", "techage:sieved_gravel"}, - }, -}) - -minetest.register_craft({ - type = "cooking", - output = "default:cobble", - recipe = "techage:compressed_gravel", - cooktime = 10, -}) - -minetest.register_alias("techage:sieve", "techage:sieve3") -minetest.register_alias("techage:auto_sieve", "techage:auto_sieve3") diff --git a/techage/iron_age/hammer.lua b/techage/iron_age/hammer.lua deleted file mode 100644 index c760b61..0000000 --- a/techage/iron_age/hammer.lua +++ /dev/null @@ -1,246 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Hammer to convert stone into gravel - -]]-- - -local S = techage.S - -local Stone2Gravel = { - ["default:stone"] = "default:gravel", - ["default:cobble"] = "default:gravel", - ["default:desert_stone"] = "default:gravel", - ["techage:basalt_stone"] = "techage:basalt_gravel", - ["techage:basalt_cobble"] = "techage:basalt_gravel", - ["techage:bauxite_stone"] = "techage:bauxite_gravel", - ["techage:bauxite_cobble"] = "techage:bauxite_gravel", -} - -function techage.register_stone_gravel_pair(stone_name, gravel_name) - Stone2Gravel[stone_name] = gravel_name -end - --- Pipeworks uses a fakeplayer based on the owner of the nodebraker. -local function is_real_player(player) - return minetest.is_player(player) and not player.is_fake_player -end - -local function handler(player_name, node, itemstack, digparams) - local pos = techage.dug_node[player_name] - if not pos then return end - techage.dug_node[player_name] = nil - - if minetest.is_protected(pos, player_name) then - minetest.record_protection_violation(pos, player_name) - return - end - - if minetest.get_item_group(node.name, "stone") > 0 then - -- Remove item from players inventory or from the world - local ndef = minetest.registered_nodes[node.name] - if ndef then - local item = ItemStack(ndef.drop or node.name) - local inv = minetest.get_inventory({type="player", name=player_name}) - if inv and inv:room_for_item("main", item) then - -- item should have been added and can therefore be removed again - local taken = inv:remove_item("main", item) - else - for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do - obj:remove() - break - end - end - end - if Stone2Gravel[node.name] then - node.name = Stone2Gravel[node.name] - else - node.name = "default:gravel" - end - minetest.swap_node(pos, node) - minetest.check_single_for_falling(pos) - end -end - -minetest.register_tool("techage:hammer_stone", { - description = S("TA1 Stone Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_stone.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=6.00, [2]=2.5, [3]=1.2}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - after_use = function(itemstack, user, node, digparams) - if is_real_player(user) then - minetest.after(0.01, handler, user:get_player_name(), node) - end - itemstack:add_wear(digparams.wear) - return itemstack - end, -}) - -minetest.register_tool("techage:hammer_bronze", { - description = S("TA1 Bronze Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_bronze.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=5.00, [2]=2.0, [3]=1.0}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - after_use = function(itemstack, user, node, digparams) - if is_real_player(user) then - minetest.after(0.01, handler, user:get_player_name(), node) - end - itemstack:add_wear(digparams.wear) - return itemstack - end, -}) - -minetest.register_tool("techage:hammer_steel", { - description = S("TA1 Steel Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_steel.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=50, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - after_use = function(itemstack, user, node, digparams) - if is_real_player(user) then - minetest.after(0.01, handler, user:get_player_name(), node) - end - itemstack:add_wear(digparams.wear) - return itemstack - end, -}) - -minetest.register_tool("techage:hammer_mese", { - description = S("TA1 Mese Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_mese.png", - tool_capabilities = { - full_punch_interval = 0.9, - max_drop_level=3, - groupcaps={ - cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=60, maxlevel=3}, - }, - damage_groups = {fleshy=5}, - }, - sound = {breaks = "default_tool_breaks"}, - after_use = function(itemstack, user, node, digparams) - if is_real_player(user) then - minetest.after(0.01, handler, user:get_player_name(), node) - end - itemstack:add_wear(digparams.wear) - return itemstack - end, -}) - -minetest.register_tool("techage:hammer_diamond", { - description = S("TA1 Diamond Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_diamond.png", - tool_capabilities = { - full_punch_interval = 0.9, - max_drop_level=3, - groupcaps={ - cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=70, maxlevel=3}, - }, - damage_groups = {fleshy=5}, - }, - sound = {breaks = "default_tool_breaks"}, - after_use = function(itemstack, user, node, digparams) - if is_real_player(user) then - minetest.after(0.01, handler, user:get_player_name(), node) - end - itemstack:add_wear(digparams.wear) - return itemstack - end, -}) - -if minetest.global_exists("wielded_light") then - minetest.register_tool("techage:hammer_meridium", { - description = S("TA1 Meridium Hammer (smash stone to gravel)"), - inventory_image = "techage_tool_hammer_meridium.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=60, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - light_source = 12, - after_use = function(itemstack, user, node, digparams) - minetest.after(0.01, handler, user:get_player_name(), node) - itemstack:add_wear(digparams.wear) - return itemstack - end, - }) - minetest.register_craft({ - output = "techage:hammer_meridium 2", - recipe = { - {"techage:meridium_ingot", "group:stick", "techage:meridium_ingot"}, - {"techage:meridium_ingot", "group:stick", "techage:meridium_ingot"}, - {"", "group:stick", ""}, - } - }) -end - -minetest.register_craft({ - output = "techage:hammer_stone 2", - recipe = { - {"default:cobble", "group:stick", "default:cobble"}, - {"default:cobble", "group:stick", "default:cobble"}, - {"", "group:stick", ""}, - } -}) -minetest.register_craft({ - output = "techage:hammer_bronze 2", - recipe = { - {"default:bronze_ingot", "group:stick", "default:bronze_ingot"}, - {"default:bronze_ingot", "group:stick", "default:bronze_ingot"}, - {"", "group:stick", ""}, - } -}) -minetest.register_craft({ - output = "techage:hammer_steel 2", - recipe = { - {"default:steel_ingot", "group:stick", "default:steel_ingot"}, - {"default:steel_ingot", "group:stick", "default:steel_ingot"}, - {"", "group:stick", ""}, - } -}) -minetest.register_craft({ - output = "techage:hammer_mese 2", - recipe = { - {"default:mese_crystal", "group:stick", "default:mese_crystal"}, - {"default:mese_crystal", "group:stick", "default:mese_crystal"}, - {"", "group:stick", ""}, - } -}) -minetest.register_craft({ - output = "techage:hammer_diamond 2", - recipe = { - {"default:diamond", "group:stick", "default:diamond"}, - {"default:diamond", "group:stick", "default:diamond"}, - {"", "group:stick", ""}, - } -}) diff --git a/techage/iron_age/hopper.lua b/techage/iron_age/hopper.lua deleted file mode 100644 index 745b301..0000000 --- a/techage/iron_age/hopper.lua +++ /dev/null @@ -1,92 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Simple TA1 Hopper - -]]-- - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - --- use the minecart hopper -minetest.register_alias("techage:hopper_ta1", "minecart:hopper") - - -minecart.register_inventory( - { - "techage:chest_ta2", "techage:chest_ta3", "techage:chest_ta4", - "techage:meltingpot", "techage:meltingpot_active", "techage:ta4_reactor", - }, - { - put = { - listname = "main", - }, - take = { - listname = "main", - }, - } -) - - - - -minecart.register_inventory( - { - "techage:ta2_distributor_pas", "techage:ta2_distributor_act", - "techage:ta3_distributor_pas", "techage:ta3_distributor_act", - "techage:ta4_distributor_pas", "techage:ta4_distributor_act", - "techage:ta4_high_performance_distributor_pas", "techage:ta4_high_performance_distributor_act", - }, - { - put = { - allow_inventory_put = function(pos, stack, player_name) - CRD(pos).State:start_if_standby(pos) - return true - end, - listname = "src", - }, - take = { - listname = "src", - }, - } -) - -minecart.register_inventory( - { - "techage:sieve0", "techage:sieve1", "techage:sieve2", "techage:sieve3", - }, - { - put = { - allow_inventory_put = function(pos, stack, player_name) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if inv:is_empty("src") then - minetest.get_node_timer(pos):start(2) - return true - end - end, - listname = "src", - }, - } -) - -minecart.register_inventory( - { - "techage:ta1_mill_base", - }, - { - put = { - listname = "src", - }, - take = { - listname = "dst", - }, - } -) diff --git a/techage/iron_age/lighter.lua b/techage/iron_age/lighter.lua deleted file mode 100644 index 8885f0d..0000000 --- a/techage/iron_age/lighter.lua +++ /dev/null @@ -1,89 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Lighter for Coalburner and Charcoalpile - -]]-- - -local S = techage.S - -minetest.register_node("techage:lighter_burn", { - tiles = {"techage_lighter_burn.png"}, - - after_place_node = function(pos) - techage.start_pile(pos) - end, - - on_timer = function(pos, elapsed) - return techage.keep_running_pile(pos) - end, - - on_destruct = function(pos) - techage.stop_pile(pos) - end, - - drop = "", - light_source = 10, - is_ground_content = false, - groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node("techage:coal_lighter_burn", { - tiles = {"techage_lighter_burn.png"}, - - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - local playername = meta:get_string("playername") - techage.start_burner(pos, playername) - end, - - on_timer = function(pos, elapsed) - return techage.keep_running_burner(pos) - end, - - on_destruct = function(pos) - techage.stop_burner(pos) - end, - - drop = "", - light_source = 10, - is_ground_content = false, - groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node("techage:lighter", { - description = S("TA1 Lighter"), - tiles = {"techage_lighter.png"}, - on_ignite = function(pos, igniter) - if minetest.find_node_near(pos, 1, "techage:charcoal") then - minetest.after(1, techage.ironage_swap_node, pos, "techage:coal_lighter_burn") - else - minetest.after(1, techage.ironage_swap_node, pos, "techage:lighter_burn") - end - end, - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - meta:set_string("playername", placer:get_player_name()) - end, - is_ground_content = false, - groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, flammable = 2}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_craft({ - output = 'techage:lighter 2', - recipe = { - {'group:wood'}, - {'farming:straw'}, - {''}, - } -}) diff --git a/techage/iron_age/main.lua b/techage/iron_age/main.lua deleted file mode 100644 index eb2d59f..0000000 --- a/techage/iron_age/main.lua +++ /dev/null @@ -1,28 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - -]]-- - -function techage.ironage_swap_node(pos, name) - minetest.swap_node(pos, {name = name}) - local node = minetest.registered_nodes[name] - if node.on_construct then - node.on_construct(pos) - end - if node.after_place_node then - node.after_place_node(pos) - end -end - -function techage.ironage_swap_nodes(pos1, pos2, name1, name2) - for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, name1)) do - techage.ironage_swap_node(p, name2) - end -end diff --git a/techage/iron_age/meltingpot.lua b/techage/iron_age/meltingpot.lua deleted file mode 100644 index 498df82..0000000 --- a/techage/iron_age/meltingpot.lua +++ /dev/null @@ -1,517 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Meltingpot to produce metal and alloy ingots - -]]-- - -local S = techage.S - -local SMELTING_TIME = 2 - -local Tabs = S("Menu,Recipes") - -local Recipes = {} -- registered recipes -local KeyList = {} -- index to Recipes key translation -local NumRecipes = 0 -local Cache = {} -- store melting pot inventory data - --- formspec images -local function draw(images) - local tbl = {} - for y=0,4 do - for x=0,4 do - local idx = 1 + x + y * 5 - local img = images[idx] - if img ~= false then - tbl[#tbl+1] = "image["..(x*0.8)..","..(y*0.8)..";0.8,0.8;"..img..".png]" - end - end - end - return table.concat(tbl) -end - -local formspec1 = - "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;"..Tabs..";1;;true]".. - "label[1,0.2;"..S("Menu").."]".. - - "container[1,1]".. - "list[current_name;src;0,0;2,2;]".. - "item_image[2.6,0;0.8,0.8;techage:meltingpot]".. - "image[2.3,0.6;1.6,1;gui_furnace_arrow_bg.png^[transformR270]".. - "list[current_name;dst;4,0;2,2;]".. - "container_end[]".. - - "list[current_player;main;0,4;8,4;]".. - "listring[current_name;dst]".. - "listring[current_player;main]".. - "listring[current_name;src]".. - "listring[current_player;main]" - -local function formspec2(idx) - idx = math.min(idx, #KeyList) - local key = KeyList[idx] - local input1 = Recipes[key].input[1] or "" - local input2 = Recipes[key].input[2] or "" - local input3 = Recipes[key].input[3] or "" - local input4 = Recipes[key].input[4] or "" - local num = Recipes[key].number - local heat = Recipes[key].heat - local time = Recipes[key].time - local output = Recipes[key].output - if num > 1 then - output = output.." "..num - end - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;"..Tabs..";2;;true]".. - "label[1,0.2;"..S("Melting Guide").."]".. - - "container[1,1]".. - "item_image_button[0,0;1,1;"..input1..";b1;]".. - "item_image_button[1,0;1,1;"..input2..";b2;]".. - "item_image_button[0,1;1,1;"..input3..";b3;]".. - "item_image_button[1,1;1,1;"..input4..";b4;]".. - "item_image[2.6,0;0.8,0.8;techage:meltingpot]".. - "image[2.3,0.6;1.6,1;gui_furnace_arrow_bg.png^[transformR270]".. - "item_image_button[4,0.5;1,1;"..output..";b5;]".. - "label[2,2.2;"..S("Heat")..": "..heat.." / "..S("Time")..": "..time.." s]".. - "label[2,4;Recipe "..idx.." of "..NumRecipes.."]".. - "button[2,5.5;1,1;priv;<<]".. - "button[3,5.5;1,1;next;>>]".. - "container_end[]" -end - -local function on_receive_fields(pos, formname, fields, sender) - local meta = minetest.get_meta(pos) - local recipe_idx = meta:get_int("recipe_idx") - if recipe_idx == 0 then recipe_idx = 1 end - if fields.tab == "1" then - meta:set_string("formspec", formspec1) - elseif fields.tab == "2" then - meta:set_string("formspec", formspec2(recipe_idx)) - elseif fields.next == ">>" then - recipe_idx = math.min(recipe_idx + 1, NumRecipes) - meta:set_int("recipe_idx", recipe_idx) - meta:set_string("formspec", formspec2(recipe_idx)) - elseif fields.priv == "<<" then - recipe_idx = math.max(recipe_idx - 1, 1) - meta:set_int("recipe_idx", recipe_idx) - meta:set_string("formspec", formspec2(recipe_idx)) - end -end - -local function can_dig(pos, player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if listname == "src" then - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - --- generate an unique key based on the unsorted and --- variable number of inventory items -local function recipe_key(items) - local tbl = {} - -- remove items which exist more than once - for _,item in ipairs(items) do - tbl[item] = true - end - local names = {} - for key,_ in pairs(tbl) do - names[#names + 1] = key - end - -- bring in a sorted order - table.sort(names) - return table.concat(names, "-") -end - --- determine recipe based on inventory items -local function get_recipe(inv) - -- collect items - local stacks = {} - local names = {} - for _,stack in ipairs(inv:get_list("src")) do - if not stack:is_empty() then - table.insert(names, stack:get_name()) - table.insert(stacks, stack) - else - table.insert(stacks, ItemStack("")) - end - end - local key = recipe_key(names) - local recipe = Recipes[key] - - if recipe then - return { - input = recipe.input, - stacks = stacks, - output = ItemStack(recipe.output.." "..recipe.number), - heat = recipe.heat, - time = recipe.time, - } - end - return nil -end - --- prepare recipe and store in cache table for faster access -local function store_recipe_in_cache(pos) - local hash = minetest.hash_node_position(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local recipe = get_recipe(inv) - Cache[hash] = recipe - return recipe -end - --- read value from the node below -local function get_heat(pos) - local heat = 0 - pos.y = pos.y - 1 - local node = techage.get_node_lvm(pos) - local meta = minetest.get_meta(pos) - if minetest.get_item_group(node.name, "techage_flame") == 0 then - pos.y = pos.y + 1 - return 0 - end - - pos.y = pos.y - 1 - node = techage.get_node_lvm(pos) - pos.y = pos.y + 2 - if minetest.get_item_group(node.name, "techage_flame") == 0 and - node.name ~= "techage:charcoal_burn" then - return 0 - end - - return meta:get_int("heat") -end - --- Start melting if heat is ok AND source items available -function techage.switch_to_active(pos) - local meta = minetest.get_meta(pos) - local heat = get_heat(pos) - local recipe = store_recipe_in_cache(pos) - - if recipe and heat >= recipe.heat then - minetest.swap_node(pos, {name = "techage:meltingpot_active"}) - minetest.registered_nodes["techage:meltingpot_active"].on_construct(pos) - meta:set_string("infotext", S("Melting Pot active (heat=")..heat..")") - minetest.get_node_timer(pos):start(2) - return true - end - meta:set_string("infotext", S("Melting Pot inactive (heat=")..heat..")") - return false -end - -function techage.update_heat(pos) - local meta = minetest.get_meta(pos) - local heat = get_heat(pos) - meta:set_string("infotext", S("Melting Pot inactive (heat=")..heat..")") -end - -local function set_inactive(meta, pos, heat) - minetest.get_node_timer(pos):stop() - minetest.swap_node(pos, {name = "techage:meltingpot"}) - minetest.registered_nodes["techage:meltingpot"].on_construct(pos) - meta:set_string("infotext", S("Melting Pot inactive (heat=")..heat..")") -end - --- Stop melting if heat to low OR no source items available -local function switch_to_inactive(pos) - local meta = minetest.get_meta(pos) - local heat = get_heat(pos) - local hash = minetest.hash_node_position(pos) - local recipe = Cache[hash] or store_recipe_in_cache(pos) - - if not recipe or heat < recipe.heat then - set_inactive(meta, pos, heat) - return true - end - meta:set_string("infotext", S("Melting Pot active (heat=")..heat..")") - return false -end - - -local function index(list, x) - for idx, v in pairs(list) do - if v == x then return idx end - end - return nil -end - --- move recipe src items to output inventory -local function process(inv, recipe, heat) - if heat < recipe.heat then - return false - end - local res = false - if inv:room_for_item("dst", recipe.output) then - for _,item in ipairs(recipe.input) do - res = false - for _, stack in ipairs(recipe.stacks) do - if stack:get_count() > 0 and stack:get_name() == item then - stack:take_item(1) - res = true - break - end - end - if res == false then - return false - end - end - inv:add_item("dst", recipe.output) - inv:set_list("src", recipe.stacks) - return true - end - return false -end - -local function smelting(pos, recipe, heat, elapsed) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - elapsed = elapsed + meta:get_int("leftover") - - while elapsed >= recipe.time do - if process(inv, recipe, heat) == false then - meta:set_int("leftover", 0) - set_inactive(meta, pos, heat) - return false - end - elapsed = elapsed - recipe.time - end - meta:set_int("leftover", elapsed) - return true -end - -local function pot_node_timer(pos, elapsed) - if switch_to_inactive(pos) == false then - local hash = minetest.hash_node_position(pos) - local heat = get_heat(pos) - local recipe = Cache[hash] or store_recipe_in_cache(pos) - if recipe then - return smelting(pos, recipe, heat, elapsed) - end - end - return false -end - -minetest.register_node("techage:meltingpot_active", { - description = S("TA1 Melting Pot"), - tiles = { - { - name = "techage_meltingpot_top_active.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 1, - }, - }, - "default_cobble.png^techage_meltingpot.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-10/16, -8/16, -10/16, 10/16, 9/16, -6/16}, - {-10/16, -8/16, 6/16, 10/16, 9/16, 10/16}, - {-10/16, -8/16, -10/16, -6/16, 9/16, 10/16}, - { 6/16, -8/16, -10/16, 10/16, 9/16, 10/16}, - { -6/16, -8/16, -6/16, 6/16, 5/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-10/16, -8/16, -10/16, 10/16, 9/16, 10/16}, - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec1) - local inv = meta:get_inventory() - inv:set_size('src', 4) - inv:set_size('dst', 4) - end, - - on_timer = function(pos, elapsed) - return pot_node_timer(pos, elapsed) - end, - - on_receive_fields = function(pos, formname, fields, sender) - on_receive_fields(pos, formname, fields, sender) - end, - - on_metadata_inventory_move = function(pos) - store_recipe_in_cache(pos) - switch_to_inactive(pos) - end, - - on_metadata_inventory_put = function(pos) - store_recipe_in_cache(pos) - switch_to_inactive(pos) - end, - - on_metadata_inventory_take = function(pos) - store_recipe_in_cache(pos) - switch_to_inactive(pos) - end, - - can_dig = can_dig, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - drop = "techage:meltingpot", - is_ground_content = false, - groups = {cracky = 3, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, -}) - -minetest.register_node("techage:meltingpot", { - description = S("TA1 Melting Pot"), - tiles = { - "default_cobble.png", - "default_cobble.png^techage_meltingpot.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-10/16, -8/16, -10/16, 10/16, 9/16, -6/16}, - {-10/16, -8/16, 6/16, 10/16, 9/16, 10/16}, - {-10/16, -8/16, -10/16, -6/16, 9/16, 10/16}, - { 6/16, -8/16, -10/16, 10/16, 9/16, 10/16}, - { -6/16, -8/16, -6/16, 6/16, -4/16, 6/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-10/16, -8/16, -10/16, 10/16, 9/16, 10/16}, - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec1) - meta:set_string("infotext", S("Melting Pot inactive (heat=0)")) - local inv = meta:get_inventory() - inv:set_size('src', 4) - inv:set_size('dst', 4) - end, - - on_metadata_inventory_move = function(pos) - store_recipe_in_cache(pos) - techage.switch_to_active(pos) - end, - - on_metadata_inventory_put = function(pos) - store_recipe_in_cache(pos) - techage.switch_to_active(pos) - end, - - on_metadata_inventory_take = function(pos) - store_recipe_in_cache(pos) - techage.switch_to_active(pos) - end, - - on_receive_fields = function(pos, formname, fields, sender) - on_receive_fields(pos, formname, fields, sender) - end, - - can_dig = can_dig, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {cracky = 3}, - sounds = default.node_sound_metal_defaults(), - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, -}) - -minetest.register_craft({ - output = "techage:meltingpot", - recipe = { - {"default:cobble", "default:copper_ingot", "default:cobble"}, - {"default:cobble", "", "default:cobble"}, - {"default:cobble", "default:cobble", "default:cobble"}, - }, -}) - -techage.recipes.register_craft_type("melting", { - description = S("TA1 Melting"), - icon = "default_cobble.png^techage_meltingpot.png", - width = 2, - height = 2, -}) -techage.recipes.register_craft_type("burning", { - description = S("TA1 Burning"), - icon = "techage_smoke.png", - width = 1, - height = 1, -}) -techage.recipes.register_craft({ - output = "techage:charcoal", - items = {"group:wood"}, - type = "burning", -}) - -function techage.ironage_register_recipe(recipe) - local key = recipe_key(recipe.recipe) - local output = string.split(recipe.output, " ") - local number = tonumber(output[2] or 1) - table.insert(KeyList, key) - Recipes[key] = { - input = recipe.recipe, - output = output[1], - number = number, - heat = math.max(recipe.heat or 3, 2), - time = math.max(recipe.time or 2, 2*number), - } - NumRecipes = NumRecipes + 1 - - recipe.items = recipe.recipe - recipe.type = "melting" - techage.recipes.register_craft(recipe) -end diff --git a/techage/iron_age/meridium.lua b/techage/iron_age/meridium.lua deleted file mode 100644 index e456444..0000000 --- a/techage/iron_age/meridium.lua +++ /dev/null @@ -1,125 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Brilliant Meririum and tools (mod "wielded_light" needed) - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:meridium_ingot", { - description = "Meridium Ingot", - inventory_image = "techage_meridium_ingot.png", -}) - - -minetest.register_tool("techage:pick_meridium", { - description = S("Meridium Pickaxe"), - inventory_image = "techage_meridiumpick.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - light_source = 12, -}) - -minetest.register_tool("techage:shovel_meridium", { - description = S("Meridium Shovel"), - inventory_image = "techage_meridiumshovel.png", - wield_image = "techage_meridiumshovel.png^[transformR90", - tool_capabilities = { - full_punch_interval = 1.1, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=3}, - }, - sound = {breaks = "default_tool_breaks"}, - light_source = 12, -}) - -minetest.register_tool("techage:axe_meridium", { - description = S("Meridium Axe"), - inventory_image = "techage_meridiumaxe.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, - light_source = 12, -}) - -minetest.register_tool("techage:sword_meridium", { - description = S("Meridium Sword"), - inventory_image = "techage_meridiumsword.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=6}, - }, - sound = {breaks = "default_tool_breaks"}, - light_source = 12, -}) - -minetest.register_craft({ - output = 'techage:pick_meridium', - recipe = { - {'techage:meridium_ingot', 'techage:meridium_ingot', 'techage:meridium_ingot'}, - {'', 'group:stick', ''}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'techage:shovel_meridium', - recipe = { - {'techage:meridium_ingot'}, - {'group:stick'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'techage:axe_meridium', - recipe = { - {'techage:meridium_ingot', 'techage:meridium_ingot'}, - {'techage:meridium_ingot', 'group:stick'}, - {'', 'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'techage:sword_meridium', - recipe = { - {'techage:meridium_ingot'}, - {'techage:meridium_ingot'}, - {'group:stick'}, - } -}) - -techage.ironage_register_recipe({ - output = "techage:meridium_ingot", - recipe = {"default:steel_ingot", "default:mese_crystal_fragment"}, - heat = 4, - time = 3, -}) diff --git a/techage/iron_age/recipes.lua b/techage/iron_age/recipes.lua deleted file mode 100644 index 4169811..0000000 --- a/techage/iron_age/recipes.lua +++ /dev/null @@ -1,237 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Meltingpot recipes - Bucket redefinitions - -]]-- - -local S = techage.S - --- --- New burner recipes --- -techage.ironage_register_recipe({ - output = "default:obsidian", - recipe = {"default:cobble"}, - heat = 10, - time = 8, -}) - -techage.ironage_register_recipe({ - output = "techage:iron_ingot", - recipe = {"default:iron_lump"}, - heat = 5, - time = 3, -}) - -minetest.register_craftitem("techage:iron_ingot", { - description = S("TA1 Iron Ingot"), - inventory_image = "techage_iron_ingot.png", - use_texture_alpha = techage.CLIP, -}) - -local function check_protection(pos, name, text) - if minetest.is_protected(pos, name) then - minetest.log("action", (name ~= "" and name or "A mod") - .. " tried to " .. text - .. " at protected position " - .. minetest.pos_to_string(pos) - .. " with a bucket") - minetest.record_protection_violation(pos, name) - return true - end - return false -end - --- derived from bucket/init.lua -local function register_liquid(source, flowing, itemname, inventory_image, name, - groups, force_renew) - bucket.liquids[source] = { - source = source, - flowing = flowing, - itemname = itemname, - force_renew = force_renew, - } - bucket.liquids[flowing] = bucket.liquids[source] - - if itemname ~= nil then - minetest.unregister_item(itemname) - - minetest.register_craftitem(":"..itemname, { - description = name, - inventory_image = inventory_image, - stack_max = 1, - liquids_pointable = true, - groups = groups, - - on_place = function(itemstack, user, pointed_thing) - -- Must be pointing to node - if pointed_thing.type ~= "node" then - return - end - - local node = minetest.get_node_or_nil(pointed_thing.under) - local ndef = node and minetest.registered_nodes[node.name] - - -- Call on_rightclick if the pointed node defines it - if ndef and ndef.on_rightclick and - not (user and user:is_player() and - user:get_player_control().sneak) then - return ndef.on_rightclick( - pointed_thing.under, - node, user, - itemstack) - end - - local lpos - - -- Check if pointing to a buildable node - if ndef and ndef.buildable_to then - -- buildable; replace the node - lpos = pointed_thing.under - else - -- not buildable to; place the liquid above - -- check if the node above can be replaced - - lpos = pointed_thing.above - node = minetest.get_node_or_nil(lpos) - local above_ndef = node and minetest.registered_nodes[node.name] - - if not above_ndef or not above_ndef.buildable_to then - -- do not remove the bucket with the liquid - return itemstack - end - end - - if check_protection(lpos, user - and user:get_player_name() - or "", "place "..source) then - return - end - - -------------------------------- Start Modification --- minetest.set_node(lpos, {name = source}) - if source == "default:lava_source" and lpos.y > 0 and not minetest.is_singleplayer() then - minetest.chat_send_player(user:get_player_name(), S("[Bucket] Lava can only be placed below sea level!")) - return - else - -- see "basis/lib.lua" techage.is_ocean(pos) - minetest.set_node(lpos, {name = source, param2 = 1}) - end - -------------------------------- End Modification - return ItemStack("bucket:bucket_empty") - end - }) - end -end - - --- --- Changed default recipes --- -if techage.modified_recipes_enabled then - minetest.clear_craft({output = "default:bronze_ingot"}) - minetest.clear_craft({output = "default:steel_ingot"}) - minetest.clear_craft({output = "fire:flint_and_steel"}) - minetest.clear_craft({output = "bucket:bucket_empty"}) - if minetest.global_exists("moreores") then - minetest.clear_craft({output = "moreores:silver_ingot"}) - end - - -- add again - minetest.register_craft({ - output = 'default:steel_ingot 9', - recipe = { - {'default:steelblock'}, - } - }) - minetest.register_craft({ - output = 'default:bronze_ingot 9', - recipe = { - {'default:bronzeblock'}, - } - }) - - techage.ironage_register_recipe({ - output = "default:bronze_ingot 4", - recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"}, - heat = 4, - time = 8, - }) - - techage.ironage_register_recipe({ - output = "default:steel_ingot 4", - recipe = {"default:coal_lump", "default:iron_lump", "default:iron_lump", "default:iron_lump"}, - heat = 7, - time = 8, - }) - - techage.ironage_register_recipe({ - output = "default:tin_ingot 1", - recipe = {"default:tin_lump"}, - heat = 4, - time = 2, - }) - - if minetest.global_exists("moreores") then - techage.ironage_register_recipe({ - output = "moreores:silver_ingot 1", - recipe = {"moreores:silver_lump"}, - heat = 5, - time = 2, - }) - - end - - minetest.register_craft({ - output = "fire:flint_and_steel", - recipe = { - {"default:flint", "default:iron_lump"} - } - }) - - minetest.register_craft({ - output = 'bucket:bucket_empty 2', - recipe = { - {'techage:iron_ingot', '', 'techage:iron_ingot'}, - {'', 'techage:iron_ingot', ''}, - } - }) - - minetest.override_item("fire:flint_and_steel", { - description = S("Flint and Iron"), - inventory_image = "fire_flint_steel.png^[colorize:#c7643d:60", - }) - - minetest.override_item("bucket:bucket_empty", { - inventory_image = "bucket.png^[colorize:#c7643d:40" - }) - minetest.override_item("bucket:bucket_river_water", { - inventory_image = "bucket_river_water.png^[colorize:#c7643d:30" - }) - - register_liquid( - "default:water_source", - "default:water_flowing", - "bucket:bucket_water", - "bucket_water.png^[colorize:#c7643d:30", - "Water Bucket", - {water_bucket = 1} - ) - - register_liquid( - "default:lava_source", - "default:lava_flowing", - "bucket:bucket_lava", - "bucket_lava.png^[colorize:#c7643d:30", - "Lava Bucket" - ) -end diff --git a/techage/iron_age/tools.lua b/techage/iron_age/tools.lua deleted file mode 100644 index 3316ebc..0000000 --- a/techage/iron_age/tools.lua +++ /dev/null @@ -1,102 +0,0 @@ ---[[ - - Iron Age - ======== - - Copyright (C) 2018 Joachim Stolberg - Based on mods/default/tools.lua - - AGPL v3 - See LICENSE.txt for more information - -]]-- - - - -local function tools() - minetest.override_item("default:pick_bronze", { - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - }) - minetest.override_item("default:pick_steel", { - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - }) - - minetest.override_item("default:shovel_bronze", { - tool_capabilities = { - full_punch_interval = 1.1, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=3}, - }, - }) - minetest.override_item("default:shovel_steel", { - tool_capabilities = { - full_punch_interval = 1.1, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=3}, - }, - }) - - minetest.override_item("default:axe_bronze", { - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - }) - minetest.override_item("default:axe_steel", { - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - }) - - minetest.override_item("default:sword_bronze", { - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=6}, - }, - }) - minetest.override_item("default:sword_steel", { - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=6}, - }, - }) -end - -minetest.after(1, tools) diff --git a/techage/items/aluminium.lua b/techage/items/aluminium.lua deleted file mode 100644 index 0c34069..0000000 --- a/techage/items/aluminium.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Aluminium - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:gibbsite_powder", { - description = S("Gibbsite Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#C6DCDB:120", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:aluminum", { - description = S("Aluminum"), - inventory_image = "techage_aluminum_inv.png", -}) - -minetest.register_craftitem("techage:redmud", { - description = S("Red Mud"), - inventory_image = "techage_liquid2_inv.png^[colorize:#F80E13:140^techage_liquid1_inv.png", -}) - -minetest.register_craftitem("techage:barrel_redmud", { - description = S("Red Mud Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#F80E13:140^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:canister_redmud", { - description = S("Red Mud Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#F80E13:140^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -techage.register_liquid("techage:barrel_redmud", "techage:ta3_barrel_empty", 10, "techage:redmud") -techage.register_liquid("techage:canister_redmud", "techage:ta3_canister_empty", 1, "techage:redmud") - -techage.recipes.add("ta4_doser", { - output = "techage:gibbsite_powder 2", - waste = "techage:redmud 1", - input = { - "techage:bauxite_powder 2", - "techage:lye 1", - } -}) - -techage.furnace.register_recipe({ - output = "techage:aluminum 2", - recipe = {"techage:gibbsite_powder", "techage:gibbsite_powder", - "techage:gibbsite_powder", "techage:gibbsite_powder"}, - time = 16, - -}) - -if minetest.get_modpath('techpack_stairway') then - minetest.register_craft({ - output = "techpack_stairway:grating 6", - recipe = { - {"", "", ""}, - {"dye:dark_grey", "", "default:coal_lump"}, - {"default:steel_ingot", "techage:aluminum", "default:steel_ingot"}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:handrail 6", - recipe = { - {"default:steel_ingot", "default:coal_lump", ""}, - {"techage:aluminum", "", ""}, - {"default:steel_ingot", "dye:dark_grey", ""}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:stairway1 6", - recipe = { - {"", "", "default:steel_ingot"}, - {"dye:dark_grey", "techage:aluminum", "default:coal_lump"}, - {"default:steel_ingot", "", ""}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:ladder1 3", - recipe = { - {"", "default:steel_ingot", ""}, - {"dye:dark_grey", "techage:aluminum", "default:coal_lump"}, - {"", "default:steel_ingot", ""}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:ladder3 6", - recipe = { - {"", "", "default:steel_ingot"}, - {"dye:dark_grey", "techage:aluminum", "default:coal_lump"}, - {"", "", "default:steel_ingot"}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:ladder4 12", - recipe = { - {"dye:dark_grey", "techage:aluminum", "default:coal_lump"}, - {"", "default:steel_ingot", ""}, - {"", "default:steel_ingot", ""}, - }, - }) - - minetest.register_craft({ - output = "techpack_stairway:lattice 4", - recipe = { - {"default:steel_ingot", "", "default:steel_ingot"}, - {"dye:dark_grey", "techage:aluminum", "default:coal_lump"}, - {"default:steel_ingot", "", "default:steel_ingot"}, - }, - }) -end diff --git a/techage/items/baborium.lua b/techage/items/baborium.lua deleted file mode 100644 index f82f0fb..0000000 --- a/techage/items/baborium.lua +++ /dev/null @@ -1,51 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Baborium - -]]-- - -local S = techage.S - -minetest.register_node("techage:stone_with_baborium", { - description = S("Baborium Ore"), - tiles = {"default_stone.png^techage_baborium.png"}, - groups = {cracky = 2}, - drop = 'techage:baborium_lump', - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craftitem("techage:baborium_lump", { - description = S("Baborium Lump"), - inventory_image = "techage_baborium_lump.png", -}) - -minetest.register_craftitem("techage:baborium_ingot", { - description = S("Baborium Ingot"), - inventory_image = "techage_baborium_ingot.png", -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "techage:stone_with_baborium", - wherein = "default:stone", - clust_scarcity = 8 * 8 * 8, - clust_num_ores = 5, - clust_size = 3, - y_min = -340, - y_max = -250, -}) - -minetest.register_craft({ - type = 'cooking', - output = 'techage:baborium_ingot', - recipe = 'techage:baborium_lump', - cooktime = 5, -}) diff --git a/techage/items/barrel.lua b/techage/items/barrel.lua deleted file mode 100644 index 226de59..0000000 --- a/techage/items/barrel.lua +++ /dev/null @@ -1,114 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Barrel/Liquid/Canister/Water - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:water", { - description = S("Water"), - inventory_image = "techage_liquid2_inv.png^[colorize:#0b6eca:120^techage_liquid1_inv.png", - groups = {not_in_creative_inventory=1}, - -}) - -minetest.register_craftitem("techage:river_water", { - description = S("Water"), - inventory_image = "techage_liquid2_inv.png^[colorize:#189dc3:120^techage_liquid1_inv.png", - groups = {not_in_creative_inventory=1}, - -}) - -minetest.register_craftitem("techage:barrel_water", { - description = S("Water Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#0b6eca:120^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:barrel_river_water", { - description = S("River Water Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#189dc3:120^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:liquid", { - description = S("empty"), - inventory_image = "techage_liquid2_inv.png^[colorize:#BFBFBF:180^techage_liquid1_inv.png", - groups = {not_in_creative_inventory=1}, -}) - -minetest.register_craftitem("techage:ta3_barrel_empty", { - description = S("TA Empty Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#BFBFBF:180", -}) - -minetest.register_craftitem("techage:ta3_canister_empty", { - description = S("TA3 Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#BFBFBF:180^techage_canister_frame.png", -}) - -minetest.register_craftitem("techage:ta3_cylinder_small", { - description = S("Gas Cylinder Small"), - inventory_image = "techage_gas_cylinder_small.png^[colorize:#4D7481:100", -}) - -minetest.register_craftitem("techage:ta3_cylinder_large", { - description = S("Gas Cylinder Large"), - inventory_image = "techage_gas_cylinder_large.png^[colorize:#4D7481:100", -}) - - -minetest.register_craft({ - output = 'techage:ta3_barrel_empty 6', - recipe = { - {'techage:iron_ingot', 'techage:iron_ingot', 'techage:iron_ingot'}, - {'techage:iron_ingot', '', 'techage:iron_ingot'}, - {'techage:iron_ingot', 'techage:iron_ingot', 'techage:iron_ingot'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_canister_empty 6', - recipe = { - {'basic_materials:plastic_sheet', 'basic_materials:plastic_sheet', 'basic_materials:plastic_sheet'}, - {'basic_materials:plastic_sheet', '', 'basic_materials:plastic_sheet'}, - {'basic_materials:plastic_sheet', 'basic_materials:plastic_sheet', 'basic_materials:plastic_sheet'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_cylinder_small 8', - recipe = { - {'', 'techage:iron_ingot', ''}, - {'techage:iron_ingot', '', 'techage:iron_ingot'}, - {'techage:iron_ingot', 'techage:iron_ingot', 'techage:iron_ingot'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_cylinder_large', - recipe = { - {'', 'techage:ta3_cylinder_small', ''}, - {'', 'techage:ta3_cylinder_small', ''}, - {'', 'techage:ta3_cylinder_small', ''}, - } -}) - - - -techage.register_liquid("bucket:bucket_water", "bucket:bucket_empty", 1, "techage:water") -techage.register_liquid("bucket:bucket_river_water", "bucket:bucket_empty", 1, "techage:river_water") - -techage.register_liquid("techage:barrel_water", "techage:ta3_barrel_empty", 10, "techage:water") -techage.register_liquid("techage:barrel_river_water", "techage:ta3_barrel_empty", 10, "techage:river_water") - -techage.register_liquid("bucket:bucket_lava", "bucket:bucket_empty", 1, "default:lava_source") diff --git a/techage/items/basalt.lua b/techage/items/basalt.lua deleted file mode 100644 index e3fe2f6..0000000 --- a/techage/items/basalt.lua +++ /dev/null @@ -1,203 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Basalt as result from the lava/water generator - -]]-- - -local S = techage.S - --- Replace default:stone with techage:basalt which is less valuable for ore generation. -default.cool_lava = function(pos, node) - if node.name == "default:lava_source" then - minetest.set_node(pos, {name = "default:obsidian"}) - else -- Lava flowing - minetest.set_node(pos, {name = "techage:basalt_stone"}) - end - minetest.sound_play("default_cool_lava", - {pos = pos, max_hear_distance = 16, gain = 0.25}) -end - -minetest.register_node("techage:basalt_stone", { - description = S("Basalt Stone"), - tiles = {"default_stone.png^[brighten"}, - groups = {cracky = 3, stone = 1}, - drop = 'techage:basalt_cobble', - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:basalt_cobble", { - description = S("Basalt Cobble"), - tiles = {"default_cobble.png^[brighten"}, - groups = {cracky = 3, stone = 2}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:basalt_stone_brick", { - description = S("Basalt Stone Brick"), - paramtype2 = "facedir", - place_param2 = 0, - tiles = {"default_stone_brick.png^[brighten"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:basalt_stone_block", { - description = S("Basalt Stone Block"), - tiles = {"default_stone_block.png^[brighten"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:basalt_gravel", { - description = S("Basalt Gravel"), - tiles = {"default_gravel.png^[brighten"}, - groups = {crumbly = 2, falling_node = 1, gravel = 1}, - sounds = default.node_sound_gravel_defaults(), -}) - -minetest.register_node("techage:sieved_basalt_gravel", { - description = S("Sieved Basalt Gravel"), - tiles = {"default_gravel.png^[brighten"}, - groups = {crumbly = 2, falling_node = 1, gravel = 1, not_in_creative_inventory=1}, - sounds = default.node_sound_gravel_defaults(), -}) - -minetest.register_node("techage:basalt_glass", { - description = S("Basalt Glass"), - drawtype = "glasslike_framed_optional", - tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:basalt_glass2", { - description = S("Basalt Glass 2"), - drawtype = "glasslike_framed_optional", - tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:basalt_glass_thin", { - description = S("Basalt Glass Thin"), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -1/16, 8/16, 8/16, 1/16}, - }, - }, - tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:basalt_glass_thin2", { - description = S("Basalt Glass Thin 2"), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -1/16, 8/16, 8/16, 1/16}, - }, - }, - tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:basalt_glass_thin_xl", { - description = S("Basalt Glass Thin XL"), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -1/16, 16/16, 16/16, 1/16}, - }, - }, - tiles = {"techage_basalt_glass.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:basalt_glass_thin_xl2", { - description = S("Basalt Glass Thin XL 2"), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -1/16, 16/16, 16/16, 1/16}, - }, - }, - tiles = {"techage_basalt_glass2.png"}, - use_texture_alpha = techage.BLEND, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_craft({ - output = "techage:basalt_stone_brick 4", - recipe = { - {"techage:basalt_stone", "techage:basalt_stone"}, - {"techage:basalt_stone", "techage:basalt_stone"}, - } -}) - -minetest.register_craft({ - output = "techage:basalt_stone_block 9", - recipe = { - {"techage:basalt_stone", "techage:basalt_stone", "techage:basalt_stone"}, - {"techage:basalt_stone", "techage:basalt_stone", "techage:basalt_stone"}, - {"techage:basalt_stone", "techage:basalt_stone", "techage:basalt_stone"}, - } -}) - -minetest.register_craft({ - type = "cooking", - output = "techage:basalt_stone", - recipe = "techage:basalt_cobble", -}) - -techage.add_grinder_recipe({input="techage:basalt_stone", output="techage:basalt_gravel"}) -techage.add_grinder_recipe({input="techage:basalt_cobble", output="techage:basalt_gravel"}) -techage.add_grinder_recipe({input="techage:basalt_gravel", output="default:clay"}) -techage.add_grinder_recipe({input="techage:sieved_basalt_gravel", output="default:clay"}) diff --git a/techage/items/bauxit.lua b/techage/items/bauxit.lua deleted file mode 100644 index cf3102a..0000000 --- a/techage/items/bauxit.lua +++ /dev/null @@ -1,68 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Bauxite - -]]-- - -local S = techage.S - -minetest.register_node("techage:bauxite_stone", { - description = S("Bauxite Stone"), - tiles = {"default_desert_stone.png^techage_bauxit_overlay.png^[colorize:#FB2A00:120"}, - groups = {cracky = 3, stone = 1}, - drop = 'techage:bauxite_cobble', - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:bauxite_cobble", { - description = S("Bauxite Cobblestone"), - tiles = {"default_desert_cobble.png^[colorize:#FB2A00:80"}, - is_ground_content = false, - groups = {cracky = 3, stone = 2}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:bauxite_gravel", { - description = S("Bauxite Gravel"), - tiles = {"default_gravel.png^[colorize:#FB2A00:180"}, - is_ground_content = false, - groups = {crumbly = 2, falling_node = 1}, - sounds = default.node_sound_gravel_defaults(), -}) - -minetest.register_craftitem("techage:bauxite_powder", { - description = S("Bauxite Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#FB2A00:120", - groups = {powder = 1}, -}) - - -minetest.register_ore({ - ore_type = "blob", - ore = "techage:bauxite_stone", - wherein = {"default:stone", "default:desert_stone"}, - clust_scarcity = 16 * 16 * 16, - clust_size = 6, - y_max = -50, - y_min = -500, - noise_threshold = 0.0, - noise_params = { - offset = 0.5, - scale = 0.2, - spread = {x = 5, y = 5, z = 5}, - seed = 41524, - octaves = 1, - persist = 0.0 - }, -}) - -techage.add_grinder_recipe({input="techage:bauxite_cobble", output="techage:bauxite_gravel"}) -techage.add_grinder_recipe({input="techage:bauxite_gravel", output="techage:bauxite_powder"}) diff --git a/techage/items/cement.lua b/techage/items/cement.lua deleted file mode 100644 index 8d9d2fe..0000000 --- a/techage/items/cement.lua +++ /dev/null @@ -1,70 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Cement as ingredient and alternative recipe for basic_materials:wet_cement - Cement is cooked and grinded clay - -]]-- - -local S = techage.S - - -if not minetest.get_modpath("bakedclay") then - minetest.register_node("techage:cement_block", { - description = S("Cement Block"), - tiles = {"default_clay.png^[colorize:#FFFFFF:160"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), - }) - - minetest.register_craft({ - type = "cooking", - output = "techage:cement_block", - recipe = "default:clay", - }) - - techage.add_grinder_recipe({input="techage:cement_block", output="techage:cement_powder"}) -else - -- The block should not exist when the mod baked clay is loaded. - -- But this block was active due to an error and can therefore no longer be deleted. - minetest.register_node("techage:cement_block", { - description = S("Cement Block"), - tiles = {"default_clay.png^[colorize:#FFFFFF:160"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), - }) - - -- Needs to be a techage recipe, not to overwrite the clay/bakedclay recipe - techage.furnace.register_recipe({ - output = "techage:cement_block", - recipe = { - "default:clay", - }, - }) - techage.add_grinder_recipe({input="techage:cement_block", output="techage:cement_powder"}) - techage.add_grinder_recipe({input="bakedclay:white", output="techage:cement_powder"}) -end - -minetest.register_craftitem("techage:cement_powder", { - description = S("Cement Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#FFFFFF:240", - groups = {powder = 1}, -}) - -minetest.register_craft({ - output = "basic_materials:wet_cement 3", - recipe = { - {"bucket:bucket_water", "techage:cement_powder"}, - {"group:sand", "default:gravel"}, - }, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, -}) diff --git a/techage/items/ceramic.lua b/techage/items/ceramic.lua deleted file mode 100644 index 5bdcad6..0000000 --- a/techage/items/ceramic.lua +++ /dev/null @@ -1,84 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Ceramic - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:ta4_ceramic_material", { - description = S("TA4 Ceramic Material"), - inventory_image = "techage_ceramic_material.png", - groups = {powder = 1}, -}) - -techage.recipes.add("ta4_doser", { - output = "techage:ta4_ceramic_material 2", - input = { - "techage:clay_powder 1", - "techage:aluminum_powder 1", - "techage:silver_sandstone_powder 1", - "techage:water 1", - } -}) - -minetest.register_craft({ - output = "techage:ta4_ceramic_material 2", - recipe = { - {"techage:clay_powder", "techage:aluminum_powder", ""}, - {"techage:silver_sandstone_powder", "bucket:bucket_water", ""}, - {"", "", ""}, - }, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, -}) - -minetest.register_craftitem("techage:ta4_furnace_ceramic", { - description = S("TA4 Furnace Ceramic"), - inventory_image = "techage_furnace_ceramic.png", -}) - -techage.furnace.register_recipe({ - output = "techage:ta4_furnace_ceramic", - recipe = { - "techage:ta4_ceramic_material", - "techage:ta4_ceramic_material", - }, - time = 16, -}) - -minetest.register_craftitem("techage:ta4_round_ceramic", { - description = S("TA4 Round Ceramic"), - inventory_image = "techage_round_ceramic.png", -}) - -minetest.register_craftitem("techage:ta5_ceramic_turbine", { - description = S("TA5 Ceramic Turbine"), - inventory_image = "techage_ceramic_turbine.png", -}) - -techage.furnace.register_recipe({ - output = "techage:ta4_round_ceramic 2", - recipe = { - "techage:ta4_ceramic_material", "techage:ta4_ceramic_material", - "techage:ta4_ceramic_material", "techage:ta4_ceramic_material", - }, - time = 16, -}) - -techage.furnace.register_recipe({ - output = "techage:ta5_ceramic_turbine", - recipe = { - "techage:ta4_ceramic_material", - "techage:ta4_ceramic_material", - "techage:graphite_powder", - }, - time = 16, -}) diff --git a/techage/items/cracking.lua b/techage/items/cracking.lua deleted file mode 100644 index 52c98f3..0000000 --- a/techage/items/cracking.lua +++ /dev/null @@ -1,109 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Cracking breaks long chains of hydrocarbons into short chains using a catalyst. - Gibbsite powder serves as a catalyst (is not consumed). - It can be used to convert bitumen into fueloil, fueloil into naphtha, naphtha into gasoline, - and gasoline into gas. - - In hydrogenation, pairs of hydrogen atoms are added to a molecule to convert short-chain - hydrocarbons into long ones. - Here iron powder is required as a catalyst (is not consumed). - It can be used to convert gas (propan) into isobutane, isobutane into gasoline, gasoline into naphtha, - naphtha into fueloil, and fueloil into bitumen. - -]]-- - --- Cracking -techage.recipes.add("ta4_doser", { - output = "techage:fueloil 1", - input = { - "techage:bitumen 1", - }, - catalyst = "techage:gibbsite_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:naphtha 1", - input = { - "techage:fueloil 1", - }, - catalyst = "techage:gibbsite_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:gasoline 1", - input = { - "techage:naphtha 1", - }, - catalyst = "techage:gibbsite_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:isobutane 1", - input = { - "techage:gasoline 1", - }, - catalyst = "techage:gibbsite_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:gas 1", - input = { - "techage:isobutane 1", - }, - catalyst = "techage:gibbsite_powder", -}) - --- Hydrogenate -techage.recipes.add("ta4_doser", { - output = "techage:isobutane 1", - input = { - "techage:gas 1", - "techage:hydrogen 1", - }, - catalyst = "techage:iron_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:gasoline 1", - input = { - "techage:isobutane 1", - "techage:hydrogen 1", - }, - catalyst = "techage:iron_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:naphtha 1", - input = { - "techage:gasoline 1", - "techage:hydrogen 1", - }, - catalyst = "techage:iron_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:fueloil 1", - input = { - "techage:naphtha 1", - "techage:hydrogen 1", - }, - catalyst = "techage:iron_powder", -}) - -techage.recipes.add("ta4_doser", { - output = "techage:bitumen 1", - input = { - "techage:fueloil 1", - "techage:hydrogen 1", - }, - catalyst = "techage:iron_powder", -}) diff --git a/techage/items/electronic.lua b/techage/items/electronic.lua deleted file mode 100644 index 5139bec..0000000 --- a/techage/items/electronic.lua +++ /dev/null @@ -1,102 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Bauxite - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:vacuum_tube", { - description = S("TA3 Vacuum Tube"), - inventory_image = "techage_vacuum_tube.png", -}) - -minetest.register_craftitem("techage:ta4_wlanchip", { - description = S("TA4 WLAN Chip"), - inventory_image = "techage_wlanchip.png", -}) - -minetest.register_craftitem("techage:wlanchip", { - description = S("WLAN Chip"), - inventory_image = "techage_wlanchip.png", -}) - -minetest.register_craftitem("techage:ta4_ramchip", { - description = S("TA4 RAM Chip"), - inventory_image = "techage_ramchip.png", -}) - -minetest.register_craftitem("techage:ta4_leds", { - description = S("TA4 LEDs"), - inventory_image = "techage_leds.png", -}) - -minetest.register_craftitem("techage:ta5_aichip", { - description = S("TA5 AI Chip"), - inventory_image = "techage_aichip.png^[colorize:#48b9de:40", -}) - -minetest.register_craftitem("techage:ta5_aichip2", { - description = S("TA5 AI Chip II"), - inventory_image = "techage_aichip.png^[colorize:#de486c:40", -}) - -techage.recipes.add("ta2_electronic_fab", { - output = "techage:vacuum_tube 2", - waste = "basic_materials:empty_spool 1", - input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"} -}) - -techage.recipes.add("ta3_electronic_fab", { - output = "techage:vacuum_tube 2", - waste = "basic_materials:empty_spool 1", - input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"} -}) - -techage.recipes.add("ta3_electronic_fab", { - output = "techage:ta4_wlanchip 8", - input = {"default:mese_crystal 1", "default:copper_ingot 1", "default:gold_ingot 1", "techage:ta4_silicon_wafer 1"} -}) - -techage.recipes.add("ta3_electronic_fab", { - output = "techage:ta4_ramchip 8", - input = {"default:mese_crystal 1", "default:gold_ingot 1", "default:copper_ingot 1", "techage:ta4_silicon_wafer 1"} -}) - -techage.recipes.add("ta4_electronic_fab", { - output = "techage:ta4_wlanchip 8", - input = {"default:mese_crystal 1", "default:copper_ingot 1", "default:gold_ingot 1", "techage:ta4_silicon_wafer 1"} -}) - -techage.recipes.add("ta4_electronic_fab", { - output = "techage:ta4_ramchip 8", - input = {"default:mese_crystal 1", "default:gold_ingot 1", "default:copper_ingot 1", "techage:ta4_silicon_wafer 1"} -}) - -techage.recipes.add("ta4_electronic_fab", { - output = "techage:ta4_leds 8", - waste = "basic_materials:empty_spool 1", - input = {"basic_materials:plastic_sheet 4", "basic_materials:copper_wire 1", "techage:ta4_silicon_wafer 1"} -}) - -techage.recipes.add("ta4_electronic_fab", { - output = "techage:ta5_aichip 2", - waste = "basic_materials:empty_spool 2", - input = {"techage:ta4_leds 8", "basic_materials:copper_wire 1", "basic_materials:gold_wire 1", "techage:ta4_silicon_wafer 1"}, - ex_points = 10, -}) - -techage.recipes.add("ta4_electronic_fab", { - output = "techage:ta5_aichip2 2", - waste = "basic_materials:empty_spool 2", - input = {"techage:ta4_leds 8", "basic_materials:copper_wire 1", "basic_materials:gold_wire 1", "techage:ta4_silicon_wafer 1"}, - ex_points = 25, -}) diff --git a/techage/items/epoxy.lua b/techage/items/epoxy.lua deleted file mode 100644 index 26a2ae2..0000000 --- a/techage/items/epoxy.lua +++ /dev/null @@ -1,45 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Epoxy - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:epoxy", { - description = S("Epoxide Resin"), - inventory_image = "techage_liquid2_inv.png^[colorize:#ca2446:140^techage_liquid1_inv.png", -}) - -minetest.register_craftitem("techage:barrel_epoxy", { - description = S("Epoxide Resin Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#ca2446:140^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:canister_epoxy", { - description = S("Epoxide Resin Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#ca2446:140^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -techage.recipes.add("ta4_doser", { - output = "techage:epoxy 1", - input = { - "techage:naphtha 1", - "techage:needle_powder 1", - } -}) - -techage.register_liquid("techage:barrel_epoxy", "techage:ta3_barrel_empty", 10, "techage:epoxy") -techage.register_liquid("techage:canister_epoxy", "techage:ta3_canister_empty", 1, "techage:epoxy") - -minetest.register_alias("techage:ta4_epoxy", "techage:canister_epoxy") diff --git a/techage/items/filling.lua b/techage/items/filling.lua deleted file mode 100644 index 55fb0ac..0000000 --- a/techage/items/filling.lua +++ /dev/null @@ -1,14 +0,0 @@ --- Needed for the trowel - -local fillings = {} - -minetest.register_on_mods_loaded(function() - for name, ndef in pairs(minetest.registered_nodes) do - -- test if it is a simple node without logic - if ndef and not ndef.groups.soil and name ~= "default:cobble" and - not ndef.after_place_node and not ndef.on_construct then - table.insert(fillings, name) - end - end - networks.register_filling_items(fillings) -end) diff --git a/techage/items/hydrogen.lua b/techage/items/hydrogen.lua deleted file mode 100644 index 1abce56..0000000 --- a/techage/items/hydrogen.lua +++ /dev/null @@ -1,43 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Hydrogen - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:hydrogen", { - description = S("TA4 Hydrogen"), - inventory_image = "techage_hydrogen_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:cylinder_small_hydrogen", { - description = S("Hydrogen Cylinder Small"), - inventory_image = "techage_gas_cylinder_small.png^[colorize:#00528A:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:cylinder_large_hydrogen", { - description = S("Hydrogen Cylinder Large"), - inventory_image = "techage_gas_cylinder_large.png^[colorize:#00528A:120", - stack_max = 1, -}) - -techage.register_liquid("techage:cylinder_small_hydrogen", "techage:ta3_cylinder_small", 1, "techage:hydrogen") -techage.register_liquid("techage:cylinder_large_hydrogen", "techage:ta3_cylinder_large", 6, "techage:hydrogen") - -techage.recipes.add("ta4_doser", { - output = "techage:hydrogen 1", - input = { - "techage:gas 1", - } -}) diff --git a/techage/items/lye.lua b/techage/items/lye.lua deleted file mode 100644 index b69894d..0000000 --- a/techage/items/lye.lua +++ /dev/null @@ -1,44 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Lye - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:lye", { - description = S("Lye"), - inventory_image = "techage_liquid2_inv.png^[colorize:#7fd44c:120^techage_liquid1_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:barrel_lye", { - description = S("Lye Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#7fd44c:120^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:canister_lye", { - description = S("Lye Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#7fd44c:120^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -techage.recipes.add("ta4_doser", { - output = "techage:lye 4", - input = { - "techage:water 3", - "techage:usmium_powder 1", - } -}) - -techage.register_liquid("techage:barrel_lye", "techage:ta3_barrel_empty", 10, "techage:lye") -techage.register_liquid("techage:canister_lye", "techage:ta3_canister_empty", 1, "techage:lye") diff --git a/techage/items/moreblocks.lua b/techage/items/moreblocks.lua deleted file mode 100644 index 0204e67..0000000 --- a/techage/items/moreblocks.lua +++ /dev/null @@ -1,99 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - techage node registrations - -]]-- - -local function register_alias(name) - --minetest.register_alias("stairs:slab_" ..name, "techage:slab_" ..name) - minetest.register_alias("stairs:slab_" ..name.. "_inverted", "techage:slab_" ..name.. "_inverted") - minetest.register_alias("stairs:slab_" ..name.. "_wall", "techage:slab_" ..name.. "_wall") - minetest.register_alias("stairs:slab_" ..name.. "_quarter", "techage:slab_" ..name.. "_quarter") - minetest.register_alias("stairs:slab_" ..name.. "_quarter_inverted", "techage:slab_" ..name.. "_quarter_inverted") - minetest.register_alias("stairs:slab_" ..name.. "_quarter_wall", "techage:slab_" ..name.. "_quarter_wall") - minetest.register_alias("stairs:slab_" ..name.. "_three_quarter", "techage:slab_" ..name.. "_three_quarter") - minetest.register_alias("stairs:slab_" ..name.. "_three_quarter_inverted", "techage:slab_" ..name.. "_three_quarter_inverted") - minetest.register_alias("stairs:slab_" ..name.. "_three_quarter_wall", "techage:slab_" ..name.. "_three_quarter_wall") - --minetest.register_alias("stairs:stair_" ..name, "techage:stair_" ..name) - minetest.register_alias("stairs:stair_" ..name.. "_inverted", "techage:stair_" ..name.. "_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_wall", "techage:stair_" ..name.. "_wall") - minetest.register_alias("stairs:stair_" ..name.. "_wall_half", "techage:stair_" ..name.. "_wall_half") - minetest.register_alias("stairs:stair_" ..name.. "_wall_half_inverted", "techage:stair_" ..name.. "_wall_half_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_half", "techage:stair_" ..name.. "_half") - minetest.register_alias("stairs:stair_" ..name.. "_half_inverted", "techage:stair_" ..name.. "_half_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_right_half", "techage:stair_" ..name.. "_right_half") - minetest.register_alias("stairs:stair_" ..name.. "_right_half_inverted", "techage:stair_" ..name.. "_right_half_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_wall_half", "techage:stair_" ..name.. "_wall_half") - minetest.register_alias("stairs:stair_" ..name.. "_wall_half_inverted", "techage:stair_" ..name.. "_wall_half_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_inner", "techage:stair_" ..name.. "_inner") - minetest.register_alias("stairs:stair_" ..name.. "_inner_inverted", "techage:stair_" ..name.. "_inner_inverted") - minetest.register_alias("stairs:stair_" ..name.. "_outer", "techage:stair_" ..name.. "_outer") - minetest.register_alias("stairs:stair_" ..name.. "_outer_inverted", "techage:stair_" ..name.. "_outer_inverted") -end - -local NodeNames = { - "techage:compressed_gravel", - "techage:red_stone", - "techage:red_stone_block", - "techage:red_stone_brick", - - "techage:basalt_cobble", - "techage:basalt_stone", - "techage:basalt_stone_block", - "techage:basalt_stone_brick", - "techage:sieved_basalt_gravel", - - "techage:basalt_glass", - "techage:basalt_glass2", - "techage:bauxite_cobble", - "techage:bauxite_stone", - - "techage:cement_block", -} - -if(minetest.get_modpath("moreblocks")) then - for _,name in ipairs(NodeNames) do - local ndef = minetest.registered_nodes[name] - if ndef then - ndef = table.copy(ndef) - if ndef.drop then -- this fixes https://github.com/fluxionary/minetest-moreblocks/issues/19 - ndef.drop = nil - end - local subname = string.split(name, ":")[2] - ndef.sunlight_propagates = true - ndef.groups.not_in_creative_inventory = 1 - stairsplus:register_all("techage", subname, name, ndef) - if techage.stair_aliases_enabled then - register_alias(subname) - end - end - end -else - for _,name in ipairs(NodeNames) do - local ndef = minetest.registered_nodes[name] - if ndef then - local subname = string.split(name, ":")[2] - stairs.register_stair_and_slab( - subname, - name, - ndef.groups, - ndef.tiles, - ndef.description.." Stair", - ndef.description.." Slab", - ndef.sound, - false - ) - if techage.stair_aliases_enabled then - register_alias(subname) - end - end - end -end diff --git a/techage/items/oil.lua b/techage/items/oil.lua deleted file mode 100644 index 02c4614..0000000 --- a/techage/items/oil.lua +++ /dev/null @@ -1,136 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Oil - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S = techage.S - -minetest.register_node("techage:oil_source", { - description = S("Oil Source"), - drawtype = "liquid", - paramtype = "light", - - inventory_image = "techage_liquid2_inv.png^[colorize:#000000^techage_liquid1_inv.png", - tiles = { - { - name = "techage_oil_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 10 - } - }, - { - name = "techage_oil_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0 - } - } - }, - - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - drowning = 1, - liquidtype = "source", - liquid_alternative_flowing = "techage:oil_flowing", - liquid_alternative_source = "techage:oil_source", - liquid_viscosity = 20, - liquid_range = 10, - liquid_renewable = false, - post_effect_color = {a = 200, r = 1, g = 1, b = 1}, - groups = {liquid = 5, ta_liquid = 1}, -}) - -minetest.register_node("techage:oil_flowing", { - description = S("Flowing Oil"), - drawtype = "flowingliquid", - tiles = {"techage_oil.png"}, - special_tiles = { - { - name = "techage_oil_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 10, - }, - }, - { - name = "techage_oil_animated.png", - backface_culling = true, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 10, - }, - }, - }, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - liquid_renewable = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "techage:oil_flowing", - liquid_alternative_source = "techage:oil_source", - liquid_viscosity = 20, - liquid_range = 10, - post_effect_color = {a = 200, r = 1, g = 1, b = 1}, - groups = {liquid = 5, not_in_creative_inventory = 1}, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "techage:oil_source", - burntime = 30, -}) - -bucket.register_liquid( - "techage:oil_source", - "techage:oil_flowing", - "techage:bucket_oil", - "techage_bucket_oil.png", - "Oil Bucket") - -minetest.register_craftitem("techage:ta3_barrel_oil", { - description = S("TA3 Oil Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#000000:120^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_canister_oil", { - description = S("TA3 Oil Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#000000^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -techage.register_liquid("techage:bucket_oil", "bucket:bucket_empty", 1, "techage:oil_source") -techage.register_liquid("techage:ta3_barrel_oil", "techage:ta3_barrel_empty", 10, "techage:oil_source") -techage.register_liquid("techage:ta3_canister_oil", "techage:ta3_canister_empty", 1, "techage:oil_source") diff --git a/techage/items/petroleum.lua b/techage/items/petroleum.lua deleted file mode 100644 index fe9b53f..0000000 --- a/techage/items/petroleum.lua +++ /dev/null @@ -1,173 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Petroleum types: bitumen, fueloil, naphtha, gasoline, isobutane, gas (propan) - -]]-- - -local S = techage.S - - -minetest.register_craftitem("techage:bitumen", { - description = S("TA3 Bitumen"), - inventory_image = "techage_liquid2_inv.png^[colorize:#000000", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:fueloil", { - description = S("TA3 Fuel Oil"), - inventory_image = "techage_liquid2_inv.png^[colorize:#7E5D0A:180^techage_liquid1_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:naphtha", { - description = S("TA3 Naphtha"), - inventory_image = "techage_liquid2_inv.png^[colorize:#AAA820:180^techage_liquid1_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:gasoline", { - description = S("TA3 Gasoline"), - inventory_image = "techage_liquid2_inv.png^[colorize:#EEFC52:180^techage_liquid1_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:isobutane", { - description = S("TA4 Isobutane"), - inventory_image = "techage_isobutane_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:gas", { - description = S("TA3 Propane"), - inventory_image = "techage_gas_inv.png", - groups = {ta_liquid = 1}, -}) - -minetest.register_craftitem("techage:ta3_cylinder_small_gas", { - description = S("Propane Cylinder Small"), - inventory_image = "techage_gas_cylinder_small.png^[colorize:#e51818:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_cylinder_large_gas", { - description = S("Propane Cylinder Large"), - inventory_image = "techage_gas_cylinder_large.png^[colorize:#e51818:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta4_cylinder_small_isobutane", { - description = S("Isobutane Cylinder Small"), - inventory_image = "techage_gas_cylinder_small.png^[colorize:#18d618:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta4_cylinder_large_isobutane", { - description = S("Isobutane Cylinder Large"), - inventory_image = "techage_gas_cylinder_large.png^[colorize:#18d618:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_barrel_bitumen", { - description = S("TA3 Bitumen Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#000000:120", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_barrel_fueloil", { - description = S("TA3 Fuel Oil Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#7E5D0A:180^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_barrel_naphtha", { - description = S("TA3 Naphtha Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#AAA820:180^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_barrel_gasoline", { - description = S("TA3 Gasoline Barrel"), - inventory_image = "techage_barrel_inv.png^[colorize:#EEFC52:180^techage_symbol_liquid.png", - stack_max = 1, -}) - - -minetest.register_craftitem("techage:ta3_canister_bitumen", { - description = S("TA3 Bitumen Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#000000:180^techage_canister_frame.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_canister_fueloil", { - description = S("TA3 Fuel Oil Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#7E5D0A:180^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_canister_naphtha", { - description = S("TA3 Naphtha Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#AAA820:180^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - -minetest.register_craftitem("techage:ta3_canister_gasoline", { - description = S("TA3 Gasoline Canister"), - inventory_image = "techage_canister_filling.png^[colorize:#EEFC52^techage_canister_frame.png^techage_symbol_liquid.png", - stack_max = 1, -}) - - -minetest.register_craft({ - type = "fuel", - recipe = "techage:gas", - burntime = 30, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "techage:isobutane", - burntime = 40, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "techage:gasoline", - burntime = 50, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "techage:naphtha", - burntime = 45, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "techage:fueloil", - burntime = 40, -}) - - -techage.register_liquid("techage:ta3_barrel_oil", "techage:ta3_barrel_empty", 10, "techage:oil_source") -techage.register_liquid("techage:ta3_barrel_bitumen", "techage:ta3_barrel_empty", 10, "techage:bitumen") -techage.register_liquid("techage:ta3_barrel_fueloil", "techage:ta3_barrel_empty", 10, "techage:fueloil") -techage.register_liquid("techage:ta3_barrel_naphtha", "techage:ta3_barrel_empty", 10, "techage:naphtha") -techage.register_liquid("techage:ta3_barrel_gasoline", "techage:ta3_barrel_empty", 10, "techage:gasoline") -techage.register_liquid("techage:ta3_cylinder_large_gas", "techage:ta3_cylinder_large", 6, "techage:gas") -techage.register_liquid("techage:ta4_cylinder_large_isobutane", "techage:ta3_cylinder_large", 6, "techage:isobutane") - -techage.register_liquid("techage:ta3_canister_oil", "techage:ta3_canister_empty", 1, "techage:oil_source") -techage.register_liquid("techage:ta3_canister_bitumen", "techage:ta3_canister_empty", 1, "techage:bitumen") -techage.register_liquid("techage:ta3_canister_fueloil", "techage:ta3_canister_empty", 1, "techage:fueloil") -techage.register_liquid("techage:ta3_canister_naphtha", "techage:ta3_canister_empty", 1, "techage:naphtha") -techage.register_liquid("techage:ta3_canister_gasoline", "techage:ta3_canister_empty", 1, "techage:gasoline") -techage.register_liquid("techage:ta3_cylinder_small_gas", "techage:ta3_cylinder_small", 1, "techage:gas") -techage.register_liquid("techage:ta4_cylinder_small_isobutane", "techage:ta3_cylinder_small", 1, "techage:isobutane") diff --git a/techage/items/plastic.lua b/techage/items/plastic.lua deleted file mode 100644 index 1d68412..0000000 --- a/techage/items/plastic.lua +++ /dev/null @@ -1,35 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Plastic - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:plastic_granules", { - description = S("Plastic Granules"), - inventory_image = "techage_powder_inv.png^[colorize:#FFFFFF:180", - groups = {powder = 1}, -}) - -techage.recipes.add("ta4_doser", { - output = "techage:plastic_granules 1", - input = { - "techage:naphtha 1", - } -}) - -techage.furnace.register_recipe({ - output = "basic_materials:plastic_sheet 4", - recipe = {"techage:plastic_granules"}, - time = 2, - -}) diff --git a/techage/items/powder.lua b/techage/items/powder.lua deleted file mode 100644 index b5b445e..0000000 --- a/techage/items/powder.lua +++ /dev/null @@ -1,90 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Powder - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:leave_powder", { - description = S("Leave Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#71a157:120", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:needle_powder", { - description = S("Needle Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#1c800f:120", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:iron_powder", { - description = S("Iron Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#c7643d:160", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:clay_powder", { - description = S("Clay Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#F9DE80:160", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:aluminum_powder", { - description = S("Aluminum Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#A1BDC4:160", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:silver_sandstone_powder", { - description = S("Silver Sandstone Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#FFFFFF:160", - groups = {powder = 1}, -}) - -minetest.register_craftitem("techage:graphite_powder", { - description = S("Graphite Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#000000:160", - groups = {powder = 1}, -}) - -techage.add_grinder_recipe({input="default:acacia_bush_leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:acacia_leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:aspen_leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:blueberry_bush_leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:bush_leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:jungleleaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:leaves", output="techage:leave_powder"}) -techage.add_grinder_recipe({input="default:pine_needles", output="techage:needle_powder"}) -techage.add_grinder_recipe({input="default:iron_lump", output="techage:iron_powder"}) -techage.add_grinder_recipe({input="default:clay", output="techage:clay_powder"}) -techage.add_grinder_recipe({input="techage:aluminum", output="techage:aluminum_powder"}) -techage.add_grinder_recipe({input="default:silver_sandstone", output="techage:silver_sandstone_powder"}) -techage.add_grinder_recipe({input="default:coal_lump", output="techage:graphite_powder"}) - -if minetest.get_modpath("ethereal") then - techage.add_grinder_recipe({input="ethereal:bush", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:bush2", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:bush3", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:bamboo_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:bananaleaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:birch_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:frost_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:lemon_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:olive_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:orange_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:palmleaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:redwood_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:sakura_leaves", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:ethereal:sakura_leaves2", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:willow_twig", output="techage:leave_powder"}) - techage.add_grinder_recipe({input="ethereal:yellowleaves", output="techage:leave_powder"}) -end diff --git a/techage/items/redstone.lua b/techage/items/redstone.lua deleted file mode 100644 index 202e811..0000000 --- a/techage/items/redstone.lua +++ /dev/null @@ -1,70 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Redstone as result from the redmud/sand - -]]-- - -local S = techage.S - - -minetest.register_node("techage:red_stone", { - description = S("Red Stone"), - tiles = {"default_stone.png^[colorize:#ff4538:110"}, - groups = {cracky = 3, stone = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:red_stone_brick", { - description = S("Red Stone Brick"), - paramtype2 = "facedir", - place_param2 = 0, - tiles = {"default_stone_brick.png^[colorize:#ff4538:110"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:red_stone_block", { - description = S("Red Stone Block"), - tiles = {"default_stone_block.png^[colorize:#ff4538:110"}, - is_ground_content = false, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - output = "techage:red_stone_brick 4", - recipe = { - {"techage:red_stone", "techage:red_stone"}, - {"techage:red_stone", "techage:red_stone"}, - } -}) - -minetest.register_craft({ - output = "techage:red_stone_block 9", - recipe = { - {"techage:red_stone", "techage:red_stone", "techage:red_stone"}, - {"techage:red_stone", "techage:red_stone", "techage:red_stone"}, - {"techage:red_stone", "techage:red_stone", "techage:red_stone"}, - } -}) - -techage.furnace.register_recipe({ - output = "techage:red_stone 3", - recipe = { - "techage:canister_redmud", - "default:sand", - "default:sand", - "default:sand", - }, - waste = "techage:ta3_canister_empty", - time = 10, -}) diff --git a/techage/items/registered_nodes.lua b/techage/items/registered_nodes.lua deleted file mode 100644 index be296da..0000000 --- a/techage/items/registered_nodes.lua +++ /dev/null @@ -1,75 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Collect data of registered nodes - -]]-- - - -techage.aEtherealDirts = { - "ethereal:fiery_dirt", - "ethereal:cold_dirt", - "ethereal:crystal_dirt", - "ethereal:gray_dirt", - "ethereal:mushroom_dirt", - "ethereal:prairie_dirt", - "ethereal:grove_dirt", - "ethereal:jungle_dirt", - "ethereal:bamboo_dirt", -} - -techage.aAnyKindOfDirtBlocks = {} - -minetest.register_on_mods_loaded(function() - for name, ndef in pairs(minetest.registered_nodes) do - if string.find(name, "dirt") and - ndef.drawtype == "normal" and - ndef.groups.crumbly and ndef.groups.crumbly > 0 then - techage.aAnyKindOfDirtBlocks[#techage.aAnyKindOfDirtBlocks + 1] = name - end - end -end) - -minetest.override_item("default:gravel", {groups = {crumbly = 2, gravel = 1, falling_node = 1}}) - --- Register all known mobs mods for the move/fly controllers -techage.register_mobs_mods("ts_skins_dummies") -techage.register_mobs_mods("mobs") -techage.register_mobs_mods("draconis") -techage.register_mobs_mods("mobkit") -techage.register_mobs_mods("animalia") -techage.register_mobs_mods("mobs_animal") -techage.register_mobs_mods("mobs_monster") -techage.register_mobs_mods("dmobs") -techage.register_mobs_mods("mob_horse") -techage.register_mobs_mods("petz") -techage.register_mobs_mods("mobs_npc") -techage.register_mobs_mods("livingnether") -techage.register_mobs_mods("extra_mobs") -techage.register_mobs_mods("nssm") -techage.register_mobs_mods("goblins") -techage.register_mobs_mods("animalworld") -techage.register_mobs_mods("aliveai") -techage.register_mobs_mods("people") -techage.register_mobs_mods("paleotest") -techage.register_mobs_mods("mobs_balrog") -techage.register_mobs_mods("wildlife") -techage.register_mobs_mods("mobs_skeletons") -techage.register_mobs_mods("mobs_dwarves") -techage.register_mobs_mods("mobf_trader") -techage.register_mobs_mods("ts_vehicles_cars") - --- Used as e.g. crane cable -techage.register_simple_nodes({"techage:power_lineS"}, true) - --- Mods like cottages add the function ``after_dig_node`` to the dirt blocks -techage.register_simple_nodes({"default:dirt", "default:dirt_with_grass", "default:dirt_with_grass_footsteps", - "default:dirt_with_dry_grass", "default:dirt_with_snow", "default:dirt_with_rainforest_litter", - "default:dirt_with_coniferous_litter"}, true) diff --git a/techage/items/salt.lua b/techage/items/salt.lua deleted file mode 100644 index 7a401fa..0000000 --- a/techage/items/salt.lua +++ /dev/null @@ -1,50 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2024 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Salt - -]]-- - - ---Detects if the salt node is registered. -minetest.register_on_mods_loaded(function() - if minetest.registered_nodes["farming:salt"] then - --Adds salt to powder group to ensure reactor and silo will accept it - local def = minetest.registered_nodes["farming:salt"] - local groups = table.copy(def.groups) - groups.powder = 1 - minetest.override_item("farming:salt", { groups=groups }) - - --Add the water -> salt & river water recipe. - techage.recipes.add("ta4_doser", { - output = "farming:salt 1", - waste = "techage:river_water 1", - input = { - "techage:water 1", - } - }) - - -- Add salt recipe as replacement for the minetest.register_craft("farming:salt") recipe - techage.furnace.register_recipe({ - output = "farming:salt", - recipe = {"bucket:bucket_water"}, - waste = "bucket:bucket_empty", - time = 8, - }) - else - -- Creates a water -> River Water recipe in absense of the farming:salt node. - techage.recipes.add("ta4_doser", { - output = "techage:river_water 1", - input = { - "techage:water 1", - } - }) - end -end) diff --git a/techage/items/silicon.lua b/techage/items/silicon.lua deleted file mode 100644 index 5c89005..0000000 --- a/techage/items/silicon.lua +++ /dev/null @@ -1,45 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Silicon Wafer - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:ta4_silicon_wafer", { - description = S("TA4 Silicon Wafer"), - inventory_image = "techage_silicon_wafer.png", -}) - -if minetest.global_exists("mesecon") then - techage.furnace.register_recipe({ - output = "techage:ta4_silicon_wafer 16", - recipe = { - "mesecons_materials:silicon", - "mesecons_materials:silicon", - "mesecons_materials:silicon", - "techage:baborium_ingot" - }, - time = 6, - }) -end -techage.furnace.register_recipe({ - output = "techage:ta4_silicon_wafer 16", - recipe = { - "basic_materials:silicon", - "basic_materials:silicon", - "basic_materials:silicon", - "techage:baborium_ingot" - }, - time = 6, -}) - - diff --git a/techage/items/steelmat.lua b/techage/items/steelmat.lua deleted file mode 100644 index 5c158a4..0000000 --- a/techage/items/steelmat.lua +++ /dev/null @@ -1,29 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - pillar - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:steelmat", { - description = S("TechAge Steel Mat"), - inventory_image = "techage_steelmat.png", -}) - -minetest.register_craft({ - output = 'techage:steelmat 16', - recipe = { - {"", "techage:iron_ingot", ""}, - {"default:steel_ingot", "techage:iron_ingot", "default:steel_ingot"}, - {"", "techage:iron_ingot", ""}, - }, -}) diff --git a/techage/items/usmium.lua b/techage/items/usmium.lua deleted file mode 100644 index 18ce3c4..0000000 --- a/techage/items/usmium.lua +++ /dev/null @@ -1,28 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Usminum - -]]-- - -local S = techage.S - -minetest.register_craftitem("techage:usmium_nuggets", { - description = S("Usmium Nuggets"), - inventory_image = "techage_usmium_nuggets.png", -}) - -minetest.register_craftitem("techage:usmium_powder", { - description = S("Usmium Powder"), - inventory_image = "techage_powder_inv.png^[colorize:#46728E:120", - groups = {powder = 1}, -}) - -techage.add_grinder_recipe({input="techage:usmium_nuggets", output="techage:usmium_powder"}) diff --git a/techage/lamps/ceilinglamp.lua b/techage/lamps/ceilinglamp.lua deleted file mode 100644 index ecfae6e..0000000 --- a/techage/lamps/ceilinglamp.lua +++ /dev/null @@ -1,66 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Ceiling Lamp - -]]-- - -local S = techage.S - -techage.register_lamp("techage:ceilinglamp", { - description = S("TA Ceiling Lamp"), - tiles = { - -- up, down, right, left, back, front - 'techage_ceilinglamp_top.png', - 'techage_ceilinglamp_bottom.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-5/16, -7/16, -5/16, 5/16, -5/16, 5/16}, - {-4/16, -8/16, -4/16, 4/16, -7/16, 4/16}, - }, - }, - -},{ - description = S("TA Ceiling Lamp"), - tiles = { - -- up, down, right, left, back, front - 'techage_ceilinglamp_top.png', - 'techage_ceilinglamp_bottom.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - 'techage_ceilinglamp.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-5/16, -7/16, -5/16, 5/16, -5/16, 5/16}, - {-4/16, -8/16, -4/16, 4/16, -7/16, 4/16}, - }, - }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ceilinglamp_off 3", - recipe = {"techage:simplelamp_off", "default:wood", "default:glass"}, -}) diff --git a/techage/lamps/growlight.lua b/techage/lamps/growlight.lua deleted file mode 100644 index c592eb6..0000000 --- a/techage/lamps/growlight.lua +++ /dev/null @@ -1,224 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 LED Grow Light - -]]-- - -local S = techage.S - -local CYCLE_TIME = 2 -local RANDOM_VAL = 20 -local PWR_NEEDED = 1 - -local Cable = techage.ElectricCable -local power = networks.power -local Flowers = {} -local Plants = {} -local Ignore = { ["flowers:waterlily_waving"] = true } --- 9 plant positions below the light -local Positions = { - {x = 0, y =-1, z = 0}, - {x =-1, y =-1, z = 0}, - {x = 0, y =-1, z =-1}, - {x = 1, y =-1, z = 0}, - {x = 0, y =-1, z = 1}, - {x =-1, y =-1, z =-1}, - {x = 1, y =-1, z = 1}, - {x =-1, y =-1, z = 1}, - {x = 1, y =-1, z =-1}, -} - -local function swap_node(pos, postfix) - local node = techage.get_node_lvm(pos) - local parts = string.split(node.name, "_") - if postfix == parts[2] then - return - end - node.name = parts[1].."_"..postfix - minetest.swap_node(pos, node) - techage.light_ring(pos, postfix == "on") -end - -local function on_nopower(pos) - swap_node(pos, "off") - local nvm = techage.get_nvm(pos) - nvm.turned_on = false -end - -local function on_power(pos) - swap_node(pos, "on") - local nvm = techage.get_nvm(pos) - nvm.turned_on = true -end - -local function grow_flowers(pos) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.grow_pos = mem.grow_pos or {} -- keep the pos blank for some time - nvm.tick = nvm.tick or math.random(RANDOM_VAL, RANDOM_VAL*2) - nvm.tick = nvm.tick - 1 - if nvm.tick == 0 then - nvm.tick = math.random(RANDOM_VAL, RANDOM_VAL*2) - local plant_idx = math.random(1, 9) - local plant_pos = vector.add(pos, Positions[plant_idx]) - local soil_pos = {x = plant_pos.x, y = plant_pos.y - 1, z = plant_pos.z} - local plant_node = minetest.get_node(plant_pos) - local soil_node = minetest.get_node(soil_pos) - if soil_node and soil_node.name == "compost:garden_soil" then - if plant_node and plant_node.name == "air" then - if mem.grow_pos[plant_idx] and #Flowers > 1 then - local idx = math.floor(math.random(1, #Flowers)) - if Flowers[idx] then - minetest.set_node(plant_pos, {name = Flowers[idx]}) - mem.grow_pos[plant_idx] = false - end - else - mem.grow_pos[plant_idx] = true - end - elseif plant_node and Plants[plant_node.name] then - local ndef = minetest.registered_nodes[plant_node.name] - ndef.on_timer(plant_pos, 200) - else - mem.grow_pos[plant_idx] = false - end - end - end -end - -local function node_timer_on(pos, elapsed) - grow_flowers(pos) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - on_nopower(pos) - end - return true -end - -local function node_timer_off(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - on_power(pos) - end - return true -end - -local function on_switch_lamp(pos, on) - techage.light_ring(pos, on) -end - -techage.register_lamp("techage:growlight", { - description = S("TA4 LED Grow Light"), - tiles = { - -- up, down, right, left, back, front - 'techage_growlight_off.png', - 'techage_growlight_back.png', - 'techage_growlight_off.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, - }, - }, - on_timer = node_timer_off, - on_switch_lamp = on_switch_lamp, - high_power = true, -},{ - description = S("TA4 LED Grow Light"), - tiles = { - -- up, down, right, left, back, front - 'techage_growlight_on.png', - 'techage_growlight_back.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - 'techage_growlight_side.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, - }, - }, - on_timer = node_timer_on, - on_switch_lamp = on_switch_lamp, - high_power = true, -}) - -minetest.register_craft({ - output = "techage:growlight_off", - recipe = { - {"techage:ta4_leds", "techage:basalt_glass_thin", "techage:ta4_leds"}, - {"techage:ta4_leds", "techage:ta4_leds", "techage:ta4_leds"}, - {"techage:ta4_leds", "techage:aluminum", "techage:ta4_leds"}, - }, -}) - -local function contains(table, element) - for _, value in pairs(table) do - if value == element then - return true - end - end - return false -end - -function techage.register_flower(name) - if contains(Flowers, name) then - return - end - Flowers[#Flowers+1] = name -end - -function techage.register_plant(name) - Plants[name] = true -end - -minetest.after(1, function() - local function add_flower(name) - local def = minetest.registered_nodes[name] - if def and (def.groups.mushroom == 1 or def.groups.flower == 1) then - if not Ignore[name] then - techage.register_flower(name) - end - end - end - - for _,def in pairs(minetest.registered_decorations) do - local name = def.decoration - if type(name) == "string" then - add_flower(name) - elseif type(name) == "table" then - for _,sub_name in ipairs(name) do - add_flower(sub_name) - end - end - end - for name,ndef in pairs(minetest.registered_nodes) do - if type(name) == "string" then - local mod = string.split(name, ":")[1] - if mod == "farming" and ndef.on_timer then -- probably a plant that still needs to grow - if not Ignore[name] then - techage.register_plant(name) - end - end - end - end -end) diff --git a/techage/lamps/industriallamp1.lua b/techage/lamps/industriallamp1.lua deleted file mode 100644 index 5fcfeb4..0000000 --- a/techage/lamps/industriallamp1.lua +++ /dev/null @@ -1,66 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Industrial Lamp 1 - -]]-- - -local S = techage.S - -techage.register_lamp("techage:industriallamp1", { - description = S("TA Industrial Lamp 1"), - inventory_image = 'techage_industriallamp_inv1.png', - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp1.png', - 'techage_industriallamp1.png', - 'techage_industriallamp1.png^[transformR180', - 'techage_industriallamp1.png^[transformR180', - 'techage_industriallamp1.png', - 'techage_industriallamp1.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -3/32, -6/16, -9/32, 3/32}, - { 6/16, -8/16, -3/32, 8/16, -9/32, 3/32}, - {-6/16, -7/16, -1/16, 6/16, -5/16, 1/16}, - }, - }, -},{ - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp1_on.png', - 'techage_industriallamp1_on.png', - 'techage_industriallamp1_on.png^[transformR180', - 'techage_industriallamp1_on.png^[transformR180', - 'techage_industriallamp1_on.png', - 'techage_industriallamp1_on.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -3/32, -6/16, -9/32, 3/32}, - { 6/16, -8/16, -3/32, 8/16, -9/32, 3/32}, - {-6/16, -7/16, -1/16, 6/16, -5/16, 1/16}, - }, - }, -}) - -minetest.register_craft({ - output = "techage:industriallamp1_off 2", - recipe = { - {"", "", ""}, - {"default:glass", "techage:simplelamp_off", "dye:grey"}, - {"basic_materials:plastic_strip", "default:copper_ingot", "basic_materials:plastic_strip"}, - }, -}) diff --git a/techage/lamps/industriallamp2.lua b/techage/lamps/industriallamp2.lua deleted file mode 100644 index b0f3227..0000000 --- a/techage/lamps/industriallamp2.lua +++ /dev/null @@ -1,68 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Industrial Lamp 2 - -]]-- - -local S = techage.S - -local size = {x = 8/32, y = 8/32, z = 5/32} - -techage.register_lamp("techage:industriallamp2", { - description = S("TA Industrial Lamp 2"), - inventory_image = 'techage_industriallamp_inv2.png', - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp2.png', - 'techage_industriallamp2.png', - 'techage_industriallamp2.png^[transformR180', - 'techage_industriallamp2.png^[transformR180', - 'techage_industriallamp2.png', - 'techage_industriallamp2.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/32, -16/32, -4/32, 8/32, -9/32, 4/32}, - {-7/32, -16/32, -5/32, 7/32, -9/32, 5/32}, - {-7/32, -9/32, -4/32, 7/32, -8/32, 4/32}, - }, - }, -},{ - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp2_on.png', - 'techage_industriallamp2_on.png', - 'techage_industriallamp2_on.png^[transformR180', - 'techage_industriallamp2_on.png^[transformR180', - 'techage_industriallamp2_on.png', - 'techage_industriallamp2_on.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/32, -16/32, -4/32, 8/32, -9/32, 4/32}, - {-7/32, -16/32, -5/32, 7/32, -9/32, 5/32}, - {-7/32, -9/32, -4/32, 7/32, -8/32, 4/32}, - }, - }, -}) - -minetest.register_craft({ - output = "techage:industriallamp2_off 2", - recipe = { - {"default:glass", "default:glass", ""}, - {"techage:simplelamp_off", "dye:black", ""}, - {"basic_materials:steel_bar", "basic_materials:steel_bar", ""}, - }, -}) diff --git a/techage/lamps/industriallamp3.lua b/techage/lamps/industriallamp3.lua deleted file mode 100644 index 51d27bf..0000000 --- a/techage/lamps/industriallamp3.lua +++ /dev/null @@ -1,64 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Industrial Lamp 3 - -]]-- - -local S = techage.S - -local size = {x = 6/32, y = 4/32, z = 6/32} - -techage.register_lamp("techage:industriallamp3", { - description = S("TA Industrial Lamp 3"), - inventory_image = 'techage_industriallamp_inv3.png', - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp3.png', - 'techage_industriallamp3.png', - 'techage_industriallamp3.png^[transformR180', - 'techage_industriallamp3.png^[transformR180', - 'techage_industriallamp3.png', - 'techage_industriallamp3.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875}, - }, - }, -},{ - tiles = { - -- up, down, right, left, back, front - 'techage_industriallamp3_on.png', - 'techage_industriallamp3_on.png', - 'techage_industriallamp3_on.png^[transformR180', - 'techage_industriallamp3_on.png^[transformR180', - 'techage_industriallamp3_on.png', - 'techage_industriallamp3_on.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875}, - }, - }, -}) - -minetest.register_craft({ - output = "techage:industriallamp3_off 2", - recipe = { - {"default:glass", "default:glass", ""}, - {"techage:simplelamp_off", "dye:red", ""}, - {"basic_materials:steel_bar", "basic_materials:steel_bar", ""}, - }, -}) diff --git a/techage/lamps/industriallamp4.lua b/techage/lamps/industriallamp4.lua deleted file mode 100644 index 2646136..0000000 --- a/techage/lamps/industriallamp4.lua +++ /dev/null @@ -1,64 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Industrial Lamp 4 - -]]-- - -local S = techage.S - -local function on_switch_lamp(pos, on) - techage.light_ring({x = pos.x, y = pos.y - 3, z = pos.z}, on) -end - -techage.register_lamp("techage:industriallamp4", { - description = S("TA4 LED Industrial Lamp"), - tiles = { - 'techage_growlight_off.png', - 'techage_growlight_back.png', - 'techage_growlight_side.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, - }, - }, - on_switch_lamp = on_switch_lamp, - conn_sides = {"U"}, - high_power = true, -},{ - description = S("TA4 LED Industrial Lamp"), - tiles = { - -- up, down, right, left, back, front - 'techage_industlight4_on.png', - 'techage_growlight_back.png', - 'techage_growlight_side.png', - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, - }, - }, - on_switch_lamp = on_switch_lamp, - high_power = true, -}) - -minetest.register_craft({ - output = "techage:industriallamp4_off", - recipe = { - {"basic_materials:steel_strip", "basic_materials:steel_strip", "basic_materials:steel_strip"}, - {"techage:ta4_leds", "techage:ta4_leds", "techage:ta4_leds"}, - {"techage:ta4_leds", "techage:basalt_glass_thin", "techage:ta4_leds"}, - }, -}) diff --git a/techage/lamps/lampholder.lua b/techage/lamps/lampholder.lua deleted file mode 100644 index cb7dcaf..0000000 --- a/techage/lamps/lampholder.lua +++ /dev/null @@ -1,115 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/4 Lamp Holder - -]]-- - -local S = techage.S - -local function register_holder(name, description, png) - minetest.register_node(name, { - description = description, - tiles = {png}, - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "connected", - fixed = {{ -4/32, -4/32, -4/32, 4/32, 4/32, 4/32}}, - - connect_top = {{ -3/32, -3/32, -3/32, 3/32, 16/32, 3/32}}, - connect_bottom = {{ -3/32, -16/32, -3/32, 3/32, 3/32, 3/32}}, - connect_left = {{-16/32, -3/32, -3/32, 3/32, 3/32, 3/32}}, - connect_right = {{ -3/32, -3/32, -3/32, 16/32, 3/32, 3/32}}, - connect_back = {{ -3/32, -3/32, -3/32, 3/32, 3/32, 16/32}}, - connect_front = {{ -3/32, -3/32, -16/32, 3/32, 3/32, 3/32}}, - }, - connects_to = { - "techage:ceilinglamp_off", "techage:ceilinglamp_on", - "techage:growlight_off", "techage:growlight_on", - "techage:industriallamp1_off", "techage:industriallamp1_on", - "techage:industriallamp2_off", "techage:industriallamp2_on", - "techage:industriallamp3_off", "techage:industriallamp3_on", - "techage:industriallamp4_off", "techage:industriallamp4_on", - "techage:simplelamp_off", "techage:simplelamp_on", - "techage:streetlamp_off", "techage:streetlamp_on", - "techage:streetlamp2_off", "techage:streetlamp2_on", - "techage:streetlamp_arm", "techage:streetlamp_pole", - "techage:streetlamp2_off", "techage:streetlamp2_on", - "techage:power_line", "techage:power_lineS", "techage:power_lineA" - }, - paramtype = "light", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), - }) -end - - -register_holder("techage:lampholder1", S("TA Lamp Holder White"), "techage_streetlamp2_housing.png") -register_holder("techage:lampholder2", S("TA Lamp Holder Aspen"), "default_aspen_wood.png") -register_holder("techage:lampholder3", S("TA Lamp Holder Acacia"), "default_acacia_wood.png") -register_holder("techage:lampholder4", S("TA Lamp Holder Apple"), "default_wood.png") -register_holder("techage:lampholder5", S("TA Lamp Holder Copper"), "default_copper_block.png") -register_holder("techage:lampholder6", S("TA Lamp Holder Gold"), "default_gold_block.png") - - -minetest.register_craft({ - output = "techage:lampholder1 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "dye:white", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) - -minetest.register_craft({ - output = "techage:lampholder2 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "default:fence_aspen_wood", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) - -minetest.register_craft({ - output = "techage:lampholder3 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "default:fence_acacia_wood", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) - -minetest.register_craft({ - output = "techage:lampholder4 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "default:fence_wood", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) -minetest.register_craft({ - output = "techage:lampholder5 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "default:copper_ingot", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) -minetest.register_craft({ - output = "techage:lampholder6 2", - recipe = { - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - {"", "default:gold_ingot", ""}, - {"basic_materials:steel_bar", "", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/lamps/lib.lua b/techage/lamps/lib.lua deleted file mode 100644 index 4ef7676..0000000 --- a/techage/lamps/lib.lua +++ /dev/null @@ -1,183 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Lamp library - -]]-- - --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local P = minetest.string_to_pos -local M = minetest.get_meta - -local PWR_NEEDED = 0.5 -local CYCLE_TIME = 2 - -local Cable = techage.ElectricCable -local power = networks.power - -local function swap_node(pos, postfix) - local node = techage.get_node_lvm(pos) - local parts = string.split(node.name, "_") - if postfix == parts[2] then - return - end - node.name = parts[1].."_"..postfix - minetest.swap_node(pos, node) - local ndef = minetest.registered_nodes[node.name] - if ndef.on_switch_lamp then - ndef.on_switch_lamp(pos, postfix == "on") - end -end - -local function on_power(pos) - swap_node(pos, "on") - local nvm = techage.get_nvm(pos) - nvm.turned_on = true -end - -local function on_nopower(pos) - swap_node(pos, "off") - local nvm = techage.get_nvm(pos) - nvm.turned_on = false -end - -local function is_running(pos, nvm) - return nvm.turned_on -end - -local function node_timer_off1(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - on_power(pos) - end - return true -end - -local function node_timer_off2(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED * 2) - if consumed == PWR_NEEDED * 2 then - on_power(pos) - end - return true -end - -local function node_timer_on1(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - on_nopower(pos) - end - return true -end - -local function node_timer_on2(pos, elapsed) - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED * 2) - if consumed < PWR_NEEDED * 2 then - on_nopower(pos) - end - return true -end - -local function lamp_on_rightclick(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - if not nvm.turned_on and power.power_available(pos, Cable) then - nvm.turned_on = true - minetest.get_node_timer(pos):start(CYCLE_TIME) - swap_node(pos, "on") - else - nvm.turned_on = false - minetest.get_node_timer(pos):stop() - swap_node(pos, "off") - end -end - -local function on_rotate(pos, node, user, mode, new_param2) - if minetest.is_protected(pos, user:get_player_name()) then - return false - end - node.param2 = techage.rotate_wallmounted(node.param2) - minetest.swap_node(pos, node) - return true -end - -local function on_place(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end - return minetest.rotate_and_place(itemstack, placer, pointed_thing) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - power.update_network(pos, outdir, tlib2) -end - -function techage.register_lamp(basename, ndef_off, ndef_on) - if ndef_off.high_power then - ndef_off.on_timer = ndef_off.on_timer or node_timer_off2 - else - ndef_off.on_timer = ndef_off.on_timer or node_timer_off1 - end - ndef_off.after_place_node = after_place_node - ndef_off.after_dig_node = after_dig_node - ndef_off.on_rightclick = lamp_on_rightclick - if not ndef_off.on_rotate then - ndef_off.on_place = on_place - end - ndef_off.on_rotate = ndef_off.on_rotate or on_rotate - ndef_off.paramtype = "light" - ndef_off.use_texture_alpha = techage.CLIP - ndef_off.light_source = 0 - ndef_off.sunlight_propagates = true - ndef_off.paramtype2 = "facedir" - ndef_off.groups = {choppy=2, cracky=2, crumbly=2} - ndef_off.is_ground_content = false - ndef_off.sounds = default.node_sound_glass_defaults() - - if ndef_on.high_power then - ndef_on.on_timer = ndef_on.on_timer or node_timer_on2 - else - ndef_on.on_timer = ndef_on.on_timer or node_timer_on1 - end - ndef_on.after_place_node = after_place_node - ndef_on.after_dig_node = after_dig_node - ndef_on.on_rightclick = lamp_on_rightclick - ndef_on.on_rotate = ndef_on.on_rotate or on_rotate - ndef_on.paramtype = "light" - ndef_on.use_texture_alpha = techage.CLIP - ndef_on.light_source = minetest.LIGHT_MAX - ndef_on.sunlight_propagates = true - ndef_on.paramtype2 = "facedir" - ndef_on.diggable = false - ndef_on.groups = {not_in_creative_inventory=1} - ndef_on.is_ground_content = false - ndef_on.sounds = default.node_sound_glass_defaults() - - minetest.register_node(basename.."_off", ndef_off) - minetest.register_node(basename.."_on", ndef_on) - - power.register_nodes({basename.."_off", basename.."_on"}, Cable, "con") - techage.register_node_for_v1_transition({basename.."_off", basename.."_on"}, function(pos, node) - power.update_network(pos, nil, Cable) - end) -end diff --git a/techage/lamps/lightblock.lua b/techage/lamps/lightblock.lua deleted file mode 100644 index a874452..0000000 --- a/techage/lamps/lightblock.lua +++ /dev/null @@ -1,65 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Invisible Light Block - -]]-- - -local S = techage.S - --- 9 light positions in a 3x3 field -local Positions = { - {x =-1, y = 0, z = 0}, - {x = 0, y = 0, z =-1}, - {x = 1, y = 0, z = 0}, - {x = 0, y = 0, z = 1}, - {x =-1, y = 0, z =-1}, - {x = 1, y = 0, z = 1}, - {x =-1, y = 0, z = 1}, - {x = 1, y = 0, z =-1}, -} - -minetest.register_node("techage:lightblock", { - description = "Techage Light Block", - drawtype = "airlike", - paramtype = "light", - light_source = minetest.LIGHT_MAX, - sunlight_propagates = true, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - floodable = true, - is_ground_content = false, - groups = {not_in_creative_inventory=1}, - drop = "", -}) - -function techage.light_ring(center_pos, on, large) - if on then - for _,dir in ipairs(Positions) do - if large then - dir = vector.multiply(dir, 2) - end - local pos1 = vector.add(center_pos, dir) - local node = techage.get_node_lvm(pos1) - if node.name == "air" then - minetest.set_node(pos1, {name = "techage:lightblock"}) - end - end - else - local pos1 = {x=center_pos.x-2, y=center_pos.y-2, z=center_pos.z-2} - local pos2 = {x=center_pos.x+2, y=center_pos.y+2, z=center_pos.z+2} - for _,pos in ipairs(minetest.find_nodes_in_area(pos1, pos2, "techage:lightblock")) do - minetest.remove_node(pos) - end - minetest.fix_light(pos1, pos2) - end -end diff --git a/techage/lamps/simplelamp.lua b/techage/lamps/simplelamp.lua deleted file mode 100644 index 197b7f8..0000000 --- a/techage/lamps/simplelamp.lua +++ /dev/null @@ -1,53 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Lamp - -]]-- - -local S = techage.S - -techage.register_lamp("techage:simplelamp", { - description = S("TA Lamp"), - tiles = { - 'techage_electric_button.png', - }, - conn_sides = {"L", "R", "U", "D", "F", "B"}, - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -},{ - description = S("TA Lamp"), - tiles = { - 'techage_electric_button.png', - }, - conn_sides = {"L", "R", "U", "D", "F", "B"}, - paramtype = "light", - light_source = minetest.LIGHT_MAX, - sunlight_propagates = true, - paramtype2 = "facedir", - drop = "techage:test_lamp", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:simplelamp_off 2", - recipe = { - {"", "", ""}, - {"", "default:glass", ""}, - {"", "basic_materials:heating_element", ""}, - }, -}) diff --git a/techage/lamps/streetlamp.lua b/techage/lamps/streetlamp.lua deleted file mode 100644 index 945b84b..0000000 --- a/techage/lamps/streetlamp.lua +++ /dev/null @@ -1,70 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Street Lamp - -]]-- - -local S = techage.S - -techage.register_lamp("techage:streetlamp", { - description = S("TA Street Lamp"), - tiles = { - -- up, down, right, left, back, front - 'techage_streetlamp_top.png', - 'techage_streetlamp_top.png', - 'techage_streetlamp_off.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-5/16, -8/16, -5/16, 5/16, 8/16, 5/16}, - {-2/16, -8/16, -2/16, 2/16, 8/16, 2/16}, - {-8/16, 4/16, -8/16, 8/16, 5/16, 8/16}, - {-5/16, -8/16, -5/16, 5/16, -7/16, 5/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - on_rotate = screwdriver.disallow, - conn_sides = {"U", "D"}, -},{ - description = S("TA Street Lamp"), - tiles = { - -- up, down, right, left, back, front - 'techage_streetlamp_top.png', - 'techage_streetlamp_top.png', - 'techage_streetlamp.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-5/16, -8/16, -5/16, 5/16, 8/16, 5/16}, - {-8/16, 4/16, -8/16, 8/16, 5/16, 8/16}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - }, - on_rotate = screwdriver.disallow, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:streetlamp_off 2", - recipe = {"techage:simplelamp_off", "default:steel_ingot", "default:glass"}, -}) diff --git a/techage/lamps/streetlamp2.lua b/techage/lamps/streetlamp2.lua deleted file mode 100644 index e07aa73..0000000 --- a/techage/lamps/streetlamp2.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 LED Street Lamp - -]]-- - -local S = techage.S - -local function on_switch_lamp(pos, on) - techage.light_ring({x = pos.x, y = pos.y - 3, z = pos.z}, on, true) -end - -techage.register_lamp("techage:streetlamp2", { - description = S("TA4 LED Street Lamp"), - tiles = { - "techage_streetlamp2_housing.png", - "techage_streetlamp2_housing.png^techage_streetlamp2_off.png", - "techage_streetlamp2_housing.png", - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = {{ -8/32, 8/32, -16/32, 8/32, 15/32, 16/32}}, - }, - on_switch_lamp = on_switch_lamp, - on_rotate = screwdriver.disallow, - conn_sides = {"F", "B"}, - high_power = true, -},{ - description = S("TA4 LED Street Lamp"), - tiles = { - -- up, down, right, left, back, front - "techage_streetlamp2_housing_on.png", - "techage_streetlamp2_housing_on.png^techage_streetlamp2_on.png", - "techage_streetlamp2_housing_on.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = {{ -8/32, 8/32, -16/32, 8/32, 15/32, 16/32}}, - }, - on_switch_lamp = on_switch_lamp, - on_rotate = screwdriver.disallow, - conn_sides = {"F", "B"}, - high_power = true, -}) - -minetest.register_node("techage:streetlamp_pole", { - description = S("TA4 LED Street Lamp Pole"), - tiles = { - "techage_streetlamp2_housing.png", - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "connected", - fixed = {{ -5/32, -16/32, -5/32, 5/32, 16/32, 5/32}}, - - connect_left = {{-16/32, 8/32, -3/32, 3/32, 14/32, 3/32}}, - connect_right = {{ -3/32, 8/32, -3/32, 16/32, 14/32, 3/32}}, - connect_back = {{ -3/32, 8/32, -3/32, 3/32, 14/32, 16/32}}, - connect_front = {{ -3/32, 8/32, -16/32, 3/32, 14/32, 3/32}}, - }, - connects_to = {"techage:streetlamp_arm", "techage:streetlamp2_off", "techage:streetlamp2_on"}, - paramtype = "light", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("techage:streetlamp_arm", { - description = S("TA4 LED Street Lamp Arm"), - tiles = { - "techage_streetlamp2_housing.png", - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = {{ -3/32, 8/32, -16/32, 3/32, 14/32, 16/32}}, - }, - paramtype = "light", - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_craft({ - output = "techage:streetlamp2_off", - recipe = { - {"basic_materials:steel_strip", "dye:white", "basic_materials:steel_strip"}, - {"techage:ta4_leds", "techage:ta4_leds", "techage:ta4_leds"}, - {"techage:ta4_leds", "techage:basalt_glass_thin", "techage:ta4_leds"}, - }, -}) - -minetest.register_craft({ - output = "techage:streetlamp_pole 2", - recipe = { - {"", "basic_materials:steel_bar", ""}, - {"", "basic_materials:steel_bar", "dye:white"}, - {"", "basic_materials:steel_bar", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:streetlamp_arm 2", - recipe = { - {"", "dye:white", ""}, - {"basic_materials:steel_bar", "basic_materials:steel_bar", "basic_materials:steel_bar"}, - {"", "", ""}, - }, -}) diff --git a/techage/liquids/filler.lua b/techage/liquids/filler.lua deleted file mode 100644 index 21a1ebf..0000000 --- a/techage/liquids/filler.lua +++ /dev/null @@ -1,159 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Liquid Filler - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local liquid = techage.liquid -local CYCLE_TIME = 2 - -local function formspec(pos) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize( "#000000", S("Liquid Filler")).."]".. - "list[context;src;0,0.8;3,3;]".. - "image[3.5,1.8;1,1;techage_form_arrow_bg.png^[transformR270]".. - "list[context;dst;5,0.8;3,3;]".. - "list[current_player;main;0,4.2;8,4;]".. - "listring[current_player;main]".. - "listring[context;src]" .. - "listring[current_player;main]".. - "listring[context;dst]" .. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.2) - -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - minetest.get_node_timer(pos):start(CYCLE_TIME) - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("src") and inv:is_empty("dst") -end - -local function on_rightclick(pos, node, clicker) - local inv = M(pos):get_inventory() - if not inv:is_empty("src") then - minetest.get_node_timer(pos):start(CYCLE_TIME) - end -end - -local function node_timer(pos, elapsed) - local inv = M(pos):get_inventory() - if not inv:is_empty("src") then - local taken = techage.get_items(pos, inv, "src", 1) - if liquid.is_container_empty(taken:get_name()) then - liquid.fill_container({x = pos.x, y = pos.y+1, z = pos.z}, inv, taken:get_name()) - else - liquid.empty_container({x = pos.x, y = pos.y-1, z = pos.z}, inv, taken:get_name()) - end - end - return true -end - -minetest.register_node("techage:filler", { - description = S("TA Liquid Filler"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_hole_tube.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_hole_tube.png", - "techage_filling_ta3.png^techage_frame_small_ta3.png^techage_appl_outp.png", - "techage_filling_ta3.png^techage_frame_small_ta3.png^techage_appl_inp.png", - "techage_filling_ta3.png^techage_appl_liquid_hopper.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_liquid_hopper.png^techage_frame_ta3.png", - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -1/2, -3/8, -3/8, 1/2, 3/8, 3/8}, -- box - { -2/8, 3/8, -2/8, 2/8, 4/8, 2/8}, -- top - { -2/8, -4/8, -2/8, 2/8, -3/8, 2/8}, -- bottom - }, - }, - - on_construct = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('src', 9) - inv:set_size('dst', 9) - end, - - after_place_node = function(pos, placer) - M(pos):set_string("formspec", formspec(pos)) - end, - - on_rightclick = on_rightclick, - on_timer = node_timer, - can_dig = can_dig, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - sunlight_propagates = true, - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - -techage.register_node({"techage:filler"}, { - on_pull_item = function(pos, in_dir, num) - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end, - on_push_item = function(pos, in_dir, stack) - local inv = M(pos):get_inventory() - if not minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):start(CYCLE_TIME) - end - return techage.put_items(inv, "src", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end, -}) - - -minetest.register_craft({ - output = "techage:filler", - recipe = { - {"default:steel_ingot", "group:wood", "default:steel_ingot"}, - {"techage:tubeS", "", "techage:tubeS"}, - {"default:steel_ingot", "group:wood", "default:steel_ingot"}, - }, -}) diff --git a/techage/liquids/liquid_pipe.lua b/techage/liquids/liquid_pipe.lua deleted file mode 100644 index 2e94efa..0000000 --- a/techage/liquids/liquid_pipe.lua +++ /dev/null @@ -1,205 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Liquid Pipes - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local MAX_PIPE_LENGHT = 100 - -local liquid = networks.liquid - -local Pipe = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = MAX_PIPE_LENGHT, - show_infotext = false, - force_to_use_tubes = false, - tube_type = "pipe2", - primary_node_names = { - "techage:ta3_pipeS", "techage:ta3_pipeA", - "techage:ta3_pipe_wall_entry", "techage:ta3_valve_open", - }, - secondary_node_names = {}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - local name = minetest.get_node(pos).name - if name == "techage:ta3_pipe_wall_entry" then - minetest.swap_node(pos, {name = "techage:ta3_pipe_wall_entry", param2 = param2}) - elseif name == "techage:ta3_valve_open" then - minetest.swap_node(pos, {name = "techage:ta3_valve_open", param2 = param2}) - else - minetest.swap_node(pos, {name = "techage:ta3_pipe"..tube_type, param2 = param2}) - end - end, -}) - --- Use global callback instead of node related functions -Pipe:register_on_tube_update2(function(pos, outdir, tlib2, node) - liquid.update_network(pos, outdir, tlib2, node) -end) - -minetest.register_node("techage:ta3_pipeS", { - description = S("TA Pipe"), - tiles = { - "techage_gaspipe.png^[transformR90", - "techage_gaspipe.png^[transformR90", - "techage_gaspipe.png", - "techage_gaspipe.png", - "techage_gaspipe_hole2.png", - "techage_gaspipe_hole2.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -4/8, 1/8, 1/8, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_pipeA", { - description = S("TA Pipe"), - tiles = { - "techage_gaspipe_knee2.png", - "techage_gaspipe_hole2.png^[transformR180", - "techage_gaspipe_knee.png^[transformR270", - "techage_gaspipe_knee.png", - "techage_gaspipe_knee2.png", - "techage_gaspipe_hole2.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -4/8, -1/8, 1/8, 1/8, 1/8}, - {-2/8, -0.5, -2/8, 2/8, -13/32, 2/8}, - {-1/8, -1/8, -4/8, 1/8, 1/8, -1/8}, - {-2/8, -2/8, -0.5, 2/8, 2/8, -13/32}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta3_pipeS", -}) - -local size1 = 1/8 -local size2 = 2/8 -local size3 = 13/32 -local Boxes = { - { - {-size1, -size1, size1, size1, size1, 0.5 }, -- z+ - {-size2, -size2, size3, size2, size2, 0.5 }, -- z+ - }, - { - {-size1, -size1, -size1, 0.5, size1, size1}, -- x+ - { size3, -size2, -size2, 0.5, size2, size2}, -- x+ - }, - { - {-size1, -size1, -0.5, size1, size1, size1}, -- z- - {-size2, -size2, -0.5, size2, size2, -size3}, -- z- - }, - { - {-0.5, -size1, -size1, size1, size1, size1}, -- x- - {-0.5, -size2, -size2, -size3, size2, size2}, -- x- - }, - { - {-size1, -0.5, -size1, size1, size1, size1}, -- y- - {-size2, -0.5, -size2, size2, -size3, size2}, -- y- - }, - { - {-size1, -size1, -size1, size1, 0.5, size1}, -- y+ - {-size2, size3, -size2, size2, 0.5, size2}, -- y+ - } -} - -local names = networks.register_junction("techage:ta3_junctionpipe", 1/8, Boxes, Pipe, { - description = S("TA Junction Pipe"), - tiles = {"techage_gaspipe_junction.png"}, - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, techage_trowel = 1}, - sounds = default.node_sound_metal_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local name = "techage:ta3_junctionpipe" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - Pipe:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - local name = "techage:ta3_junctionpipe" .. networks.junction_type(pos, Pipe) - minetest.swap_node(pos, {name = name, param2 = 0}) - liquid.update_network(pos, 0, tlib2, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, -}, 25) - -liquid.register_nodes(names, Pipe, "junc") - -minetest.register_craft({ - output = "techage:ta3_junctionpipe25 2", - recipe = { - {"", "techage:ta3_pipeS", ""}, - {"techage:ta3_pipeS", "", "techage:ta3_pipeS"}, - {"", "techage:ta3_pipeS", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta3_pipeS 6", - recipe = { - {'', '', "techage:iron_ingot"}, - {'dye:yellow', 'default:steel_ingot', ''}, - {"techage:iron_ingot", '', ''}, - }, -}) - -minetest.register_alias("techage:ta4_pipeA", "techage:ta3_pipeA") -minetest.register_alias("techage:ta4_pipeS", "techage:ta3_pipeS") - -techage.LiquidPipe = Pipe diff --git a/techage/liquids/pipe_wall_entry.lua b/techage/liquids/pipe_wall_entry.lua deleted file mode 100644 index f94afd2..0000000 --- a/techage/liquids/pipe_wall_entry.lua +++ /dev/null @@ -1,57 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Liquid Pipe Wall Entry - -]]-- - -local S = techage.S - -local Pipe = techage.LiquidPipe - -minetest.register_node("techage:ta3_pipe_wall_entry", { - description = S("TA3 Pipe Wall Entry"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_appl_hole_pipe.png", - "basic_materials_concrete_block.png^techage_appl_hole_pipe.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - groups = {crumbly = 2, cracky = 2, snappy = 2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta3_pipe_wall_entry", - recipe = { - {"", "techage:ta3_pipeS", ""}, - {"", "basic_materials:concrete_block", ""}, - {"", "",""}, - }, -}) diff --git a/techage/liquids/pump.lua b/techage/liquids/pump.lua deleted file mode 100644 index 34bf43f..0000000 --- a/techage/liquids/pump.lua +++ /dev/null @@ -1,420 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Pump - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local Flip = networks.Flip - -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 -local CAPA = 4 - -local WRENCH_MENU = { - { - type = "output", - name = "flowrate", - label = S("Total flow rate"), - tooltip = S("Total flow rate in liquid units"), - }, - { - type = "number", - name = "limit", - label = S("Number of units"), - tooltip = S("Number of liquid units that are allowed to be pumped"), - default = "0", - }, -} - -local State3 = techage.NodeStates:new({ - node_name_passive = "techage:t3_pump", - node_name_active = "techage:t3_pump_on", - infotext_name = S("TA3 Pump"), - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, -}) - -local State4 = techage.NodeStates:new({ - node_name_passive = "techage:t4_pump", - node_name_active = "techage:t4_pump_on", - infotext_name = S("TA4 Pump"), - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, -}) - -local function handle_pump_limit(pos, nvm) - local val = M(pos):get_int("limit") - if val and val > 0 then - nvm.limit = val - nvm.num_items = 0 - else - nvm.limit = nil - nvm.num_items = nil - end -end - --- Function returns the number of pumped units -local function pump(pos, mem, nvm, state, outdir, units) - local taken, name = liquid.take(pos, Pipe, Flip[outdir], nil, units, mem.dbg_cycles > 0) - if taken > 0 and name then - local leftover = liquid.put(pos, Pipe, outdir, name, taken, mem.dbg_cycles > 0) - if leftover and leftover > 0 then - -- air needs no tank - if name == "air" then - state:keep_running(pos, nvm, COUNTDOWN_TICKS) - return 0 - end - liquid.untake(pos, Pipe, Flip[outdir], name, leftover) - if leftover == taken then - state:blocked(pos, nvm) - return 0 - end - return taken - leftover - end - return taken - else - state:idle(pos, nvm) - return 0 - end -end - -local function pumping(pos, nvm, state, capa) - local mem = techage.get_mem(pos) - mem.dbg_cycles = (mem.dbg_cycles or 0) - 1 - local outdir = M(pos):get_int("outdir") - - if not nvm.limit then - local num = pump(pos, mem, nvm, state, outdir, capa) - if num > 0 then - state:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - return num - elseif nvm.num_items < nvm.limit then - local num = math.min(capa, nvm.limit - nvm.num_items) - num = pump(pos, mem, nvm, state, outdir, num) - if num > 0 then - nvm.num_items = nvm.num_items + num - if nvm.num_items >= nvm.limit then - state:stop(pos, nvm) - else - state:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - end - return num - end - return 0 -end - -local function after_place_node3(pos, placer) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:t3_pump") - State3:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) -end - -local function after_place_node4(pos, placer) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:t4_pump") - State4:node_init(pos, nvm, number) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) -end - -local function node_timer3(pos, elapsed) - local nvm = techage.get_nvm(pos) - pumping(pos, nvm, State3, CAPA) - return State3:is_active(nvm) -end - -local function node_timer4(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.flowrate = (nvm.flowrate or 0) + pumping(pos, nvm, State4, CAPA * 2) - return State4:is_active(nvm) -end - -local function on_rightclick(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - if node.name == "techage:t3_pump" then - local mem = techage.get_mem(pos) - mem.dbg_cycles = 5 - State3:start(pos, nvm) - elseif node.name == "techage:t3_pump_on" then - State3:stop(pos, nvm) - elseif node.name == "techage:t4_pump" then - local mem = techage.get_mem(pos) - mem.dbg_cycles = 5 - handle_pump_limit(pos, nvm) - State4:start(pos, nvm) - elseif node.name == "techage:t4_pump_on" then - State4:stop(pos, nvm) - end -end - -local function ta_rotate_node(pos, node, new_param2) - Pipe:after_dig_node(pos) - minetest.swap_node(pos, {name = node.name, param2 = new_param2}) - Pipe:after_place_node(pos) - M(pos):set_int("outdir", techage.side_to_outdir("R", new_param2)) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local ta3_tiles_pas = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3_bottom.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_pump.png^techage_frame_ta3.png^[transformFX", - "techage_filling_ta3.png^techage_appl_pump.png^techage_frame_ta3.png", -} - -local ta4_tiles_pas = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta4.png^[transformFX", - "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta4.png", -} - -local ta3_tiles_act = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3_bottom.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - { - name = "techage_filling8_ta3.png^techage_appl_pump8.png^techage_frame8_ta3.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_filling8_ta3.png^techage_appl_pump8.png^techage_frame8_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, -} - -local ta4_tiles_act = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta4.png", - { - name = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta4.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, -} - -minetest.register_node("techage:t3_pump", { - description = S("TA3 Pump"), - tiles = ta3_tiles_pas, - after_place_node = after_place_node3, - on_rightclick = on_rightclick, - on_timer = node_timer3, - after_dig_node = after_dig_node, - ta_rotate_node = ta_rotate_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:t3_pump_on", { - description = S("TA3 Pump"), - tiles = ta3_tiles_act, - --after_place_node = after_place_node3, - on_rightclick = on_rightclick, - on_timer = node_timer3, - after_dig_node = after_dig_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:t4_pump", { - description = S("TA4 Pump"), - tiles = ta4_tiles_pas, - after_place_node = after_place_node4, - on_rightclick = on_rightclick, - on_timer = node_timer4, - after_dig_node = after_dig_node, - ta_rotate_node = ta_rotate_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - ta4_formspec = WRENCH_MENU, -}) - -minetest.register_node("techage:t4_pump_on", { - description = S("TA4 Pump"), - tiles = ta4_tiles_act, - --after_place_node = after_place_node4, - on_rightclick = on_rightclick, - on_timer = node_timer4, - after_dig_node = after_dig_node, - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -techage.register_node({"techage:t3_pump", "techage:t3_pump_on"}, { - on_recv_message = function(pos, src, topic, payload) - return State3:on_receive_message(pos, topic, payload) - end, -}) - -techage.register_node({"techage:t4_pump", "techage:t4_pump_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "limit" then -- Set pump limit - local nvm = techage.get_nvm(pos) - State4:stop(pos, nvm) - local val = tonumber(payload) or 0 - if val and val > 0 then - nvm.limit = val - nvm.num_items = 0 - M(pos):set_int("limit", val) - else - nvm.limit = nil - nvm.num_items = nil - M(pos):set_string("limit", "") - end - return true - elseif topic == "count" then -- Get number of pumped units - local nvm = techage.get_nvm(pos) - return nvm.num_items or 0 - elseif topic == "flowrate" then -- Get total number of pumped units - local nvm = techage.get_nvm(pos) - return nvm.flowrate or 0 - else - if topic == "on" then - local nvm = techage.get_nvm(pos) - handle_pump_limit(pos, nvm) - end - return State4:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if (topic == 69 or topic == 21) and payload then -- Set pump limit - local nvm = techage.get_nvm(pos) - State4:stop(pos, nvm) - if payload[1] > 0 then - nvm.limit = payload[1] - nvm.num_items = 0 - M(pos):set_int("limit", payload[1]) - else - nvm.limit = nil - nvm.num_items = nil - M(pos):set_string("limit", "") - end - return 0 - else - if topic == 1 then - local nvm = techage.get_nvm(pos) - handle_pump_limit(pos, nvm) - end - return State4:on_beduino_receive_cmnd(pos, topic, payload) - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 137 then -- Get total number of pumped units - local nvm = techage.get_nvm(pos) - return 0, {nvm.flowrate or 0} - elseif topic == 151 then -- Get number of pumped units - local nvm = techage.get_nvm(pos) - return 0, {nvm.num_items or 0} - else - return State4:on_beduino_request_data(pos, topic, payload) - end - end, -}) - --- Pumps have to provide one output and one input side -liquid.register_nodes({ - "techage:t3_pump", "techage:t3_pump_on", - "techage:t4_pump", "techage:t4_pump_on", -}, Pipe, "pump", {"L", "R"}, {}) - -minetest.register_craft({ - output = "techage:t3_pump 2", - recipe = { - {"group:wood", "techage:iron_ingot", "group:wood"}, - {"techage:ta3_pipeS", "techage:usmium_nuggets", "techage:ta3_pipeS"}, - {"group:wood", "techage:iron_ingot", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = "techage:t4_pump", - recipe = { - {"default:tin_ingot", "dye:blue", "default:steel_ingot"}, - {"", "techage:t3_pump", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/liquids/silo.lua b/techage/liquids/silo.lua deleted file mode 100644 index b18c367..0000000 --- a/techage/liquids/silo.lua +++ /dev/null @@ -1,358 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2024 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Powder Silo - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local LQD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).liquid end -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local INV_SIZE = 8 -local STACKMAX = 99 - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - -- check if it is powder or techage liquid item (migration function) - local ndef = minetest.registered_craftitems[stack:get_name()] or - minetest.registered_items[stack:get_name()] or {} - if ndef.groups and (ndef.groups.powder == 1 or ndef.groups.ta_liquid == 1) then - local nvm = techage.get_nvm(pos) - nvm.item_name = nil - nvm.item_count = nil - local inv = minetest.get_meta(pos):get_inventory() - if inv:is_empty(listname) then - return stack:get_count() - end - if inv:contains_item(listname, ItemStack(stack:get_name())) then - return stack:get_count() - end - end - return 0 -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local nvm = techage.get_nvm(pos) - nvm.item_name = nil - nvm.item_count = nil - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") -end - -local function get_item_name(nvm, inv) - for idx = 1, inv:get_size("main") do - local stack = inv:get_stack("main", idx) - if stack:get_count() > 0 then - nvm.item_name = stack:get_name() - return nvm.item_name - end - end -end - -local function get_item_count(pos) - local inv = M(pos):get_inventory() - local count = 0 - for idx = 1, inv:get_size("main") do - local stack = inv:get_stack("main", idx) - count = count + stack:get_count() - end - return count -end - -local function get_silo_capa(pos) - local inv = M(pos):get_inventory() - for idx = 1, inv:get_size("main") do - local stack = inv:get_stack("main", idx) - if stack:get_count() > 0 then - return inv:get_size("main") * stack:get_stack_max() - end - end - return inv:get_size("main") * STACKMAX -end - -local function formspec3() - return "size[8,5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0,0;8,1;]".. - "list[current_player;main;0,1.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function formspec4() - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0,0;8,2;]".. - "list[current_player;main;0,2.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local tLiquid = { - capa = 0, - peek = function(pos, indir) - local nvm = techage.get_nvm(pos) - local inv = M(pos):get_inventory() - if not inv:is_empty("main") then - return nvm.item_name or get_item_name(nvm, inv) - end - end, - put = function(pos, indir, name, amount) - -- check if it is powder - local nvm = techage.get_nvm(pos) - local ndef = minetest.registered_craftitems[name] or minetest.registered_nodes[name] or {} - if ndef.groups and ndef.groups.powder == 1 then - local inv = M(pos):get_inventory() - local stack = ItemStack(name.." "..amount) - if inv:room_for_item("main", stack) then - nvm.item_count = nvm.item_count or get_item_count(pos) - inv:add_item("main", stack) - nvm.item_count = nvm.item_count + stack:get_count() - return 0 - end - end - return amount - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local inv = M(pos):get_inventory() - if not name then - name = nvm.item_name or get_item_name(nvm, inv) - end - if name then - local stack = ItemStack(name.." "..amount) - nvm.item_count = nvm.item_count or get_item_count(pos) - local count = inv:remove_item("main", stack):get_count() - nvm.item_count = nvm.item_count - count - return count, name - end - return 0 - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local inv = M(pos):get_inventory() - local stack = ItemStack(name.." "..amount) - if inv:room_for_item("main", stack) then - nvm.item_count = nvm.item_count or get_item_count(pos) - inv:add_item("main", stack) - nvm.item_count = nvm.item_count + stack:get_count() - return 0 - end - return amount - end, -} - -minetest.register_node("techage:ta3_silo", { - description = S("TA3 Silo"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_silo.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_silo.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_silo.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_silo.png", - }, - on_construct = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('main', INV_SIZE) - end, - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:ta3_silo") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec3(nvm)) - meta:set_string("infotext", S("TA3 Silo").." "..number) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - can_dig = can_dig, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_silo", { - description = S("TA4 Silo"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_silo.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_silo.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_silo.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_silo.png", - }, - on_construct = function(pos) - local inv = M(pos):get_inventory() - inv:set_size('main', INV_SIZE * 2) - end, - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:ta4_silo") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec4(nvm)) - meta:set_string("infotext", S("TA4 Silo").." "..number) - Pipe:after_place_node(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - can_dig = can_dig, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - - -techage.register_node({"techage:ta3_silo", "techage:ta4_silo"}, { - on_pull_item = function(pos, in_dir, num) - local inv = M(pos):get_inventory() - if not inv:is_empty("main") then - local taken = techage.get_items(pos, inv, "main", num) - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.item_count = nvm.item_count - taken:get_count() - return taken - end - end, - on_push_item = function(pos, in_dir, stack) - -- check if it is powder - local name = stack:get_name() - local ndef = minetest.registered_craftitems[name] or {} - if ndef.groups and ndef.groups.powder == 1 then - local inv = M(pos):get_inventory() - - if inv:is_empty("main") then - inv:add_item("main", stack) - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.item_count = nvm.item_count + stack:get_count() - return true - end - - if inv:contains_item("main", name) and inv:room_for_item("main", stack) then - inv:add_item("main", stack) - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.item_count = nvm.item_count + stack:get_count() - return true - end - end - return false - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = M(pos) - local inv = meta:get_inventory() - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.item_count = nvm.item_count + stack:get_count() - return techage.put_items(inv, "main", stack) - end, - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = M(pos) - local inv = meta:get_inventory() - return techage.get_inv_state(inv, "main") - elseif topic == "load" then - local inv = M(pos):get_inventory() - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.capa = nvm.capa or get_silo_capa(pos) - return techage.power.percent(nvm.capa, nvm.item_count), nvm.item_count - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- Chest State - local meta = M(pos) - local inv = meta:get_inventory() - return 0, {techage.get_inv_state_num(inv, "main")} - elseif topic == 134 then - local inv = M(pos):get_inventory() - local nvm = techage.get_nvm(pos) - nvm.item_count = nvm.item_count or get_item_count(pos) - nvm.capa = nvm.capa or get_silo_capa(pos) - if payload[1] == 1 then - return 0, {techage.power.percent(nvm.capa, nvm.item_count)} - else - return 0, {nvm.item_count} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - local nvm = techage.get_nvm(pos) - nvm.item_count = nil - end, -}) - -liquid.register_nodes({"techage:ta3_silo", "techage:ta4_silo"}, Pipe, "tank", nil, tLiquid) - -minetest.register_craft({ - output = "techage:ta3_silo", - recipe = { - {"", "", ""}, - {"techage:tubeS", "techage:chest_ta3", "techage:ta3_pipeS"}, - {"", "", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_silo", - recipe = { - {"default:tin_ingot", "dye:blue", "default:steel_ingot"}, - {"", "techage:ta3_silo", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/liquids/ta5_tank.lua b/techage/liquids/ta5_tank.lua deleted file mode 100644 index e41b3be..0000000 --- a/techage/liquids/ta5_tank.lua +++ /dev/null @@ -1,111 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Hyperloop Tank - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local hyperloop = techage.hyperloop -local remote_pos = techage.hyperloop.remote_pos -local shared_tank = techage.shared_tank -local menu = techage.menu - -local CAPACITY = 1000 -local EX_POINTS = 15 - -minetest.register_node("techage:ta5_hl_tank", { - description = S("TA5 Hyperloop Tank"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_tank.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:ta5_hl_tank") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", shared_tank.formspec(pos)) - meta:set_string("infotext", S("TA5 Hyperloop Tank").." "..number) - Pipe:after_place_node(pos) - hyperloop.after_place_node(pos, placer, "tank") - end, - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if techage.get_expoints(player) >= EX_POINTS then - if techage.menu.eval_input(pos, hyperloop.SUBMENU, fields) then - hyperloop.after_formspec(pos, fields) - shared_tank.on_rightclick(pos, nil, player) - M(pos):set_string("formspec", shared_tank.formspec(pos)) - end - end - end, - on_timer = shared_tank.node_timer, - on_rightclick = shared_tank.on_rightclick, - on_punch = function(pos, node, puncher) - return techage.liquid.on_punch(remote_pos(pos), node, puncher) - end, - can_dig = shared_tank.can_dig, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - hyperloop.after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta5_hl_tank"}, - Pipe, "tank", nil, { - capa = CAPACITY, - peek = shared_tank.peek_liquid, - put = shared_tank.put_liquid, - take = shared_tank.take_liquid, - untake = shared_tank.untake_liquid, - } -) - -techage.register_node({"techage:ta5_hl_tank"}, techage.liquid.recv_message) - -minetest.register_craft({ - output = "techage:ta5_hl_tank", - recipe = { - {"", "techage:ta5_aichip", ""}, - {"", "techage:ta4_tank", ""}, - {"", "", ""}, - }, -}) - -minetest.register_on_mods_loaded(function() - if not minetest.global_exists("hyperloop") then - minetest.clear_craft({output = "techage:ta5_hl_tank"}) - end -end) diff --git a/techage/liquids/tank.lua b/techage/liquids/tank.lua deleted file mode 100644 index 9b87f51..0000000 --- a/techage/liquids/tank.lua +++ /dev/null @@ -1,298 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Tank, Oil Tank - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local N = tubelib2.get_node_lvm -local LQD = function(pos) return (minetest.registered_nodes[N(pos).name] or {}).liquid end -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -local CAPACITY = 1000 - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - minetest.get_node_timer(pos):start(2) -end - -local function node_timer(pos, elapsed) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - return true - end - return false -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - return techage.liquid.is_empty(pos) -end - -local function peek_liquid(pos, indir) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) -end - -local function take_liquid(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - if (M(pos):get_int("keep_assignment") or 0) == 1 then - amount = math.max(math.min(amount, ((nvm.liquid or {}).amount or 0) - 1), 0) - end - amount, name = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return amount, name -end - -local function put_liquid(pos, indir, name, amount) - -- check if it is not powder - local ndef = minetest.registered_craftitems[name] or {} - if not ndef.groups or ndef.groups.powder ~= 1 then - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, LQD(pos).capa) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return leftover - end - return amount -end - -local function untake_liquid(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, LQD(pos).capa) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", techage.liquid.formspec(pos, nvm)) - end - return leftover -end - -minetest.register_node("techage:ta3_tank", { - description = S("TA3 Tank"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_bottom.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_tank.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_tank.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_tank.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_tank.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:ta3_tank") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", techage.liquid.formspec(pos, nvm)) - meta:set_string("infotext", S("TA3 Tank").." "..number) - Pipe:after_place_node(pos) - end, - on_timer = node_timer, - on_punch = techage.liquid.on_punch, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - end, - on_rightclick = on_rightclick, - can_dig = can_dig, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta3_tank"}, - Pipe, "tank", nil, { - capa = CAPACITY, - peek = peek_liquid, - put = put_liquid, - take = take_liquid, - untake = untake_liquid, - } -) - -minetest.register_node("techage:oiltank", { - description = S("Oil Tank"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_metal.png^techage_framexl_ta3_top.png", - "techage_filling_metal.png^techage_framexl_ta3_top.png", - "techage_filling_metal.png^techage_framexl_ta3.png^techage_appl_explosive.png", - }, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = {-6/8, -4/8, -6/8, 6/8, 6/8, 6/8}, - }, - selection_box = { - type = "fixed", - fixed = {-6/8, -4/8, -6/8, 6/8, 6/8, 6/8}, - }, - collision_box = { - type = "fixed", - fixed = {-6/8, -4/8, -6/8, 6/8, 6/8, 6/8}, - }, - wield_scale = {x = 0.8, y = 0.8, z = 0.8}, - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:oiltank") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", techage.liquid.formspec(pos, nvm)) - meta:set_string("infotext", S("Oil Tank").." "..number) - Pipe:after_place_node(pos) - end, - on_timer = node_timer, - on_punch = techage.liquid.on_punch, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - end, - on_rightclick = on_rightclick, - can_dig = can_dig, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:oiltank"}, - Pipe, "tank", nil, { - capa = CAPACITY * 4, - peek = peek_liquid, - put = put_liquid, - take = take_liquid, - untake = untake_liquid, - } -) - -minetest.register_node("techage:ta4_tank", { - description = S("TA4 Tank"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_bottom.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_tank.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.liquid = {} - local number = techage.add_node(pos, "techage:ta4_tank") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", techage.liquid.formspec(pos, nvm)) - meta:set_string("infotext", S("TA4 Tank").." "..number) - Pipe:after_place_node(pos) - end, - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if fields.public then - M(pos):set_int("public", fields.public == "true" and 1 or 0) - end - if fields.keep_assignment then - M(pos):set_int("keep_assignment", fields.keep_assignment == "true" and 1 or 0) - end - end, - on_timer = node_timer, - on_punch = techage.liquid.on_punch, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - end, - on_rightclick = on_rightclick, - can_dig = can_dig, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta4_tank"}, - Pipe, "tank", nil, { - capa = CAPACITY * 2, - peek = peek_liquid, - put = put_liquid, - take = take_liquid, - untake = untake_liquid, - } -) - -techage.register_node({"techage:ta3_tank", "techage:ta4_tank", "techage:oiltank"}, techage.liquid.recv_message) - -minetest.register_craft({ - output = "techage:ta3_tank 2", - recipe = { - {"techage:iron_ingot", "techage:ta3_barrel_empty", "group:wood"}, - {"group:wood", "techage:ta3_barrel_empty", "techage:ta3_pipeS"}, - {"group:wood", "techage:ta3_barrel_empty", "techage:iron_ingot"}, - }, -}) - -minetest.register_craft({ - output = "techage:oiltank", - recipe = { - {"", "", ""}, - {"techage:ta3_tank", "techage:iron_ingot", ""}, - {"techage:iron_ingot", "techage:ta3_tank", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_tank", - recipe = { - {"default:tin_ingot", "dye:blue", "default:steel_ingot"}, - {"", "techage:ta3_tank", ""}, - {"", "", ""}, - }, -}) - -minetest.register_lbm({ - label = "Repair Tanks", - name = "techage:tank", - nodenames = {"techage:ta3_tank", "techage:oiltank", "techage:ta4_tank"}, - run_at_every_load = true, - action = function(pos, node) - local mem = tubelib2.get_mem(pos) - if mem.liquid and mem.liquid.amount then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = math.max(mem.liquid.amount, 0) - nvm.liquid.name = mem.liquid.name - --tubelib2.del_mem(pos) - end - end, -}) diff --git a/techage/liquids/valve.lua b/techage/liquids/valve.lua deleted file mode 100644 index bf59c35..0000000 --- a/techage/liquids/valve.lua +++ /dev/null @@ -1,176 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Valve - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - -minetest.register_node("techage:ta3_valve_open", { - description = S("TA Valve"), - tiles = { - "techage_gaspipe.png^techage_gaspipe_valve_open.png^[transformR90", - "techage_gaspipe.png^techage_gaspipe_valve_open.png^[transformR90", - "techage_gaspipe.png^techage_gaspipe_valve_open.png", - "techage_gaspipe.png^techage_gaspipe_valve_open.png", - "techage_gaspipe_valve_hole.png", - "techage_gaspipe_valve_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - local meta = M(pos) - local number = techage.add_node(pos, "techage:ta3_valve_closed") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA3 Valve")..": "..number) - return false - end, - on_rightclick = function(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - if liquid.turn_valve_off(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") then - minetest.sound_play("techage_valve", { - pos = pos, - gain = 1, - max_hear_distance = 10}) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -4/8, 1/8, 1/8, 4/8}, - {-3/16, -3/16, -3/16, 3/16, 3/16, 3/16}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_valve_closed", { - description = S("TA Valve"), - tiles = { - "techage_gaspipe.png^techage_gaspipe_valve_closed.png^[transformR90", - "techage_gaspipe.png^techage_gaspipe_valve_closed.png^[transformR90", - "techage_gaspipe.png^techage_gaspipe_valve_closed.png", - "techage_gaspipe.png^techage_gaspipe_valve_closed.png", - "techage_gaspipe_valve_hole.png", - "techage_gaspipe_valve_hole.png", - }, - - on_rightclick = function(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - if liquid.turn_valve_on(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") then - minetest.sound_play("techage_valve", { - pos = pos, - gain = 1, - max_hear_distance = 10}) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -4/8, 1/8, 1/8, 4/8}, - {-3/16, -3/16, -3/16, 3/16, 3/16, 3/16}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 2, cracky = 2, snappy = 2, not_in_creative_inventory = 1}, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta3_valve_open", -}) - -techage.register_node({"techage:ta3_valve_closed", "techage:ta3_valve_open"}, { - on_recv_message = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == "on" and node.name == "techage:ta3_valve_closed" then - liquid.turn_valve_on(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") - return true - elseif topic == "off" and node.name == "techage:ta3_valve_open" then - liquid.turn_valve_off(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") - return true - elseif topic == "state" then - if node.name == "techage:ta3_valve_open" then - return "on" - end - return "off" - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == 1 and payload[1] == 1 and node.name == "techage:ta3_valve_closed" then - liquid.turn_valve_on(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") - return 0 - elseif topic == 1 and payload[1] == 0 and node.name == "techage:ta3_valve_open" then - liquid.turn_valve_off(pos, Pipe, "techage:ta3_valve_closed", "techage:ta3_valve_open") - return 0 - else - return 2, "" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == 142 then -- State - if node.name == "techage:ta3_valve_open" then - return 0, {1} - end - return 0, {0} - else - return 2, "" - end - end, -}) - -liquid.register_nodes({"techage:ta3_valve_closed"}, Pipe, "special", {}, {}) - -minetest.register_craft({ - output = "techage:ta3_valve_open", - recipe = { - {"", "dye:black", ""}, - {"techage:ta3_pipeS", "basic_materials:steel_bar", "techage:ta3_pipeS"}, - {"", "techage:vacuum_tube", ""}, - }, -}) diff --git a/techage/liquids/waterinlet.lua b/techage/liquids/waterinlet.lua deleted file mode 100644 index 866eb5d..0000000 --- a/techage/liquids/waterinlet.lua +++ /dev/null @@ -1,109 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Water Inlet (replacement for the water pump) - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe -local liquid = networks.liquid -local water_level = tonumber(minetest.get_mapgen_setting("water_level")) or 1 - -local function is_ocean(pos) - if pos.y > water_level then - M(pos):set_string("infotext", S("Error: Not on sea level!")) - return false - end - local node = techage.get_node_lvm({x = pos.x, y = pos.y - 1, z = pos.z}) - if node.name ~= "default:water_source" then - M(pos):set_string("infotext", S("Error: No water available!")) - return false - end - if node.param2 == 1 then - M(pos):set_string("infotext", S("Error: No natural water!")) - return false - end - M(pos):set_string("infotext", S("Operational")) - return true -end - -local function peek_liquid(pos) - local mem = techage.get_mem(pos) - if is_ocean(pos) then - mem.liquid_name = "techage:water" - mem.liquid_amount = 1 - else - mem.liquid_name = "techage:water" - mem.liquid_amount = 0 - end - return mem.liquid_name -end - -local function take_liquid(pos, indir, name, amount) - local mem = techage.get_mem(pos) - if not mem.liquid_name then - peek_liquid(pos) - end - return mem.liquid_amount or 0, mem.liquid_name -end - - -local function untake_liquid(pos, indir, name, amount) - return 0 -end - -minetest.register_node("techage:ta4_waterinlet", { - description = S("TA4 Water Inlet"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_waterpump_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - Pipe:after_place_node(pos) - is_ocean(pos) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - end, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta4_waterinlet"}, - Pipe, "tank", {"U"}, { - capa = 1, - peek = peek_liquid, - take = take_liquid, - untake = untake_liquid, - } -) - -minetest.register_craft({ - output = "techage:ta4_waterinlet", - recipe = { - {"techage:ta4_carbon_fiber", "techage:ta3_pipeS", "techage:ta4_carbon_fiber"}, - {"techage:iron_ingot", "techage:ta3_barrel_empty", "techage:iron_ingot"}, - }, -}) diff --git a/techage/liquids/waterpump.lua b/techage/liquids/waterpump.lua deleted file mode 100644 index 6911493..0000000 --- a/techage/liquids/waterpump.lua +++ /dev/null @@ -1,167 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Water Pump - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local Pipe = techage.LiquidPipe -local power = networks.power -local liquid = networks.liquid - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 3 -local COUNTDOWN_TICKS = 3 -local PWR_NEEDED = 4 - -local function formspec(self, pos, nvm) - return "size[3,2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;2.8,0.5;#c6e8ff]".. - "label[0.5,-0.1;"..minetest.colorize( "#000000", S("Water Pump")).."]".. - "image_button[1,1;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[1,1;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local function can_start(pos, nvm, state) - local outdir = M(pos):get_int("waterdir") - local pos1 = vector.add(pos, tubelib2.Dir6dToVector[outdir or 0]) - if not techage.is_ocean(pos1) then - return S("no usable water") - end - if not power.power_available(pos, Cable) then - return S("no power") - end - return true -end - -local function start_node(pos, nvm, state) - nvm.running = true -end - -local function stop_node(pos, nvm, state) - nvm.running = false -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:t4_waterpump", - infotext_name = S("TA4 Water Pump"), - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function has_power(pos, nvm) - local outdir = networks.Flip[M(pos):get_int("waterdir")] - local taken = power.consume_power(pos, Cable, outdir, PWR_NEEDED) - if techage.is_running(nvm) then - if taken < PWR_NEEDED then - State:nopower(pos, nvm) - else - return true -- keep running - end - elseif taken == PWR_NEEDED then - State:start(pos, nvm) - end -end - -local function pumping(pos, nvm) - if has_power(pos, nvm) then - nvm.ticks = (nvm.ticks or 0) + 1 - if nvm.ticks % 4 == 0 then - local leftover = liquid.put(pos, Pipe, 6, "techage:water", 1) - if leftover and leftover > 0 then - State:blocked(pos, nvm) - return - end - end - State:keep_running(pos, nvm, 1) - end -end - --- converts power into hydrogen -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - pumping(pos, nvm) - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - nvm.running = false - local number = techage.add_node(pos, "techage:t4_waterpump") - State:node_init(pos, nvm, number) - M(pos):set_int("waterdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -minetest.register_node("techage:t4_waterpump", { - description = S("TA4 Water Pump"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_waterpump_top.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - "techage_filling_ta4.png^techage_frame_waterpump.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - "techage_filling_ta4.png^techage_frame_waterpump.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_receive_fields = on_receive_fields, - on_timer = node_timer, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2, not_in_creative_inventory = 1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, -}) - -power.register_nodes({"techage:t4_waterpump"}, Cable, "con", {"L"}) -liquid.register_nodes({"techage:t4_waterpump"}, Pipe, "pump", {"U"}, {}) - -techage.register_node({"techage:t4_waterpump"}, { - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) diff --git a/techage/locale/techage.de.tr b/techage/locale/techage.de.tr deleted file mode 100644 index b2cb77d..0000000 --- a/techage/locale/techage.de.tr +++ /dev/null @@ -1,1582 +0,0 @@ -# textdomain: techage - - - -### akkubox.lua ### - -TA3 Accu Box=TA3 Akkublock - -### aluminium.lua ### - -Aluminum=Aluminium -Gibbsite Powder=Gibbsit Pulver -Red Mud=Rotschlamm -Red Mud Barrel=Rotschlamm Fass -Red Mud Canister=Rotschlamm Kanister - -### assemble.lua ### -### firebox_lib.lua ### - -[TA] Area is protected!=[TA] Bereich ist geschützt -[TA] Not enough space!=[TA] Nicht ausreichend Platz! - -### assembly_tool.lua ### - -TechAge Assembly Tool=TechAge Montagewerkzeug - -### autocrafter.lua ### - -Autocrafter=Autocrafter - -### axle2power.lua ### - -TA2 Power Generator=TA2 Stromgenerator - -### baborium.lua ### - -Baborium Ingot=Baboriumbarren -Baborium Lump=Baboriumklumpen -Baborium Ore=Baboriumerz - -### barrel.lua ### - -Gas Cylinder Large=Gasflasche groß -Gas Cylinder Small=Gasflasche klein -River Water Barrel=Flusswasserfass -TA Empty Barrel=TA leeres Fass -TA3 Canister=TA3 Kanister -Water=Wasser -Water Barrel=Wasserfass -empty=leer - -### basalt.lua ### - -Basalt Cobble=Basaltpflaster -Basalt Glass=Basaltglas -Basalt Glass 2=Basaltglas 2 -Basalt Glass Thin=Basaltglas dünn -Basalt Glass Thin 2=Basaltglas dünn 2 -Basalt Glass Thin XL=Basaltglas dünn XL -Basalt Glass Thin XL 2=Basaltglas dünn XL 2 -Basalt Gravel=Basaltkies -Basalt Stone=Basaltgestein -Basalt Stone Block=Basaltsteinblock -Basalt Stone Brick=Basaltsteinziegel -Sieved Basalt Gravel=Basaltkies gesiebt - -### battery.lua ### - -Battery=Batterie -Coal Equivalents=Kohleeinheiten -Digtron Battery=Digtron Akku - -### battery.lua ### -### storage.lua ### - -Load=Ladung - -### bauxit.lua ### - -Bauxite Cobblestone=Bauxit Kopfsteinpflaster -Bauxite Gravel=Bauxit Kies -Bauxite Powder=Bauxit Pulver -Bauxite Stone=Bauxit - -### blackhole.lua ### - -TechAge Black Hole=TechAge Schwarzes Loch -TechAge Black Hole (let items and liquids disappear)=TechAge Schwarzes Loch (Gegenstände und Flüssigkeiten verschwinden) - -### boiler.lua ### - -TA2 Boiler Base=TA2 Boiler unten -TA2 Boiler Top=TA2 Boiler oben - -### boiler_base.lua ### - -TA3 Boiler Base=TA3 Boiler unten - -### boiler_lib.lua ### - -To add water punch@nthe boiler@nwith a water bucket=Um Wasser nachzufüllen,@nschlage mit einem Wassereimer@nauf den Block -Water Boiler=Wasserboiler - -### boiler_lib.lua ### -### heatexchanger2.lua ### - -water temperature=Wassertemperatur - -### boiler_top.lua ### - -TA3 Boiler Top=TA3 Boiler oben - -### booster.lua ### - -TA3 Booster=TA3 Gebläse - -### button.lua ### - -Access:=Zugriff: -Button or switch=Taster oder Schalter -Change the block name (infotext)=Ändere den Blocknamen -Command to be sent=Zu sendender Befehl -Infotext=Infotext -TA3 Button/Switch=TA3 Taster/Schalter -TA4 Button/Switch=TA4 Schalter/Taster - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### - -Access=Zugriff -Button protection=Tastenschutz -Type=Typ - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### gaze_sensor.lua ### -### player_detector.lua ### - -Command=Kommando -Number=Nummer - -### button.lua ### -### cart_detector.lua ### -### command_converter.lua ### -### detector.lua ### -### flipflop.lua ### -### light_detector.lua ### -### lua_logic.lua ### -### mesecons_converter.lua ### -### node_detector.lua ### -### player_detector.lua ### -### repeater.lua ### - -Insert destination node number(s)=Gebe Zielnummer(n) ein - -### button.lua ### -### chest.lua ### -### command_converter.lua ### -### detector.lua ### -### doorcontroller.lua ### -### flipflop.lua ### -### mesecons_converter.lua ### -### repeater.lua ### -### sequencer2.lua ### -### submenu.lua ### - -Save=Speichern - -### button.lua ### -### gaze_sensor.lua ### - -Destination block number(s)=Zielblocknummer(n) - -### button_2x.lua ### - -TA4 2x Button=TA4 2x Taster - -### button_2x.lua ### -### button_4x.lua ### - -Command to be sent (ignored for switches)=Zu sendender Befehl (wird für Schalter ignoriert) -Label for the button=Beschriftung für die Taste -Momentary button or on/off switch=Taster oder Ein-/Ausschalter - -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### player_detector.lua ### - -Destination block number=Zielblocknummer - -### button_2x.lua ### -### button_4x.lua ### -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label=Beschriftung - -### button_4x.lua ### - -TA4 4x Button=TA4 4x Taster - -### cart_detector.lua ### - -TA3 Cart Detector=TA3 Wagen Detektor - -### cart_detector.lua ### -### light_detector.lua ### -### node_detector.lua ### - -accept=akzeptieren - -### cart_detector.lua ### -### player_detector.lua ### - -TA3 Player Detector=TA3 Spieler Detektor - -### ceilinglamp.lua ### - -TA Ceiling Lamp=TA Deckenlampe - -### cement.lua ### - -Cement Block=Zement Block -Cement Powder=Zement Pulver - -### ceramic.lua ### - -TA4 Ceramic Material=TA4 Keramik Material -TA4 Furnace Ceramic=TA4 Ofen Keramik -TA4 Round Ceramic=TA4 Rund-Keramik -TA5 Ceramic Turbine=TA5 Keramikturbine - -### charcoalpile.lua ### - -Dirt with Ash=Erde mit Asche -TA1 Charcoal=TA1 Holzkohle - -### charge_detector.lua ### - -Command to send when the energy storage charge@nlevel falls below the specified switch point=Befehl zum Senden, wenn der Ladezustand des@nEnergiespeichers den angegebenen Schaltpunkt unterschreitet -Command to send when the energy storage charge@nlevel rises above the specified switch point=Befehl zum Senden, wenn der Ladezustand des@nEnergiespeichers den angegebenen Schaltpunkt überschreitet -Storage charge level switch point=Schaltpunkt Speicherladezustand -Switch point=Schaltpunkt -TA4 Energy Storage Charge Detector=TA4 Energiespeicher-Ladungsdetektor - -### chest.lua ### - -Allow public access to the chest=Erlaube öffentlichen Zugriff auf die Kiste -Inventory,Pre-Assignment,Config=Inventar,Vorbelegung,Konfiguration -Node label:=Blockbeschriftung: -TA2 Protected Chest=TA2 Gesicherte Kiste -TA3 Protected Chest=TA3 Gesicherte Kiste -TA4 Protected Chest=TA4 Gesicherte Kiste - -### chest_cart.lua ### - -TA Chest Cart=TA Kistenwagen - -### coalburner.lua ### - -Ash=Asche - -### collector.lua ### - -Node number to send the events to=Knotennummer zum Senden der Events -Node numbers to read the states from=Knotennummern zum Lesen der Zustände -Send an event if state is equal or larger than=Senden ein Event wenn Status größer oder gleich als -TA4 State Collector=TA4 Zuständesammler - -### command_converter.lua ### - -Receive=Empfang -Send delay (s)=Sendeverz. (s) -Sent command=Sendekommando -TA3 Command Converter=TA3 Kommando Konverter - -### concentrator.lua ### - -TA4 Tube Concentrator=TA4 Röhren Konzentrator -Tube Concentrator=Röhren Konzentrator - -### controller.lua ### - -Cooling failed=Kühlung ausgefallen -Magnet detection error@n(@1% found / 100% expected)=Magneterkennungsfehler@n(@1% erkannt / 100% erwartet) -Nucleus detection error=Kern nicht erkannt -Plasma ring shape error=Formfehler des Plasmarings -Shell shape error@n(@1% found / 100% expected)=Hüllenformfehler@n(@1% erkannt / 100% erwartet) -TA5 Fusion Reactor Controller=TA5 Fusionsreaktor Controller - -### controller.lua ### -### heatexchanger2.lua ### - -No power=Kein Strom - -### cooking.lua ### - -TA3 Melting=TA3 Schmelzen - -### cooler.lua ### - -TA3 Cooler=TA3 Kühler -TA4 Collider Cooler=TA4 Collider Kühler - -### counting.lua ### - -Your current value is=Der aktuelle Wert ist -[techage] The limit for 'number of commands per minute' has been exceeded.=[techage] Das Limit für 'Anzahl Befehle pro Minute' wurde überschritten. -is allowed=ist erlaubt -is allowed. Current value is=ist erlaubt. Aktueller Wert ist -per minute=pro Minute - -### cylinder.lua ### - -TA2 Cylinder=TA2 Zylinder - -### detector.lua ### - -Counts down the number of items passed through@nand only triggers an 'on' command when it reaches zero.=Zählt die Anzahl der durchlaufenen Elemente herunter@nund löst nur dann einen 'ON'-Befehl aus, wenn er Null erreicht. -Current countdown=Aktueller Zähler -Current countdown value.=Aktueller Zählerwert. -TA4 Collider Detector=TA4 Collider Detektor -TA4 Collider Detector Core=TA4 Collider Detektorkern -TA4 Detector=TA4 Detektor - -### detector.lua ### -### electricmeter.lua ### - -Countdown=Countdown - -### detector.lua ### -### logic_block.lua ### -### tele.lua ### - -Blocking Time=Sperrzeit - -### detector.lua ### -### tele.lua ### - -Configured Items=Konfigurierte Gegenstände -Items which generate an 'on' command.@nIf empty, all passed items generate an 'on' command.=Items, die einen 'on'-Kommando generieren.@nWenn leer, generieren alle übergebenen Items einen 'on'-Befehl. -On Time=ON Zeit -TA3 Detector=TA3 Detektor -The time after the 'off' command@nuntil the next 'on' command is accepted.=Die Zeit nach dem 'off' Kommando,@nbis das nächste 'on' Kommando akzeptiert wird. -The time between the 'on' and 'off' commands.=Die Zeit zwischen den 'on' und 'off' Kommandos. - -### display.lua ### - -Display no: =Display Nr. -TA4 Display=TA4 Display -TA4 Display XL=TA4 Display XL - -### distiller.lua ### - -TA3 Distillation Tower 1=TA3 Destillationsturm 1 -TA3 Distillation Tower 2=TA3 Destillationsturm 2 -TA3 Distillation Tower 3=TA3 Destillationsturm 3 -TA3 Distillation Tower 4=TA3 Destillationsturm 4 -TA3 Distillation Tower Base=TA3 Destillationsturm Basis - -### distributor.lua ### - -Block configured items for open ports=Blockiere konfigurierte Gegenstände für offene Ausgänge -Distributor=Verteiler -High Performance Distributor=Hochleistungs-Verteiler -Input=Einspeisung -blocking mode=Blockiert - -### doorblock.lua ### - -TechAge Door Block=TechAge Türblock - -### doorcontroller.lua ### - -Insert door/gate block number(s)=Gebe Tür-/Tornummer(n) ein -TA3 Door Controller=TA3 Tür Controller - -### doorcontroller2.lua ### - -Blocks exchanged=Blöcke ausgetauscht -Blocks reset=Blöcke rückgesetzt -Click on all the blocks that are part of the door/gate=Klicke auf alle Blöcke, die Teil des Tores sind -Ctrl,Inv=Ctrl,Inv -Exchange=Austauschen -TA3 Door Controller II=TA3 Tür Controller II -with door sound=mit Türgeräusch - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### node_detector.lua ### -### turncontroller.lua ### - -Done=Fertig -Record=Aufzeichnen -block positions are stored.=Block Positionen gespeichert. - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### turncontroller.lua ### - -Recording...=Aufzeichnung... - -### doorcontroller2.lua ### -### movecontroller.lua ### - -Reset=Rücksetzen - -### drillbox.lua ### - -Build derrick=Errichte Ölturm -Depth=Tiefe -Drill Bit=Bohrstange -Drill area is protected=Bohrbereich ist geschützt -Drill bits missing=Bohrgestänge fehlt -Oil Drill Box=Ölbohrkiste -Remove derrick=Entferne Ölturm -item output blocked=Ausgang blockiert - -### drive_axle.lua ### - -TA2 Drive Axle=TA2 Antriebsachse - -### electric_cable.lua ### - -TA Electric Cable=TA Stromkabel - -### electricmeter.lua ### - -Amount of power to be provided before the device turns off=Strommenge, die bereitgestellt werden soll, bis sich das Gerät ausschaltet -Consumption=Verbrauch -Power countdown=Leistungs-Countdown -TA4 Electric Meter=TA4 Stromzähler - -### electricmeter.lua ### -### formspecs.lua ### -### transformer.lua ### - -Power=Strom - -### electricmeter.lua ### -### transformer.lua ### - -Max. power=Max. Leistung -Maximum power passed through=Max. Leistung, die durchgeleitet werden soll - -### electrolyzer.lua ### - -Configurable value@nfor the current limit=Konfigurierbarer Wert@nfür die Strombegrenzung -Current limitation=Strombegrenzung -Electrolyzer=Eletrolyseur -If the charge of the storage@nsystem falls below the configured value,@nthe block switches off=unterschreitet die Ladung des@nSpeichersystems den konfigurierten@nWert, schaltet sich der Block ab -Maximum possible@ncurrent consumption=Maximal mögliche Stromaufnahme -Maximum power consumption [ku]=maximale Stromaufnahme -Storage full=Speicher voll -TA4 Electrolyzer=TA4 Elektrolyseur -Turnoff point=Abschaltpunkt -Turnoff point reached=Abschaltpunkt erreicht - -### electrolyzer.lua ### -### fuelcell.lua ### -### tiny_generator.lua ### - -Electricity=Strom - -### electronic.lua ### - -TA3 Vacuum Tube=TA3 Vakuumröhre -TA4 LEDs=TA4 LEDs -TA4 RAM Chip=RAM Chip -TA4 WLAN Chip=TA4 WLAN Chip -TA5 AI Chip=TA5 KI Chip -TA5 AI Chip II=TA5 KI Chip II -WLAN Chip=WLAN Chip - -### electronic_fab.lua ### - -Electronic Fab=Elektronikfabrik -TA2 Ele Fab=TA2 E-Fabrik -TA3 Ele Fab=TA3 E-Fabrik -TA4 Ele Fab=TA4 E-Fabrik - -### end_wrench.lua ### - -Biome=Biom -Node owner=Blockbesitzer -Position=Position -Position temperature=Positionstemperatur -Pump connected to no/empty tank(s).=Pumpe an keine/leere Tank(s) angeschlossen. -Pump connected to tank(s) with: @1=Pumpe an Tank(s) angeschlossen mit: @1 -TechAge Info Tool (use @= read status info)=TechAge Info Werkzeug - -### end_wrench.lua ### -### meltingpot.lua ### - -Time=Zeit - -### epoxy.lua ### - -Epoxide Resin=Epoxidharz -Epoxide Resin Barrel=Epoxidharz Fass -Epoxide Resin Canister=Epoxidharz Kanister - -### explore.lua ### - -Oil=Öl -TA3 Oil Explorer=TA3 Ölexplorer -TA3 Oil Storage=TA3 Öl Speicher -depth=Tiefe - -### filler.lua ### - -Liquid Filler=Einfülltrichter -TA Liquid Filler=TA Einfülltrichter - -### firebox.lua ### - -TA2 Firebox=TA2 Feuerkiste -TA3 Coal Power Station Firebox=TA3 Kohlekraftwerks-Feuerbox -TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner -TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox - -### firebox_lib.lua ### - -Firebox=Feuerkasten - -### flipflop.lua ### - -TA3 Flip-Flop=TA3 FlipFlop - -### fly_lib.lua ### - -Destination position is protected=Zielposition ist geschützt -Error: Max. length of the flight route exceeded by @1 blocks !!=Fehler: max. Länge der Flugstrecke um @1 Blöcke überschritten !! -No valid destination position=Keine gültige Zielposition -No valid node at the start position=Kein gültiger Block an der Startposition -No valid start position=Keine gültige Startposition -Running=In Betrieb -Start position is protected=Startposition ist geschützt -Stopped=Gestoppt - -### fly_lib.lua ### -### flycontroller.lua ### - -Error: Invalid path !!=Fehler: Ungültiger Pfad !! - -### flycontroller.lua ### - -Error: Recording is missing !!=Fehler: Aufzeichnung fehlt !! -Flight route (A to B)=Flug Route (A nach B) -Move a player without moving blocks=Bewege einen Spieler ohne Blöcke -See chat output=Siehe chat Ausgabe -TA5 Fly Controller=TA5 Flug Controller -Teleport mode=Teleport Mode -Test=Test -[TA4 Fly Controller] Invalid path!=[TA5 Flug Controller] Ungültiger Pfad! -[TA4 Fly Controller] Recording is missing!=[TA5 Flug Controller] Aufzeichnung fehlt! - -### flycontroller.lua ### -### logic_block.lua ### -### lua_logic.lua ### -### movecontroller.lua ### - -Store=Speichern - -### flycontroller.lua ### -### movecontroller.lua ### - -Click on all blocks that shall be moved=Klicke auf alle Blöcke, die verschoben werden sollen -Maximum Speed=Maximalgeschwindigkeit -Maximum speed for moving blocks=Maximale Geschwindigkeit für bewegliche Blöcke -Move=Bewege -Move A-B=Bewege A-B -Move B-A=Bewege B-A -Move block height=Move Block Höhe -Object offset=Objekt Offset -Stored=Gespeichert -Value in the range of 0.0 to 1.0=Wert im Bereich von 0.0 bis 1.0 -Y-offset for non-player objects like vehicles (-0.5 to 0.5)=Y-Offset für Nicht-Spieler Objekte wie Fahrzeuge (-0.5 bis 0.5) - -### flywheel.lua ### - -Flywheel=Schwungrad -TA2 Flywheel=TA2 Schwungrad - -### forceload.lua ### - -Area already loaded or max. number of Forceload Blocks reached!=Bereich bereits geladen oder maximale Anzahl von Forceload Blöcken erreicht! -Area from=Bereich von -Area to=Bereich bis -Block at pos=Block an Pos -List of your Forceload Blocks:=Liste der Forceload Blöcke -Punch the block to make the area visible.=Schlage auf den Bock um den Bereich anzuzeigen. -Show all forceload blocks in a 64x64x64 range=Zeige alle Forceload Blöcke im Umkreis von 64x64x64 Blöcken -Techage Forceload Block=Techage Forceload Block -Techage Forceload Tile=Techage Forceload Kachel -loaded=geladen - -### formspecs.lua ### - -Block has a wrench menu=Block hat ein Gabelschlüssel-Menü -Charge termination=Ladebegrenzung -Current output [ku]=Aktueller Ausgabewert -Maximum output [ku]=Maximaler Ausgabewert -Range in which the generator reduces its power=Bereich in dem der Generator die Leistung reduziert -The current power the generator provides=Die aktuelle Leistung die der Generator liefert -The maximum power the generator can provide=Die maximale Leistung die der Generator liefern kann - -### formspecs.lua ### -### power_terminal2.lua ### - -Charging=Laden - -### formspecs.lua ### -### power_terminal2.lua ### -### storage.lua ### -### transformer.lua ### - -Storage=Speicher - -### fuel_lib.lua ### - -Fuel Menu=Brennstoff Menü -To add fuel punch@nthis block@nwith a fuel container=Um Brennstoff nachzufüllen,@nschlage mit einem Kraftstoffbehälter@nauf den Block - -### fuelcell.lua ### - -Fuel Cell=Brennstoffzelle -TA4 Fuel Cell=TA4 Brennstoffzelle -no hydrogen=kein Wasserstoff - -### fuelcellstack.lua ### - -TA4 Fuel Cell Stack=Brennstoffzellenstapel - -### furnace_top.lua ### - -Furnace Top=Ofenoberteil -Outp=Ergeb. -no fuel or no power=kein Strom oder Brennstoff - -### gas_pipe.lua ### - -TA5 Junction Pipe=TA5 Leitungskupplung -TA5 Pipe=TA5 Leitung - -### gateblock.lua ### - -TechAge Gate Block=TechAge Torblock - -### gaze_sensor.lua ### - -Command to send when sensor is no longer viewed=Befehl zum Senden, wenn der Sensor nicht mehr angesehen wird -Command to send when sensor is viewed=Befehl zum Senden, wenn der Sensor angesehen wird -Input the player name(s) separated by blanks.@nIf empty, only the owner is accepted.=Geben den/die Spielernamen durch Leerzeichen getrennt ein.@nWenn leer, wird nur der Besitzer akzeptiert. -Player Names=Spielernamen -TA4 Gaze Sensor=TA4 Blicksensor - -### gearbox.lua ### - -TA2 Gearbox=TA2 Getriebeblock - -### generator.lua ### - -TA3 Generator=TA3 Generator -TA4 Generator=TA4 Generator -TA5 Generator=TA5 Generator -no steam=Kein Dampf - -### generator.lua ### -### power_terminal2.lua ### - -Generator=Generator - -### gravelrinser.lua ### - -Gravel Rinser=Kiesspüler -Rinsing=Waschen - -### gravelsieve.lua ### - -Compressed Gravel=Komprimiertes Kies -Gravel Sieve=Kiessieb -Sieved Gravel=Gesiebtes Kies -TA1 Gravel Sieve=TA1 Kiessieb -TA2 Gravel Sieve=TA2 Kiessieb -TA3 Gravel Sieve=TA3 Kiessieb -TA4 Gravel Sieve=TA4 Kiessieb - -### grinder.lua ### - -Grinder=Mühle -Grinding=Mahlen -Milling=Mahlen -TA1 Mill Base=Mühlenunterteil - -### growlight.lua ### - -TA4 LED Grow Light=TA4 LED Pflanzenlampe - -### hammer.lua ### - -TA1 Bronze Hammer (smash stone to gravel)=TA1 Bronzehammer (zerschlage Stein zu Kies) -TA1 Diamond Hammer (smash stone to gravel)=TA1 Diamanthammer (zerschlage Stein zu Kies) -TA1 Meridium Hammer (smash stone to gravel)=TA1 Meridiumhammer (zerschlage Stein zu Kies) -TA1 Mese Hammer (smash stone to gravel)=TA1 Mesehammer (zerschlage Stein zu Kies) -TA1 Steel Hammer (smash stone to gravel)=TA1 Stahlhammer (zerschlage Stein zu Kies) -TA1 Stone Hammer (smash stone to gravel)=TA1 Steinhammer (zerschlage Stein zu Kies) - -### heater.lua ### - -TA4 Furnace Heater=TA4 Ofenheizung - -### heatexchanger1.lua ### - -TA4 Heat Exchanger 1=TA4 Wärmetauscher 1 -TA5 Heat Exchanger 1=TA5 Wärmetauscher 1 - -### heatexchanger2.lua ### - - Error!= -Blue pipe connection error@n(@1 found / @2 expected)=Verbindungsfehler blaue Leitung@n(@1 erkannt / @2 erwartet) -Blue pipe coolant missing@n(@1 found / @2 expected)=Kühlmittel fehlt bei der blauen Leitung@n(@1 erkannt / @2 erwartet) -Cooler error=Kühlungsfehler -Green pipe connection error@n(@1 found / @2 expected)=Verbindungsfehler grüne Leitung@n(@1 erkannt / @2 erwartet) -Green pipe coolant missing@n(@1 found / @2 expected)=Kühlmittel fehlt bei der grünen Leitung@n(@1 erkannt / @2 erwartet) -Power network connection error=Stromnetz Verbindungsfehler -TA4 Heat Exchanger=TA4 Wärmetauscher -TA4 Heat Exchanger 2=TA4 Wärmetauscher 2 -TA5 Heat Exchanger 2=TA5 Wärmetauscher 2 -Turbine error= -did you check the plan?=hast du den Plan geprüft? -inlet/pipe error=Einlass/Leitungsfehler -wrong storage diameter=Falscher Wärmespeicher-Durchmesser - -### heatexchanger3.lua ### - -TA4 Heat Exchanger 3=TA4 Wärmetauscher 3 -TA5 Heat Exchanger 3=TA5 Wärmetauscher 3 - -### hydrogen.lua ### - -Hydrogen Cylinder Large=Wasserstoffflasche groß -Hydrogen Cylinder Small=Wasserstoffflasche klein -TA4 Hydrogen=TA4 Wasserstoff - -### hyperloop.lua ### -### sensorchest.lua ### -### teleport.lua ### - -not connected=nicht verbunden - -### hyperloop.lua ### -### teleport.lua ### - -Block name=Blockname -Connection name for this block=Verbindungsname für diesen Block -Connection name of the remote block=Verbindungsname des entfernten Blocks -Enter a block name or select an existing one=Gebe einen Blocknamen ein oder wähle einen vorhandenen aus -Remote name=Name entfernter Block -connected to=verbunden mit - -### industriallamp1.lua ### - -TA Industrial Lamp 1=TA Industrielampe 1 - -### industriallamp2.lua ### - -TA Industrial Lamp 2=TA Industrielampe 2 - -### industriallamp3.lua ### - -TA Industrial Lamp 3=TA Industrielampe 3 - -### industriallamp4.lua ### - -TA4 LED Industrial Lamp=TA4 LED Industrielampe - -### inlet.lua ### - -TA4 Pipe Inlet=TA4 Leitungszulauf -one window maximum=maximal ein Fenster -wrong diameter (should be 5, 7, or 9)=falscher Durchmesser (sollte 5, 7, oder 9 sein) -wrong number of gravel nodes=falsche Anzahl von Kiesblöcken -wrong number of shell nodes=falsche Anzahl von Blöcken bei der Hülle - -### inlets.lua ### - -TA4 Collider Cable Input=TA4 Collider Kabelausgang -TA4 Collider Pipe Input=TA4 Collider Leitungseingang -TA4 Collider Pipe Output=TA4 Collider Leitungsausgang -TA4 Collider Tube Input=TA4 Collider Rohreneingang - -### inverter.lua ### - -Inverter=Wechselrichter -Power AC=Wechselstrom -Power DC=Gleichstrom -TA4 Solar Inverter=TA4 Solar Wechselrichter -no solar power=keine Solarleistung -solar network error=Solar-Netzwerk Fehler - -### junctionbox.lua ### - -TA Electric Junction Box=TA Verteilerdose - -### lampholder.lua ### - -TA Lamp Holder Acacia=TA Lampenhalter Akazie -TA Lamp Holder Apple=TA Lampenhalter Apfel -TA Lamp Holder Aspen=TA Lampenhalter Espe -TA Lamp Holder Copper=TA Lampenhalter Kupfer -TA Lamp Holder Gold=TA Lampenhalter Gold -TA Lamp Holder White=TA Lampenhalter Weiß - -### laser.lua ### - -Laser beam error!=Laserstrahl Fehler! -TA4 Laser Beam Emitter=TA4 Laserstrahl Sender -TA4 Laser Beam Receiver=TA4 Laserstrahl Empfänger -Valid destination positions:=Gültige Zielpositionen -to=bis - -### lib.lua ### - -Block has an@nadditional wrench menu=Block besitzt ein@nzusätzliches@nSchraubenschlüssel-Menü - -### lib.lua ### -### sensorchest.lua ### - -connected with=verbunden mit - -### light_detector.lua ### - -Send signal if light level is above:=Sende ein Signal wenn der Lichtwert größer ist als: -TA3 Light Detector=TA3 Lichtdetektor - -### lighter.lua ### - -TA1 Lighter=TA1 Anzünder - -### liquid_lib.lua ### - -Allow public access to the tank=Erlaube öffentlichen Zugriff auf den Tank -Liquid Tank=Flüssigkeitstank -To add liquids punch@nthe tank@nwith a liquid container=Um Flüssigkeit nachzufüllen,@nschlage mit einem Flüssigkeitsbehälter@nauf den Block - -### liquid_lib.lua ### -### ta4_chest.lua ### - -keep assignment=Zuordnung beibehalten - -### liquid_pipe.lua ### - -TA Junction Pipe=TA Leitungskupplung -TA Pipe=TA Leitung (Flüssigkeiten) - -### liquidsampler.lua ### - -Liquid Sampler=Flüssigkeitensammler - -### liquidsampler.lua ### -### waterpump.lua ### - -no usable water=Kein brauchbares Wasser - -### logic_block.lua ### - -'me' has to be used for the own block number.@n='me' wird für die eigene Blocknummer verwendet.@n -'~@=' means: not equal@n='~@=' bedeutet: ungleich@n -@n is a boolean expression@nwhere input numbers are evaluated.@n=@n ist ein boolescher Ausdruck,@nbei dem Eingabenummern ausgewertet werden.@n -@n is the block number to which the@ncommand should be sent.@n=@n ist die Blocknummer, an die der Befehl@ngesendet werden soll.@n -@nAll rules are checked with each received@ncommand.=@nAlle Regeln werden mit jedem empfangenen@nBefehl überprüft. -@nExamples:@n1234 @=@= on@n1234 @=@= off@n1234 @=@= on and 2345 @=@= off@n2345 ~@= 3456@n=@nBeispiele:@n1234 @=@= on@n1234 @=@= off@n1234 @=@= on and 2345 @=@= off@n2345 ~@= 3456@n -@nRule:@n @= on/off if is true@n=@nRegel:@n @= on/off if is true@n -@nThe internal processing time for all@ncommands is 100 ms.=@nDie interne Durchlaufzeit für alle@nKommandos beträgt 100 ms. -@nValid operators:@nand or on off me @=@= ~@= ( )@n=@nGültige Operatoren:@nand or on off @=@= ~@= ( )@n -Clear=Löschen -Debug=Debug -Inputs=Eingänge -Outputs=Ausgänge -Rules=Regeln -Send an 'on'/'off' command if the@nexpression becomes true.@n=Sende ein 'on'/'off' Kommando, wenn der @nAusdruck wahr wird.@n -Syntax=Syntax - -### logic_block.lua ### -### lua_logic.lua ### - -TA3 Logic Block=TA3 Logikblock -Update=Update - -### logic_block.lua ### -### sequencer2.lua ### - -Help=Hilfe - -### lye.lua ### - -Lye=Lauge -Lye Barrel=Lauge Fass -Lye Canister=Lauge Kanister - -### magnet.lua ### - -TA4 Collider Detector Magnet=TA4 Collider Detektormagnet -TA4 Collider Magnet=TA4 Collider Magnet -TA4 Collider Magnet Base=TA4 Collider Magnetfuß -TA4 Collider Steel Block=TA4 Collider Stahlblock -TA5 Fusion Reactor Magnet 1=TA5 Fusionsreaktor Magnet 1 -TA5 Fusion Reactor Magnet 2=TA5 Fusionsreaktor Magnet 2 -TA5 Fusion Reactor Magnet Blank=TA5 Fusionsreaktor Magnetrohling -TA5 Fusion Reactor Magnet Shield=TA5 Fusionsreaktor Magnetschild - -### mba_detector.lua ### - -TA4 Mapblock Active Detector=TA4 Aktiver Mapblock Detektor - -### meltingpot.lua ### - -Heat=Hitze -Melting Guide=Schmelzführer -Melting Pot active (heat@==Schmelztiegel aktiv (Hitze@= -Melting Pot inactive (heat@==Schmelztiegel inaktiv (Hitze@= -Melting Pot inactive (heat@=0)=Schmelztiegel inaktiv (Hitze@=0) -Menu=Menü -Menu,Recipes=Menü,Rezepte -TA1 Burning=TA1 Brennen -TA1 Melting=TA1 Schmelzen -TA1 Melting Pot=TA1 Schmelztiegel - -### meridium.lua ### - -Meridium Axe=Meridium Axt -Meridium Pickaxe=Meridium Pickel -Meridium Shovel=Meridium Schaufel -Meridium Sword=Meridium Schwert - -### mesecons_converter.lua ### - -TA3 Mesecons Converter=TA3 Mesecons Konverter - -### mill.lua ### - -TA1 Mill=TA1 Mühle -TA1 Mill Gear=TA1 Mühlengetriebe - -### millboard.lua ### - -TA1 Acacia Millrace Board=TA1 Akazie Mühlbachbrett -TA1 Acacia Wood Board=TA1 Akazienholzbrett -TA1 Apple Millrace Board=TA1 Apfel Mühlbachbrett -TA1 Apple Wood Board=TA1 Apfelholzbrett -TA1 Aspen Millrace Board=TA1 Espe Mühlbachbrett -TA1 Aspen Wood Board=TA1 Espenholzbrett -TA1 Jungle Millrace Board=TA1 Dschungel Mühlbachbrett -TA1 Jungle Wood Board=TA1 Dschungelholzbrett -TA1 Pine Millrace Board=TA1 Kiefer Mühlbachbrett -TA1 Pine Wood Board=TA1 Kiefernholzbrett - -### minicell.lua ### - -TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle - -### minichest.lua ### - -Test Chest=Testkiste - -### minitank.lua ### - -Test Mini Tank=Testminitank - -### movecontroller.lua ### - -Error: Invalid distance !!=Fehler: Ungültige Entfernung !! -Move distance=Entfernung -Move distance (A to B)=Entfernung (A nach B) -Operational mode=Betriebsmodus -Switch to the remote controlled 'move xyz' mode=Wechseln in den ferngesteuerten 'move xyz'-Modus -TA Rack and Pinion=TA Zahnstange -TA4 Move Controller=TA4 Move Controller - -### node_detector.lua ### - -Click on all blocks whose positions should be checked=Klicke auf alle Blöcke, deren Positionen überprüft werden sollen -Send signal if nodes have been:=Sende ein Signal falls Blöcke: -TA3 Node Detector=TA3 Block Detektor -TA4 Node Detector=TA3 Block Detektor -added=hinzugefügt wird -added or removed=hinzugefügt oder entfernt wird -removed=entfernt - -### nodes.lua ### - -TechAge Gravel=TechAge Kies - -### oil.lua ### - -Flowing Oil=Fließendes Öl -Oil Source=Erdöl -TA3 Oil Barrel=TA3 Ölfass -TA3 Oil Canister=TA3 Erdölkanister - -### oilfirebox.lua ### - -TA3 Power Station Oil Burner=TA3 Kraftwerks-Ölbrenner - -### petroleum.lua ### - -Isobutane Cylinder Large=Isobutangasflasche groß -Isobutane Cylinder Small=Isobutangasflasche klein -Propane Cylinder Large=Propangasflasche groß -Propane Cylinder Small=Propangasflasche klein -TA3 Bitumen=TA3 Bitumen -TA3 Bitumen Barrel=TA3 Bitumenfass -TA3 Bitumen Canister=TA3 Bitumenkanister -TA3 Fuel Oil=TA3 Schweröl -TA3 Fuel Oil Barrel=TA3 Schwerölfass -TA3 Fuel Oil Canister=TA3 Schwerölkanister -TA3 Gasoline=TA3 Benzin -TA3 Gasoline Barrel=TA3 Benzinfass -TA3 Gasoline Canister=TA3 Benzinkanister -TA3 Naphtha=TA3 Naphtha -TA3 Naphtha Barrel=TA3 Naphtha-Fass -TA3 Naphtha Canister=TA3 Naphtha-Kanister -TA3 Propane=TA3 Propan -TA4 Isobutane=TA4 Isobutan - -### pillar.lua ### - -TA4 Pillar=TA4 Säule - -### pipe_wall_entry.lua ### - -TA3 Pipe Wall Entry=TA3 Leitungs/Wanddurchbruch - -### pipe_wrench.lua ### - -TA3 Drill Pipe Wrench=TA3 Bohrgestängezange - -### plastic.lua ### - -Plastic Granules=Plastikgranulat - -### player_detector.lua ### - -Command to send when player is detected=Befehl zum Senden, wenn ein Spieler erkannt wird -Command to send when player moves away=Befehl zum Senden, wenn sich der Spieler wegbewegt -Radius=Radius -Search radius=Suchradius -TA4 Player Detector=TA4 Spieler Detektor - -### powder.lua ### - -Aluminum Powder=Aluminium Pulver -Clay Powder=Ton Pulver -Graphite Powder=Graphitpulver -Iron Powder=Eisen Pulver -Leave Powder=Laub Pulver -Needle Powder=Nadel Pulver -Silver Sandstone Powder=Silbersandstein Pulver - -### power2axle.lua ### - -TA3 Electric Motor=TA3 Elektromotor - -### power_line.lua ### - -TA Power Line=TA Stromleitung -TA Power Pole=TA Strommast -TA Power Pole Top (for up to 6 connections)=TA Strommastkopf (für bis zu 6 Verbindungen) -TA Power Pole Top 2 (for landlines)=TA Strommastkopf 2 (für Überlandleitungen) - -### power_terminal2.lua ### - -Commands@nhelp . . . print this text@ncls . . . . clear screen@ngen . . print generators@nsto . . print storage systems@ncon1 . . print consumers with power consumption between 1 and 10 ku@ncon2 . . print consumers with power consumption with 10 ku or above@n=Commands@nhelp . . . diesen Text ausgeben@ncls . . . . lösche Bildschirm@ngen . . Generatoren ausgeben@nsto . . Speichersysteme ausgeben@ncon1 . . Verbraucher mit einem Verbrauch zw. 1 und 10 ku ausgeben@ncon2 . . Verbraucher ab 10 ku Verbrauch ausgeben@n -Consumer=Verbraucher -Network Data=Netzwerkdaten -Number of consumers:=Anzahl der Verbraucher -Number of generators:=Anzahl der Generatoren -Number of network nodes:=Anzahl von Netzwerkblöcken -Number of storage systems:=Anzahl der Speichersysteme -TA3 Power Terminal=TA3 Strom Terminal - -### power_terminal2.lua ### -### terminal.lua ### - -Enter=Eingeben - -### powerswitch.lua ### - -TA Power Switch=TA Stromschalter -TA Power Switch Small=TA Stromschalter klein - -### powerswitchbox.lua ### -### powerswitchbox_legacy.lua ### - -TA Power Switch Box=TA Stromschalterbox - -### programmer.lua ### - -TechAge Programmer (right @= read number, left @= write numbers)=TechAge Programmer (rechts @= lese Nummer, links @= schreibe Nummern) -[TechAge Programmer] Error: invalid numbers!=[TechAge Programmer] Fehler: ungültige Nummern! -[TechAge Programmer] Error: programmer not supported!=[TechAge Programmer] Fehler: Programmer wird nicht unterstützt! -[TechAge Programmer] Unknown node on=[TechAge Programmer] Unbekannter Block bei -[TechAge Programmer] foreign or unknown node!=[TechAge Programmer] Fremder oder unbekannter Block! -[TechAge Programmer] node programmed!=[TechAge Programmer] Nummer(n) programmiert! -[TechAge Programmer] number=[TechAge Programmer] Nummer -[TechAge Programmer] programmer reset=[TechAge Programmer] Programmer zurück gesetzt - -### protection.lua ### - -Allow to dig/place Techage power lines nearby power poles=Erlaubt TODO - -### pump.lua ### - -Number of liquid units that are allowed to be pumped=Anzahl der Flüssigkeitseinheiten, die gepumpt werden dürfen -Number of units=Anzahl der Einheiten -TA3 Pump=TA3 Pumpe -TA4 Pump=TA4 Pumpe - -### pump.lua ### -### ta5_pump.lua ### - -Total flow rate=Gesamtdurchfluss -Total flow rate in liquid units=Gesamtdurchfluss in Flüssigkeitseinheiten - -### pumpjack.lua ### - -Oil Pumpjack=Ölpumpe -Oil amount=Ölmenge -Pumpjack=Ölpumpe -needs power=benötigt Strom -no oil=Kein Öl - -### pusher.lua ### - -Number of items=Anzahl der Elemente -Number of items that are allowed to be pushed=Anzahl der Elemente, die verschoben werden dürfen -Optionally configure@nthe pusher with one item=Der Schieber kann optional@nmit einem Elemente@nkonfiguriert werden -Pusher=Schieber - -### quarry.lua ### - -Digging depth=Grabungstiefe -Hole size=Lochgröße -Quarry=Steinbrecher -Start level=Startebene -Start level @= 0@nmeans the same level@nas the quarry is placed=Startebene @= 0@nbedeutet gleiche Ebene@nwie der Steinbrecher -area is protected=Bereich ist geschützt -finished=fertig -inventory full=Inventar ist voll - -### reboiler.lua ### - -TA3 Oil Reboiler=TA3 Aufkocher - -### recipe_lib.lua ### -### recipeblock.lua ### - -Recipe=Rezept - -### recipe_lib.lua ### -### ta4_reactor.lua ### - -Catalyst=Katalysator - -### recipeblock.lua ### - -TA4 Recipe Block=TA4 Rezept Block - -### recipes.lua ### - -Flint and Iron=Flint and Iron -TA1 Iron Ingot=TA1 Eisenbarren -[Bucket] Lava can only be placed below sea level!=Lava kann nur unterhalb der Meerehöhe platziert werden! - -### recycler.lua ### - -Recycler=Recycler - -### redstone.lua ### - -Red Stone=Rotstein -Red Stone Block=Rotsteinblock -Red Stone Brick=Rotsteinziegel - -### repeater.lua ### - -TA3 Repeater=TA3 Wiederholer - -### rotor.lua ### - -Nacelle is missing=Die Gondel fehlt -TA4 Carbon Fiber=TA4 Kohlefaser -TA4 Rotor Blade=TA4 Rotorblatt -TA4 Wind Turbine=TA4 Windkraftanlage -TA4 Wind Turbine Nacelle=TA4 Windkraftanlagengondel - -### screwdriver.lua ### - -Block alignment stored!=Blockausrichtung gespeichert! -Techage Screwdriver@n(See: TA3 > Tools)=Techage Schraubendreher@n(Siehe: TA3 > Werkzeuge) - -### sensorchest.lua ### - -Allow public chest access=Erlaube öffentlichen Zugriff -TA4 Sensor Chest=Sensorkiste - -### sequencer.lua ### - -TA3 Sequencer=TA3 Sequenzer - -### sequencer.lua ### -### sequencer2.lua ### - -stopped=gestoppt - -### sequencer2.lua ### - - - 'goto ' (jump to another line)@n= - 'goto ' (springe zu einer anderen Zeile)@n - - 'nop' (do nothing)@n= - 'nop' (mache nichts)@n - - 'send ' (techage command)@n= - 'send ' (techage Kommando)@n - - 'stop' (stop the execution)@n= - 'stop' (stoppe die Ausführung)@n - - 1 corresponds to 100 ms@n= - 1 entspricht 100 ms@n - - 50000 corresponds to 4 game days@n= - 50000 entspricht 4 Spieltagen@n -'[] '@n='[] '@n - is one of the following:@n= ist eines der folgenden:@n - is a number from 1 to 50000 and is@n= ist eine Nummer von 1 bis 50000 und ist@n -@n=@n -Commands=Kommandos -Cycle time=Zykluszeit -Example:@n=Beispiel: -If 'yes' a received OFF command won't stop the sequencer=Bei 'yes' stoppt ein empfangener OFF-Befehl den Sequenzer nicht -Ignore OFF command=OFF-Befehl ignorieren -Invalid command!=Ungültiges Kommando! -Start=Start -Stop=Stopp -Syntax:@n=Syntax:@n -TA4 Sequencer=TA4 Sequenzer -Timer cycle time (default: 100 ms)=Zykluszeit (normal: 100 ms) -running=läuft -the timeslot when the command is executed.@n=der Zeitpunkt, wenn der Befehl ausgeführt wird.@n - -### sequencer2.lua ### -### submenu.lua ### - -Cancel=Abbruch - -### shell.lua ### - -TA5 Fusion Reactor Nucleus=TA5 Fusionsreaktor Kern -TA5 Fusion Reactor Shell=TA5 Fusionsreaktor Hülle - -### signallamp.lua ### - -TA4 Wind Turbine Signal Lamp=TA4 Windkraftanlagenlampe -TechAge Color Lamp=TechAge Farblampe -TechAge Color Lamp 2=TechAge Farblampe 2 - -### signallamp_2x.lua ### - -TA4 2x Signal Lamp=TA4 2x Signallampe - -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label for the lamp=Bezeichner der Lampe - -### signallamp_4x.lua ### - -TA4 4x Signal Lamp=TA4 4x Signallampe - -### silicon.lua ### - -TA4 Silicon Wafer=TA4 Silizium-Wafer - -### silo.lua ### - -TA3 Silo=TA3 Silo -TA4 Silo=Silo - -### simplelamp.lua ### - -TA Lamp=TA Lampe - -### sluice.lua ### - -TA1 Sluice Gate=TA1 Schleusenschieber -TA1 Sluice Handle=TA1 Schleusengriff - -### solarcell.lua ### - -TA4 Solar Carrier Module=TA4 Solar Trägermodul -TA4 Solar Carrier Module B=TA4 Solar Trägermodul U -TA4 Solar Carrier Module T=TA4 Solar Trägermodul O -TA4 Solar Module=TA4 Solarmodul -light=Licht - -### solarcell.lua ### -### source.lua ### - -power=Strom - -### soundblock.lua ### - -Play=Abspielen -TA3 Sound Block=TA3 Sound Block - -### source.lua ### - -Axle Power Source=Achsenkraftquelle -Ele Power Source=Ele Kraftquelle -Power Source=Stromquelle -Test Generator=Test Generator - -### steam_pipe.lua ### - -TA2 Steam Pipe=TA2 Dampfleitung - -### steelmat.lua ### - -TechAge Steel Mat=TechAge Stahlmatte - -### storage.lua ### - -Test Storage=Test Speicher - -### streetlamp.lua ### - -TA Street Lamp=TA Straßenlampe - -### streetlamp2.lua ### - -TA4 LED Street Lamp=TA4 LED Straßenlampe -TA4 LED Street Lamp Arm=TA4 LED Lampenarm -TA4 LED Street Lamp Pole=TA4 LED Lampenmast - -### submenu.lua ### - -Note: You can't change any values while the block is running!=Hinweis: Während der Block läuft, kann kein Wert geändert werden! -Refresh=Aktualisieren - -### ta1_axle.lua ### - -TA1 Axle=TA1 Achse -TA1 Axle Bearing=TA1 Achsenlager - -### ta2_clutch.lua ### - -TA2 Clutch=TA2 Kupplung - -### ta2_weight_chest.lua ### - -TA2 Weight Chest=TA2 Gewichtekiste - -### ta2_winch.lua ### - -TA2 Winch=TA2 Seilwinde - -### ta4_cable.lua ### - -TA4 Low Power Box=TA4 Niederspannungsverteilerbox -TA4 Low Power Cable=TA4 Niederspannungskabel - -### ta4_cable_wall_entry.lua ### - -TA4 Cable Wall Entry=TA4 Kabel/Wanddurchbruch - -### ta4_chest.lua ### - -Empty the slots always @nfrom right to left=Speicherplätze von rechts nach links leeren -Never completely empty the slots@nwith the pusher to keep the item assignment=Speicherplätze mit dem Schieber nie ganz@nleeren, um die Item-Zuordnung beizubehalten -Size=Größe -TA4 8x2000 Chest=TA4 8x2000 Kiste -Unlock=Entsperren -Unlock connected chest@nif all slots are below 2000=Nachfolgende Kiste entsperren,@nsofern alle Speicherplätze <@= 2000 -right to left=von rechts nach links - -### ta4_doser.lua ### - -Doser=Dosierer -TA4 Doser=TA4 Dosierer -catalyst missing=Katalysator fehlt -reactor defect=Reaktor defekt -reactor defect or no power=Reaktor defekt oder kein Strom -reactor has no power=Reaktor hat keinen Strom -wrong catalyst=falscher Katalysator - -### ta4_doser.lua ### -### ta4_reactor.lua ### - -TA4 Reactor=TA4 Reaktor - -### ta4_injector.lua ### - -Configure up to 8 items @nto be pushed by the injector=Konfiguriere bis zu 8 Gegenstände \n die vom Injektor weitergegeben werden sollen -Injector=Injektor -Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration=Wechsle in den "Ziehe-Modus",@num Items gemäß der Injektor-Konfiguration@naus einem Inventar zu ziehen -pull mode= Ziehe-Modus - -### ta4_liquid_filter.lua ### - -TA4 Liquid Filter Filler=TA4 Flüssigkeitsfilter Einfüllstutzen -TA4 Liquid Filter Sink=TA4 Flüssigkeitsfilter Abfluss - -### ta4_reactor.lua ### - -TA4 Reactor Filler Pipe=TA4 Reaktor Einfüllstutzen - -### ta4_stand.lua ### - -TA4 Reactor Base=TA4 Reaktor Sockel -TA4 Reactor Stand=TA4 Reaktor Ständer -off=aus -on=an - -### ta4_stand.lua ### -### waterpump.lua ### - -no power=kein Strom - -### ta5_chest.lua ### - -TA5 Hyperloop Chest=TA5 Hyperloop Kiste - -### ta5_pump.lua ### - -TA5 Pump=TA5 Pumpe - -### ta5_tank.lua ### - -TA5 Hyperloop Tank=TA5 Hyperloop Tank - -### tank.lua ### - -Oil Tank=Öltank -TA3 Tank=TA3 Tank -TA4 Tank=TA4 Tank - -### tank_cart.lua ### - -TA Tank Cart=TA Tankwagen - -### teleport.lua ### - -Connected=Verbunden -Connection status=Verbindungsstatus -Distance > @1 blocks=Abstand > @1 Blöcke -Ex-points missing (@1 < @2)=Erf.-Punkte fehlen (@1 < @2) -Status=Status -server not connected=Server nicht verbunden - -### teleport_pipe.lua ### - -TA5 Teleport Block Liquids=TA5 Teleport Block Flüssigkeiten - -### teleport_pipe.lua ### -### teleport_tube.lua ### - -Remote block error=Fehler entfernter Block - -### teleport_tube.lua ### - -TA5 Teleport Block Items=TA5 Teleport Block Gegenstände - -### terminal.lua ### - -Syntax error, try help=Syntax Fehler, nutze help -TA3 Terminal=TA3 Terminal -TA4 Terminal=TA4 Terminal -commands like: help=Kommandos wie: help - -### timer.lua ### - -TA3 Timer=TA3 Timer - -### tiny_generator.lua ### - -TA3 Tiny Power Generator=TA3 Kleiner Stromgenerator -Tiny Generator=Kleingenerator -no fuel=kein Kraftstoff - -### tower.lua ### - -TA3 Derrick=TA3 Bohrturm -TA3 Drill Pipe=TA3 Bohrgestänge -TA4 Derrick=TA4 Bohrturm -[TA] Derrick is being built!=[TA] Bohrturm wird errichtet -[TA] Derrick is being removed!=[TA] Bohrturm wird abgebaut - -### transformer.lua ### - -TA4 Isolation Transformer=TA4 Trenntransformator - -### trowel.lua ### - -TechAge Trowel=TechAge Kelle - -### tube_wall_entry.lua ### - -Tube Wall Entry=Röhrenwanddurchbruch - -### tubes.lua ### - -TechAge Tube=TechAge Röhre - -### tubes_ta4.lua ### - -TA4 Tube=TA4 Röhre - -### turbine.lua ### - -TA3 Turbine=TA3 Turbine -TA4 Turbine=TA4 Turbine -TA5 Turbine=TA5 Turbine - -### turncontroller.lua ### - -Click on all blocks that shall be turned=Klicke auf all Blöcke, die gedreht werden sollen -TA4 Turn Controller=TA4 Dreh Controller -Turn left=Drehe links -Turn right=Drehe rechts - -### usmium.lua ### - -Usmium Nuggets=Usmium Nuggets -Usmium Powder=Usmium Pulver - -### vacuumtube.lua ### - -TA4 Vacuum Tube=TA4 Vakuumröhre - -### valve.lua ### - -TA Valve=TA Ventil -TA3 Valve=TA3 Ventil - -### waterinlet.lua ### - -Error: No natural water!=Fehler: Kein natürliches Wasser! -Error: No water available!=Fehler: Kein Wasser verfügbar! -Error: Not on sea level!=Fehler: Nicht auf Meereshöhe! -Operational=Betriebsbereit -TA4 Water Inlet=TA4 Wasssereinlass - -### watermill.lua ### - -TA1 Watermill=TA1 Wasssermühle - -### waterpump.lua ### - -TA4 Water Pump=Wasserpumpe -Water Pump=Wasserpumpe - -### windturbine_lib.lua ### - -Here is not enough water (41x41 m)!=Hier ist nicht genug Wasser (41x41 m)! -Here is not enough wind@n(A free air space of 41x41x21 m is necessary)!=Hier ist nicht genug Wind@n(Ein freier Luftraum von 41x41x21 m ist notwendig)! -The next wind turbines is too close!= Die nächste Windkraftanlagen iat zu nahe! -This is a=Dies ist ein -This is no ocean water!= Dies ist kein Meerwasser! -This is not the surface of the ocean!=Das ist nicht die Meeresoberfläche! -[TA4 Wind Turbine]=[TA4 Windkraftanlage] -biome and no ocean!=Biom und keine Meer (ocean)! -is a suitable place for a wind turbine!=ist ein geeigneter Ort für eine Windkraftanlage! - -### worker.lua ### - -Build detector=Baue Detektor -Item list=Teileliste -Remove detector=Entferne Detektor -TA4 Collider Detector Worker=TA4 Collider Detektor Worker -[TA4] Detector is being built!=[TA4] Detektor wird gebaut! -[TA4] Detector is being removed!=[TA4] Detektor wird entfernt! - - -##### not used anymore ##### diff --git a/techage/locale/techage.fr.tr b/techage/locale/techage.fr.tr deleted file mode 100644 index d4ad8fa..0000000 --- a/techage/locale/techage.fr.tr +++ /dev/null @@ -1,1602 +0,0 @@ -# textdomain: techage - - - -### akkubox.lua ### - -TA3 Accu Box=TA3 Boite Accu - -### aluminium.lua ### - -Aluminum=Aluminium -Gibbsite Powder=Poudre Gibbsite -Red Mud=Boue rouge -Red Mud Barrel=Baril de boue rouge -Red Mud Canister=Bidon de boue rouge - -### assemble.lua ### -### firebox_lib.lua ### - -[TA] Area is protected!=[TA] La zone est protégée! -[TA] Not enough space!=[TA] Pas assez de place! - -### assembly_tool.lua ### - -TechAge Assembly Tool= - -### autocrafter.lua ### - -Autocrafter=Crafteur Automatique - -### axle2power.lua ### - -TA2 Power Generator=Générateur d'électricité TA2 - -### baborium.lua ### - -Baborium Ingot=Lingot de Baborium -Baborium Lump=Morceau de Baborium -Baborium Ore=Minerai de Baborium - -### barrel.lua ### - -Gas Cylinder Large=Cylindre à gaz de grande taille -Gas Cylinder Small=Cylindre à gaz de petite taille -River Water Barrel=Baril d'eau de rivière -TA Empty Barrel=TA Baril vide -TA3 Canister=TA3 Bidon -Water=Eau -Water Barrel=Baril d'eau -empty=vide - -### basalt.lua ### - -Basalt Cobble=Pavé de basalte -Basalt Glass=Verre de basalte -Basalt Glass 2=Verre de basalte 2 -Basalt Glass Thin=Verre de basalte mince -Basalt Glass Thin 2=Verre de basalte mince 2 -Basalt Glass Thin XL=Verre de basalte mince XL -Basalt Glass Thin XL 2=Verre de basalte mince XL 2 -Basalt Gravel=Gravier de basalte -Basalt Stone=Pierre de basalte -Basalt Stone Block=Bloc de pierre de basalte -Basalt Stone Brick=Brique de pierre de basalte -Sieved Basalt Gravel=Gravier de basalte tamisé - -### battery.lua ### - -Battery=Batterie -Coal Equivalents=Équivalents charbon -Digtron Battery=Batterie de Digtron - -### battery.lua ### -### storage.lua ### - -Load=Charger - -### bauxit.lua ### - -Bauxite Cobblestone=Pavé de bauxite -Bauxite Gravel=Gravier de bauxite -Bauxite Powder=Poudre de bauxite -Bauxite Stone=Pierre de bauxite - -### blackhole.lua ### - -TechAge Black Hole=TechAge Trou Noir -TechAge Black Hole (let items and liquids disappear)=TechAge Trou Noir ( laissez les objets et les liquides disparaître) - -### boiler.lua ### - -TA2 Boiler Base=TA2 Base de chaudière -TA2 Boiler Top=TA2 Chaudière du haut - -### boiler_base.lua ### - -TA3 Boiler Base=TA3 Base de chaudière - -### boiler_lib.lua ### - -To add water punch@nthe boiler@nwith a water bucket=Pour ajouter de l'eau percuter@la chaudière@avec un seau d'eau -Water Boiler=Chaudière à eau - -### boiler_lib.lua ### -### heatexchanger2.lua ### - -water temperature=température de l'eau - -### boiler_top.lua ### - -TA3 Boiler Top=TA3 Chaudière du haut - -### booster.lua ### - -TA3 Booster=TA3 Amplificateur - -### button.lua ### - -Access:= -Button or switch= -Change the block name (infotext)= -Command to be sent= -Infotext= -TA3 Button/Switch=Bouton/interrupteur TA3 -TA4 Button/Switch=Bouton/interrupteur TA4 - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### - -Access= -Button protection= -Type= - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### gaze_sensor.lua ### -### player_detector.lua ### - -Command= -Number= - -### button.lua ### -### cart_detector.lua ### -### command_converter.lua ### -### detector.lua ### -### flipflop.lua ### -### light_detector.lua ### -### lua_logic.lua ### -### mesecons_converter.lua ### -### node_detector.lua ### -### player_detector.lua ### -### repeater.lua ### - -Insert destination node number(s)=Insérer le numéro de destination du nœud (s) - -### button.lua ### -### chest.lua ### -### command_converter.lua ### -### detector.lua ### -### doorcontroller.lua ### -### flipflop.lua ### -### mesecons_converter.lua ### -### repeater.lua ### -### sequencer2.lua ### -### submenu.lua ### - -Save=Sauvegarder - -### button.lua ### -### gaze_sensor.lua ### - -Destination block number(s)= - -### button_2x.lua ### - -TA4 2x Button= - -### button_2x.lua ### -### button_4x.lua ### - -Command to be sent (ignored for switches)= -Label for the button= -Momentary button or on/off switch= - -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### player_detector.lua ### - -Destination block number= - -### button_2x.lua ### -### button_4x.lua ### -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label= - -### button_4x.lua ### - -TA4 4x Button= - -### cart_detector.lua ### - -TA3 Cart Detector=Détecteur de chariot TA3 - -### cart_detector.lua ### -### light_detector.lua ### -### node_detector.lua ### - -accept=accepter - -### cart_detector.lua ### -### player_detector.lua ### - -TA3 Player Detector=Détecteur de joueur TA3 - -### ceilinglamp.lua ### - -TA Ceiling Lamp=TA Lampe de plafond - -### cement.lua ### - -Cement Block=Bloc de ciment -Cement Powder=Poudre de ciment - -### ceramic.lua ### - -TA4 Ceramic Material= -TA4 Furnace Ceramic= -TA4 Round Ceramic= -TA5 Ceramic Turbine= - -### charcoalpile.lua ### - -Dirt with Ash=Saleté avec cendre -TA1 Charcoal=TA1 Charbon de bois - -### charge_detector.lua ### - -Command to send when the energy storage charge@nlevel falls below the specified switch point= -Command to send when the energy storage charge@nlevel rises above the specified switch point= -Storage charge level switch point= -Switch point= -TA4 Energy Storage Charge Detector= - -### chest.lua ### - -Allow public access to the chest=Autoriser l'accès public au coffre -Inventory,Pre-Assignment,Config=Inventaire, Présélection, Configuration -Node label:=Étiquette du nœud : -TA2 Protected Chest=TA2 Coffre protégé -TA3 Protected Chest=TA3 Coffre protégé -TA4 Protected Chest=TA4 Coffre protégé - -### chest_cart.lua ### - -TA Chest Cart=TA Coffre de chariot - -### coalburner.lua ### - -Ash=Cendres - -### collector.lua ### - -Node number to send the events to=numéro de nœud pour envoyer les événements à -Node numbers to read the states from=numéros de noeud à lire les états de -Send an event if state is equal or larger than=Envoyer un événement si l'état est égal ou supérieur à -TA4 State Collector=Collecteur d'état TA4 - -### command_converter.lua ### - -Receive= -Send delay (s)= -Sent command= -TA3 Command Converter= - -### concentrator.lua ### - -TA4 Tube Concentrator= -Tube Concentrator= - -### controller.lua ### - -Cooling failed= -Magnet detection error@n(@1% found / 100% expected)= -Nucleus detection error= -Plasma ring shape error= -Shell shape error@n(@1% found / 100% expected)= -TA5 Fusion Reactor Controller= - -### controller.lua ### -### heatexchanger2.lua ### - -No power= - -### cooking.lua ### - -TA3 Melting=TA3 Fonte - -### cooler.lua ### - -TA3 Cooler=TA3 Refroidisseur -TA4 Collider Cooler= - -### counting.lua ### - -Your current value is= -[techage] The limit for 'number of commands per minute' has been exceeded.= -is allowed= -is allowed. Current value is= -per minute= - -### cylinder.lua ### - -TA2 Cylinder=Cylindre TA2 - -### detector.lua ### - -Counts down the number of items passed through@nand only triggers an 'on' command when it reaches zero.= -Current countdown= -Current countdown value.= -TA4 Collider Detector= -TA4 Collider Detector Core= -TA4 Detector=Détecteur TA4 - -### detector.lua ### -### electricmeter.lua ### - -Countdown= - -### detector.lua ### -### logic_block.lua ### -### tele.lua ### - -Blocking Time= - -### detector.lua ### -### tele.lua ### - -Configured Items= -Items which generate an 'on' command.@nIf empty, all passed items generate an 'on' command.= -On Time= -TA3 Detector=Détecteur TA3 -The time after the 'off' command@nuntil the next 'on' command is accepted.= -The time between the 'on' and 'off' commands.= - -### display.lua ### - -Display no: =Afficher n° : -TA4 Display=Affichage TA4 -TA4 Display XL=Affichage TA4 XL - -### distiller.lua ### - -TA3 Distillation Tower 1=TA3 Tour de distillation 1 -TA3 Distillation Tower 2=TA3 Tour de distillation 2 -TA3 Distillation Tower 3=TA3 Tour de distillation 3 -TA3 Distillation Tower 4=TA3 Tour de distillation 4 -TA3 Distillation Tower Base=Base de la tour de distillation TA3 - -### distributor.lua ### - -Block configured items for open ports=Bloquer les éléments configurés pour les ports ouverts -Distributor=Distributeur -High Performance Distributor=Distributeur haute performance -Input=Entrée -blocking mode=mode de blocage - -### doorblock.lua ### - -TechAge Door Block=Bloc de porte TechAge - -### doorcontroller.lua ### - -Insert door/gate block number(s)=Insérer le numéro de porte(s) -TA3 Door Controller=TA3 Contrôleur de porte - -### doorcontroller2.lua ### - -Blocks exchanged= -Blocks reset= -Click on all the blocks that are part of the door/gate=Cliquez sur tous les blocs qui font partie de la porte/du portail -Ctrl,Inv=Ctrl,Inv -Exchange= -TA3 Door Controller II=TA3 Contrôleur de porte II -with door sound= - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### node_detector.lua ### -### turncontroller.lua ### - -Done=Terminé -Record=Enregistrer -block positions are stored.=Les positions des blocs sont enregistrées. - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### turncontroller.lua ### - -Recording...=Enregistrement... - -### doorcontroller2.lua ### -### movecontroller.lua ### - -Reset= - -### drillbox.lua ### - -Build derrick=Construire le derrick -Depth=Profondeur -Drill Bit=Mèche de forage -Drill area is protected=La zone de forage est protégée -Drill bits missing=Mèches de forage manquantes -Oil Drill Box=Boîte de forage pétrolier -Remove derrick=Retirer le derrick -item output blocked=sortie d'article bloquée - -### drive_axle.lua ### - -TA2 Drive Axle=Axe d'entraînement TA2 - -### electric_cable.lua ### - -TA Electric Cable=TA Câble électrique - -### electricmeter.lua ### - -Amount of power to be provided before the device turns off= -Consumption= -Power countdown= -TA4 Electric Meter= - -### electricmeter.lua ### -### formspecs.lua ### -### transformer.lua ### - -Power= - -### electricmeter.lua ### -### transformer.lua ### - -Max. power= -Maximum power passed through= - -### electrolyzer.lua ### - -Configurable value@nfor the current limit= -Current limitation= -Electrolyzer=Électrolyseur -If the charge of the storage@nsystem falls below the configured value,@nthe block switches off= -Maximum possible@ncurrent consumption= -Maximum power consumption [ku]= -Storage full= -TA4 Electrolyzer= -Turnoff point= -Turnoff point reached= - -### electrolyzer.lua ### -### fuelcell.lua ### -### tiny_generator.lua ### - -Electricity=Électricité - -### electronic.lua ### - -TA3 Vacuum Tube=Tube à vide TA3 -TA4 LEDs=TA4 DEL -TA4 RAM Chip=Puce RAM TA4 -TA4 WLAN Chip=Puce WLAN TA4 -TA5 AI Chip= -TA5 AI Chip II= -WLAN Chip=Puce WLAN - -### electronic_fab.lua ### - -Electronic Fab=Fab électronique -TA2 Ele Fab= -TA3 Ele Fab= -TA4 Ele Fab= - -### end_wrench.lua ### - -Biome= -Node owner= -Position= -Position temperature= -Pump connected to no/empty tank(s).= -Pump connected to tank(s) with: @1= -TechAge Info Tool (use @= read status info)= - -### end_wrench.lua ### -### meltingpot.lua ### - -Time= - -### epoxy.lua ### - -Epoxide Resin=Résine d'époxyde -Epoxide Resin Barrel=Baril de résine d'époxyde -Epoxide Resin Canister=Résine époxyde en bidon - -### explore.lua ### - -Oil=Pétrole -TA3 Oil Explorer=TA3 Explorateur de pétrole -TA3 Oil Storage=TA3 Entreposage du pétrole -depth= - -### filler.lua ### - -Liquid Filler= -TA Liquid Filler=TA Remplisseur liquide - -### firebox.lua ### - -TA2 Firebox= -TA3 Coal Power Station Firebox= -TA3 Furnace Oil Burner= -TA3 Power Station Firebox= - -### firebox_lib.lua ### - -Firebox= - -### flipflop.lua ### - -TA3 Flip-Flop= - -### fly_lib.lua ### - -Destination position is protected= -Error: Max. length of the flight route exceeded by @1 blocks !!= -No valid destination position= -No valid node at the start position= -No valid start position= -Running= -Start position is protected= -Stopped= - -### fly_lib.lua ### -### flycontroller.lua ### - -Error: Invalid path !!= - -### flycontroller.lua ### - -Error: Recording is missing !!= -Flight route (A to B)= -Move a player without moving blocks= -See chat output= -TA5 Fly Controller= -Teleport mode= -Test= -[TA4 Fly Controller] Invalid path!= -[TA4 Fly Controller] Recording is missing!= - -### flycontroller.lua ### -### logic_block.lua ### -### lua_logic.lua ### -### movecontroller.lua ### - -Store= - -### flycontroller.lua ### -### movecontroller.lua ### - -Click on all blocks that shall be moved= -Maximum Speed= -Maximum speed for moving blocks= -Move= -Move A-B= -Move B-A= -Move block height= -Object offset= -Stored= -Value in the range of 0.0 to 1.0= -Y-offset for non-player objects like vehicles (-0.5 to 0.5)= - -### flywheel.lua ### - -Flywheel=La roue motrice -TA2 Flywheel=La roue motrice TA2 - -### forceload.lua ### - -Area already loaded or max. number of Forceload Blocks reached!=Zone déjà chargée ou nombre maximum de Forceload atteint! -Area from= -Area to= -Block at pos= -List of your Forceload Blocks:=Liste de vos blocs de forceload : -Punch the block to make the area visible.=Frappez le bloc pour rendre la zone visible. -Show all forceload blocks in a 64x64x64 range=Afficher tous les blocs de forceload dans une zone de 64x64x64 -Techage Forceload Block=Bloc de Forceload Techage -Techage Forceload Tile=Tuile de Forceload Techage -loaded=chargé - -### formspecs.lua ### - -Block has a wrench menu= -Charge termination= -Current output [ku]= -Maximum output [ku]= -Range in which the generator reduces its power= -The current power the generator provides= -The maximum power the generator can provide= - -### formspecs.lua ### -### power_terminal2.lua ### - -Charging= - -### formspecs.lua ### -### power_terminal2.lua ### -### storage.lua ### -### transformer.lua ### - -Storage= - -### fuel_lib.lua ### - -Fuel Menu=Menu Carburant -To add fuel punch@nthis block@nwith a fuel container= - -### fuelcell.lua ### - -Fuel Cell=Cellules à combustible -TA4 Fuel Cell=Cellules à combustible TA4 -no hydrogen= - -### fuelcellstack.lua ### - -TA4 Fuel Cell Stack=Empilement de cellules à combustible TA4 - -### furnace_top.lua ### - -Furnace Top=Haut du fourneau -Outp= -no fuel or no power=pas de carburant ou pas d'électricité - -### gas_pipe.lua ### - -TA5 Junction Pipe= -TA5 Pipe= - -### gateblock.lua ### - -TechAge Gate Block=Bloc de porte TechAge - -### gaze_sensor.lua ### - -Command to send when sensor is no longer viewed= -Command to send when sensor is viewed= -Input the player name(s) separated by blanks.@nIf empty, only the owner is accepted.= -Player Names= -TA4 Gaze Sensor= - -### gearbox.lua ### - -TA2 Gearbox=Boîte de vitesses TA2 - -### generator.lua ### - -TA3 Generator=Générateur TA3 -TA4 Generator=Générateur TA4 -TA5 Generator= -no steam= - -### generator.lua ### -### power_terminal2.lua ### - -Generator=Générateur - -### gravelrinser.lua ### - -Gravel Rinser=Rinceur de gravier -Rinsing=Rinçage - -### gravelsieve.lua ### - -Compressed Gravel=Gravier compressé -Gravel Sieve=Tamis à gravier -Sieved Gravel=Gravier tamisé -TA1 Gravel Sieve=Tamis à gravier TA1 -TA2 Gravel Sieve=Tamis à gravier TA2 -TA3 Gravel Sieve=Tamis à gravier TA3 -TA4 Gravel Sieve=Tamis à gravier TA4 - -### grinder.lua ### - -Grinder=Broyeur -Grinding=Broyage -Milling= -TA1 Mill Base= - -### growlight.lua ### - -TA4 LED Grow Light=Lumière a DEL pour culture TA4 - -### hammer.lua ### - -TA1 Bronze Hammer (smash stone to gravel)= -TA1 Diamond Hammer (smash stone to gravel)= -TA1 Meridium Hammer (smash stone to gravel)= -TA1 Mese Hammer (smash stone to gravel)= -TA1 Steel Hammer (smash stone to gravel)= -TA1 Stone Hammer (smash stone to gravel)= - -### heater.lua ### - -TA4 Furnace Heater= - -### heatexchanger1.lua ### - -TA4 Heat Exchanger 1= -TA5 Heat Exchanger 1= - -### heatexchanger2.lua ### - - Error!= -Blue pipe connection error@n(@1 found / @2 expected)= -Blue pipe coolant missing@n(@1 found / @2 expected)= -Cooler error= -Green pipe connection error@n(@1 found / @2 expected)= -Green pipe coolant missing@n(@1 found / @2 expected)= -Power network connection error= -TA4 Heat Exchanger= -TA4 Heat Exchanger 2= -TA5 Heat Exchanger 2= -Turbine error= -did you check the plan?= -inlet/pipe error= -wrong storage diameter= - -### heatexchanger3.lua ### - -TA4 Heat Exchanger 3= -TA5 Heat Exchanger 3= - -### hydrogen.lua ### - -Hydrogen Cylinder Large= -Hydrogen Cylinder Small= -TA4 Hydrogen= - -### hyperloop.lua ### -### sensorchest.lua ### -### teleport.lua ### - -not connected= - -### hyperloop.lua ### -### teleport.lua ### - -Block name= -Connection name for this block= -Connection name of the remote block= -Enter a block name or select an existing one= -Remote name= -connected to= - -### industriallamp1.lua ### - -TA Industrial Lamp 1= - -### industriallamp2.lua ### - -TA Industrial Lamp 2= - -### industriallamp3.lua ### - -TA Industrial Lamp 3= - -### industriallamp4.lua ### - -TA4 LED Industrial Lamp= - -### inlet.lua ### - -TA4 Pipe Inlet= -one window maximum= -wrong diameter (should be 5, 7, or 9)= -wrong number of gravel nodes= -wrong number of shell nodes= - -### inlets.lua ### - -TA4 Collider Cable Input= -TA4 Collider Pipe Input= -TA4 Collider Pipe Output= -TA4 Collider Tube Input= - -### inverter.lua ### - -Inverter= -Power AC= -Power DC= -TA4 Solar Inverter= -no solar power= -solar network error= - -### junctionbox.lua ### - -TA Electric Junction Box= - -### lampholder.lua ### - -TA Lamp Holder Acacia= -TA Lamp Holder Apple= -TA Lamp Holder Aspen= -TA Lamp Holder Copper= -TA Lamp Holder Gold= -TA Lamp Holder White= - -### laser.lua ### - -Laser beam error!= -TA4 Laser Beam Emitter= -TA4 Laser Beam Receiver= -Valid destination positions:= -to= - -### lib.lua ### - -Block has an@nadditional wrench menu= - -### lib.lua ### -### sensorchest.lua ### - -connected with= - -### light_detector.lua ### - -Send signal if light level is above:= -TA3 Light Detector= - -### lighter.lua ### - -TA1 Lighter= - -### liquid_lib.lua ### - -Allow public access to the tank= -Liquid Tank= -To add liquids punch@nthe tank@nwith a liquid container= - -### liquid_lib.lua ### -### ta4_chest.lua ### - -keep assignment=garder l'affectation - -### liquid_pipe.lua ### - -TA Junction Pipe= -TA Pipe= - -### liquidsampler.lua ### - -Liquid Sampler= - -### liquidsampler.lua ### -### waterpump.lua ### - -no usable water= - -### logic_block.lua ### - -'me' has to be used for the own block number.@n= -'~@=' means: not equal@n= -@n is a boolean expression@nwhere input numbers are evaluated.@n= -@n is the block number to which the@ncommand should be sent.@n= -@nAll rules are checked with each received@ncommand.= -@nExamples:@n1234 @=@= on@n1234 @=@= off@n1234 @=@= on and 2345 @=@= off@n2345 ~@= 3456@n= -@nRule:@n @= on/off if is true@n= -@nThe internal processing time for all@ncommands is 100 ms.= -@nValid operators:@nand or on off me @=@= ~@= ( )@n= -Clear= -Debug= -Inputs= -Outputs= -Rules= -Send an 'on'/'off' command if the@nexpression becomes true.@n= -Syntax= - -### logic_block.lua ### -### lua_logic.lua ### - -TA3 Logic Block= -Update= - -### logic_block.lua ### -### sequencer2.lua ### - -Help= - -### lye.lua ### - -Lye= -Lye Barrel= -Lye Canister= - -### magnet.lua ### - -TA4 Collider Detector Magnet= -TA4 Collider Magnet= -TA4 Collider Magnet Base= -TA4 Collider Steel Block= -TA5 Fusion Reactor Magnet 1= -TA5 Fusion Reactor Magnet 2= -TA5 Fusion Reactor Magnet Blank= -TA5 Fusion Reactor Magnet Shield= - -### mba_detector.lua ### - -TA4 Mapblock Active Detector= - -### meltingpot.lua ### - -Heat= -Melting Guide= -Melting Pot active (heat@== -Melting Pot inactive (heat@== -Melting Pot inactive (heat@=0)= -Menu= -Menu,Recipes= -TA1 Burning= -TA1 Melting= -TA1 Melting Pot= - -### meridium.lua ### - -Meridium Axe= -Meridium Pickaxe= -Meridium Shovel= -Meridium Sword= - -### mesecons_converter.lua ### - -TA3 Mesecons Converter= - -### mill.lua ### - -TA1 Mill= -TA1 Mill Gear= - -### millboard.lua ### - -TA1 Acacia Millrace Board= -TA1 Acacia Wood Board= -TA1 Apple Millrace Board= -TA1 Apple Wood Board= -TA1 Aspen Millrace Board= -TA1 Aspen Wood Board= -TA1 Jungle Millrace Board= -TA1 Jungle Wood Board= -TA1 Pine Millrace Board= -TA1 Pine Wood Board= - -### minicell.lua ### - -TA4 Streetlamp Solar Cell= - -### minichest.lua ### - -Test Chest= - -### minitank.lua ### - -Test Mini Tank= - -### movecontroller.lua ### - -Error: Invalid distance !!= -Move distance= -Move distance (A to B)= -Operational mode= -Switch to the remote controlled 'move xyz' mode= -TA Rack and Pinion= -TA4 Move Controller= - -### node_detector.lua ### - -Click on all blocks whose positions should be checked= -Send signal if nodes have been:= -TA3 Node Detector= -TA4 Node Detector= -added= -added or removed= -removed= - -### nodes.lua ### - -TechAge Gravel= - -### oil.lua ### - -Flowing Oil= -Oil Source= -TA3 Oil Barrel= -TA3 Oil Canister= - -### oilfirebox.lua ### - -TA3 Power Station Oil Burner= - -### petroleum.lua ### - -Isobutane Cylinder Large= -Isobutane Cylinder Small= -Propane Cylinder Large= -Propane Cylinder Small= -TA3 Bitumen= -TA3 Bitumen Barrel= -TA3 Bitumen Canister= -TA3 Fuel Oil= -TA3 Fuel Oil Barrel= -TA3 Fuel Oil Canister= -TA3 Gasoline= -TA3 Gasoline Barrel= -TA3 Gasoline Canister= -TA3 Naphtha= -TA3 Naphtha Barrel= -TA3 Naphtha Canister= -TA3 Propane= -TA4 Isobutane= - -### pillar.lua ### - -TA4 Pillar= - -### pipe_wall_entry.lua ### - -TA3 Pipe Wall Entry= - -### pipe_wrench.lua ### - -TA3 Drill Pipe Wrench= - -### plastic.lua ### - -Plastic Granules= - -### player_detector.lua ### - -Command to send when player is detected= -Command to send when player moves away= -Radius= -Search radius= -TA4 Player Detector= - -### powder.lua ### - -Aluminum Powder= -Clay Powder= -Graphite Powder= -Iron Powder= -Leave Powder= -Needle Powder= -Silver Sandstone Powder= - -### power2axle.lua ### - -TA3 Electric Motor= - -### power_line.lua ### - -TA Power Line= -TA Power Pole= -TA Power Pole Top (for up to 6 connections)= -TA Power Pole Top 2 (for landlines)= - -### power_terminal2.lua ### - -Commands@nhelp . . . print this text@ncls . . . . clear screen@ngen . . print generators@nsto . . print storage systems@ncon1 . . print consumers with power consumption between 1 and 10 ku@ncon2 . . print consumers with power consumption with 10 ku or above@n= -Consumer= -Network Data= -Number of consumers:= -Number of generators:= -Number of network nodes:= -Number of storage systems:= -TA3 Power Terminal= - -### power_terminal2.lua ### -### terminal.lua ### - -Enter=Saisir - -### powerswitch.lua ### - -TA Power Switch= -TA Power Switch Small= - -### powerswitchbox.lua ### -### powerswitchbox_legacy.lua ### - -TA Power Switch Box= - -### programmer.lua ### - -TechAge Programmer (right @= read number, left @= write numbers)= -[TechAge Programmer] Error: invalid numbers!= -[TechAge Programmer] Error: programmer not supported!= -[TechAge Programmer] Unknown node on= -[TechAge Programmer] foreign or unknown node!= -[TechAge Programmer] node programmed!= -[TechAge Programmer] number= -[TechAge Programmer] programmer reset= - -### protection.lua ### - -Allow to dig/place Techage power lines nearby power poles= - -### pump.lua ### - -Number of liquid units that are allowed to be pumped= -Number of units= -TA3 Pump= -TA4 Pump= - -### pump.lua ### -### ta5_pump.lua ### - -Total flow rate= -Total flow rate in liquid units= - -### pumpjack.lua ### - -Oil Pumpjack= -Oil amount= -Pumpjack= -needs power= -no oil= - -### pusher.lua ### - -Number of items= -Number of items that are allowed to be pushed= -Optionally configure@nthe pusher with one item= -Pusher= - -### quarry.lua ### - -Digging depth= -Hole size= -Quarry= -Start level= -Start level @= 0@nmeans the same level@nas the quarry is placed= -area is protected= -finished= -inventory full= - -### reboiler.lua ### - -TA3 Oil Reboiler= - -### recipe_lib.lua ### -### recipeblock.lua ### - -Recipe= - -### recipe_lib.lua ### -### ta4_reactor.lua ### - -Catalyst= - -### recipeblock.lua ### - -TA4 Recipe Block= - -### recipes.lua ### - -Flint and Iron= -TA1 Iron Ingot= -[Bucket] Lava can only be placed below sea level!= - -### recycler.lua ### - -Recycler= - -### redstone.lua ### - -Red Stone= -Red Stone Block= -Red Stone Brick= - -### repeater.lua ### - -TA3 Repeater= - -### rotor.lua ### - -Nacelle is missing= -TA4 Carbon Fiber= -TA4 Rotor Blade= -TA4 Wind Turbine= -TA4 Wind Turbine Nacelle= - -### screwdriver.lua ### - -Block alignment stored!= -Techage Screwdriver@n(See: TA3 > Tools)= - -### sensorchest.lua ### - -Allow public chest access= -TA4 Sensor Chest= - -### sequencer.lua ### - -TA3 Sequencer= - -### sequencer.lua ### -### sequencer2.lua ### - -stopped= - -### sequencer2.lua ### - - - 'goto ' (jump to another line)@n= - - 'nop' (do nothing)@n= - - 'send ' (techage command)@n= - - 'stop' (stop the execution)@n= - - 1 corresponds to 100 ms@n= - - 50000 corresponds to 4 game days@n= -'[] '@n= - is one of the following:@n= - is a number from 1 to 50000 and is@n= -@n= -Commands= -Cycle time= -Example:@n= -If 'yes' a received OFF command won't stop the sequencer= -Ignore OFF command= -Invalid command!= -Start= -Stop= -Syntax:@n= -TA4 Sequencer= -Timer cycle time (default: 100 ms)= -running= -the timeslot when the command is executed.@n= - -### sequencer2.lua ### -### submenu.lua ### - -Cancel= - -### shell.lua ### - -TA5 Fusion Reactor Nucleus= -TA5 Fusion Reactor Shell= - -### signallamp.lua ### - -TA4 Wind Turbine Signal Lamp= -TechAge Color Lamp= -TechAge Color Lamp 2= - -### signallamp_2x.lua ### - -TA4 2x Signal Lamp= - -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label for the lamp= - -### signallamp_4x.lua ### - -TA4 4x Signal Lamp= - -### silicon.lua ### - -TA4 Silicon Wafer= - -### silo.lua ### - -TA3 Silo= -TA4 Silo= - -### simplelamp.lua ### - -TA Lamp= - -### sluice.lua ### - -TA1 Sluice Gate= -TA1 Sluice Handle= - -### solarcell.lua ### - -TA4 Solar Carrier Module= -TA4 Solar Carrier Module B= -TA4 Solar Carrier Module T= -TA4 Solar Module= -light= - -### solarcell.lua ### -### source.lua ### - -power=alimentation - -### soundblock.lua ### - -Play= -TA3 Sound Block= - -### source.lua ### - -Axle Power Source= -Ele Power Source= -Power Source= -Test Generator= - -### steam_pipe.lua ### - -TA2 Steam Pipe= - -### steelmat.lua ### - -TechAge Steel Mat= - -### storage.lua ### - -Test Storage= - -### streetlamp.lua ### - -TA Street Lamp= - -### streetlamp2.lua ### - -TA4 LED Street Lamp= -TA4 LED Street Lamp Arm= -TA4 LED Street Lamp Pole= - -### submenu.lua ### - -Note: You can't change any values while the block is running!= -Refresh= - -### ta1_axle.lua ### - -TA1 Axle= -TA1 Axle Bearing= - -### ta2_clutch.lua ### - -TA2 Clutch= - -### ta2_weight_chest.lua ### - -TA2 Weight Chest= - -### ta2_winch.lua ### - -TA2 Winch= - -### ta4_cable.lua ### - -TA4 Low Power Box= -TA4 Low Power Cable= - -### ta4_cable_wall_entry.lua ### - -TA4 Cable Wall Entry= - -### ta4_chest.lua ### - -Empty the slots always @nfrom right to left= -Never completely empty the slots@nwith the pusher to keep the item assignment=Ne jamais vider complètement les slots@n avec le pousseur pour conserver l'affectation des articles -Size=Taille -TA4 8x2000 Chest=TA4 Coffre 8x2000 -Unlock=Déverrouiller -Unlock connected chest@nif all slots are below 2000=Déverrouiller le coffre connecté@n si tous les emplacements sont inférieurs à 2000 -right to left=de droite à gauche - -### ta4_doser.lua ### - -Doser=Doseur -TA4 Doser=TA4 Doseur -catalyst missing=catalyseur manquant -reactor defect=défaut du réacteur -reactor defect or no power=défaut du réacteur ou absence de courant -reactor has no power=Le réacteur n'a pas de courant -wrong catalyst=mauvais catalyseur - -### ta4_doser.lua ### -### ta4_reactor.lua ### - -TA4 Reactor=Réacteur TA4 - -### ta4_injector.lua ### - -Configure up to 8 items @nto be pushed by the injector= -Injector=Injecteur -Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration= -pull mode= - -### ta4_liquid_filter.lua ### - -TA4 Liquid Filter Filler=TA4 Remplisseur de liquide filtrer -TA4 Liquid Filter Sink=TA4 Évier de filtre à liquide - -### ta4_reactor.lua ### - -TA4 Reactor Filler Pipe=Tuyau de remplissage du réacteur TA4 - -### ta4_stand.lua ### - -TA4 Reactor Base=Base du réacteur TA4 -TA4 Reactor Stand=Support du réacteur TA4 -off=fermer -on=allumer - -### ta4_stand.lua ### -### waterpump.lua ### - -no power=pas de courant - -### ta5_chest.lua ### - -TA5 Hyperloop Chest= - -### ta5_pump.lua ### - -TA5 Pump= - -### ta5_tank.lua ### - -TA5 Hyperloop Tank= - -### tank.lua ### - -Oil Tank=Citerne de pétrole -TA3 Tank=Citerne TA3 -TA4 Tank=Citerne TA4 - -### tank_cart.lua ### - -TA Tank Cart=Chariot-citerne TA - -### teleport.lua ### - -Connected= -Connection status= -Distance > @1 blocks= -Ex-points missing (@1 < @2)= -Status= -server not connected= - -### teleport_pipe.lua ### - -TA5 Teleport Block Liquids= - -### teleport_pipe.lua ### -### teleport_tube.lua ### - -Remote block error= - -### teleport_tube.lua ### - -TA5 Teleport Block Items= - -### terminal.lua ### - -Syntax error, try help=Erreur de syntaxe, essayez l'aide -TA3 Terminal=Terminal TA3 -TA4 Terminal= -commands like: help=commandes comme: aide - -### timer.lua ### - -TA3 Timer=TA3 Minuteur - -### tiny_generator.lua ### - -TA3 Tiny Power Generator=TA3 Petit générateur d'électricité -Tiny Generator=Petit générateur -no fuel=pas de carburant - -### tower.lua ### - -TA3 Derrick=TA3 Derrick -TA3 Drill Pipe=Tuyau de forage TA3 -TA4 Derrick=TA4 Derrick -[TA] Derrick is being built!=[TA] Le derrick est en cours de construction! -[TA] Derrick is being removed!=[TA] Le derrick est retiré! - -### transformer.lua ### - -TA4 Isolation Transformer= - -### trowel.lua ### - -TechAge Trowel=Truelle TechAge - -### tube_wall_entry.lua ### - -Tube Wall Entry=Entrée murale du tube - -### tubes.lua ### - -TechAge Tube= - -### tubes_ta4.lua ### - -TA4 Tube= - -### turbine.lua ### - -TA3 Turbine=Turbine TA3 -TA4 Turbine=Turbine TA4 -TA5 Turbine= - -### turncontroller.lua ### - -Click on all blocks that shall be turned= -TA4 Turn Controller= -Turn left= -Turn right= - -### usmium.lua ### - -Usmium Nuggets=Pépites d'Usmium -Usmium Powder=Poudre d'Usmium - -### vacuumtube.lua ### - -TA4 Vacuum Tube= - -### valve.lua ### - -TA Valve=TA Valve -TA3 Valve= - -### waterinlet.lua ### - -Error: No natural water!= -Error: No water available!= -Error: Not on sea level!= -Operational= -TA4 Water Inlet= - -### watermill.lua ### - -TA1 Watermill= - -### waterpump.lua ### - -TA4 Water Pump=TA4 Pompe à eau -Water Pump=Pompe à eau - -### windturbine_lib.lua ### - -Here is not enough water (41x41 m)!=Ici, il n'y a pas assez d'eau (41x41 m)! -Here is not enough wind@n(A free air space of 41x41x21 m is necessary)!= -The next wind turbines is too close!=La prochaine éolienne est trop proche! -This is a=Il s'agit d'un -This is no ocean water!=Ce n'est pas de l'eau de mer! -This is not the surface of the ocean!=Ce n'est pas la surface de l'océan! -[TA4 Wind Turbine]=[TA4 Éolienne] -biome and no ocean!=un biome et pas d'océan! -is a suitable place for a wind turbine!=est un endroit approprié pour une éolienne! - -### worker.lua ### - -Build detector= -Item list= -Remove detector= -TA4 Collider Detector Worker= -[TA4] Detector is being built!= -[TA4] Detector is being removed!= - - -##### not used anymore ##### - -TA3 Akku Box=TA3 Boite Akku -No plan available=Aucun plan disponible -Side view=Vue de côté -Top view=Vue de dessus -Blocks are back=Les blocs sont de retour -Blocks are disappeared=Les blocs ont disparu -Remove=Retirer -Set=Configurer -Priv missing=Priv manquant -Switched to private use!=Passage à l'usage privé! -Switched to public use!=Passage à l'usage public! -TA2 Power Generator: Overload fault?@n(restart with right-click)=Générateur de puissance TA2 : Défaut de surcharge ?@n(redémarrage avec le clic droit) -Error: Inventory already in use=Erreur : Inventaire déjà utilisé -full=plein -storage empty?=stockage vide? -Use a trowel to remove the node.=Utilisez une truelle pour enlever le noeud. -TA3 Valve closed=TA3 Valve fermée -TA3 Valve open=TA3 Valve ouverte -Here is not enough wind (A free air space of 41x41x21 m is necessary)!=Ici, il n'y a pas assez de vent (un espace libre de 41x41x21 m est nécessaire)! diff --git a/techage/locale/techage.ru.tr b/techage/locale/techage.ru.tr deleted file mode 100644 index 1bdf22e..0000000 --- a/techage/locale/techage.ru.tr +++ /dev/null @@ -1,1576 +0,0 @@ -# textdomain: techage - - - -### akkubox.lua ### - -TA3 Accu Box=TA3 Блок питания - -### aluminium.lua ### - -Aluminum=Алюминий -Gibbsite Powder=Гидраргиллитовый порошок -Red Mud=Красная грязь -Red Mud Barrel=Бочка красной грязи -Red Mud Canister=Канистра красной грязи - -### assemble.lua ### -### firebox_lib.lua ### - -[TA] Area is protected!=[TA] Зона защищена! -[TA] Not enough space!=[TA] Недостаточно пространства! - -### assembly_tool.lua ### - -TechAge Assembly Tool=TechAge Сборочный инструмент - -### autocrafter.lua ### - -Autocrafter=Автокрафтер - -### axle2power.lua ### - -TA2 Power Generator=TA2 Генератор - -### baborium.lua ### - -Baborium Ingot=Бабориемувый слиток -Baborium Lump=Кусок бабориума -Baborium Ore=Кусок бабориемувой руды - -### barrel.lua ### - -Gas Cylinder Large=Большой газовый баллон -Gas Cylinder Small=Маленький газовый баллон -River Water Barrel=Бочка речной воды -TA Empty Barrel=TA Пустая бочка -TA3 Canister=TA3 Канистра -Water=Вода -Water Barrel=Бочка с водой -empty=пустой - -### basalt.lua ### - -Basalt Cobble=Базальтовый булыжник -Basalt Glass=Базальтовое стекло -Basalt Glass 2=Базальтовое стекло 2 -Basalt Glass Thin=Тонкое базальтовое стекло -Basalt Glass Thin 2=Тонкое базальтовое стекло 2 -Basalt Glass Thin XL=Тонкое базальтовое стекло XL -Basalt Glass Thin XL 2=Тонкое базальтовое стекло XL 2 -Basalt Gravel=Базальтовый гравий -Basalt Stone=Базальтовый камень -Basalt Stone Block=Блок базальтового камня -Basalt Stone Brick=Базальтовый кирпич -Sieved Basalt Gravel=Просеянный базальтовый камень - -### battery.lua ### - -Battery=Батарея -Coal Equivalents=В угольном эквиваленте -Digtron Battery=Батарея дигтрона - -### battery.lua ### -### storage.lua ### - -Load=Загрузка - -### bauxit.lua ### - -Bauxite Cobblestone=Бокситовый булыжник -Bauxite Gravel=Бокситовый гравий -Bauxite Powder=Бокситовая порошок -Bauxite Stone=Бокситовый камень - -### blackhole.lua ### - -TechAge Black Hole=TechAge Черная дыра -TechAge Black Hole (let items and liquids disappear)=Techage Черная дыра (позвольте предметам и жидкостям исчезнуть) - -### boiler.lua ### - -TA2 Boiler Base=TA2 Нижняя часть водонагревателя -TA2 Boiler Top=TA2 Верхняя часть водонагревателя - -### boiler_base.lua ### - -TA3 Boiler Base=TA3 Нижняя часть водонагревателя - -### boiler_lib.lua ### - -To add water punch@nthe boiler@nwith a water bucket=Что бы добавить воду ударьте @nводонагреватель@n ведром воды -Water Boiler=Водонагреватель - -### boiler_lib.lua ### -### heatexchanger2.lua ### - -water temperature=температура воды - -### boiler_top.lua ### - -TA3 Boiler Top=TA3 Верхняя часть бойлера - -### booster.lua ### - -TA3 Booster=TA3 Усилитель - -### button.lua ### - -Access:=Доступ: -Button or switch=Кнопка или выключатель -Change the block name (infotext)=Измените имя блока (информационный текст) -Command to be sent=Команда для отправки -Infotext=Информационный текст -TA3 Button/Switch=TA3 Кнопка/Выключатель -TA4 Button/Switch=TA4 Кнопка/Выключатель - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### - -Access=Доступ -Button protection=Защита кнопки -Type=Тип - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### gaze_sensor.lua ### -### player_detector.lua ### - -Command=Команда -Number=Номер - -### button.lua ### -### cart_detector.lua ### -### command_converter.lua ### -### detector.lua ### -### flipflop.lua ### -### light_detector.lua ### -### lua_logic.lua ### -### mesecons_converter.lua ### -### node_detector.lua ### -### player_detector.lua ### -### repeater.lua ### - -Insert destination node number(s)=Введите номер(а) блок(а/ов) назначения - -### button.lua ### -### chest.lua ### -### command_converter.lua ### -### detector.lua ### -### doorcontroller.lua ### -### flipflop.lua ### -### mesecons_converter.lua ### -### repeater.lua ### -### sequencer2.lua ### -### submenu.lua ### - -Save=Сохранить - -### button.lua ### -### gaze_sensor.lua ### - -Destination block number(s)=Номер(а) блок(а/ов) назначения - -### button_2x.lua ### - -TA4 2x Button=TA4 2x Кнопка - -### button_2x.lua ### -### button_4x.lua ### - -Command to be sent (ignored for switches)=Команда для отправки (игнорируется для выключателей) -Label for the button=Ярлык для кнопки -Momentary button or on/off switch=Мгновенная кнопка или выключатель - -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### player_detector.lua ### - -Destination block number=Номер блока назначения - -### button_2x.lua ### -### button_4x.lua ### -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label=Ярлык - -### button_4x.lua ### - -TA4 4x Button=TA4 4x Кнопка - -### cart_detector.lua ### - -TA3 Cart Detector=TA3 Детектор вагонетки - -### cart_detector.lua ### -### light_detector.lua ### -### node_detector.lua ### - -accept=принять - -### cart_detector.lua ### -### player_detector.lua ### - -TA3 Player Detector=TA3 Детектор игрока - -### ceilinglamp.lua ### - -TA Ceiling Lamp=TA Люстра - -### cement.lua ### - -Cement Block=Блок цемента -Cement Powder=Порошок из цемента - -### ceramic.lua ### - -TA4 Ceramic Material=TA4 Керамика -TA4 Furnace Ceramic=TA4 Керамика для печи -TA4 Round Ceramic=TA4 Круглая керамика -TA5 Ceramic Turbine=TA5 Керамическая турбина - -### charcoalpile.lua ### - -Dirt with Ash=Грязь с пеплом -TA1 Charcoal=TA1 Древесный уголь - -### charge_detector.lua ### - -Command to send when the energy storage charge@nlevel falls below the specified switch point=Команда, которая отправится когда @nуровень энергии будет ниже указанной точки -Command to send when the energy storage charge@nlevel rises above the specified switch point=Команда, которая отправится когда @nуровень энергии будет выше указанной точки -Storage charge level switch point=Точка переключения уровня заряда источника энергии -Switch point=Точка переключения -TA4 Energy Storage Charge Detector=TA4 Детектор количества энергии в хранилище - -### chest.lua ### - -Allow public access to the chest=Разрешить публичный доступ к сундуку -Inventory,Pre-Assignment,Config=Инвентарь,Пред задание,Настройка -Node label:=Ярлык ноды: -TA2 Protected Chest=TA2 Защищенный сундук -TA3 Protected Chest=TA3 Защищенный сундук -TA4 Protected Chest=TA4 Защищенный сундук - -### chest_cart.lua ### - -TA Chest Cart=TA Вагонетка с сундуком - -### coalburner.lua ### - -Ash=Пепел - -### collector.lua ### - -Node number to send the events to=Номер ноды в которую будут отправляться события -Node numbers to read the states from=Номера нод из которых будут считываться состояния -Send an event if state is equal or larger than=Отправить событие если состояние больше или равно чем -TA4 State Collector=TA4 Считыватель состояния - -### command_converter.lua ### - -Receive=Получить -Send delay (s)=Отправить через (с) -Sent command=Отправить команду -TA3 Command Converter=TA3 Конвертер команд - -### concentrator.lua ### - -TA4 Tube Concentrator=TA4 Соединитель труб -Tube Concentrator=Соединитель труб - -### controller.lua ### - -Cooling failed=Охлаждение не удалось -Magnet detection error@n(@1% found / 100% expected)=Ошибка обнаружения магнита(@1 найден / 100% ожидается) -Nucleus detection error=Ошибка обнаружения ядра -Plasma ring shape error=Ошибка формы плазмового кольца -Shell shape error@n(@1% found / 100% expected)=Ошибка формы оболочки@n(@1% найдено / 100% ожидается) -TA5 Fusion Reactor Controller=TA5 Контроллер ядерного реактора - -### controller.lua ### -### heatexchanger2.lua ### - -No power=Нет энергии - -### cooking.lua ### - -TA3 Melting=TA3 Плавление - -### cooler.lua ### - -TA3 Cooler=TA3 Охладитель -TA4 Collider Cooler=TA4 Охладитель коллайдера - -### counting.lua ### - -Your current value is=Ваше текущее значение -[techage] The limit for 'number of commands per minute' has been exceeded.=[techage] Предел для 'количество команд в минуту' был исчерпан. -is allowed=разрешен -is allowed. Current value is=разрешен. Ваше текущее значение -per minute=в минуту - -### cylinder.lua ### - -TA2 Cylinder=TA2 Цилиндр - -### detector.lua ### - -Counts down the number of items passed through@nand only triggers an 'on' command when it reaches zero.=Считает количество проходящих предметов@nи включается когда количество достигает нуля. -Current countdown=Кол-во предметов которое должно пройти -Current countdown value.=Кол-во прошедших предметов -TA4 Collider Detector=TA4 Детектор коллайдера -TA4 Collider Detector Core=TA4 Ядро детектора коллайдера -TA4 Detector=TA4 Детектор - -### detector.lua ### -### electricmeter.lua ### - -Countdown=Кол-во электроэнергии которое должно передаться - -### detector.lua ### -### logic_block.lua ### -### tele.lua ### - -Blocking Time=Время блокировки - -### detector.lua ### -### tele.lua ### - -Configured Items=Настроенные предметы -Items which generate an 'on' command.@nIf empty, all passed items generate an 'on' command.=Предметы, которые генерируют команду 'on' (включить).@nЕсли пусто, все прошедшие предметы генерируют команду 'on'. -On Time=Вовремя -TA3 Detector=TA3 Детектор -The time after the 'off' command@nuntil the next 'on' command is accepted.=Время после команды 'off' до приема следующей команды 'on'. -The time between the 'on' and 'off' commands.=Промежуток времени между командами 'on' (включить) и 'off' (выключить). - -### display.lua ### - -Display no: =Номер дисплея: -TA4 Display=TA4 Экран -TA4 Display XL=TA4 Экран XL - -### distiller.lua ### - -TA3 Distillation Tower 1=TA3 Дистилляционная башня 1 -TA3 Distillation Tower 2=TA3 Дистилляционная башня 2 -TA3 Distillation Tower 3=TA3 Дистилляционная башня 3 -TA3 Distillation Tower 4=TA3 Дистилляционная башня 4 -TA3 Distillation Tower Base=TA3 Основание дистилляционной башни - -### distributor.lua ### - -Block configured items for open ports=Заблокировать предметы настроенные для открытых портов -Distributor=Распределитель -High Performance Distributor=Высокопроизводительный распределитель -Input=Ввод -blocking mode=блокирующий режим - -### doorblock.lua ### - -TechAge Door Block=Techage Блок двери - -### doorcontroller.lua ### - -Insert door/gate block number(s)=Введите номер(а) блок(а/ов) двер(и/ей)/ворот -TA3 Door Controller=TA3 Контроллер двери - -### doorcontroller2.lua ### - -Blocks exchanged=Блоки перемещены -Blocks reset=Переустановить блоки -Click on all the blocks that are part of the door/gate=Нажмите на все блоки которые являются частью двери/ворот -Ctrl,Inv=Контроль,Инвентарь -Exchange=Обмен -TA3 Door Controller II=TA3 Контроллер двери -with door sound=с звуком двери - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### node_detector.lua ### -### turncontroller.lua ### - -Done=Готово -Record=Записать -block positions are stored.=позиции блоков сохранены. - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### turncontroller.lua ### - -Recording...=Запись... - -### doorcontroller2.lua ### -### movecontroller.lua ### - -Reset=Переустановить - -### drillbox.lua ### - -Build derrick=Построить буровую вышку -Depth=Глубина -Drill Bit=Сверло для бурения -Drill area is protected=Зона бурения защищена -Drill bits missing=Сверла для бурения отсутствуют -Oil Drill Box=Коробка для бурения нефтяных скважин -Remove derrick=Удалить буровую вышку -item output blocked=выход предмета заблокирован - -### drive_axle.lua ### - -TA2 Drive Axle=TA2 Вал - -### electric_cable.lua ### - -TA Electric Cable=TA Кабель - -### electricmeter.lua ### - -Amount of power to be provided before the device turns off=Количество энергии которое должно быть подано до выключения устройства -Consumption=Потребление -Power countdown=Кол-во электроэнергии которое должно пройти -TA4 Electric Meter=TA4 Счетчик электроэнергии - -### electricmeter.lua ### -### formspecs.lua ### -### transformer.lua ### - -Power=Энергия - -### electricmeter.lua ### -### transformer.lua ### - -Max. power=Максимальная мощность -Maximum power passed through=Максимальная мощность прошедшая через - -### electrolyzer.lua ### - -Configurable value@nfor the current limit=Настраиваемое значение@nдля текущего лимита -Current limitation=Текущие ограничения -Electrolyzer=Электролизер -If the charge of the storage@nsystem falls below the configured value,@nthe block switches off=Если заряд в хранилище@nпадает ниже указанной точки то@nблок выключается -Maximum possible@ncurrent consumption=Максимально возможное@nпотребление тока -Maximum power consumption [ku]=Максимальное потребление энергии [кВт] -Storage full=Хранилище заполнено -TA4 Electrolyzer=TA4 Электролизер -Turnoff point=Точка выключения -Turnoff point reached=Достигнута точка выключения - -### electrolyzer.lua ### -### fuelcell.lua ### -### tiny_generator.lua ### - -Electricity=Электричество - -### electronic.lua ### - -TA3 Vacuum Tube=TA3 Вакуумная труба -TA4 LEDs=TA4 Светодиоды -TA4 RAM Chip=TA4 ОЗУ-микросхема -TA4 WLAN Chip=TA4 WLAN-микросхема -TA5 AI Chip=TA5 ИИ-микросхема -TA5 AI Chip II=TA5 ИИ-микросхема II -WLAN Chip=WLAN-микросхема - -### electronic_fab.lua ### - -Electronic Fab=Фабрика электроники -TA2 Ele Fab=TA2 Фабрика электроники -TA3 Ele Fab=TA3 Фабрика электроники -TA4 Ele Fab=TA4 Фабрика электроники - -### end_wrench.lua ### - -Biome=Биом -Node owner=Владелец ноды -Position=Местоположение -Position temperature=Температура местоположения -Pump connected to no/empty tank(s).=Насос (не) присоединен к пустому резервуар(у/ам). -Pump connected to tank(s) with: @1=Насос присоединен к резервуар(у/ам) с: @1 -TechAge Info Tool (use @= read status info)=Techage Информационный инструмент(используй @= чтобы прочитать информацию о статусе) - -### end_wrench.lua ### -### meltingpot.lua ### - -Time=Время - -### epoxy.lua ### - -Epoxide Resin=Эпоксидная смола -Epoxide Resin Barrel=Бочка эпоксидной смолы -Epoxide Resin Canister=Канистра эпоксидной смолы - -### explore.lua ### - -Oil=Нефть -TA3 Oil Explorer=TA3 Нефтяной радар -TA3 Oil Storage=TA3 Хранилище нефти -depth=глубина - -### filler.lua ### - -Liquid Filler=Заполнитель жидкостью -TA Liquid Filler=TA Заполнитель жидкостью - -### firebox.lua ### - -TA2 Firebox=TA5 Топка -TA3 Coal Power Station Firebox=TA3 Топка использующая уголь для генерации электроэнергии -TA3 Furnace Oil Burner=TA3 Масляная горелка печи -TA3 Power Station Firebox=TA3 Топка для генерации электроэнергии - -### firebox_lib.lua ### - -Firebox=Топка - -### flipflop.lua ### - -TA3 Flip-Flop=TA3 Триггер - -### fly_lib.lua ### - -Destination position is protected=Пункт назначения защищен -Error: Max. length of the flight route exceeded by @1 blocks !!=Ошибка: Максимальная длина траектории полета ограничена @1 блоками !! -No valid destination position=Нет правильного пункта назначения -No valid node at the start position=Неправильная нода на начальном местоположении -No valid start position=Неправильное начальное местоположение -Running=Работает -Start position is protected=Начальное местоположение защищено -Stopped=Остановлено - -### fly_lib.lua ### -### flycontroller.lua ### - -Error: Invalid path !!=Ошибка: неверный путь !! - -### flycontroller.lua ### - -Error: Recording is missing !!=Ошибка: Запись отсутствует!! -Flight route (A to B)=Траектория полета (из A в Б) -Move a player without moving blocks=Сдвинуть игрока не сдвигая блоки -See chat output=Выводить чат -TA5 Fly Controller=TA5 Контроллер полета -Teleport mode=Режим телепорта -Test=Протестировать -[TA4 Fly Controller] Invalid path!=[TA4 Контроллер полета] Неправильный путь! -[TA4 Fly Controller] Recording is missing!=[TA4 Контроллер полета] Запись отсутствует! - -### flycontroller.lua ### -### logic_block.lua ### -### lua_logic.lua ### -### movecontroller.lua ### - -Store=Записать - -### flycontroller.lua ### -### movecontroller.lua ### - -Click on all blocks that shall be moved=Нажмите на все блоки которые должны быть передвинуты -Maximum Speed=Максимальная скорость -Maximum speed for moving blocks=Максимальная скорость движущихся блоков -Move=Переместить -Move A-B=Переместить из А в Б -Move B-A=Переместить из Б в А -Move block height=Высота перемещения блока -Object offset=Смещение объекта -Stored=Записано -Value in the range of 0.0 to 1.0=Число в диапазоне от 0.0 до 1.0 -Y-offset for non-player objects like vehicles (-0.5 to 0.5)=Смещение по оси Y для не игровых объектов таких как велосипед (от -0.5 до 0.5) - -### flywheel.lua ### - -Flywheel=Маховик -TA2 Flywheel=TA2 Маховик - -### forceload.lua ### - -Area already loaded or max. number of Forceload Blocks reached!=Зона уже загружена или достигнуто максимальное количество блоков загрузки! -List of your Forceload Blocks:=Список ваших блоков загрузки: -Punch the block to make the area visible.=Ударьте блок, что бы сделать зону видимой. -Show all forceload blocks in a 64x64x64 range=Показать все блоки загрузки в диапазоне 64x64x64. -Techage Forceload Block=Techage Блок загрузки -Techage Forceload Tile=Techage Плитка загрузки -loaded=загружено - -### formspecs.lua ### - -Block has a wrench menu=У блока есть меню для гаечного ключа -Charge termination=Прекращение зарядки -Current output [ku]=Текущий выходной ток [кВт] -Maximum output [ku]=Максимальный выходной ток [кВт] -Range in which the generator reduces its power=Диапазон в котором генератор уменьшает свою мощность -The current power the generator provides=Текущая мощность генератора позволяет -The maximum power the generator can provide=Максимальная мощность генератора может позволить - -### formspecs.lua ### -### power_terminal2.lua ### - -Charging=Зарядка - -### formspecs.lua ### -### power_terminal2.lua ### -### storage.lua ### -### transformer.lua ### - -Storage=Хранилище - -### fuel_lib.lua ### - -Fuel Menu=Меню топлива -To add fuel punch@nthis block@nwith a fuel container=Что бы добавить топливо ударьте@nэтот блок@nконтейнером с топливом - -### fuelcell.lua ### - -Fuel Cell=Ячейка с топливом -TA4 Fuel Cell=TA4 Ячейка с топливом -no hydrogen=нет водорода - -### fuelcellstack.lua ### - -TA4 Fuel Cell Stack=TA4 Блок топливных элементов - -### furnace_top.lua ### - -Furnace Top=Верхняя часть печи -Outp=Результат -no fuel or no power=нет топлива или нет энергии - -### gas_pipe.lua ### - -TA5 Junction Pipe=TA5 Распределительная труба -TA5 Pipe=TA5 Труба - -### gateblock.lua ### - -TechAge Gate Block=TechAge блок ворот - -### gaze_sensor.lua ### - -Command to send when sensor is no longer viewed=Команда, которая будет отправлена когда сенсор окажется вне зоны видимости -Command to send when sensor is viewed=Команда, которая отправится когда сенсор будет в зоне видимости -Input the player name(s) separated by blanks.@nIf empty, only the owner is accepted.=Введите им(я/ена) игроков разделенные пробелами.@nЕсли пусто, то только владельцу сервера разрешено. -Player Names=Имена игроков -TA4 Gaze Sensor=TA4 Сенсор взгляда - -### gearbox.lua ### - -TA2 Gearbox=TA2 Коробка передач - -### generator.lua ### - -TA3 Generator=TA3 Генератор -TA4 Generator=TA4 Генератор -TA5 Generator=TA5 Генератор -no steam=нет пара - -### generator.lua ### -### power_terminal2.lua ### - -Generator=Генератор - -### gravelrinser.lua ### - -Gravel Rinser=Промыватель гравия -Rinsing=Промывание - -### gravelsieve.lua ### - -Compressed Gravel=Сжатый гравий -Gravel Sieve=Сито для гравия -Sieved Gravel=Просеянный гравий -TA1 Gravel Sieve=TA1 Сито для гравия -TA2 Gravel Sieve=TA2 Сито для гравия -TA3 Gravel Sieve=TA3 Сито для гравия -TA4 Gravel Sieve=TA4 Сито для гравия - -### grinder.lua ### - -Grinder=Измельчитель -Grinding=Измельчение -Milling=Помол -TA1 Mill Base=TA1 Основание мельницы - -### growlight.lua ### - -TA4 LED Grow Light=TA4 Светодиодная лампа для выращивания - -### hammer.lua ### - -TA1 Bronze Hammer (smash stone to gravel)=TA1 Бронзовый молот (переделывает камень в гравий) -TA1 Diamond Hammer (smash stone to gravel)=TA1 Алмазный молот (переделывает камень в гравий) -TA1 Meridium Hammer (smash stone to gravel)=TA1 Меридиемувый молот (переделывает камень в гравий) -TA1 Mese Hammer (smash stone to gravel)=TA1 Месеиевый молот (переделывает камень в гравий) -TA1 Steel Hammer (smash stone to gravel)=TA1 Стальной молот (переделывает камень в гравий) -TA1 Stone Hammer (smash stone to gravel)=TA1 Каменный молот (переделывает камень в гравий) - -### heater.lua ### - -TA4 Furnace Heater=TA4 Нагреватель печи - -### heatexchanger1.lua ### - -TA4 Heat Exchanger 1=TA4 Теплообменник 1 -TA5 Heat Exchanger 1=TA5 Теплообменник 1 - -### heatexchanger2.lua ### - - Error!= Ошибка! -Blue pipe connection error@n(@1 found / @2 expected)=Ошибка соединения синей трубы @n (@1 найдено из @2) -Blue pipe coolant missing@n(@1 found / @2 expected)=Отсутствует охладитель синей трубы @n (@1 найдено из @2) -Cooler error=Ошибка охладителя -Green pipe connection error@n(@1 found / @2 expected)=Ошибка соединения зеленой трубы @n (@1 найдено из @2) -Green pipe coolant missing@n(@1 found / @2 expected)=Отсутствует охладитель зеленой трубы @n (@1 найдено из @2) -Power network connection error=Ошибка соединения электрической сети -TA4 Heat Exchanger=TA4 Теплообменник -TA4 Heat Exchanger 2=TA4 Теплообменник 2 -TA5 Heat Exchanger 2=TA5 Теплообменник 2 -Turbine error=Ошибка турбины -did you check the plan?=вы проверили чертеж? -inlet/pipe error=ошибка входной/обычной трубы -wrong storage diameter=неправильный диаметр хранилища - -### heatexchanger3.lua ### - -TA4 Heat Exchanger 3=TA4 Теплообменник 3 -TA5 Heat Exchanger 3=TA5 Теплообменник 3 - -### hydrogen.lua ### - -Hydrogen Cylinder Large=Большой цилиндр с водородом -Hydrogen Cylinder Small=Маленький цилиндр с водородом -TA4 Hydrogen=TA4 Водород - -### hyperloop.lua ### -### sensorchest.lua ### -### teleport.lua ### - -not connected=не соединен - -### hyperloop.lua ### -### teleport.lua ### - -Block name=Название блока -Connection name for this block=Имя соединения для этого блока -Connection name of the remote block=Имя соединения для этого удаленного блока -Enter a block name or select an existing one=Введите имя блока или выберите уже существующий -Remote name=Удаленное имя -connected to=соединен к - -### industriallamp1.lua ### - -TA Industrial Lamp 1=TA Промышленный светильник 1 - -### industriallamp2.lua ### - -TA Industrial Lamp 2=TA Промышленный светильник 2 - -### industriallamp3.lua ### - -TA Industrial Lamp 3=TA Промышленный светильник 3 - -### industriallamp4.lua ### - -TA4 LED Industrial Lamp=TA4 Светодиодный промышленный светильник - -### inlet.lua ### - -TA4 Pipe Inlet=TA4 Входная труба -one window maximum=одно окно максимум -wrong diameter (should be 5, 7, or 9)=неправильный диаметр (должен быть 5, 7, или 9) -wrong number of gravel nodes=неправильное количество блоков гравия -wrong number of shell nodes=неправильное количество блоков оболочки - -### inlets.lua ### - -TA4 Collider Cable Input=TA4 Входной кабель коллайдера -TA4 Collider Pipe Input=TA4 Входная труба коллайдера -TA4 Collider Pipe Output=TA4 Выходная труба коллайдера -TA4 Collider Tube Input=TA4 Большая входная труба - -### inverter.lua ### - -Inverter=Инвертор -Power AC=Энергия переменного тока -Power DC=Энергия постоянного тока -TA4 Solar Inverter=TA4 Солнечный инвертор -no solar power=нет солнечной энергии -solar network error=ошибка электрической сети солнечной энергии - -### junctionbox.lua ### - -TA Electric Junction Box=TA Электрическая распределительная коробка - -### lampholder.lua ### - -TA Lamp Holder Acacia=TA Акациевый держатель для лампы -TA Lamp Holder Apple=TA Яблоневый держатель для лампы -TA Lamp Holder Aspen=TA Осиновый держатель для лампы -TA Lamp Holder Copper=TA Медный держатель для лампы -TA Lamp Holder Gold=TA Золотой держатель для лампы -TA Lamp Holder White=TA Белый держатель для лампы - -### laser.lua ### - -Laser beam error!=Ошибка лазерного луча! -TA4 Laser Beam Emitter=TA4 Излучатель лазера -TA4 Laser Beam Receiver=TA4 Приемник лазерного луча -Valid destination positions:=Правильные места назначения: -to=в - -### lib.lua ### - -Block has an@nadditional wrench menu=У блока есть@nдополнительное меню для гаечного ключа - -### lib.lua ### -### sensorchest.lua ### - -connected with=соединен с - -### light_detector.lua ### - -Send signal if light level is above:=Отправить сигнал если уровень света выше: -TA3 Light Detector=TA3 Детектор света - -### lighter.lua ### - -TA1 Lighter=TA1 Заготовка для розжига - -### liquid_lib.lua ### - -Allow public access to the tank=Разрешить публичный доступ к резервуару -Liquid Tank=Резервур для жидкости -To add liquids punch@nthe tank@nwith a liquid container=Чтобы добавить жидкость, ударьте@nрезервуар@nс резервуаром - -### liquid_lib.lua ### -### ta4_chest.lua ### - -keep assignment=сохранить расположение - -### liquid_pipe.lua ### - -TA Junction Pipe=TA Распределительная труба -TA Pipe=TA Труба - -### liquidsampler.lua ### - -Liquid Sampler=Сборщик воды - -### liquidsampler.lua ### -### waterpump.lua ### - -no usable water=нет используемой воды - -### logic_block.lua ### - -'me' has to be used for the own block number.@n='me' должно быть использовано для собственного номера блока.@n -'~@=' means: not equal@n='~@=' означает: не равно -@n is a boolean expression@nwhere input numbers are evaluated.@n=@n<введенное-выражение> это булево выражение@nв котором проверяются выражение с числами. -@n is the block number to which the@ncommand should be sent.@n=@n<вывод> это номер блока в который@nкоманда должна быть отправлена. -@nAll rules are checked with each received@ncommand.=@nВсе правила проверяются у каждой введенной@nкоманды. -@nExamples:@n1234 @=@= on@n1234 @=@= off@n1234 @=@= on and 2345 @=@= off@n2345 ~@= 3456@n=@nПримеры: @n1234 @=@= on@n1234 @=@= off@n1234 on and 2345 @=@= off@n2345 ~@= 3456@n=@n -@nRule:@n @= on/off if is true@n=@nПравило:@n<вывод> @= on/off если <введенное-выражение> истинно=@n -@nThe internal processing time for all@ncommands is 100 ms.=@nВнутреннее время обработки всех@nкоманд это 100 миллисекунд. -@nValid operators:@nand or on off me @=@= ~@= ( )@n=@nКорректные операторы:@nand or on off me @=@= ~@= ()@n -Clear=Очистить -Debug=Отладить -Inputs=Вводы -Outputs=Выводы -Rules=Правила -Send an 'on'/'off' command if the@nexpression becomes true.@n=Отправить 'on'/'off' команды если@nвыражение истинно.@n -Syntax=Синтаксис - -### logic_block.lua ### -### lua_logic.lua ### - -TA3 Logic Block=TA3 Логический блок -Update=Обновить - -### logic_block.lua ### -### sequencer2.lua ### - -Help=Помощь - -### lye.lua ### - -Lye=Щелочь -Lye Barrel=Бочка с щелочью -Lye Canister=Канистра с щелочью - -### magnet.lua ### - -TA4 Collider Detector Magnet=TA4 Детектор магнита коллайдера -TA4 Collider Magnet=TA4 Магнит коллайдера -TA4 Collider Magnet Base=TA4 Основание магнита коллайдера -TA4 Collider Steel Block=TA4 Стальной блок коллайдера -TA5 Fusion Reactor Magnet 1=TA5 Магнит ядерного реактора 1 -TA5 Fusion Reactor Magnet 2=TA5 Магнит ядерного реактора 2 -TA5 Fusion Reactor Magnet Blank=TA5 Пустой магнит ядерного реактора -TA5 Fusion Reactor Magnet Shield=TA5 Щит магнита ядерного реактора - -### mba_detector.lua ### - -TA4 Mapblock Active Detector=TA4 Активный детектор блоков карты - -### meltingpot.lua ### - -Heat=Тепло -Melting Guide=Руководство по плавке -Melting Pot active (heat@==Тигель активный (тепло@== -Melting Pot inactive (heat@==Тигель неактивный (тепло@== -Melting Pot inactive (heat@=0)=Тигель неактивный (тепло@=0) -Menu=Меню -Menu,Recipes=Меню,Рецепты -TA1 Burning=TA1 Горение -TA1 Melting=TA1 Плавление -TA1 Melting Pot=TA1 Тигель - -### meridium.lua ### - -Meridium Axe=Меридиемувый топор -Meridium Pickaxe=Меридиемувая кирка -Meridium Shovel=Меридиемувая лопата -Meridium Sword=Меридиемувый меч - -### mesecons_converter.lua ### - -TA3 Mesecons Converter=TA3 Mesecons конвертер - -### mill.lua ### - -TA1 Mill=TA1 Мельница -TA1 Mill Gear=TA1 Шестеренка Мельницы - -### millboard.lua ### - -TA1 Acacia Millrace Board=TA1 Акациевая доска для мельницы -TA1 Acacia Wood Board=TA1 Акациевая доска -TA1 Apple Millrace Board=TA1 Яблоневая доска для мельницы -TA1 Apple Wood Board=TA1 Яблоневая доска -TA1 Aspen Millrace Board=TA1 Осиновая доска для мельницы -TA1 Aspen Wood Board=TA1 Осиновая доска -TA1 Jungle Millrace Board=TA1 Доска для мельницы из тропического дерева -TA1 Jungle Wood Board=TA1 Доска тропического дерева -TA1 Pine Millrace Board=TA1 Сосновая доска для мельницы -TA1 Pine Wood Board=TA1 Сосновая доска - -### minicell.lua ### - -TA4 Streetlamp Solar Cell=TA4 Солнечная панель для уличного светильника - -### minichest.lua ### - -Test Chest=Тестовый сундук - -### minitank.lua ### - -Test Mini Tank=Тестовый мини резервуар - -### movecontroller.lua ### - -Error: Invalid distance !!=Ошибка: Неправильное расстояние!! -Move distance=Расстояние перемещения -Move distance (A to B)=Расстояние перемещения (из А в Б) -Operational mode=Рабочий режим -Switch to the remote controlled 'move xyz' mode=Переключиться в режим 'move xyz' -TA Rack and Pinion=TA Реечная передача -TA4 Move Controller=TA4 Контроллер движения - -### node_detector.lua ### - -Click on all blocks whose positions should be checked=Нажмите на все блоки позиция которых должна быть проверена -Send signal if nodes have been:=Отправьте сигнал если: -TA3 Node Detector=TA3 Детектор нод -TA4 Node Detector=TA4 Детектор нод -added=добавлено -added or removed=добавлено или удалено -removed=удалено - -### nodes.lua ### - -TechAge Gravel=TechAge Гравий - -### oil.lua ### - -Flowing Oil=Текущая нефть -Oil Source=Источник нефти -TA3 Oil Barrel=TA3 Бочка нефти -TA3 Oil Canister=TA3 Канистра нефти - -### oilfirebox.lua ### - -TA3 Power Station Oil Burner=TA3 Нефтяная горелка для электростанции - -### petroleum.lua ### - -Isobutane Cylinder Large=Большой баллон с изобутаном -Isobutane Cylinder Small=Маленький баллон с изобутаном -Propane Cylinder Large=Большой баллон с пропаном -Propane Cylinder Small=Маленький баллон с пропаном -TA3 Bitumen=TA3 Битум -TA3 Bitumen Barrel=TA3 Бочка с битумом -TA3 Bitumen Canister=TA3 Канистра с битумом -TA3 Fuel Oil=TA3 Мазут -TA3 Fuel Oil Barrel=TA3 Бочка с мазутом -TA3 Fuel Oil Canister=TA3 Канистра с мазутом -TA3 Gasoline=TA3 Бензин -TA3 Gasoline Barrel=TA3 Бочка с бензином -TA3 Gasoline Canister=TA3 Канистра с бензином -TA3 Naphtha=TA3 Лигроин -TA3 Naphtha Barrel=TA3 Бочка с лигроином -TA3 Naphtha Canister=TA3 Канистра с лигроином -TA3 Propane=TA3 Пропан -TA4 Isobutane=TA3 Изобутан - -### pillar.lua ### - -TA4 Pillar=TA4 Колонна - -### pipe_wall_entry.lua ### - -TA3 Pipe Wall Entry=TA3 Входная стена с трубой - -### pipe_wrench.lua ### - -TA3 Drill Pipe Wrench=TA3 Гаечный ключ для сверла для бурения - -### plastic.lua ### - -Plastic Granules=Пластиковые гранулы - -### player_detector.lua ### - -Command to send when player is detected=Команда, которая отправится когда игрок будет замечен -Command to send when player moves away=Команда, которая отправится когда игрок будет двигаться -Radius=Радиус -Search radius=Радиус поиска -TA4 Player Detector=TA4 Детектор игрока - -### powder.lua ### - -Aluminum Powder=Алюминиевый порошок -Clay Powder=Глиняный порошок -Graphite Powder=Графитовый порошок -Iron Powder=Железный порошок -Leave Powder=Порошок из листьев -Needle Powder=Хвойный порошок -Silver Sandstone Powder=Порошок из серебряного песка - -### power2axle.lua ### - -TA3 Electric Motor=TA3 Мотор - -### power_line.lua ### - -TA Power Line=TA Линия электропередач -TA Power Pole=TA Опора ЛЭП -TA Power Pole Top (for up to 6 connections)=TA Верхняя часть опоры ЛЭП (больше 6 соединений) -TA Power Pole Top 2 (for landlines)=TA Верхняя часть опоры ЛЭП (для воздушных линий) - -### power_terminal2.lua ### - -Commands@nhelp . . . print this text@ncls . . . . clear screen@ngen . . print generators@nsto . . print storage systems@ncon1 . . print consumers with power consumption between 1 and 10 ku@ncon2 . . print consumers with power consumption with 10 ku or above@n=Команды@nhelp печатает этот текст@ncls очищает экран@ngen выводит генераторы источников энергии@nsto выводит системы хранения@ncon1 выводит потребителей электроэнергии потребляющих от 1 до 10 кВт@ncon2 выводит потребителей электроэнергии потребляющих 10 кВт или больше@n -Consumer=Потребитель -Network Data=Информация о электрической сети -Number of consumers:=Количество потребителей: -Number of generators:=Количество генераторов: -Number of network nodes:=Количество нод электрической сети: -Number of storage systems:=Количество хранилищ: -TA3 Power Terminal=TA3 Терминал электроэнергии - -### power_terminal2.lua ### -### terminal.lua ### - -Enter=Ввести - -### powerswitch.lua ### - -TA Power Switch=TA Выключатель -TA Power Switch Small=TA Маленький выключатель - -### powerswitchbox.lua ### -### powerswitchbox_legacy.lua ### - -TA Power Switch Box=TA Коробка выключателей - -### programmer.lua ### - -TechAge Programmer (right @= read number, left @= write numbers)=TechAge Программист (ПКМ @= прочитать число, ЛКМ написать числа) -[TechAge Programmer] Error: invalid numbers!=[TechAge Программист] Ошибка: неправильные числа! -[TechAge Programmer] Error: programmer not supported!=[TechAge Программист] Ошибка: программист не поддерживается! -[TechAge Programmer] Unknown node on=[TechAge Программист] Неизвестная нода включена -[TechAge Programmer] foreign or unknown node!=[TechAge Программст] незнакомая или неизвестная нода! -[TechAge Programmer] node programmed!=[TechAge Программист] нода запрограммирована! -[TechAge Programmer] number=[TechAge Программист] номер -[TechAge Programmer] programmer reset=[TechAge Программист] сбросить настройки программиста - -### protection.lua ### - -Allow to dig/place Techage power lines nearby power poles=Разрешить копать/ставить Techage линии электропередач недалеко от опор ЛЭП - -### pump.lua ### - -Number of liquid units that are allowed to be pumped=Количество жидкости которое можно высосать -Number of units=Количество единиц -TA3 Pump=TA3 Насос -TA4 Pump=TA4 Насос - -### pump.lua ### -### ta5_pump.lua ### - -Total flow rate=Общая скорость потока -Total flow rate in liquid units=Общая скорость потока в единицах измерения жидкости - -### pumpjack.lua ### - -Oil Pumpjack=Нефтяной -Oil amount=Количество нефти -Pumpjack=Насос -needs power=Нуждается в электроэнергии -no oil=нет нефти - -### pusher.lua ### - -Number of items=Количество предметов -Number of items that are allowed to be pushed=Количество предметов которое можно вытолкать -Optionally configure@nthe pusher with one item=Опционально настроить@nтолкатель на один предмет -Pusher=Толкатель - -### quarry.lua ### - -Digging depth=Глубина копания -Hole size=Глубина дыры -Quarry=Карьер -Start level=Начальный высота -Start level @= 0@nmeans the same level@nas the quarry is placed=Начальная высота @= 0@nозначает ту же высоту, что имеется у карьера -area is protected=зона защищена -finished=готово -inventory full=инвентарь заполнен - -### reboiler.lua ### - -TA3 Oil Reboiler=TA3 Нефтяной ребойлер - -### recipe_lib.lua ### -### recipeblock.lua ### - -Recipe=Рецепт - -### recipe_lib.lua ### -### ta4_reactor.lua ### - -Catalyst=Катализатор - -### recipeblock.lua ### - -TA4 Recipe Block=TA4 Блок рецепта - -### recipes.lua ### - -Flint and Iron=Кремень и железо -TA1 Iron Ingot=TA1 Железный слиток -[Bucket] Lava can only be placed below sea level!=[Ведро] Лава может быть расположена только ниже уровня моря! - -### recycler.lua ### - -Recycler=Переработчик - -### redstone.lua ### - -Red Stone=Красный камень -Red Stone Block=Блок красного камня -Red Stone Brick=Кирпич из красного камня - -### repeater.lua ### - -TA3 Repeater=TA3 Повторитель - -### rotor.lua ### - -Nacelle is missing=Гондола отсутствует -TA4 Carbon Fiber=TA4 Карбоновое волокно -TA4 Rotor Blade=TA4 Лопасти турбины -TA4 Wind Turbine=TA4 Ветряная турбина -TA4 Wind Turbine Nacelle=TA4 Гондола ветряной турбины отсутствует - -### screwdriver.lua ### - -Block alignment stored!=Расположение блока сохранено! -Techage Screwdriver@n(See: TA3 > Tools)=Techage отвертка@n(Посмотри TA3 > Инструменты) - -### sensorchest.lua ### - -Allow public chest access=Разрешить публичный доступ к сундуку -TA4 Sensor Chest=TA4 Сенсорный сундук - -### sequencer.lua ### - -TA3 Sequencer=TA3 Секвенсор - -### sequencer.lua ### -### sequencer2.lua ### - -stopped=остановлено - -### sequencer2.lua ### - - - 'goto ' (jump to another line)@n= - 'goto <номер>' (перепрыгнуть на другую строчку)@n - - 'nop' (do nothing)@n= - 'nop' (ничего не делать) - - 'send ' (techage command)@n= - 'send <номер ноды> - - 'stop' (stop the execution)@n= - 'stop' (останавливает выражение) - - 1 corresponds to 100 ms@n= - 1 соответствует 100 миллисекундам@n - - 50000 corresponds to 4 game days@n= - 50000 соответствует 4 игровым дням @n -'[] '@n='[<номер>] <команда>'@n - is one of the following:@n=<команда> что-то из следующего: - is a number from 1 to 50000 and is@n=<номер> это число в диапазоне от 1 до 50000 и это@n -@n=@n -Commands=Команды -Cycle time=Время цикла -Example:@n=Пример:@n -If 'yes' a received OFF command won't stop the sequencer=Если 'yes', то полученная OFF команда не остановит секвенсор -Ignore OFF command=Игнорировать команду OFF -Invalid command!=Неправильная команда -Start=Начать -Stop=Остановить -Syntax:@n=Синтаксис:@n -TA4 Sequencer=TA4 Секвенсор -Timer cycle time (default: 100 ms)=Таймер времени цикла (по умолчанию: 100 миллисекунд) -running=работает -the timeslot when the command is executed.@n=Временной интервал в течении которого выполняется команда.@n - -### sequencer2.lua ### -### submenu.lua ### - -Cancel=Отменить - -### shell.lua ### - -TA5 Fusion Reactor Nucleus=TA5 Ядро термоядерного реактора -TA5 Fusion Reactor Shell=TA5 Оболочка термоядерного реактора - -### signallamp.lua ### - -TA4 Wind Turbine Signal Lamp=TA4 Сигнальная лампа ветряной турбины -TechAge Color Lamp=TechAge Цветная лампа -TechAge Color Lamp 2=TechAge Цветная лампа 2 - -### signallamp_2x.lua ### - -TA4 2x Signal Lamp=TA4 2x Сигнальная лампа - -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label for the lamp=Ярлык для лампы - -### signallamp_4x.lua ### - -TA4 4x Signal Lamp=TA4 4x Сигнальная лампа - -### silicon.lua ### - -TA4 Silicon Wafer=TA4 Кремниевая пластина - -### silo.lua ### - -TA3 Silo=TA3 Хранилище сыпучих материалов -TA4 Silo=TA4 Хранилище сыпучих материалов - -### simplelamp.lua ### - -TA Lamp=TA Лампа - -### sluice.lua ### - -TA1 Sluice Gate=TA1 Ворота шлюза -TA1 Sluice Handle=TA1 Ручка для шлюза - -### solarcell.lua ### - -TA4 Solar Carrier Module=TA4 Держатель солнечной панели -TA4 Solar Carrier Module B=TA4 Держатель солнечной панели B -TA4 Solar Carrier Module T=TA4 Держатель солнечной панели T -TA4 Solar Module=TA4 Солнечная панель -light=свет - -### solarcell.lua ### -### source.lua ### - -power=энергия - -### soundblock.lua ### - -Play=играть -TA3 Sound Block=TA3 Нотный блок - -### source.lua ### - -Axle Power Source=Источник механической энергии -Ele Power Source=Источник электроэнергии -Power Source=Источник энергии -Test Generator=Тестовый генератор - -### steam_pipe.lua ### - -TA2 Steam Pipe=TA2 Труба для пара - -### steelmat.lua ### - -TechAge Steel Mat=Techage Сталь - -### storage.lua ### - -Test Storage=Тестовое хранилище - -### streetlamp.lua ### - -TA Street Lamp=TA Уличная лампа - -### streetlamp2.lua ### - -TA4 LED Street Lamp=TA4 Уличная светодиодная лампа -TA4 LED Street Lamp Arm=TA4 Кронштейн для уличной светодиодной лампы -TA4 LED Street Lamp Pole=TA4 Столб для уличной светодиодной лампы - -### submenu.lua ### - -Note: You can't change any values while the block is running!=Примечание: Вы не можете изменять какие-либо числа пока блок работает! -Refresh=Обновить - -### ta1_axle.lua ### - -TA1 Axle=TA1 Вал -TA1 Axle Bearing=TA1 Подшипник с валом - -### ta2_clutch.lua ### - -TA2 Clutch=TA2 Сцепление - -### ta2_weight_chest.lua ### - -TA2 Weight Chest=TA2 Сундук с грузом - -### ta2_winch.lua ### - -TA2 Winch=TA2 Лебедка - -### ta4_cable.lua ### - -TA4 Low Power Box=TA4 Распределительная коробка низкого напряжения -TA4 Low Power Cable=TA4 Кабель низкого напряжения - -### ta4_cable_wall_entry.lua ### - -TA4 Cable Wall Entry=TA4 Входная стена с кабелем - -### ta4_chest.lua ### - -Empty the slots always @nfrom right to left=Опустошайте слоты@nсправа налево -Never completely empty the slots@nwith the pusher to keep the item assignment=Никогда полностью не опустошайте слоты с помощью толкателя, чтобы не сбить расположение предметов -Size=Размер -TA4 8x2000 Chest=TA4 8x2000 Сундук -Unlock=Разблокировать -Unlock connected chest@nif all slots are below 2000=Разблокировать соединенный сундук@nесли во всех слотах меньше 2000 -right to left=справа налево - -### ta4_doser.lua ### - -Doser=Дозатор -TA4 Doser=TA4 Дозатор -catalyst missing=отсутствует катализатор -reactor defect=дефект реактора -reactor defect or no power=дефект реактора или нет энергии -reactor has no power=у реактора нет энергии -wrong catalyst=неправильный катализатор - -### ta4_doser.lua ### -### ta4_reactor.lua ### - -TA4 Reactor=TA4 Реактор - -### ta4_injector.lua ### - -Configure up to 8 items @nto be pushed by the injector=Выберите 8 предметов которые должен толкать инжектор -Injector=Инжектор -Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration=Переключитесь в режим извлечения,@nчто бы извлекать предметы из инвентаря в@nсоответствии настройками инжектора -pull mode=режим извлечения - -### ta4_liquid_filter.lua ### - -TA4 Liquid Filter Filler=TA4 Наполнитель жидкостных фильтров -TA4 Liquid Filter Sink=TA4 Жидкостный фильтр с формой раковины - -### ta4_reactor.lua ### - -TA4 Reactor Filler Pipe=TA4 Труба-наполнитель реактора - -### ta4_stand.lua ### - -TA4 Reactor Base=TA4 Основание реактора -TA4 Reactor Stand=TA4 Стенд для реактора -off=выключить -on=включить - -### ta4_stand.lua ### -### waterpump.lua ### - -no power=нет энергии - -### ta5_chest.lua ### - -TA5 Hyperloop Chest=TA5 Hyperloop сундук - -### ta5_pump.lua ### - -TA5 Pump=TA5 Насос - -### ta5_tank.lua ### - -TA5 Hyperloop Tank=TA5 Hyperloop Резервуар - -### tank.lua ### - -Oil Tank=Нефтяной резервуар -TA3 Tank=TA3 Резервуар -TA4 Tank=TA4 Резервуар - -### tank_cart.lua ### - -TA Tank Cart=TA Вагонетка с резервуаром - -### teleport.lua ### - -Connected=Соединен -Connection status=Статус соединения -Distance > @1 blocks=Расстояние > @1 блоков -Ex-points missing (@1 < @2)=Очки опыта отсутствуют (@1 < @2) -Status=Статус -server not connected=сервер не соединен - -### teleport_pipe.lua ### - -TA5 Teleport Block Liquids=TA5 Блок для телепортирования жидкостей - -### teleport_pipe.lua ### -### teleport_tube.lua ### - -Remote block error=Ошибка удаленного блока - -### teleport_tube.lua ### - -TA5 Teleport Block Items=TA5 Блок для телепортирования предметов - -### terminal.lua ### - -Syntax error, try help=Синтаксическая ошибка, попробуйте написать help -TA3 Terminal=TA3 Терминал -TA4 Terminal=TA4 Терминал -commands like: help=команды как: help - -### timer.lua ### - -TA3 Timer=TA3 Таймер - -### tiny_generator.lua ### - -TA3 Tiny Power Generator=TA3 Небольшой генератор энергии -Tiny Generator=Небольшой генератор -no fuel=нет топлива - -### tower.lua ### - -TA3 Derrick=TA3 Буровая вышка -TA3 Drill Pipe=TA3 Буровая труба -TA4 Derrick=TA4 Буровая вышка -[TA] Derrick is being built!=[TA] Буровая вышка построена! -[TA] Derrick is being removed!=[TA] Буровая вышка удалена! - -### transformer.lua ### - -TA4 Isolation Transformer=TA4 Изолирующий трансформатор - -### trowel.lua ### - -TechAge Trowel=TechAge Мастерок - -### tube_wall_entry.lua ### - -Tube Wall Entry=Входная стена с трубой - -### tubes.lua ### - -TechAge Tube=TechAge Труба - -### tubes_ta4.lua ### - -TA4 Tube=TA4 Труба - -### turbine.lua ### - -TA3 Turbine=TA3 Турбина -TA4 Turbine=TA4 Турбина -TA5 Turbine=TA5 Турбина - -### turncontroller.lua ### - -Click on all blocks that shall be turned=Нажмите на все блоки которые должны быть повернуты -TA4 Turn Controller=TA4 Контроллер движения -Turn left=Повернуть налево -Turn right=Повернуть направо - -### usmium.lua ### - -Usmium Nuggets=Усмиевые самородки -Usmium Powder=Усмиевый порошок - -### vacuumtube.lua ### - -TA4 Vacuum Tube=TA4 Вакуумная труба - -### valve.lua ### - -TA Valve=TA Вентиль -TA3 Valve=TA3 Вентиль - -### waterinlet.lua ### - -Error: No natural water!=Ошибка: Нет природной воды! -Error: No water available!=Ошибка: Нет доступной воды! -Error: Not on sea level!=Ошибка: Не на уровне моря! -Operational=Готов к работе -TA4 Water Inlet=TA4 Водозабор - -### watermill.lua ### - -TA1 Watermill=TA1 Водяное колесо - -### waterpump.lua ### - -TA4 Water Pump=TA4 Водяной насос -Water Pump=Водяной насос - -### windturbine_lib.lua ### - -Here is not enough water (41x41 m)!=Здесь недостаточно воды (41x41 м)! -Here is not enough wind@n(A free air space of 41x41x21 m is necessary)!=Здесь недостаточно ветра@n(необходимо 41x41x21 м свободного воздушного пространства)! -The next wind turbines is too close!=Следующая ветряная турбина слишком близко! -This is a=Это -This is no ocean water!=Это не океанская вода! -This is not the surface of the ocean!=Это не поверхность океана! -[TA4 Wind Turbine]=[TA4 Ветряная турбина] -biome and no ocean!=биом и не океан! -is a suitable place for a wind turbine!=подходящее место для ветряной турбины! - -### worker.lua ### - -Build detector=Детектор строительства -Item list=Список предметов -Remove detector=Детектор удаления -TA4 Collider Detector Worker=TA4 Построитель детектора коллайдера -[TA4] Detector is being built!=[TA4] Детектор был построен! -[TA4] Detector is being removed!=[TA4] Детектор был удален! diff --git a/techage/locale/template.txt b/techage/locale/template.txt deleted file mode 100644 index 2b6be2c..0000000 --- a/techage/locale/template.txt +++ /dev/null @@ -1,1579 +0,0 @@ -# textdomain: techage - - - -### akkubox.lua ### - -TA3 Accu Box= - -### aluminium.lua ### - -Aluminum= -Gibbsite Powder= -Red Mud= -Red Mud Barrel= -Red Mud Canister= - -### assemble.lua ### -### firebox_lib.lua ### - -[TA] Area is protected!= -[TA] Not enough space!= - -### assembly_tool.lua ### - -TechAge Assembly Tool= - -### autocrafter.lua ### - -Autocrafter= - -### axle2power.lua ### - -TA2 Power Generator= - -### baborium.lua ### - -Baborium Ingot= -Baborium Lump= -Baborium Ore= - -### barrel.lua ### - -Gas Cylinder Large= -Gas Cylinder Small= -River Water Barrel= -TA Empty Barrel= -TA3 Canister= -Water= -Water Barrel= -empty= - -### basalt.lua ### - -Basalt Cobble= -Basalt Glass= -Basalt Glass 2= -Basalt Glass Thin= -Basalt Glass Thin 2= -Basalt Glass Thin XL= -Basalt Glass Thin XL 2= -Basalt Gravel= -Basalt Stone= -Basalt Stone Block= -Basalt Stone Brick= -Sieved Basalt Gravel= - -### battery.lua ### - -Battery= -Coal Equivalents= -Digtron Battery= - -### battery.lua ### -### storage.lua ### - -Load= - -### bauxit.lua ### - -Bauxite Cobblestone= -Bauxite Gravel= -Bauxite Powder= -Bauxite Stone= - -### blackhole.lua ### - -TechAge Black Hole= -TechAge Black Hole (let items and liquids disappear)= - -### boiler.lua ### - -TA2 Boiler Base= -TA2 Boiler Top= - -### boiler_base.lua ### - -TA3 Boiler Base= - -### boiler_lib.lua ### - -To add water punch@nthe boiler@nwith a water bucket= -Water Boiler= - -### boiler_lib.lua ### -### heatexchanger2.lua ### - -water temperature= - -### boiler_top.lua ### - -TA3 Boiler Top= - -### booster.lua ### - -TA3 Booster= - -### button.lua ### - -Access:= -Button or switch= -Change the block name (infotext)= -Command to be sent= -Infotext= -TA3 Button/Switch= -TA4 Button/Switch= - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### - -Access= -Button protection= -Type= - -### button.lua ### -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### gaze_sensor.lua ### -### player_detector.lua ### - -Command= -Number= - -### button.lua ### -### cart_detector.lua ### -### command_converter.lua ### -### detector.lua ### -### flipflop.lua ### -### light_detector.lua ### -### lua_logic.lua ### -### mesecons_converter.lua ### -### node_detector.lua ### -### player_detector.lua ### -### repeater.lua ### - -Insert destination node number(s)= - -### button.lua ### -### chest.lua ### -### command_converter.lua ### -### detector.lua ### -### doorcontroller.lua ### -### flipflop.lua ### -### mesecons_converter.lua ### -### repeater.lua ### -### sequencer2.lua ### -### submenu.lua ### - -Save= - -### button.lua ### -### gaze_sensor.lua ### - -Destination block number(s)= - -### button_2x.lua ### - -TA4 2x Button= - -### button_2x.lua ### -### button_4x.lua ### - -Command to be sent (ignored for switches)= -Label for the button= -Momentary button or on/off switch= - -### button_2x.lua ### -### button_4x.lua ### -### charge_detector.lua ### -### player_detector.lua ### - -Destination block number= - -### button_2x.lua ### -### button_4x.lua ### -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label= - -### button_4x.lua ### - -TA4 4x Button= - -### cart_detector.lua ### - -TA3 Cart Detector= - -### cart_detector.lua ### -### light_detector.lua ### -### node_detector.lua ### - -accept= - -### cart_detector.lua ### -### player_detector.lua ### - -TA3 Player Detector= - -### ceilinglamp.lua ### - -TA Ceiling Lamp= - -### cement.lua ### - -Cement Block= -Cement Powder= - -### ceramic.lua ### - -TA4 Ceramic Material= -TA4 Furnace Ceramic= -TA4 Round Ceramic= -TA5 Ceramic Turbine= - -### charcoalpile.lua ### - -Dirt with Ash= -TA1 Charcoal= - -### charge_detector.lua ### - -Command to send when the energy storage charge@nlevel falls below the specified switch point= -Command to send when the energy storage charge@nlevel rises above the specified switch point= -Storage charge level switch point= -Switch point= -TA4 Energy Storage Charge Detector= - -### chest.lua ### - -Allow public access to the chest= -Inventory,Pre-Assignment,Config= -Node label:= -TA2 Protected Chest= -TA3 Protected Chest= -TA4 Protected Chest= - -### chest_cart.lua ### - -TA Chest Cart= - -### coalburner.lua ### - -Ash= - -### collector.lua ### - -Node number to send the events to= -Node numbers to read the states from= -Send an event if state is equal or larger than= -TA4 State Collector= - -### command_converter.lua ### - -Receive= -Send delay (s)= -Sent command= -TA3 Command Converter= - -### concentrator.lua ### - -TA4 Tube Concentrator= -Tube Concentrator= - -### controller.lua ### - -Cooling failed= -Magnet detection error@n(@1% found / 100% expected)= -Nucleus detection error= -Plasma ring shape error= -Shell shape error@n(@1% found / 100% expected)= -TA5 Fusion Reactor Controller= - -### controller.lua ### -### heatexchanger2.lua ### - -No power= - -### cooking.lua ### - -TA3 Melting= - -### cooler.lua ### - -TA3 Cooler= -TA4 Collider Cooler= - -### counting.lua ### - -Your current value is= -[techage] The limit for 'number of commands per minute' has been exceeded.= -is allowed= -is allowed. Current value is= -per minute= - -### cylinder.lua ### - -TA2 Cylinder= - -### detector.lua ### - -Counts down the number of items passed through@nand only triggers an 'on' command when it reaches zero.= -Current countdown= -Current countdown value.= -TA4 Collider Detector= -TA4 Collider Detector Core= -TA4 Detector= - -### detector.lua ### -### electricmeter.lua ### - -Countdown= - -### detector.lua ### -### logic_block.lua ### -### tele.lua ### - -Blocking Time= - -### detector.lua ### -### tele.lua ### - -Configured Items= -Items which generate an 'on' command.@nIf empty, all passed items generate an 'on' command.= -On Time= -TA3 Detector= -The time after the 'off' command@nuntil the next 'on' command is accepted.= -The time between the 'on' and 'off' commands.= - -### display.lua ### - -Display no: = -TA4 Display= -TA4 Display XL= - -### distiller.lua ### - -TA3 Distillation Tower 1= -TA3 Distillation Tower 2= -TA3 Distillation Tower 3= -TA3 Distillation Tower 4= -TA3 Distillation Tower Base= - -### distributor.lua ### - -Block configured items for open ports= -Distributor= -High Performance Distributor= -Input= -blocking mode= - -### doorblock.lua ### - -TechAge Door Block= - -### doorcontroller.lua ### - -Insert door/gate block number(s)= -TA3 Door Controller= - -### doorcontroller2.lua ### - -Blocks exchanged= -Blocks reset= -Click on all the blocks that are part of the door/gate= -Ctrl,Inv= -Exchange= -TA3 Door Controller II= -with door sound= - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### node_detector.lua ### -### turncontroller.lua ### - -Done= -Record= -block positions are stored.= - -### doorcontroller2.lua ### -### flycontroller.lua ### -### movecontroller.lua ### -### turncontroller.lua ### - -Recording...= - -### doorcontroller2.lua ### -### movecontroller.lua ### - -Reset= - -### drillbox.lua ### - -Build derrick= -Depth= -Drill Bit= -Drill area is protected= -Drill bits missing= -Oil Drill Box= -Remove derrick= -item output blocked= - -### drive_axle.lua ### - -TA2 Drive Axle= - -### electric_cable.lua ### - -TA Electric Cable= - -### electricmeter.lua ### - -Amount of power to be provided before the device turns off= -Consumption= -Power countdown= -TA4 Electric Meter= - -### electricmeter.lua ### -### formspecs.lua ### -### transformer.lua ### - -Power= - -### electricmeter.lua ### -### transformer.lua ### - -Max. power= -Maximum power passed through= - -### electrolyzer.lua ### - -Configurable value@nfor the current limit= -Current limitation= -Electrolyzer= -If the charge of the storage@nsystem falls below the configured value,@nthe block switches off= -Maximum possible@ncurrent consumption= -Maximum power consumption [ku]= -Storage full= -TA4 Electrolyzer= -Turnoff point= -Turnoff point reached= - -### electrolyzer.lua ### -### fuelcell.lua ### -### tiny_generator.lua ### - -Electricity= - -### electronic.lua ### - -TA3 Vacuum Tube= -TA4 LEDs= -TA4 RAM Chip= -TA4 WLAN Chip= -TA5 AI Chip= -TA5 AI Chip II= -WLAN Chip= - -### electronic_fab.lua ### - -Electronic Fab= -TA2 Ele Fab= -TA3 Ele Fab= -TA4 Ele Fab= - -### end_wrench.lua ### - -Biome= -Node owner= -Position= -Position temperature= -Pump connected to no/empty tank(s).= -Pump connected to tank(s) with: @1= -TechAge Info Tool (use @= read status info)= - -### end_wrench.lua ### -### meltingpot.lua ### - -Time= - -### epoxy.lua ### - -Epoxide Resin= -Epoxide Resin Barrel= -Epoxide Resin Canister= - -### explore.lua ### - -Oil= -TA3 Oil Explorer= -TA3 Oil Storage= -depth= - -### filler.lua ### - -Liquid Filler= -TA Liquid Filler= - -### firebox.lua ### - -TA2 Firebox= -TA3 Coal Power Station Firebox= -TA3 Furnace Oil Burner= -TA3 Power Station Firebox= - -### firebox_lib.lua ### - -Firebox= - -### flipflop.lua ### - -TA3 Flip-Flop= - -### fly_lib.lua ### - -Destination position is protected= -Error: Max. length of the flight route exceeded by @1 blocks !!= -No valid destination position= -No valid node at the start position= -No valid start position= -Running= -Start position is protected= -Stopped= - -### fly_lib.lua ### -### flycontroller.lua ### - -Error: Invalid path !!= - -### flycontroller.lua ### - -Error: Recording is missing !!= -Flight route (A to B)= -Move a player without moving blocks= -See chat output= -TA5 Fly Controller= -Teleport mode= -Test= -[TA4 Fly Controller] Invalid path!= -[TA4 Fly Controller] Recording is missing!= - -### flycontroller.lua ### -### logic_block.lua ### -### lua_logic.lua ### -### movecontroller.lua ### - -Store= - -### flycontroller.lua ### -### movecontroller.lua ### - -Click on all blocks that shall be moved= -Maximum Speed= -Maximum speed for moving blocks= -Move= -Move A-B= -Move B-A= -Move block height= -Object offset= -Stored= -Value in the range of 0.0 to 1.0= -Y-offset for non-player objects like vehicles (-0.5 to 0.5)= - -### flywheel.lua ### - -Flywheel= -TA2 Flywheel= - -### forceload.lua ### - -Area already loaded or max. number of Forceload Blocks reached!= -Area from= -Area to= -Block at pos= -List of your Forceload Blocks:= -Punch the block to make the area visible.= -Show all forceload blocks in a 64x64x64 range= -Techage Forceload Block= -Techage Forceload Tile= -loaded= - -### formspecs.lua ### - -Block has a wrench menu= -Charge termination= -Current output [ku]= -Maximum output [ku]= -Range in which the generator reduces its power= -The current power the generator provides= -The maximum power the generator can provide= - -### formspecs.lua ### -### power_terminal2.lua ### - -Charging= - -### formspecs.lua ### -### power_terminal2.lua ### -### storage.lua ### -### transformer.lua ### - -Storage= - -### fuel_lib.lua ### - -Fuel Menu= -To add fuel punch@nthis block@nwith a fuel container= - -### fuelcell.lua ### - -Fuel Cell= -TA4 Fuel Cell= -no hydrogen= - -### fuelcellstack.lua ### - -TA4 Fuel Cell Stack= - -### furnace_top.lua ### - -Furnace Top= -Outp= -no fuel or no power= - -### gas_pipe.lua ### - -TA5 Junction Pipe= -TA5 Pipe= - -### gateblock.lua ### - -TechAge Gate Block= - -### gaze_sensor.lua ### - -Command to send when sensor is no longer viewed= -Command to send when sensor is viewed= -Input the player name(s) separated by blanks.@nIf empty, only the owner is accepted.= -Player Names= -TA4 Gaze Sensor= - -### gearbox.lua ### - -TA2 Gearbox= - -### generator.lua ### - -TA3 Generator= -TA4 Generator= -TA5 Generator= -no steam= - -### generator.lua ### -### power_terminal2.lua ### - -Generator= - -### gravelrinser.lua ### - -Gravel Rinser= -Rinsing= - -### gravelsieve.lua ### - -Compressed Gravel= -Gravel Sieve= -Sieved Gravel= -TA1 Gravel Sieve= -TA2 Gravel Sieve= -TA3 Gravel Sieve= -TA4 Gravel Sieve= - -### grinder.lua ### - -Grinder= -Grinding= -Milling= -TA1 Mill Base= - -### growlight.lua ### - -TA4 LED Grow Light= - -### hammer.lua ### - -TA1 Bronze Hammer (smash stone to gravel)= -TA1 Diamond Hammer (smash stone to gravel)= -TA1 Meridium Hammer (smash stone to gravel)= -TA1 Mese Hammer (smash stone to gravel)= -TA1 Steel Hammer (smash stone to gravel)= -TA1 Stone Hammer (smash stone to gravel)= - -### heater.lua ### - -TA4 Furnace Heater= - -### heatexchanger1.lua ### - -TA4 Heat Exchanger 1= -TA5 Heat Exchanger 1= - -### heatexchanger2.lua ### - - Error!= -Blue pipe connection error@n(@1 found / @2 expected)= -Blue pipe coolant missing@n(@1 found / @2 expected)= -Cooler error= -Green pipe connection error@n(@1 found / @2 expected)= -Green pipe coolant missing@n(@1 found / @2 expected)= -Power network connection error= -TA4 Heat Exchanger= -TA4 Heat Exchanger 2= -TA5 Heat Exchanger 2= -Turbine error= -did you check the plan?= -inlet/pipe error= -wrong storage diameter= - -### heatexchanger3.lua ### - -TA4 Heat Exchanger 3= -TA5 Heat Exchanger 3= - -### hydrogen.lua ### - -Hydrogen Cylinder Large= -Hydrogen Cylinder Small= -TA4 Hydrogen= - -### hyperloop.lua ### -### sensorchest.lua ### -### teleport.lua ### - -not connected= - -### hyperloop.lua ### -### teleport.lua ### - -Block name= -Connection name for this block= -Connection name of the remote block= -Enter a block name or select an existing one= -Remote name= -connected to= - -### industriallamp1.lua ### - -TA Industrial Lamp 1= - -### industriallamp2.lua ### - -TA Industrial Lamp 2= - -### industriallamp3.lua ### - -TA Industrial Lamp 3= - -### industriallamp4.lua ### - -TA4 LED Industrial Lamp= - -### inlet.lua ### - -TA4 Pipe Inlet= -one window maximum= -wrong diameter (should be 5, 7, or 9)= -wrong number of gravel nodes= -wrong number of shell nodes= - -### inlets.lua ### - -TA4 Collider Cable Input= -TA4 Collider Pipe Input= -TA4 Collider Pipe Output= -TA4 Collider Tube Input= - -### inverter.lua ### - -Inverter= -Power AC= -Power DC= -TA4 Solar Inverter= -no solar power= -solar network error= - -### junctionbox.lua ### - -TA Electric Junction Box= - -### lampholder.lua ### - -TA Lamp Holder Acacia= -TA Lamp Holder Apple= -TA Lamp Holder Aspen= -TA Lamp Holder Copper= -TA Lamp Holder Gold= -TA Lamp Holder White= - -### laser.lua ### - -Laser beam error!= -TA4 Laser Beam Emitter= -TA4 Laser Beam Receiver= -Valid destination positions:= -to= - -### lib.lua ### - -Block has an@nadditional wrench menu= - -### lib.lua ### -### sensorchest.lua ### - -connected with= - -### light_detector.lua ### - -Send signal if light level is above:= -TA3 Light Detector= - -### lighter.lua ### - -TA1 Lighter= - -### liquid_lib.lua ### - -Allow public access to the tank= -Liquid Tank= -To add liquids punch@nthe tank@nwith a liquid container= - -### liquid_lib.lua ### -### ta4_chest.lua ### - -keep assignment= - -### liquid_pipe.lua ### - -TA Junction Pipe= -TA Pipe= - -### liquidsampler.lua ### - -Liquid Sampler= - -### liquidsampler.lua ### -### waterpump.lua ### - -no usable water= - -### logic_block.lua ### - -'me' has to be used for the own block number.@n= -'~@=' means: not equal@n= -@n is a boolean expression@nwhere input numbers are evaluated.@n= -@n is the block number to which the@ncommand should be sent.@n= -@nAll rules are checked with each received@ncommand.= -@nExamples:@n1234 @=@= on@n1234 @=@= off@n1234 @=@= on and 2345 @=@= off@n2345 ~@= 3456@n= -@nRule:@n @= on/off if is true@n= -@nThe internal processing time for all@ncommands is 100 ms.= -@nValid operators:@nand or on off me @=@= ~@= ( )@n= -Clear= -Debug= -Inputs= -Outputs= -Rules= -Send an 'on'/'off' command if the@nexpression becomes true.@n= -Syntax= - -### logic_block.lua ### -### lua_logic.lua ### - -TA3 Logic Block= -Update= - -### logic_block.lua ### -### sequencer2.lua ### - -Help= - -### lye.lua ### - -Lye= -Lye Barrel= -Lye Canister= - -### magnet.lua ### - -TA4 Collider Detector Magnet= -TA4 Collider Magnet= -TA4 Collider Magnet Base= -TA4 Collider Steel Block= -TA5 Fusion Reactor Magnet 1= -TA5 Fusion Reactor Magnet 2= -TA5 Fusion Reactor Magnet Blank= -TA5 Fusion Reactor Magnet Shield= - -### mba_detector.lua ### - -TA4 Mapblock Active Detector= - -### meltingpot.lua ### - -Heat= -Melting Guide= -Melting Pot active (heat@== -Melting Pot inactive (heat@== -Melting Pot inactive (heat@=0)= -Menu= -Menu,Recipes= -TA1 Burning= -TA1 Melting= -TA1 Melting Pot= - -### meridium.lua ### - -Meridium Axe= -Meridium Pickaxe= -Meridium Shovel= -Meridium Sword= - -### mesecons_converter.lua ### - -TA3 Mesecons Converter= - -### mill.lua ### - -TA1 Mill= -TA1 Mill Gear= - -### millboard.lua ### - -TA1 Acacia Millrace Board= -TA1 Acacia Wood Board= -TA1 Apple Millrace Board= -TA1 Apple Wood Board= -TA1 Aspen Millrace Board= -TA1 Aspen Wood Board= -TA1 Jungle Millrace Board= -TA1 Jungle Wood Board= -TA1 Pine Millrace Board= -TA1 Pine Wood Board= - -### minicell.lua ### - -TA4 Streetlamp Solar Cell= - -### minichest.lua ### - -Test Chest= - -### minitank.lua ### - -Test Mini Tank= - -### movecontroller.lua ### - -Error: Invalid distance !!= -Move distance= -Move distance (A to B)= -Operational mode= -Switch to the remote controlled 'move xyz' mode= -TA Rack and Pinion= -TA4 Move Controller= - -### node_detector.lua ### - -Click on all blocks whose positions should be checked= -Send signal if nodes have been:= -TA3 Node Detector= -TA4 Node Detector= -added= -added or removed= -removed= - -### nodes.lua ### - -TechAge Gravel= - -### oil.lua ### - -Flowing Oil= -Oil Source= -TA3 Oil Barrel= -TA3 Oil Canister= - -### oilfirebox.lua ### - -TA3 Power Station Oil Burner= - -### petroleum.lua ### - -Isobutane Cylinder Large= -Isobutane Cylinder Small= -Propane Cylinder Large= -Propane Cylinder Small= -TA3 Bitumen= -TA3 Bitumen Barrel= -TA3 Bitumen Canister= -TA3 Fuel Oil= -TA3 Fuel Oil Barrel= -TA3 Fuel Oil Canister= -TA3 Gasoline= -TA3 Gasoline Barrel= -TA3 Gasoline Canister= -TA3 Naphtha= -TA3 Naphtha Barrel= -TA3 Naphtha Canister= -TA3 Propane= -TA4 Isobutane= - -### pillar.lua ### - -TA4 Pillar= - -### pipe_wall_entry.lua ### - -TA3 Pipe Wall Entry= - -### pipe_wrench.lua ### - -TA3 Drill Pipe Wrench= - -### plastic.lua ### - -Plastic Granules= - -### player_detector.lua ### - -Command to send when player is detected= -Command to send when player moves away= -Radius= -Search radius= -TA4 Player Detector= - -### powder.lua ### - -Aluminum Powder= -Clay Powder= -Graphite Powder= -Iron Powder= -Leave Powder= -Needle Powder= -Silver Sandstone Powder= - -### power2axle.lua ### - -TA3 Electric Motor= - -### power_line.lua ### - -TA Power Line= -TA Power Pole= -TA Power Pole Top (for up to 6 connections)= -TA Power Pole Top 2 (for landlines)= - -### power_terminal2.lua ### - -Commands@nhelp . . . print this text@ncls . . . . clear screen@ngen . . print generators@nsto . . print storage systems@ncon1 . . print consumers with power consumption between 1 and 10 ku@ncon2 . . print consumers with power consumption with 10 ku or above@n= -Consumer= -Network Data= -Number of consumers:= -Number of generators:= -Number of network nodes:= -Number of storage systems:= -TA3 Power Terminal= - -### power_terminal2.lua ### -### terminal.lua ### - -Enter= - -### powerswitch.lua ### - -TA Power Switch= -TA Power Switch Small= - -### powerswitchbox.lua ### -### powerswitchbox_legacy.lua ### - -TA Power Switch Box= - -### programmer.lua ### - -TechAge Programmer (right @= read number, left @= write numbers)= -[TechAge Programmer] Error: invalid numbers!= -[TechAge Programmer] Error: programmer not supported!= -[TechAge Programmer] Unknown node on= -[TechAge Programmer] foreign or unknown node!= -[TechAge Programmer] node programmed!= -[TechAge Programmer] number= -[TechAge Programmer] programmer reset= - -### protection.lua ### - -Allow to dig/place Techage power lines nearby power poles= - -### pump.lua ### - -Number of liquid units that are allowed to be pumped= -Number of units= -TA3 Pump= -TA4 Pump= - -### pump.lua ### -### ta5_pump.lua ### - -Total flow rate= -Total flow rate in liquid units= - -### pumpjack.lua ### - -Oil Pumpjack= -Oil amount= -Pumpjack= -needs power= -no oil= - -### pusher.lua ### - -Number of items= -Number of items that are allowed to be pushed= -Optionally configure@nthe pusher with one item= -Pusher= - -### quarry.lua ### - -Digging depth= -Hole size= -Quarry= -Start level= -Start level @= 0@nmeans the same level@nas the quarry is placed= -area is protected= -finished= -inventory full= - -### reboiler.lua ### - -TA3 Oil Reboiler= - -### recipe_lib.lua ### -### recipeblock.lua ### - -Recipe= - -### recipe_lib.lua ### -### ta4_reactor.lua ### - -Catalyst= - -### recipeblock.lua ### - -TA4 Recipe Block= - -### recipes.lua ### - -Flint and Iron= -TA1 Iron Ingot= -[Bucket] Lava can only be placed below sea level!= - -### recycler.lua ### - -Recycler= - -### redstone.lua ### - -Red Stone= -Red Stone Block= -Red Stone Brick= - -### repeater.lua ### - -TA3 Repeater= - -### rotor.lua ### - -Nacelle is missing= -TA4 Carbon Fiber= -TA4 Rotor Blade= -TA4 Wind Turbine= -TA4 Wind Turbine Nacelle= - -### screwdriver.lua ### - -Block alignment stored!= -Techage Screwdriver@n(See: TA3 > Tools)= - -### sensorchest.lua ### - -Allow public chest access= -TA4 Sensor Chest= - -### sequencer.lua ### - -TA3 Sequencer= - -### sequencer.lua ### -### sequencer2.lua ### - -stopped= - -### sequencer2.lua ### - - - 'goto ' (jump to another line)@n= - - 'nop' (do nothing)@n= - - 'send ' (techage command)@n= - - 'stop' (stop the execution)@n= - - 1 corresponds to 100 ms@n= - - 50000 corresponds to 4 game days@n= -'[] '@n= - is one of the following:@n= - is a number from 1 to 50000 and is@n= -@n= -Commands= -Cycle time= -Example:@n= -If 'yes' a received OFF command won't stop the sequencer= -Ignore OFF command= -Invalid command!= -Start= -Stop= -Syntax:@n= -TA4 Sequencer= -Timer cycle time (default: 100 ms)= -running= -the timeslot when the command is executed.@n= - -### sequencer2.lua ### -### submenu.lua ### - -Cancel= - -### shell.lua ### - -TA5 Fusion Reactor Nucleus= -TA5 Fusion Reactor Shell= - -### signallamp.lua ### - -TA4 Wind Turbine Signal Lamp= -TechAge Color Lamp= -TechAge Color Lamp 2= - -### signallamp_2x.lua ### - -TA4 2x Signal Lamp= - -### signallamp_2x.lua ### -### signallamp_4x.lua ### - -Label for the lamp= - -### signallamp_4x.lua ### - -TA4 4x Signal Lamp= - -### silicon.lua ### - -TA4 Silicon Wafer= - -### silo.lua ### - -TA3 Silo= -TA4 Silo= - -### simplelamp.lua ### - -TA Lamp= - -### sluice.lua ### - -TA1 Sluice Gate= -TA1 Sluice Handle= - -### solarcell.lua ### - -TA4 Solar Carrier Module= -TA4 Solar Carrier Module B= -TA4 Solar Carrier Module T= -TA4 Solar Module= -light= - -### solarcell.lua ### -### source.lua ### - -power= - -### soundblock.lua ### - -Play= -TA3 Sound Block= - -### source.lua ### - -Axle Power Source= -Ele Power Source= -Power Source= -Test Generator= - -### steam_pipe.lua ### - -TA2 Steam Pipe= - -### steelmat.lua ### - -TechAge Steel Mat= - -### storage.lua ### - -Test Storage= - -### streetlamp.lua ### - -TA Street Lamp= - -### streetlamp2.lua ### - -TA4 LED Street Lamp= -TA4 LED Street Lamp Arm= -TA4 LED Street Lamp Pole= - -### submenu.lua ### - -Note: You can't change any values while the block is running!= -Refresh= - -### ta1_axle.lua ### - -TA1 Axle= -TA1 Axle Bearing= - -### ta2_clutch.lua ### - -TA2 Clutch= - -### ta2_weight_chest.lua ### - -TA2 Weight Chest= - -### ta2_winch.lua ### - -TA2 Winch= - -### ta4_cable.lua ### - -TA4 Low Power Box= -TA4 Low Power Cable= - -### ta4_cable_wall_entry.lua ### - -TA4 Cable Wall Entry= - -### ta4_chest.lua ### - -Empty the slots always @nfrom right to left= -Never completely empty the slots@nwith the pusher to keep the item assignment= -Size= -TA4 8x2000 Chest= -Unlock= -Unlock connected chest@nif all slots are below 2000= -right to left= - -### ta4_doser.lua ### - -Doser= -TA4 Doser= -catalyst missing= -reactor defect= -reactor defect or no power= -reactor has no power= -wrong catalyst= - -### ta4_doser.lua ### -### ta4_reactor.lua ### - -TA4 Reactor= - -### ta4_injector.lua ### - -Configure up to 8 items @nto be pushed by the injector= -Injector= -Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration= -pull mode= - -### ta4_liquid_filter.lua ### - -TA4 Liquid Filter Filler= -TA4 Liquid Filter Sink= - -### ta4_reactor.lua ### - -TA4 Reactor Filler Pipe= - -### ta4_stand.lua ### - -TA4 Reactor Base= -TA4 Reactor Stand= -off= -on= - -### ta4_stand.lua ### -### waterpump.lua ### - -no power= - -### ta5_chest.lua ### - -TA5 Hyperloop Chest= - -### ta5_pump.lua ### - -TA5 Pump= - -### ta5_tank.lua ### - -TA5 Hyperloop Tank= - -### tank.lua ### - -Oil Tank= -TA3 Tank= -TA4 Tank= - -### tank_cart.lua ### - -TA Tank Cart= - -### teleport.lua ### - -Connected= -Connection status= -Distance > @1 blocks= -Ex-points missing (@1 < @2)= -Status= -server not connected= - -### teleport_pipe.lua ### - -TA5 Teleport Block Liquids= - -### teleport_pipe.lua ### -### teleport_tube.lua ### - -Remote block error= - -### teleport_tube.lua ### - -TA5 Teleport Block Items= - -### terminal.lua ### - -Syntax error, try help= -TA3 Terminal= -TA4 Terminal= -commands like: help= - -### timer.lua ### - -TA3 Timer= - -### tiny_generator.lua ### - -TA3 Tiny Power Generator= -Tiny Generator= -no fuel= - -### tower.lua ### - -TA3 Derrick= -TA3 Drill Pipe= -TA4 Derrick= -[TA] Derrick is being built!= -[TA] Derrick is being removed!= - -### transformer.lua ### - -TA4 Isolation Transformer= - -### trowel.lua ### - -TechAge Trowel= - -### tube_wall_entry.lua ### - -Tube Wall Entry= - -### tubes.lua ### - -TechAge Tube= - -### tubes_ta4.lua ### - -TA4 Tube= - -### turbine.lua ### - -TA3 Turbine= -TA4 Turbine= -TA5 Turbine= - -### turncontroller.lua ### - -Click on all blocks that shall be turned= -TA4 Turn Controller= -Turn left= -Turn right= - -### usmium.lua ### - -Usmium Nuggets= -Usmium Powder= - -### vacuumtube.lua ### - -TA4 Vacuum Tube= - -### valve.lua ### - -TA Valve= -TA3 Valve= - -### waterinlet.lua ### - -Error: No natural water!= -Error: No water available!= -Error: Not on sea level!= -Operational= -TA4 Water Inlet= - -### watermill.lua ### - -TA1 Watermill= - -### waterpump.lua ### - -TA4 Water Pump= -Water Pump= - -### windturbine_lib.lua ### - -Here is not enough water (41x41 m)!= -Here is not enough wind@n(A free air space of 41x41x21 m is necessary)!= -The next wind turbines is too close!= -This is a= -This is no ocean water!= -This is not the surface of the ocean!= -[TA4 Wind Turbine]= -biome and no ocean!= -is a suitable place for a wind turbine!= - -### worker.lua ### - -Build detector= -Item list= -Remove detector= -TA4 Collider Detector Worker= -[TA4] Detector is being built!= -[TA4] Detector is being removed!= diff --git a/techage/logic/button.lua b/techage/logic/button.lua deleted file mode 100644 index 3a26194..0000000 --- a/techage/logic/button.lua +++ /dev/null @@ -1,516 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 & TA4 Logic button - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local NDEF = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}) end - -local logic = techage.logic - -local WRENCH_MENU3 = { - { - type = "dropdown", - choices = "switch,on button,button 1s,button 2s,button 4s,button 8s,button 16s,button 32s", - name = "type", - label = S("Type"), - tooltip = S("Button or switch"), - default = "1", - }, - { - type = "numbers", - name = "numbers", - label = S("Number"), - tooltip = S("Destination block number(s)"), - default = "", - check = techage.check_numbers, - }, - { - type = "dropdown", - choices = "private,protected,public", - name = "access", - label = S("Access"), - tooltip = S("Button protection"), - default = "1", - }, -} - -local WRENCH_MENU4 = { - { - type = "dropdown", - choices = "switch,on button,button 1s,button 2s,button 4s,button 8s,button 16s,button 32s", - name = "type", - label = S("Type"), - tooltip = S("Button or switch"), - default = "1", - }, - { - type = "numbers", - name = "numbers", - label = S("Number"), - tooltip = S("Destination block number(s)"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command", - label = S("Command"), - tooltip = S("Command to be sent"), - default = "on", - }, - { - type = "dropdown", - choices = "private,protected,public", - name = "access", - label = S("Access"), - tooltip = S("Button protection"), - default = "1", - }, - { - type = "ascii", - name = "decription", - label = S("Infotext"), - tooltip = S("Change the block name (infotext)"), - default = "", - }, -} - -local function switch_on(pos, no_sound) - local cycle_time = M(pos):get_int("cycle_time") - local name = techage.get_node_lvm(pos).name - if name == "techage:ta3_button_off" then - logic.swap_node(pos, "techage:ta3_button_on") - elseif name == "techage:ta4_button_off" then - logic.swap_node(pos, "techage:ta4_button_on") - end - logic.send_cmnd(pos, "command", "on", cycle_time) - if not no_sound then - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - end -end - -local function switch_off(pos, no_sound) - local name = techage.get_node_lvm(pos).name - if name == "techage:ta3_button_on" then - logic.swap_node(pos, "techage:ta3_button_off") - elseif name == "techage:ta4_button_on" then - logic.swap_node(pos, "techage:ta4_button_off") - end - local meta = M(pos) - if meta:get_string("off_command") ~= "true" and - (not meta:contains("command") or meta:get_string("command") == "on") then - logic.send_off(pos, M(pos)) - end - if not no_sound then - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - end -end - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - local idx = meta:get_int("cycle_idx") or 0 - if idx == 0 then idx = 1 end - local access_idx = meta:get_string("public") == "true" and 3 or meta:get_string("protected") == "true" and 2 or 1 - return "size[7.5,6]".. - "dropdown[0.2,0;3;type;switch,on button,button 1s,button 2s,button 4s,button 8s,button 16s,button 32s;"..idx.."]".. - "field[0.5,2;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "label[0.2,3;"..S("Access:").."]".. - "dropdown[3,3;4;access;private,protected,public;"..access_idx.."]".. - "button_exit[2,4;3,1;exit;"..S("Save").."]" -end - -local function store_fields_data(pos, fields) - local meta = M(pos) - meta:set_string("numbers", fields.numbers) - meta:set_string("off_command", "") - - if fields.access == "protected" then - meta:set_string("protected", "true") - meta:set_string("public", "") - end - if fields.access == "public" then - meta:set_string("public", "true") - meta:set_string("protected", "") - end - if fields.access == "private" then - meta:set_string("public", "") - meta:set_string("protected", "") - end - local cycle_time = nil - if fields.type == "switch" then - meta:set_int("cycle_idx", 1) - cycle_time = 0 - elseif fields.type == "on button" then - meta:set_int("cycle_idx", 2) - meta:set_string("off_command", "true") - cycle_time = 1 - elseif fields.type == "button 1s" then - meta:set_int("cycle_idx", 3) - cycle_time = 1 - elseif fields.type == "button 2s" then - meta:set_int("cycle_idx", 4) - cycle_time = 2 - elseif fields.type == "button 4s" then - meta:set_int("cycle_idx", 5) - cycle_time = 4 - elseif fields.type == "button 8s" then - meta:set_int("cycle_idx", 6) - cycle_time = 8 - elseif fields.type == "button 16s" then - meta:set_int("cycle_idx", 7) - cycle_time = 16 - elseif fields.type == "button 32s" then - meta:set_int("cycle_idx", 8) - cycle_time = 32 - end - if cycle_time ~= nil then - meta:set_int("cycle_time", cycle_time) - end - meta:set_string("access", fields.access) - meta:set_string("type", fields.type) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if not techage.check_numbers(fields.numbers, player:get_player_name()) then - return - end - store_fields_data(pos, fields) - - local meta = M(pos) - logic.infotext(meta, NDEF(pos).description) - if fields.exit then - meta:set_string("formspec", "") - meta:set_string("fixed" , "true") - else - meta:set_string("formspec", formspec(meta)) - end -end - -local function ta_after_formspec(pos, fields, playername) - store_fields_data(pos, fields) - local meta = M(pos) - if fields.decription and fields.decription ~= "" then - logic.infotext(meta, fields.decription) - else - logic.infotext(meta, NDEF(pos).description) - end -end - -local function can_access(pos, player) - local meta = M(pos) - local public = meta:get_string("public") == "true" - local protected = meta:get_string("protected") == "true" - local owner = meta:get_string("owner") - local name = player:get_player_name() - return public or protected and not minetest.is_protected(pos, name) or owner == name -end - -local function on_rightclick_on(pos, node, clicker) - local meta = M(pos) - local fixed = meta:get_string("fixed") - if fixed == "true" then - if can_access(pos, clicker) then - switch_on(pos) - local mem = techage.get_mem(pos) - mem.clicker = clicker and clicker:get_player_name() - mem.time = math.floor(minetest.get_us_time() / 100000) - end - end -end - -local function on_rightclick_off(pos, node, clicker) - local meta = M(pos) - local numbers = meta:get_string("numbers") - local cycle_time = meta:get_int("cycle_time") or 0 - if numbers ~= "" and numbers ~= nil and cycle_time == 0 then - if can_access(pos, clicker) then - switch_off(pos) - end - end -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, NDEF(pos).description) - meta:set_string("formspec", formspec(meta)) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -minetest.register_node("techage:ta3_button_off", { - description = S("TA3 Button/Switch"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_button.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_button.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_button_off.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_button_off", S("TA3 Button/Switch")) - logic.infotext(meta, S("TA3 Button/Switch")) - meta:set_string("formspec", formspec(meta)) - meta:set_string("public", "false") - meta:set_int("cycle_time", 0) - end, - - ta3_formspec = WRENCH_MENU3, - ta_after_formspec = ta_after_formspec, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick_on, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_button_on", { - description = ("TA3 Button/Switch"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_button.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_button.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_button_on.png", - }, - - ta3_formspec = WRENCH_MENU3, - ta_after_formspec = ta_after_formspec, - on_rightclick = on_rightclick_off, - on_timer = switch_off, - on_rotate = screwdriver.disallow, - techage_set_numbers = techage_set_numbers, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_button_off", -}) - -minetest.register_node("techage:ta4_button_off", { - description = S("TA4 Button/Switch"), - inventory_image = "techage_smartline_button_inv.png", - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_button_off.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta4_button_off", S("TA4 Button/Switch")) - logic.infotext(meta, S("TA4 Button/Switch")) - meta:set_string("formspec", formspec(meta)) - meta:set_string("public", "false") - meta:set_int("cycle_time", 0) - end, - - ta4_formspec = WRENCH_MENU4, - ta_after_formspec = ta_after_formspec, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick_on, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_button_on", { - description = ("TA4 Button/Switch"), - inventory_image = "techage_smartline_button_inv.png", - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_button_on.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - ta4_formspec = WRENCH_MENU4, - ta_after_formspec = ta_after_formspec, - on_rightclick = on_rightclick_off, - on_timer = switch_off, - on_rotate = screwdriver.disallow, - techage_set_numbers = techage_set_numbers, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta4_button_off", -}) - -minetest.register_craft({ - output = "techage:ta3_button_off", - recipe = { - {"", "group:wood", ""}, - {"default:glass", "techage:vacuum_tube", ""}, - {"", "group:wood", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_button_off", - recipe = { - {"", "techage:aluminum", "dye:blue"}, - {"", "default:glass", "techage:ta4_wlanchip"}, - {"", "", ""}, - }, -}) - -techage.register_node({"techage:ta3_button_off", "techage:ta3_button_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - switch_on(pos, true) - return true - elseif topic == "off" then - switch_off(pos, true) - return true - elseif topic == "state" then - local name = techage.get_node_lvm(pos).name - return name == "techage:ta3_button_on" and "on" or "off" - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - switch_on(pos, true) - return 0 - elseif topic == 1 and payload[1] == 0 then - switch_off(pos, true) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- State - local name = techage.get_node_lvm(pos).name - return 0, name == "techage:ta3_button_on" and {1} or {0} - else - return 2, "" - end - end, - } -) - -techage.register_node({ - "techage:ta4_button_off", "techage:ta4_button_on", - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - switch_on(pos, true) - return true - elseif topic == "off" then - switch_off(pos, true) - return true - elseif topic == "state" then - local name = techage.get_node_lvm(pos).name - return name == "techage:ta4_button_on" and "on" or "off" - elseif topic == "name" then - local mem = techage.get_mem(pos) - return mem.clicker or "" - elseif topic == "time" then - local mem = techage.get_mem(pos) - return mem.time or 0 - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - switch_on(pos, true) - return 0 - elseif topic == 1 and payload[1] == 0 then - switch_off(pos, true) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- State - local name = techage.get_node_lvm(pos).name - return 0, name == "techage:ta4_button_on" and {1} or {0} - elseif topic == 144 then -- Player Name - local mem = techage.get_mem(pos) - return 0, mem.clicker - elseif topic == 149 then --time - local mem = techage.get_mem(pos) - return 0, {mem.time or 0} - else - return 2, "" - end - end, - } -) diff --git a/techage/logic/button_2x.lua b/techage/logic/button_2x.lua deleted file mode 100644 index a016f7a..0000000 --- a/techage/logic/button_2x.lua +++ /dev/null @@ -1,307 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Logic twofold button - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local function get_button_num(pos, clicker, pointed_thing) - -- use the node behind the button to get better results - if clicker and pointed_thing then - local offs = vector.subtract(pointed_thing.under, pointed_thing.above) - pointed_thing.under = vector.add(pointed_thing.under, offs) - pointed_thing.above = vector.add(pointed_thing.above, offs) - local pos1 = minetest.pointed_thing_to_face_pos(clicker, pointed_thing) - local y = pos1.y - pos.y - - if y > 0.03 then - return 1 - elseif y < -0.03 then - return 2 - end - end -end - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "button,switch", - name = "type", - label = S("Type"), - tooltip = S("Momentary button or on/off switch"), - default = "1", - }, - { - type = "ascii", - name = "label1", - label = S("Label") .. " 1", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number1", - label = S("Number") .. " 1", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command1", - label = S("Command") .. " 1", - tooltip = S("Command to be sent (ignored for switches)"), - default = "1", - }, - { - type = "ascii", - name = "label2", - label = S("Label") .. " 2", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number2", - label = S("Number") .. " 2", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command2", - label = S("Command") .. " 2", - tooltip = S("Command to be sent (ignored for switches)"), - default = "2", - }, - { - type = "dropdown", - choices = "private,protected,public", - name = "access", - label = S("Access"), - tooltip = S("Button protection"), - default = "8", - }, -} - -local function send_cmnd(pos, num, cmd) - local meta = M(pos) - local own_num = meta:get_string("node_number") - local dest = meta:get_string("dest_number" .. num) - local command, payload = cmd, nil - if not cmd then - local s = meta:get_string("command" .. num) - command, payload = unpack(string.split(s, " ", false, 1)) - end - local owner = meta:get_string("owner") - if techage.check_numbers(dest, owner) then - techage.send_multi(own_num, dest, command, payload) - end -end - -local function button_update(pos, objref) - local meta = M(pos) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - local tbl = {" ", " ", meta:get_string("label1"), " ", meta:get_string("label2")} - local text = "< " .. table.concat(tbl, "\n< ") - local texture = lcdlib.make_multiline_texture("default", text, 96, 96, 7, "top", "#000", 6) - - if nvm.button[1] then - texture = texture .. "^techage_smartline_button_4x_on2.png" - end - if nvm.button[2] then - texture = texture .. "^techage_smartline_button_4x_on3.png" - end - objref:set_properties({ textures = {texture}, visual_size = {x=1, y=1} }) -end - -local function switch_off(pos, num) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - nvm.button[num] = nil - lcdlib.update_entities(pos) -end - -local function switch_on(pos, num) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - nvm.button[num] = true - lcdlib.update_entities(pos) -end - -local lcd_box = {-8/16, -4/16, 7.75/16, 8/16, 4/16, 8/16} - -local function can_access(pos, player) - local meta = M(pos) - local playername = player:get_player_name() - local access = meta:get_string("access") - local owner = meta:get_string("owner") - local protected = minetest.is_protected(pos, playername) - - if access == "private" and playername ~= owner then - return false - elseif access == "protected" and protected then - return false - end - return true -end - -minetest.register_node("techage:ta4_button_2x", { - description = S("TA4 2x Button"), - inventory_image = 'techage_smartline_button_2x.png', - tiles = {'techage_smartline_button_2x.png'}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = "clip", - sunlight_propagates = true, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = lcd_box, - }, - light_source = 6, - - display_entities = { - ["techage:display_entity"] = { depth = 0.48, - on_display_update = button_update}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_button_2x") - local meta = minetest.get_meta(pos) - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", "TA4 2x Button " .. number) - meta:set_string("type", "button") - meta:set_string("label1", "B1") - meta:set_string("label2", "B2") - lcdlib.update_entities(pos) - end, - - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - if clicker and clicker:is_player() then - -- Check access settings - if not can_access(pos, clicker) then - return - end - - local num = get_button_num(pos, clicker, pointed_thing) - if num then - local typ = M(pos):get_string("type") - if typ == "switch" then - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - if nvm.button[num] then - switch_off(pos, num) - send_cmnd(pos, num, "off") - else - switch_on(pos, num) - send_cmnd(pos, num, "on") - end - else - switch_on(pos, num) - send_cmnd(pos, num) - minetest.after(0.5, switch_off, pos, num) - end - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - end - end - end, - - ta_after_formspec = function(pos, fields, playername) - lcdlib.update_entities(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta3_formspec = WRENCH_MENU, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -techage.register_node({"techage:ta4_button_2x"}, { - on_recv_message = function(pos, src, topic, payload) - local num = math.max(tonumber(payload) or 0, 1) - if topic == "on" then - switch_on(pos, num) - send_cmnd(pos, num) - return true - elseif topic == "off" then - switch_off(pos, num) - return true - elseif topic == "state" then - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - return nvm.button[num] == true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local num = math.max(payload[1], 1) - if topic == 23 and payload[2] == 1 then - switch_on(pos, num) - send_cmnd(pos, num) - return 0 - elseif topic == 23 and payload[2] == 0 then - switch_off(pos, num) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 152 then -- State - local num = math.max(payload[1], 1) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - return 0, nvm.button[num] and {1} or {0} - else - return 2, "" - end - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_button_2x", - recipe = { - {"", "", ""}, - {"", "techage:ta4_button_off", "techage:ta4_button_off"}, - {"", "", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_button_off 2", - recipe = { - {"", "", ""}, - {"", "techage:ta4_button_2x", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/logic/button_4x.lua b/techage/logic/button_4x.lua deleted file mode 100644 index 7c30107..0000000 --- a/techage/logic/button_4x.lua +++ /dev/null @@ -1,363 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Logic fourfold button - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local function get_button_num(pos, clicker, pointed_thing) - -- use the node behind the button to get better results - if clicker and pointed_thing then - local offs = vector.subtract(pointed_thing.under, pointed_thing.above) - pointed_thing.under = vector.add(pointed_thing.under, offs) - pointed_thing.above = vector.add(pointed_thing.above, offs) - local pos1 = minetest.pointed_thing_to_face_pos(clicker, pointed_thing) - local y = pos1.y - pos.y - - if y < -0.3 then - return 4 - elseif y < -0.03 and y > -0.22 then - return 3 - elseif y > 0.03 and y < 0.22 then - return 2 - elseif y > 0.3 then - return 1 - end - end -end - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "button,switch", - name = "type", - label = S("Type"), - tooltip = S("Momentary button or on/off switch"), - default = "1", - }, - { - type = "ascii", - name = "label1", - label = S("Label") .. " 1", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number1", - label = S("Number") .. " 1", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command1", - label = S("Command") .. " 1", - tooltip = S("Command to be sent (ignored for switches)"), - default = "1", - }, - { - type = "ascii", - name = "label2", - label = S("Label") .. " 2", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number2", - label = S("Number") .. " 2", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command2", - label = S("Command") .. " 2", - tooltip = S("Command to be sent (ignored for switches)"), - default = "2", - }, - { - type = "ascii", - name = "label3", - label = S("Label") .. " 3", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number3", - label = S("Number") .. " 3", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command3", - label = S("Command") .. " 3", - tooltip = S("Command to be sent (ignored for switches)"), - default = "3", - }, - { - type = "ascii", - name = "label4", - label = S("Label") .. " 4", - tooltip = S("Label for the button"), - default = "1", - }, - { - type = "numbers", - name = "dest_number4", - label = S("Number") .. " 4", - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command4", - label = S("Command") .. " 4", - tooltip = S("Command to be sent (ignored for switches)"), - default = "4", - }, - { - type = "dropdown", - choices = "private,protected,public", - name = "access", - label = S("Access"), - tooltip = S("Button protection"), - default = "8", - }, -} - -local function send_cmnd(pos, num, cmd) - local meta = M(pos) - local own_num = meta:get_string("node_number") - local dest = meta:get_string("dest_number" .. num) - local command, payload = cmd, nil - if not cmd then - local s = meta:get_string("command" .. num) - command, payload = unpack(string.split(s, " ", false, 1)) - end - local owner = meta:get_string("owner") - if techage.check_numbers(dest, owner) then - techage.send_multi(own_num, dest, command, payload) - end -end - -local function button_update(pos, objref) - local meta = M(pos) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - local tbl = {meta:get_string("label1"), " ", meta:get_string("label2"), " ", meta:get_string("label3"), " ", meta:get_string("label4")} - local text = "< " .. table.concat(tbl, "\n< ") - local texture = lcdlib.make_multiline_texture("default", text, 96, 96, 7, "top", "#000", 6) - - if nvm.button[1] then - texture = texture .. "^techage_smartline_button_4x_on1.png" - end - if nvm.button[2] then - texture = texture .. "^techage_smartline_button_4x_on2.png" - end - if nvm.button[3] then - texture = texture .. "^techage_smartline_button_4x_on3.png" - end - if nvm.button[4] then - texture = texture .. "^techage_smartline_button_4x_on4.png" - end - objref:set_properties({ textures = {texture}, visual_size = {x=1, y=1} }) -end - -local function switch_off(pos, num) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - nvm.button[num] = nil - lcdlib.update_entities(pos) -end - -local function switch_on(pos, num) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - nvm.button[num] = true - lcdlib.update_entities(pos) -end - -local lcd_box = {-8/16, -8/16, 7.75/16, 8/16, 8/16, 8/16} - -local function can_access(pos, player) - local meta = M(pos) - local playername = player:get_player_name() - local access = meta:get_string("access") - local owner = meta:get_string("owner") - local protected = minetest.is_protected(pos, playername) - - if access == "private" and playername ~= owner then - return false - elseif access == "protected" and protected then - return false - end - return true -end - -minetest.register_node("techage:ta4_button_4x", { - description = S("TA4 4x Button"), - inventory_image = 'techage_smartline_button_4x.png', - tiles = {'techage_smartline_button_4x.png'}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = "clip", - sunlight_propagates = true, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = lcd_box, - }, - light_source = 6, - - display_entities = { - ["techage:display_entity"] = { depth = 0.48, - on_display_update = button_update}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_button_4x") - local meta = minetest.get_meta(pos) - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", "TA4 4x Button " .. number) - meta:set_string("type", "button") - meta:set_string("label1", "B1") - meta:set_string("label2", "B2") - meta:set_string("label3", "B3") - meta:set_string("label4", "B4") - lcdlib.update_entities(pos) - end, - - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - if clicker and clicker:is_player() then - -- Check access settings - if not can_access(pos, clicker) then - return - end - - local num = get_button_num(pos, clicker, pointed_thing) - if num then - local typ = M(pos):get_string("type") - if typ == "switch" then - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - if nvm.button[num] then - switch_off(pos, num) - send_cmnd(pos, num, "off") - else - switch_on(pos, num) - send_cmnd(pos, num, "on") - end - else - switch_on(pos, num) - send_cmnd(pos, num) - minetest.after(0.5, switch_off, pos, num) - end - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - end - end - end, - - ta_after_formspec = function(pos, fields, playername) - lcdlib.update_entities(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta3_formspec = WRENCH_MENU, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -techage.register_node({"techage:ta4_button_4x"}, { - on_recv_message = function(pos, src, topic, payload) - local num = math.max(tonumber(payload) or 0, 3) - if topic == "on" then - switch_on(pos, num) - send_cmnd(pos, num) - return true - elseif topic == "off" then - switch_off(pos, num) - return true - elseif topic == "state" then - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - return nvm.button[num] == true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local num = math.max(payload[1], 3) - if topic == 23 and payload[2] == 1 then - switch_on(pos, num) - send_cmnd(pos, num) - return 0 - elseif topic == 23 and payload[2] == 0 then - switch_off(pos, num) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 152 then -- State - local num = math.max(payload[1], 3) - local nvm = techage.get_nvm(pos) - nvm.button = nvm.button or {} - return 0, nvm.button[num] and {1} or {0} - else - return 2, "" - end - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_button_4x", - recipe = { - {"", "techage:ta4_button_off", "techage:ta4_button_off"}, - {"", "techage:ta4_button_off", "techage:ta4_button_off"}, - {"", "", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_button_off 4", - recipe = { - {"", "", ""}, - {"", "techage:ta4_button_4x", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/logic/cart_detector.lua b/techage/logic/cart_detector.lua deleted file mode 100644 index 99c12b6..0000000 --- a/techage/logic/cart_detector.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Cart Detector/Starter - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end - -local logic = techage.logic -local CYCLE_TIME = 2 - -local function switch_off(pos) - local node = minetest.get_node(pos) - if node.name == "techage:ta3_cartdetector_on" then - logic.swap_node(pos, "techage:ta3_cartdetector_off") - logic.send_off(pos, M(pos)) - end -end - -local function switch_on(pos) - logic.swap_node(pos, "techage:ta3_cartdetector_on") - if logic.send_on(pos, M(pos)) then - minetest.after(1, switch_off, pos) - end -end - -local function node_timer(pos) - if minecart.is_cart_available(pos, nil, 1.5) then - switch_on(pos) - else - switch_off(pos) - end - return true -end - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - return "size[7.5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "button_exit[2,2.2;3,1;accept;"..S("accept").."]" -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - if fields.accept then - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Cart Detector")) - end - meta:set_string("formspec", formspec(meta)) - end -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Cart Detector")) - meta:set_string("formspec", formspec(meta)) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -minetest.register_node("techage:ta3_cartdetector_off", { - description = S("TA3 Cart Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR90", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_cartdetector.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_cartdetector_off", S("TA3 Player Detector")) - logic.infotext(meta, S("TA3 Cart Detector")) - meta:set_string("formspec", formspec(meta)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = on_receive_fields, - on_timer = node_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_cartdetector_on", { - description = "TA3 Cart Detector", - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR90", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_cartdetector_on.png", - }, - on_receive_fields = on_receive_fields, - on_timer = node_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_cartdetector_off" -}) - -minetest.register_craft({ - output = "techage:ta3_cartdetector_off", - recipe = { - {"", "group:wood", "default:mese_crystal"}, - {"", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", "basic_materials:motor"}, - }, -}) - -techage.register_node({"techage:ta3_cartdetector_off", "techage:ta3_cartdetector_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - local node = minetest.get_node(pos) - local dir = minetest.facedir_to_dir(node.param2) - minecart.punch_cart(pos, nil, 1.6, dir) - elseif topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_cartdetector_on" then - return "on" - else - return "off" - end - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 then - local node = minetest.get_node(pos) - local dir = minetest.facedir_to_dir(node.param2) - minecart.punch_cart(pos, nil, 1.6, dir) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then -- Binary State - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_cartdetector_on" then - return 0, {1} - else - return 0, {0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - --- Register default cart in addition -minecart.tEntityNames["carts:cart"] = true diff --git a/techage/logic/charge_detector.lua b/techage/logic/charge_detector.lua deleted file mode 100644 index bf8c8da..0000000 --- a/techage/logic/charge_detector.lua +++ /dev/null @@ -1,232 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Energy storage charge detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local Cable = techage.ElectricCable -local power = networks.power - -local logic = techage.logic -local CYCLE_TIME = 8 -local DESCR = S("TA4 Energy Storage Charge Detector") - -local WRENCH_MENU = { - { - type = "numbers", - name = "numbers", - label = S("Number"), - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "dropdown", - choices = "10%,20%,30%,40%,50%,60%,70%,80%,90%", - name = "switch_point", - label = S("Switch point"), - tooltip = S("Storage charge level switch point"), - default = "50", - values = {10, 20, 30, 40, 50, 60, 70, 80, 90} - }, - { - type = "ascii", - name = "command1", - label = '"<" ' .. S("Command"), - tooltip = S("Command to send when the energy storage charge\nlevel falls below the specified switch point"), - default = "off", - }, - { - type = "ascii", - name = "command2", - label = '">" ' .. S("Command"), - tooltip = S("Command to send when the energy storage charge\nlevel rises above the specified switch point"), - default = "on", - }, -} - -local function switch_on(pos) - if logic.swap_node(pos, "techage:ta4_chargedetector_on") then - logic.send_cmnd(pos, "command2", "on") - end -end - -local function switch_off(pos) - if logic.swap_node(pos, "techage:ta4_chargedetector_off") then - logic.send_cmnd(pos, "command1", "off") - end -end - -local function switch_point(pos) - local mem = techage.get_mem(pos) - if not mem.switch_point then - mem.switch_point = tonumber(M(pos):get_string("switch_point")) or 50 - end - return mem.switch_point -end - -local function above_switch_point(pos) - local outdir = M(pos):get_int("outdir") - local value = networks.power.get_storage_percent(pos, Cable, outdir) - return value > switch_point(pos) -end - -local function techage_set_numbers(pos, numbers, player_name) - local res = logic.set_numbers(pos, numbers, player_name, DESCR) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function ta_after_formspec(pos, fields, playername) - local mem = techage.get_mem(pos) - mem.switch_point = nil -end - -minetest.register_node("techage:ta4_chargedetector_off", { - description = DESCR, - inventory_image = 'techage_charge_detector_inv.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_charge_detector_off.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta4_chargedetector_off", DESCR) - logic.infotext(meta, DESCR) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "B")) - Cable:after_place_node(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_timer = function (pos, elapsed) - if not above_switch_point(pos) then - switch_on(pos) - end - return true - end, - - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta_after_formspec = ta_after_formspec, - ta4_formspec = WRENCH_MENU, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_chargedetector_on", { - description = DESCR, - inventory_image = 'techage_charge_detector_inv.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_charge_detector_on.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - on_timer = function (pos, elapsed) - if above_switch_point(pos) then - switch_off(pos) - end - return true - end, - - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta_after_formspec = ta_after_formspec, - ta4_formspec = WRENCH_MENU, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta4_chargedetector_off" -}) - -minetest.register_craft({ - output = "techage:ta4_chargedetector_off", - recipe = { - {"", "", ""}, - {"basic_materials:plastic_sheet", "dye:blue", "techage:aluminum"}, - {"techage:ta4_wlanchip", "techage:electric_cableS", "default:copper_ingot"}, - }, -}) - -techage.register_node({ - "techage:ta4_chargedetector_off", "techage:ta4_chargedetector_on" - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta4_chargedetector_on" then - return "on" - else - return "off" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then -- Binary State - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta4_chargedetector_on" then - return 0, {1} - else - return 0, {0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - } -) - -power.register_nodes({"techage:ta4_chargedetector_off", "techage:ta4_chargedetector_on"}, Cable, "con", {"B"}) - diff --git a/techage/logic/collector.lua b/techage/logic/collector.lua deleted file mode 100644 index f5568d5..0000000 --- a/techage/logic/collector.lua +++ /dev/null @@ -1,225 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Collector - Collects states from other nodes, acting as a state concentrator. - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local NDEF = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}) end -local logic = techage.logic - -local CYCLE_TIME = 1 - --- The numbering seems strange here, but I had to add the "running" state --- afterwards without changing the behavior of the block. -local tStates = {stopped = 0, running = 1, standby = 2, blocked = 3, fault = 4, defect = 5} -local tDropdownPos = {["1 standby"] = 1, ["2 blocked"] = 2, ["3 fault"] = 3, ["4 defect"] = 4} -local lStates = {[0] = "stopped", "running", "standby", "blocked", "fault", "defect"} -local tDropdownPos = {["1 standby"] = 1, ["2 blocked"] = 2, ["3 nopower"] = 3, ["4 fault"] = 4} -local TaStates = {running = 1, blocked = 2, standby = 3, nopower = 4, fault = 5, stopped = 6} - -local function formspec(nvm, meta) - nvm.poll_numbers = nvm.poll_numbers or {} - local poll_numbers = table.concat(nvm.poll_numbers, " ") - local event_number = meta:get_string("event_number") - local dropdown_pos = meta:get_int("dropdown_pos") - if dropdown_pos == 0 then dropdown_pos = 1 end - - return "size[9,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.3,0.6;9,1;poll_numbers;"..S("Node numbers to read the states from")..":;"..poll_numbers.."]" .. - "field[0.3,2;9,1;event_number;"..S("Node number to send the events to")..":;"..event_number.."]" .. - "label[1.3,2.8;"..S("Send an event if state is equal or larger than")..":]".. - "dropdown[1.2,3.4;7,4;severity;1 standby,2 blocked,3 nopower,4 fault;"..dropdown_pos.."]".. - "button_exit[3,5;2,1;exit;Save]" -end - - -local function send_event(nvm, meta) - local event_number = meta:get_string("event_number") - if event_number ~= "" then - local severity = meta:get_int("dropdown_pos") - local own_number = meta:get_string("own_number") - if nvm.common_state > severity then - techage.send_multi(own_number, event_number, "on") - else - techage.send_multi(own_number, event_number, "off") - end - end -end - -local function request_state(nvm, meta) - local number = nvm.poll_numbers and nvm.poll_numbers[nvm.idx] - if number then - local own_number = meta:get_string("own_number") - local state = techage.send_single(own_number, number, "state", nil) - if state then - state = tStates[state] or 0 - nvm.common_state = math.max(nvm.common_state, state) - end - end -end - - -local function on_timer(pos,elapsed) - local nvm = techage.get_nvm(pos) - local meta = minetest.get_meta(pos) - nvm.idx = (nvm.idx or 0) + 1 - nvm.common_state = nvm.common_state or 0 - - if not nvm.poll_numbers then - local own_number = meta:get_string("own_number") - meta:set_string("infotext", S("TA4 State Collector").." "..own_number..": stopped") - nvm.common_state = 0 - nvm.idx = 1 - return false - end - - if nvm.idx > #nvm.poll_numbers then - nvm.idx = 1 - if nvm.stored_state ~= nvm.common_state then - send_event(nvm, meta) - local own_number = meta:get_string("own_number") - meta:set_string("infotext", S("TA4 State Collector").." "..own_number..': "'..lStates[nvm.common_state]..'"') - nvm.stored_state = nvm.common_state - end - nvm.common_state = 0 -- reset for the next round - end - - request_state(nvm, meta) - return true -end - -minetest.register_node("techage:ta4_collector", { - description = S("TA4 State Collector"), - inventory_image = "techage_smartline_collector_inv.png", - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_collector.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - local meta = minetest.get_meta(pos) - local own_number = techage.add_node(pos, "techage:ta4_collector") - meta:set_string("own_number", own_number) - meta:set_string("formspec", formspec(nvm, meta)) - meta:set_string("infotext", S("TA4 State Collector").." "..own_number) - meta:set_string("owner", placer:get_player_name()) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") - if owner ~= player:get_player_name() then - return - end - - local nvm = techage.get_nvm(pos) - local timer = minetest.get_node_timer(pos) - local own_number = meta:get_string("own_number") - - if fields.quit == "true" and fields.poll_numbers then - if techage.check_numbers(fields.event_number, player:get_player_name()) then - meta:set_string("event_number", fields.event_number) - end - if techage.check_numbers(fields.poll_numbers, player:get_player_name()) then - nvm.poll_numbers = string.split(fields.poll_numbers, " ") - nvm.idx = 0 - if not timer:is_started() then - timer:start(CYCLE_TIME) - end - meta:set_string("infotext", S("TA4 State Collector").." "..own_number..": running") - else - if timer:is_started() then - timer:stop() - end - meta:set_string("infotext", S("TA4 State Collector").." "..own_number..": stopped") - nvm.common_state = 0 - nvm.stored_state = 0 - end - if fields.severity then - meta:set_int("dropdown_pos", tDropdownPos[fields.severity]) - end - meta:set_string("formspec", formspec(nvm, meta)) - end - end, - - techage_set_numbers = function(pos, numbers, player_name) - local nvm = techage.get_nvm(pos) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, NDEF(pos).description) - meta:set_string("formspec", formspec(nvm, meta)) - return res - end, - - on_timer = on_timer, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_collector", - recipe = { - {"", "techage:aluminum", "dye:blue"}, - {"", "default:mese_crystal_fragment", "techage:ta4_wlanchip"}, - }, -}) - -techage.register_node({"techage:ta4_collector"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local nvm = techage.get_nvm(pos) - return lStates[nvm.stored_state or 0] - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 129 then - local nvm = techage.get_nvm(pos) - return 0, {TaStates[lStates[nvm.stored_state or 0]]} - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/logic/command_converter.lua b/techage/logic/command_converter.lua deleted file mode 100644 index 16af99d..0000000 --- a/techage/logic/command_converter.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Commannd Converter - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local DESCR = S("TA3 Command Converter") - -local logic = techage.logic - -local sDelay = "0,1,2,3,4,5,7,10,15,20,30,45,60" - -local function switch_on(pos) - logic.swap_node(pos, "techage:ta3_command_converter_on") - logic.send_cmnd(pos, "command_on", "") -end - -local function switch_off(pos) - logic.swap_node(pos, "techage:ta3_command_converter_off") - logic.send_cmnd(pos, "command_off", "") -end - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - local command_on = meta:get_string("command_on") - local command_off = meta:get_string("command_off") - local delay_on = techage.dropdown_index(sDelay, meta:get_string("delay_on")) - local delay_off = techage.dropdown_index(sDelay, meta:get_string("delay_off")) - - return "formspec_version[4]size[10,6]".. - "box[0.2,0.2;9.6,0.6;#c6e8ff]" .. - "label[0.4,0.5;" .. minetest.colorize( "#000000", DESCR) .. "]" .. - - "field[1.0,1.5;8,0.6;numbers;" .. S("Insert destination node number(s)") .. ";" .. numbers .. "]" .. - - "label[0.6,2.7;" .. S("Receive") .. "]" .. - "label[2.8,2.7;" .. S("Sent command") .. "]" .. - "label[7.34,2.7;" .. S("Send delay (s)") .. "]" .. - - "box[0.5,3.1;1.2,0.6;#888]" .. - "label[0.6,3.4;on]" .. - "field[2.7,3.1;3.5,0.6;command_on;;" .. command_on .. "]" .. - "dropdown[7.2,3.1;2,0.6;delay_on;" .. sDelay .. ";" .. delay_on .. ";false]" .. - - "box[0.5,4.0;1.2,0.6;#888]" .. - "label[0.6,4.3;off]" .. - "field[2.7,4.0;3.5,0.6;command_off;;" .. command_off .. "]" .. - "dropdown[7.2,4.0;2,0.6;delay_off;" .. sDelay .. ";" .. delay_off .. ";false]" .. - - "button_exit[3.5,5.2;3,0.6;exit;" .. S("Save") .. "]" -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR) - meta:set_string("formspec", formspec(meta)) - return true --res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - if fields.exit and fields.exit ~= "" then - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), DESCR) - end - meta:set_string("command_on", fields.command_on) - meta:set_string("command_off", fields.command_off) - meta:set_int("delay_on", fields.delay_on or 0) - meta:set_int("delay_off", fields.delay_off or 0) - meta:set_string("formspec", formspec(meta)) - elseif fields.exit == "close" then - meta:set_string("formspec", formspec(meta)) - end -end - -minetest.register_node("techage:ta3_command_converter_off", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_command_converter.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_command_converter_off", DESCR) - logic.infotext(meta, DESCR) - meta:set_string("formspec", formspec(meta)) - end, - - on_timer = function (pos, elapsed) - switch_on(pos) - end, - - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_command_converter_on", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_command_converter_on.png", - }, - - on_timer = function (pos, elapsed) - switch_off(pos) - end, - - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_command_converter_off" -}) - -minetest.register_craft({ - output = "techage:ta3_command_converter_off", - recipe = { - {"", "group:wood", ""}, - {"default:mese_crystal_fragment", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", ""}, - }, -}) - -techage.register_node({ - "techage:ta3_command_converter_off", "techage:ta3_command_converter_on" - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - local delay = M(pos):get_int("delay_on") or 0 - if delay > 0 then - minetest.get_node_timer(pos):start(delay) - else - switch_on(pos) - end - return true - elseif topic == "off" then - local delay = M(pos):get_int("delay_off") or 0 - if delay > 0 then - minetest.get_node_timer(pos):start(delay) - else - switch_off(pos) - end - return true - else - return "unsupported" - end - end, - } -) diff --git a/techage/logic/detector.lua b/techage/logic/detector.lua deleted file mode 100644 index 2dbde0e..0000000 --- a/techage/logic/detector.lua +++ /dev/null @@ -1,394 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Item detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local NDEF = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}) end - -local logic = techage.logic -local BLOCKING_TIME = 8 -- seconds -local ON_TIME = 1 - -local WRENCH_MENU3 = { - { - type = "dropdown", - choices = "1,2,4,6,8,12,16", - name = "ontime", - label = S("On Time") .. " [s]", - tooltip = S("The time between the 'on' and 'off' commands."), - default = "1", - }, - { - type = "dropdown", - choices = "2,4,6,8,12,16,20", - name = "blockingtime", - label = S("Blocking Time") .. " [s]", - tooltip = S("The time after the 'off' command\nuntil the next 'on' command is accepted."), - default = "8", - }, - { - type = "items", - name = "config", - label = S("Configured Items"), - tooltip = S("Items which generate an 'on' command.\nIf empty, all passed items generate an 'on' command."), - size = 4, - } -} - -local WRENCH_MENU4 = { - { - type = "dropdown", - choices = "1,2,4,6,8,12,16", - name = "ontime", - label = S("On Time") .. " [s]", - tooltip = S("The time between the 'on' and 'off' commands."), - default = "1", - }, - { - type = "dropdown", - choices = "2,4,6,8,12,16,20", - name = "blockingtime", - label = S("Blocking Time") .. " [s]", - tooltip = S("The time after the 'off' command\nuntil the next 'on' command is accepted."), - default = "8", - }, - { - type = "number", - name = "countdown", - label = S("Countdown"), - tooltip = S("Counts down the number of items passed through\nand only triggers an 'on' command when it reaches zero."), - default = "0", - }, - { - type = "output", - name = "countdown", - label = S("Current countdown"), - tooltip = S("Current countdown value."), - default = "0", - }, - { - type = "items", - name = "config", - label = S("Configured Items"), - tooltip = S("Items which generate an 'on' command.\nIf empty, all passed items generate an 'on' command."), - size = 4, - } -} - -local function switch_on(pos) - local mem = techage.get_mem(pos) - local t = minetest.get_gametime() - if t > (mem.time or 0) then - local name = techage.get_node_lvm(pos).name - if name == "techage:ta3_detector_off" then - logic.swap_node(pos, "techage:ta3_detector_on") - else - logic.swap_node(pos, "techage:ta4_detector_on") - end - local meta = M(pos) - local on_time = math.max(meta:get_int("ontime"), ON_TIME) - local blocking_time = tonumber(meta:get_string("blockingtime")) or BLOCKING_TIME - logic.send_on(pos, meta, on_time) - mem.time = t + blocking_time + on_time - end -end - -local function switch_off(pos) - local name = techage.get_node_lvm(pos).name - if name == "techage:ta3_detector_on" then - logic.swap_node(pos, "techage:ta3_detector_off") - else - logic.swap_node(pos, "techage:ta4_detector_off") - end - logic.send_off(pos, M(pos)) -end - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - return "size[7.5,3]".. - techage.wrench_image(7, -0.1) .. - "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "button_exit[2,2;3,1;exit;"..S("Save").."]" -end - -local function after_place_node3(pos, placer) - local meta = M(pos) - local inv = meta:get_inventory() - inv:set_size('cfg', 4) - logic.after_place_node(pos, placer, "techage:ta3_detector_off", S("TA3 Detector")) - logic.infotext(meta, S("TA3 Detector")) - meta:set_string("formspec", formspec(meta)) -end - -local function after_place_node4(pos, placer) - local meta = M(pos) - local inv = meta:get_inventory() - inv:set_size('cfg', 4) - logic.after_place_node(pos, placer, "techage:ta4_detector_off", S("TA4 Detector")) - logic.infotext(meta, S("TA4 Detector")) - meta:set_string("formspec", formspec(meta)) -end - -local function on_receive_fields(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), NDEF(pos).description) - meta:set_string("formspec", formspec(M(pos))) - end -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, NDEF(pos).description) - meta:set_string("formspec", formspec(meta)) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function ta_after_formspec(pos, fields, playername) - if fields.save then - local nvm = techage.get_nvm(pos) - local val = M(pos):get_int("countdown") or 0 - if val > 0 then - nvm.countdown = val - else - nvm.countdown = nil - end - end -end - -minetest.register_node("techage:ta3_detector_off", { - description = S("TA3 Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_outp.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_inp.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_detector.png^[transformFX", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_detector.png", - }, - - after_place_node = after_place_node3, - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta3_formspec = WRENCH_MENU3, - - on_rotate = screwdriver.disallow, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_node("techage:ta3_detector_on", { - description = S("TA3 Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_outp.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_inp.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_detector_on.png^[transformFX", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_detector_on.png", - }, - - on_timer = switch_off, - on_rotate = screwdriver.disallow, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta3_formspec = WRENCH_MENU3, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_detector_off", -}) - -minetest.register_node("techage:ta4_detector_off", { - description = S("TA4 Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_outp.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inp.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_detector.png^[transformFX", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_detector.png", - }, - - after_place_node = after_place_node4, - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta4_formspec = WRENCH_MENU4, - ta_after_formspec = ta_after_formspec, - - on_rotate = screwdriver.disallow, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - - -minetest.register_node("techage:ta4_detector_on", { - description = S("TA4 Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_outp.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inp.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_detector_on.png^[transformFX", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_detector_on.png", - }, - - on_timer = switch_off, - on_rotate = screwdriver.disallow, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - ta4_formspec = WRENCH_MENU4, - ta_after_formspec = ta_after_formspec, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta4_detector_off", -}) - -minetest.register_craft({ - output = "techage:ta3_detector_off", - recipe = { - {"", "group:wood", ""}, - {"techage:tubeS", "techage:vacuum_tube", "techage:tubeS"}, - {"", "group:wood", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_detector_off", - recipe = { - {"", "techage:ta3_detector_off", ""}, - {"", "techage:ta4_wlanchip", ""}, - {"", "", ""}, - }, -}) - -techage.register_node({"techage:ta3_detector_off", "techage:ta3_detector_on"}, { - on_push_item = function(pos, in_dir, stack) - local leftover = techage.safe_push_items(pos, in_dir, stack) - if leftover then - local inv = minetest.get_inventory({type = "node", pos = pos}) - if not inv or inv:is_empty("cfg") or inv:contains_item("cfg", ItemStack(stack:get_name())) then - if leftover == true or leftover:get_count() ~= stack:get_count() then - switch_on(pos) - end - end - return leftover - end - return false - end, - is_pusher = true, -- is a pulling/pushing node -}) - -techage.register_node({"techage:ta4_detector_off", "techage:ta4_detector_on"}, { - on_push_item = function(pos, in_dir, stack) - local leftover = techage.safe_push_items(pos, in_dir, stack) - if leftover then - local inv = minetest.get_inventory({type = "node", pos = pos}) - if not inv or inv:is_empty("cfg") or inv:contains_item("cfg", ItemStack(stack:get_name())) then - local nvm = techage.get_nvm(pos) - local num_moved = stack:get_count() - if leftover ~= true then - num_moved = num_moved - leftover:get_count() - end - - if nvm.countdown and nvm.countdown > 0 then - nvm.countdown = nvm.countdown - num_moved - if nvm.countdown <= 0 then - M(pos):set_int("countdown", 0) - if leftover == true or leftover:get_count() ~= stack:get_count() then - switch_on(pos) - end - end - elseif nvm.countdown == nil then - if leftover == true or leftover:get_count() ~= stack:get_count() then - switch_on(pos) - end - end - nvm.counter = (nvm.counter or 0) + num_moved - end - return leftover - end - return false - end, - is_pusher = true, -- is a pulling/pushing node - - on_recv_message = function(pos, src, topic, payload) - if topic == "count" then - local nvm = techage.get_nvm(pos) - return nvm.counter or 0 - elseif topic == "countdown" then - local nvm = techage.get_nvm(pos) - nvm.countdown = tonumber(payload) or 0 - M(pos):set_int("countdown", nvm.countdown) - return true - elseif topic == "reset" then - local nvm = techage.get_nvm(pos) - nvm.counter = 0 - nvm.countdown = nil - return true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 6 then -- Detector Block Reset - local nvm = techage.get_nvm(pos) - nvm.counter = 0 - nvm.countdown = nil - return 0 - elseif topic == 5 then -- Detector Block Countdown - local nvm = techage.get_nvm(pos) - nvm.countdown = tonumber(payload[1]) or 0 - M(pos):set_int("countdown", nvm.countdown) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 139 then - local nvm = techage.get_nvm(pos) - return 0, {nvm.counter or 0} - else - return 2, "" - end - end, -}) diff --git a/techage/logic/flipflop.lua b/techage/logic/flipflop.lua deleted file mode 100644 index 756ec6b..0000000 --- a/techage/logic/flipflop.lua +++ /dev/null @@ -1,147 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Flip-flop - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local DESCR = S("TA3 Flip-Flop") - -local logic = techage.logic - -local function switch_on(pos) - logic.swap_node(pos, "techage:ta3_flipflop_on") - logic.send_on(pos, M(pos)) -end - -local function switch_off(pos) - logic.swap_node(pos, "techage:ta3_flipflop_off") - logic.send_off(pos, M(pos)) -end - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - - return "formspec_version[4]size[10,3.5]".. - "box[0.2,0.2;9.6,0.6;#c6e8ff]" .. - "label[0.4,0.5;" .. minetest.colorize( "#000000", DESCR) .. "]" .. - - "field[1.0,1.5;8,0.6;numbers;" .. S("Insert destination node number(s)") .. ";" .. numbers .. "]" .. - - "button_exit[3.5,2.7;3,0.6;exit;" .. S("Save") .. "]" -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR) - meta:set_string("formspec", formspec(meta)) - return true --res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - if fields.exit and fields.exit ~= "" then - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), DESCR) - end - meta:set_string("formspec", formspec(meta)) - elseif fields.exit == "close" then - meta:set_string("formspec", formspec(meta)) - end -end - -minetest.register_node("techage:ta3_flipflop_off", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_flipflop.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_flipflop_off", DESCR) - logic.infotext(meta, DESCR) - meta:set_string("formspec", formspec(meta)) - end, - - on_timer = function (pos, elapsed) - switch_on(pos) - end, - - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_flipflop_on", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_flipflop_on.png", - }, - - on_timer = function (pos, elapsed) - switch_off(pos) - end, - - on_receive_fields = on_receive_fields, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_flipflop_off" -}) - -minetest.register_craft({ - output = "techage:ta3_flipflop_off", - recipe = { - {"", "group:wood", ""}, - {"default:mese_crystal_fragment", "default:steel_ingot", "techage:vacuum_tube"}, - {"", "group:wood", ""}, - }, -}) - -techage.register_node({ - "techage:ta3_flipflop_off", "techage:ta3_flipflop_on" - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - minetest.get_node_timer(pos):start(0.1) - return true - elseif topic == "off" then - return true - else - return "unsupported" - end - end, - } -) diff --git a/techage/logic/gaze_sensor.lua b/techage/logic/gaze_sensor.lua deleted file mode 100644 index 3144751..0000000 --- a/techage/logic/gaze_sensor.lua +++ /dev/null @@ -1,244 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Gaze Sensor - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic -local CYCLE_TIME = 2 -local DESCR = S("TA4 Gaze Sensor") -local MAX_PLAYER_DIST = 30 - -local WRENCH_MENU = { - { - type = "ascii", - name = "names", - label = S("Player Names"), - tooltip = S("Input the player name(s) separated by blanks.\nIf empty, only the owner is accepted."), - default = "", - }, - { - type = "numbers", - name = "numbers", - label = S("Number"), - tooltip = S("Destination block number(s)"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command1", - label = "On " .. S("Command"), - tooltip = S("Command to send when sensor is viewed"), - default = "on", - }, - { - type = "ascii", - name = "command2", - label = "Off " .. S("Command"), - tooltip = S("Command to send when sensor is no longer viewed"), - default = "off", - }, -} - -local function switch_on(pos) - if logic.swap_node(pos, "techage:ta4_gaze_sensor_on") then - logic.send_cmnd(pos, "command1", "on") - end -end - -local function switch_off(pos) - if logic.swap_node(pos, "techage:ta4_gaze_sensor_off") then - logic.send_cmnd(pos, "command2", "off") - end -end - -local function get_players(pos) - local meta = minetest.get_meta(pos) - local names = meta:get_string("names") or "" - local t = string.split(names, " ") or {} - t[#t + 1] = meta:get_string("owner") - return t -end - -local function player_focuses_block(pos, name, obj) - obj = obj or minetest.get_player_by_name(name) - if obj then - local player_pos = obj:get_pos() - player_pos.y = player_pos.y + 1.5 - local dist = vector.distance(pos, player_pos) - if dist < MAX_PLAYER_DIST then - local dir = obj:get_look_dir() - if dir then - local vec1 = vector.multiply(dir, dist) - local pos1 = vector.round(vector.add(player_pos, vec1)) - if vector.equals(pos, pos1) then - local item = obj:get_wielded_item() - if not item or item:get_name() ~= "techage:end_wrench" then - return true - end - end - end - end - end - return false -end - -local function scan_for_player(pos) - local mem = techage.get_mem(pos) - mem.players = mem.players or get_players(pos) - if mem.players[1] == "***" then - for _, obj in ipairs(minetest.get_objects_inside_radius(pos, MAX_PLAYER_DIST)) do - if player_focuses_block(pos, "", obj) then - mem.player_name = obj:get_player_name() - return true - end - end - else - for _, name in ipairs(mem.players) do - if player_focuses_block(pos, name, nil) then - mem.player_name = name - return true - end - end - end - mem.player_name = "" - return false -end - -local function ta_after_formspec(pos, fields, playername) - if fields.save then - local mem = techage.get_mem(pos) - mem.players = nil - end -end - -minetest.register_node("techage:ta4_gaze_sensor_off", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_gaze_sensor.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta4_gaze_sensor_off", DESCR) - logic.infotext(meta, DESCR) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_timer = function (pos, elapsed) - if scan_for_player(pos) then - switch_on(pos) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - return logic.set_numbers(pos, numbers, player_name, DESCR) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - ta4_formspec = WRENCH_MENU, - ta_after_formspec = ta_after_formspec, - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_gaze_sensor_on", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_gaze_sensor_on.png", - }, - - on_timer = function (pos, elapsed) - if not scan_for_player(pos) then - switch_off(pos) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - return logic.set_numbers(pos, numbers, player_name, DESCR) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - ta4_formspec = WRENCH_MENU, - ta_after_formspec = ta_after_formspec, - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta4_gaze_sensor_off" -}) - -minetest.register_craft({ - output = "techage:ta4_gaze_sensor_off", - recipe = { - {"dye:blue", "techage:aluminum", "dye:blue"}, - {"default:copper_ingot", "techage:ta4_wlanchip", "default:wood"}, - }, -}) - -techage.register_node({ - "techage:ta4_gaze_sensor_off", "techage:ta4_gaze_sensor_on", - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "name" then - local mem = techage.get_mem(pos) - return mem.player_name or "" - elseif topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta4_gaze_sensor_on" then - return "on" - else - return "off" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 144 then -- Player Name - local mem = techage.get_mem(pos) - return 0, mem.player_name or "" - elseif topic == 142 then -- Binary State - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta4_gaze_sensor_on" then - return 0, {1} - else - return 0, {0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - } -) diff --git a/techage/logic/lib.lua b/techage/logic/lib.lua deleted file mode 100644 index 2938e73..0000000 --- a/techage/logic/lib.lua +++ /dev/null @@ -1,110 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Logic library - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -techage.logic = {} - -local Face2Dir = {[0]= - {x=0, y=0, z=1}, - {x=1, y=0, z=0}, - {x=0, y=0, z=-1}, - {x=-1, y=0, z=0}, - {x=0, y=-1, z=0}, - {x=0, y=1, z=0} -} - --- Determine the destination position based on the position, --- the node param2, and a route table like : {0,0,3} --- 0 = forward, 1 = right, 2 = backward, 3 = left -function techage.logic.dest_pos(pos, param2, route) - local p2 = param2 - for _,dir in ipairs(route) do - p2 = (param2 + dir) % 4 - pos = vector.add(pos, Face2Dir[p2]) - end - return pos, p2 -end - -function techage.logic.swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return false - end - node.name = name - minetest.swap_node(pos, node) - return true -end - -function techage.logic.after_place_node(pos, placer, name, descr) - local meta = M(pos) - local own_num = techage.add_node(pos, name) - meta:set_string("node_number", own_num) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", descr.." -") -end - -function techage.logic.send_on(pos, meta, time) - local own_num = meta:get_string("node_number") or "" - local numbers = meta:get_string("numbers") or "" - if time and time > 0 then - minetest.get_node_timer(pos):start(time) - end - techage.send_multi(own_num, numbers, "on") - return own_num == numbers -end - -function techage.logic.send_cmnd(pos, ident, default, time) - local meta = M(pos) - local s = meta:contains(ident) and meta:get_string(ident) or default - local command, payload = unpack(string.split(s, " ", false, 1)) - local own_num = meta:get_string("node_number") or "" - local numbers = meta:get_string("numbers") or "" - if time and time > 0 then - minetest.get_node_timer(pos):start(time) - end - if command and command ~= "" then - techage.send_multi(own_num, numbers, command, payload) - end -end - -function techage.logic.send_off(pos, meta) - local own_num = meta:get_string("node_number") or "" - local numbers = meta:get_string("numbers") or "" - techage.send_multi(own_num, numbers, "off") -end - -function techage.logic.infotext(meta, descr, text) - local own_num = meta:get_string("node_number") or "" - local numbers = meta:get_string("numbers") or "" - if numbers ~= "" then - meta:set_string("infotext", descr.." "..own_num..": "..S("connected with").." "..numbers) - elseif text then - meta:set_string("infotext", descr.." "..own_num..": "..text) - else - meta:set_string("infotext", descr.." "..own_num) - end -end - -function techage.logic.set_numbers(pos, numbers, player_name, descr) - if techage.check_numbers(numbers, player_name) then - local meta = M(pos) - meta:set_string("numbers", numbers) - techage.logic.infotext(meta, descr) - return true - end - return false -end diff --git a/techage/logic/light_detector.lua b/techage/logic/light_detector.lua deleted file mode 100755 index 4072f88..0000000 --- a/techage/logic/light_detector.lua +++ /dev/null @@ -1,189 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Light Detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end - -local logic = techage.logic -local CYCLE_TIME = 2 - -local function switch_off(pos) - local node = minetest.get_node(pos) - if node.name == "techage:ta3_lightdetector_on" then - logic.swap_node(pos, "techage:ta3_lightdetector_off") - logic.send_off(pos, M(pos)) - end -end - -local function switch_on(pos) - logic.swap_node(pos, "techage:ta3_lightdetector_on") - if logic.send_on(pos, M(pos)) then - minetest.after(1, switch_off, pos) - end -end - -local function node_timer(pos) - - local nvm = techage.get_nvm(pos) - - local trigger = nvm.mode or 7 - - local pos_above = {x = pos.x, y = pos.y + 1, z = pos.z} - if minetest.get_node_light(pos_above, nil) == nil then - switch_off(pos) - return true - end - - if minetest.get_node_light(pos_above, nil) > trigger then - switch_on(pos) - else - switch_off(pos) - end - return true -end - -local function formspec(meta, nvm) - local numbers = meta:get_string("numbers") or "" - local dropdown_label = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15" -- Has to be a cleaner way of doing this, but it's just easier this way - return "size[7.5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "label[0.2,1.6;"..S("Send signal if light level is above:").."]".. - "dropdown[0.2,2.1;7.3,1;mode;"..dropdown_label.."; "..(nvm.mode or 7).."]".. - "button_exit[2,3.2;3,1;accept;"..S("accept").."]" -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - local nvm = techage.get_nvm(pos) - - if fields.accept then - nvm.mode = tonumber(fields.mode) or 7 - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Light Detector")) - end - meta:set_string("formspec", formspec(meta, nvm)) - end -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Light Detector")) - meta:set_string("formspec", formspec(meta)) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -minetest.register_node("techage:ta3_lightdetector_off", { - description = S("TA3 Light Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_lightdetector.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR90", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta3_lightdetector_off", S("TA3 Light Detector")) - logic.infotext(meta, S("TA3 Light Detector")) - meta:set_string("formspec", formspec(meta, nvm)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = on_receive_fields, - on_timer = node_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_lightdetector_on", { - description = "TA3 Light Detector (On)", - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_lightdetector_on.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR90", - }, - on_receive_fields = on_receive_fields, - on_timer = node_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_lightdetector_off" -}) - -minetest.register_craft({ - output = "techage:ta3_lightdetector_off", - recipe = { - {"", "group:wood", "default:glass"}, - {"", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", "default:mese_crystal"}, - }, -}) - -techage.register_node({"techage:ta3_lightdetector_off", "techage:ta3_lightdetector_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_lightdetector_on" then - return "on" - else - return "off" - end - elseif topic == "light_level" then -- Allow finding the specific light level - local pos_above = {x = pos.x, y = pos.y + 1, z = pos.z} - return minetest.get_node_light(pos_above, nil) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then -- Binary State - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_lightdetector_on" then - return 0, {1} - else - return 0, {0} - end - elseif topic == 143 then -- Allow finding the specific light level - local pos_above = {x = pos.x, y = pos.y + 1, z = pos.z} - return 0, {minetest.get_node_light(pos_above, nil)} - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/logic/logic_block.lua b/techage/logic/logic_block.lua deleted file mode 100644 index e15d652..0000000 --- a/techage/logic/logic_block.lua +++ /dev/null @@ -1,435 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Logic Block 2 - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic -local NUM_RULES = 4 - -local HELP = S("Send an 'on'/'off' command if the\nexpression becomes true.\n") .. - S("\nRule:\n = on/off if is true\n") .. - S("\n is the block number to which the\ncommand should be sent.\n") .. - S("\n is a boolean expression\nwhere input numbers are evaluated.\n") .. - S("\nExamples:\n1234 == on\n1234 == off\n1234 == on and 2345 == off\n2345 ~= 3456\n") .. - S("\nValid operators:\nand or on off me == ~= ( )\n") .. - S("'~=' means: not equal\n") .. - S("'me' has to be used for the own block number.\n") .. - S("\nAll rules are checked with each received\ncommand.") .. - S("\nThe internal processing time for all\ncommands is 100 ms.") - -local ValidSymbols = { - ["me"] = true, - ["and"] = true, - ["or"] = true, - ["on"] = true, - ["off"] = true, - ["=="] = true, - ["~="] = true, - ["("] = true, - [")"] = true, -} - -local Dropdown = { - [""] = 1, - ["on"] = 2, - ["off"] = 3 -} - -local function check_expr(pos, expr) - local nvm = techage.get_nvm(pos) - local origin = expr - -- Add blanks for the syntax check - expr = expr:gsub("==", " == ") - expr = expr:gsub("~=", " ~= ") - expr = expr:gsub("%(", " ( ") - expr = expr:gsub("%)", " ) ") - - -- First syntax check - local old_sym = "or" -- valid default value - for sym in expr:gmatch("[^%s]+") do - if not ValidSymbols[sym] and string.find(sym, '^[0-9]+$') == nil then - return "Unexpected symbol '"..sym.."'" - end - if string.find(sym, '^[0-9]+$') and sym == nvm.own_num then - return "Invalid node number '"..sym.."'" - end - -- function call check - if sym == "(" and (old_sym ~= "and" and old_sym ~= "or") then - return "Syntax error at '" .. sym .. "'" - end - old_sym = sym - end - -- Second syntax check - local code, _ = loadstring("return " .. expr) - if not code then - return "Syntax error in '" .. origin .. "'" - end -end - -local function check_num(pos, num, player_name) - local nvm = techage.get_nvm(pos) - - if num ~= "me" and (num == nvm.own_num or - not techage.check_numbers(num, player_name)) then - return "Invalid node number '"..num.."'" - end -end - -local function debug(mem, text) - mem.debug = mem.debug or {} - if #mem.debug > 20 then - table.remove(mem.debug, 1) - end - local s = string.format("%.3f", techage.SystemTime) .. " s: " .. text - table.insert(mem.debug, s) -end - -local function send(pos, num, val) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - debug(mem, "(outp) " .. num .. " = " .. val) - - if num == "me" then - nvm.outp_tbl = nvm.outp_tbl or {} - nvm.outp_tbl.me = val - -- set the input directly - nvm.inp_tbl = nvm.inp_tbl or {} - nvm.inp_tbl.me = val - else - nvm.outp_tbl = nvm.outp_tbl or {} - nvm.outp_tbl[num] = val - nvm.own_num = nvm.own_num or M(pos):get_string("node_number") - techage.send_single(nvm.own_num, num, val) - end -end - -local function get_inputs(pos) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - -- old data is needed for formspec 'input' values - nvm.old_inp_tbl = table.copy(nvm.inp_tbl or {}) - for _, num in ipairs(mem.outp_num or {}) do - nvm.old_inp_tbl[num] = nvm.outp_tbl[num] or "off" - end - return nvm.old_inp_tbl -end - -local function check_syntax(pos, line, owner, outp, expr) - local err = check_num(pos, outp, owner) - if not err then - err = check_expr(pos, expr) - if not err then - return true, "ok" - end - end - return false, "Error(" .. line .. "): " .. err -end - -local function compile(nvm, str) - if str then - local code, _ = loadstring(str) - if code then - nvm.error = "ok" - return code - else - nvm.error = "Unknown compile error" - end - end -end - -local function data(nvm) - local inp = {} - local outp = {} - for num, val in pairs(nvm.old_inp_tbl or {}) do - if num == nvm.own_num then num = "me" end - inp[#inp+1] = num .. " = " .. tostring(val) - end - for num, val in pairs(nvm.outp_tbl or {}) do - if num == nvm.own_num then num = "me" end - outp[#outp+1] = num .. " = " .. tostring(val) - end - return table.concat(inp, ", "), table.concat(outp, ", ") -end - -local function get_code(pos, nvm, mem) - local meta = M(pos) - local tbl = {"local inputs = get_inputs(pos) or {}"} - local owner = M(pos):get_string("owner") - nvm.own_num = nvm.own_num or M(pos):get_string("node_number") - mem.outp_num = {} - - for i = 1,NUM_RULES do - local outp = meta:get_string("outp" .. i) - local val = meta:get_string("val" .. i) - local expr = meta:get_string("expr" .. i) - - if outp ~= "" and val ~= "" and expr ~= "" then - local res, err = check_syntax(pos, i, owner, outp, expr) - if res then - expr = string.gsub(expr, '([0-9]+)', 'inputs["%1"]') - expr = string.gsub(expr, 'me', 'inputs["me"]') - expr = string.gsub(expr, 'on', '"on"') - expr = string.gsub(expr, 'off', '"off"') - tbl[#tbl + 1] = "if "..expr.." then send(pos, '"..outp.."', '"..val.."') end" - table.insert(mem.outp_num, outp) - else - nvm.error = err - return - end - end - end - - local str = table.concat(tbl, "\n") - local code = compile(nvm, str) - if code then - local env = {} - env.send = send - env.pos = pos - env.get_inputs = get_inputs - setfenv(code, env) - - return code - end -end - -local function execute(pos) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.code = mem.code or get_code(pos, nvm, mem) - if mem.code then - local res, _ = pcall(mem.code) - if not res then - nvm.error = "Unknown runtime error" - mem.code = nil - end - end -end - -local function rules(meta) - local tbl = {} - - tbl[#tbl + 1] = "label[-0.2,0;]" - tbl[#tbl + 1] = "label[1.4,0;=]" - tbl[#tbl + 1] = "label[1.8,0;]" - tbl[#tbl + 1] = "label[3.5,0;if]" - tbl[#tbl + 1] = "label[4.2,0; is true]" - - - for i = 1,NUM_RULES do - local y1 = (i * 0.9) - 0.1 - local y2 = (i * 0.9) - 0.2 - local y3 = (i * 0.9) - 0.3 - local outp = meta:get_string("outp" .. i) - local val = meta:get_string("val" .. i) - local expr = meta:get_string("expr" .. i) - val = Dropdown[val] or 1 - - tbl[#tbl + 1] = "field[0," .. y1 .. ";1.6,1;outp" .. i ..";;" .. outp .. "]" - tbl[#tbl + 1] = "label[1.4," .. y2 .. ";=]" - tbl[#tbl + 1] = "dropdown[1.8," .. y3 .. ";1.6,1;val" .. i ..";,on,off;" .. val .. "]" - tbl[#tbl + 1] = "label[3.5," .. y2 .. ";if]" - tbl[#tbl + 1] = "field[4.2," .. y1 .. ";5.6,1;expr" .. i ..";;" .. expr .. "]" - end - return table.concat(tbl, "") -end - -local function formspec(pos, meta) - local nvm = techage.get_nvm(pos) - local err = nvm.error or "ok" - err = minetest.formspec_escape(err) - nvm.io_tbl = nvm.io_tbl or {} - local inputs, outputs = data(nvm) - local bt = nvm.blocking_time or 1 - return "size[10,8.2]" .. - "tabheader[0,0;tab;"..S("Rules") .. "," .. S("Help") .. "," .. S("Debug") .. ";1;;true]" .. - "container[0.4,0.1]" .. - rules(meta) .. - "container_end[]" .. - - "label[0.2,4.4;" .. S("Blocking Time") .. "]".. - "field[4.6,4.5;2,1;bt;;" .. bt .. "]".. - "label[6.3,4.4;s]".. - - "label[0,5.3;" .. S("Inputs") .. ":]" .. - "label[2,5.3;" .. inputs .."]" .. - "label[0,5.9;" .. S("Outputs") .. ":]" .. - "label[2,5.9;" .. outputs .."]" .. - "label[0,6.5;" .. S("Syntax") .. ":]" .. - "label[2,6.5;" .. err .. "]" .. - "button[1.5,7.5;3,1;update;" .. S("Update") .. "]" .. - "button[5.6,7.5;3,1;store;" .. S("Store") .. "]" -end - -local function formspec_help() - return "size[10,8.2]" .. - "tabheader[0,0;tab;"..S("Rules") .. "," .. S("Help") .. "," .. S("Debug") .. ";2;;true]" .. - "textarea[0.3,0.3;9.9,8.5;;;"..minetest.formspec_escape(HELP).."]" -end - -local function formspec_debug(mem) - mem.debug = mem.debug or {} - local s = table.concat(mem.debug, "\n") - return "size[10,8.2]" .. - "tabheader[0,0;tab;"..S("Rules") .. "," .. S("Help") .. "," .. S("Debug") .. ";3;;true]" .. - "textarea[0.3,0.3;9.9,8.5;;;"..minetest.formspec_escape(s).."]" .. - "button[1.5,7.5;3,1;update2;" .. S("Update") .. "]" .. - "button[5.6,7.5;3,1;clear;" .. S("Clear") .. "]" -end - -minetest.register_node("techage:ta3_logic2", { - description = S("TA3 Logic Block"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_logic.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta3_logic2", S("TA3 Logic Block")) - logic.infotext(meta, S("TA3 Logic Block")) - meta:set_string("formspec", formspec(pos, meta)) - meta:set_string("owner", placer:get_player_name()) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - - if fields.store then - for i = 1,NUM_RULES do - meta:set_string("outp" .. i, fields["outp" .. i] or "") - meta:set_string("val" .. i, fields["val" .. i] or "") - meta:set_string("expr" .. i, fields["expr" .. i] or "") - end - local nvm = techage.get_nvm(pos) - nvm.blocking_time = tonumber(fields.bt) or 0.1 - nvm.inp_tbl = {me = "off"} - nvm.outp_tbl = {} - elseif fields.update2 then - local mem = techage.get_mem(pos) - meta:set_string("formspec", formspec_debug(mem)) - elseif fields.clear then - local mem = techage.get_mem(pos) - mem.debug = {} - meta:set_string("formspec", formspec_debug(mem)) - end - - if fields.tab == "2" then - meta:set_string("formspec", formspec_help()) - elseif fields.tab == "3" then - local mem = techage.get_mem(pos) - meta:set_string("formspec", formspec_debug(mem)) - else - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - mem.code = nil - get_code(pos, nvm, mem) - meta:set_string("formspec", formspec(pos, meta)) - end - end, - - on_timer = function(pos) - execute(pos) - return false - end, - - on_rightclick = function(pos, node, clicker) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(pos, meta)) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta3_logic2", - recipe = { - {"", "group:wood", ""}, - {"techage:vacuum_tube", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", ""}, - }, -}) - -techage.register_node({"techage:ta3_logic2"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - nvm.own_num = nvm.own_num or M(pos):get_string("node_number") - nvm.blocking_time = nvm.blocking_time or M(pos):get_float("blocking_time") - nvm.inp_tbl = nvm.inp_tbl or {} - - if src ~= nvm.own_num then - if topic == "on" then - debug(mem, "(inp) " .. src .. " = on") - nvm.inp_tbl[src] = "on" - elseif topic == "off" then - debug(mem, "(inp) " .. src .. " = off") - nvm.inp_tbl[src] = "off" - else - debug(mem, "(inp) invalid command") - return "unsupported" - end - - local t = math.max((mem.ttl or 0) - techage.SystemTime, 0.1) - minetest.get_node_timer(pos):start(t) - mem.ttl = techage.SystemTime + (nvm.blocking_time or 0) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - nvm.own_num = nvm.own_num or M(pos):get_string("node_number") - nvm.blocking_time = nvm.blocking_time or M(pos):get_float("blocking_time") - nvm.inp_tbl = nvm.inp_tbl or {} - - if src ~= nvm.own_num then - if topic == 1 and payload[1] == 1 then - debug(mem, "(inp) " .. src .. " = on") - nvm.inp_tbl[src] = "on" - return 0 - elseif topic == 1 and payload[1] == 0 then - debug(mem, "(inp) " .. src .. " = off") - nvm.inp_tbl[src] = "off" - return 0 - else - debug(mem, "(inp) invalid command") - return 2 - end - local t = math.max((mem.ttl or 0) - techage.SystemTime, 0.1) - minetest.get_node_timer(pos):start(t) - mem.ttl = techage.SystemTime + (nvm.blocking_time or 0) - end - end, -}) diff --git a/techage/logic/lua_logic.lua b/techage/logic/lua_logic.lua deleted file mode 100644 index 48e3418..0000000 --- a/techage/logic/lua_logic.lua +++ /dev/null @@ -1,264 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Lua Logic Block (Deprecated and replaced by "techage:ta3_logic2") - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local logic = techage.logic - --- mem.inp_tbl = { --- n001 = true, -- "on" received --- n002 = false, -- "off" received --- inp = true, -- last input --- outp = false, -- last output --- } - -local ValidSymbols = { - ["if"] = true, - ["then"] = true, - ["else"] = true, - ["end"] = true, - ["return"] = true, - ["not"] = true, - ["and"] = true, - ["or"] = true, - ["inp"] = true, - ["outp"] = true, - ["true"] = true, - ["false"] = true, - ["nil"] = true, - ["=="] = true, - ["~="] = true, - ["("] = true, - [")"] = true, -} -local function check(expression) - for _, sym in ipairs(string.split(expression, " ")) do - if not ValidSymbols[sym] and string.find(sym, '^[n0-9]+$') == nil then - return false, "Error: Invalid symbol '"..sym.."'" - end - end - return true, "ok" -end - -local function compile(nvm, expression) - local res, err = check(expression) - if res then - local code, err = loadstring(expression, "") - if code then - nvm.code = code - nvm.error = "ok" - else - nvm.code = nil - nvm.error = err - end - else - nvm.code = nil - nvm.error = err - end -end - -local function get_code(pos, nvm) - local meta = M(pos) - local if_expr = meta:get_string("if_expr") or "" - local then_expr = meta:get_string("then_expr") or "" - local else_expr = meta:get_string("else_expr") or "" - local expr = "if "..if_expr.." then return "..then_expr.." else return "..else_expr.." end" - compile(nvm, expr) - return nvm.code -end - -local function eval(pos, nvm) - nvm.code = nvm.code or get_code(pos, nvm) - if nvm.code then - setfenv(nvm.code, nvm.inp_tbl) - local res, sts = pcall(nvm.code) - if res then - nvm.error = "ok" - if sts == true and nvm.inp_tbl.outp ~= true then - nvm.inp_tbl.outp = sts - return "on" - elseif sts == false and nvm.inp_tbl.outp ~= false then - nvm.inp_tbl.outp = sts - return "off" - end - else - nvm.error = "Error: "..sts - end - end -end - -local function data(nvm) - local tbl = {"inp = "..dump(nvm.inp_tbl.inp), "outp = "..dump(nvm.inp_tbl.outp)} - for k,v in pairs(nvm.inp_tbl) do - if k ~= "inp" and k ~= "outp" then - tbl[#tbl+1] = k.." = "..dump(v) - end - end - return table.concat(tbl, ", ") -end - -local function formspec(pos, meta) - local nvm = techage.get_nvm(pos) - local numbers = meta:get_string("numbers") or "" - local if_expr = meta:get_string("if_expr") or "" - local then_expr = meta:get_string("then_expr") or "" - local else_expr = meta:get_string("else_expr") or "" - local err = nvm.error or "ok" - if err ~= "ok" then - err = string.sub(err, 15) - end - err = minetest.formspec_escape(err) - nvm.inp_tbl = nvm.inp_tbl or {inp = false, outp = false} - local data = data(nvm) - return "size[9,8]".. - "background[0,0;9,1.3;techage_formspec_bg.png]".. - "field[0.5,0.2;8.5,2;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "label[0,1.4;Variables: "..data.."]".. - "label[0,2;Valid symbols: not and or true false nil == ~= ( )]".. - "background[0,2.6;9,4;techage_formspec_bg.png]".. - "label[0.1,2.8;if]".. - "field[0.8,2.9;7,1;if_expr;;"..if_expr.."]" .. - "label[7.6,2.8;then]".. - "label[0.6,3.8;return]".. - "field[2,3.9;7,1;then_expr;;"..then_expr.."]" .. - "label[0.1,4.5;else]".. - "label[0.6,5.2;return]".. - "field[2,5.3;7,1;else_expr;;"..else_expr.."]" .. - "label[0.1,6;end]".. - "label[0,6.8;Result: "..err.."]".. - "button[2,7.3;2.5,1;update;"..S("Update").."]".. - "button[5,7.3;2.5,1;store;"..S("Store").."]" -end - -minetest.register_node("techage:ta3_logic", { - description = S("TA3 Logic Block"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_logic.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.inp_tbl = {inp = false, outp = false} - logic.after_place_node(pos, placer, "techage:ta3_logic", S("TA3 Logic Block")) - logic.infotext(meta, S("TA3 Logic Block")) - meta:set_string("formspec", formspec(pos, meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - if fields.numbers and fields.numbers ~= "" then - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Logic Block")) - end - end - if fields.if_expr and fields.if_expr ~= "" then - meta:set_string("if_expr", fields.if_expr) - end - if fields.then_expr and fields.then_expr ~= "" then - meta:set_string("then_expr", fields.then_expr) - end - if fields.else_expr and fields.else_expr ~= "" then - meta:set_string("else_expr", fields.else_expr) - end - if fields.store then - get_code(pos, nvm) - end - meta:set_string("formspec", formspec(pos, meta)) - end, - - on_timer = function(pos,elapsed) - local nvm = techage.get_nvm(pos) - local topic = eval(pos, nvm) - if topic then - local meta = M(pos) - local own_num = meta:get_string("node_number") or "" - local numbers = meta:get_string("numbers") or "" - techage.send_multi(own_num, numbers, topic) - end - return false - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Logic Block")) - meta:set_string("formspec", formspec(pos, meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - drop = "techage:ta3_logic2", - sounds = default.node_sound_wood_defaults(), -}) - - --- Deprecated and replaced by "techage:ta3_logic2" ---minetest.register_craft({ --- output = "techage:ta3_logic", --- recipe = { --- {"", "group:wood", ""}, --- {"", "default:copper_ingot", "techage:vacuum_tube"}, --- {"", "group:wood", ""}, --- }, ---}) - -techage.register_node({"techage:ta3_logic"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - nvm.inp_tbl = nvm.inp_tbl or {outp = false} - - if topic == "on" then - nvm.inp_tbl.inp = true - nvm.inp_tbl["n"..src] = true - elseif topic == "off" then - nvm.inp_tbl.inp = false - nvm.inp_tbl["n"..src] = false - else - return "unsupported" - end - minetest.get_node_timer(pos):start(0.1) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - nvm.inp_tbl.inp = true - nvm.inp_tbl["n"..src] = true - return 0 - elseif topic == 1 and payload[1] == 0 then - nvm.inp_tbl.inp = false - nvm.inp_tbl["n"..src] = false - return 0 - else - return 2 - end - end, - on_node_load = function(pos) - end, -}) diff --git a/techage/logic/mba_detector.lua b/techage/logic/mba_detector.lua deleted file mode 100644 index ab5d744..0000000 --- a/techage/logic/mba_detector.lua +++ /dev/null @@ -1,116 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Mapblock Active Detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic - -minetest.register_node("techage:ta4_mbadetector", { - description = "TA4 Mapblock Active Detector", - inventory_image = 'techage_smartline_mba_detector_inv.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_mba_detector.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta4_mbadetector", S("TA4 Mapblock Active Detector")) - logic.infotext(meta, S("TA4 Mapblock Active Detector")) - minetest.get_node_timer(pos):start(1) - end, - - on_timer = function(pos, elapsed) - local mem = techage.get_mem(pos) - mem.gametime = minetest.get_gametime() - return true - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_mbadetector", - recipe = { - {"", "group:wood", "default:mese_crystal"}, - {"", "techage:vacuum_tube", "default:copper_ingot"}, - {"", "group:wood", ""}, - }, -}) - -techage.register_node({"techage:ta4_mbadetector"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - if minetest.compare_block_status then - if minetest.compare_block_status(pos, "active") then - return "on" - else - return "off" - end - else - local mem = techage.get_mem(pos) - local res = mem.gametime and mem.gametime > (minetest.get_gametime() - 2) - return res and "on" or "off" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then -- Binary State - if minetest.compare_block_status then - if minetest.compare_block_status(pos, "active") then - return 0, {1} - else - return 0, {0} - end - else - local mem = techage.get_mem(pos) - local res = mem.gametime and mem.gametime > (minetest.get_gametime() - 2) - return 0, {res and 1 or 0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(1) - end, - } -) diff --git a/techage/logic/mesecons_converter.lua b/techage/logic/mesecons_converter.lua deleted file mode 100644 index e6a5cae..0000000 --- a/techage/logic/mesecons_converter.lua +++ /dev/null @@ -1,199 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Mesecons converter - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic -local OVER_LOAD_MAX = 10 -local CYCLE_TIME = 2 - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - return "size[7.5,3]".. - "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "button_exit[2,2;3,1;exit;"..S("Save").."]" -end - -local function send_message(pos, topic) - local meta = M(pos) - local mem = techage.get_mem(pos) - mem.overload_cnt = (mem.overload_cnt or 0) + 1 - if mem.overload_cnt > OVER_LOAD_MAX then - logic.infotext(M(pos), S("TA3 Mesecons Converter"), "fault (overloaded)") - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter") - minetest.get_node_timer(pos):stop() - return false - end - local own_num = meta:get_string("node_number") - local numbers = meta:get_string("numbers") - techage.send_multi(own_num, numbers, topic) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Mesecons Converter")) - meta:set_string("formspec", formspec(meta)) - end - minetest.get_node_timer(pos):start(CYCLE_TIME) -end - -local function on_timer(pos,elapsed) - local mem = techage.get_mem(pos) - mem.overload_cnt = 0 - return true -end - -local function techage_set_numbers(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Mesecons Converter")) - meta:set_string("formspec", formspec(meta)) - return res -end - -local function after_dig_node(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - mesecon.on_dignode(pos, oldnode) -end - - -minetest.register_node("techage:ta3_mesecons_converter", { - description = S("TA3 Mesecons Converter"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_mesecons_converter.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local mem = techage.get_mem(pos) - logic.after_place_node(pos, placer, "techage:ta3_mesecons_converter", S("TA3 Mesecons Converter")) - logic.infotext(meta, S("TA3 Mesecons Converter")) - meta:set_string("formspec", formspec(meta)) - mem.overload_cnt = -OVER_LOAD_MAX -- to prevent overload after placing - minetest.get_node_timer(pos):start(CYCLE_TIME) - mesecon.on_placenode(pos, minetest.get_node(pos)) - end, - - on_receive_fields = on_receive_fields, - on_timer = on_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - - mesecons = { - receptor = { - state = mesecon.state.off, - rules = mesecon.rules.default, - }, - effector = { - rules = mesecon.rules.default, - action_on = function(pos, node) - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter_on") - send_message(pos, "on") - end, - action_off = function(pos, node) - end, - action_change = function(pos, node) - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter_on") - send_message(pos, "on") - end, - } - }, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_mesecons_converter_on", { - description = S("TA3 Mesecons Converter"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_mesecons_converter.png", - }, - - on_receive_fields = on_receive_fields, - on_timer = on_timer, - techage_set_numbers = techage_set_numbers, - after_dig_node = after_dig_node, - - mesecons = { - receptor = { - state = mesecon.state.off, - rules = mesecon.rules.default, - }, - effector = { - rules = mesecon.rules.default, - action_on = function(pos, node) - end, - action_off = function(pos, node) - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter") - send_message(pos, "off") - end, - action_change = function(pos, node) - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter") - send_message(pos, "off") - end, - } - }, - - paramtype = "light", - light_source = 5, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_mesecons_converter", -}) - -minetest.register_craft({ - output = "techage:ta3_mesecons_converter", - recipe = { - {"techage:ta3_repeater", "mesecons:wire_00000000_off"}, - }, -}) - -techage.register_node({"techage:ta3_mesecons_converter", "techage:ta3_mesecons_converter_on"}, { - on_recv_message = function(pos, src, topic, payload) - local mem = techage.get_mem(pos) - mem.overload_cnt = (mem.overload_cnt or 0) + 1 - if mem.overload_cnt > OVER_LOAD_MAX then - logic.infotext(M(pos), S("TA3 Mesecons Converter"), "fault (overloaded)") - minetest.get_node_timer(pos):stop() - return false - elseif topic == "on" then - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter_on") - mesecon.receptor_on(pos, mesecon.rules.default) - elseif topic == "off" then - techage.logic.swap_node(pos, "techage:ta3_mesecons_converter") - mesecon.receptor_off(pos, mesecon.rules.default) - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/logic/node_detector.lua b/techage/logic/node_detector.lua deleted file mode 100644 index 0ebf3f4..0000000 --- a/techage/logic/node_detector.lua +++ /dev/null @@ -1,407 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Node Detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local MP = minetest.get_modpath("techage") -local mark = dofile(MP .. "/basis/mark_lib.lua") - -local logic = techage.logic -local CYCLE_TIME = 2 -local MAX_BLOCKS = 4 -local DESCR3 = S("TA3 Node Detector") -local DESCR4 = S("TA4 Node Detector") - -local function switch_on3(pos) - if logic.swap_node(pos, "techage:ta3_nodedetector_on") then - logic.send_on(pos, M(pos)) - end -end - -local function switch_off3(pos) - if logic.swap_node(pos, "techage:ta3_nodedetector_off") then - logic.send_off(pos, M(pos)) - end -end - -local function switch_on4(pos) - if logic.swap_node(pos, "techage:ta4_nodedetector_on") then - logic.send_on(pos, M(pos)) - end -end - -local function switch_off4(pos) - if logic.swap_node(pos, "techage:ta4_nodedetector_off") then - logic.send_off(pos, M(pos)) - end -end - -local DropdownValues = { - [S("added")] = 1, - [S("removed")] = 2, - [S("added or removed")] = 3, -} - -local AirLikeBlocks = {"air"} -local kvAirLikeBlocks = {air = 1} - -for i = 1,14 do - -- Add light blocks from the mod "wielded_light" to the air-like blocks - AirLikeBlocks[#AirLikeBlocks + 1] = "wielded_light:" .. i - kvAirLikeBlocks["wielded_light:" .. i] = 1 -end - -local function formspec3(meta, nvm) - local numbers = meta:get_string("numbers") or "" - local label = S("added")..","..S("removed")..","..S("added or removed") - return "size[7.5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,0.6;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "label[0.2,1.6;"..S("Send signal if nodes have been:").."]".. - "dropdown[0.2,2.1;7.3,1;mode;"..label..";"..(nvm.mode or 3).."]".. - "button_exit[2,3.2;3,1;accept;"..S("accept").."]" -end - -local function formspec4(meta, nvm) - local numbers = meta:get_string("numbers") or "" - local label = S("added")..","..S("removed")..","..S("added or removed") - return "size[7.5,6]".. - "box[0,-0.1;7.2,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", DESCR4) .. "]" .. - "button[0.1,0.6;3.6,1;record;" .. S("Record") .. "]" .. - "button[3.9,0.6;3.6,1;done;" .. S("Done") .. "]" .. - "field[0.5,2.6;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "label[0.2,3.6;"..S("Send signal if nodes have been:").."]".. - "dropdown[0.2,4.1;7.3,1;mode;"..label..";"..(nvm.mode or 3).."]".. - "button_exit[2,5.2;3,1;accept;"..S("accept").."]" -end - -local function any_node_changed3(pos) - local nvm = techage.get_nvm(pos) - if not nvm.pos1 or not nvm.pos2 or not nvm.num then - local node = minetest.get_node(pos) - local param2 = (node.param2 + 2) % 4 - nvm.pos1 = logic.dest_pos(pos, param2, {0}) - nvm.pos2 = logic.dest_pos(pos, param2, {0,0,0}) - nvm.num = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, AirLikeBlocks) - return false - end - local num1 = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, AirLikeBlocks) - local num2 = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, {"ignore"}) - - if num2 == 0 and nvm.num ~= num1 then - if nvm.mode == 1 and num1 < nvm.num then - nvm.num = num1 - return true - elseif nvm.mode == 2 and num1 > nvm.num then - nvm.num = num1 - return true - elseif nvm.mode == 3 then - nvm.num = num1 - return true - end - nvm.num = num1 - end - return false -end - -local function any_node_changed4(pos) - local nvm = techage.get_nvm(pos) - nvm.lpos = nvm.lpos or {} - local num = 0 - for _,pos1 in ipairs(nvm.lpos) do - local name = minetest.get_node(pos1).name - if name == "ignore" then return false end - num = num + (kvAirLikeBlocks[name] or 0) - end - if not nvm.num then - nvm.num = num - elseif nvm.num ~= num then - if nvm.mode == 1 and num < nvm.num then - nvm.num = num - return true - elseif nvm.mode == 2 and num > nvm.num then - nvm.num = num - return true - elseif nvm.mode == 3 then - nvm.num = num - return true - end - nvm.num = num - end - return false -end - -local function on_receive_fields3(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local nvm = techage.get_nvm(pos) - local meta = M(pos) - if fields.accept then - nvm.mode = DropdownValues[fields.mode] or 3 - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), DESCR3) - end - end - meta:set_string("formspec", formspec3(meta, nvm)) -end - -local function on_receive_fields4(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local name = player:get_player_name() - local nvm = techage.get_nvm(pos) - local meta = M(pos) - - if fields.accept then - nvm.mode = DropdownValues[fields.mode] or 3 - if techage.check_numbers(fields.numbers, name) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), DESCR4) - end - mark.unmark_all(name) - mark.stop(name) - elseif fields.record then - nvm.lpos = {} - minetest.chat_send_player(name, "[techage] " .. S("Click on all blocks whose positions should be checked")) - mark.start(name, MAX_BLOCKS) - elseif fields.done then - local pos_list = mark.get_poslist(name) - minetest.chat_send_player(name, "[techage] " .. #pos_list.." "..S("block positions are stored.")) - nvm.lpos = pos_list - mark.unmark_all(name) - mark.stop(name) - end - meta:set_string("formspec", formspec4(meta, nvm)) -end - -local function node_timer3(pos) - if any_node_changed3(pos)then - switch_on3(pos) - else - switch_off3(pos) - end - return true -end - -minetest.register_node("techage:ta3_nodedetector_off", { - description = DESCR3, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR270", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_nodedetector.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta3_nodedetector_off", DESCR3) - logic.infotext(meta, DESCR3) - nvm.mode = 3 -- default mode - meta:set_string("formspec", formspec3(meta, nvm)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - any_node_changed3(pos) - end, - - on_timer = node_timer3, - on_receive_fields = on_receive_fields3, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR3) - meta:set_string("formspec", formspec3(meta, techage.get_nvm(pos))) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - is_ground_content = false, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_nodedetector_on", { - description = DESCR3, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png^[transformR270", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_nodedetector_on.png", - }, - - on_timer = node_timer3, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR3) - meta:set_string("formspec", formspec3(meta, techage.get_nvm(pos))) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - is_ground_content = false, - drop = "techage:ta3_nodedetector_off", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), -}) - -local function node_timer4(pos) - if any_node_changed4(pos)then - switch_on4(pos) - else - switch_off4(pos) - end - return true -end - -minetest.register_node("techage:ta4_nodedetector_off", { - description = DESCR4, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png^[transformR270", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_nodedetector.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta4_nodedetector_off", DESCR4) - logic.infotext(meta, DESCR4) - nvm.mode = 3 -- default mode - meta:set_string("formspec", formspec4(meta, nvm)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_timer = node_timer4, - on_receive_fields = on_receive_fields4, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR4) - meta:set_string("formspec", formspec4(meta, techage.get_nvm(pos))) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - is_ground_content = false, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_nodedetector_on", { - description = DESCR4, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png^[transformR270", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_nodedetector_on.png", - }, - - on_timer = node_timer4, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, DESCR4) - meta:set_string("formspec", formspec4(meta, techage.get_nvm(pos))) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_rotate = screwdriver.disallow, - paramtype2 = "facedir", - is_ground_content = false, - drop = "techage:ta4_nodedetector_off", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta3_nodedetector_off", - recipe = { - {"", "group:wood", ""}, - {"", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", "default:mese_crystal"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_nodedetector_off", - recipe = { - {"", "dye:blue", ""}, - {"", "techage:ta3_nodedetector_off", ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) - -techage.register_node({"techage:ta3_nodedetector_off", "techage:ta3_nodedetector_on", - "techage:ta4_nodedetector_off", "techage:ta4_nodedetector_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_nodedetector_off" or node.name == "techage:ta4_nodedetector_off" then - return "off" - else - return "on" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_nodedetector_off" or node.name == "techage:ta4_nodedetector_off" then - return 0, {0} - else - return 0, {1} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/logic/player_detector.lua b/techage/logic/player_detector.lua deleted file mode 100644 index e234b06..0000000 --- a/techage/logic/player_detector.lua +++ /dev/null @@ -1,382 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 & TA4 Player Detector - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local NDEF = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}) end - -local logic = techage.logic -local CYCLE_TIME = 1 - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "1,2,3,4,5,6,7,8", - name = "radius", - label = S("Radius"), - tooltip = S("Search radius"), - default = "4", - }, - { - type = "numbers", - name = "numbers", - label = S("Number"), - tooltip = S("Destination block number"), - default = "", - check = techage.check_numbers, - }, - { - type = "ascii", - name = "command1", - label = "On " .. S("Command"), - tooltip = S("Command to send when player is detected"), - default = "on", - }, - { - type = "ascii", - name = "command2", - label = "Off " .. S("Command"), - tooltip = S("Command to send when player moves away"), - default = "off", - }, -} - -local function switch_on(pos, stage) - if logic.swap_node(pos, "techage:ta"..stage.."_playerdetector_on") then - logic.send_cmnd(pos, "command1", "on") - end -end - -local function switch_off(pos, stage) - if logic.swap_node(pos, "techage:ta"..stage.."_playerdetector_off") then - logic.send_cmnd(pos, "command2", "off") - end -end - -local function scan_for_player(pos) - local nvm = techage.get_nvm(pos) - local meta = minetest.get_meta(pos) - local names = meta:get_string("names") or "" - local radius = meta:contains("radius") and meta:get_int("radius") or 4 - for _, object in pairs(minetest.get_objects_inside_radius(pos, radius)) do - if object:is_player() then - if names == "" then - nvm.player_name = object:get_player_name() - return true - end - for _,name in ipairs(string.split(names, " ")) do - if object:get_player_name() == name then - nvm.player_name = name - return true - end - end - end - end - nvm.player_name = nil - return false -end - -local function formspec_help() - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[3,0;Player Detector Help]".. - "label[0,1;Input the number(s) of the destination node(s).\n".. - "Separate numbers via blanks, like '123 234'.\n\n".. - "Input the player name(s) separated by blanks,\nor empty for all players.]".. - "button_exit[3,5;2,1;exit;close]" -end - - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - local names = meta:get_string("names") or "" - return "size[7,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.3,0.6;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "field[0.3,2;7,1;names;Insert player name(s) (optional):;"..names.."]" .. - "button[0.9,3;2.5,1;help;help]".. - "button_exit[3.5,3;2.5,1;exit;Save]" -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = minetest.get_meta(pos) - if fields.exit == "Save" then - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), NDEF(pos).description) - end - meta:set_string("names", fields.names) - meta:set_string("formspec", formspec(meta)) - elseif fields.help ~= nil then - meta:set_string("formspec", formspec_help()) - elseif fields.exit == "close" then - meta:set_string("formspec", formspec(meta)) - end -end - -minetest.register_node("techage:ta3_playerdetector_off", { - description = S("TA3 Player Detector"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_playerdetector.png", - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_playerdetector_off", S("TA3 Player Detector")) - logic.infotext(meta, S("TA3 Player Detector")) - meta:set_string("formspec", formspec(meta)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = on_receive_fields, - - on_timer = function (pos, elapsed) - if scan_for_player(pos) then - switch_on(pos, 3) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Player Detector")) - meta:set_string("formspec", formspec(meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta3_playerdetector_on", { - description = "TA3 Player Detector", - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_playerdetector_on.png", - }, - on_receive_fields = on_receive_fields, - - on_timer = function (pos, elapsed) - if not scan_for_player(pos) then - switch_off(pos, 3) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Player Detector")) - meta:set_string("formspec", formspec(meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta3_playerdetector_off" -}) - -minetest.register_node("techage:ta4_playerdetector_off", { - description = S("TA4 Player Detector"), - inventory_image = 'techage_smartline_detector_inv.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_detector.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta4_playerdetector_off", S("TA4 Player Detector")) - logic.infotext(meta, S("TA4 Player Detector")) - meta:set_string("formspec", formspec(meta)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = on_receive_fields, - - on_timer = function (pos, elapsed) - if scan_for_player(pos) then - switch_on(pos, 4) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA4 Player Detector")) - meta:set_string("formspec", formspec(meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - ta4_formspec = WRENCH_MENU, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta4_playerdetector_on", { - description = "TA4 Player Detector", - inventory_image = 'techage_smartline_detector_inv.png', - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_smartline_detector_on.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - on_receive_fields = on_receive_fields, - - on_timer = function (pos, elapsed) - if not scan_for_player(pos) then - switch_off(pos, 4) - end - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA4 Player Detector")) - meta:set_string("formspec", formspec(meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - ta4_formspec = WRENCH_MENU, - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - drop = "techage:ta4_playerdetector_off" -}) - -minetest.register_craft({ - output = "techage:ta3_playerdetector_off", - recipe = { - {"", "group:wood", "default:mese_crystal"}, - {"", "default:copper_ingot", "techage:vacuum_tube"}, - {"", "group:wood", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_playerdetector_off", - recipe = { - {"", "techage:aluminum", "dye:blue"}, - {"", "default:copper_ingot", "techage:ta4_wlanchip"}, - }, -}) - -techage.register_node({ - "techage:ta3_playerdetector_off", "techage:ta3_playerdetector_on", - "techage:ta4_playerdetector_off", "techage:ta4_playerdetector_on" - }, { - on_recv_message = function(pos, src, topic, payload) - if topic == "name" then - local nvm = techage.get_nvm(pos) - return nvm.player_name or "" - elseif topic == "state" then - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_playerdetector_on" or - node.name == "techage:ta4_playerdetector_on" then - return "on" - else - return "off" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 144 then -- Player Name - local nvm = techage.get_nvm(pos) - return 0, nvm.player_name or "" - elseif topic == 142 then -- Binary State - local node = techage.get_node_lvm(pos) - if node.name == "techage:ta3_playerdetector_on" or - node.name == "techage:ta4_playerdetector_on" then - return 0, {1} - else - return 0, {0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - } -) diff --git a/techage/logic/programmer.lua b/techage/logic/programmer.lua deleted file mode 100644 index 0c02947..0000000 --- a/techage/logic/programmer.lua +++ /dev/null @@ -1,100 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Number programmer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local function join_to_string(tbl) - local t = {} - for key,_ in pairs(tbl) do - t[#t + 1] = key - end - return table.concat(t, " ") -end - -local function reset_programmer(itemstack, user, pointed_thing) - user:get_meta():set_string("techage_prog_numbers", "") - minetest.chat_send_player(user:get_player_name(), S("[TechAge Programmer] programmer reset")) - return itemstack -end - -local function read_number(itemstack, user, pointed_thing) - local pos = pointed_thing.under - if pos then - local number = techage.get_node_number(pos) - if number then - local numbers = minetest.deserialize(user:get_meta():get_string("techage_prog_numbers")) or {} - techage.add_to_set(numbers, number) - user:get_meta():set_string("techage_prog_numbers", minetest.serialize(numbers)) - minetest.chat_send_player(user:get_player_name(), S("[TechAge Programmer] number").." "..number.." read") - else - minetest.chat_send_player(user:get_player_name(), S("[TechAge Programmer] Unknown node on").." "..minetest.pos_to_string(pos)) - end - else - return reset_programmer(itemstack, user, pointed_thing) - end - return itemstack -end - -local function program_numbers(itemstack, placer, pointed_thing) - local pos = pointed_thing.under - if pos then - local meta = M(pos) - local numbers = minetest.deserialize(placer:get_meta():get_string("techage_prog_numbers")) or {} - placer:get_meta():set_string("techage_prog_numbers", "") - local player_name = placer:get_player_name() - if meta and meta:get_string("owner") ~= player_name then - minetest.chat_send_player(player_name, S("[TechAge Programmer] foreign or unknown node!")) - return itemstack - end - local text = table.concat(numbers, " ") - local ndef = minetest.registered_nodes[minetest.get_node(pos).name] - if ndef and ndef.techage_set_numbers then - local res = ndef.techage_set_numbers(pos, text, player_name) - if res == true then - minetest.chat_send_player(player_name, S("[TechAge Programmer] node programmed!")) - else - minetest.chat_send_player(player_name, S("[TechAge Programmer] Error: invalid numbers!")) - end - else - minetest.chat_send_player(player_name, S("[TechAge Programmer] Error: programmer not supported!")) - end - return itemstack - else - return reset_programmer(itemstack, placer, pointed_thing) - end -end - -minetest.register_craftitem("techage:programmer", { - description = S("TechAge Programmer (right = read number, left = write numbers)"), - inventory_image = "techage_programmer.png", - stack_max = 1, - wield_image = "techage_programmer_wield.png", - groups = {cracky=1, book=1}, - -- left mouse button = program - on_use = program_numbers, - on_secondary_use = reset_programmer, - -- right mouse button = read - on_place = read_number, -}) - -minetest.register_craft({ - output = "techage:programmer", - recipe = { - {"", "default:steel_ingot", ""}, - {"", "techage:ta4_wlanchip", ""}, - {"", "dye:red", ""}, - }, -}) diff --git a/techage/logic/repeater.lua b/techage/logic/repeater.lua deleted file mode 100644 index cb08b64..0000000 --- a/techage/logic/repeater.lua +++ /dev/null @@ -1,132 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Signal Repeater - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic -local OVER_LOAD_MAX = 10 -local CYCLE_TIME = 2 - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - return "size[7.5,3]".. - "field[0.5,1;7,1;numbers;"..S("Insert destination node number(s)")..";"..numbers.."]" .. - "button_exit[2,2;3,1;exit;"..S("Save").."]" -end - -minetest.register_node("techage:ta3_repeater", { - description = S("TA3 Repeater"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_repeater.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local mem = techage.get_mem(pos) - logic.after_place_node(pos, placer, "techage:ta3_repeater", S("TA3 Repeater")) - logic.infotext(meta, S("TA3 Repeater")) - meta:set_string("formspec", formspec(meta)) - mem.overload_cnt = 0 - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - if techage.check_numbers(fields.numbers, player:get_player_name()) then - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Repeater")) - meta:set_string("formspec", formspec(meta)) - end - end, - - on_timer = function(pos,elapsed) - local mem = techage.get_mem(pos) - mem.overload_cnt = 0 - return true - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Repeater")) - meta:set_string("formspec", formspec(meta)) - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta3_repeater", - recipe = { - {"", "group:wood", ""}, - {"techage:vacuum_tube", "", "techage:vacuum_tube"}, - {"", "group:wood", ""}, - }, -}) - -techage.register_node({"techage:ta3_repeater"}, { - on_recv_message = function(pos, src, topic, payload) - local mem = techage.get_mem(pos) - mem.overload_cnt = (mem.overload_cnt or 0) + 1 - if mem.overload_cnt > OVER_LOAD_MAX then - logic.infotext(M(pos), S("TA3 Repeater"), "fault (overloaded)") - minetest.get_node_timer(pos):stop() - return false - else - local numbers = M(pos):get_string("numbers") or "" - techage.counting_start(M(pos):get_string("owner")) - techage.send_multi(src, numbers, topic, payload) - techage.counting_stop() - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local mem = techage.get_mem(pos) - mem.overload_cnt = (mem.overload_cnt or 0) + 1 - if mem.overload_cnt > OVER_LOAD_MAX then - logic.infotext(M(pos), S("TA3 Repeater"), "fault (overloaded)") - minetest.get_node_timer(pos):stop() - return 3 - else - if topic == 1 then - local numbers = M(pos):get_string("numbers") or "" - techage.counting_start(M(pos):get_string("owner")) - techage.send_multi(src, numbers, payload[1] == 1 and "on" or "off") - techage.counting_stop() - return 0 - end - end - return 2 - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) diff --git a/techage/logic/sequencer.lua b/techage/logic/sequencer.lua deleted file mode 100644 index 1d5d936..0000000 --- a/techage/logic/sequencer.lua +++ /dev/null @@ -1,309 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Sequencer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic -local NUM_SLOTS = 8 - -local sAction = ",on,off" -local kvAction = {[""]=1, ["on"]=2, ["off"]=3} -local tAction = {nil, "on", "off"} - -local function new_rules() - local tbl = {} - for idx = 1,NUM_SLOTS do - tbl[idx] = {offs = "", num = "", act = 1} - end - return tbl -end - -local function formspec(state, rules, endless) - local tbl = {"size[8,9.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[0,0;Number(s)]label[2.1,0;Command]label[6.4,0;Offset/s]"} - - for idx, rule in ipairs(rules or {}) do - tbl[#tbl+1] = "field[0.2,"..(-0.2+idx)..";2,1;num"..idx..";;"..(rule.num or "").."]" - tbl[#tbl+1] = "dropdown[2,"..(-0.4+idx)..";3.9,1;act"..idx..";"..sAction..";"..(rule.act or "").."]" - tbl[#tbl+1] = "field[6.2,"..(-0.2+idx)..";2,1;offs"..idx..";;"..(rule.offs or "").."]" - end - tbl[#tbl+1] = "checkbox[0,8.5;endless;Run endless;"..dump(endless).."]" - tbl[#tbl+1] = "button[2.2,8.5;1.5,1;help;help]" - tbl[#tbl+1] = "button[4.2,8.5;1.5,1;save;Save]" - tbl[#tbl+1] = "image_button[6.2,8.5;1,1;".. techage.state_button(state) ..";button;]" - - return table.concat(tbl) -end - -local function formspec_help() - return "size[8,9.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[2,0;TA3 Sequencer Help]".. - "label[0,1;Define a sequence of commands\nto control other machines.]".. - "label[0,2.2;Numbers(s) are the node numbers,\nthe command shall sent to.]".. - "label[0,3.4;The commands 'on'/'off' are used\n for machines and other nodes.]".. - "label[0,4.6;Offset is the time to the\nnext line in seconds (0.2 to 999).]".. - "label[0,5.8;If endless is set, the Sequencer\nrestarts again and again.]".. - "label[0,7;The command ' ' does nothing,\nonly consuming the offset time.]".. - "button[3,8;2,1;exit;close]" -end - -local function stop_the_sequencer(pos) - local nvm = techage.get_nvm(pos) - local meta = M(pos) - nvm.running = false - nvm.endless = nvm.endless or false - nvm.rules = nvm.rules or new_rules() - logic.infotext(meta, S("TA3 Sequencer"), "stopped") - meta:set_string("formspec", formspec(techage.STOPPED, nvm.rules, nvm.endless)) - minetest.get_node_timer(pos):stop() - return false -end - -local function get_next_slot(idx, rules, endless) - idx = idx + 1 - if idx <= #rules and rules[idx].offs ~= "" and rules[idx].num ~= "" then - return idx - elseif endless then - return 1 - end - return nil -end - -local function restart_timer(pos, time) - local timer = minetest.get_node_timer(pos) - if timer:is_started() then - timer:stop() - end - if type(time) == "number" then - time = math.max(time, 0.2) - timer:start(time) - end -end - -local function check_rules(pos, elapsed) - local nvm = techage.get_nvm(pos) - local own_num = M(pos):get_string("node_number") - nvm.rules = nvm.rules or new_rules() - nvm.running = nvm.running or false - nvm.index = nvm.index or 1 - nvm.endless = nvm.endless or false - techage.counting_start(M(pos):get_string("owner")) - while true do -- process all rules as long as offs == 0 - local rule = nvm.rules[nvm.index] - local offs = tonumber(nvm.rules[nvm.index].offs or 1) - techage.send_multi(own_num, rule.num, tAction[rule.act]) - nvm.index = get_next_slot(nvm.index, nvm.rules, nvm.endless) - if nvm.index ~= nil and offs ~= nil and nvm.running then - -- after the last rule a pause with 1 or more sec is required - if nvm.index == 1 and offs < 1 then - offs = 1 - end - if offs > 0 then - -- we can't restart the timer within the function om_timer - minetest.after(0, restart_timer, pos, offs) - techage.counting_stop() - return false - end - else - techage.counting_stop() - return stop_the_sequencer(pos) - end - end - techage.counting_stop() - return false -end - -local function start_the_sequencer(pos) - local nvm = techage.get_nvm(pos) - if not nvm.running then - local meta = M(pos) - nvm.running = true - nvm.endless = nvm.endless or false - nvm.rules = nvm.rules or new_rules() - logic.infotext(meta, S("TA3 Sequencer"), "running") - meta:set_string("formspec", formspec(techage.RUNNING, nvm.rules, nvm.endless)) - minetest.get_node_timer(pos):start(0.1) - end - return false -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.running = nvm.running or false - nvm.endless = nvm.endless or false - nvm.rules = nvm.rules or new_rules() - - if fields.help ~= nil then - meta:set_string("formspec", formspec_help()) - return - end - - if fields.endless ~= nil then - nvm.endless = fields.endless == "true" - nvm.index = 1 - end - - if fields.exit ~= nil then - if nvm.running then - meta:set_string("formspec", formspec(techage.RUNNING, nvm.rules, nvm.endless)) - else - meta:set_string("formspec", formspec(techage.STOPPED, nvm.rules, nvm.endless)) - end - return - end - - for idx = 1,NUM_SLOTS do - if fields["offs"..idx] ~= nil then - nvm.rules[idx].offs = tonumber(fields["offs"..idx]) or "" - end - if fields["num"..idx] ~= nil and - techage.check_numbers(fields["num"..idx], player:get_player_name()) then - nvm.rules[idx].num = fields["num"..idx] - end - if fields["act"..idx] ~= nil then - nvm.rules[idx].act = kvAction[fields["act"..idx]] - end - end - - if fields.button ~= nil then - if nvm.running then - stop_the_sequencer(pos) - else - start_the_sequencer(pos) - end - elseif fields.num1 ~= nil then -- any other change? - stop_the_sequencer(pos) - else - if nvm.running then - meta:set_string("formspec", formspec(techage.RUNNING, nvm.rules, nvm.endless)) - else - meta:set_string("formspec", formspec(techage.STOPPED, nvm.rules, nvm.endless)) - end - end -end - -minetest.register_node("techage:ta3_sequencer", { - description = S("TA3 Sequencer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_sequencer.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta3_sequencer", S("TA3 Sequencer")) - logic.infotext(meta, S("TA3 Sequencer"), S("stopped")) - nvm.rules = new_rules() - nvm.index = 1 - nvm.running = false - nvm.endless = false - meta:set_string("formspec", formspec(techage.STOPPED, nvm.rules, nvm.endless)) - end, - - on_receive_fields = on_receive_fields, - - can_dig = function(pos, puncher) - if minetest.is_protected(pos, puncher:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - return not nvm.running - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_timer = check_rules, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta3_sequencer", - recipe = { - {"group:wood", "group:wood", ""}, - {"default:mese_crystal", "techage:vacuum_tube", ""}, - {"group:wood", "group:wood", ""}, - }, -}) - -techage.register_node({"techage:ta3_sequencer"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - start_the_sequencer(pos) - elseif topic == "off" then - -- do not stop immediately - local nvm = techage.get_nvm(pos) - if not nvm.running then - nvm.endless = not (nvm.endless or false) - else - nvm.endless = false - end - elseif topic == "pause" then - stop_the_sequencer(pos) - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 7 then -- TA3 Sequenzer - if payload[1] == 1 then - start_the_sequencer(pos) - return 0 - elseif payload[1] == 0 then - -- do not stop immediately - local nvm = techage.get_nvm(pos) - if not nvm.running then - nvm.endless = not (nvm.endless or false) - else - nvm.endless = false - end - return 0 - elseif payload[1] == 2 then - stop_the_sequencer(pos) - return 0 - end - end - return 2 - end, - on_node_load = function(pos) - local nvm = techage.get_nvm(pos) - if nvm.running then - minetest.get_node_timer(pos):start(1) - end - end, -}) diff --git a/techage/logic/sequencer2.lua b/techage/logic/sequencer2.lua deleted file mode 100644 index 884ccbf..0000000 --- a/techage/logic/sequencer2.lua +++ /dev/null @@ -1,367 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Sequencer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic - -local HELP = S("Syntax:\n") .. - S("'[] '\n") .. - S("\n") .. - S(" is a number from 1 to 50000 and is\n") .. - S("the timeslot when the command is executed.\n") .. - S(" - 1 corresponds to 100 ms\n") .. - S(" - 50000 corresponds to 4 game days\n") .. - S("\n") .. - S(" is one of the following:\n") .. - S(" - 'send ' (techage command)\n") .. - S(" - 'goto ' (jump to another line)\n") .. - S(" - 'stop' (stop the execution)\n") .. - S(" - 'nop' (do nothing)\n") .. - S("\n") .. - S("Example:\n") .. - " -- move controller commands\n" .. - " [1] send 1234 a2b\n" .. - " [30] send 1234 b2a\n" .. - " [60] goto 1 -- keep going" - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "100ms,200ms,500ms,1s,2s", - name = "cycletime", - label = S("Cycle time"), - tooltip = S("Timer cycle time (default: 100 ms)"), - default = "100ms", - values = {0.1, 0.2, 0.5, 1.0, 2.0} - }, - { - type = "dropdown", - choices = "no,yes", - name = "ignore_off", - label = S("Ignore OFF command"), - tooltip = S("If 'yes' a received OFF command won't stop the sequencer"), - default = "no", - values = {0, 1} - }, -} - -local function cycle_time(pos) - local mem = techage.get_mem(pos) - if not mem.cycletime then - mem.cycletime = tonumber(M(pos):get_string("cycletime")) or 0.1 - end - return mem.cycletime -end - - -local function strsplit(text) - text = text:gsub("\r\n", "\n") - text = text:gsub("\r", "\n") - return string.split(text, "\n", true) -end - -local function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) -end - -local function command(s) - local num, cmd, pld = unpack(string.split(s, " ", false, 2)) - if not num or not cmd then - return S("Invalid command!") - end - return {number = num, cmnd = cmd, payload = pld} -end - -local function add_error(text, line_num) - local tbl = {} - for idx, line in ipairs(strsplit(text)) do - if idx == line_num and not string.find(line, '--<<== error') then - tbl[#tbl+1] = line.." --<<== error" - else - tbl[#tbl+1] = line - end - end - return table.concat(tbl, "\n") -end - -local function exception(tRes, line, s) - if tRes then - tRes.line = line - tRes.error = s - end -end - -local function compile(s, tRes) - local tCode = {} - local old_idx = 0 - local start_idx - - for i, line in ipairs(strsplit(s)) do - line = trim(line) - line = string.split(line, "--", true, 1)[1] or "" - if line ~= "" then - local idx, cmnd1, cmnd2 = unpack(string.split(line, " ", false, 2)) - idx = tonumber(string.match(idx, "^%[(%d+)%]$")) - if not idx then - return exception(tRes, i, "Syntax error!") - end - if idx > 50000 then - return exception(tRes, i, "Order error!") - end - if idx <= old_idx then - return exception(tRes, i, "Order error!") - end - start_idx = start_idx or idx - if old_idx ~= 0 and tCode[old_idx] and not tCode[old_idx].next_idx then - tCode[old_idx].next_idx = idx - end - if cmnd1 == "send" then - local res = command(cmnd2) - if type(res) == "string" then - return exception(tRes, i, res) - end - tCode[idx] = res - elseif cmnd1 == "goto" then - tCode[idx] = {next_idx = tonumber(cmnd2) or 1} - elseif cmnd1 == "stop" then - tCode[idx] = false - elseif cmnd1 == nil or cmnd1 == "nop" then - tCode[idx] = {} - end - old_idx = idx - end - end - -- Returns: - -- { - -- start_idx = 1, - -- tCode = { - -- = {number = , cmnd = , payload = , next_idx = }, - -- ... - -- }, - -- } - return {start_idx=start_idx, tCode=tCode} -end - -local function check_syntax(meta) - local tRes = {} - local res = compile(meta:get_string("text"), tRes) - if not res then - meta:set_string("err_msg", tRes.error) - meta:set_string("text", add_error(meta:get_string("text"), tRes.line)) - return false - else - meta:set_string("err_msg", "") - return true - end -end - -local function formspec(nvm, meta) - local text = meta:get_string("text") - text = minetest.formspec_escape(text) - local bttn = nvm.running and ("stop;" .. S("Stop")) or ("start;" .. S("Start")) - local style = nvm.running and "style_type[textarea;font=mono;textcolor=#888888;border=false]" or - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]" - local textarea = nvm.running and "textarea[0.3,0.2;10,8.3;;;"..text.."]" or - "textarea[0.3,0.2;10,8.3;text;;"..text.."]" - - return "size[10,8]" .. - style .. - techage.wrench_image(9.3, -0.25) .. - "tabheader[0,0;tab;edit,help;1;;true]" .. - "label[0.1,-0.2;" .. S("Commands") .. ":]" .. - textarea .. - "background[0.1,0.3;9.8,7.0;techage_form_mask.png]" .. - "label[0.1,7.5;" .. meta:get_string("err_msg") .. "]" .. - "button_exit[3.4,7.5;2.2,1;cancel;" .. S("Cancel") .. "]" .. - "button[5.6,7.5;2.2,1;save;" .. S("Save") .. "]" .. - "button[7.8,7.5;2.2,1;" .. bttn .. "]" -end - -local function formspec_help(meta) - local text = "" --minetest.formspec_escape("hepl") - return "size[10,8]".. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]".. - "tabheader[0,0;tab;edit,help;2;;true]".. - "textarea[0.3,0.3;10,9;;" .. S("Help") .. ":;"..minetest.formspec_escape(HELP).."]" .. - "background[0.1,0.3;9.8,8.0;techage_form_mask.png]" -end - -local function restart_timer(pos, ticks) - local timer = minetest.get_node_timer(pos) - if timer:is_started() then - timer:stop() - end - timer:start(ticks * cycle_time(pos)) -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.running then - local mem = techage.get_mem(pos) - mem.code = mem.code or compile(M(pos):get_string("text")) - if mem.code then - mem.idx = mem.idx or mem.code.start_idx - local code = mem.code.tCode[mem.idx] - if code and code.cmnd then - local src = M(pos):get_string("node_number") - techage.counting_start(M(pos):get_string("owner")) - techage.send_single(src, code.number, code.cmnd, code.payload) - techage.counting_stop() - end - if code and code.next_idx then - local offs = code.next_idx - mem.idx - minetest.after(0, restart_timer, pos, math.max(offs, 1)) - mem.idx = code.next_idx - else - nvm.running = false - local meta = M(pos) - meta:set_string("formspec", formspec(nvm, meta)) - logic.infotext(meta, S("TA4 Sequencer"), S("stopped")) - end - end - end - return false -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - nvm.running = nvm.running or false - - if fields.stop then - nvm.running = false - minetest.get_node_timer(pos):stop() - logic.infotext(meta, S("TA4 Sequencer"), S("stopped")) - elseif not nvm.running then - if fields.tab == "2" then - meta:set_string("formspec", formspec_help(meta)) - return - elseif fields.tab == "1" then - meta:set_string("formspec", formspec(nvm, meta)) - return - end - - if fields.save then - nvm.running = false - meta:set_string("text", fields.text or "") - mem.code = nil - mem.idx = nil - elseif fields.start then - if check_syntax(meta) then - nvm.running = true - meta:set_string("text", fields.text or "") - mem.code = nil - mem.idx = nil - mem.cycletime = nil - restart_timer(pos, 1) - logic.infotext(meta, S("TA4 Sequencer"), S("running")) - end - end - end - meta:set_string("formspec", formspec(nvm, meta)) -end - -minetest.register_node("techage:ta4_sequencer", { - description = S("TA4 Sequencer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_sequencer.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta4_sequencer", S("TA4 Sequencer")) - logic.infotext(meta, S("TA4 Sequencer"), S("stopped")) - nvm.running = false - meta:set_string("formspec", formspec(nvm, meta)) - end, - - on_receive_fields = on_receive_fields, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_timer = node_timer, - ta4_formspec = WRENCH_MENU, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_sequencer", - recipe = { - {"default:steel_ingot", "dye:blue", "default:steel_ingot"}, - {"techage:ta4_ramchip", "default:mese_crystal", "techage:ta4_wlanchip"}, - {"techage:aluminum", "group:wood", "techage:aluminum"}, - }, -}) - -local INFO = [[Commands: 'goto ', 'stop', 'on', 'off']] - -techage.register_node({"techage:ta4_sequencer"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if (topic == "goto" or topic == "on") and not nvm.running then - local mem = techage.get_mem(pos) - nvm.running = true - mem.idx = tonumber(payload or 1) or 1 - restart_timer(pos, 1) - logic.infotext(M(pos), S("TA4 Sequencer"), S("running")) - elseif topic == "stop" or (topic == "off" and M(pos):get_int("ignore_off") == 0) then - nvm.running = false - minetest.get_node_timer(pos):stop() - logic.infotext(M(pos), S("TA4 Sequencer"), S("stopped")) - elseif topic == "info" then - return INFO - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 13 then - if payload[1] ~= 0 and not nvm.running then - local mem = techage.get_mem(pos) - nvm.running = true - mem.idx = tonumber(payload or 1) or 1 - restart_timer(pos, 1) - logic.infotext(M(pos), S("TA4 Sequencer"), S("running")) - return 0 - elseif payload[1] == 0 then - nvm.running = false - minetest.get_node_timer(pos):stop() - logic.infotext(M(pos), S("TA4 Sequencer"), S("stopped")) - return 0 - end - end - return 2 - end, -}) diff --git a/techage/logic/signallamp.lua b/techage/logic/signallamp.lua deleted file mode 100644 index ba0e7ba..0000000 --- a/techage/logic/signallamp.lua +++ /dev/null @@ -1,238 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2022-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Colored Signal Lamps (with unifieddyes support) - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic - -local COLORED = minetest.get_modpath("unifieddyes") and minetest.global_exists("unifieddyes") - -local LampsOff = {} -local LampsOn = {} - -local function switch_on(pos, node, player, color) - if player and minetest.is_protected(pos, player:get_player_name()) then - return - end - color = tonumber(color) or node.param2 - if LampsOff[node.name] then - node.name = LampsOff[node.name] - node.param2 = color - minetest.swap_node(pos, node) - elseif LampsOn[node.name] and color ~= node.param2 then - node.param2 = color - minetest.swap_node(pos, node) - end -end - -local function switch_off(pos, node, player) - if player and minetest.is_protected(pos, player:get_player_name()) then - return - end - if LampsOn[node.name] then - node.name = LampsOn[node.name] - minetest.swap_node(pos, node) - end -end - -local function register_signallamp(name, description, tiles_off, tiles_on, node_box) - LampsOff[name .. "_off"] = name .. "_on" - LampsOn[name .. "_on"] = name .. "_off" - - minetest.register_node(name .. "_off", { - description = description, - tiles = tiles_off, - drawtype = node_box and "nodebox", - node_box = node_box, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - logic.after_place_node(pos, placer, name .. "_off", description) - logic.infotext(M(pos), description) - if COLORED then - unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing) - else - local node = minetest.get_node(pos) - node.param2 = 35 - minetest.swap_node(pos, node) - end - end, - - on_rightclick = switch_on, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - if COLORED then - unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger) - end - end, - - on_construct = COLORED and unifieddyes.on_construct or nil, - on_dig = COLORED and unifieddyes.on_dig or nil, - - paramtype = "light", - paramtype2 = "color", - --palette = "techage_palette256.png", - palette = COLORED and "unifieddyes_palette_extended.png" or "techage_palette256.png", - place_param2 = 240, - sunlight_propagates = true, - sounds = default.node_sound_glass_defaults(), - groups = {choppy=2, cracky=1, ud_param2_colorable = 1}, - is_ground_content = false, - drop = name .. "_off" - }) - - minetest.register_node(name .. "_on", { - description = description, - tiles = tiles_on, - drawtype = node_box and "nodebox", - node_box = node_box, - - on_rightclick = switch_off, - - paramtype = "light", - paramtype2 = "color", - palette = COLORED and "unifieddyes_palette_extended.png" or "techage_palette256.png", - groups = {choppy=2, cracky=1, not_in_creative_inventory=1, ud_param2_colorable = 1}, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - if COLORED then - unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger) - end - end, - - on_dig = COLORED and unifieddyes.on_dig or nil, - light_source = 10, - is_ground_content = false, - drop = name .. "_off" - }) - - techage.register_node({name .. "_off", name .. "_on"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - local node = techage.get_node_lvm(pos) - switch_on(pos, node) - return true - elseif topic == "off" then - local node = techage.get_node_lvm(pos) - switch_off(pos, node) - return true - elseif topic == "color" then - local node = techage.get_node_lvm(pos) - switch_on(pos, node, nil, payload) - return true - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - local node = techage.get_node_lvm(pos) - switch_on(pos, node) - return 0 - elseif topic == 1 and payload[1] == 0 then - local node = techage.get_node_lvm(pos) - switch_off(pos, node) - return 0 - elseif topic == 70 or topic == 22 then - local node = techage.get_node_lvm(pos) - switch_on(pos, node, nil, payload[1]) - return 0 - else - return 2 - end - end, - }) -end - -minetest.register_chatcommand("ta_color", { - description = minetest.formspec_escape( - "Output the color palette and the numbers for Lua/Beduino color commands"), - - func = function(name, param) - local tbl = {} - if COLORED then - tbl[1] = "size[14,7]" - tbl[2] = "background[0,0;14,7;unifieddyes_palette_extended.png]" - for i = 0, 10 do - local y = i * 0.64 - tbl[#tbl + 1] = "label[0," .. y .. ";" .. (i * 24 + 0) .. "]" - tbl[#tbl + 1] = "label[7," .. y .. ";" .. (i * 24 + 12) .. "]" - end - else - tbl[1] = "size[10,7.5]" - tbl[2] = "background[0,0;10,7.5;techage_palette256.png]" - for i = 0, 13 do - local y = i * 0.5 - tbl[#tbl + 1] = "label[0," .. y .. ";" .. (i * 18 + 0) .. "]" - tbl[#tbl + 1] = "label[5," .. y .. ";" .. (i * 18 + 9) .. "]" - end - end - minetest.show_formspec(name, ";techage:color_form", table.concat(tbl, "")) - return true - end -}) - --- Register callback -minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname ~= "techage:color_form" then - return false - end - return true -end) - - -register_signallamp("techage:color_lamp", - S("TechAge Color Lamp"), - {"techage_signal_lamp.png^[colorize:#000000:80"}, - {"techage_signal_lamp.png"}, - { - type = "fixed", - fixed = { - {-6/16, -6/16, -6/16, 6/16, 6/16, 6/16}, - {-4/16, -10/16, -4/16, 4/16, -6/16, 4/16}, - } - } -) - -register_signallamp("techage:color_lamp2", - S("TechAge Color Lamp 2"), - {"techage_signallamp2.png^[colorize:#000000:80"}, - {"techage_signallamp2.png"} -) - -minetest.register_craft({ - output = "techage:signal_lamp_off", - recipe = { - {"", "wool:white", ""}, - {"", "default:torch", ""}, - {"", "techage:vacuum_tube", ""}, - }, - }) - -minetest.register_craft({ - output = "techage:signal_lamp2_off", - recipe = { - {"", "default:glass", ""}, - {"", "default:torch", ""}, - {"", "techage:vacuum_tube", ""}, - }, - }) - -minetest.register_alias("techage:signal_lamp_off", "techage:color_lamp_off") -minetest.register_alias("techage:signal_lamp2_off", "techage:color_lamp2_off") -minetest.register_alias("techage:signal_lamp_on", "techage:color_lamp_on") -minetest.register_alias("techage:signal_lamp2_on", "techage:color_lamp2_on") diff --git a/techage/logic/signallamp_2x.lua b/techage/logic/signallamp_2x.lua deleted file mode 100644 index 3692b30..0000000 --- a/techage/logic/signallamp_2x.lua +++ /dev/null @@ -1,164 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Logic twofold signal lamp - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local OFF = 0 -local GREEN = 1 -local AMBER = 2 -local RED = 3 - -local WRENCH_MENU = { - { - type = "ascii", - name = "label1", - label = S("Label") .. " 1", - tooltip = S("Label for the lamp"), - default = "1", - }, - { - type = "ascii", - name = "label2", - label = S("Label") .. " 2", - tooltip = S("Label for the lamp"), - default = "2", - }, -} - -local function lamp_update(pos, objref) - local meta = M(pos) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - local tbl = {" ", " ", meta:get_string("label1"), " ", meta:get_string("label2")} - local text = "< " .. table.concat(tbl, "\n< ") - local texture = lcdlib.make_multiline_texture("default", text, 96, 96, 7, "top", "#000", 6) - - if nvm.lamp[1] == RED then - texture = texture .. "^techage_smartline_signal_red2.png" - elseif nvm.lamp[1] == GREEN then - texture = texture .. "^techage_smartline_signal_green2.png" - elseif nvm.lamp[1] == AMBER then - texture = texture .. "^techage_smartline_signal_amber2.png" - end - - if nvm.lamp[2] == RED then - texture = texture .. "^techage_smartline_signal_red3.png" - elseif nvm.lamp[2] == GREEN then - texture = texture .. "^techage_smartline_signal_green3.png" - elseif nvm.lamp[2] == AMBER then - texture = texture .. "^techage_smartline_signal_amber3.png" - end - - objref:set_properties({ textures = {texture}, visual_size = {x=1, y=1} }) -end - -local lcd_box = {-8/16, -4/16, 7.75/16, 8/16, 4/16, 8/16} - -minetest.register_node("techage:ta4_signallamp_2x", { - description = S("TA4 2x Signal Lamp"), - inventory_image = 'techage_smartline_signal_2x.png^techage_smartline_signal_green2.png^techage_smartline_signal_amber3.png', - tiles = {'techage_smartline_signal_2x.png'}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = "clip", - sunlight_propagates = true, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = lcd_box, - }, - light_source = 6, - - display_entities = { - ["techage:display_entity"] = { depth = 0.48, - on_display_update = lamp_update}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_signallamp_2x") - local meta = minetest.get_meta(pos) - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA4 2x Signal Lamp") .. " " .. number) - local nvm = techage.get_nvm(pos) - nvm.lamp = {} - lcdlib.update_entities(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta_after_formspec = function(pos, fields, playername) - lcdlib.update_entities(pos) - end, - - ta3_formspec = WRENCH_MENU, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -techage.register_node({"techage:ta4_signallamp_2x"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - if topic == "green" then - local num = math.min(tonumber(payload) or 0, 2) - nvm.lamp[num] = GREEN - lcdlib.update_entities(pos) - elseif topic == "amber" then - local num = math.min(tonumber(payload) or 0, 2) - nvm.lamp[num] = AMBER - lcdlib.update_entities(pos) - elseif topic == "red" then - local num = math.min(tonumber(payload) or 0, 2) - nvm.lamp[num] = RED - lcdlib.update_entities(pos) - elseif topic == "off" then - local num = math.min(tonumber(payload) or 0, 2) - nvm.lamp[num] = OFF - lcdlib.update_entities(pos) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - if topic == 3 then -- Signal Lamp - local num = math.min(payload[1] or 1, 2) - local color = math.min(payload[2] or 0, 3) - nvm.lamp[num] = color - lcdlib.update_entities(pos) - return 0 - else - return 2 - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_signallamp_2x", - recipe = { - {"", "techage:aluminum", "dye:blue"}, - {"", "default:glass", "techage:ta4_wlanchip"}, - {"", "techage:ta4_leds", "techage:ta4_leds"}, - }, -}) diff --git a/techage/logic/signallamp_4x.lua b/techage/logic/signallamp_4x.lua deleted file mode 100644 index a098ba6..0000000 --- a/techage/logic/signallamp_4x.lua +++ /dev/null @@ -1,195 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Logic fourfold signal lamp - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local OFF = 0 -local GREEN = 1 -local AMBER = 2 -local RED = 3 - -local WRENCH_MENU = { - { - type = "ascii", - name = "label1", - label = S("Label") .. " 1", - tooltip = S("Label for the lamp"), - default = "1", - }, - { - type = "ascii", - name = "label2", - label = S("Label") .. " 2", - tooltip = S("Label for the lamp"), - default = "2", - }, - { - type = "ascii", - name = "label3", - label = S("Label") .. " 3", - tooltip = S("Label for the lamp"), - default = "3", - }, - { - type = "ascii", - name = "label4", - label = S("Label") .. " 4", - tooltip = S("Label for the lamp"), - default = "4", - }, -} - -local function lamp_update(pos, objref) - local meta = M(pos) - pos = vector.round(pos) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - local tbl = {meta:get_string("label1"), " ", meta:get_string("label2"), " ", meta:get_string("label3"), " ", meta:get_string("label4")} - local text = "< " .. table.concat(tbl, "\n< ") - local texture = lcdlib.make_multiline_texture("default", text, 96, 96, 7, "top", "#000", 6) - - if nvm.lamp[1] == RED then - texture = texture .. "^techage_smartline_signal_red1.png" - elseif nvm.lamp[1] == GREEN then - texture = texture .. "^techage_smartline_signal_green1.png" - elseif nvm.lamp[1] == AMBER then - texture = texture .. "^techage_smartline_signal_amber1.png" - end - - if nvm.lamp[2] == RED then - texture = texture .. "^techage_smartline_signal_red2.png" - elseif nvm.lamp[2] == GREEN then - texture = texture .. "^techage_smartline_signal_green2.png" - elseif nvm.lamp[2] == AMBER then - texture = texture .. "^techage_smartline_signal_amber2.png" - end - - if nvm.lamp[3] == RED then - texture = texture .. "^techage_smartline_signal_red3.png" - elseif nvm.lamp[3] == GREEN then - texture = texture .. "^techage_smartline_signal_green3.png" - elseif nvm.lamp[3] == AMBER then - texture = texture .. "^techage_smartline_signal_amber3.png" - end - - if nvm.lamp[4] == RED then - texture = texture .. "^techage_smartline_signal_red4.png" - elseif nvm.lamp[4] == GREEN then - texture = texture .. "^techage_smartline_signal_green4.png" - elseif nvm.lamp[4] == AMBER then - texture = texture .. "^techage_smartline_signal_amber4.png" - end - - objref:set_properties({ textures = {texture}, visual_size = {x=1, y=1} }) -end - -local lcd_box = {-8/16, -8/16, 7.75/16, 8/16, 8/16, 8/16} - -minetest.register_node("techage:ta4_signallamp_4x", { - description = S("TA4 4x Signal Lamp"), - inventory_image = 'techage_smartline_signal_4x.png^techage_smartline_signal_off1.png^techage_smartline_signal_green2.png^techage_smartline_signal_amber3.png^techage_smartline_signal_red4.png', - tiles = {'techage_smartline_signal_4x.png'}, - drawtype = "nodebox", - paramtype = "light", - use_texture_alpha = "clip", - sunlight_propagates = true, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = lcd_box, - }, - light_source = 6, - - display_entities = { - ["techage:display_entity"] = { depth = 0.48, - on_display_update = lamp_update}, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, "techage:ta4_signallamp_4x") - local meta = minetest.get_meta(pos) - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA4 4x Signal Lamp") .. " " .. number) - local nvm = techage.get_nvm(pos) - nvm.text = {"1", "", "2", "", "3", "", "4"} - nvm.lamp = {} - lcdlib.update_entities(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta_after_formspec = function(pos, fields, playername) - lcdlib.update_entities(pos) - end, - - ta3_formspec = WRENCH_MENU, - on_place = lcdlib.on_place, - on_construct = lcdlib.on_construct, - on_destruct = lcdlib.on_destruct, - on_rotate = lcdlib.on_rotate, - groups = {cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -techage.register_node({"techage:ta4_signallamp_4x"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - if topic == "green" then - local num = math.min(tonumber(payload) or 0, 4) - nvm.lamp[num] = GREEN - lcdlib.update_entities(pos) - elseif topic == "amber" then - local num = math.min(tonumber(payload) or 0, 4) - nvm.lamp[num] = AMBER - lcdlib.update_entities(pos) - elseif topic == "red" then - local num = math.min(tonumber(payload) or 0, 4) - nvm.lamp[num] = RED - lcdlib.update_entities(pos) - elseif topic == "off" then - local num = math.min(tonumber(payload) or 0, 4) - nvm.lamp[num] = OFF - lcdlib.update_entities(pos) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - nvm.lamp = nvm.lamp or {} - if topic == 3 then -- Signal Lamp - local num = math.min(payload[1] or 1, 4) - local color = math.min(payload[2] or 0, 3) - nvm.lamp[num] = color - lcdlib.update_entities(pos) - return 0 - else - return 2 - end - end, -}) - -minetest.register_craft({ - output = "techage:ta4_signallamp_4x", - recipe = { - {"", "techage:ta4_signallamp_2x", ""}, - {"", "techage:ta4_signallamp_2x", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/logic/terminal.lua b/techage/logic/terminal.lua deleted file mode 100644 index 1008ac3..0000000 --- a/techage/logic/terminal.lua +++ /dev/null @@ -1,448 +0,0 @@ ---[[ - - Terminal - ======== - - Copyright (C) 2018-2024 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - terminal.lua: - -]]-- - -local M = minetest.get_meta -local S = techage.S - -local HELP_TA3 = [[ #### TA3 Terminal #### -Send commands to machines and output the results. -Local commands: -- Clear screen with 'clear' -- Output this message with 'help' -- Switch to public use of buttons with 'pub' -- Switch to private use of buttons with 'priv' -- Output techage version with 'vers' -- Program a user button with - 'set ' - Example: 'set 1 ON cmd 1234 on' -- send a command with 'cmd ' - Example: 'cmd 1234 on']] - -local HELP_TA4 = [[ #### TA4 Terminal #### -Send commands to machines and output the results. -Local commands: -- Clear screen with 'clear' -- Output this message with 'help' -- Switch to public use of buttons with 'pub' -- Switch to private use of buttons with 'priv' -- Output techage version with 'vers' -- Program a user button with - 'set ' - Example: 'set 1 ON cmd 1234 on' -- send a command with 'cmd ' - Example: 'cmd 1234 on' -- Connect to a machine with 'connect ' -If connected, compact commands like 'status' -are possible.]] - -local SYNTAX_ERR = S("Syntax error, try help") - -local function get_string(meta, num, default) - local s = meta:get_string("bttn_text"..num) - if not s or s == "" then - return default - end - return s -end - -local function formspec2(meta) - local output = meta:get_string("output") - local command = meta:get_string("command") - output = minetest.formspec_escape(output) - output = output:gsub("\n", ",") - local bttn_text1 = get_string(meta, 1, "User1") - local bttn_text2 = get_string(meta, 2, "User2") - local bttn_text3 = get_string(meta, 3, "User3") - local bttn_text4 = get_string(meta, 4, "User4") - local bttn_text5 = get_string(meta, 5, "User5") - local bttn_text6 = get_string(meta, 6, "User6") - local bttn_text7 = get_string(meta, 7, "User7") - local bttn_text8 = get_string(meta, 8, "User8") - local bttn_text9 = get_string(meta, 9, "User9") - return "size[10,8.5]".. - --"style_type[table,field;font=mono]".. - "button[0,-0.2;3.3,1;bttn1;"..bttn_text1.."]button[3.3,-0.2;3.3,1;bttn2;"..bttn_text2.."]button[6.6,-0.2;3.3,1;bttn3;"..bttn_text3.."]".. - "button[0,0.6;3.3,1;bttn4;"..bttn_text4.."]button[3.3,0.6;3.3,1;bttn5;"..bttn_text5.."]button[6.6,0.6;3.3,1;bttn6;"..bttn_text6.."]".. - "button[0,1.4;3.3,1;bttn7;"..bttn_text7.."]button[3.3,1.4;3.3,1;bttn8;"..bttn_text8.."]button[6.6,1.4;3.3,1;bttn9;"..bttn_text9.."]".. - "table[0,2.3;9.8,5.6;output;"..output..";200]".. - "field[0.4,8.2;7.6,1;cmnd;;"..command.."]" .. - "field_close_on_enter[cmnd;false]".. - "button[7.9,7.9;2,1;ok;"..S("Enter").."]" -end - -local function output(pos, text) - local meta = minetest.get_meta(pos) - text = meta:get_string("output") .. "\n" .. (text or "") - text = text:sub(-1000,-1) - meta:set_string("output", text) - meta:set_string("formspec", formspec2(meta)) -end - -local function append(pos, text) - local meta = minetest.get_meta(pos) - text = meta:get_string("output") .. (text or "") - meta:set_string("output", text) - meta:set_string("formspec", formspec2(meta)) -end - -local function get_line_text(pos, num) - local meta = minetest.get_meta(pos) - local text = meta:get_string("output") or "" - local lines = string.split(text, "\n", true) - local line = lines[num] or "" - return line:gsub("^[%s$]*(.-)%s*$", "%1") -end - -local function server_debug(pos, command, player) - local cmnd, payload = command:match('^pipe%s+([%w_]+)%s*(.*)$') - if cmnd then - if not minetest.check_player_privs(player, "server") then - output(pos, "server privs missing") - return - end - local resp = techage.transfer( - pos, - "B", -- outdir - cmnd, -- topic - payload, -- payload - techage.LiquidPipe, -- network - nil) -- valid nodes - output(pos, dump(resp)) - return true - end - - cmnd, payload = command:match('^axle%s+([%w_]+)%s*(.*)$') - if cmnd then - if not minetest.check_player_privs(player, "server") then - output(pos, "server privs missing") - return - end - local resp = techage.transfer( - pos, - "B", -- outdir - cmnd, -- topic - payload, -- payload - techage.TA1Axle, -- network - nil) -- valid nodes - output(pos, dump(resp)) - return true - end - - cmnd, payload = command:match('^vtube%s+([%w_]+)%s*(.*)$') - if cmnd then - if not minetest.check_player_privs(player, "server") then - output(pos, "server privs missing") - return - end - local resp = techage.transfer( - pos, - "B", -- outdir - cmnd, -- topic - payload, -- payload - techage.VTube, -- network - nil) -- valid nodes - output(pos, dump(resp)) - return true - end -end - -local function command(pos, command, player, is_ta4) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") or "" - - command = command:sub(1,80) - command = string.trim(command) - local cmnd, data = command:match('^(%w+)%s*(.*)$') - - if cmnd == "clear" then - meta:set_string("output", "") - meta:set_string("formspec", formspec2(meta)) - elseif cmnd == "" then - output(pos, "$") - elseif cmnd == "help" then - if is_ta4 then - output(pos, HELP_TA4) - else - output(pos, HELP_TA3) - end - elseif cmnd == "pub" then - meta:set_int("public", 1) - output(pos, "$ "..command) - output(pos, "Switched to public buttons!") - elseif cmnd == "priv" then - meta:set_int("public", 0) - output(pos, "$ "..command) - output(pos, "Switched to private buttons!") - elseif cmnd == "vers" then - output(pos, "$ "..command) - output(pos, "Techage version = " .. techage.version) - elseif cmnd == "connect" and data then - output(pos, "$ "..command) - if techage.not_protected(data, owner, owner) then - local own_num = meta:get_string("node_number") - local resp = techage.send_single(own_num, data, cmnd) - if resp then - meta:set_string("connected_to", data) - output(pos, "Connected.") - else - meta:set_string("connected_to", "") - output(pos, "Not connected!") - end - else - output(pos, "Protection error!") - end - else - output(pos, "$ "..command) - local own_num = meta:get_string("node_number") - local connected_to = meta:contains("connected_to") and meta:get_string("connected_to") - local bttn_num, label, num, cmnd, payload - - num, cmnd, payload = command:match('^cmd%s+([0-9]+)%s+(%w+)%s*(.*)$') - if num and cmnd then - if techage.not_protected(num, owner, owner) then - local resp = techage.send_single(own_num, num, cmnd, payload) - if type(resp) == "string" then - output(pos, resp) - else - output(pos, dump(resp)) - end - end - return - end - - num, cmnd = command:match('^turn%s+([0-9]+)%s+([onf]+)$') - if num and (cmnd == "on" or cmnd == "off") then - if techage.not_protected(num, owner, owner) then - local resp = techage.send_single(own_num, num, cmnd) - output(pos, dump(resp)) - end - return - end - - bttn_num, label, cmnd = command:match('^set%s+([1-9])%s+([%w_]+)%s+(.+)$') - if bttn_num and label and cmnd then - meta:set_string("bttn_text"..bttn_num, label) - meta:set_string("bttn_cmnd"..bttn_num, cmnd) - meta:set_string("formspec", formspec2(meta)) - return - end - - if server_debug(pos, command, player) then - return - end - - if connected_to then - local cmnd, payload = command:match('^(%w+)%s*(.*)$') - if cmnd then - local resp = techage.send_single(own_num, connected_to, cmnd, payload) - if resp ~= true then - if type(resp) == "string" then - output(pos, resp) - else - output(pos, dump(resp)) - end - end - return - end - end - - if command ~= "" then - output(pos, SYNTAX_ERR) - end - end -end - -local function send_cmnd(pos, meta, num) - local cmnd = meta:get_string("bttn_cmnd"..num) - local owner = meta:get_string("owner") or "" - command(pos, cmnd, owner) -end - -local function register_terminal(name, description, tiles, node_box, selection_box) - minetest.register_node("techage:"..name, { - description = description, - tiles = tiles, - drawtype = "nodebox", - node_box = node_box, - selection_box = selection_box, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, minetest.get_node(pos).name) - local meta = minetest.get_meta(pos) - meta:set_string("node_number", number) - meta:set_string("command", S("commands like: help")) - meta:set_string("formspec", formspec2(meta)) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", description .. " " .. number) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - local public = meta:get_int("public") == 1 - local protected = minetest.is_protected(pos, player:get_player_name()) - - if not protected then - local evt = minetest.explode_table_event(fields.output) - if evt.type == "DCL" then - local s = get_line_text(pos, evt.row) - meta:set_string("command", s) - meta:set_string("formspec", formspec2(meta)) - return - elseif (fields.ok or fields.key_enter_field) and fields.cmnd then - local is_ta4 = string.find(description, "TA4") - command(pos, fields.cmnd, player:get_player_name(), is_ta4) - techage.historybuffer_add(pos, fields.cmnd) - meta:set_string("command", "") - meta:set_string("formspec", formspec2(meta)) - return - elseif fields.key_up then - meta:set_string("command", techage.historybuffer_priv(pos)) - meta:set_string("formspec", formspec2(meta)) - return - elseif fields.key_down then - meta:set_string("command", techage.historybuffer_next(pos)) - meta:set_string("formspec", formspec2(meta)) - return - end - end - if public or not protected then - if fields.bttn1 then send_cmnd(pos, meta, 1) - elseif fields.bttn2 then send_cmnd(pos, meta, 2) - elseif fields.bttn3 then send_cmnd(pos, meta, 3) - elseif fields.bttn4 then send_cmnd(pos, meta, 4) - elseif fields.bttn5 then send_cmnd(pos, meta, 5) - elseif fields.bttn6 then send_cmnd(pos, meta, 6) - elseif fields.bttn7 then send_cmnd(pos, meta, 7) - elseif fields.bttn8 then send_cmnd(pos, meta, 8) - elseif fields.bttn9 then send_cmnd(pos, meta, 9) - end - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - preserve_nodedata = techage.preserve_nodedata, - restore_nodedata = techage.restore_nodedata, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - }) -end - -register_terminal("terminal2", S("TA3 Terminal"), { - -- up, down, right, left, back, front - 'techage_terminal2_top.png', - 'techage_terminal2_side.png', - 'techage_terminal2_side.png^[transformFX', - 'techage_terminal2_side.png', - 'techage_terminal2_back.png', - "techage_terminal2_front.png", - }, - { - type = "fixed", - fixed = { - {-12/32, -16/32, -16/32, 12/32, -14/32, 16/32}, - {-12/32, -14/32, -3/32, 12/32, 6/32, 16/32}, - {-10/32, -12/32, 14/32, 10/32, 4/32, 18/32}, - {-12/32, 4/32, -4/32, 12/32, 6/32, 16/32}, - {-12/32, -16/32, -4/32, -10/32, 6/32, 16/32}, - { 10/32, -16/32, -4/32, 12/32, 6/32, 16/32}, - {-12/32, -14/32, -4/32, 12/32, -12/32, 16/32}, - }, - }, - { - type = "fixed", - fixed = { - {-12/32, -16/32, -4/32, 12/32, 6/32, 16/32}, - }, - } -) - -register_terminal("terminal3", S("TA4 Terminal"), { - -- up, down, right, left, back, front - 'techage_terminal1_top.png', - 'techage_terminal1_bottom.png', - 'techage_terminal1_side.png', - 'techage_terminal1_side.png', - 'techage_terminal1_bottom.png', - "techage_terminal1_front.png", - }, - { - type = "fixed", - fixed = { - {-12/32, -16/32, -8/32, 12/32, -14/32, 12/32}, - {-12/32, -14/32, 12/32, 12/32, 6/32, 14/32}, - }, - }, - { - type = "fixed", - fixed = { - {-12/32, -16/32, -8/32, 12/32, -14/32, 12/32}, - {-12/32, -14/32, 12/32, 12/32, 6/32, 14/32}, - }, - } -) - -minetest.register_craft({ - output = "techage:terminal2", - recipe = { - {"", "", ""}, - {"techage:basalt_glass_thin", "techage:vacuum_tube", "default:copper_ingot"}, - {"dye:grey", "default:steel_ingot", "techage:usmium_nuggets"}, - }, -}) - -minetest.register_craft({ - output = "techage:terminal3", - recipe = { - {"techage:basalt_glass_thin", "", ""}, - {"techage:ta4_leds", "", ""}, - {"techage:aluminum", "techage:ta4_wlanchip", "techage:ta4_ramchip"}, - }, -}) - -techage.register_node({"techage:terminal2"}, { - on_recv_message = function(pos, src, topic, payload) - output(pos, "src="..src..", cmd="..dump(topic)..", data="..dump(payload)) - return true - end, - on_node_load = function(pos) - local meta = M(pos) - local number = meta:get_string("number") or "" - if number ~= "" then - meta:set_string("node_number", number) - meta:set_string("number", "") - end - end, -}) - -techage.register_node({"techage:terminal3"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "text" then - output(pos, payload) - elseif topic == "append" then - append(pos, payload) - else - output(pos, "src="..src..", cmd="..dump(topic)..", data="..dump(payload)) - end - return true - end, -}) diff --git a/techage/logic/timer.lua b/techage/logic/timer.lua deleted file mode 100644 index 2e55613..0000000 --- a/techage/logic/timer.lua +++ /dev/null @@ -1,209 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Sequencer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic -local CYCLE_TIME = 8 - -local tTime = { - ["00:00"] = 1, ["02:00"] = 2, ["04:00"] = 3, - ["06:00"] = 4, ["08:00"] = 5, ["10:00"] = 6, - ["12:00"] = 7, ["14:00"] = 8, ["16:00"] = 9, - ["18:00"] =10, ["20:00"] =11, ["22:00"] =12, -} - -local sTime = "00:00,02:00,04:00,06:00,08:00,10:00,12:00,14:00,16:00,18:00,20:00,22:00" - -local tAction = { - [""] = 1, - ["on"] = 2, - ["off"] = 3, -} - -local sAction = ",on,off" - -local function deserialize(meta, name) - local s = meta:get_string(name) or "" - if s ~= "" then - return minetest.deserialize(s) - end -end - -local function formspec(events, numbers, actions) - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - - "label[0,0;Time]label[2.3,0;Number(s)]label[4.5,0;Command]".. - "dropdown[0,1;2,1;e1;"..sTime..";"..events[1].."]".. - "field[2.3,1.2;2,1;n1;;"..numbers[1].."]" .. - "dropdown[4.5,1;3,1;a1;"..sAction..";"..tAction[actions[1]].."]".. - - "dropdown[0,2;2,1;e2;"..sTime..";"..events[2].."]".. - "field[2.3,2.2;2,1;n2;;"..numbers[2].."]" .. - "dropdown[4.5,2;3,1;a2;"..sAction..";"..tAction[actions[2]].."]".. - - "dropdown[0,3;2,1;e3;"..sTime..";"..events[3].."]".. - "field[2.3,3.2;2,1;n3;;"..numbers[3].."]" .. - "dropdown[4.5,3;3,1;a3;"..sAction..";"..tAction[actions[3]].."]".. - - "dropdown[0,4;2,1;e4;"..sTime..";"..events[4].."]".. - "field[2.3,4.2;2,1;n4;;"..numbers[4].."]" .. - "dropdown[4.5,4;3,1;a4;"..sAction..";"..tAction[actions[4]].."]".. - - "dropdown[0,5;2,1;e5;"..sTime..";"..events[5].."]".. - "field[2.3,5.2;2,1;n5;;"..numbers[5].."]" .. - "dropdown[4.5,5;3,1;a5;"..sAction..";"..tAction[actions[5]].."]".. - - "dropdown[0,6;2,1;e6;"..sTime..";"..events[6].."]".. - "field[2.3,6.2;2,1;n6;;"..numbers[6].."]" .. - "dropdown[4.5,6;3,1;a6;"..sAction..";"..tAction[actions[6]].."]".. - - "button_exit[3,7;2,1;exit;close]" -end - - -local function check_rules(pos,elapsed) - local nvm = techage.get_nvm(pos) - nvm.done = nvm.done or {false,false,false,false,false,false} - local hour = math.floor(minetest.get_timeofday() * 24) - local meta = minetest.get_meta(pos) - local events = deserialize(meta, "events") - local numbers = deserialize(meta, "numbers") - local actions = deserialize(meta, "actions") - local number = meta:get_string("node_number") - - if events and numbers and actions then - -- check all rules - for idx,act in ipairs(actions) do - if act ~= "" and numbers[idx] ~= "" then - local hr = (events[idx] - 1) * 2 - if ((hour - hr) % 24) <= 4 then -- last 4 hours? - if nvm.done[idx] == false then -- not already executed? - techage.send_multi(number, numbers[idx], act) - nvm.done[idx] = true - end - else - nvm.done[idx] = false - end - end - end - - -- prepare for the next day - if hour == 23 then - nvm.done = {false,false,false,false,false,false} - end - return true - end - return false -end - - -minetest.register_node("techage:ta3_timer", { - description = S("TA3 Timer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_timer.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - logic.after_place_node(pos, placer, "techage:ta3_timer", S("TA3 Timer")) - logic.infotext(meta, S("TA3 Timer")) - local events = {1,1,1,1,1,1} - local numbers = {"0000","","","","",""} - local actions = {"","","","","",""} - nvm.done = {false,false,false,false,false,false} - meta:set_string("events", minetest.serialize(events)) - meta:set_string("numbers", minetest.serialize(numbers)) - meta:set_string("actions", minetest.serialize(actions)) - meta:set_string("formspec", formspec(events, numbers, actions)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local events = minetest.deserialize(meta:get_string("events")) - for idx, evt in ipairs({fields.e1, fields.e2, fields.e3, fields.e4, fields.e5, fields.e6}) do - if evt ~= nil then - events[idx] = tTime[evt] - end - end - meta:set_string("events", minetest.serialize(events)) - - local numbers = minetest.deserialize(meta:get_string("numbers")) - for idx, num in ipairs({fields.n1, fields.n2, fields.n3, fields.n4, fields.n5, fields.n6}) do - if num ~= nil and techage.check_numbers(num, player:get_player_name()) then - numbers[idx] = num - end - end - meta:set_string("numbers", minetest.serialize(numbers)) - - local actions = minetest.deserialize(meta:get_string("actions")) - for idx, act in ipairs({fields.a1, fields.a2, fields.a3, fields.a4, fields.a5, fields.a6}) do - if act ~= nil then - actions[idx] = act - end - end - meta:set_string("actions", minetest.serialize(actions)) - meta:set_string("formspec", formspec(events, numbers, actions)) - local nvm = techage.get_nvm(pos) - nvm.done = {false,false,false,false,false,false} - end, - - on_timer = check_rules, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - sounds = default.node_sound_stone_defaults(), - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, -}) - - -minetest.register_craft({ - output = "techage:ta3_timer", - recipe = { - {"group:wood", "group:wood", ""}, - {"default:gold_ingot", "techage:vacuum_tube", ""}, - {"group:wood", "group:wood", ""}, - }, -}) - -techage.register_node({"techage:ta3_timer"}, { - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - -- check rules for just loaded areas - local nvm = techage.get_nvm(pos) - nvm.done = {false,false,false,false,false,false} - check_rules(pos,0) - end, -}) diff --git a/techage/lua_controller/commands.lua b/techage/lua_controller/commands.lua deleted file mode 100644 index ea2fb46..0000000 --- a/techage/lua_controller/commands.lua +++ /dev/null @@ -1,250 +0,0 @@ ---[[ - - Techage - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - commands.lua: - - Register all basic controller commands - -]]-- - --- store protection data locally -local LocalRef = {} -local function not_protected(owner, numbers) - if owner and numbers then - LocalRef[owner] = LocalRef[owner] or {} - if LocalRef[owner][numbers] == nil then - LocalRef[owner][numbers] = techage.check_numbers(numbers, owner) - end - return LocalRef[owner][numbers] - end - return false -end - -techage.lua_ctlr.register_function("get_input", { - cmnd = function(self, num) - num = tostring(num or "") - return techage.lua_ctlr.get_input(self.meta.number, num) - end, - help = ' $get_input(num) --> "on", "off", or nil\n'.. - ' Read local input value from device with number "num".\n'.. - ' example: inp = $get_input("1234")\n'.. - " The device has to be connected with the controller." -}) - -techage.lua_ctlr.register_function("get_next_input", { - cmnd = function(self) - return techage.lua_ctlr.get_next_input(self.meta.number) - end, - help = ' $get_next_input() --> number and state\n'.. - ' Similar to $get_input(), but provides the\n'.. - ' input node number in addition.\n'.. - ' example: num, state = $get_next_input()\n'.. - ' This function deletes the input and returns\n'.. - ' nil if no further input value is available.' -}) - -techage.lua_ctlr.register_function("read_data", { - cmnd = function(self, num, cmnd, data) - num = tostring(num or "") - cmnd = tostring(cmnd or "") - if not_protected(self.meta.owner, num) then - return techage.send_single(self.meta.number, num, cmnd, data) - end - end, - help = " $read_data(num, cmnd, add_data)\n".. - " This function is deprecated.\n".. - " It will be removed in future releases.\n".. - " Use $send_cmnd(num, cmnd, add_data) instead." -}) - -techage.lua_ctlr.register_function("time_as_str", { - cmnd = function(self) - local t = minetest.get_timeofday() - local h = math.floor(t*24) % 24 - local m = math.floor(t*1440) % 60 - return string.format("%02d:%02d", h, m) - end, - help = " $time_as_str() --> e.g. '18:45'\n".. - " Read time of day as string (24h).\n".. - ' example: time = $time_as_str()' -}) - -techage.lua_ctlr.register_function("time_as_num", { - cmnd = function(self, num) - local t = minetest.get_timeofday() - local h = math.floor(t*24) % 24 - local m = math.floor(t*1440) % 60 - return h * 100 + m - end, - help = " $time_as_num() --> e.g.: 1845\n".. - " Read time of day as number (24h).\n".. - ' example: time = $time_as_num()' -}) - -techage.lua_ctlr.register_action("send_cmnd", { - cmnd = function(self, num, cmnd, data) - num = tostring(num or "") - cmnd = tostring(cmnd or "") - if not_protected(self.meta.owner, num) then - return techage.send_single(self.meta.number, num, cmnd, data) - end - end, - help = " $send_cmnd(num, cmnd, add_data)\n".. - ' Send a command to the device with number "num".\n'.. - ' "cmnd" is the command as text string\n'.. - ' "add_data" is additional data (optional)\n'.. - ' example: $send_cmnd("1234", "on")' -}) - -techage.lua_ctlr.register_action("set_filter", { - cmnd = function(self, num, slot, val) - num = tostring(num or "") - slot = tostring(slot or "red") - val = tostring(val or "on") - if not_protected(self.meta.owner, num) then - techage.send_single(self.meta.number, num, "port", slot.."="..val) - end - end, - help = " $set_filter(num, slot, val)\n".. - ' Turn on/off a Distributor filter slot.\n'.. - ' example: $set_filter("1234", "red", "off")' -}) - -techage.lua_ctlr.register_action("get_filter", { - cmnd = function(self, num, slot) - num = tostring(num or "") - slot = tostring(slot or "red") - if not_protected(self.meta.owner, num) then - return techage.send_single(self.meta.number, num, "port", slot) - end - end, - help = " $get_filter(num, slot)\n".. - ' Read state of a Distributor filter slot.\n'.. - ' Return value is "on" or "off".\n'.. - ' example: state = $get_filter("1234", "red")' -}) - -techage.lua_ctlr.register_action("display", { - cmnd = function(self, num, row, text) - num = tostring(num or "") - row = tonumber(row or 1) or 1 - text = tostring(text or "") - if not_protected(self.meta.owner, num) then - if text:byte(1) == 32 then -- left aligned? - -- use the '\t' lcdlib control char for left-aligned - text = "\t" .. text:sub(2) - end - if row == 0 then -- add line? - techage.send_single(self.meta.number, num, "add", text) - else - local payload = safer_lua.Store() - payload.set("row", row) - payload.set("str", text) - techage.send_single(self.meta.number, num, "set", payload) - end - end - end, - help = " $display(num, row, text)\n".. - ' Send a text line to the display with number "num".\n'.. - " 'row' is a value from 1..5, or 0 for scroll screen\n".. - " and add a new line. If the first char of the string\n".. - " is a blank, the text will be horizontally centered.\n".. - ' example: $display("123", 1, "Hello "..name)' - -}) - -techage.lua_ctlr.register_action("display2", { - cmnd = function(self, num, row, text) - num = tostring(num or "") - row = tonumber(row or 1) or 1 - text = tostring(text or "") - if not_protected(self.meta.owner, num) then - if row == 0 then -- add line? - techage.send_single(self.meta.number, num, "add", text) - else - local payload = safer_lua.Store() - payload.set("row", row) - payload.set("str", text) - techage.send_single(self.meta.number, num, "set", payload) - end - end - end, - help = " $display2(num, row, text)\n".. - " Alternative 'display' function with different\n".. - " control char. If the first char of the string\n".. - " is a '\t', the text will be horizontally centered." - -}) - -techage.lua_ctlr.register_action("clear_screen", { - cmnd = function(self, num) - num = tostring(num or "") - if not_protected(self.meta.owner, num) then - techage.send_single(self.meta.number, num, "clear", nil) - end - end, - help = " $clear_screen(num)\n".. - ' Clear the screen of the display\n'.. - ' with number "num".\n'.. - ' example: $clear_screen("1234")' -}) - -techage.lua_ctlr.register_action("chat", { - cmnd = function(self, text) - text = tostring(text or "") - minetest.chat_send_player(self.meta.owner, "[TA4 Lua Controller] "..text) - end, - help = " $chat(text,...)\n".. - " Send yourself a chat message.\n".. - ' example: $chat("Hello "..name)' -}) - -techage.lua_ctlr.register_action("door", { - cmnd = function(self, pos, text) - pos = tostring(pos or "") - text = tostring(text or "") - pos = minetest.string_to_pos("("..pos..")") - if pos then - local door = doors.get(pos) - if door then - local player = { - get_player_name = function() return self.meta.owner end, - is_player = function() return true end, - } - if text == "open" then - door:open(player) - elseif text == "close" then - door:close(player) - end - end - end - end, - help = " $door(pos, text)\n".. - ' Open/Close a door at position "pos"\n'.. - ' example: $door("123,7,-1200", "close")\n'.. - " Hint: Use the Techage Programmer to\ndetermine the door position." -}) - -techage.lua_ctlr.register_function("item_description", { - cmnd = function(self, itemstring) - local item_def = minetest.registered_items[itemstring] - if item_def and item_def.description then - return minetest.get_translated_string("en", item_def.description) - end - return "" - end, - help = " $item_description(itemstring)\n".. - " Get the description for a specified itemstring.\n".. - ' example: desc = $item_description("default:apple")' -}) - - --- function not_protected(owner, number(s)) -techage.lua_ctlr.not_protected = not_protected diff --git a/techage/lua_controller/controller.lua b/techage/lua_controller/controller.lua deleted file mode 100644 index 0861209..0000000 --- a/techage/lua_controller/controller.lua +++ /dev/null @@ -1,679 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Lua Controller - -]]-- - --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta - -local sHELP = [[TA4 Lua Controller - - This controller is used to control and monitor - TechAge machines. - This controller can be programmed in Lua. - - See on GitHub for more help: - https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md - - or download the PDF file from: - https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.pdf - -]] - -techage.lua_ctlr = {} - -local BATTERY_CAPA = 10000000 - -local Cache = {} - -local STATE_STOPPED = 0 -local STATE_RUNNING = 1 -local CYCLE_TIME = 1 - -local tCommands = {} -local tFunctions = {" Overview", " Data structures"} -local tHelpTexts = {[" Overview"] = sHELP, [" Data structures"] = safer_lua.DataStructHelp} -local sFunctionList = "" -local tFunctionIndex = {} - -minetest.after(2, function() - sFunctionList = table.concat(tFunctions, ",") - for idx,key in ipairs(tFunctions) do - tFunctionIndex[key] = idx - end -end) - -local function output(pos, text) - local meta = minetest.get_meta(pos) - text = meta:get_string("output") .. "\n" .. (text or "") - text = text:sub(-500,-1) - meta:set_string("output", text) -end - --- --- API functions for function/action registrations --- -function techage.lua_ctlr.register_function(key, attr) - tCommands[key] = attr.cmnd - table.insert(tFunctions, " $"..key) - tHelpTexts[" $"..key] = attr.help -end - -function techage.lua_ctlr.register_action(key, attr) - tCommands[key] = attr.cmnd - table.insert(tFunctions, " $"..key) - tHelpTexts[" $"..key] = attr.help -end - -local function merge(dest, keys, values) - for idx,key in ipairs(keys) do - dest.env[key] = values[idx] - end - return dest -end - -techage.lua_ctlr.register_action("print", { - cmnd = function(self, text) - local pos = self.meta.pos - text = tostring(text or "") - output(pos, text) - --print("Lua: "..text) - end, - help = " $print(text)\n".. - " Send a text line to the output window.\n".. - ' e.g. $print("Hello "..name)' -}) - -techage.lua_ctlr.register_action("loopcycle", { - cmnd = function(self, cycletime) - cycletime = math.floor(tonumber(cycletime) or 0) - local meta = minetest.get_meta(self.meta.pos) - meta:set_int("cycletime", cycletime) - meta:set_int("cyclecount", 0) - end, - help = "$loopcycle(seconds)\n".. - " This function allows to change the\n".. - " call frequency of the loop() function.\n".. - " value is in seconds, 0 = disable\n".. - ' e.g. $loopcycle(10)' -}) - -techage.lua_ctlr.register_action("events", { - cmnd = function(self, event) - self.meta.events = event or false - end, - help = "$events(true/false)\n".. - " Enable/disable event handling.\n".. - ' e.g. $events(true) -- enable events' -}) - -techage.lua_ctlr.register_function("get_ms_time", { - cmnd = function(self) - return math.floor(minetest.get_us_time() / 1000) - end, - help = " ms = $get_ms_time()\n".. - " returns time with millisecond precision." -}) - -techage.lua_ctlr.register_function("get_gametime", { - cmnd = function(self) - return minetest.get_gametime() - end, - help = " t = $get_gametime()\n".. - " returns the time, in seconds, since the world was created." -}) - -techage.lua_ctlr.register_function("position", { - cmnd = function(self, number) - local info = techage.get_node_info(number) - if info then - return S(info.pos) - end - return "(-,-,-)" - end, - help = " pos = $position(number)\n".. - " returns the position '(x,y,z)' of the device\n with given number." -}) - -techage.lua_ctlr.register_action("battery", { - cmnd = function(self) - local meta = minetest.get_meta(self.meta.pos) - local batpos = minetest.string_to_pos(meta:get_string("battery")) - local batmeta = minetest.get_meta(batpos) - local val = (BATTERY_CAPA - math.min(batmeta:get_int("content") or 0, BATTERY_CAPA)) - return 100 - math.floor((val * 100.0 / BATTERY_CAPA)) - end, - help = " lvl = $battery()\n".. - " Get charge level of battery connected to Controller.\n".. - " Function returns percent number (0-100) where 100 means full.\n".. - " example: battery_percent = $battery()" -}) - - -local function formspec0(meta) - local state = meta:get_int("state") == techage.RUNNING - local init = meta:get_string("init") - init = minetest.formspec_escape(init) - return "size[4,3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "label[0,0;No Battery?]".. - "button[1,2;1.8,1;start;Start]" -end - -local function formspec1(meta) - local state = meta:get_int("state") == techage.RUNNING - local cmnd = state and "stop;Stop" or "start;Start" - local init = meta:get_string("init") - init = minetest.formspec_escape(init) - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]".. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;1;;true]".. - "textarea[0.3,0.2;10,8.3;init;function init();"..init.."]".. - "background[0.1,0.3;9.8,7.0;techage_form_mask.png]".. - "label[0,7.3;end]".. - "button_exit[4.4,7.5;1.8,1;cancel;Cancel]".. - "button[6.3,7.5;1.8,1;save;Save]".. - "button[8.2,7.5;1.8,1;"..cmnd.."]" -end - -local function formspec2(meta) - local state = meta:get_int("state") == techage.RUNNING - local cmnd = state and "stop;Stop" or "start;Start" - local func = meta:get_string("func") - func = minetest.formspec_escape(func) - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]".. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;2;;true]".. - "textarea[0.3,0.2;10,8.3;func;functions:;"..func.."]".. - "background[0.1,0.3;9.8,7.0;techage_form_mask.png]".. - "button_exit[4.4,7.5;1.8,1;cancel;Cancel]".. - "button[6.3,7.5;1.8,1;save;Save]".. - "button[8.2,7.5;1.8,1;"..cmnd.."]" -end - -local function formspec3(meta) - local state = meta:get_int("state") == techage.RUNNING - local cmnd = state and "stop;Stop" or "start;Start" - local loop = meta:get_string("loop") - loop = minetest.formspec_escape(loop) - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]".. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;3;;true]".. - "textarea[0.3,0.2;10,8.3;loop;function loop(ticks, elapsed);"..loop.."]".. - "background[0.1,0.3;9.8,7.0;techage_form_mask.png]".. - "label[0,7.3;end]".. - "button_exit[4.4,7.5;1.8,1;cancel;Cancel]".. - "button[6.3,7.5;1.8,1;save;Save]".. - "button[8.2,7.5;1.8,1;"..cmnd.."]" -end - -local function formspec4(meta) - local state = meta:get_int("state") == techage.RUNNING - local cmnd = state and "stop;Stop" or "start;Start" - local output = meta:get_string("output") - output = minetest.formspec_escape(output) - output = output:gsub("\n", ",") - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;4;;true]".. - "table[0.2,0.2;9.5,7;output;"..output..";200]".. - "button[4.4,7.5;1.8,1;clear;Clear]".. - "button[6.3,7.5;1.8,1;update;Update]".. - "button[8.2,7.5;1.8,1;"..cmnd.."]" -end - -local function formspec5(meta) - local notes = meta:get_string("notes") - notes = minetest.formspec_escape(notes) - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=false]".. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;5;;true]".. - "textarea[0.3,0.2;10,8.3;notes;Notepad:;"..notes.."]".. - "background[0.1,0.3;9.8,7.0;techage_form_mask.png]".. - "button_exit[6.3,7.5;1.8,1;cancel;Cancel]".. - "button[8.2,7.5;1.8,1;save;Save]" -end - -local function formspec6(items, pos, text) - text = minetest.formspec_escape(text) - return "size[10,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[textarea;font=mono;textcolor=#FFFFFF]".. - "tabheader[0,0;tab;init,func,loop,outp,notes,help;6;;true]".. - "label[0,-0.2;Functions:]".. - "dropdown[0.3,0.2;10,8.3;functions;"..items..";"..pos.."]".. - "textarea[0.3,1.3;10,8;help;Help:;"..text.."]" -end - -local function patch_error_string(err, line_offs) - local tbl = {} - for s in err:gmatch("[^\r\n]+") do - if s:find("loop:(%d+):") then - local prefix, line, err = s:match("(.-)loop:(%d+):(.+)") - if prefix and line and err then - if tonumber(line) < line_offs then - table.insert(tbl, prefix.."func:"..line..":"..err) - else - line = tonumber(line) - line_offs - table.insert(tbl, prefix.."loop:"..line..":"..err) - end - end - else - table.insert(tbl, s) - end - end - return table.concat(tbl, "\n") -end - -local function error(pos, err) - local meta = minetest.get_meta(pos) - local func = meta:get_string("func") - local _,line_offs = string.gsub(func, "\n", "\n") - line_offs = line_offs + 1 - err = patch_error_string(err, line_offs) - output(pos, err) - local number = meta:get_string("number") - meta:set_string("infotext", "Controller "..number..": error") - meta:set_int("state", techage.STOPPED) - meta:set_int("running", STATE_STOPPED) - meta:set_string("formspec", formspec4(meta)) - minetest.get_node_timer(pos):stop() - return false -end - -local function compile(pos, meta, number) - local init = meta:get_string("init") - local func = meta:get_string("func") - local loop = meta:get_string("loop") - local owner = meta:get_string("owner") - local env = table.copy(tCommands) - env.meta = {pos=pos, owner=owner, number=number, error=error} - local code = safer_lua.init(pos, init, func.."\n"..loop, env, error) - - if code then - Cache[number] = {code=code, inputs={}, events=env.meta.events} - Cache[number].inputs.term = nil -- terminal inputs - Cache[number].inputs.msg = {} -- message queue - return true - end - return false -end - -local function battery(pos) - local battery_pos = minetest.find_node_near(pos, 1, {"techage:ta4_battery"}) - if battery_pos then - local meta = minetest.get_meta(pos) - meta:set_string("battery", minetest.pos_to_string(battery_pos)) - return true - end - return false -end - -local function start_controller(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - if not battery(pos) then - meta:set_string("formspec", formspec0(meta)) - return false - end - - meta:set_string("output", "") - meta:set_int("cycletime", 1) - meta:set_int("cyclecount", 0) - meta:set_int("cpu", 0) - - if compile(pos, meta, number) then - meta:set_int("state", techage.RUNNING) - meta:set_int("running", STATE_RUNNING) - minetest.get_node_timer(pos):start(CYCLE_TIME) - meta:set_string("formspec", formspec4(meta)) - meta:set_string("infotext", "Controller "..number..": running") - return true - end - return false -end - -local function stop_controller(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - meta:set_int("state", techage.STOPPED) - meta:set_int("running", STATE_STOPPED) - minetest.get_node_timer(pos):stop() - meta:set_string("infotext", "Controller "..number..": stopped") - meta:set_string("formspec", formspec3(meta)) -end - -local function no_battery(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - meta:set_int("state", techage.STOPPED) - meta:set_int("running", STATE_STOPPED) - minetest.get_node_timer(pos):stop() - meta:set_string("infotext", "Controller "..number..": No battery") - meta:set_string("formspec", formspec0(meta)) -end - -local function update_battery(meta, cpu) - local pos = minetest.string_to_pos(meta:get_string("battery")) - if pos then - meta = minetest.get_meta(pos) - local content = meta:get_int("content") - cpu - if content <= 0 then - meta:set_int("content", 0) - return false - end - meta:set_int("content", content) - return true - end -end - -local function call_loop(pos, meta, elapsed) - local t = minetest.get_us_time() - local number = meta:get_string("number") - if meta:get_int("running") == STATE_RUNNING then - if Cache[number] or compile(pos, meta, number) then - local cpu = meta:get_int("cpu") or 0 - local code = Cache[number].code - local res = safer_lua.run_loop(pos, elapsed, code, error) - if res then - -- Don't count thread changes - t = math.min(minetest.get_us_time() - t, 1000) - cpu = math.floor(((cpu * 20) + t) / 21) - meta:set_int("cpu", cpu) - meta:set_string("infotext", "Controller "..number..": running ("..cpu.."us)") - if not update_battery(meta, cpu) then - no_battery(pos) - return false - end - end - -- further messages available? - return res - end - end - return false -end - -local function on_timer(pos, elapsed) - local meta = minetest.get_meta(pos) - -- considering cycle frequency - local cycletime = meta:get_int("cycletime") or 1 - local cyclecount = (meta:get_int("cyclecount") or 0) + 1 - if cycletime == 0 or cyclecount < cycletime then - meta:set_int("cyclecount", cyclecount) - return true - end - meta:set_int("cyclecount", 0) - - if techage.is_activeformspec(pos) then - local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec4(meta)) - end - return call_loop(pos, meta, elapsed) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local meta = minetest.get_meta(pos) - - --print(dump(fields)) - if fields.cancel == nil then - if fields.init then - meta:set_string("init", fields.init) - meta:set_string("formspec", formspec1(meta)) - elseif fields.func then - meta:set_string("func", fields.func) - meta:set_string("formspec", formspec2(meta)) - elseif fields.loop then - meta:set_string("loop", fields.loop) - meta:set_string("formspec", formspec3(meta)) - elseif fields.notes then - meta:set_string("notes", fields.notes) - meta:set_string("formspec", formspec5(meta)) - end - end - - if fields.update then - meta:set_string("formspec", formspec4(meta)) - techage.set_activeformspec(pos, player) - elseif fields.clear then - meta:set_string("output", "") - meta:set_string("formspec", formspec4(meta)) - elseif fields.tab == "1" then - meta:set_string("formspec", formspec1(meta)) - elseif fields.tab == "2" then - meta:set_string("formspec", formspec2(meta)) - elseif fields.tab == "3" then - meta:set_string("formspec", formspec3(meta)) - elseif fields.tab == "4" then - meta:set_string("formspec", formspec4(meta)) - elseif fields.tab == "5" then - meta:set_string("formspec", formspec5(meta)) - elseif fields.tab == "6" then - meta:set_string("formspec", formspec6(sFunctionList, 1, sHELP)) - elseif fields.start == "Start" then - start_controller(pos) - minetest.log("action", player:get_player_name() .. - " starts the sl_controller at ".. minetest.pos_to_string(pos)) - elseif fields.stop == "Stop" then - stop_controller(pos) - elseif fields.functions then - local key = fields.functions - local text = tHelpTexts[key] or "" - local pos = tFunctionIndex[key] or 1 - meta:set_string("formspec", formspec6(sFunctionList, pos, text)) - end -end - -minetest.register_node("techage:ta4_lua_controller", { - description = "TA4 Lua Controller", - inventory_image = "techage_lua_controller_inventory.png", - wield_image = "techage_lua_controller_inventory.png", - stack_max = 1, - tiles = { - -- up, down, right, left, back, front - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png", - "techage_smartline.png^techage_lua_controller.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -6/32, 14/32, 6/32, 6/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local number = techage.add_node(pos, "techage:ta4_lua_controller") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("number", number) - meta:set_int("state", techage.STOPPED) - meta:set_int("running", STATE_STOPPED) - meta:set_string("init", "-- called only once") - meta:set_string("func", "-- for your functions") - meta:set_string("loop", "-- called every second") - meta:set_string("notes", "For your notes / snippets") - meta:mark_as_private("init") - meta:mark_as_private("func") - meta:mark_as_private("loop") - meta:mark_as_private("notes") - meta:set_string("formspec", formspec1(meta)) - meta:set_string("infotext", "Controller "..number..": stopped") - end, - - on_receive_fields = on_receive_fields, - - on_rightclick = function(pos, node, clicker) - local meta = M(pos) - if meta:get_int("running") == STATE_RUNNING then - techage.set_activeformspec(pos, clicker) - meta:set_string("formspec", formspec4(meta)) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - on_timer = on_timer, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=1, cracky=1, crumbly=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_lua_controller", - recipe = { - {"basic_materials:plastic_sheet", "dye:blue", "techage:aluminum"}, - {"", "default:copper_ingot", ""}, - {"techage:ta4_ramchip", "techage:ta4_wlanchip", "techage:ta4_ramchip"}, - }, -}) - --- write inputs from remote nodes -local function set_input(pos, number, input, val) - if input and M(pos):get_int("state") == techage.RUNNING then - if (Cache[number] or compile(pos, M(pos), number)) and Cache[number].inputs then - if input == "msg" then - if #Cache[number].inputs["msg"] < 10 then - table.insert(Cache[number].inputs["msg"], val) - end - else - Cache[number].inputs[input] = val - end - if Cache[number].events then -- events enabled? - local t = minetest.get_us_time() - if not Cache[number].last_event or Cache[number].last_event < t then - local meta = minetest.get_meta(pos) - minetest.after(0.01, call_loop, pos, meta, -1) - Cache[number].last_event = t + 100000 -- add 100 ms - end - end - end - end -end - --- used by the command "input" -function techage.lua_ctlr.get_input(number, input) - if input then - if Cache[number] and Cache[number].inputs then - return Cache[number].inputs[input] or "off" - end - end - return "off" -end - -function techage.lua_ctlr.get_next_input(number) - if Cache[number] and Cache[number].inputs then - local num, state = next(Cache[number].inputs or {}) - if num ~= "msg" and num ~= "term" then - if num then - Cache[number].inputs[num] = nil - end - return num, state - end - end -end - --- used for Terminal commands -function techage.lua_ctlr.get_command(number) - if Cache[number] and Cache[number].inputs then - local cmnd = Cache[number].inputs["term"] - Cache[number].inputs["term"] = nil - return cmnd - end -end - --- used for queued messages -function techage.lua_ctlr.get_msg(number) - if Cache[number] and Cache[number].inputs then - return table.remove(Cache[number].inputs["msg"], 1) - end -end - -techage.register_node({"techage:ta4_lua_controller"}, { - on_recv_message = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - - if topic == "on" then - set_input(pos, number, src, topic) - elseif topic == "off" then - set_input(pos, number, src, topic) - elseif topic == "term" then - set_input(pos, number, "term", payload) - elseif topic == "msg" then - set_input(pos, number, "msg", {src = src, data = payload}) - elseif topic == "state" then - local running = meta:get_int("running") or STATE_STOPPED - return techage.StateStrings[running] or "stopped" - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - - if topic == 1 and payload[1] == 1 then - set_input(pos, number, src, "on") - elseif topic == 1 and payload[1] == 0 then - set_input(pos, number, src, "off") - else - return 2 - end - return 0 - end, - on_beduino_request_data = function(pos, src, topic, payload) - local meta = minetest.get_meta(pos) - - if topic == 142 then - local running = meta:get_int("running") or STATE_STOPPED - return 0, {running} - else - return 2, "" - end - end, -}) diff --git a/techage/lua_controller/sensorchest.lua b/techage/lua_controller/sensorchest.lua deleted file mode 100644 index 5ba2f1e..0000000 --- a/techage/lua_controller/sensorchest.lua +++ /dev/null @@ -1,276 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Sensor Chest - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local PlayerActions = {} -local InventoryState = {} - - -local function store_action(pos, player, action) - local meta = minetest.get_meta(pos) - local name = player and player:get_player_name() or "" - local number = meta:get_string("node_number") - PlayerActions[number] = {name, action} -end - -local function send_off_command(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - if number ~= "" then - local own_num = meta:get_string("node_number") - techage.send_single(own_num, number, "off") - end -end - -local function send_command(pos) - local meta = minetest.get_meta(pos) - local number = meta:get_string("number") - if number ~= "" then - local own_num = meta:get_string("node_number") - techage.send_single(own_num, number, "on") - minetest.after(0.2, send_off_command, pos) - end -end - -local function get_stack(pos, idx) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack("main", idx) - return stack:get_name(), stack:get_count() -end - -local function get_stacks(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local a = safer_lua.Array() - for idx = 1,4 do - local stack = inv:get_stack("main", idx) - local s = safer_lua.Store() - if stack:get_count() > 0 then - s.set("name", stack:get_name()) - s.set("count", stack:get_count()) - a.add(s) - end - end - return a -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if M(pos):get_string("public") ~= "true" and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - store_action(pos, player, "put") - send_command(pos) - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if M(pos):get_string("public") ~= "true" and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - store_action(pos, player, "take") - send_command(pos) - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -local function formspec1() - return "size[5.5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,1;5,1;number;TA4 Lua Controller number:;]" .. - "checkbox[0.5,1.8;public;"..S("Allow public chest access")..";false]".. - "button_exit[1.7,2.8;2,1;exit;Save]" -end - -local function formspec2(pos) - local text = M(pos):get_string("text") - return "size[8,6]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;0,0;2,2;]".. - "button[2,0;1,1;f1;F1]".. - "button[2,1;1,1;f2;F2]".. - "label[3,0;"..text.."]".. - "list[current_player;main;0,2.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:ta4_sensor_chest", { - description = S("TA4 Sensor Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png^techage_appl_sensor.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png^techage_appl_sensor.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_back_ta4.png^techage_appl_sensor.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_chest_front_ta4.png^techage_appl_sensor.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 4) - end, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - local number = techage.add_node(pos, "techage:ta4_sensor_chest") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("text", "Text to be changed\nby command.") - meta:set_string("formspec", formspec1()) - meta:set_string("infotext", S("TA4 Sensor Chest").." "..number..": "..S("not connected")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if meta:get_string("public") ~= "true" and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - if fields.public then - meta:set_string("public", fields.public) - end - if fields.quit == "true" and fields.number and fields.number ~= "" then - local owner = meta:get_string("owner") - if techage.check_numbers(fields.number, owner) then - meta:set_string("number", fields.number) - local node_number = meta:get_string("node_number") - meta:set_string("infotext", S("TA4 Sensor Chest").." "..node_number..": "..S("connected with").." "..fields.number) - meta:set_string("formspec", formspec2(pos)) - end - elseif fields.f1 then - store_action(pos, player, "f1") - send_command(pos) - meta:set_string("formspec", formspec2(pos)) - elseif fields.f2 then - store_action(pos, player, "f2") - send_command(pos) - meta:set_string("formspec", formspec2(pos)) - end - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA4 Sensor Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:ta4_sensor_chest"}, { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_items(pos, inv, "main", num) - end, - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.put_items(inv, "main", stack) - end, - - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return techage.get_inv_state(inv, "main") - elseif topic == "action" then - local meta = minetest.get_meta(pos) - local number = meta:get_string("node_number") - return (PlayerActions[number] or {})[1], (PlayerActions[number] or {})[2] - elseif topic == "stacks" then - return get_stacks(pos) - elseif topic == "text" then - local meta = minetest.get_meta(pos) - meta:set_string("text", tostring(payload)) - meta:set_string("formspec", formspec2(pos)) - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 66 then - local meta = minetest.get_meta(pos) - meta:set_string("text", tostring(payload)) - meta:set_string("formspec", formspec2(pos)) - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 131 then -- Chest State - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - return 0, {techage.get_inv_state_num(inv, "main")} - elseif topic == 138 and payload[1] == 1 then -- Sensor Chests State (action) - local meta = minetest.get_meta(pos) - local number = meta:get_string("node_number") - local action = (PlayerActions[number] or {})[2] or "None" - return 0, {({put = 1, get = 2})[action] or 0} - elseif topic == 138 and payload[1] == 2 then -- Sensor Chests State (player name) - local meta = minetest.get_meta(pos) - local number = meta:get_string("node_number") - return 0, (PlayerActions[number] or {})[1] - elseif topic == 138 and payload[1] == 3 then -- Sensor Chests State (stack item name) - local name, _ = get_stack(pos, payload[2] or 1) - return 0, name - elseif topic == 138 and payload[1] == 4 then -- Sensor Chests State (stack item count) - local _, count = get_stack(pos, payload[2] or 1) - return 0, {count} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta4_sensor_chest", - recipe = {"techage:chest_ta4", "techage:ta4_wlanchip"} -}) diff --git a/techage/lua_controller/server.lua b/techage/lua_controller/server.lua deleted file mode 100644 index 43838cd..0000000 --- a/techage/lua_controller/server.lua +++ /dev/null @@ -1,325 +0,0 @@ ---[[ - - Techage - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - server.lua: - -]]-- - --- for lazy programmers -local S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta - -local SERVER_CAPA = 5000 - -local function formspec(nvm) - local names = table.concat(nvm.names or {}, " ") - return "size[9,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.2,1;9,1;names;Allowed user names (space separated):;"..names.."]" .. - "button_exit[3.5,2.5;2,1;exit;Save]" -end - -minetest.register_node("techage:ta4_server", { - description = "TA4 Lua Server", - tiles = { - -- up, down, right, left, back, front - "techage_server_top.png", - "techage_server_top.png", - "techage_server_side.png", - "techage_server_side.png^[transformFX", - "techage_server_back.png", - { - name = "techage_server_front.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1, - }, - }, - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -3/16, -8/16, -7/16, 3/16, 6/16, 7/16}, - }, - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta4_server") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("number", number) - meta:set_string("formspec", formspec(nvm)) - nvm.size = 0 - meta:set_string("infotext", "Server "..number..": ("..nvm.size.."/"..SERVER_CAPA..")") - minetest.get_node_timer(pos):start(20) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local owner = meta:get_string("owner") - if player:get_player_name() == owner then - if fields.names and fields.names ~= "" then - nvm.names = string.split(fields.names, " ") - meta:set_string("formspec", formspec(nvm)) - end - end - end, - - on_dig = function(pos, node, puncher, pointed_thing) - if minetest.is_protected(pos, puncher:get_player_name()) then - return - end - techage.del_mem(pos) - minetest.node_dig(pos, node, puncher, pointed_thing) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - on_timer = function(pos, elasped) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.size = nvm.size or 0 - local number = meta:get_string("number") - meta:set_string("infotext", "Server "..number..": ("..nvm.size.."/"..SERVER_CAPA..")") - return true - end, - - paramtype = "light", - sunlight_propagates = true, - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - groups = {choppy=1, cracky=1, crumbly=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_server", - recipe = { - {"default:steel_ingot", "dye:black", "default:steel_ingot"}, - {"techage:ta4_ramchip", "default:copper_ingot", "techage:ta4_ramchip"}, - {"techage:ta4_ramchip", "techage:ta4_wlanchip", "techage:ta4_ramchip"}, - }, -}) - -minetest.register_node("techage:ta4_server2", { - description = "TA4 Lua Rack Server", - tiles = { - -- up, down, right, left, back, front - "techage_server2_top.png", - "techage_server2_top.png", - "techage_server2_side.png", - "techage_server2_side.png^[transformFX", - "techage_server2_back.png", - { - name = "techage_server2_front.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1, - }, - }, - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, -0.4375, -0.4375, 0.5}, - {-0.5, 0.4375, -0.5, -0.4375, 0.5, 0.5}, - {0.4375, -0.5, -0.5, 0.5, -0.4375, 0.5}, - {0.4375, 0.4375, -0.5, 0.5, 0.5, 0.5}, - {-0.5, -0.5, -0.375, -0.4375, 0.5, -0.3125}, - {-0.5, -0.5, 0.3125, -0.4375, 0.5, 0.375}, - {0.4375, -0.5, 0.3125, 0.5, 0.5, 0.375}, - {0.4375, -0.5, -0.375, 0.5, 0.5, -0.3125}, - {-0.4375, -0.3125, -0.4375, 0.4375, 0.3125, 0.4375}, - {0.4375, -0.0625, -0.4375, 0.5, 0, 0.4375}, - {-0.5, -0.0625, -0.4375, -0.4375, 0, 0.4375}, - } - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta4_server2") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("number", number) - meta:set_string("formspec", formspec(nvm)) - nvm.size = 0 - meta:set_string("infotext", "Server "..number..": ("..nvm.size.."/"..SERVER_CAPA..")") - minetest.get_node_timer(pos):start(20) - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local owner = meta:get_string("owner") - if player:get_player_name() == owner then - if fields.names and fields.names ~= "" then - nvm.names = string.split(fields.names, " ") - meta:set_string("formspec", formspec(nvm)) - end - end - end, - - on_dig = function(pos, node, puncher, pointed_thing) - if minetest.is_protected(pos, puncher:get_player_name()) then - return - end - techage.del_mem(pos) - minetest.node_dig(pos, node, puncher, pointed_thing) - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - on_timer = function(pos, elasped) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - nvm.size = nvm.size or 0 - local number = meta:get_string("number") - meta:set_string("infotext", "Server "..number..": ("..nvm.size.."/"..SERVER_CAPA..")") - return true - end, - - paramtype = "light", - sunlight_propagates = true, - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - groups = {choppy=1, cracky=1, crumbly=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta4_server2", - recipe = {"techage:ta4_server"}, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta4_server", - recipe = {"techage:ta4_server2"}, -}) - -local function calc_size(v) - if type(v) == "number" then - return 1 - elseif type(v) == "boolean" then - return 1 - elseif v == nil then - return 0 - elseif type(v) == "string" then - return #v - elseif v.MemSize then - return v.MemSize - else - return nil - end -end - -local function get_memory(num, name) - local info = techage.get_node_info(num) - if info and info.pos then - local nvm = techage.get_nvm(info.pos) - nvm.names = nvm.names or {} - for _,n in ipairs(nvm.names) do - if name == n then - nvm.data = nvm.data or {} - return nvm - end - end - end -end - -local function write_value(nvm, key, item) - if nvm and nvm.size < SERVER_CAPA then - if nvm.data[key] then - nvm.size = nvm.size - calc_size(nvm.data[key]) - end - if type(item) == "table" then - item = safer_lua.datastruct_to_table(item) - end - nvm.size = nvm.size + calc_size(item) - nvm.data[key] = item - return true - end - return false -end - -local function read_value(nvm, key) - local item = nvm.data[key] - if type(item) == "table" then - item = safer_lua.table_to_datastruct(item) - end - return item -end - -techage.register_node({"techage:ta4_server", "techage:ta4_server2"}, { - on_recv_message = function(pos, src, topic, payload) - return "unsupported" - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(20) - end, -}) - - -techage.lua_ctlr.register_function("server_read", { - cmnd = function(self, num, key) - if type(key) == "string" then - local nvm = get_memory(num, self.meta.owner) - if nvm then - return read_value(nvm, key) - end - else - self.error("Invalid server_read parameter") - end - end, - help = " $server_read(num, key)\n".. - " Read a value from the server.\n".. - " 'key' must be a string.\n".. - ' example: state = $server_read("123", "state")' -}) - -techage.lua_ctlr.register_action("server_write", { - cmnd = function(self, num, key, value) - if type(key) == "string" then - local nvm = get_memory(num, self.meta.owner) - if nvm then - return write_value(nvm, key, value) - end - else - self.error("Invalid server_write parameter") - end - end, - help = " $server_write(num, key, value)\n".. - " Store a value on the server under the key 'key'.\n".. - " 'key' must be a string. 'value' can be either a\n".. - " number, string, boolean, nil or data structure.\n".. - " return value: true if successful or false\n".. - ' example: res = $server_write("123", "state", state)' -}) diff --git a/techage/lua_controller/terminal.lua b/techage/lua_controller/terminal.lua deleted file mode 100644 index 78d5824..0000000 --- a/techage/lua_controller/terminal.lua +++ /dev/null @@ -1,261 +0,0 @@ ---[[ - - Techage - ======= - - Copyright (C) 2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - terminal.lua: - -]]-- - -local HELP = [[#### TA4 Lua Controller Terminal #### - -Send commands to your Controller -and output text messages from your -Controller to the Terminal. - -Commands can have up to 80 characters. -Local commands: -- clear = clear screen -- help = this message -- pub = switch to public use -- priv = switch to private use -Global commands: -- send on/off = send on/off event -- msg = send a text message - -For more help: -https://github.com/joe7575/techage/wiki - -]] - -local function formspec1() - return "size[6,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "field[0.5,1;5,1;number;TA4 Lua Controller number:;]" .. - "button_exit[1.5,2.5;2,1;exit;Save]" -end - -local function formspec2(meta) - local output = meta:get_string("output") - output = minetest.formspec_escape(output) - output = output:gsub("\n", ",") - return "size[9,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "style_type[table,field;font=mono]".. - "table[0.1,0.1;8.6,6.6;output;"..output..";200]".. - "field[0.5,7.6;6,1;cmnd;Enter command;]" .. - "field_close_on_enter[cmnd;false]".. - "button[6.7,7.3;2,1;ok;Enter]" -end - -local function output(pos, text) - local meta = minetest.get_meta(pos) - text = meta:get_string("output") .. "\n" .. (text or "") - text = text:sub(-500,-1) - meta:set_string("output", text) - meta:set_string("formspec", formspec2(meta)) - -end - -local function command(pos, cmnd, player) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") - if cmnd then - cmnd = cmnd:sub(1,80) - - if cmnd == "clear" then - meta:set_string("output", "") - meta:set_string("formspec", formspec2(meta)) - elseif cmnd == "help" then - local meta = minetest.get_meta(pos) - meta:set_string("output", HELP) - meta:set_string("formspec", formspec2(meta)) - elseif cmnd == "pub" and owner == player then - meta:set_int("public", 1) - --output(pos, player..":$ "..cmnd) - output(pos, "> "..cmnd) - output(pos, "Switched to public use!") - elseif cmnd == "priv" and owner == player then - meta:set_int("public", 0) - --output(pos, player..":$ "..cmnd) - output(pos, "> "..cmnd) - output(pos, "Switched to private use!") - elseif meta:get_int("public") == 1 or owner == player then - -- send on/off - local num, topic = cmnd:match('^send%s+([0-9]+)%s+([onff]+)$') - if num and topic then - local own_number = meta:get_string("own_number") - if techage.lua_ctlr.not_protected(owner, num) then - --output(pos, player..":$ send "..num.." "..topic) - output(pos, "> send "..num.." "..topic) - techage.send_single(own_number, num, topic, nil) - return - end - end - -- msg - local num, text = cmnd:match('^msg%s+([0-9]+)%s+(.+)$') - if num and text then - local own_number = meta:get_string("own_number") - if techage.lua_ctlr.not_protected(owner, num) then - --output(pos, player..":$ msg "..num.." "..text) - output(pos, "> msg "..num.." "..text) - techage.send_single(own_number, num, "msg", text) - return - end - end - local number = meta:get_string("number") - local own_number = meta:get_string("own_number") - if techage.lua_ctlr.not_protected(owner, number) then - --output(pos, player..":$ "..cmnd) - output(pos, "> "..cmnd) - techage.send_single(own_number, number, "term", cmnd) - end - end - end -end - -minetest.register_node("techage:ta4_terminal", { - description = "TA4 Lua Controller Terminal", - tiles = { - -- up, down, right, left, back, front - 'techage_terminal1_top.png', - 'techage_terminal1_bottom.png', - 'techage_terminal1_side.png', - 'techage_terminal1_side.png', - 'techage_terminal1_bottom.png', - "techage_terminal1_front.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-12/32, -16/32, -8/32, 12/32, -14/32, 12/32}, - {-12/32, -14/32, 12/32, 12/32, 6/32, 14/32}, - }, - }, - selection_box = { - type = "fixed", - fixed = { - {-12/32, -16/32, -8/32, 12/32, -14/32, 12/32}, - {-12/32, -14/32, 12/32, 12/32, 6/32, 14/32}, - }, - }, - - after_place_node = function(pos, placer) - local number = techage.add_node(pos, minetest.get_node(pos).name) - local meta = minetest.get_meta(pos) - meta:set_string("own_number", number) - meta:set_string("formspec", formspec1()) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", "TA4 Lua Controller Terminal "..number..": not connected") - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - if fields.number and fields.number ~= "" then - local owner = meta:get_string("owner") - if techage.check_numbers(fields.number, owner) then - meta:set_string("number", fields.number) - local own_number = meta:get_string("own_number") - meta:set_string("infotext", "TA4 Lua Controller Terminal "..own_number..": connected with "..fields.number) - meta:set_string("formspec", formspec2(meta)) - end - elseif (fields.key_enter == "true" or fields.ok == "Enter") and fields.cmnd ~= "" then - command(pos, fields.cmnd, player:get_player_name()) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_terminal", - recipe = { - {"", "techage:ta4_display", ""}, - {"dye:black", "techage:ta4_wlanchip", "default:copper_ingot"}, - {"", "techage:aluminum", ""}, - }, -}) - -techage.register_node({"techage:ta4_terminal"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "term" then - output(pos, payload) - return true - elseif topic == "msg" then - output(pos, tostring(payload.src)..": "..tostring(payload.text)) - return true - end - end, -}) - -techage.lua_ctlr.register_function("get_term", { - cmnd = function(self) - return techage.lua_ctlr.get_command(self.meta.number) - end, - help = ' $get_term() --> text string or nil\n'.. - ' Read an entered string (command) from the Terminal.\n'.. - ' example: s = $get_term()\n'.. - " The Terminal has to be connected to the controller." -}) - -techage.lua_ctlr.register_action("put_term", { - cmnd = function(self, num, text) - text = tostring(text or "") - if techage.lua_ctlr.not_protected(self.meta.owner, num) then - techage.send_single(self.meta.number, num, "term", text) - end - end, - help = " $put_term(num, text)\n".. - ' Send a text line to the terminal with number "num".\n'.. - ' example: $put_term("0123", "Hello "..name)' -}) - -techage.lua_ctlr.register_function("get_msg", { - cmnd = function(self, raw) - local msg = techage.lua_ctlr.get_msg(self.meta.number) - if msg then - local data = msg.data - if not raw then - data = tostring(data or "") - end - return msg.src, data - end - end, - help = ' $get_msg([raw]) --> number and any value or nil\n'.. - ' If the optional `raw` parameter is not set or false,\n'.. - ' the second return value is guaranteed to be a string.\n'.. - ' Read a received messages. Number is the node\n'.. - ' number of the sender.\n'.. - ' example: num,msg = $get_msg().' -}) - -techage.lua_ctlr.register_action("send_msg", { - cmnd = function(self, num, data) - if techage.lua_ctlr.not_protected(self.meta.owner, num) then - techage.send_single(self.meta.number, num, "msg", data) - end - end, - help = " $send_msg(num, data)\n".. - ' Send a message to the controller with number "num".\n'.. - ' example: $send_msg("0123", "test")' -}) diff --git a/techage/manuals/QSG.md b/techage/manuals/QSG.md deleted file mode 100644 index d2933aa..0000000 --- a/techage/manuals/QSG.md +++ /dev/null @@ -1,105 +0,0 @@ -# TechAge Quick Start Guide - -The Techage Modpack is an extensive collection of technical mods with many machines and systems, which unfortunately cannot be set up intuitively. Therefore, there is this Quick Start Guide and further manuals for the different mods. - - -Techage represents five technological ages: - -- Iron Age (TA1) - Simple tools like coal pile, coal burner, gravel sieve, hammer for getting ores and making goods -- Steam Age (TA2) - Simple machines that are powered by steam engines and drive axles -- Oil Age (TA3) - More modern machines that are powered by electricity -- Present (TA4) - Electricity from renewable energy sources such as sun and wind -- Future (TA5) - Machines to overcome space and time, new sources of energy and other achievements shape your life - -Since the levels build on each other, all ages have to be run through one after the other. - - - -## Manuals - -- [Techage](https://github.com/joe7575/techage/wiki) and ingame via TA Construction Plan - -- [Minecart](https://github.com/joe7575/minecart/blob/master/README.md) and ingame via player inventory help (the blue questionmark) -- [Hyperloop](https://github.com/joe7575/Minetest-Hyperloop/wiki) -- [Signs Bot](https://github.com/joe7575/signs_bot/blob/master/README.md) and ingame via player inventory help (the blue questionmark) - - - -## Iron Age (TA1) - -1. Search and harvest papyrus to make paper and craft the Techage Construction Board. This plan is the ingame manual for all four Techage phases -2. Cut trees and make wood out of them -3. Collect dirt for the charcoal burner to make charcoal -4. Go mining and seach for ores, or -5. Alternatively, use Hammer and Gravel Sieve to collect ore from gravel -6. Build a melting furnace and melting pot to melt iron and other ores in the melting pot -7. Use the Minecart Hopper to automate your Gravel Sieve - - - -## Steam Age (TA2) - -1. Build a stream engine according to the TA Construction Board -2. Craft machines like TA2 Grinder, TA2 Sieve, TA2 Distributor, TA2 Pusher, TA2 Autocrafter, TA2 Electronic Fab, and TA2 Quarry -3. Connect the machines with the stream engine via drive axles (if needed) -4. Use the Quarry to collect cobblestone or go mining -5. Crushing, grinding and sieving of cobblestone is used to extract ores -6. Build a Gravel washer according to the TA Construction Board to collect further ores from sieved gravel -7. TA2 Autocrafter and TA2 Electronic Fab help to get items for the next phase - - - -## Oil Age (TA3) - -1. Build a coal-fired Power Station which can be replaced later by a oil firebox -2. Craft new machines driven by electricity -3. Search for oil (petroleum) with the TA3 Oil Explorer (don't give up to early) -4. Drilling derricks and oil pumps help them get the oil -5. Railways are used to transport oil to the power plants -6. Distillation Towers are used to separate the oil into its components -7. Pumps and Tanks are used to pump and store the oil liquids -8. TA3 Industrial Furnace and TA3 Electronic Fab help to get items for the next phase - - - -## Present (TA4) - -1. Build solar and wind plants to get renewable energy -2. Build a Thermal Energy Storage to store the energy -3. Build a Chemical Reactor to manufacture further items -4. Build a Hyperloop network as passenger transportation system -5. Use the Signs Bot for further automation tasks -6. Use Controller, Displays and further logic to fully automate all machines... - - - -## Future (TA5) - -tbd. - - -## Power Consumption - -| TechAge Machine | TA2 [ku] | TA3 [ku] | TA4 [ku] | -| ------------------------------ | -------- | -------- | --------- | -| Autocrafter | 4 | 6 | (9) | -| Electronic Fab | 8 | 12 | 12 | -| Gravel Rinser | 3 | 3 | - | -| Gravel Sieve | 3 | 4 | 5 | -| Grinder | 4 | 6 | 9 | -| Liquid Sampler | 3 | 5 | - | -| Quarry | 10 | 12 | 14 | -| TA3 Industrial Furnace Booster | | 3 | | -| TA4 Industrial Furnace Heater | | | 14 | -| Oil Drill Box | | 16 | | -| Oil Pumpjack | | 16 | | -| TA3 Oil Reboiler | | 14 | | -| TA4 Electrolyzer | | | 35 | -| TA4 Fuel Cell | | | 34 | -| TA4 Reactor | - | - | 8 | -| Steam Engine | 25 | | | -| Coal Power Station | | 80 | | -| TA3 Tiny Power Generator | | 12 | | -| TA4 Solar Inverter | | | up to 100 | -| TA4 Wind Turbine | | | 70 | - diff --git a/techage/manuals/description.md b/techage/manuals/description.md deleted file mode 100644 index 08c39ff..0000000 --- a/techage/manuals/description.md +++ /dev/null @@ -1,49 +0,0 @@ -From [c56](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=29520) Minetest [Forum](https://forum.minetest.net/viewtopic.php?p=414865#p414865) - - - -I decided to write a longer post describing the game to encourage the undecided. I am not native in English, so forgive me for mistakes. - -I had a very nice time playing with a mod called Tech Age. There are some things that annoy me and not everything seems well balanced, but basically it's a very cool and complex tech mod. The gameplay can be fun, relaxing and challenging. If you are concerned about communication difficulties, don't be afraid ;-) Although the server is oriented to the German language, and in the crafting guide the names of the objects are in German, you know most of these objects from other minetest games and all admins/mods also speak English, so there is no problem communicating in that language. (I do not speak German and can play there - it is possible). They are all nice and friendly people there! - -The new player starts the game with Construction Board in his or her inventory - instructions describing the next steps of technological development. This information is very useful and is written in both German and English. The player also has the ability to easily craft more of this objects and place them where they need them.This guide also includes illustrations of how to assemble and connect something to build a working device. - -Traditionally, at the begining you need to find free land and build some kind of food farm. In this case, however, it is good to find a place far away from other players, because as time goes on, you will need more space in your base, and it would be bad when other players with their structures will stop your progress. You should think about place/sapace management in advance, because as you progress, you may have a lot of objects that will be difficult for you to move to a new place if you eventually will need to move. It seems that it is best not to move at all and have good opportunities to expand your base from the very beginning, both on the surface and underground. - -At the beginning, you need to have good access to wheat, from which you will produce lighter blocks, and to trees (the best is to build a tree farm), from which you will produce charcoal blocks. Charcoal is a fuel for smelting ores into usable ingots on the early technological level. You make charcoal in a some kind of furnace, self-builded from dirt blocks, in which you put several wood planks and single lighter. You melt the ingots in a pot on a tall tower of cobbles. That tower need a hole inside, where you drop charcoal blocks, one on another, which will then burn. You make lighter block on fire with flint-and-iron item. Sounds cool? Oh yeah, it's a lot of fun with that! - -Another basic technology is getting ores from regular cobble with Gravel Sieve. This process produces gravel from cobble, but such gravel can also be passed through a sieve for more ores! You can mine ores in the traditional way too, but there is at least one element that cannot be obtained otherwise than by sieving: usmium nuggets. And you need that item to make further progress. With chests and hoppers you can make sieving somehow automated. I put all of these on the screenshot. On the picture [1] below you can see the Charcoal Burner (surrounded with iron bars), top part of Melting Furnace (as other part is underground), and the Gravel Sieve with chests and hopper attached to the wall of Melting Furnace. - -In this game you can also build a beautiful and animated (!) mill, in which the falling water power grinding the wheat into seeds, and hopper is then sending theese seeds into a regular furnace for bread making [2]. Thanks to the later progress in the game, an electrically powered robot takes care of harvesting my wheat [3]. I hit the button in the game, the robot appears, takes the wheat and sows the seeds, then places the harvested stuff in the mill. In the meantime I am either watching it or doing something else. I have a old-school coal furnace there, but I could put an electric cable over there and out an an industrial electric furnace. Alternatively I can program the same robot to refill coal in coal powered furnace which I already have right now. The player can easily program robots using commands such as "turn right", "turn left", "harvest", "sow_seed", "go forward" or "put what you have into the chest". The player put a command sign in front of the robot, writes a set of commands in the right order on the sign, and then robot can read the entire program and executes it. It is pretty easy! [4] - -Image - -Picture 5 show you next level of automation of sieving process, thanks to the steam engine (top left). The engine is powered by coal and boiling water. When the stored water reaches a high temperature, the steam drives an axle, and the axle drives machines: Grinder, Gravel Sieve and Gravel Rinser. - -Cobble is transported from the chest to Grinder using a device called Pusher that does not need to be powered. Then another Pusher takes the grinded stuff from the Grinder to a Distributor device, which sorts and sends sorted items into one of its outputs. Distributor also not need to be powered. This Distributor pass the gravel to the Gravel Sieve and anything else to the chest. Gravel Sieve produces ores that need to be send to the chest, gravel that need to be send back to the input of Gravel Sieve, and sieved gravel, that need to be send to the Gravel Rinser. - -Gravel Rinser produces sand and ores. It produces sand inside itself, so sand can be picked up by a pusher and then transported with tubes to the chest. But ores are produced outside, ores appear dropped above the Gravel Rinser, and this is why there is a water. The flowing water pushes the dropped ores to the hopper placed one or two blocks away. Hopper take it and put into a chest. - -This is more or less how the process of sieving and obtaining ores looks like. Of course, nothing prevents you from going to the mine with a pickaxe or digtron and obtaining ores in the traditional way. But even if you do so, this process can utilize all of that cobbles that come from pick, digtron or quarry mining, additionally producing the necessary usmium, which otherwise cannot be obtained. - -Later in the game, better versions of some machines, powered by electricity, become available. You will need a power generator driven by a steam turbine, which can be powered by a coal or gasoline firebox. Then you also have to build a network of electric cables that will connect the power source with the machines. Cables don't connect to each other by themselves, but the game provide an additional block that allows you to create a junction for splitting one line into two, three or four. - -Most importantly, electric lines can be placed like any other block in the game, but also can be placed inside other blocks! Thanks to a special tool, TechAge Trowel, you can put a whole line through your base, and then cover the electric cables with decorative bricks that is often use to build floors, walls or ceilings. I think this feature of Tech Age is awesome! - -As I progressed on the server, one electricity generator was no longer enough for me and I needed three coal-fired generators [6] I also experimented with wind and solar generators, all of them together gave me a lot of energy, but it was still not enough. Finally, when I built a thermonuclear plant,two Fusion Reactors [7], I stopped complaining about power drops and the need to turn on only selected processes in a given time. - -Tech Age mod is very computerized. Even too much! The player has the ability to control various devices and processes remotely. The game provides programmable buttons and "computers", with which you can turn something on, off, or check their status. Each machine has its own unique number, so that is how you identify them, when you need to program their external control. I have put in one place buttons that I can use to open or close the entrances to the building, start or stop oil processing, or turn on or off power generators [8]. With the help of control monitors, I can check the level of various substances in tanks, the status of selected machines [9] and even the amount of electricity needed by running machines and generated by generators [10]. There are also items that you can use to program in-game objects using Lua and even something like assembler language. - -In this game you can search for crude oil on a map, then build drilling wells and transport oil in carts or with pipes to refineries. Oil distillation produces bitumen, fuel oil, naphta, gasoline, and propane [11]. You can collect all that stuff in tanks and process it later. You can use bitumen to make an asphalt roads (you can move faster on them), fuel oil to create vulcanized rubber items, naphta to get epoxide resin, gasoline to generate electricity or power cars that drive on asphalt roads, and propane to make isobutane. You can process one petroleum material into another, so you can even all your crude oil turn into a gasoline (or bitumen). Oil distillation need electric power. - -Tech Age provide a chemical reactors, which are an alternative type of crafting workshop. Thanks to these reactors, you can convert the initial objects into other objects. You can change water with usmium powder into lye liquid, and then lye with bauxite powder into gibbsite. Smelted gibbsite turn into an aluminium, which is important material later in the game. You can have one chemical reactor and changing its connection with different tanks, choosing different recipie when needed, or you can build many chemical reactors, with fixed set up to produce one specific thing. I choose that second solution, with fixed production line [12]. Chemical reactors need electric power. - -Image - -In the picture [13, 14, 15] you can see my final version of the process of obtaining ores by sieving. Nothing has changed in the idea of ​​this process, described earlier. Just the whole thing is built with faster and more efficient machines, powered by electricity. And there are 3 lines of sieving. The initial cobbles are split into three loads, each of which goes to a separate line of transporting through the Grinder, Gravel Sieve and Gravel Rinser. The output is sorted to the final chests, and the ores are melted immediately into ingots. 3 parallel production lines ensure faster acquisition of end products. - -At one point in my game, I was running out of electricity and the challenge was to move to the next technological level. When I started the Hardon Collider [16, 17], it needed a lot of energy, but I needed the points it generated to build fusion reactors. I managed this somehow. The fusion reactor needs electricity too, it consumes half of what it produces. But with two of them, I have now even too much electricity! ;-) - -So if you are looking for a quiet game for a long time, where instead of fighting a monster you want to build machines, improve your factories, create accelerators and fusion reactors, plan technical puzzles, this can be for you. You don't have to worry, that you probably you do not know evrything in this game. It is natural that you will face a questions: what next, how to build it, how to achieve it? You will discover it all. By experimenting and asking the right questions, you solve all the challenges! - -And finallyt, I would like to thank the creator of Tech Age and the people who maintain the server. It's great entertainment! diff --git a/techage/manuals/manual_DE.md b/techage/manuals/manual_DE.md deleted file mode 100644 index 929b7de..0000000 --- a/techage/manuals/manual_DE.md +++ /dev/null @@ -1,124 +0,0 @@ -# Tech Age Mod - -Tech Age ist eine Technik-Mod mit 5 Entwicklungsstufen: - -TA1: Eisenzeitalter (Iron Age) -Benutze Werkzeuge und Hilfsmittel wie Köhler, Kohlebrenner, Kiessieb, Hammer, Hopper um notwendige Erze und Metalle zu schürfen und zu verarbeiten. - -TA2: Dampfzeitalter (Steam Age) -Baue eine Dampfmaschine mit Antriebsachsen und betreibe damit deine ersten Maschinen zur Verarbeitung von Erzen. - -TA3: Ölzeitalter (Oil Age) -Suche und fördere Öl, baute Schienenwege zur Ölbeförderung. Ein Kraftwerk liefert den notwendigen Strom für deine Maschinen. Elektrisches Licht erhellt deine Industrieanlagen. - -TA4: Gegenwart (Present) -Regenerative Energiequellen wie Wind, Sonne und Biokraft helfen dir, das Ölzeitalter zu verlassen. Mit modernen Technologien und intelligenten Maschinen machst du dich auf in die Zukunft. - -TA5: Zukunft (Future) -Maschinen zur Überwindung von Raum und Zeit, neue Energiequellen und andere Errungenschaften prägen dein Leben. - - -Hinweis: Mit Klicken auf die Pluszeichen kommst du in die Unterkapitel dieser Anleitung. - -[techage_ta4|image] - - - -## Hinweise - -Diese Dokumentation ist sowohl "ingame" (Block Konstruktionsplan) als auch auf GitHub als MD-Files verfügbar. - -- Link: https://github.com/joe7575/techage/wiki - -Die Konstruktionspläne (Diagramme) für den Aufbau der Maschinen sowie die Bilder sind aber nur ingame verfügbar. - -Bei Tech Age musst du von vorne beginnen. Nur mit den Items aus TA1 kannst du TA2 Blöcke herstellen, für TA3 benötigst du die Ergebnisse aus TA2, usw. - -In TA2 laufen die Maschinen nur mit Antriebsachsen. - -Ab TA3 laufen die Maschinen mit Strom und besitzen eine Kommunikationsschnittstelle zur Fernsteuerung. - -Mit TA4 kommen weitere Stromquellen dazu, aber auch höhere logistische Herausforderungen (Stromtrassen, Item Transport). - - - -## Änderungen ab Version 1.0 - -Ab V1.0 (17.07.2021) hat sich folgendes geändert: - -- Der Algorithmus zur Berechnung der Stromverteilung hat sich geändert. Energiespeichersystem werden dadurch wichtiger. Diese gleichen Schankungen aus, was bei größeren Netzen mit mehreren Generatoren wichtig wird. -- Aus diesem Grund hat TA2 seinen eigenen Energiespeicher erhalten. -- Die Akkublöcke aus TA3 dienen auch als Energiespeicher. Ihre Funktionsweise wurde entsprechend angepasst. -- Das TA4 Speichersystem wurde überarbeitet. Die Wärmetauscher (heatexchanger) haben eine neue Nummer bekommen, da die Funktionalität vom unteren in den mittleren Block verschoben wurde. Sofern diese ferngesteuert wurden, muss die Knotennummer angepasst werden. Die Generatoren haben kein eigenes Menü mehr, sondern werden nur noch über den Wärmetauscher ein-/ausgeschaltet. Wärmetauscher und Generator müssen jetzt am gleichen Netz hängen! -- Mehrere Stromnetze können jetzt über einen TA4 Transformator Blöcke gekoppelt werden. -- Neu ist auch ein TA4 Stromzähler Block für Unternetze. - -### Tipps zur Umstellung - -Viele weitere Blöcke haben kleinere Änderungen bekommen. Daher kann es sein, dass Maschinen oder Anlagen nach der Umstellung nicht gleich wieder anlaufen. Sollte es zu Störungen kommen, helfen folgende Tipps: - -- Maschinen aus- und wieder eingeschalten -- ein Stromkabel-Block entfernen und wieder setzen -- den Block ganz entfernen und wieder setzen -- mindestens ein Akkublock oder Speichersystem in jedes Netzwerk - - - -## Erze und Mineralien - -Techage fügt dem Spiel einige neue Items hinzu: - -- Meridium - eine Legierung zur Herstellung von leuchtenden Werkzeugen in TA1 -- Usmium - ein Erz, was in TA2 gefördert und für TA3 benötigt wird -- Baborium - ein Metall, welches für Rezepte in TA3 benötigt wird -- Erdöl - wird in TA3 benötigt -- Bauxit - ein Aluminiumerz, was in TA4 zur Herstellung von Aluminium benötigt wird -- Basalt - entsteht, wenn sich Wasser und Lave berühren - - -### Meridium - -Meridium ist eine Legierung aus Stahl und Mesekristallen. Meridium Ingots können mit dem Kohlebrenner aus Stahl und Mesesplitter hergestellt werden. Meridium leuchtet im Dunkeln. Auch Werkzeuge aus Meridium leuchten und sind daher im Untertagebau sehr hilfreich. - -[meridium|image] - - -### Usmium - -Usmium kommt nur als Nuggets vor und kann nur beim Waschen von Kies mit der TA2/TA3 Kieswaschanlage gewonnen werden. - -[usmium|image] - - -### Baborium - -Barborium kann nur im Untertagebau gewonnen werden. Diesen Stoff findet man nur in einer Tiefe von -250 bis -340 Metern. -Baborium kann nur im TA3 Industrieofen geschmolzen werden. - -[baborium|image] - - -### Erdöl - -Erdöl kann nur mit Hilfe des Explorers gefunden und mit Hilfe entsprechender TA3 Maschinen gefördert werden. Siehe TA3. - -[oil|image] - - -### Bauxit - -Bauxit wird nur im Untertagebau gewonnen. Bauxit findet man nur in Stein in einer Höhe zwischen -50 und -500 Meter. -Es wird zur Herstellung von Aluminium benötigt, was vor allem in TA4 Verwendung findet. - -[bauxite|image] - - -### Basalt - -Basalt entsteht nur, wenn Lava und Wasser zusammen kommen. -Dazu sollte man am besten eine Anlage aufbauen, bei der eine Lava- und eine Wasserquelle zusammenfließen. -Dort wo sich beide Flüssigkeiten treffen, entsteht Basalt. -Einen automatisierten Basalt Generator kann man mit dem Sign Bot aufbauen. - -[basalt|image] - diff --git a/techage/manuals/manual_EN.md b/techage/manuals/manual_EN.md deleted file mode 100644 index ae79e23..0000000 --- a/techage/manuals/manual_EN.md +++ /dev/null @@ -1,138 +0,0 @@ -# Tech Age Mod - -Tech Age is a technology mod with 5 development stages: - -TA1: Iron Age -Use tools and aids such as coal burners, coal burners, gravel sieves, hammers and hoppers to mine and process the necessary ores and metals. - -TA2: Steam Age -Build a steam engine with drive axles and use it to operate your first ore processing machines. - -TA3: Oil Age -Find and extract oil, built railways for oil transportation. A power plant provides the necessary electricity for your machines. Electric light illuminates your industrial plants. - -TA4: Present -Renewable energy sources such as wind, sun and bio-fuels help you to leave the oil age. With modern technologies and intelligent machines you set out into the future. - -TA5: Future -Machines to overcome space and time, new sources of energy and other achievements shape your life. - - -Note: With a click on the plus sign you get into the sub-chapters of this manual. - -[techage_ta4|image] - - - -## Hints - -This documentation is available both "ingame" (block construction plan) and on GitHub as MD files. - -- Link: https://github.com/joe7575/techage/wiki - -The construction plans (diagrams) for the construction of the machines and the pictures are only available in-game. - -With Tech Age you have to start over. You can only create TA2 blocks with the items from TA1, for TA3 you need the results from TA2, etc. - -In TA2, the machines only run with drive axes. - -From TA3, the machines run on electricity and have a communication interface for remote control. - -TA4 adds more power sources, but also higher logistical challenges (power lines, item transport). - - - -## Changes from version 1.0 - -From V1.0 (07/17/2021) the following has changed: - -- The algorithm for calculating the power distribution has changed. This makes energy storage systems more important. These compensate for fluctuations, which is important in larger networks with several generators. -- For this reason TA2 got its own energy storage. -- The battery blocks from TA3 also serve as energy storage. Their functionality has been adapted accordingly. -- The TA4 storage system has been revised. The heat heat exchanger have been given a new number because the functionality has been moved from the lower to the middle block. If these were remotely controlled, the node number must be adapted. The generators no longer have their own menu, but are only switched on / off via the heat exchanger. The heat exchanger and generator must now be connected to the same network! -- Several power grids can now be coupled via a TA4 transformer blocks. -- A TA4 electricity meter block for sub-networks is also new. -- At least one battery block or a storage system in each network - - -### Tips on switching - -Many more blocks have received minor changes. It is therefore possible that machines or systems do not start up again immediately after the changeover. In the event of malfunctions, the following tips will help: - -- Switch machines off and on again -- remove a power cable block and put it back in place -- remove the block completely and put it back in place - - - -## Ores and Minerals - -Techage adds some new items to the game: - -- Meridium - an alloy for the production of luminous tools in TA1 -- Usmium - an ore that is mined in TA2 and needed for TA3 -- Baborium - a metal that is needed for recipes in TA3 -- Petroleum - is needed in TA3 -- Bauxite - an aluminum ore that is needed in TA4 to produce aluminum -- Basalt - arises when water and lave touch - - -### Meridium - -Meridium is an alloy of steel and mesecons crystals. Meridium ingots can be made with the coal burner from steel and mesecons crystals. Meridium glows in the dark. Tools made of Meridium also light up and are therefore very helpful in underground mining. - -[meridium|image] - - -### Usmium - -Usmium only occurs as nuggets and can only be obtained by washing gravel with the TA2/TA3 gravel washing system. - -[usmium|image] - - -### Baborium - -Barborium can only be obtained from underground mining. This substance can only be found at a depth of -250 to -340 meters. - -Baborium can only be melted in the TA3 Industrial Furnace. - - -[baborium|image] - - -### Petroleum - -Petroleum can only be found with the help of the Explorer and extracted with the help of appropriate TA3 machines. See TA3. - -[oil|image] - - -### Bauxite - -Bauxite is only extracted in underground mining. Bauxite is only found in stone at a height between -50 and -500 meters. -It is required for the production of aluminum, which is mainly used in TA4. - -[bauxite|image] - - -### Basalt - -Basalt is only created when lava and water come together. -The best thing to do is to set up a system where a lava and a water source flow together. -Basalt is formed where both liquids meet. -You can build an automated basalt generator with the Sign Bot. - -[basalt|image] - - -## History - -- 28.09.2019: Solar system added -- 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed -- 18.11.2019: Chapter for ores, reactor, aluminum, silo, bauxite, furnace heating, gravel washing system added -- 22.02.2020: corrections and chapters on the update -- 29.02.2020: ICTA controller added and further corrections -- 14.03.2020 Lua controller added and further corrections -- 22.03.2020 More TA4 blocks added - diff --git a/techage/manuals/manual_RU.md b/techage/manuals/manual_RU.md deleted file mode 100644 index 40416a2..0000000 --- a/techage/manuals/manual_RU.md +++ /dev/null @@ -1,137 +0,0 @@ -# Tech Age Mod - -Tech Age - это технологический мод с 5 стадиями развития: - -TA1: Железный век -Используйте инструменты и приспособления, такие как угольные горелки, угольные горелки, гравийные сита, молоты и бункеры, чтобы добывать и обрабатывать необходимые руды и металлы. - -TA2: Паровой век -Постройте паровой двигатель с ведущими осями и используйте его для работы своих первых машин по переработке руды. - -TA3: Нефтяной век -Найдите и добывайте нефть, постройте железные дороги для транспортировки нефти. Электростанция дает необходимое электричество для ваших машин. Электрический свет освещает ваши промышленные предприятия. - -TA4: Настоящее время -Возобновляемые источники энергии, такие как ветер, солнце и биотопливо, помогают вам покинуть нефтяной век. С помощью современных технологий и умных машин вы отправляетесь в будущее. - -TA5: Будущее -Машины, преодолевающие пространство и время, новые источники энергии и другие достижения определяют вашу жизнь. - - -Примечание: Нажав на знак "плюс", вы попадаете в подразделы этого руководства. - -[techage_ta4|image] - - - -## Подсказки - -Эта документация доступна как "в игре" (план строительства блоков), так и на GitHub в виде MD-файлов. - -- Ссылка: https://github.com/joe7575/techage/wiki - -Строительные планы (схемы) для постройки машин и картинки доступны только в игре. - -В Tech Age вам придется начинать все сначала. Вы можете создавать блоки TA2 только с помощью предметов из TA1, для TA3 вам нужны результаты из TA2 и т.д. - -В TA2 машины работают только с приводными осями. - -В TA3 машины работают от электричества и имеют коммуникационный интерфейс для дистанционного управления. - -TA4 добавляет больше источников энергии, но также и более сложные логистические задачи (линии электропередач, транспортировка изделий). - - - -## Изменения по сравнению с версией 1.0 - -С версии 1.0 (07/17/2021) изменилось следующее: - -- Изменился алгоритм расчета распределения энергии. Это делает системы хранения энергии более важными. Они компенсируют колебания, что важно для больших сетей с несколькими генераторами. -- По этой причине TA2 обзавелась собственным накопителем энергии. -- Аккумуляторные блоки из TA3 также служат в качестве накопителей энергии. Их функциональность была соответствующим образом адаптирована. -- Система хранения TA4 была пересмотрена. Теплообменник получил новый номер, поскольку его функциональность была перенесена с нижнего на средний блок. Если они управлялись дистанционно, номер узла должен быть адаптирован. Генераторы больше не имеют собственного меню, а включаются/выключаются только через теплообменник. Теплообменник и генератор теперь должны быть подключены к одной сети! -- Несколько электросетей теперь могут быть соединены через трансформаторные блоки TA4. -- Также появился блок счетчиков электроэнергии TA4 для подсетей. -- Как минимум один блок аккумуляторов или система хранения в каждой сети - - -### Советы по переключению - -Многие другие блоки получили незначительные изменения. Поэтому возможно, что машины или системы не будут запускаться сразу после переключения. В случае неполадок помогут следующие советы: - -- выключите и снова включите машины -- снимите блок силовых кабелей и установите его на место -- полностью снимите блок и установите его на место - - - -## Руды и минералы - -Techage добавляет в игру несколько новых предметов: - -- Меридий - сплав для производства светящихся инструментов в TA1 -- Усмий - руда, которая добывается в TA2 и необходима для TA3 -- Бабориум - металл, необходимый для рецептов в TA3 -- Нефть - необходима в TA3 -- Боксит - алюминиевая руда, которая необходима в TA4 для производства алюминия -- Базальт - возникает при соприкосновении воды и лав - - -### Меридий - -Меридий - это сплав стали и кристаллов мезекона. Слитки меридиума можно изготовить с помощью угольной горелки из стали и кристаллов мезекона. Меридий светится в темноте. Инструменты из меридиума также светятся и поэтому очень полезны при подземной добыче. - -[meridium|image] - - -### Усмий - -Усмий встречается только в виде самородков и может быть получен только при промывке гравия с помощью системы промывки гравия TA2/TA3. - -[usmium|image] - - -### Баборий - -Барборий можно получить только при подземной добыче. Это вещество можно найти только на глубине от -250 до -340 метров. - -Бабориум можно переплавить только в промышленной печи TA3. - - -[baborium|image] - - -### Нефть - -Нефть можно найти только с помощью Исследователя и добыть с помощью соответствующих машин TA3. См. TA3. - -[oil|image] - - -### Боксит - -Боксит можно добыть только в подземной шахте. Боксит можно найти только в камне на высоте от -50 до -500 метров. -Он необходим для производства алюминия, который в основном используется в TA4. - -[bauxite|image] - - -### Базальт - -Базальт образуется только при соединении лавы и воды. -Лучше всего создать систему, в которой лава и вода будут течь вместе. -Базальт образуется там, где встречаются обе жидкости. -Вы можете создать автоматический генератор базальта с помощью Sign Bot. - -[basalt|image] - - -## History - -- 28.09.2019: Solar system added -- 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed -- 18.11.2019: Chapter for ores, reactor, aluminum, silo, bauxite, furnace heating, gravel washing system added -- 22.02.2020: corrections and chapters on the update -- 29.02.2020: ICTA controller added and further corrections -- 14.03.2020 Lua controller added and further corrections -- 22.03.2020 More TA4 blocks added \ No newline at end of file diff --git a/techage/manuals/manual_pt-BR.md b/techage/manuals/manual_pt-BR.md deleted file mode 100644 index 6cabb8a..0000000 --- a/techage/manuals/manual_pt-BR.md +++ /dev/null @@ -1,110 +0,0 @@ -# Mod Tech Age -O Tech Age é um mod de tecnologia com 5 estágios de desenvolvimento: - -## TA1: Idade do Ferro -Utilize ferramentas e instrumentos auxiliares como queimadores de carvão, peneiras de cascalho, martelos e funis para extrair e processar minérios e metais necessários. - -## TA2: Idade do Vapor -Construa uma máquina a vapor com eixos de transmissão e use-a para operar suas primeiras máquinas de processamento de minérios. - -## TA3: Idade do Petróleo -Encontre e extraia óleo, construa ferrovias para transporte de óleo. Uma usina fornece a eletricidade necessária para suas máquinas. A luz elétrica ilumina suas instalações industriais. - -## TA4: Tempos atuais (Presente) -Fontes de energia renovável, como vento, sol e biocombustíveis, ajudam você a sair da era do petróleo. Com tecnologias modernas e máquinas inteligentes, você parte para o futuro. - -## TA5: Futuro -Máquinas para superar espaço e tempo, novas fontes de energia e outras conquistas moldam sua vida. - -Nota: Clicando no sinal de adição, você acessa os subcapítulos deste manual. - -[techage_ta4|image] - -# Dicas -Esta documentação está disponível tanto "dentro do jogo" (plano de construção de blocos) quanto no GitHub como arquivos MD. - -* Link: https://github.com/joe7575/techage/wiki -Os planos de construção (diagramas) para a construção das máquinas e as imagens estão disponíveis apenas no jogo. - -Com o Tech Age, você precisa começar do zero. Você só pode criar blocos TA2 com os itens do TA1, para o TA3 você precisa dos resultados do TA2, e assim por diante. - -No TA2, as máquinas só funcionam com eixos de transmissão. - -A partir do TA3, as máquinas funcionam com eletricidade e têm uma interface de comunicação para controle remoto. - -O TA4 adiciona mais fontes de energia, mas também desafios logísticos mais altos (linhas de energia, transporte de itens). - -# Mudanças a partir da versão 1.0 -A partir da V1.0 (17/07/2021), as seguintes alterações foram feitas: - -* O algoritmo para calcular a distribuição de energia foi alterado. Isso torna os sistemas de armazenamento de energia mais importantes. Eles compensam as flutuações, o que é importante em redes maiores com vários geradores. -* Por esse motivo, o TA2 recebeu seu próprio sistema de armazenamento de energia. -* Os blocos de bateria do TA3 também servem como armazenamento de energia. Sua funcionalidade foi adaptada de acordo. -* O sistema de armazenamento do TA4 foi revisado. O permutador de calor recebeu um novo número porque a funcionalidade foi movida do bloco inferior para o bloco central. Se eles estiverem sendo controlados remotamente, o número do nó deve ser adaptado. Os geradores não têm mais um menu próprio, mas são ligados/desligados apenas através do permutador de calor. O permutador de calor e o gerador agora devem estar conectados à mesma rede! -* Vários sistemas de energia podem agora ser acoplados via blocos transformadores TA4. -* Um novo bloco medidor de eletricidade TA4 para sub-redes também foi adicionado. -* Pelo menos um bloco de bateria ou um sistema de armazenamento em cada rede. - -## Dicas sobre a troca -Muitos outros blocos receberam alterações menores. Portanto, é possível que máquinas ou sistemas não reiniciem imediatamente após a troca. Em caso de falhas, as seguintes dicas ajudarão: - -* Desligue e ligue as máquinas novamente. -* Remova um bloco de cabo de energia e coloque-o de volta no lugar. -* Remova completamente o bloco e coloque-o de volta no lugar. - -# Minérios e Minerais -Techage adiciona novos itens ao jogo: - -* Meridium - uma liga para a produção de ferramentas luminosas no TA1 -* Usmium - um minério que é extraído no TA2 e necessário para o TA3 -* Baborium - um metal necessário para receitas no TA3 -* Petróleo - necessário no TA3 -* Bauxita - um minério de alumínio necessário no TA4 para produzir alumínio -* Basalto - surge quando água e lava se encontram - -## Meridium -O Meridium é uma liga de aço e cristais de mesecons. Lingotes de Meridium podem ser feitos com a caldeira a carvão a partir de aço e cristais de mesecons. O Meridium brilha no escuro. Ferramentas feitas de Meridium também emitem luz e são, portanto, muito úteis na mineração subterrânea. - -[meridium|image] - -## Usmium -O Usmium ocorre apenas como pepitas e só pode ser obtido lavando cascalho com o sistema de lavagem de cascalho TA2/TA3. - -[usmium|image] - -## Baborium -O Baborium só pode ser obtido através da mineração subterrânea. Essa substância só pode ser encontrada a uma profundidade de -250 a -340 metros. - -O Baborium só pode ser derretido na Fornalha Industrial TA3. - -[baborium|image] - -## Petróleo -O Petróleo só pode ser encontrado com a ajuda do Explorer e extraído com a ajuda de máquinas apropriadas do TA3. Veja TA3. - -[oil|image] - -## Bauxita -A Bauxita é extraída apenas na mineração subterrânea. A Bauxita só é encontrada na pedra a uma altura entre -50 e -500 metros. -É necessária para a produção de alumínio, que é principalmente usada no TA4. - -[bauxite|image] - -## Basalto -O Basalto só é criado quando lava e água se encontram. -A melhor coisa a fazer é montar um sistema onde uma fonte de lava e uma fonte de água se encontram. -O Basalto é formado onde ambos os líquidos se encontram. -Você pode construir um gerador automático de basalto com o Sign Bot. - -[basalt|image] - - -## History - -- 28.09.2019: Solar system added -- 05.10.2019: Data on the solar system and description of the inverter and the power terminal changed -- 18.11.2019: Chapter for ores, reactor, aluminum, silo, bauxite, furnace heating, gravel washing system added -- 22.02.2020: corrections and chapters on the update -- 29.02.2020: ICTA controller added and further corrections -- 14.03.2020 Lua controller added and further corrections -- 22.03.2020 More TA4 blocks added diff --git a/techage/manuals/manual_ta1_DE.md b/techage/manuals/manual_ta1_DE.md deleted file mode 100644 index b4b3fb4..0000000 --- a/techage/manuals/manual_ta1_DE.md +++ /dev/null @@ -1,159 +0,0 @@ -# TA1: Eisenzeitalter - -In TA1 geht es darum, mit einfachen Werkzeugen und Gerätschaften ausreichend Erze zu schürfen und Holzkohle herzustellen, so dass damit TA2 Maschinen hergestellt und betrieben werden können. - -Natürlich muss es für ein Eisenzeitalter auch Eisen geben und nicht nur Stahl (steel), wie in "Minetest Game". Daher wurden einige Rezepte geändert, so dass zuerst Eisen hergestellt werden muss und erst später dann Stahl. - -Auch ist die Haltbarkeit der Werkzeuge an die Zeitalter angelehnt und entspricht damit nicht dem Minetest Originalspiel. -Die Haltbarkeit/Härte bspw. für eine Axt ist: - -* Bronze: 20 -* Stahl: 30 - -[techage_ta1|image] - - -## Köhler / Coal Pile - -Den Köhler brauchst du, um Holzkohle herzustellen. Holzkohle wird für den Brenner, aber auch bspw. in TA2 für die Dampfmaschine benötigt. - -Für den Köhler brauchst du: - -- einen Anzünderblock (`techage:lighter`) -- 26 Hölzblöcke (wood), die zu einem Würfen aufgeschichtet werden. Die Holzsorte spielt keine Rolle. -- Erde (dirt) um den Holzhaufen abzudecken. -- Feuerstein und Eisen (technischer Name: `fire:flint_and_steel`) um den Anzünderblock anzuzünden. - - - -Bauanleitung (siehe auch Plan): - -- Baue eine 5x5 große Fläche aus Erde (dirt) -- Platziere in die Mitte einen Anzünder (lighter) -- Platziere rund um den Anzünder 7 Holz (wood), aber lasse ein Loch zum Anzünder frei -- Baue weitere 2 Schichten Holz darüber, so dass ein 3x3x3 großer Holzwürfel entsteht -- Überdecke alles mit einer Schicht Erde zu einem 5x5x5 großen Würfel, aber lasse das Loch zum Anzünder frei -- Entzünde den Anzünder und verschließe das Loch sofort mit jeweils einem Block Holz und Erde -- Wenn du alles richtig gemacht hast, fängt der Köhler nach wenigen Sekunden an zu rauchen -- Öffne den Köhler erst, wenn der Rauch verschwunden ist (ca. 20 min) - -Dann kannst du die 9 Holzkohleblöcke entnehmen und den Köhler erneut füllen. - -[coalpile|plan] - - -## Kohlebrenner / Coal Burner - -Den Kohlebrenner benötigst du bspw. um Eisen und andere Erze im Schmelztiegel zu schmelzen. Es gibt verschiedene Rezepte, welche verschiedene Temperaturen benötigen. Je höher der Turm, um so heißer ist die Flamme. Eine Höhe von 11 Blöcken über der Bodenplatte ist für alle Rezepte ausreichend, ein Brenner mit dieser Höhe verbraucht aber auch mehr Holzkohle. - -Bauanleitung (siehe auch Plan): - -* Baue einen Turm aus Stein (cobble) mit einer 3x3 Grundfläche (7-11 Blöcke hoch) -* Lasse unten ein Loch an einer Seite offen -* Lege einen Anzünder (lighter) hinein -* Fülle den Turm bis zum Rand mit Holzkohle, in dem du die Holzkohle von oben in das Loch fallen lässt -* Entzünde den Anzünder durch das Loch -* Platziere den Schmelztiegel oben auf dem Turm direkt in die Flamme, einen Block über dem Turmrand -* Um den Brenner anzuhalten, schließe das Loch vorübergehend bspw. mit einem Erdblock. - -Der Schmelztiegel hat ein eigenes Menü mit Rezepten und ein Inventar, wo du die Erze hinein legst. - -[coalburner|plan] - - - -## Wassermühle - -Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. Die Mühle wird mit -Wasserkraft angetrieben. Dazu muss ein Mühlbach über einen Kanal zum Mühlrad geführt werden. -Über eine Schleuse kann der Wasserfluss und damit das Mühlrad gesteuert werden. -Die Schleuse besteht aus Schleusenschieber und Schleusengriff. - -Die Abbildung rechts (auf "Plan" klicken) zeigt den Aufbau der Wassermühle. - -[watermill1|plan] - -### TA1 Mühle - -Mit der Wassermühle können Weizen und andere Getreide zu Mehl gemahlen und dann im Ofen zu Brot gebacken werden. -Die Mühle muss mit einer TA1 Achse mit dem Mühlrad verbunden werden. Die Kraft des Mühlrades reicht nur für eine Mühle. - -Die Mühle kann mit Hilfe eines Minecart Hoppers automatisiert werden, so dass das Mehl bspw. direkt von der Mühle in einen Ofen befördert wird, um daraus Brot zu backen. - -[watermill2|plan] - -### TA1 Schleusenschieber / TA1 Sluice Gate - -Der Schleusenschieber muss auf gleicher Höhe wie die Wasseroberfläche direkt an einen Teich oder in einen Bach gesetzt werden. -Wird die Schleuse geöffnet, so fließt Wasser durch den Schieber. Dieses Wasser muss dann zum Mühlrad geleitet werden und treibt dort die Mühle an. - -[ta1_sluice|image] - -### TA1 Schleusengriff / TA1 Sluice Handle - -Der TA1 Schleusengriff muss auf den Schleusenschieber gesetzt werden. Mit Hilfe des Schleusengriffs (Rechtsklick) kann der Schieber geöffnet werden. - -[ta1_sluice_handle|image] - -### TA1 Apfelholzbrett / TA1 Apple Wood Board - -Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Es kann aber auch jedes andere Material verwendet werden. - -[ta1_board1|image] - -### TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board - -Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Dieser Block eignet sich speziell in Verbindung mit den Pfosten des Holzzauns um eine Stütze für den Kanal zu bauen. - -[ta1_board2|image] - - - -## Erze und Werkzeuge - -TA1 hat seine eigenen Werkzeuge wie Hammer und Kiessieb, aber auch der Minecart Hopper kann genutzt werden. - -[ta1_gravelsieve|image] - - -### Hammer - -Mit dem TA1 Hammer können Steine (stone) und Kopfsteinpflaster-Steine (cobble) zu Kies (gravel) zertrümmert werden. Der Hammer ist in verschiedenen Ausführungen und damit verschiedenen Eigenschaften verfügbar: Bronze, Stahl, Mese und Diamant. - -[hammer|image] - - -### Kiessieb / Gravel Sieve - -Mit dem Kiessieb können Erze aus dem Kies gesiebt werden. Dazu mit dem Kies (gravel) auf das Sieb klicken. Der gesiebte Kies und die Erze fallen unten heraus. - -Um hier nicht stundenlang am Sieb zu stehen, kann das Sieben mit dem Trichter (hopper) automatisiert werden. - -[ta1_gravelsieve|image] - - -### Trichter / Hopper - -Der Hopper aus der Mod "Minecart" dient in erster Linie zum Be- und Entladen von Minecarts. Er saugt Gegenstände (items) von oben ein und gibt diese nach rechts weiter. Beim Platzieren des Trichters muss daher auf die Ausgaberichtung geachtet werden. - -Der Trichter kann aber auch Items aus Kisten (chest) ziehen, sofern die Kiste neben oder auf dem Trichter steht. - -Der Trichter kann auch Items in Kisten legen, sofern die Kiste neben dem Trichter steht. - -[ta1_hopper|image] - - -### Kies sieben mit dem Trichter - -Mit Hilfe von zwei Kisten, zwei Trichtern und einem Kiessieb kann der Siebevorgang automatisiert werden. Der Plan rechts zeigt den Aufbau. - -Bei den Kisten darauf achten, dass es die "chest_locked" ist, sonst klaut dir jemand die wertvollen Erze aus der Kiste unten. - -[hoppersieve|plan] - - -### Meridium - -TA1 hat seine eigene Metalllegierung Meridium. Meridium Ingots können mit dem Kohlebrenner aus Stahl und Mesesplittern hergestellt werden. Meridium leuchtet im Dunkeln. Auch Werkzeuge aus Meridium leuchten und sind daher im Untertagebau sehr hilfreich. - -[meridium|image] \ No newline at end of file diff --git a/techage/manuals/manual_ta1_EN.md b/techage/manuals/manual_ta1_EN.md deleted file mode 100644 index 4646760..0000000 --- a/techage/manuals/manual_ta1_EN.md +++ /dev/null @@ -1,158 +0,0 @@ -# TA1: Iron Age - -TA1 is about mining sufficient ores and producing charcoal with simple tools and equipment, so that TA2 machines can be manufactured and operated. - -Of course, for an iron age there must also be iron and not just steel, as in "Minetest Game". As a result, some recipes have been changed so that iron has to be produced first and then steel later. - -The durability of the tools is based on the ages and therefore does not correspond to the original Minetest game. -The durability / hardness for an axe, for example: - -* Bronze: 20 -* Steel: 30 - -[techage_ta1|image] - - -## Charcoal Pile (charcoal burner) - -You need the Charcoal Pile to make charcoal. Charcoal is required for the melting furnace, but also, for example, in TA2 for the steam engine. - -For the charcoal burner you need: - -- a lighter block (`techage:lighter`) -- 26 wooden blocks that are stacked into a pile of wood. The type of wood is irrelevant -- Dirt to cover the pile of wood -- Flint and Iron (technical name: `fire:flint_and_steel`) to light the lighter block - - - -Building instructions (see also plan): - -- Build a 5x5 area of dirt -- Place 7 wood around the lighter but leave a hole to the lighter -- Build another 2 layers of wood on top, making a 3x3x3 wooden cube -- Cover everything with a layer of dirt into a 5x5x5 cube, but keep the hole to the lighter open -- Light the lighter and immediately close the hole with a block of wood and dirt -- If you have done everything correctly, the coal burner will start smoking after a few seconds -- Only open the charcoal burner when the smoke has disappeared (approx. 20 min) - -Then you can remove the 9 charcoal blocks and refill the Charcoal Pile. - -[coalpile|plan] - - -## Melting Furnace - -You need the melting furnace, for example, to melt iron and other ores in the melting pot. There are different recipes that require different temperatures. The higher the melting tower, the hotter the flame. A height of 11 blocks above the base plate is for all recipes, but a burner with this height also requires more charcoal. - -Building instructions (see also plan): - -* Build a stone tower (cobble) with a 3x3 base (7-11 blocks high) -* Leave a hole open on one side at the bottom -* Put a lighter in it -* Fill the tower to the brim with charcoal by dropping the charcoal into the hole from above -* Light the lighter through the hole -* Place the melting pot on top of the tower directly into the flame, one block above the tower edge -* To stop the burner, temporarily close the hole with an dirt block, for example. - -The melting pot has its own menu of recipes and an inventory where you have to put the ores in. - -[coalburner|plan] - - - -## Watermill - -The watermill can be used to grind wheat and other grains into flour and then bake them in the furnace to make bread. -The mill is powered by water power. To do this, a millrace must be led to the mill wheel via a canal. -The water flow and thus the mill wheel can be controlled via a sluice. The sluice consists of the sluice lock and sluice handle. - -The picture on the right (click on "Plan") shows the structure of the watermill. - -[watermill1|plan] - - -### TA1 mill - -The watermill can be used to grind wheat and other grains into flour and then bake them in the oven to make bread. The mill must be connected to the mill wheel with a TA1 axle. The power of the mill wheel is only enough for one mill. - -The mill can be automated with the help of a Minecart Hopper, so that the flour, for example, is transported directly from the mill into an furnace in order to bake bread from it. - -[watermill2|plan] - -### TA1 sluice gate - -The sluice gate valve must be placed directly next to a pond or in a stream at the same height as the water surface. -When the gate is opened, water flows through the slide. This water then has to be fed to the mill wheel, where it drives the mill. - -[ta1_sluice|image] - -### TA1 sluice handle - -The TA1 sluice handle must be placed on the sluice gate. The gate can be opened with the aid of the sluice handle (right click). - -[ta1_sluice_handle|image] - -### TA1 Apple Wood Board - -Block in different types of wood for building the millrace canal. However, any other material can also be used. - -[ta1_board1|image] - -### TA1 Apple Millrace Board - -Block in different types of wood for building the millrace canal. This block is especially suitable in connection -with posts of the wooden fence to build a support of the canal. - -[ta1_board2|image] - - - -## Ores and Tools - -TA1 has its own tools such as hammer and gravel sieve, but the Minecart Hopper can also be used. - -[ta1_gravelsieve|image] - - -### Hammer - -The TA1 hammer can be used to knock/dig stone in a mine, but also to smash cobble to gravel. The hammer is available in different versions and therefore different properties: bronze, steel, brass and diamond. - -[hammer|image] - - -### Gravel Sieve - -Ores can be sifted from the gravel with the gravel sieve. To do this, click on the sieve with the gravel. The sifted gravel and ores fall out below. - -In order not to stand at the sieve for hours, sieving can be automated with the hopper. - -[ta1_gravelsieve|image] - - -### Hopper - -The hopper from the "Minecart" mod is primarily used for loading and unloading Minecarts. He sucks in items from above and passes them on to the right. Therefore, when placing the hopper, pay attention to the direction of dispensing. - -The hopper can also pull items from boxes (chest), provided the box is next to or on the hopper. - -The hopper can also put items in boxes if the box is next to the hopper. - -[ta1_hopper|image] - - -### Gravel seven with the hopper - -With the help of two boxes, two hoppers and a gravel sieve, the sieving process can be automated. The plan on the right shows the structure. - -Make sure that the boxes are "chest_locked", otherwise someone will steal the valuable ores from the box below. - -[hoppersieve|plan] - - -### Meridium - -TA1 has its own metal alloy meridium. Meridium ingots can be made with the coal burner from steel and mesecons crystals. Meridium glows in the dark. Tools made of Meridium also light up and are therefore very helpful in underground mining. - -[meridium|image] diff --git a/techage/manuals/manual_ta1_pt-BR.md b/techage/manuals/manual_ta1_pt-BR.md deleted file mode 100644 index 4fa4a73..0000000 --- a/techage/manuals/manual_ta1_pt-BR.md +++ /dev/null @@ -1,119 +0,0 @@ -# TA1: Idade do Ferro -TA1 trata da extração de minérios suficientes e da produção de carvão com ferramentas e equipamentos simples, para que as máquinas TA2 possam ser fabricadas e operadas. - -É claro que, para uma Idade do Ferro, deve haver ferro e não apenas aço, como em "Minetest Game". Como resultado, algumas receitas foram alteradas para que o ferro precise ser produzido primeiro e, posteriormente, o aço. - -A durabilidade das ferramentas é baseada nas eras e, portanto, não corresponde ao jogo original do Minetest. -A durabilidade/dureza de um machado, por exemplo: - -* Bronze: 20 -* Aço: 30 - -[techage_ta1|image] - -## Pilha de Carvão (queimador de carvão) -Você precisa da Pilha de Carvão para fazer carvão. O carvão é necessário para a fundição, mas também, por exemplo, em TA2 para a máquina a vapor. - -Para o queimador de carvão, você precisa de: - -* Um bloco de acendedor (`techage:lighter`) -* 26 blocos de madeira empilhados para formar um monte de madeira. O tipo de madeira é irrelevante. -* Terra para cobrir o monte de madeira -* Pedra lascada e Ferro (nome técnico: `fire:flint_and_steel`) para acender o bloco de acendedor - -Instruções de construção (veja também o plano): - -* Construa uma área de 5x5 de terra -* Coloque 7 blocos de madeira ao redor do acendedor, mas deixe um buraco para o acendedor -* Construa mais 2 camadas de madeira em cima, formando um cubo de madeira 3x3x3 -* Cubra tudo com uma camada de terra formando um cubo de 5x5x5, mas mantenha o buraco para o acendedor aberto -* Acenda utilizando o isqueiro e feche imediatamente o buraco com um bloco de madeira e terra -* Se você fez tudo corretamente, o queimador de carvão começará a soltar fumaça após alguns segundos -* Só abra o queimador de carvão quando a fumaça tiver desaparecido (aproximadamente 20 minutos) -* Então você pode remover os 9 blocos de carvão e reabastecer a Pilha de Carvão. - -[coalpile|plan] - -## Forno de Fundição -Você precisa do forno de fundição, por exemplo, para fundir ferro e outros minérios no Vaso de fundição(cadinho). Existem receitas diferentes que requerem diferentes temperaturas. Quanto mais alto a torre de fusão, mais quente é a chama. Uma altura de 11 blocos acima da placa base é para todas as receitas, mas um queimador com essa altura também requer mais carvão. - -Instruções de construção (veja também o plano): - -* Construa uma torre de pedregulho (cobble) com uma base de 3x3 (7-11 blocos de altura) -* Deixe um buraco aberto de um lado na parte inferior -* Coloque um acendedor nele -* Encha a torre até a borda com carvão despejando o carvão no buraco de cima para baixo -* Acenda o acendedor através do buraco -* Coloque o Vaso de fundição(cadinho) no topo da torre diretamente na chama, um bloco acima da borda da torre -* Para parar o queimador, feche temporariamente o buraco com um bloco de terra, por exemplo. -* O Vaso de fundição(cadinho) tem seu próprio menu de receitas e um inventário onde você precisa colocar os minérios. - -[coalburner|plan] - -## Moinho d'Água -O moinho d'água pode ser usado para moer trigo e outros grãos para fazer farinha e depois assá-los no forno para fazer pão. -O moinho é alimentado por energia hidráulica. Para isso, um curso de água deve ser conduzido até a roda do moinho através de um canal. -O fluxo de água e, portanto, a roda do moinho, podem ser controlados por meio de uma comporta. A comporta é composta pelo bloqueio de comporta e pela alavanca de comporta. - -A imagem à direita (clique em "Plano") mostra a estrutura do moinho d'água. - -[watermill1|plan] - -### Moinho d'Água TA1 -O moinho d'água pode ser usado para moer trigo e outros grãos para fazer farinha e depois assá-los no forno para fazer pão. O moinho deve ser conectado à roda do moinho com um eixo TA1. A potência da roda do moinho é apenas suficiente para um moinho. - -O moinho pode ser automatizado com a ajuda de um Funil(Minecart Hopper), para que a farinha, por exemplo, seja transportada diretamente do moinho para um forno para assar pão. - -[watermill2|plan] - -### Comporta TA1 -A válvula de comporta deve ser colocada diretamente ao lado de um lago ou em um riacho na mesma altura que a superfície da água. -Quando a comporta é aberta, a água flui através do canal. Essa água deve ser conduzida até a roda do moinho, onde movimenta o moinho. - -[ta1_sluice|image] - -### Alavanca de Comporta TA1 -A alavanca de comporta TA1 deve ser colocada na comporta. A comporta pode ser aberta com a ajuda da alavanca de comporta (clique com o botão direito). - -[ta1_sluice_handle|image] - -### Placa de Madeira de Maçã TA1 -Podem ser usados bloco de diferentes tipos de madeira para construir o canal do curso d'água. No entanto, qualquer outro material também pode ser usado. - -[ta1_board1|image] - -### Placa de Curso d'Água de Maçã TA1 -Podem ser utilizados blocos em diferentes tipos de madeira para construir o canal do curso d'água. Este bloco é especialmente adequado em conexão com postes da cerca de madeira para construir um suporte do canal. - -[ta1_board2|image] - -# Minérios e Ferramentas -O TA1 possui suas próprias ferramentas, como martelo e peneira de cascalho, mas o Funil(Minecart Hopper) também pode ser utilizado. - - -## Martelo -O martelo TA1 pode ser utilizado para bater/escavar pedra em uma mina, mas também para quebrar pedregulho(cobble) em cascalho(gravel). O martelo está disponível em diferentes versões, cada uma com propriedades distintas: bronze, aço, latão e diamante. - - -## Peneira de Cascalho(Sieve) -Minérios podem ser peneirados do cascalho com a peneira de cascalho. Para fazer isso, clique na peneira com o cascalho. O cascalho peneirado e os minérios caem abaixo. - -Para não ficar horas na peneira, é possível automatizar o processo com o Funil(Minecart Hopper). - - -## Funil (Minecart Hopper) -O funil do mod "Minecart Hopper" é utilizado principalmente para carregar e descarregar carrinhos de mineração. Ele suga itens de cima e os passa para a direita. Portanto, ao posicionar o funil, preste atenção na direção de dispensa. - -O funil também pode puxar itens de baús, desde que a caixa esteja ao lado ou em cima do funil. - -O funil também pode colocar itens em baús se a caixa estiver ao lado do funil. - - -## Peneirando sete cascalhos com Funil -Com a ajuda de dois baús, dois funis e uma peneira de cascalho, o processo de peneiração pode ser automatizado. O plano à direita mostra a estrutura. - -Certifique-se de que os baús são protegidos, caso contrário, alguém pode roubar os minérios valiosos do baú abaixo. - - -Meridium -O TA1 possui sua própria liga metálica, o Meridium. Lingotes de meridium podem ser feitos com a caldeira a carvão, utilizando aço e cristais de mesecons. O meridium brilha no escuro. Ferramentas feitas de meridium também emitem luz, sendo, portanto, muito úteis na mineração subterrânea. diff --git a/techage/manuals/manual_ta2_DE.md b/techage/manuals/manual_ta2_DE.md deleted file mode 100644 index 2a8a841..0000000 --- a/techage/manuals/manual_ta2_DE.md +++ /dev/null @@ -1,295 +0,0 @@ -# TA2: Dampfzeitalter - -In TA2 geht es darum, erste Maschinen zur Verarbeitung von Erzen zu bauen und zu betreiben. Einige Maschinen müssen dazu über Antriebsachsen angetrieben werden. Dazu musst du eine Dampfmaschine bauen und diese mit Kohle oder Holzkohle anheizen. - -In TA2 steht auch ein Kiesspüler zur Verfügung, mit dem seltene Erze wie Usmium Nuggets ausgewaschen werden können. Diese Nuggets wirst du später für weitere Rezepte brauchen. - -[techage_ta2|image] - -## Dampfmaschine - -Die Dampfmaschine besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet, zusammen gebaut werden. Dazu werden die Blöcke TA2 Feuerbox, TA2 Boiler oben, TA2 Boiler unten, TA2 Zylinder, TA2 Schwungrad und Dampfleitungen benötigt. - -Zusätzlich werden Antriebsachsen sowie Getriebeblöcke für Richtungswechsel benötigt. Das Schwungrad muss über die Antriebsachsen mit allen Maschinen verbunden werden, die angetrieben werden müssen. - -Bei allen Blöcken beim Setzen immer auch die Ausrichtung achten: - -- Zylinder links, Schwungrad rechts daneben -- Dampfleitungen anschließen, wo ein entsprechendes Loch ist -- Antriebsachse beim Schwungrad nur rechts -- bei allen Maschinen kann die Antriebsachse an allen Seiten angeschlossen werden, welche nicht durch andere Funktionen belegt wird, wie bspw. die IN und OUT Löcher bei Mühle und Sieb. - -Der Boiler muss mit Wasser gefüllt werden. Dazu bis zu 10 Eimer Wasser in den Boiler füllen. -Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. -Wenn das Wasser heiß ist (Temperaturanzeige ganz oben), kann die Dampfmaschine am Schwungrad gestartet werden. - -Die Dampfmaschine leistet 25 ku und kann damit mehrere Maschinen gleichzeitig antreiben. - -[steamengine|plan] - - -### TA2 Feuerbox / Firebox - -Teil der Dampfmaschine. - -Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. Die Brenndauer ist abhängig von der Leistung, die von der Dampfmaschine angefordert wird. Unter Volllast brennt Kohle 32 s und Holzkohle 96 s. - -[ta2_firebox|image] - - -### TA2 Boiler - -Teil der Dampfmaschine. Muss mit Wasser gefüllt werden. Dies erfolgt durch Klicken mit einem Wassereimer auf den Boiler. Wenn kein Wasser mehr vorhanden ist oder die Temperatur zu weit absinkt, schaltet sich die Dampfmaschine ab. Bei der Dampfmaschine geht bei jedem Kolbenhub etwas Wasser als Dampf verloren, daher muss regelmäßig Wasser nachgefüllt werden. - -[ta2_boiler|image] - - -### TA2 Zylinder /Cylinder - -Teil der Dampfmaschine. - -[ta2_cylinder|image] - - -### TA2 Schwungrad / Flywheel - -Antriebsteil der Dampfmaschine. Das Schwungrad muss über Antriebsachsen mit den Maschinen verbunden werden. - -[ta2_flywheel|image] - - -### TA2 Dampfleitungen / Steam Pipe - -Teil der Dampfmaschine. Der Boiler muss mit dem Zylinder über die Dampfleitungen (steam pipes) verbunden werden. Die Dampfleitung besitzt keine Abzweigungen, die maximale Länge beträgt 12 m (Blöcke). - -[ta2_steampipe|image] - -### TA2 Antriebsachsen / TA2 Drive Axle - -Die Antriebsachsen dienen zur Kraftübertragung von der Dampfmaschine zu anderen Maschinen. Die maximale Länge einer Antriebsachse beträgt 10 Blöcke. Über Getriebeblöcke können auch größere Strecken überbrückt, sowie Abzweigungen und Richtungswechsel realisiert werden. - -[ta2_driveaxle|image] - -### TA2 Stromgenerator / TA2 Power Generator - -Um Lampen oder andere Stromverbraucher an einer Dampfmaschine betreiben zu können, wird der TA2 Stromgenerator benötigt. Der TA2 Stromgenerator muss auf einer Seite mit Antriebsachsen verbunden werden und liefert dann auf der anderen Seite elektrischen Strom. - -Wird der Stromgenerator nicht mit ausreichend Kraft versorgt, geht er in einen Fehlerzustand und muss über einen Rechtsklick wieder aktiviert werden. - -Das Stromgenerator nimmt primär max. 25 ku an Achsenkraft auf und gibt sekundär max. 24 ku als Strom wieder ab. Er verbraucht also ein ku für die Umwandlung. - -[ta2_generator|image] - - -## TA2 Energiespeicher - -Bei größeren Anlagen mit mehreren Dampfmaschinen oder vielen angetriebenen Maschinen empfiehlt sich ein Energiespeicher. Der Energiespeicher bei TA2 arbeitet mit Lageenergie. Dazu wird Balast (Steine, Kies) in einer Kiste mit Hilfe einer Seilwinde in die Höhe gezogen. Ist überschüssige Energie im Achsen-Netzwerk vorhanden, so wird die Kiste nach oben gezogen. Wird kurzfristig mehr Energie benötigt, als die Dampfmaschine liefern kann, so gibt der Energiespeicher die gespeicherte Energie wieder ab, und die Balast-Kiste bewegt sich wieder nach unten. - -Der Energiespeicher besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet, zusammen gebaut werden. - -Um die maximale Speicherkapazität zu erreichen, muss die Kiste mit Gewichten komplett gefüllt, und der Mast inklusive der zwei Getriebeblöcke 12 Blöcke hoch sein. Kleinere Aufbauten sind aber auch möglich. - -[ta2_storage|plan] - - - -### TA2 Seilwinde / TA2 Winch - -Die Seilwinde muss mit einem Getriebeblock verbunden werden und kann so überschüssige Energie aufnehmen und damit eine Gewichtekiste nach oben ziehen. Achte beim Aufbau der Seilwinde darauf, dass der Pfeil auf der Blockoberseite zum Getriebeblock zeigt. Die maximale Seillänge beträgt 10 Blöcke. - -[ta2_winch|image] - - - -### TA2 Gewichtekiste / TA2 Weight Chest - -Diese Kiste muss mit bis zu 10 Blöcken Abstand unter die Seilwinde gesetzt und mit Pflastersteinen Kies oder Sand gefüllt werden. Ist das Mindestgewicht von einem Stack (99+ Items) erreicht und überschüssige Energie vorhanden, wird die Kiste automatisch über eine Seil mit der Seilwinde verbunden und in die Höhe gezogen. - -[ta2_weight_chest|image] - - - -### TA2 Kupplung / TA2 Clutch - -Mit der Kupplung können Achsen und Maschinen vom Energiespeicher getrennt werden. Damit kommen die Achsen nach der Kupplung zum Stillstand und Maschinenanlagen können umgebaut werden. Achte beim Aufbau der Kupplung darauf, dass der Pfeil auf der Blockoberseite zum Energiespeicher zeigt. - -[techage:ta2_clutch_off|image] - - - -## Items schieben und sortieren - -Um Gegenstände (Items) von einer Verarbeitungsstation zur nächsten weiter zu transportieren, werden Schieber und Röhren verwendet. Siehe Plan. - -[itemtransport|plan] - - -### Röhren / TechAge Tube - -Zwei Maschinen können mit Hilfe eines Schiebers und einer Röhre (tube) verbunden werden. Röhren besitzen keine Abzweigungen. Die maximale Länge beträgt 200 m (Blöcke). - -Röhren können alternativ mit Hilfe der Shift-Taste platziert werden. Dies erlaubt bspw. Röhren parallel zu verlegen, ohne dass diese sich unbeabsichtigt verbinden. - -Die Transportkapazität einer Röhre ist unbegrenzt und nur durch die Schieber begrenzt. - -[tube|image] - -### Röhren Konzentrator / Tube Concentrator - -Über den Konzentrator können mehrere Röhren zu einer Röhre zusammengeführt werden. Die Richtung, in der alle Items weitergegeben werden, ist mit einem Pfeil markiert. - -[concentrator|image] - - -### TA2 Schieber / Pusher - -Ein Schieber ist in der Lage, Items aus Kisten oder Maschinen zu ziehen und in andere Kisten oder Maschinen zu schieben. Oder anders gesagt: Zwischen zwei Blöcken mit Inventar muss ein und genau ein Schieber sein. Mehrere Schieber in Reihe sind nicht möglich. -In die Gegenrichtung ist ein Schieber für Items aber durchlässig, so dass eine Kiste über eine Röhre gefüllt und ebenso geleert werden kann. - -Ein Schieber geht in den Zustand "standby", wenn der keine Items zum Schieben hat. Ist der Ausgang blockiert oder das Inventory des Empfängers voll, so geht der Schieber in den Zustand "blocked". Aus beiden Zuständen kommt der Schieber nach einigen Sekunden selbsttätig wieder raus, sofern sich die Situation geändert hat. - -Der Verarbeitungsleistung eines TA2 Schiebers beträgt 2 Items alle 2 s. - -[ta2_pusher|image] - - -### TA2 Verteiler / Distributor - -Der Verteiler ist in der Lage, die Items aus seinem Inventar sortiert in bis zu vier Richtungen weiter zu transportieren. Dazu muss der Verteiler entsprechend konfiguriert werden. - -Der Verteiler besitzt dazu ein Menü mit 4 Filter mit unterschiedlichen Farben, entsprechend den 4 Ausgängen. Soll ein Ausgang genutzt werden, so muss der entsprechende Filter über die "on" Checkbox aktiviert werden. Alle Items, die für diesen Filter konfiguriert sind, werden über den zugeordneten Ausgang ausgegeben. Wird ein Filter aktiviert, ohne das Items konfiguriert werden, so sprechen wir hier von einem "nicht-konfigurierten", offenen Ausgang. - -**Achtung: Der Verteiler ist an seinen Ausgängen gleichzeitig ein Schieber. Daher niemals die Gegenstände mit einem Schieber aus dem Verteiler ziehen!** - -Für einen nicht-konfigurierten Ausgang gibt es zwei Betriebsarten: - -1) Alle Items ausgeben, die an keine anderen Ausgängen ausgegeben werden können, auch wenn diese blockiert sind. - -2) Nur die Items ausgeben, die für keinen anderen Filter konfiguriert wurden. - -Im ersten Fall werden immer alle Items weitergeleitet und der Verteiler läuft nicht voll. Im zweiten Fall werden Items zurückgehalten und der Verteiler kann voll laufen und in der Folge blockieren. - -Einstellbar ist die Betriebsart über die "blockiere" Checkbox. - -Der Verarbeitungsleistung eines TA2 Verteilers beträgt 4 Items alle 2 s, wobei der Verteiler dabei versucht, die 4 Items auf die offenen Ausgänge zu verteilen. - -Wird dasselbe Item in einem Filter mehrfach hinterlegt, so beeinflusst dies das langfristige Verteilungsverhältnis entsprechend. - -Bitte beachte, dass die Verteilung ein probabilistischer Vorgang ist, d.h. die Verhältnisse werden nicht exakt, sondern nur langfristig eingehalten. - -In den Filtern beträgt die maximale Stackgröße 12; insgesamt können höchstens 36 Items konfiguriert werden. - -[ta2_distributor|image] - - -## Kieswaschanlage - -Die Kieswaschanlage ist eine komplexere Maschine mit dem Ziel, Usmium Nuggets aus gesiebtem Kies auszuwaschen. Für den Aufbau wird ein TA2 Kiesspüler mit Achsenantrieb, ein Trichter, eine Kiste, sowie fließendes Wasser benötigt. - -Aufbau von links nach rechts (siehe auch Plan): - -* Ein Erdblock, darauf die Wasserquelle, umgeben auf 3 Seiten von bspw. Glasblöcken -* daneben den Kiesspüler, ggf. mit Röhrenanschlüssen für den Kies An- und Abtransport -* dann den Trichter mit Kiste - -Das Ganze umgeben von weiteren Glasblöcken, so dass das Wasser über den Kiesspüler und den Trichter fließt und ausgespülten Nuggets vom Trichter wieder eingesammelt werden können. - -[gravelrinser|plan] - - -### TA2 Kiesspüler / Gravel Rinser - -Der Kiesspüler ist in der Lage, aus bereits gesiebtem Kies die Erze Usmium und Kupfer auszuspülen, sofern dieser von Wasser überspült wird. - -Ob der Kiesspüler korrekt arbeitet, kann mit Hilfe von Stöcken (sticks) getestet werden, wenn diese in das Inventar des Kiesspülers getan werden. Diese müssen einzeln ausgespült und vom Trichter eingefangen werden. - -Die Verarbeitungsleistung ist ein Kies Item alle 2 s. Der Kiesspüler benötigt 3 ku Energie. - -[ta2_rinser|image] - - -## Stein brechen, mahlen und sieben - -Das Brechen, Mahlen und Siebe von Gestein dient zur Gewinnung von Erzen. Gesiebtes Kies kann aber auch anderweitig genutzt werden. Steinbrecher, Mühle und Sieb müssen angetrieben und damit in der Nähe einer Dampfmaschine aufgebaut werden. - -[ta2_grinder|image] - - -### TA2 Steinbrecher / Quarry - -Der Steinbrecher dient zum Abbau von Steinen und anderen Materialien aus dem Untergrund. Der Steinbrecher gräbt ein 5x5 Blöcke großes Loch. Die Tiefe ist einstellbar. -Die Verarbeitungsleistung ist ein Block alle 4 s. Der Steinbrecher benötigt 10 ku Energie. Die maximale Tiefe beträgt 20 Meter. Für größere Tiefen siehe TA3/TA4. - -[ta2_quarry|image] - - -### TA2 Mühle / Grinder - -Die Mühle ist in der Lage, verschiedenes Gestein, aber auch Holz und andere Items zu mahlen. -Die Verarbeitungsleistung ist ein Item alle 4 s. Die Mühle benötigt 4 ku Energie. - -[ta2_grinder|image] - - -### TA2 Kiessieb / Gravel Sieve - -Das Kiessieb ist in der Lage, Kies zu sieben um Erze zu gewinnen. Als Ergebnis erhält man teilweise "gesiebtes Kies", was nicht wieder gesiebt werden kann. -Die Verarbeitungsleistung ist ein Item alle 4 s. Das Kiessieb benötigt 3 ku Energie. - -[ta2_gravelsieve|image] - - -## Items produzieren - -Mit TA2 Maschinen können nicht nur Erze gewonnen, sondern auch Gegenstände hergestellt werden. - - -### TA2 Autocrafter - -Der Autocrafter dient zur automatischen Herstellung von Waren. Alles was der Spieler über das "Crafting Grid" herstellen kann, kann auch durch den Autocrafter erledigt werden. Dazu müssen im Menü des Autocrafters das Rezept eingegeben und die notwendigen Zutaten hinzugefügt werden. - -Zutaten und hergestellte Waren können über Röhren und Schieber in und aus dem Block transportiert werden. - -Die Verarbeitungsleistung ist ein Item alle 4 s. Der Autocrafter benötigt 4 ku Energie. - -[ta2_autocrafter|image] - - -### TA2 Elektronikfabrik / Electronic Fab - -Die Elektronikfabrik ist eine Spezialmaschine und nur für die Herstellung der Vakuumröhren nutzbar. Vakuumröhren werden für TA3 Maschinen und Blöcke benötigt. - -Die Verarbeitungsleistung ist eine Vakuumröhre alle 6 s. Die Elektronikfabrik benötigt 8 ku Energie. - -[ta2_electronicfab|image] - - -## Sonstige Blöcke - -### TA2 Flüssigkeitensammler / Liquid Sampler - -Für manche Rezepte wird Wasser benötigt. Damit auch diese Rezepte automatisiert mit dem Autocrafter bearbeitet werden können, muss Wasser in Eimern bereitgestellt werden. Hierzu dient der Flüssigkeitensammler. Er benötigt leere Eimer und muss ins Wasser gestellt werden. - -Die Verarbeitungsleistung ist ein Wassereimer alle 8 s. Der Flüssigkeitensammler benötigt 3 ku Energie. - -[ta2_liquidsampler|image] - - -### TA2 Gesicherte Kiste / Protected Chest - -Die gesicherte Kiste kann nur von den Spielern genutzt werden, die an diesem Ort auch bauen können, also Protection Rechte besitzen. Es spielt dabei keine Rolle, wer die Kiste setzt. - -[ta2_chest|image] - - -### Techage Forceload Block - -Minetest teilt die Karte in sogenannte Map-Blocks ein. Das sind Würfel mit 16x16x16 Blöcke Kantenlänge. So ein Map-Block wird vom Server immer komplett geladen, aber es werden nur die Blöcke um einen Spieler herum geladen (ca. 2-3 Blöcke in alle Richtungen). In Sichtrichtung des Spielers sind es auch mehr Map-Blöcke. Nur dieser Teil der Welt ist aktiv und nur hier wachsen Pflanzen und Bäume bzw. laufen die Maschinen. - -Mit einem Forceload-Block kannst du erzwingen, dass der Map-Block, in dem der Forceload Block steht, immer geladen bleibt, solange du auf dem Server bist. Wenn alle deine Farmen und Maschinen mit Forceload Blöcken abgedeckt sind, ist immer alles am Laufen. - -Die Map-Blöcke mit ihren Koordinaten sind vordefiniert, also bspw. (0,0,0) bis (15,15,15), oder (16,16,16) bis (31,31,31). -Man kann einen Forceload-Block innerhalb eines Map-Blockes verschieben wie man will, die Position des Map-Blocks bleibt dabei unverändert. - -[ta2_forceload|image] - diff --git a/techage/manuals/manual_ta2_EN.md b/techage/manuals/manual_ta2_EN.md deleted file mode 100644 index 4fb7cc7..0000000 --- a/techage/manuals/manual_ta2_EN.md +++ /dev/null @@ -1,295 +0,0 @@ -# TA2: Steam Age - -TA2 is about building and operating the first machines for processing ores. Some machines have to be driven via drive axles. To do this, you need to build a steam engine and heat it with coal or charcoal. - -In TA2 there is also a gravel rinser that can be used to wash out rare ores such as Usmium nuggets. You will need these nuggets later for further recipes. - -[techage_ta2|image] - -## Steam Engine - -The steam engine consists of several blocks and must be assembled as shown in the plan on the right. The blocks TA2 fire box, TA2 boiler top, TA2 boiler bottom, TA2 cylinder, TA2 flywheel and steam pipes are required. - -In addition, drive axles and gear blocks are required for changing direction. The flywheel must be connected to all machines that have to be driven via the drive axles. - -Always pay attention to the alignment of all blocks when placing: - -- Cylinder on the left, flywheel on the right -- Connect steam pipes where there is a corresponding hole -- Drive axle on flywheel only on the right -- In all machines, the drive axles can be connected on all sides, which is not occupied by other functions, such as the IN and OUT holes in the grinder and sieve. - -The boiler must be filled with water. Fill up to 10 buckets of water in the boiler. -The fire box must be filled with coal or charcoal. -When the water is hot (temperature display at the top), the steam engine can be started on the flywheel. - -The steam engine has a capacity of 25 ku, so it can drive several machines at the same time. - -[steamengine|plan] - - -### TA2 Firebox - -Part of the steam engine. - -The fire box must be filled with coal or charcoal. The burning time depends on the power demanded by the steam engine. Coal burns for 32 s and charcoal for 96 s under full load. - -[ta2_firebox|image] - - -### TA2 Boiler - -Part of the steam engine. Must be filled with water. This is done by clicking on the boiler with a water bucket. When there is no more water or the temperature drops too low, the steam engine switches off. With the steam engine, some water is lost as steam with each piston stroke, so water has to be refilled regularly. - -[ta2_boiler|image] - - -### TA2 Cylinder - -Part of the steam engine. - -[ta2_cylinder|image] - - -### TA2 Flywheel - -Drive part of the steam engine. The flywheel must be connected to the machines via drive axles. - -[ta2_flywheel|image] - - -### TA2 Steam Pipes - -Part of the steam engine. The boiler must be connected to the cylinder via the steam pipes. The steam pipe has no branches, the maximum length is 12 m (blocks). - -[ta2_steampipe|image] - - -### TA2 Drive Axle / TA2 Gearbox - -The drive axles are used to transmit power from the steam engine to other machines. The maximum length of a drive axis is 10 blocks. With TA2 Gearboxes, larger distances can be bridged, and branches and changes of direction can be realized. - -[ta2_driveaxle|image] - - -### TA2 Power Generator - -The TA2 Power Generator is required to operate lamps or other power consumers on a steam engine. The TA2 Power Generator has to be connected to drive axles on one side and then supplies electricity on the other side. - -If the Power Generator is not supplied with sufficient power, it goes into an error state and must be reactivated with a right-click. - -The Power Generator takes max. 25 ku of axle power and provides on the other side max. 24 ku as electricity. So he consumes one ku for the conversion. - -[ta2_generator|image] - -## TA2 energy storage - -For larger systems with several steam engines or many driven machines, an energy storage system is recommended. The energy storage at TA2 works with position energy. For this purpose, ballast (stones, gravel, sand) is pulled up in a chest with the help of a cable winch. If there is excess energy in the axis network, the chest is pulled upwards. If more energy is required in the short term than the steam engine can supply, the energy store releases the stored energy again and the weight chest moves down again. -The energy storage consists of several blocks and must be assembled as shown in the plan on the right. -In order to achieve the maximum storage capacity, the chest must be completely filled with weights and the mast including the two gear boxes must be 12 blocks high. Smaller structures are also possible. - -[ta2_storage|plan] - - - -### TA2 Winch - -The cable winch must be connected to a gear box and can absorb excess energy and thus pull a weight chest upwards. -When assembling the cable winch, make sure that the arrow on the top of the block points to the gearbox. -The maximum rope length is 10 blocks. - -[ta2_winch|image] - - - -### TA2 Weight Chest - -This chest must be placed under the winch with a distance of up to 10 blocks and filled with cobblestone, gravel or sand. If the minimum weight of a stack (99+ items) is reached and there is excess energy, the box is automatically connected to the winch via a rope and pulled up. - -[ta2_weight_chest|image] - - - -### TA2 Clutch - -With the clutch, axles and machines can be separated from the energy storage. This means that the axles after the clutch come to a standstill and machine systems can be rebuilt. When assembling the clutch, make sure that the arrow on the top of the block points to the energy storage system. - -[techage:ta2_clutch_off|image] - - - -## Push and sort items - -In order to transport objects from one processing station to the next, pushers and tubes are used. See plan. - -[itemtransport|plan] - - -### TechAge Tube - -Two machines can be connected with the help of a pusher and a tube. Tubes have no branches. The maximum length is 200 m (blocks). - -Alternatively, tubes can be placed using the Shift key. This allows, for example, tubes to be laid in parallel without them accidentally connecting. - -The transport capacity of a tube is unlimited and only limited by the pusher. - -[tube|image] - -### Tube Concentrator - -Several tubes can be combined into one tube via the concentrator. The direction in which all items are passed on is marked with an arrow. - -[concentrator|image] - -### TA2 Pusher - -A pusher is able to pull items out of boxes or machines and push them into other boxes or machines. In other words, there must be one and exactly one pusher between two blocks with inventory. Multiple pushers in a row are not possible. -In the opposite direction, however, a pusher is permeable for items, so that a box can be filled via a tube and also taught. - -A pusher goes into the "standby" state if it has no items to push. If the output is blocked or the recipient's inventory is full, the pusher goes into the "blocked" state. The pusher automatically comes out of both states after a few seconds if the situation has changed. - -The processing power of a TA2 pusher is 2 items every 2 s. - -[ta2_pusher|image] - - -### TA2 Distributor - -The distributor is able to transport the items from his inventory sorted in up to four directions. To do this, the distributor must be configured accordingly. - -The distributor has a menu with 4 filters with different colors, corresponding to the 4 outputs. If an output is to be used, the corresponding filter must be activated via the "on" checkbox. All items that are configured for this filter are output via the assigned output. If a filter is activated without items being configured, we are talking about an "unconfigured", open output. - -**Attention: The distributor is also a pusher at its output sides. Therefore, never pull items out of the distributor with a pusher!** - -There are two operating modes for a non-configured output: - -1) Output all items that cannot be output to any other exit, even if they are blocked. - -2) Only output the items that have not been configured for any other filter. - -In the first case, all items are always forwarded and the distributor does not run full. In the second case, items are held back and the distributor can run full and then block. - -The operating mode can be set using the "blocking mode" checkbox. - -The processing power of a TA2 distributor is 4 items every 2 s, whereby the distributor tries to distribute the 4 items to the open outputs. - -If the same item is configured multiple times in one filter, the long term distribution ratio will be influenced accordingly. - -Please note that the distribution is a probabilistic process. This means that the distribution rations won't be matched exactly, but only in the long term. - -The maximum stack size in the filters is 12; in total, not more than 36 items can be configured. - -[ta2_distributor|image] - - -## Gravel washer - -The gravel washer is a more complex machine with the goal of washing Usmium nuggets out of sieved gravel. A TA2 rinser with axis drive, a hopper, a chest and running water are required for the installation. - -Structure from left to right (see also plan): - -* A dirt block, on top of it the water source, surrounded on 3 sides by e.g. glass blocks -* next to it the gravel rinser, if necessary with tube connections for the gravel delivery and removal -* then the hopper with chest - -The whole thing is surrounded by further glass blocks, so that the water flows over the gravel rinser and the hopper and rinsed-out nuggets can be collected again by the hopper. - -[gravelrinser|plan] - - -### TA2 Gravel Rinser - -The gravel washer is able to rinse out the Usmium and copper ores from gravel that has already been sieved, provided that this is flushed with water. - -Whether the Gravel Rinser works correctly can be tested with sticks if these are placed in the inventory of the Gravel Rinser. These must be rinsed out individually and caught by the hopper. - -The processing power is one gravel item every 2 s. The gravel washer needs 3 ku of energy. - -[ta2_rinser|image] - - -## Dig stone, grind and sieve - -Crushing, grinding and sieving of cobblestone is used to extract ores. Sieved gravel can also be used for other purposes. Quarry, grinder and sieve must be driven and thus installed near a steam engine. - -[ta2_grinder|image] - - -### TA2 Quarry - -The quarry is used to remove stones and other materials from the underground. The quarry digs a 5x5 block hole. The depth is adjustable. -The processing power is one block every 4 s. The quarry needs 10 ku of energy. The maximum depth is 20 meters. For greater depths see TA3 / TA4. - -[ta2_quarry|image] - - -### TA2 Grinder - -The grinder is able to grind various rocks, but also wood and other items. -The processing power is one item every 4 s. The grinder needs 4 ku of energy. - -[ta2_grinder|image] - - -### TA2 Gravel Sieve - -The gravel sieve is able to sieve gravel to extract ores. The result is partially "sieved gravel", which cannot be sieved again. -The processing power is one item every 4 s. The gravel sieve requires 3 ku of energy. - -[ta2_gravelsieve|image] - - -## Produce Items - -TA2 machines can not only extract ores, but also produce objects. - - -### TA2 Autocrafter - -The autocrafter is used for the automatic production of goods. Everything that the player can produce via the "Crafting Grid" can also be done by the autocrafter. To do this, the recipe must be entered in the menu of the autocrafter and the necessary ingredients added. - -Ingredients and manufactured goods can be transported in and out of the block via tubes and pushers. - -The processing power is one item every 4 s. The autocrafter requires 4 ku of energy. - -[ta2_autocrafter|image] - - -### TA2 Electronic Fab - -The electronic fab is a special machine and can only be used for the production of vacuum tubes. Vacuum tubes are required for TA3 machines and blocks. - -The processing power is one vacuum tube every 6 s. The electronic fab requires 8 ku of energy. - -[ta2_electronicfab|image] - - -## Other blocks - -### TA2 Liquid Sampler - -Some recipes require water. So that these recipes can also be processed automatically with the autocrafter, water must be provided in buckets. The liquid sampler is used for this. He needs empty buckets and has to be put in the water. - -The processing capacity is one water bucket every 8 s. The liquid sampler requires 3 ku of energy. - -[ta2_liquidsampler|image] - - -### TA2 Protected Chest - -The protected chest can only be used by players who can build at this location, i.e. who have protection rights. It does not matter who sets the chest. - -[ta2_chest|image] - - -### Techage Forceload Block - -Minetest divides the map into so-called map blocks. These are cubes with an edge length of 16x16x16 blocks. Such a map block is always loaded completely by the server, but only the blocks around a player are loaded (approx. 2-3 blocks in all directions). In the player's direction of view, there are also more map blocks. Only this part of the world is active and only here do plants and trees grow or the machines run. - -With a forceload block you can force the map block in which the forceload block is located to remain loaded as long as you are on the server. When all your farms and machines are covered with Forceload blocks, everything is always running. - -The map blocks with their coordinates are predefined, e.g. (0,0,0) to (15,15,15), or (16,16,16) to (31,31,31). -You can move a forceload block within a map block as you like, the position of the map block remains unchanged. - -[ta2_forceload|image] - diff --git a/techage/manuals/manual_ta2_pt-BR.md b/techage/manuals/manual_ta2_pt-BR.md deleted file mode 100644 index da50b1b..0000000 --- a/techage/manuals/manual_ta2_pt-BR.md +++ /dev/null @@ -1,284 +0,0 @@ -# TA2: Era a Vapor - -TA2 trata-se de construir e operar as primeiras máquinas para processamento de minérios. Algumas máquinas precisam ser acionadas por eixos de transmissão. Para fazer isso, você precisa construir uma máquina a vapor e aquecê-la com carvão ou carvão vegetal. - -No TA2, há também um lavador de cascalho que pode ser usado para lavar minérios raros, como pepitas de Usmium. Você precisará dessas pepitas posteriormente para receitas adicionais. - -[techage_ta2|image] - -## Máquina a Vapor - -A máquina a vapor é composta por vários blocos e deve ser montada conforme mostrado no plano à direita. São necessários os blocos da Caixa de Fogo(Firebox) TA2, parte superior da Caldeira(Boiler) TA2, parte inferior da Caldeira(Boiler) TA2, Cilindro(Cylinder) TA2, Volante(Flywheel) TA2 e Tubos de Vapor(steam piper) TA2. - -Além disso, são necessários Eixos de Transmissão(drive axles) e blocos de Engrenagem(gear) para mudança de direção. O Volante deve ser conectado a todas as máquinas que precisam ser acionadas pelos Eixos de Transmissão. - -Sempre preste atenção ao alinhamento de todos os blocos ao colocá-los: - -- Cilindro à esquerda, volante à direita -- Conectar os tubos de vapor onde há um furo correspondente -- Eixo de transmissão no volante apenas à direita -- Em todas as máquinas, os eixos de transmissão podem ser conectados em todos os lados que não estejam ocupados por outras funções, como os furos de ENTRADA(IN) e SAÍDA(OUTPUT) no Moedor(grinder) e na Peneira(sieve). - -A Caldeira deve ser preenchida com água. Preencha até 10 baldes de água na caldeira. -A Caixa de fogo deve ser preenchida com carvão ou carvão vegetal. -Quando a água estiver quente (indicador de temperatura no topo), a máquina a vapor pode ser iniciada no Volante. - -A máquina a vapor tem uma capacidade de 25ku, podendo acionar várias máquinas ao mesmo tempo. - -[steamengine|plan] - -### Caixa de Fogo(Firebox) TA2 - -Parte da máquina a vapor. - -A Caixa de fogo deve ser preenchida com carvão ou carvão vegetal. O tempo de queima depende da potência exigida pela máquina a vapor. O carvão queima por 32s e o carvão vegetal por 96s em carga máxima. - -[ta2_firebox|image] - -### TA2 Caldeira(Boiler) - -Parte da máquina a vapor. Deve ser preenchida com água. Isso é feito clicando na caldeira com um balde de água. Quando não há mais água ou a temperatura cai muito, a máquina a vapor desliga. Com a máquina a vapor, parte da água é perdida como vapor a cada curso do pistão, então a água deve ser reabastecida regularmente. - -[ta2_boiler|image] - -### TA2 Cilindro(Cylinder) - -Parte da máquina a vapor. - -[ta2_cylinder|image] - -### TA2 Volante(Flywheel) - -Parte motora da máquina a vapor. O Volante deve ser conectado às máquinas por meio de eixos de transmissão. - -[ta2_flywheel|image] - -### TA2 Tubos de Vapor(Steam pipes) - -Parte da máquina a vapor. A caldeira deve ser conectada ao cilindro por meio dos Tubos de vapor. O tubo de vapor não tem ramificações, o comprimento máximo é 12 m (blocos). - -[ta2_steampipe|image] - -### TA2 Eixo de Transmissão(Drive axle) TA2 / Caixa de Engrenagem(Gearbox) - -Os Eixos de transmissão são usados para transmitir energia da máquina a vapor para outras máquinas. O comprimento máximo de um eixo de transmissão é 10 blocos. Com as Caixas de Engrenagem TA2, é possível vencer distâncias maiores, e também realizar ramificações e mudanças de direção. - -[ta2_driveaxle|image] - -### TA2 Gerador de Energia - -O Gerador de Energia TA2 é necessário para operar lâmpadas ou outros consumidores de energia em uma Máquina a vapor. O Gerador de Energia TA2 deve ser conectado aos eixos de transmissão de um lado e, em seguida, fornece eletricidade do outro lado. - -Se o Gerador de Energia não receber energia suficiente, ele entra em estado de erro e deve ser reativado com um clique direito. - -O Gerador de Energia consome no máximo 25ku de potência do eixo e fornece no máximo 24ku como eletricidade do outro lado. Portanto, ele consome um ku para a conversão. - -[ta2_generator|image] - -## TA2 Armazenamento de Energia - -Para sistemas maiores com várias máquinas a vapor ou muitas máquinas acionadas, é recomendado um sistema de armazenamento de energia. O armazenamento de energia no TA2 funciona com energia potencial. Para isso, o peso (pedras, cascalho, areia) é puxado para cima em um baú com a ajuda de um guincho. Se houver excesso de energia na rede de eixos, o baú é puxado para cima. Se mais energia for necessária a curto prazo do que a máquina a vapor pode fornecer, o armazenamento de energia libera a energia armazenada novamente e o baú de pesos desce novamente. -O armazenamento de energia é composto por vários blocos e deve ser montado conforme mostrado no plano à direita. -Para alcançar a capacidade máxima de armazenamento, o baú deve ser completamente preenchido com pesos e o mastro, incluindo as duas caixas de engrenagens, deve ter 12 blocos de altura. Estruturas menores também são possíveis. - -[ta2_storage|plan] - -### TA2 Guincho - -O guincho deve ser conectado a uma caixa de engrenagens e pode absorver energia excessiva e assim puxar um baú de pesos para cima. -Ao montar o guincho, certifique-se de que a seta no topo do bloco aponte para a caixa de engrenagens. -O comprimento máximo da corda é 10 blocos. - -[ta2_winch|image] - -### TA2 Baú de Pesos - -Este baú deve ser colocado sob o guincho com uma distância de até 10 blocos e preenchido com pedras, cascalho ou areia. Se o peso mínimo de uma pilha (99+ itens) - -### TA2 Embreagem - -Com a embreagem, eixos e máquinas podem ser separados do armazenamento de energia. Isso significa que os eixos após a embreagem param e sistemas de máquinas podem ser reconstruídos. Ao montar a embreagem, certifique-se de que a seta na parte superior do bloco aponta para o sistema de armazenamento de energia. - -[techage:ta2_clutch_off|image] - -## Empurrar e classificar itens - -Para transportar objetos de uma estação de processamento para a próxima, são usados pushers e tubos. Veja o plano. - -[itemtransport|plan] - -### Tubo TechAge - -Duas máquinas podem ser conectadas com a ajuda de um pusher e um tubo. Tubos não têm ramificações. O comprimento máximo é 200m (blocos). - -Alternativamente, os tubos podem ser colocados usando a tecla Shift. Isso permite, por exemplo, que tubos sejam colocados em paralelo sem que eles se conectem acidentalmente. - -A capacidade de transporte de um tubo é ilimitada e é limitada apenas pelo pusher. - -[tube|image] - -### Tubo Concentrador - -Vários tubos podem ser combinados em um único tubo via concentrador. A direção na qual todos os itens são passados é marcada com uma seta. - -[concentrator|image] - -### TA2 Pusher - -Um pusher(empurrador) é capaz de puxar itens de caixas ou máquinas e empurrá-los para outras caixas ou máquinas. Em outras palavras, deve haver um e apenas um pusher entre dois blocos com inventário. Múltiplos pushers em sequência não são possíveis. -No entanto, na direção oposta, um pusher é permeável a itens, de modo que uma caixa pode ser preenchida via tubo e também ensinada. - -Um pusher entra no estado "standby" se não tiver itens para empurrar. Se a saída estiver bloqueada ou o inventário do destinatário estiver cheio, o pusher entra no estado "bloqueado". O pusher automaticamente sai de ambos os estados após alguns segundos se a situação mudar. - -A capacidade de processamento de um pusher TA2 é de 2 itens a cada 2 s. - -[ta2_pusher|image] - -### TA2 Distributor(Distribuidor) - -O distribuidor é capaz de transportar os itens de seu inventário ordenados em até quatro direções. Para fazer isso, o distribuidor deve ser configurado conforme necessário. - -O distribuidor possui um menu com 4 filtros com cores diferentes, correspondendo às 4 saídas. Se uma saída for usada, o filtro correspondente deve ser ativado via caixa de seleção "ligado". Todos os itens configurados para este filtro são enviados através da saída designada. Se um filtro for ativado sem que itens sejam configurados, estamos falando de uma saída "não configurada", aberta. - -**Atenção: O distribuidor também é um pusher em suas saídas. Portanto, nunca puxe itens do distribuidor com um pusher!** - -Existem dois modos de operação para uma saída não configurada: - -1) Enviar todos os itens que não podem ser enviados para nenhuma outra saída, mesmo que estejam bloqueados. - -2) Enviar apenas os itens que não foram configurados para nenhum outro filtro. - -No primeiro caso, todos os itens são sempre encaminhados e o distribuidor não fica cheio. No segundo caso, os itens são retidos e o distribuidor pode ficar cheio e, em seguida, bloquear. - -O modo de operação pode ser definido usando a caixa de seleção "modo de bloqueio". - -A capacidade de processamento de um distribuidor TA2 é de 4 itens a cada 2s, onde o distribuidor tenta distribuir os 4 itens para as saídas abertas. - -Se o mesmo item for configurado várias vezes em um filtro, a proporção de distribuição a longo prazo será influenciada de acordo. - -Observe que a distribuição é um processo probabilístico. Isso significa que as proporções de distribuição não serão correspondidas exatamente, mas apenas a longo prazo. - -O tamanho máximo de pilha nos filtros é 12; no total, não mais que 36 itens podem ser configurados. - -[ta2_distributor|image] - - -## Gravel washer(Lavador de cascalho) - -O lavador de cascalho é uma máquina mais complexa com o objetivo de lavar pepitas de Usmium a partir de cascalho peneirado. Um enxaguatório TA2 com eixo de acionamento, um funil, um baú e água corrente são necessários para a instalação. - -Estrutura da esquerda para a direita (veja também o plano): - -- Um bloco de terra, sobre ele a fonte de água, cercada em 3 lados, por exemplo, por blocos de vidro -- Ao lado, o enxaguatório de cascalho, se necessário com conexões de tubulação para a entrega e remoção de cascalho -- Em seguida, o funil com baú - -O conjunto é cercado por mais blocos de vidro, para que a água flua sobre o enxaguatório de cascalho e o funil, e as pepitas lavadas possam ser coletadas novamente pelo funil. - -[gravelrinser|plan] - -### TA2 Gravel Rinser(Enxaguatório de cascalho) - -O lavador de cascalho é capaz de enxaguar os minérios de Usmium e cobre do cascalho que já foi peneirado, desde que seja lavado com água. - -Se o Enxaguatório de Cascalho funciona corretamente, pode ser testado com pedaços de madeira, se estes forem colocados no inventário do Enxaguatório de Cascalho. Eles devem ser enxaguados individualmente e recolhidos pelo funil. - -A capacidade de processamento é de um item de cascalho a cada 2s. O lavador de cascalho precisa de 3 ku de energia. - -[ta2_rinser|image] - - -## Escavar pedra, moer e peneirar - -Esmagar, moer e peneirar pedregulhos é usado para extrair minérios. O cascalho peneirado também pode ser usado para outros fins. A pedreira, moedor e peneira devem ser acionados e, portanto, instalados perto de uma máquina a vapor. - -[ta2_grinder|image] - -### TA2 Quarry(Pedreira) - -A pedreira é usada para remover pedras e outros materiais do subsolo. A pedreira escava um buraco de 5x5 blocos. A profundidade é ajustável. -A capacidade de processamento é de um bloco a cada 4s. A pedreira precisa de 10 ku de energia. A profundidade máxima é de 20 metros. Para maiores profundidades, consulte TA3 / TA4. - -[ta2_quarry|image] - -### TA2 Grinder(Moedor) - -O moedor é capaz de moer várias rochas, mas também madeira e outros itens. -A capacidade de processamento é de um item a cada 4s. O moedor precisa de 4 ku de energia. - -[ta2_grinder|image] - -### TA2 Gravel Sieve(Peneira de cascalho) - -A peneira de cascalho é capaz de peneirar cascalho para extrair minérios. O resultado é parcialmente "sieved gravel", que não pode ser peneirado novamente. -A capacidade de processamento é de um item a cada 4s. A peneira de cascalho requer 3 ku de energia. - -[ta2_gravelsieve|image] - - -## Produzindo Itens - -As máquinas TA2 podem não apenas extrair minérios, mas também produzir objetos. - -### TA2 Autocrafter - -O autocrafter é usado para a produção automática de bens. Tudo o que o jogador pode produzir via "Crafting Grid" também pode ser feito pelo autocrafter. Para isso, a receita deve ser inserida no menu do autocrafter e os ingredientes necessários adicionados. - -Ingredientes e produtos fabricados podem ser transportados para dentro e para fora do bloco por meio de tubos e pushers. - -A capacidade de processamento é de um item a cada 4s. O autocrafter requer 4 ku de energia. - -[ta2_autocrafter|image] - -### TA2 Electronic Fab - -O electronic fab é uma máquina especial e só pode ser usada para a produção de tubos de vácuo. Tubos de vácuo são necessários para máquinas e blocos TA3. - -A capacidade de processamento é de um tubo de vácuo a cada 6s. O electronic fab requer 8 ku de energia. - -[ta2_electronicfab|image] - - -## Outros Blocos - -### TA2 Liquid Sampler - -Algumas receitas requerem água. Para que essas receitas também possam ser processadas automaticamente com o autocrafter, água deve ser fornecida em baldes. Isso é feito usando o liquid sampler. Ele precisa de baldes vazios e deve ser colocado na água. - -A capacidade de processamento é de um balde de água a cada 8s. O liquid sampler requer 3 ku de energia. - -[ta2_liquidsampler|image] - -### TA2 Protected Chest - -O protected chest só pode ser usado por jogadores que têm permissão de construção neste local, ou seja, que têm direitos de proteção. Não importa quem coloca o baú. - -[ta2_chest|image] - -### Techage Forceload Block - -O Minetest divide o mapa em chamados map blocks. Estes são cubos com uma aresta de 16x16x16 blocos. Um map block é sempre completamente carregado pelo servidor, mas apenas os blocos ao redor de um jogador são carregados (aproximadamente 2-3 blocos em todas as direções). Na direção de visão do jogador, também existem mais map blocks. Apenas esta parte do mundo é ativa e apenas aqui as plantas e árvores crescem ou as máquinas funcionam. - -Com um bloco forceload, você pode forçar o map block em que o bloco forceload está localizado a permanecer carregado enquanto você estiver no servidor. Quando todos os seus campos e máquinas estão cobertos com blocos Forceload, tudo está sempre em execução. - -Os map blocks com suas coordenadas são predefinidos, por exemplo, (0,0,0) a (15,15,15), ou (16,16,16) a (31,31,31). -Você pode mover um bloco forceload dentro de um map block como quiser, a posição do map block permanece inalterada. - -[ta2_forceload|image] - - - - - - - - - - - - - - - - - diff --git a/techage/manuals/manual_ta3_DE.md b/techage/manuals/manual_ta3_DE.md deleted file mode 100644 index 3b2037b..0000000 --- a/techage/manuals/manual_ta3_DE.md +++ /dev/null @@ -1,912 +0,0 @@ -# TA3: Ölzeitalter - -Bei TA3 gilt es, die Dampf-betriebenen Maschinen durch leistungsfähigere und mit elektrischem Strom betriebene Maschinen abzulösen. - -Dazu musst du Kohlekraftwerke und Generatoren bauen. Bald wirst du sehen, dass dein Strombedarf nur mit Öl-betriebenen Kraftwerken zu decken ist. Also machst du dich auf die Suche nach Erdöl. Bohrtürme und Ölpumpen helfen die, an das Öl zu kommen. Schienenwege dienen dir zum Öltransport bis in die Kraftwerke. - -Das Industrielle Zeitalter ist auf seinem Höhepunkt. - -[techage_ta3|image] - - -## Kohlekraftwerk / Ölkraftwerk - -Das Kohlekraftwerk besteht aus mehreren Blöcken und muss wie im Plan rechts abgebildet, zusammen gebaut werden. Dazu werden die Blöcke TA3 Kraftwerks-Feuerbox, TA3 Boiler oben, TA3 Boiler unten, TA3 Turbine, TA3 Generator und TA3 Kühler benötigt. - -Der Boiler muss mit Wasser gefüllt werden. Dazu bis zu 10 Eimer Wasser in den Boiler füllen. -Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. -Wenn das Wasser heiß ist, kann der Generator gestartet werden. - -Das Kraftwerk kann alternativ auch mit einem Ölbrenner ausgestattet und dann mit Öl betrieben werden. -Das Öl kann über eine Pumpe und Ölleitung nachgefüllt werden. - -Das Kraftwerk liefert eine Leistung von 80 ku. - -[coalpowerstation|plan] - - -### TA3 Kraftwerks-Feuerbox / Power Station Firebox - -Teil des Kraftwerks. -Die Feuerbox muss mit Kohle oder Holzkohle gefüllt werden. Die Brenndauer ist abhängig von der Leistung, die vom Kraftwerk angefordert wird. Unter Volllast brennt Kohle 20 s und Holzkohle 60 s. Unter Teillast entsprechend länger (50% Last = doppelte Zeit). - -[ta3_firebox|image] - - -### TA3 Kraftwerks-Ölbrenner / TA3 Power Station Oil Burner - -Teil des Kraftwerks. - -Der Ölbrenner kann mit Erdöl, Schweröl, Naphtha oder Benzin gefüllt werden. Die Brenndauer ist abhängig von der Leistung, die vom Kraftwerk angefordert wird. Unter Volllast brennt Erdöl 15 s, Schweröl 20 s, Naphtha 22 s und Benzin 25 s. - -Unter Teillast entsprechend länger (50% Last = doppelte Zeit). - -Der Ölbrenner kann nur 50 Einheiten Kraftstoff aufnehmen. Ein zusätzlicher Öltank und eine Ölpumpe sind daher ratsam. - - -[ta3_oilbox|image] - - -### TA3 Boiler unten/oben - -Teil des Kraftwerk. Muss mit Wasser gefüllt werden. Wem kein Wasser mehr vorhanden ist oder die Temperatur zu weit absinkt, schaltet sich das Kraftwerk ab. Der Wasserverbrauch des TA3-Kessels ist durch den geschlossenen Dampfkreislauf viel geringer als bei der Dampfmachine. -Bei der Dampfmaschine geht bei jedem Kolbenhub etwas Wasser als Dampf verloren. - -[ta3_boiler|image] - - -### TA3 Turbine - -Die Turbine ist Teil des Kraftwerk. Sie muss neben den Generator gesetzt und über Dampfleitungen mit dem Boiler und dem Kühler, wie im Plan abgebildet, verbunden werden. - -[ta3_turbine|image] - - -### TA3 Generator - -Der Generator dient zur Stromerzeugung. Er muss über Stromkabel und Verteilerdosen mit den Maschinen verbunden werden. - -[ta3_generator|image] - - -### TA3 Kühler / Cooler - -Dient zur Abkühlung des heißen Dampfs aus der Turbine. Muss über Dampfleitungen mit dem Boiler und der Turbine, wie im Plan abgebildet, verbunden werden. - -[ta3_cooler|image] - - -## Elektrischer Strom - -In TA3 (und TA4) werden die Maschinen mit Strom angetrieben. Dazu müssen die Maschinen, Speichersysteme und Generatoren mit Stromkabel verbunden werden. -TA3 besitzt 2 Arten von Stromkabel: - -- Isolierte Kabel (TA Stromkabel) für die lokale Verkabelung im Boden oder in Gebäuden. Diese Kabel lassen sich in der Wand oder im Boden verstecken (können mit der Kelle "verputzt" werden). -- Überlandleitungen (TA Stromleitung) für Freiluftverkabelung über große Strecken. Diese Kabel sind geschützt, können also von anderen Spielern nicht entfernt werden. - -Mehrere Verbraucher, Speichersysteme und Generatoren können in einem Stromnetzwerk zusammen betrieben werden. Mit Hilfe der Verteilerdosen können so Netzwerke aufgebaut werden. -Wird zu wenig Strom bereitgestellt, gehen die Verbraucher aus. -In diesem Zusammenhang ist auch wichtig, dass die Funktionsweise von Forceload Blöcken verstanden wurde, denn bspw. Generatoren liefern nur Strom, wenn der entsprechende Map-Block geladen ist. Dies kann mit einen Forceload Block erzwungen werden. - -In TA4 kommt noch ein Kabel für die Solaranlage hinzu. - -[ta3_powerswitch|image] - -### Bedeutung von Speichersystemen - -Speichersysteme im Stromnetz erfüllen zwei Aufgaben: - -- Um Bedarfsspitzen abzufangen: Alle Generatoren liefern immer gerade soviel Leistung, wie benötigt wird. Werden aber Verbraucher ein/ausgeschaltet oder kommt es aus anderen Gründen zu Bedarfsschwankungen, so können Verbraucher kurzzeitig ausfallen. Um dies zu verhindern, sollte immer mindestens ein Akkublock in jedem Netzwerk vorhanden sein. Dieser dient als Puffer und gleicht diese Schwankungen im Sekundenbereich aus. -- Um regenerative Energie zu speichern: Solar und Wind stehen nicht 24 Stunden am Tag zur Verfügung. Damit die Stromversorgung nicht ausfällt, wenn kein Strom produziert wird, müssen ein oder mehrere Speichersysteme im Netzwerk verbaut werden. Alternativ können die Lücken auch mit Öl/Kohle-Strom überbrückt werden. - -Ein Speichersystem gibt seine Kapazität in kud an, also ku pro day (Tag). Bspw. ein Speichersystem mit 100 kud liefert 100 ku einen Spieltag lang, oder auch 10 ku für 10 Spieltage. - -Alle TA3/TA4 Energiequellen besitzen eine einstellbare Ladecharakteristik. Standardmäßig ist diese auf "80% - 100%" eingestellt. Dies bedeutet, dass die Leistung ab 80% Füllung des Speichersystems immer weiter reduziert wird, bis sie bei 100 % komplett abschaltet. Sofern Strom im Netzwerk benötigt wird, werden die 100 % nie erreicht, da die Leistung des Generators irgendwann auf den Strombedarf im Netzwerk abgesunken ist und damit das Speichersystem nicht mehr geladen, sondern nur noch die Verbraucher bedient werden. - -Dies hat mehrere Vorteile: - -- Die Ladecharakteristik ist einstellbar. Damit kann man bspw. Öl/Kohle Energiequellen bei 60% und die regenerativen Energiequellen erst bei 80% zurückfahren. Damit wird nur Öl/Kohle verbrannt, wenn nicht ausreichend regenerativen Energiequellen zur Verfügung stehen. -- Mehrere Energiequellen können parallel betrieben werden und werden dabei nahezu gleichmäßig belastet, denn alle Energiequellen arbeiten bspw. bis 80% Ladekapazität des Speichersystems mit ihrer vollen Leistung und fahren dann gleichzeitig ihre Leistung zurück. -- Alle Speichersysteme in einem Netzwerk bilden einen großen Puffer. An jedem Speichersystem aber auch am Strom Terminal kann immer die Ladekapazität und der Füllungsgrad des gesamten Speichersystems in Prozent abgelesen werden. - -[power_reduction|image] - - - - -### TA Stromkabel / Electric Cable - -Für die lokale Verkabelung im Boden oder in Gebäuden. -Abzweigungen können mit Hilfe von Verteilerdosen realisiert werden. Die maximale Kabellänge zwischen Maschinen oder Verteilerdosen beträgt 1000 m. Es können maximale 1000 Knoten in einem Strom-Netzwerk verbunden werden. Als Knoten zählen alle Blöcke mit Stromanschluss, also auch Verteilerdosen. - -Da die Stromkabel nicht automatisch geschützt sind, wird für längere Strecken die Überlandleitungen (TA Stromleitung) empfohlen. - -Stromkabel können mit der Kelle verputzt also in der Wand oder im Boden versteckt werden. Als Material zum Verputzen können alle Stein-, Clay- und sonstige Blöcke ohne "Intelligenz" genutzt werden. Erde (dirt) geht nicht, da Erde zu Gras oder ähnlichem konvertiert werden kann, was die Leitung zerstören würde. - -Zum Verputzen muss mit der Kelle auf das Kabel geklickt werden. Das Material, mit dem das Kabel verputzt werden soll, muss sich im Spieler-Inventar ganz links befinden. -Die Kabel können wieder sichtbar gemacht werden, indem man mit der Kelle wieder auf den Block klickt. - -Außer Kabel können auch die TA Verteilerdose und die TA Stromschalterbox verputzt werden. - -[ta3_powercable|image] - - -### TA Verteilerdose / Electric Junction Box - -Mit der Verteilerdose kann Strom in bis zu 6 Richtungen verteilt werden. Verteilerdosen können auch mit der Kelle verputzt (versteckt) und wieder sichtbar gemacht werden. - -[ta3_powerjunction|image] - - -### TA Stromleitung / Power Line - -Mit der TA Stromleitung und den Strommasten können halbwegs realistische Überlandleitungen realisiert werden. Die Strommasten-Köpfe dienen gleichzeitig zum Schutz der Stromleitung (Protection). Dazu muss alle 16 m oder weniger ein Masten gesetzt werden. Der Schutz gilt aber nur die die Stromleitung und die Masten, alle anderen Blöcke in diesem Bereich sind dadurch nicht geschützt. - -[ta3_powerline|image] - - -### TA Strommast / Power Pole -Dient zum Bauen von Strommasten. Ist durch den Strommast-Kopf vor Zerstörung geschützt und kann nur vom Besitzer wieder abgebaut werden. - -[ta3_powerpole|image] - - -### TA Strommastkopf / Power Pole Top -Hat bis zu vier Arme und erlaubt damit, Strom in bis zu 6 Richtungen weiter zu verteilen. -Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m. - -[ta3_powerpole4|image] - - -### TA Strommastkopf 2 / Power Pole Top 2 - -Dieser Strommastkopf hat zwei feste Arme und wird für die Überlandleitungen genutzt. Er kann aber auch Strom nach unten und oben weiterleiten. -Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m. - -[ta3_powerpole2|image] - - -### TA Stromschalter / Power Switch - -Mit dem Schalter kann der Strom ein- und ausgeschaltet werden. Der Schalter muss dazu auf eine Stromschalterbox gesetzt werden. Die Stromschalterbox muss dazu auf beiden Seiten mit dem Stromkabel verbunden sein. - -[ta3_powerswitch|image] - - -### TA Stromschalter klein / Power Switch Small - -Mit dem Schalter kann der Strom ein- und ausgeschaltet werden. Der Schalter muss dazu auf eine Stromschalterbox gesetzt werden. Die Stromschalterbox muss dazu auf beiden Seiten mit dem Stromkabel verbunden sein. - -[ta3_powerswitchsmall|image] - - -### TA Stromschalterbox / Power Switch Box - -siehe TA Stromschalter. - -[ta3_powerswitchbox|image] - - -### TA3 Kleiner Stromgenerator / Tiny Power Generator - -Der kleine Stromgenerator wird mit Benzin betrieben und kann für kleine Verbraucher mit bis zu 12 ku genutzt werden. Unter Volllast brennt Benzin 150 s. Unter Teillast entsprechend länger (50% Last = doppelte Zeit). - -Der Stromgenerator kann nur 50 Einheiten Benzin aufnehmen. Ein zusätzlicher Tank und eine Pumpe sind daher ratsam. - - -[ta3_tinygenerator|image] - - -### TA3 Akku Block / TA3 Accu Box - -Der Akku Block dient zur Speicherung von überschüssiger Energie und gibt bei Stromausfall automatisch Strom ab (soweit vorhanden). -Mehrere Akku Blocks zusammen bilden ein TA3 Energiespeichersystem. Jeder Akku Block hat eine Anzeige für den Ladezustand und für die gespeicherte Ladung, wobei hier immer die Werte für das gesamte Netzwerk angezeigt werden. Die gespeicherte Ladung wird in "kud" also "ku-days" angezeigt (analog zu kWh) 5 kud entspricht damit bspw. 5 ku für einen Spieltag (20 min) oder 1 ku für 5 Spieltage. - -Ein Akku Block hat 3.33 kud. - -[ta3_akkublock|image] - - -### TA3 Strom Terminal / Power Terminal - -Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an. - -In der oberen Hälfte werden die wichtigsten Größen ausgegeben: - -- aktuelle/maximale Generatorleistung -- aktueller Stromaufnahme aller Verbraucher -- aktueller Ladestrom in/aus dem Speichersystems -- aktuellen Ladezustand des Speichersystems in Prozent - -In der unteren Hälfte wird die Anzahl der Netzwerkblöcke ausgegeben. - -Über den Reiter "console" können weitere Daten zu den Generatoren und Speichersystemen abgefragt werden. - -[ta3_powerterminal|image] - - -### TA3 Elektromotor / TA3 Electric Motor - -Um TA2 Maschinen über das Stromnetz betreiben zu können, wird der TA3 Elektromotor benötigt. Dieser wandelt Strom in Achsenkraft um. -Wird der Elektromotor nicht mit ausreichend Strom versorgt, geht er in einen Fehlerzustand und muss über einen Rechtsklick wieder aktiviert werden. - -Das Elektromotor nimmt primär max. 40 ku an Strom auf und gibt sekundär max. 39 ku als Achsenkraft wieder ab. Er verbraucht also ein ku für die Umwandlung. - -[ta3_motor|image] - - - -## TA3 Industrieofen - -Der TA3 Industrieofen dient als Ergänzung zu normalen Ofen (furnace). Damit können alle Waren mit "Koch" Rezepten, auch im Industrieofen hergestellt werden. Es gibt aber auch spezielle Rezepte, die nur im Industrieofen hergestellt werden können. -Der Industrieofen hat sein eigenes Menü zur Rezeptauswahl. Abhängig von den Waren im Industrieofen Inventar links kann rechts das Ausgangsprodukt gewählt werden. - -Der Industrieofen benötigt Strom (für das Gebläse) sowie Schweröl/Benzin für den Brenner. Der Industrieofen muss wie im Plan rechts abgebildet, zusammen gebaut werden. - -Siehe auch TA4 Ofenheizung. - -[ta3_furnace|plan] - - -### TA3 Ofen-Ölbrenner / Furnace Oil Burner - -Ist Teil des TA3 Industrieofen. - -Der Ölbrenner kann mit Erdöl, Schweröl, Naphtha oder Benzin betrieben werden. Die Brennzeit beträgt für Erdöl 65 s, Schweröl 80 s, Naphtha 90 s und Benzin 100 s. - -Der Ölbrenner kann nur 50 Einheiten Kraftstoff aufnehmen. Ein zusätzlicher Tank und eine Pumpe sind daher ratsam. - -[ta3_furnacefirebox|image] - - -### TA3 Ofenoberteil / Furnace Top - -Ist Teil des TA3 Industrieofen. Siehe TA3 Industrieofen. - -[ta3_furnace|image] - - -### TA3 Gebläse / Booster - -Ist Teil des TA3 Industrieofen. Siehe TA3 Industrieofen. - -[ta3_booster|image] - - -## Flüssigkeiten - -Flüssigkeiten wie Wasser oder Öl können nur die spezielle Leitungen gepumpt und in Tanks gespeichert werden. Wie auch bei Wasser gibt es aber Behälter (Kanister, Fässer), in denen die Flüssig gelagert und transportiert werden kann. - -Über die gelben Leitungen und Verbindungsstücke ist es auch möglich, mehrere Tanks zu verbinden. Allerdings müssen die Tanks den selben Inhalt haben und zwischen Tank, Pumpe und Verteiler muss immer mindestens eine gelbe Leitung sein. - -Bspw. zwei Tanks direkt mit einem Verteilerstück zu verbinden, geht nicht. - -Um Flüssigkeiten von Behältern nach Tanks umzufüllen, dient der Einfülltrichter. Im Plan ist dargestellt, wie Kanistern oder Fässer mit Flüssigkeiten über Schieber in einen Einfülltrichter geschoben werden. Im Einfülltrichter wird der Behälter geleert und die Flüssigkeit nach unten in den Tank geleitet. - -Der Einfülltrichter kann auch unter einen Tank gesetzt werden, um den Tank zu leeren. - -[ta3_tank|plan] - - -### TA3 Tank / TA3 Tank - -In einem Tank können Flüssigkeiten gespeichert werden. Ein Tank kann über eine Pumpe gefüllt bzw. geleert werden. Dazu muss die Pumpe über einer Leitung (gelbe Röhre) mit dem Tank verbunden sein. - -Ein Tank kann auch von Hand gefüllt oder geleert werden, indem mit einem vollen oder leeren Flüssigkeitsbehälter (Fass, Kanister) auf den Tank geklickt wird. Dabei ist zu beachten, dass Fässer nur komplett gefüllt oder entleert werden können. Sind bspw. weniger als 10 Einheiten im Tank, muss dieser Rest mit Kanistern entnommen oder leergepumpt werden. - -In einen TA3 Tank passen 1000 Einheiten oder 100 Fässer einer Flüssigkeit. - -[ta3_tank|image] - - -### TA3 Pumpe / TA3 Pump - -Mit der Pumpe können Flüssigkeiten von Tanks oder Behältern zu anderen Tanks oder Behältern gepumpt werden. Bei der Pumpe muss die Pumprichtung (Pfeil) beachtet werden. Über die gelben Leitungen und Verbindungsstücke ist es auch möglich, mehrere Tanks auf jeder Seite der Pumpe anzuordnen. Allerdings müssen die Tanks den selben Inhalt haben. - -Die TA3 Pumpe pumpt 4 Einheiten Flüssigkeit alle zwei Sekunden. - -Hinweis 1: Die Pumpe darf nicht direkt neben den Tank platziert werden. Es muss immer mindestens ein Stück gelbe Leitung dazwischen sein. - -Hinweis 2: Nach dem Starten markiert die Pumpe 10 x die Blöcke, von und zu denen gepumpt wird. - -[ta3_pump|image] - - -### TA Einfülltrichter / TA Liquid Filler - -Um Flüssigkeiten zwischen Behältern und Tanks umzufüllen, dient der Einfülltrichter. - -- wird der Einfülltrichter unter einen Tank gesetzt und werden leere Fässer mit einem Schieber oder von Hand in den Einfülltrichter gegeben, wird der Tankinhalt in die Fässer umgefüllt und die Fässer können ausgangsseitig wieder entnommen werden -- wird der Einfülltrichter auf einen Tank gesetzt und werden volle Fässer mit einem Schieber oder von Hand in den Einfülltrichter gegeben, werden diese in den Tank umgefüllt und die Fässer können ausgangsseitig wieder entnommen werden - -Dabei ist zu beachten, dass Fässer nur komplett gefüllt oder entleert werden können. Sind bspw. weniger als 10 Einheiten im Tank, muss dieser Rest mit Kanistern entnommen oder leergepumpt werden. - -[ta3_filler|image] - -### TA4 Röhre / Pipe - -Die gelben Röhren dienen zur Weiterleitung von Gas und Flüssigkeiten. -Die maximale Leitungslänge beträgt 100 m. - -[ta3_pipe|image] - -### TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke - -Die Blöcke dienen als Wanddurchbrüche für Röhren, so dass keine Löcher offen bleiben. - -[ta3_pipe_wall_entry|image] - -### TA Ventil / TA Valve - -Für die gelben Röhren gibt es ein Ventil, welches über Mausklicks geöffnet und geschlossen werden kann. -Das Ventil kann auch über on/off Kommandos angesteuert werden. - -[ta3_valve|image] - - - -## Öl-Förderung - -Um deine Generatoren und Öfen mit Öl betreiben zu können, muss du zuerst nach Öl suchen und einen Bohrturm errichten und danach das Öl fördern. -Dazu dienen dir TA3 Ölexplorer, TA3 Ölbohrkiste und TA3 Ölpumpe. - -[techage_ta3|image] - - -### TA3 Ölexplorer / Oil Explorer - -Mit dem Ölexplorer kannst du nach Öl suchen. Dazu den Block auf den Boden setzen und mit Rechtsklick die Suche starten. Der Ölexplorer kann oberirdisch und unterirdisch in allen Tiefen eingesetzt werden. -Über die Chat-Ausgabe wird dir angezeigt, in welcher Tiefe nach Öl gesucht wurde und wie viel Öl (oil) gefunden wurde. -Du kannst mehrfach auf den Block klicken, um auch in tieferen Bereichen nach Öl zu suchen. Ölfelder haben eine Größe von 4000 bis zu 20000 Items. - -Falls die Suche erfolglos war, musst du den Block ca. 16 m weiter setzen. -Der Ölexplorer sucht immer innerhalb des ganzen Map-Blocks und darunter nach Öl, in dem er gesetzt wurde. Eine erneute Suche im gleichen Map-Block (16x16 Feld) macht daher keinen Sinn. - -Falls Öl gefunden wurde, wird die Stelle für den Bohrturm angezeigt. Du musst den Bohrturm innerhalb des angezeigten Bereiches errichten, die Stelle am besten gleich mit einem Schild markieren und den ganzen Bereich gegen fremde Spieler schützen. - -Gib die Suche nach Öl nicht zu schnell auf. Es kann wenn du Pech hast, sehr lange dauern, bis du eine Ölquelle gefunden hast. -Es macht auch keinen Sinn, einen Bereich den ein anderer Spieler bereits abgesucht hat, nochmals abzusuchen. Die Chance, irgendwo Öl zu finden, ist für alle Spieler gleich. - -Der Ölexplorer kann immer wieder zur Suche nach Öl eingesetzt werden. - -[ta3_oilexplorer|image] - - -### TA3 Ölbohrkiste / Oil Drill Box - -Die Ölbohrkiste muss an die Stelle gesetzt werden, die vom Ölexplorer angezeigt wurde. An anderen Stellen nach Öl zu bohren ist zwecklos. -Wird auf den Button der Ölbohrkiste geklickt, wird über der Kiste ein Bohrturm errichtet. Dies dauert einige Sekunden. -Die Ölbohrkiste hat 4 Seiten, bei IN muss das Bohrgestänge über Schieber angeliefert und bei OUT muss das Bohrmaterial abtransportiert werden. Über eine der anderen zwei Seiten muss die Ölbohrkiste mit Strom versorgt werden. - -Die Ölbohrkiste bohrt bis zum Ölfeld (1 Meter in 16 s) und benötigt dazu 16 ku Strom. -Wurde das Ölfeld erreicht, kann der Bohrturm abgebaut und die Kiste entfernt werden. - -[ta3_drillbox|image] - - -### TA3 Ölpumpe / Oil Pumpjack - -An die Stelle der Ölbohrkiste muss nun die Ölpumpe platziert werden. Auch die Ölpumpe benötigt Strom (16 ku) und liefert alle 8 s ein Einheit Erdöl. Das Erdöl muss in einem Tank gesammelt werden. Dazu muss die Ölpumpe über eine Leitung (gelbe Röhre) mit dem Tank verbunden werden. -Ist alles Öl abgepumpt, kann auch die Ölpumpe wieder entfernt werden. - -[ta3_pumpjack|image] - - -### TA3 Bohrgestänge / Drill Pipe - -Das Bohrgestänge wird für die Bohrung benötigt. Es werden so viele Bohrgestänge Items benötigt wie als Tiefe für das Ölfeld angegeben wurde. Das Bohrgestänge ist nach der Bohrung nutzlos, kann aber auch nicht abgebaut werden und verbleibt im Boden. Es gibt aber ein Werkzeug, um die Bohrgestänge Blöcke wieder entfernen zu können (-> Werkzeuge -> TA3 Bohrgestängezange). - -[ta3_drillbit|image] - - -### Öltank / Oil Tank - -Der Öltank ist die große Ausführung des TA3 Tanks (siehe Flüssigkeiten -> TA3 Tank). - -Der große Tank kann 4000 Einheiten Öl, aber auch jede andere Art von Flüssigkeit aufnehmen. - -[oiltank|image] - - - -## Öl-Transport - -### Öl-Transport mit dem Tankwagen -Um Öl von der Ölquelle zur Ölverarbeitungsanlage zu befördern, können Tankwagen (tank carts) genutzt werden. Ein Tankwagen kann direkt über Pumpen gefüllt bzw. geleert werden. In beiden Fällen muss die gelbe Röhre von oben mit dem Tankwagen verbunden werden. - -Dazu sind folgende Schritte notwendig: - -- Den Tankwagen vor den Prellbock setzen. Der Prellbock darf noch nicht mit einer Zeit programmiert sein, so dass der Tankwagen nicht automatisch losfährt -- Den Tankwagen über gelbe Röhren mit der Pumpe verbinden -- Pumpe einschalten -- Prellbock mit einer Zeit (10 - 20 s) programmieren - -Diese Reihenfolge muss auf beiden Seiten /Füllen/Leeren) eingehalten werden. - -[tank_cart|image] - -### Öl-Transport mit Fässern über Minecarts -In die Minecarts können Kanister und Fässer geladen werden. Das Öl muss dazu zuvor in Fässer umgeladen werden. Die Ölfässer können direkt mit einem Schieber und Röhren in das Minecart geschoben werden (siehe Plan). Die leeren Fässer, welche per Minecart von der Entladestation zurück kommen, können über einen Hopper entladen werden, der unter der Schiene an der Haltestelle platziert wird. - -Es ist mit dem Hopper nicht möglich, an **einer** Haltestelle sowohl die leeren Fässer zu entladen, als auch die vollen Fässer zu beladen. Der Hopper lädt die vollen Fässer sofort wieder aus. Daher ist es ratsam, jeweils 2 Stationen auf der Be- und Entladeseite einzurichten und den Minecart dann über eine Aufzeichnungsfahrt entsprechend zu programmieren. - -Der Plan zeigt, wie das Öl in einen Tank gepumpt und über einen Einfülltrichter in Fässer umgefüllt und in Minecarts geladen werden kann. - -Damit die Minecarts automatisch wieder starten, müssen die Prellböcke mit Stationsname und Wartezeit konfiguriert werden. Für das Entladen reichen 5 s. Da aber die Schieber immer für mehrere Sekunden in den Standby fallen, wenn kein Minecart da ist, muss für das Beladen eine Zeit von 15 oder mehr Sekunden eingegeben werden. - -[ta3_loading|plan] - - -### Tankwagen / Tank Cart - -Der Tankwagen dient zum Transport von Flüssigkeiten. Es kann wie Tanks mit Pumpen gefüllt bzw. geleert werden. In beiden Fällen muss die gelbe Röhre von oben mit dem Tankwagen verbunden werden. - -In den Tankwagen passen 200 Einheiten. - -[tank_cart|image] - -### Kistenwagen / Chest Cart - -Der Kistenwagen dient zum Transport von Items. Es kann wie Kisten über Schieber gefüllt bzw. geleert werden. - -In den Kistenwagen passen 4 Stacks. - -[chest_cart|image] - - - -## Öl-Verarbeitung - -Öl ist ein Stoffgemisch und besteht aus sehr vielen Komponenten. Über einen Destillationsturm kann das Öl in seine Hauptbestandteile wie Bitumen, Schweröl, Naphtha, Benzin und Gas zerlegt werden. -Die weitere Verarbeitung zu Endprodukten erfolgt im Chemischen Reaktor. - -[techage_ta31|image] - - -### Destillationsturm / distiller tower - -Der Destillationsturm muss wie im Plan rechts oben aufgebaut werden. -Über den Basisblock wird das Bitumen abgelassen. Der Ausgang ist auf der Rückseite des Basisblocks (Pfeilrichtung beachten). -Auf diesen Basisblock kommen die "Destillationsturm" Blöcke mit den Nummern: 1, 2, 3, 2, 3, 2, 3, 4 -An den Öffnungen von unten nach oben werden Schweröl, Naphtha und Benzin abgeleitet. Ganz oben wird das Propangas abgefangen. -Es müssen alle Öffnungen am Turm mit Tanks verbunden werden. -Der Aufkocher (reboiler) muss mit dem Block "Destillationsturm 1" verbunden werden. - -Der Aufkocher benötigt Strom (nicht im Plan zu sehen)! - - -[ta3_distiller|plan] - -#### Aufkocher / reboiler) - -Der Aufkocher erhitzt das Erdöl auf ca. 400°C. Dabei verdampft es weitgehend und wird in den Destillationsturm zur Abkühlung geleitet. - -Der Aufkocher benötigt 14 Einheiten Strom und produziert alle 16 s jeweils eine Einheit Bitumen, Schweröl, Naphtha, Benzin und Propangas. -Dazu muss der Aufkocher über einen Pumpe mit Erdöl versorgt werden. - -[reboiler|image] - - -## Logik-/Schalt-Blöcke - -Neben den Röhren für Warentransport, sowie den Gas- und Stromleitungen gibt es auch noch eine drahtlose Kommunikationsebene, über die Blöcke untereinander Daten austauschen können. Dafür müssen keine Leitungen gezogen werden, sondern die Verbindung zwischen Sender und Empfänger erfolgt nur über die Blocknummer. - -**Info:** Eine **Blocknummer** ist eine eindeutige Zahl, die von Techage beim Setzen von vielen Techage Blöcken generiert wird. Die Blocknummer dient zur Adressierung bei der Kommunikation zwischen Techage Controllern und Maschinen. Alle Blöcke, die an dieser Kommunikation teilnehmen können, zeigen die Blocknummer als Info-Text an, wenn man mit dem Mauscursor den Block fixiert. - -Welche Kommandos ein Block unterstützt, kann mit dem TechAge Info Werkzeug (Schraubenschlüssel) ausgelesen und angezeigt werden. -Die einfachsten Kommandos, die von fast allen Blöcken unterstützt werden, sind: - -- `on` - Block/Maschine/Lampe einschalten -- `off` - Block/Maschine/Lampe ausschalten - -Mir Hilfe des TA3 Terminal können diese Kommandos sehr einfach ausprobiert werden. Angenommen, eine Signallampe hat die Nummer 123. -Dann kann mit: - - cmd 123 on - -die Lampe ein, und mit: - - cmd 123 off - -die Lampe wieder ausgeschaltet werden. Diese Kommandos müssen so in das Eingabefeld des TA3 Terminals eingegeben werden. - -Kommandos wie `on` und `off` werden zum Empfänger gesendet, ohne dass eine Antwort zurück kommt. Diese Kommandos können daher bspw. mit einem Taster/Schalter auch gleichzeitig an mehrere Empfänger gesendet werden, wenn dort im Eingabefeld mehrere Nummern eingegeben werden. - -Ein Kommandos wie `state` fordert den Status eines Blockes an. Der Block sendet in Folge seinen Status zurück. Diese Art von bestätigten Kommandos kann gleichzeitig nur an einen Empfänger gesendet werden. -Auch dieses Kommandos kann mit dem TA3 Terminal bspw. an einem Schieber ausprobiert werden: - - cmd 123 state - -Mögliche Antworten des Schiebers sind: -- `running` --> bin am arbeiten -- `stopped` --> ausgeschaltet -- `standby` --> nichts zu tun, da Quell-Inventar leer -- `blocked` --> kann nichts tun, da Ziel-Inventar voll - -Dieser Status und weitere Informationen werden auch ausgegeben, wenn mit dem Schraubenschlüssel auf den Block geklickt wird. - -[ta3_logic|image] - - -### TA3 Taster/Schalter / Button/Switch - -Der Taster/Schalter sendet `on`/`off` Kommandos zu den Blöcken, die über die Nummern konfiguriert wurden. -Der Taster/Schalter kann als Taster (button) oder Schalter (switch) konfiguriert werden. Wird er als Taster konfiguriert, so kann die Zeit zwischen den `on` und `off` Kommandos eingestellt werden. Mit der Betriebsart "on button" wird nur ein `on` und kein `off` Kommandos gesendet. - -Über die Checkbox "public" kann eingestellt werden, ob den Taster von jedem (gesetzt), oder nur vom Besitzer selbst (nicht gesetzt) genutzt werden darf. - -Hinweis: Mit dem Programmer können Blocknummern sehr einfach eingesammelt und konfiguriert werden. - -[ta3_button|image] - -### TA3 Kommando Konverter / Command Converter - -Mit dem TA3 Kommando Konverter können `on` / `off` Kommandos in andere Kommandos umgewandelt werden, sowie die Weiterleitung verhindert oder verzögert werden. Die Nummer des Zielblockes bzw. die Nummern der Zielblöcke, die Kommandos die gesendet werden sollen, sowie die Verzögerungszeiten in Sekunden müssen eingegeben werden. Wird kein Kommando eingegeben, wird nichts gesendet. - -Die Nummern können auch mit Hilfe des Techage Programmers programmiert werden. - -[ta3_command_converter|image] - -### TA3 Flipflop / Flip-Flop - -Das TA3 Flipflop wechselt seinen Zustand mit jedem empfangenen `on` Kommando. Empfangene `off` Kommandos werden ignoriert. Damit werden abhängig vom Zustandswechsel abwechselnd `on` / `off` Kommandos gesendet. Die Nummer des Zielblockes bzw. die Nummern der Zielblöcke müssen eingegeben werden. Die Nummern können auch mit Hilfe des Techage Programmers programmiert werden. - -Damit lassen sich bspw. Lampen mit Hilfe von Tastern ein- und wieder ausschalten. - -[ta3_flipflop|image] - -### TA3 Logikblock / Logic Block - -Den TA3 Logikblock kann man so programmieren, dass ein oder mehrere Eingangskommandos zu einem Ausgangskommando verknüpft und gesendet werden. Dieser Block kann daher diverse Logik-Elemente wie AND, OR, NOT, XOR usw. ersetzen. -Eingangkommandos für den Logikblock sind `on`/`off` Kommandos. -Eingangskommandos werden über die Nummer referenziert, also bspw. `1234` für das Kommando vom Sender mit der Nummer 1234. -Das gleiche gilt für Ausgangskommandos. - -Eine Regel ist wie folgt aufgebaut: - -``` - = on/off if is true -``` - -`` ist die Nummer des Blocks, zu dem das Kommando gesendet werden soll. -`` ist ein boolescher Ausdruck, bei dem Eingabenummern ausgewertet werden. - - - -**Beispiele für den Input Ausdruck** - -Signal negieren (NOT): - - 1234 == off - -Logisches UND (AND): - - 1234 == on and 2345 == on - -Logisches ODER (OR): - - 1234 == on or 2345 == on - -Folgende Operatoren sind zulässig: `and` `or` `on` `off` `me` `==` `~=` `(` `)` - -Ist der Ausdruck wahr (true), wird ein Kommando an den Block mit der `` Nummer gesendet. - -Es können bis zu vier Regeln definiert werden, wobei immer alle Regeln geprüft werden, wenn ein Kommando empfangen wird. - -Die interne Durchlaufzeit aller Kommandos beträgt 100 ms. - -Über das Schlüsselwort `me` kann die eigene Knotennummer referenziert werden. Damit ist es möglich, dass sich der Block selbst ein Kommando sendet (Flip-Flop Funktion). - -Die Sperrzeit definiert eine Pause nach einem Kommando, in der der Logikblock kein weiteres Kommando von extern annimmt. Empfangene Kommandos in der Sperrzeit werden damit verworfen. Die Sperrzeit kann in Sekunden definiert werden. - -[ta3_logic|image] - - -### TA3 Wiederholer / Repeater - -Der Wiederholer (repeater) sendet das empfangene Signal an alle konfigurierten Nummern weiter. -Dies kann bspw. Sinn machen, wenn man viele Blöcke gleichzeitig angesteuert werden sollen. Den Wiederholer kann man dazu mit dem Programmer konfigurieren, was nicht bei allen Blöcken möglich ist. - -[ta3_repeater|image] - - -### TA3 Sequenzer / Sequencer - -Der Sequenzer kann eine Reihe von `on`/`off` Kommandos senden, wobei der Abstand zwischen den Kommandos in Sekunden angegeben werden muss. Damit kann man bspw. eine Lampe blinken lassen. -Es können bis zu 8 Kommandos konfiguriert werden, jedes mit Zielblocknummer und Anstand zum nächsten Kommando. -Der Sequenzer wiederholt die Kommandos endlos, wenn "Run endless" gesetzt wird. -Wird also Kommando nichts ausgewählt, wird nur die angegeben Zeit in Sekunden gewartet. - -[ta3_sequencer|image] - - -### TA3 Timer - -Der Timer kann Kommandos Spielzeit-gesteuert senden. Für jede Kommandozeile kann die Uhrzeit, die Zielnummer(n) und das Kommando selbst angegeben werden. Damit lassen sich bspw. Lampen abends ein- und morgens wieder ausschalten. - -[ta3_timer|image] - - -### TA3 Terminal - -Das Terminal dient in erster Linie zum Austesten der Kommandoschnittstelle anderer Blöcke (siehe "Logik-/Schalt-Blöcke"). -Man kann aber auch Kommandos auf Tasten legen und so das Terminal produktiv nutzen. - - set - -Mit `set 1 ON cmd 123 on` kann bspw. die Usertaste 1 mit dem Kommando `cnd 123 on` programmiert werden. Wird die Taste gedrückt, wird das Kommando gesendet und die Antwort auf dem Bildschirm ausgegeben. - -Das Terminal besitzt folgende, lokalen Kommandos: -- `clear` lösche Bildschirm -- `help` gib eine Hilfeseite aus -- `pub` schalte in den öffentlichen Modus um -- `priv` schalte in den privaten Modus um - -Im privaten Modus (private) kann das Terminal nur von Spielern verwendet werden, die an diesem Ort bauen können, also Protection Rechte besitzen. Im öffentlichen Modus (public) können alle Spieler die vorkonfigurierten Tasten verwenden. - -[ta3_terminal|image] - - -### TechAge Farblampe / Color Lamp - -Die Farblampe kann mit `on`/`off` Kommando ein- bzw. ausgeschaltet werden. Diese Lampe braucht keinen Strom und -kann mit der Spritzpistole aus der Mod "Unified Dyes" und über Lua/Beduino Kommandos eingefärbt werden. - -Mit dem Chat-Kommando `/ta_color` wird die Farbpalette mit den Werten für die Lua/Beduino Kommandos angezeigt und mit `/ta_send color ` kann die Farbe geändert werden. - -[ta3_colorlamp|image] - - -### Tür/Tor Blöcke / Door/Gate Blocks - -Mit diese Blöcken kann man Türe und Tore realisieren, die über Kommandos geöffnet (Blöcke verschwinden) und wieder geschlossen werden können. Pro Tor oder Tür wird dazu ein Tür Controller benötigt. - -Das Aussehen der Blöcke kann über das Block-Menü eingestellt werden. -Damit lassen sich Geheimtüren realisieren, die sich nur bei bestimmten Spielern öffnen (mit Hilfe des Spieler-Detektors). - -[ta3_doorblock|image] - - - -### TA3 Tür Controller / Door Controller - -Der Tür Controller dient zur Ansteuerung der TA3 Tür/Tor Blöcke. Beim Tür Controller müssen die Nummern der Tür/Tor Blöcke eingegeben werden. Wird ein `on`/`off` Kommando Kommando an den Tür Controller gesendet, öffnet/schließt dieser die Tür bzw. das Tor. - -[ta3_doorcontroller|image] - -### TA3 Tür Controller II / Door Controller II - -Der Tür Controller II kann alle Arten von Blöcken entfernen und wieder setzen. Um den Tür Controller II anzulernen, muss der "Aufzeichnen" Button gedrückt werden. Dann müssen alle Blöcke angeklickt werden, die Teil der Tür / des Tores sein sollen. Danach muss der "Fertig" Button gedrückt werden. Es können bis zu 16 Blöcke ausgewählt werden. Die entfernten Blöcke werden im Inventar des Controllers gespeichert. - - Über die Tasten "Entfernen" bzw. "Setzen" kann die Funktion des Controllers von Hand getestet werden. - -Wird ein `on` / `off` Kommando an den Tür Controller II gesendet, entfernt bzw. setzt er die Blöcke ebenfalls. - -Mit `$send_cmnd(node_number, "exchange", 2)` können einzelne Böcke gesetzt, entfernt, bzw. durch andere Blöcke aus dem Inventar ersetzt werden. - -Mit `$send_cmnd(node_number, "set", 2)` kann ein Block aus dem Inventory explizit gesetzt werden, sofern der Inventory Slot nicht leer ist. - -Mit `$send_cmnd(node_number, "dig", 2)` kann ein Block wieder entfernt werden, sofern der Inventory Slot leer ist. - -Mit `$send_cmnd(node_number, "get", 2)` wird der Name des gesetzten Blocks zurückgeliefert. - -Die Slot-Nummer des Inventars (1 .. 16) muss in allen drei Fällen als payload übergeben werden. - -Damit lassen sich auch ausfahrbare Treppen und ähnliches simulieren. - -[ta3_doorcontroller|image] - -### TA3 Sound Block - -Mir dem Sound Block können veschiedene Sounds/Laute abgespielt werden. Es sind alle Sounds der Mods Techage, Signs Bot, Hyperloop, Unified Inventory, TA4 Jetpack und Minetest Game verfügbar. - -Die Sounds können über das Menü und über ein Kommando ausgewählt und abgespielt werden. - -- Kommando `on` zum Abspielen eines Sounds -- Kommando `sound ` zur Auswahl eines Sounds über den Index -- Kommando `gain ` zum Einstellen der Lautstärke über den `` Wert (1 bis 5). - -[ta3_soundblock|image] - -### TA3 Mesecons Umsetzer / TA3 Mesecons Converter - -Der Mesecons Umsetzer dient zur Umwandlung von Techage on/off Kommandos in Mesecons Signale und umgekehrt. -Dazu müssen eine oder mehrere Knotennummern eingegeben und der Konverter mit Mesecons Blöcken -über Mesecons Leitungen verbunden werden. Den Mesecons Umsetzer kann man auch mit dem Programmer konfigurieren. -Der Mesecons Umsetzer akzeptiert bis zu 5 Kommandos pro Sekunde, bei höherer Belastung schaltet er sich ab. - -**Dieser Block existiert aber nur, wenn die Mod mesecons aktiv ist!** - -[ta3_mesecons_converter|image] - - -## Detektoren - -Detektoren scannen ihre Umgebung ab und senden ein `on`-Kommando, wenn das Gesuchte erkannt wurde. - -[ta3_nodedetector|image] - - -### TA3 Detektor / Detector - -Der Detektor ist eine spezieller Röhrenblock, der erkennt, wenn Items über die Röhre weitergegeben werden. Es muss dazu auf beiden Seiten mit der Röhre verbunden sein. Werden Items mit einem Schieber in den Detektor geschoben, gibt er diese automatisch weiter. -Er sendet ein `on`, wenn ein Item erkannt wird, gefolgt von einem `off` eine Sekunde später. -Danach werden weitere Kommando für 8 Sekunden blockiert. -Die Wartezeit, sowie die Items, die ein Kommando auslösen sollen, können über das Gabelschlüssel-Menü konfiguriert werden. - - -[ta3_detector|image] - - -### TA3 Wagen Detektor / Cart Detector - -Der Wagen Detektor sendet ein `on`-Kommando, wenn er einen Wagen/Cart (Minecart) direkt vor sich erkannt hat. Zusätzlich kann der Detektor auch den Wagen wieder starten, wenn ein `on`-Kommando empfangen wird. - -Der Detektor kann auch mit seiner eigenen Nummer programmiert werden. In diesem Falle schiebt er alle Wagen an, die in seiner Nähe (ein Block in alle Richtungen) zum Halten kommen. - -[ta3_cartdetector|image] - - -### TA3 Block Detektor / Node Detector - -Der Block Detektor sendet ein `on`-Kommando, wenn er erkennt, dass Blöcke vor ihm erscheinen oder verschwinden, muss jedoch entsprechend konfiguriert werden. Nach dem Zurückschalten des Detektors in den Standardzustand (grauer Block) wird ein `off`-Kommando gesendet. Gültige Blöcke sind alle Arten von Blöcken und Pflanzen, aber keine Tiere oder Spieler. Die Sensorreichweite beträgt 3 Blöcke/Meter in Pfeilrichtung. - -[ta3_nodedetector|image] - - -### TA3 Spieler Detektor / Player Detector - -Der Spieler Detektor sendet ein `on`-Kommando, wenn er einen Spieler in einem Umkreis von 4 m um den Block herum erkennt. Verlässt der Spieler wieder den Bereich, wird ein `off`-Kommando gesendet. -Soll die Suche auf bestimmte Spieler eingegrenzt werden, so können diese Spielernamen auch eingegeben werden. - -[ta3_playerdetector|image] - - -### TA3 Lichtdetektor - -Der Lichtdetektor sendet einen `on`-Kommando, wenn der Lichtpegel des darüber liegenden Blocks einen bestimmten Pegel überschreitet, der über das Rechtsklickmenü eingestellt werden kann. -Mit einen TA4 Lua Controller kann die genaue Lichtstärke mit $get_cmd(num, 'light_level') ermitteln werden. - -[ta3_lightdetector|image] - - -## TA3 Maschinen - -Bei TA3 existieren die gleichen Maschinen wie bei TA2, nur sind diese hier leistungsfähiger und benötigen Strom statt Achsenantrieb. -Im folgenden sind daher nur die unterschiedlichen, technischen Daten angegeben. - -[ta3_grinder|image] - - -### TA3 Schieber / Pusher - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 6 Items alle 2 s. - -[ta3_pusher|image] - - -### TA3 Verteiler / Distributor - -Die Funktion des TA3 Verteilers entspricht der von TA2. -Die Verarbeitungsleistung beträgt 12 Items alle 4 s. - -[ta3_distributor|image] - - -### TA3 Autocrafter - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Autocrafter benötigt hierfür 6 ku Strom. - -[ta3_autocrafter|image] - - -### TA3 Elektronikfabrik / Electronic Fab - -Die Funktion entspricht der von TA2, nur werden hier TA4 WLAN Chips produziert. -Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierfür 12 ku Strom. - -[ta3_electronicfab|image] - - -### TA3 Steinbrecher / Quarry - -Die Funktion entspricht der von TA2. -Die maximale Tiefe beträgt 40 Meter. Der Steinbrecher benötigt 12 ku Strom. - -[ta3_quarry|image] - - -### TA3 Kiessieb / Gravel Sieve - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 4 ku Strom. - -[ta3_gravelsieve|image] - - -### TA3 Kieswaschanlage / Gravel Rinser - -Die Funktion entspricht der von TA2. -Auch die Wahrscheinlichkeit ist wie bei TA2. Der Block benötigt auch 3 ku Strom. -Aber im Gegensatz zu TA2 kann beim TA3 Block bspw. der Status abgefragt werden (Controller) - -[ta3_gravelrinser|image] - - -### TA3 Mühle / Grinder - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 6 ku Strom. - -[ta3_grinder|image] - -### TA3 Injektor / Injector - -Der Injektor ist ein TA3 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter, Industrieofen und Elektronikfabrik). - -Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert. - -Der Injektor kann auch auf "Ziehe-Modus" umgeschaltet werden. Dann zieht er nur Items von den Positionen aus der Kiste, die in der Konfiguration des Injektors definiert sind. Hier müssen also Item-Typ und Position überein stimmen. Damit können geziehlt Speicherplätze im Inventar einer Kiste geleert werden. - -Die Verarbeitungsleistung beträgt bis zu 8 mal ein Item alle 4 Sekunden. - -[ta3_injector|image] - - - - -## Werkzeuge - -### Techage Info Tool - -Das Techage Info Tool (Schraubenschlüssel) hat verschiedene Funktionen. Er zeigt die Uhrzeit, die Position, die Temperatur und das Biome an, wenn auf einen unbekannten Block geklickt wird. -Wird auf einen TechAge Block mit Kommandoschnittstelle geklickt, werden alle verfügbaren Daten abgerufen (siehe auch "Logik-/Schalt-Blöcke"). - -Mit Shift+Rechtsklick kann bei einigen Blöcken ein erweitertes Menü geöffnet werden. Hier lassen sich je nach Block weitere Daten abrufen oder spezielle Einstellungen vornehmen. Bei einem Generator kann bspw. die Ladekurve/abschaltung programmiert werden. - -[ta3_end_wrench|image] - - -### TechAge Programmer - -Mit dem Programmer können Blocknummern mit einem Rechtsklick von mehreren Blöcken eingesammelt und mit einem Linksklick in einen Block wie Taster/Schalter geschrieben werden. -Wird in die Luft geklickt, wird der interne Speicher gelöscht. - -[ta3_programmer|image] - -### TechAge Kelle / Trowel - -Die Kelle dient zum Verputzen von Stromkabel. Siehe dazu "TA Stromkabel". - -[ta3_trowel|image] - - -### TA3 Bohrgestängezange / TA3 Drill Pipe Wrench - -Mit diesem Werkzeug lassen sich die Bohrgestängezange Blöcke wieder entfernen, wenn dort bspw. ein Tunnel durch soll. - -[ta3_drill_pipe_wrench|image] - -### Techage Schraubendreher / Screwdriver - -Der Techage Schraubendreher dient als Ersatz für den normalen Schraubendreher. Es besitzt folgende Funktionen: - -- Linksklick: Den Block nach links drehen -- Rechtsklick: Die sichtbare Seite des Blockes nach oben drehen -- Shift+Linksklick: Ausrichtung des angeklickten Blockes speichern -- Shift+Rechtsklick: Die gespeicherte Ausrichtung auf den angeklickten Block anwenden - -[ta3_screwdriver|image] - -### TechAge Montagewerkzeug / Assembly Tool - -Das TechAge Montagewerkzeug dient zum Entfernen und wieder Setzen von Techage Blöcken, ohne dass diese Blöcke ihre Blocknummer verlieren, bzw. beim Setzen eine neue Nummer zugeteilt bekommen. Dies ist bspw. bei Steinbrechern hilfreich, da diese oft umgesetzt werden müssen. - -- Linke Taste: Entfernen eines Blocks -- Rechte Taste: Setzen eines Blocks - -Der Block, der zuvor mit dem Montagewerkzeug entfernt wurde und wieder gesetzt werden soll, muss sich im Spieler-Inventar ganz links befinden. - -[techage:assembly_tool|image] \ No newline at end of file diff --git a/techage/manuals/manual_ta3_EN.md b/techage/manuals/manual_ta3_EN.md deleted file mode 100644 index ba82fdc..0000000 --- a/techage/manuals/manual_ta3_EN.md +++ /dev/null @@ -1,904 +0,0 @@ -# TA3: Oil Age - -At TA3 it is important to replace the steam-powered machines with more powerful and electric-powered machines. - -To do this, you have to build coal-fired power plants and generators. You will soon see that your electricity needs can only be met with oil-powered power plants. So you go looking for oil. Drilling derricks and oil pumps help them get the oil. Railways are used to transport oil to the power plants. - -The industrial age is at its peak. - -[techage_ta3|image] - - -## Coal-fired Power Station / Oil-fired Power Station - -The coal-fired power plant consists of several blocks and must be assembled as shown in the plan on the right. The blocks TA3 power station fire box, TA3 boiler top, TA3 boiler base, TA3 turbine, TA3 generator and TA3 cooler are required. - -The boiler must be filled with water. Fill up to 10 buckets of water in the boiler. -The fire box must be filled with coal or charcoal. -When the water is hot, the generator can then be started. - -Alternatively, the power plant can be equipped with an oil burner and then operated with oil. -The oil can be refilled using a pump and oil pipe. - -The power plant delivers an output of 80 ku. - -[coalpowerstation|plan] - - -### TA3 power station firebox - -Part of the power plant. -The fire box must be filled with coal or charcoal. The burning time depends on the power that is requested by the power plant. Coal burns for 20 s and charcoal for 60 s under full load. Correspondingly longer under partial load (50% load = double time). - -[ta3_firebox|image] - - -### TA3 Power Station Oil Burner - -Part of the power plant. - -The oil burner can be filled with crude oil, fuel oil, naphtha or gasoline. The burning time depends on the power that is requested by the power plant. Under full load, crude oil burns 15 s, fuel oil 20 s, naphtha 22 s and gasoline 25 s. - -Correspondingly longer under partial load (50% load = double time). - -The oil burner can only hold 50 units of fuel. An additional oil tank and an oil pump are therefore advisable. - - -[ta3_oilbox|image] - - -### TA3 boiler base / top - -Part of the power plant. Must be filled with water. If there is no more water or the temperature drops too low, the power plant switches off. - -The water consumption of the TA3 boiler is much lower than that of the steam engine due to the closed steam circuit. -With the steam engine, some water is lost as steam with each piston stroke. - -[ta3_boiler|image] - - -### TA3 turbine - -The turbine is part of the power plant. It must be placed next to the generator and connected to the boiler and cooler via steam pipes as shown in the plan. - -[ta3_turbine|image] - - -### TA3 generator - -The generator is used to generate electricity. It must be connected to the machines via power cables and junction boxes. - -[ta3_generator|image] - - -### TA3 cooler - -Used to cool the hot steam from the turbine. Must be connected to the boiler and turbine via steam pipes as shown in the plan. - -[ta3_cooler|image] - - -## Electrical current - -In TA3 (and TA4) the machines are powered by electricity. To do this, machines, storage systems, and generators must be connected with power cables. -TA3 has 2 types of power cables: - -- Insulated cables (TA power cables) for local wiring in the floor or in buildings. These cables can be hidden in the wall or in the floor (can be "plastered" with the trowel). -- Overland lines (TA power line) for outdoor cabling over long distances. These cables are protected and cannot be removed by other players. - -Several consumers, storage systems, and generators can be operated together in a power network. Networks can be set up with the help of the junction boxes. -If too little electricity is provided, consumers run out. -In this context, it is also important that the functionality of Forceload blocks is understood, because generators, for example, only supply electricity when the corresponding map block is loaded. This can be enforced with a forceload block. - -In TA4 there is also a cable for the solar system. - - -[ta3_powerswitch|image] - - -### Importance of storage systems - -Storage systems in the power grid fulfill two tasks: - -- To cope with peaks in demand: All generators always deliver just as much power as is needed. However, if consumers are switched on/off or there are fluctuations in demand for other reasons, consumers can fail for a short time. To prevent this, there should always be at least one battery block in every network. This serves as a buffer and compensates for these fluctuations in the seconds range. -- To store regenerative energy: Solar and wind are not available 24 hours a day. So that the power supply does not fail when no electricity is produced, one or more storage systems must be installed in the network. Alternatively, the gaps can also be bridged with oil/coal electricity. - -A storage system indicates its capacity in kud, i.e. ku per day. For example, a storage system with 100 kud delivers 100 ku for one game day, or 10 ku for 10 game days. - -All TA3/TA4 energy sources have adjustable charging characteristics. By default this is set to "80% - 100%". This means that when the storage system is 80% full, the output is reduced further and further until it switches off completely at 100%. If electricity is required in the network, 100% will never be reached, since the power of the generator has at some point dropped to the electricity demand in the network and the storage system is no longer charged, but only the consumers are served. - -This has several advantages: - -- The charging characteristics are adjustable. This means, for example, that oil/coal energy sources can be reduced at 60% and regenerative energy sources only at 80%. This means that oil/coal is only burned if there are not enough renewable energy sources available. -- Several energy sources can be operated in parallel and are loaded almost evenly, because all energy sources work, for example, up to 80% of the storage system's charging capacity at their full capacity and then reduce their capacity at the same time. -- All storage systems in a network form a large buffer. The charging capacity and the filling level of the entire storage system can always be read in percent on every storage system, but also on the electricity terminal. - -[power_reduction|image] - - - -### TA Electric Cable - -For local wiring in the floor or in buildings. -Branches can be realized using junction boxes. The maximum cable length between machines or junction boxes is 1000 m. A maximum of 1000 nodes can be connected in a power network. All blocks with power connection, including junction boxes, count as nodes. - -Since the power cables are not automatically protected, the land lines (TA power line) are recommended for longer distances. - -Power cables can be plastered with the trowel so they can be hidden in the wall or in the floor. All stone, clay and other blocks without "intelligence" can be used as plastering material. Dirt does not work because dirt can be converted to grass or the like, which would destroy the line. - -For plastering, the cable must be clicked on with the trowel. The material with which the cable is to be plastered must be on the far left in the player inventory. -The cables can be made visible again by clicking on the block with the trowel. - -In addition to cables, the TA junction box and the TA power switch box can also be plastered. - -[ta3_powercable|image] - - -### TA Electric Junction Box - -With the junction box, electricity can be distributed in up to 6 directions. Junction boxes can also be plastered (hidden) with a trowel and made visible again. - -[ta3_powerjunction|image] - - -### TA Power Line - -With the TA power line and the electricity poles, reasonably realistic overhead lines can be realized. The power pole heads also serve to protect the power line (protection). A pole must be set every 16 m or less. The protection only applies to the power line and the poles, however, all other blocks in this area are not protected. - -[ta3_powerline|image] - - -### TA Power Pole -Used to build electricity poles. Is protected from destruction by the electricity pole head and can only be removed by the owner. - -[ta3_powerpole|image] - - -### TA Power Pole Top -Has up to four arms and thus allows electricity to be distributed in up to 6 directions. -The electricity pole head protects power lines and poles within a radius of 8 m. - -[ta3_powerpole4|image] - - -### TA Power Pole Top 2 - -This electricity pole head has two fixed arms and is used for the overhead lines. However, it can also transmit current downwards and upwards. -The electricity pole head protects power lines and poles within a radius of 8 m. - -[ta3_powerpole2|image] - - -### TA Power Switch - -The switch can be used to switch the power on and off. To do this, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides. - -[ta3_powerswitch|image] - - -### TA Power Switch Small - -The switch can be used to switch the power on and off. To do this, the switch must be placed on a power switch box. The power switch box must be connected to the power cable on both sides. - -[ta3_powerswitchsmall|image] - - -### TA Power Switch Box - -see TA power switch. - -[ta3_powerswitchbox|image] - - -### TA3 Small Power Generator - -The small power generator runs on gasoline and can be used for small consumers with up to 12 ku. Gasoline burns for 150 s under full load. Correspondingly longer under partial load (50% load = double time). - -The power generator can only hold 50 units of gasoline. An additional tank and a pump are therefore advisable. - - -[ta3_tinygenerator|image] - - -### TA3 Accu Block - -The accu block (rechargeable battery) is used to store excess energy and automatically delivers power in the event of a power failure (if available). -Several accu blocks together form a TA3 energy storage system. Each accu block has a display for the charging state and for the stored load. -The values for the entire network are always displayed here. The stored load is displayed in "kud" or "ku-days" (analogous to kWh) 5 kud thus corresponds, for example, to 5 ku for a game day (20 min) or 1 ku for 5 game days. - -A accu block has 3.33 kud - -[ta3_akkublock|image] - - -### TA3 Power Terminal - -The power terminal must be connected to the power grid. It shows data from the power grid. - -The most important figures are displayed in the upper half: - -- current/maximum generator power -- current power consumption of all consumers -- current charging current in/from the storage system -- Current state of charge of the storage system in percent - -The number of network blocks is output in the lower half. - -Additional data on the generators and storage systems can be queried via the "console" tab. - -[ta3_powerterminal|image] - - -### TA3 Electric Motor - -The TA3 Electric Motor is required in order to be able to operate TA2 machines via the power grid. The TA3 Electric Motor converts electricity into axle power. -If the electric motor is not supplied with sufficient power, it goes into an fault state and must be reactivated with a right-click. - -The electric motor takes max. 40 ku of electricity and provides on the other side max. 39 ku as axle power. So he consumes one ku for the conversion. - -[ta3_motor|image] - - - - -## TA3 Industrial Furnace - -The TA3 industrial furnace serves as a supplement to normal furnaces. This means that all goods can be produced with "cooking" recipes, even in an industrial furnace. But there are also special recipes that can only be made in an industrial furnace. -The industrial furnace has its own menu for recipe selection. Depending on the goods in the industrial furnace inventory on the left, the output product can be selected on the right. - -The industrial furnace requires electricity (for the booster) and fuel oil / gasoline for the burner. The industrial furnace must be assembled as shown in the plan on the right. - -See also TA4 heater. - -[ta3_furnace|plan] - - -### TA3 Furnace Oil Burner - -Is part of the TA3 industrial furnace. - -The oil burner can be operated with crude oil, fuel oil, naphtha or gasoline. The burning time is 64 s for crude oil, 80 s for fuel oil, 90 s for naphtha and 100 s for gasoline. - -The oil burner can only hold 50 units of fuel. An additional tank and a pump are therefore advisable. - -[ta3_furnacefirebox|image] - - -### TA3 Furnace Top - -Is part of the TA3 industrial furnace. See TA3 industrial furnace. - -[ta3_furnace|image] - - -### TA3 Booster - -Is part of the TA3 industrial furnace. See TA3 industrial furnace. - -[ta3_booster|image] - - -## Liquids - -Liquids such as water or oil can only be pumped through the special pipes and stored in tanks. As with water, there are containers (canisters, barrels) in which the liquid can be stored and transported. - -It is also possible to connect several tanks using the yellow pipes and connectors. However, the tanks must have the same content and there must always be at least one yellow pipe between the tank, pump and distributor pipe. - -E.g. It is not possible to connect two tanks directly to a distributor pipe. - -The liquid filler is used to transfer liquids from containers to tanks. The plan shows how canisters or barrels with liquids are pushed into a liquid filler via pushers. The container is emptied in the liquid filler and the liquid is led down into the tank. - -The liquid filler can also be placed under a tank to empty the tank. - -[ta3_tank|plan] - - -### TA3 Tank - -Liquids can be stored in a tank. A tank can be filled or emptied using a pump. To do this, the pump must be connected to the tank via a pipe (yellow pipes). - -A tank can also be filled or emptied manually by clicking on the tank with a full or empty liquid container (barrel, canister). It should be noted that barrels can only be completely filled or emptied. If, for example, there are less than 10 units in the tank, this remainder must be removed with canisters or pumped empty. - -A TA3 tank can hold 1000 units or 100 barrels of liquid. - -[ta3_tank|image] - - -### TA3 Pump - -The pump can be used to pump liquids from tanks or containers to other tanks or containers. The pump direction (arrow) must be observed for the pump. The yellow lines and connectors also make it possible to arrange several tanks on each side of the pump. However, the tanks must have the same content. - -The TA3 pump pumps 4 units of liquid every two seconds. - -Note 1: The pump must not be placed directly next to the tank. There must always be at least a piece of yellow pipe between them. - -[ta3_pump|image] - - -### TA Liquid Filler - -The liquid filler is used to transfer liquids between containers and tanks. - -- If the liquid filler is placed under a tank and empty barrels are put into the liquid filler with a pusher or by hand, the contents of the tank are transferred to the barrels and the barrels can be removed from the outlet -- If the liquid filler is placed on a tank and if full containers are put into the liquid filler with a pusher or by hand, the content is transferred to the tank and the empty containers can be removed on the exit side - -It should be noted that barrels can only be completely filled or emptied. If, for example, there are less than 10 units in the tank, this remainder must be removed with canisters or pumped empty. - -[ta3_filler|image] - -### TA4 Pipe - -The yellow pipes are used for the transmission of gas and liquids. -The maximum pipe length is 100 m. - -[ta3_pipe|image] - -### TA3 Pipe Wall Entry Blocks - -The blocks serve as wall openings for tubes, so that no holes remain open. - -[ta3_pipe_wall_entry|image] - -### TA Valve - -There is a valve for the yellow pipes, which can be opened and closed with a click of the mouse. -The valve can also be controlled via on/off commands. - -[ta3_valve|image] - - -## Oil Production - -In order to run your generators and stoves with oil, you must first look for oil and build a derrick and then extract the oil. -TA3 oil explorer, TA3 oil drilling box and TA3 pump jack are used for this. - -[techage_ta3|image] - - -### TA3 Oil Explorer - -You can search for oil with the oil explorer. To do this, place the block on the floor and right-click to start the search. The oil explorer can be used above ground and underground at all depths. -The chat output shows you the depth to which oil was searched and how much oil (petroleum) was found. -You can click the block multiple times to search for oil in deeper areas. Oil fields range in size from 4,000 to 20,000 items. - -If the search was unsuccessful, you have to move the block approx. 16 m further. -The oil explorer always searches for oil in the whole map block and below, in which it was set. A new search in the same map block (16x16 field) therefore makes no sense. - -If oil is found, the location for the derrick is displayed. You have to erect the derrick within the area shown, it is best to mark the spot with a sign and protect the entire area against foreign players. - -Don't give up looking for oil too quickly. If you're unlucky, it can take a long time to find an oil well. -It also makes no sense to search an area that another player has already searched. The chance of finding oil anywhere is the same for all players. - -The oil explorer can always be used to search for oil. - -[ta3_oilexplorer|image] - - -### TA3 Oil Drill Box - -The oil drill box must be placed in the position indicated by the oil explorer. Drilling for oil elsewhere is pointless. -If the button on the oil drilling box is clicked, the derrick is erected above the box. This takes a few seconds. -The oil drilling box has 4 sides, at IN the drill pipe has to be delivered via pusher and at OUT the drilling material has to be removed. The oil drilling box must be supplied with power via one of the other two sides. - -The oil drilling box drills to the oil field (1 meter in 16 s) and requires 16 ku of electricity. -Once the oil field has been reached, the derrick can be dismantled and the box removed. - -[ta3_drillbox|image] - - -### TA3 Oil Pumpjack - -The oil pump (pump-jack) must now be placed in the place of the oil drilling box. The oil pump also requires electricity (16 ku) and supplies one unit of oil every 8 s. The oil must be collected in a tank. To do this, the oil pump must be connected to the tank via yellow pipes. -Once all the oil has been pumped out, the oil pump can also be removed. - -[ta3_pumpjack|image] - - -### TA3 Drill Pipe - -The drill pipe is required for drilling. As many drill pipe items are required as the depth specified for the oil field. The drill pipe is useless after drilling, but it also cannot be dismantled and remains in the ground. However, there is a tool to remove the drill pipe blocks (-> Tools -> TA3 drill pipe pliers). - -[ta3_drillbit|image] - - -### Oil tank - -The oil tank is the large version of the TA3 tank (see liquids -> TA3 tank). - -The large tank can hold 4000 units of oil, but also any other type of liquid. - -[oiltank|image] - - - -## Oil Transportation - -### Oil transportation by Tank Carts - -Tank carts can be used to transport oil from the oil well to the oil processing plant. A tank cart can be filled or emptied directly using pumps. In both cases, the yellow pipes must be connected to the tank cart from above. - -The following steps are necessary: - -- Place the tank cart in front of the rail bumper block. The bumper block must not yet be programmed with a time so that the tank cart does not start automatically -- Connect the tank cart to the pump using yellow pipes -- Switch on the pump -- Program the bumper with a time (10 - 20 s) - -This sequence must be observed on both sides (fill / empty). - -[tank_cart | image] - -### Oil transportation with barrels over Minecarts - -Canisters and barrels can be loaded into the Minecarts. To do this, the oil must first be transferred to barrels. The oil barrels can be pushed directly into the Minecart with a pusher and tubes (see map). The empty barrels, which come back from the unloading station by Minecart, can be unloaded using a hopper, which is placed under the rail at the stop. - -It is not possible with the hopper to both **unload the empty barrels and load the full barrels at a stop**. The hopper immediately unloads the full barrels. It is therefore advisable to set up 2 stations on the loading and unloading side and then program the Minecart accordingly using a recording run. - -The plan shows how the oil can be pumped into a tank and filled into barrels via a liquid filler and loaded into Minecarts. - -For the Minecarts to start again automatically, the bumper blocks must be configured with the station name and waiting time. 5 s are sufficient for unloading. However, since the pushers always go into standby for several seconds when there is no Minecart, a time of 15 or more seconds must be entered for loading. - -[ta3_loading|plan] - -### Tank Cart - -The tank truck is used to transport liquids. Like tanks, it can be filled with pumps or emptied. In both cases, the yellow tube must be connected to the tank truck from above. - -200 units fit in the tank truck. - -[tank_cart | image] - -### Chest Cart - -The chest cart is used to transport items. Like chests, it can be filled or emptied using a pusher. - -4 stacks fit in the chest cart. - -[chest_cart | image] - - -## Oil Processing - -Oil is a mixture of substances and consists of many components. The oil can be broken down into its main components such as bitumen, fuel oil, naphtha, gasoline and propane gas via a distillation tower. -Further processing to end products takes place in the chemical reactor. - -[techage_ta31|image] - - -### Distillation Tower - -The distillation tower must be set up as in the plan at the top right. -The bitumen is drained off via the base block. The exit is on the back of the base block (note the direction of the arrow). -The "distillation tower" blocks with the numbers: 1, 2, 3, 2, 3, 2, 3, 4 are placed on this basic block -Fuel oil, naphtha and gasoline are drained from the openings from bottom to top. The propane gas is caught at the top. -All openings on the tower must be connected to tanks. -The reboiler must be connected to the "distillation tower 1" block. - -The reboiler needs electricity (not shown in the plan)! - - -[ta3_distiller|plan] - -#### Reboiler - -The reboiler heats the oil to approx. 400 ° C. It largely evaporates and is fed into the distillation tower for cooling. - -The reboiler requires 14 units of electricity and produces one unit of bitumen, fuel oil, naphtha, gasoline and propane every 16 s. -To do this, the reboiler must be supplied with oil via a pump. - -[reboiler|image] - - -## Logic / Switching Blocks - -In addition to the tubes for goods transport, as well as the gas and power pipes, there is also a wireless communication level through which blocks can exchange data with each other. No lines have to be drawn for this, the connection between transmitter and receiver is only made via the block number. - -**Info:** A block number is a unique number that is generated by Techage when many Techage blocks are placed. The block number is used for addressing during communication between Techage controllers and machines. All blocks that can participate in this communication show the block number as info text if you fix the block with the mouse cursor. - -Which commands a block supports can be read out and displayed with the TechAge Info Tool (wrench). -The simplest commands supported by almost all blocks are: - -- `on` - to turn on block / machine / lamp -- `off` - to turn off the block / machine / lamp - -With the help of the TA3 Terminal, these commands can be tried out very easily. Suppose a signal lamp is number 123. -Then with: - - cmd 123 on - -the lamp can be turned on and with: - - cmd 123 off - -the lamp can be turned off again. These commands must be entered in the input field of the TA3 terminal. - -Commands such as `on` and` off` are sent to the recipient without a response coming back. These commands can therefore be sent to several receivers at the same time, for example with a push button / switch, if several numbers are entered in the input field. - -A command like `state` requests the status of a block. The block then sends its status back. This type of confirmed command can only be sent to one recipient at a time. -This command can also be tested with the TA3 terminal on a pusher, for example: - - cmd 123 state - -Possible responses from the pusher are: -- `running` -> I'm working -- `stopped` -> switched off -- `standby` -> nothing to do because source inventory is empty -- `blocked` -> can't do anything because target inventory is full - -This status and other information is also output when the wrench is clicked on the block. - -[ta3_logic|image] - - -### TA3 Button / Switch -The button/switch sends `on` / `off` commands to the blocks that have been configured via the numbers. -The button/switch can be configured as a button or a switch. If it is configured as a button, the time between the `on` and `off` commands can be set. With the operating mode "on button" only an `on` and no `off` command is sent. - -The checkbox "public" can be used to set whether the button can be used by everyone (set) or only by the owner himself (not set). - -Note: With the programmer, block numbers can be easily collected and configured. - -[ta3_button|image] - -### TA3 Command Converter - -With the TA3 command converter, `on` / `off` commands can be converted into other commands, and forwarding can be prevented or delayed. -The number of the target block or the numbers of the target blocks, the commands to be sent and the delay times in seconds must be entered. If no command is entered, nothing is sent. - -The numbers can also be programmed using the Techage programmer. - -[ta3_command_converter|image] - -### TA3 Flip-Flop - -The TA3 flip-flop changes its state with each received `on` command. Received `off` commands are ignored. Depending on the status change, `on` / `off` commands are sent alternately. The number of the target block or the numbers of the target blocks must be entered. The numbers can also be programmed using the Techage programmer. - -For example, lamps can be switched on and off with the help of buttons. - -[ta3_flipflop|image] - -### TA3 Logic Block - -The TA3 logic block can be programmed in such a way that one or more input commands are linked to one output command and sent. This block can therefore replace various logic elements such as AND, OR, NOT, XOR etc. -Input commands for the logic block are `on` /` off` commands. -Input commands are referenced via the number, e.g. `1234` for the command from the sender with the number 1234. -The same applies to output commands. - -A rule is structured as follows: - -``` - = on/off if is true -``` - -`` is the block number to which the command should be sent. -`` is a boolean expression where input numbers are evaluated. - - - -**Examples for the input expression** - -Negate signal (NOT): - - 1234 == off - -Logical AND: - - 1234 == on and 2345 == on - -Logical OR: - - 1234 == on or 2345 == on - -The following operators are allowed: `and` `or` `on` `off` `me` `==` `~=` `(` `)` - -If the expression is true, a command is sent to the block with the `` number. -Up to four rules can be defined, whereby all rules are always checked when a command is received. -The internal processing time for all commands is 100 ms. - -Your own node number can be referenced using the keyword `me`. This makes it possible for the block to send itself a command (flip-flop function). - -The blocking time defines a pause after a command, during which the logic block does not accept any further external commands. Commands received during the blocking period are thus discarded. The blocking time can be defined in seconds. - -[ta3_logic|image] - - -### TA3 Repeater - -The repeater sends the received signal to all configured numbers. -This can make sense, for example, if you want to control many blocks at the same time. The repeater can be configured with the programmer, which is not possible with all blocks. - -[ta3_repeater|image] - - -### TA3 Sequencer - -The sequencer can send a series of `on` / `off` commands, whereby the interval between the commands must be specified in seconds. You can use it to make a lamp blink, for example. -Up to 8 commands can be configured, each with target block number and pending the next command. -The sequencer repeats the commands endlessly when "Run endless" is set. -If nothing is selected, only the specified time in seconds is waited for. - -[ta3_sequencer|image] - - -### TA3 Timer - -The timer can send commands time-controlled. The time, the target number(s) and the command itself can be specified for each command line. This means that lamps can be switched on in the evening and switched off again in the morning. - -[ta3_timer|image] - - -### TA3 Terminal - -The terminal is primarily used to test the command interface of other blocks (see "Logic / switching blocks"). -You can also assign commands to keys and use the terminal productively. - - set - -With `set 1 ON cmd 123 on`, for example, user key 1 can be programmed with the command `cmd 123 on`. If the key is pressed, the command is sent and the response is output on the screen. - -The terminal has the following local commands: -- `clear` clear screen -- `help` output a help page -- `pub` switch to public mode -- `priv` switch to private mode - -In private mode, the terminal can only be used by players who can build at this location, i.e. who have protection rights. - -In public mode, all players can use the preconfigured keys. - -[ta3_terminal|image] - - -### TechAge Color Lamp - -The signal lamp can be switched on or off with the `on` / `off` command. This lamp does not need electricity and can be colored with the airbrush tool from the mod Unified Dyes" and via Lua/Beduino commands. - -With the chat command `/ta_color` the color palette with the values for the Lua/Beduino commands is displayed and with `/ta_send color ` the color can be changed. - -[ta3_colorlamp|image] - - -### Door/Gate Blocks - -With these blocks you can realize doors and gates that can be opened via commands (blocks disappear) and closed again. One door controller is required for each gate or door. - -The appearance of the blocks can be adjusted via the block menu. -This makes it possible to realize secret doors that only open for certain players (with the help of the player detector). - -[ta3_doorblock|image] - -### TA3 Door Controller - -The door controller is used to control the TA3 door/gate blocks. With the door controller, the numbers of the door/gate blocks must be entered. If an `on` / `off` command is sent to the door controller, this opens/closes the door or gate. - -[ta3_doorcontroller|image] - -### TA3 Door Controller II - -The Door Controller II can remove and set all types of blocks. To teach in the Door Controller II, the "Record" button must be pressed. Then all blocks that should be part of the door / gate must be clicked. Then the "Done" button must be pressed. Up to 16 blocks can be selected. The removed blocks are saved in the controller's inventory. The function of the controller can be tested manually using the "Remove" or "Set" buttons. If an `on` /`off` command is sent to the Door Controller II, it removes or sets the blocks as well. - -With `$send_cmnd(node_number, "exchange", 2)` individual blocks can be set, removed or replaced by other blocks from the inventory. - -With `$send_cmnd(node_number, "set", 2)` a block from the inventory can be set explicitly, as long as the inventory slot is not empty. - -A block can be removed again with `$send_cmnd(node_number, "dig", 2)` if the inventory slot is empty. - -The name of the set block is returned with `$send_cmnd(node_number, "get", 2)`. - -The slot number of the inventory (1 .. 16) must be passed as payload in all three cases. - -This can also be used to simulate extendable stairs and the like. - -[ta3_doorcontroller|image] - -### TA3 Sound Block - -Different sounds can be played with the sound block. All sounds of the Mods Techage, Signs Bot, Hyperloop, Unified Inventory, TA4 Jetpack and Minetest Game are available. - -The sounds can be selected and played via the menu and via command. - -- Command `on` to play a sound -- Command `sound ` to select a sound via the index -- Command `gain ` to adjust the volume via the `` value (1 to 5). - -[ta3_soundblock|image] - -### TA3 Mesecons Converter - -The Mesecons converter is used to convert Techage on/off commands into Mesecons signals and vice versa. -To do this, one or more node numbers must be entered and the converter with Mesecons blocks -has to be connected via Mesecons cables. The Mesecons converter can also be configured with the programmer. -The Mesecons converter accepts up to 5 commands per second; it switches itself off at higher loads. - -**This node only exists if the mod mesecons is active!** - -[ta3_mesecons_converter|image] - - - -## Detectors - -Detectors scan their surroundings and send an `on` command when the search is recognized. - -[ta3_nodedetector|image] - - -### TA3 Detector - -The detector is a special tube block that detects when items are passed on through the tube. To do this, it must be connected to tubes on both sides. If items are pushed into the detector with a pusher, they are automatically passed on. -It sends an `on` when an item is recognized, followed by an `off` a second later. -Then further commands are blocked for 8 seconds. -The waiting time and the items that should trigger a command can be configured using the open-ended wrench menu. - - -[ta3_detector|image] - - -### TA3 Cart Detector - -The cart detector sends an `on` command if it has recognized a cart (Minecart) directly in front of it. In addition, the detector can also restart the cart when an `on` command is received. - -The detector can also be programmed with its own number. In this case, he pushes all the wagons that stop near him (one block in all directions). - -[ta3_cartdetector|image] - - -### TA3 Node Detector - -The node detector sends an `on` command if it detects that nodes (blocks) appear or disappear in front of it, but must be configured accordingly. After switching the detector back to the standard state (gray block), an `off` command is sent. Valid blocks are all types of blocks and plants, but not animals or players. The sensor range is 3 blocks / meter in the direction of the arrow. - -[ta3_nodedetector|image] - - -### TA3 Player Detector - -The player detector sends an `on` command if it detects a player within 4 m of the block. If the player leaves the area again, an `off` command is sent. -If the search should be limited to specific players, these player names can also be entered. - -[ta3_playerdetector|image] - -### TA3 Light Detector - -The light detector sends an `on` command if the light level of the block above exceeds a certain level, which can be set through the right-click menu. -If you have a TA4 Lua Controller, you can get the exact light level with $get_cmd(num, 'light_level') - -[ta3_lightdetector|image] - -## TA3 Machines - -TA3 has the same machines as TA2, only these are more powerful and require electricity instead of axis drive. -Therefore, only the different technical data are given below. - -[ta3_grinder|image] - - -### TA3 Pusher - -The function corresponds to that of TA2. -The processing power is 6 items every 2 s. - -[ta3_pusher|image] - - -### TA3 Distributor - -The function of the TA3 distributor corresponds to that of TA2. -The processing power is 12 items every 4 s. - -[ta3_distributor|image] - - -### TA3 Autocrafter - -The function corresponds to that of TA2. -The processing power is 2 items every 4 s. The autocrafter requires 6 ku of electricity. - -[ta3_autocrafter|image] - - -### TA3 Electronic Fab - -The function corresponds to that of TA2, only TA4 WLAN chips are produced here. -The processing power is one chip every 6 s. The block requires 12 ku of electricity for this. - -[ta3_electronicfab|image] - - -### TA3 Quarry - -The function corresponds to that of TA2. -The maximum depth is 40 meters. The quarry requires 12 ku of electricity. - -[ta3_quarry|image] - - -### TA3 Gravel Sieve - -The function corresponds to that of TA2. -The processing power is 2 items every 4 s. The block requires 4 ku of electricity. - -[ta3_gravelsieve|image] - - -### TA3 Gravel Rinser - -The function corresponds to that of TA2. -The probability is also the same as for TA2. The block also requires 3 ku of electricity. -But in contrast to TA2, the status of the TA3 block can be read (controller) - -[ta3_gravelrinser|image] - - -### TA3 Grinder - -The function corresponds to that of TA2. -The processing power is 2 items every 4 s. The block requires 6 ku of electricity. - -[ta3_grinder|image] - -### TA3 Injector - -The injector is a TA3 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest to pass them on to machines with recipes (autocrafter, industrial furnace and electronic fab). - -When passing on, only one position in the inventory is used in the target machine. If, for example, only the first three entries are configured in the injector, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented. - -The injector can also be switched to "pull mode". Then he only pulls items out of the chest from the positions that are defined in the configuration of the injector. In this case, item type and position must match. This allows to empty specific inventory entries of a chest. - -The processing power is up to 8 times one item every 4 seconds. - -[ta3_injector|image] - - - -## Tools - -### Techage Info Tool - -The Techage Info Tool (open-ended wrench) has several functions. It shows the time, position, temperature and biome when an unknown block is clicked on. -If you click on a TechAge block with command interface, all available data will be shown (see also "Logic / switching blocks"). - -With Shift + right click an extended menu can be opened for some blocks. Depending on the block, further data can be called up or special settings can be made here. In the case of a generator, for example, the charging curve/switch-off can be programmed. - -[ta3_end_wrench|image] - -### TechAge Programmer - -With the programmer, block numbers can be collected from several blocks with a right click and written into a block like a button / switch with a left click. -If you click in the air, the internal memory is deleted. - -[ta3_programmer|image] - -### TechAge Trowel / Trowel - -The trowel is used for plastering power cables. See also "TA power cable". - -[ta3_trowel|image] - -### TA3 drill pipe wrench - -This tool can be used to remove the drill pipe blocks if, for example, a tunnel is to pass through there. - -[ta3_drill_pipe_wrench|image] - -### Techage Screwdriver - -The Techage Screwdriver serves as a replacement for the normal screwdriver. It has the following functions: - -- Left click: turn the block to the left -- Right click: turn the visible side of the block upwards -- Shift + left click: save the alignment of the clicked block -- Shift + right click: apply the saved alignment to the clicked block - -[ta3_screwdriver|image] - -### TechAge Assembly Tool - -The TechAge Assembly Tool is used to remove and reposition Techage blocks without these blocks losing their block number or being assigned a new number when setting. This is helpful, for example, for quarries, as they often have to be moved. - -- Left button: Remove a block -- Right button: Set a block - -The block that was previously removed with the assembly tool and is to be placed again must be on the far left of the player inventory. - -[techage:assembly_tool|image] - diff --git a/techage/manuals/manual_ta3_pt-BR.md b/techage/manuals/manual_ta3_pt-BR.md deleted file mode 100644 index e4d2851..0000000 --- a/techage/manuals/manual_ta3_pt-BR.md +++ /dev/null @@ -1,890 +0,0 @@ -# TA3: Era do Petróleo - -Na TA3, é importante substituir as máquinas a vapor por máquinas mais potentes movidas a eletricidade. - -Para fazer isso, é necessário construir usinas termelétricas a carvão e geradores. Logo você perceberá que suas necessidades de eletricidade só podem ser atendidas com usinas movidas a óleo. Portanto, você parte em busca de petróleo. Torres de perfuração e bombas de petróleo ajudam a extrair o óleo. Ferrovias são usadas para transportar o óleo até as usinas. - -A era industrial está em seu auge. - -[techage_ta3|image] - -## Usina Termelétrica a Carvão / Usina Termelétrica a Óleo - -A usina termelétrica a carvão é composta por vários blocos e deve ser montada conforme mostrado no plano à direita. São necessários os blocos Fornalha(Firebox) TA3, Topo da Caldeira TA3, Base da Caldeira TA3, Turbina TA3, Gerador TA3 e Resfriador TA3. - -A caldeira deve ser preenchida com água. Encha até 10 baldes de água na caldeira. -A caixa de fogo deve ser preenchida com carvão ou carvão vegetal. -Quando a água estiver quente, o gerador pode ser iniciado. - -Alternativamente, a usina pode ser equipada com um queimador de óleo e operada com óleo. O óleo pode ser reabastecido usando uma bomba e um tubo de óleo. - -A usina fornece uma saída de 80 ku. - -[coalpowerstation|plan] - -### TA3 Fornalha(firebox) da estação de energia - -Parte da usina de energia. -A fornalha deve ser preenchida com carvão ou carvão vegetal. O tempo de queima depende da potência solicitada pela usina. Carvão queima por 20s e carvão vegetal por 60s em carga total. Proporcionalmente mais tempo em carga parcial (50% de carga = dobro do tempo). - -[ta3_firebox|image] - -### TA3 Queimador de Óleo da Usina de Energia - -Parte da usina de energia. - -O queimador de óleo pode ser preenchido com óleo cru, óleo combustível, nafta ou gasolina. O tempo de queima depende da potência solicitada pela usina. Em carga total, óleo cru queima por 15s, óleo combustível por 20s, nafta por 22s e gasolina por 25s. - -Proporcionalmente mais tempo em carga parcial (50% de carga = dobro do tempo). - -O queimador de óleo pode armazenar apenas 50 unidades de combustível. Recomenda-se, portanto, um tanque de óleo adicional e uma bomba de óleo. - - -[ta3_oilbox|image] - -### TA3 Base / Topo da Caldeira - -Parte da usina de energia. Deve ser preenchida com água. Se não houver mais água ou a temperatura diminuir muito, a usina desliga. - -O consumo de água da caldeira TA3 é muito menor do que o da máquina a vapor devido ao circuito de vapor fechado. -Com a máquina a vapor, parte da água é perdida como vapor a cada curso do pistão. - -[ta3_boiler|image] - - -### TA3 Turbina - -A turbina faz parte da usina de energia. Deve ser colocada ao lado do gerador e conectada à caldeira e ao resfriador por meio de tubos de vapor, conforme mostrado no plano. - -[ta3_turbine|image] - -### TA3 Gerador - -O gerador é usado para gerar eletricidade. Deve ser conectado às máquinas por meio de cabos de energia e caixas de junção. - -[ta3_generator|image] - - -### TA3 Cooler - -Usado para resfriar o vapor quente da turbina. Deve ser conectado à caldeira e à turbina por meio de tubos de vapor, conforme mostrado no plano. - -[ta3_cooler|image] - -## Corrente elétrica - -Em TA3 (e TA4), as máquinas são alimentadas por eletricidade. Para isso, máquinas, sistemas de armazenamento e geradores devem ser conectados com cabos de energia. -TA3 possui 2 tipos de cabos de energia: - -- Cabos isolados (cabos de energia TA) para instalação local no chão ou em edifícios. Esses cabos podem ser ocultos na parede ou no chão (podem ser "revestidos" com a colher de pedreiro). -- Linhas aéreas (linha de energia TA) para cabeamento externo em longas distâncias. Esses cabos são protegidos e não podem ser removidos por outros jogadores. - -Vários consumidores, sistemas de armazenamento e geradores podem ser operados juntos em uma rede de energia. Redes podem ser configuradas com a ajuda das caixas de junção. -Se houver pouca eletricidade fornecida, os consumidores ficam sem energia. -Nesse contexto, também é importante entender a funcionalidade dos blocos de Forceload, porque os geradores, por exemplo, só fornecem eletricidade quando o bloco de mapa correspondente está carregado. Isso pode ser imposto com um bloco de Forceload. - -Em TA4, também existe um cabo para o sistema solar. - -[ta3_powerswitch|image] - -### Importância dos sistemas de armazenamento - -Os sistemas de armazenamento na rede elétrica desempenham duas funções: - -- Lidar com picos de demanda: Todos os geradores sempre fornecem exatamente a quantidade de energia necessária. No entanto, se os consumidores forem ligados/desligados ou houver flutuações na demanda por outros motivos, os consumidores podem falhar por um curto período. Para evitar isso, deve sempre haver pelo menos um bloco de bateria em cada rede. Isso serve como um buffer e compensa essas flutuações na faixa de segundos. -- Armazenar energia regenerativa: Solar e eólica não estão disponíveis 24 horas por dia. Para que o fornecimento de energia não falhe quando não há produção de eletricidade, um ou mais sistemas de armazenamento devem ser instalados na rede. Alternativamente, as lacunas também podem ser preenchidas com eletricidade de óleo/carvão. - -Um sistema de armazenamento indica sua capacidade em kud, ou seja, ku por dia. Por exemplo, um sistema de armazenamento com 100 kud fornece 100 ku por um dia de jogo, ou 10 ku por 10 dias de jogo. - -Todas as fontes de energia TA3/TA4 têm características de carregamento ajustáveis. Por padrão, isso é configurado para "80% - 100%". Isso significa que, quando o sistema de armazenamento estiver 80% cheio, a saída é reduzida cada vez mais até desligar completamente em 100%. Se eletricidade for necessária na rede, nunca se atingirá 100%, pois a potência do gerador em algum momento caiu para a demanda de eletricidade na rede e o sistema de armazenamento não está mais sendo carregado, mas apenas os consumidores estão sendo atendidos. - -Isso tem várias vantagens: - -- As características de carregamento são ajustáveis. Isso significa, por exemplo, que as fontes de energia de óleo/carvão podem ser reduzidas em 60% e as fontes de energia renovável apenas em 80%. Isso significa que o óleo/carvão só é queimado se não houver energia renovável suficiente disponível. -- Várias fontes de energia podem ser operadas em paralelo e são carregadas quase uniformemente, porque todas as fontes de energia trabalham, por exemplo, até 80% da capacidade de carga do sistema de armazenamento em sua capacidade total e depois reduzem sua capacidade ao mesmo tempo. -- Todos os sistemas de armazenamento em uma rede formam um grande buffer. A capacidade de carga e o nível de preenchimento de todo o sistema de armazenamento podem sempre ser lidos em percentagem em todos os sistemas de armazenamento, mas também no terminal de eletricidade. - -[power_reduction|image] - -### TA3 Cabo Elétrico - -Para fiação local no chão ou em construções. -Ramos podem ser realizados usando caixas de junção. O comprimento máximo do cabo entre máquinas ou caixas de junção é de 1000 m. Um máximo de 1000 nós pode ser conectado em uma rede elétrica. Todos os blocos com conexão elétrica, incluindo caixas de junção, contam como nós. - -Como os cabos elétricos não são automaticamente protegidos, as linhas aéreas (TA power line) são recomendadas para distâncias mais longas. - -Os cabos elétricos podem ser rebocados com a colher de alvenaria para que fiquem ocultos na parede ou no chão. Todos os blocos de pedra, argila e outros blocos sem "inteligência" podem ser usados como material de reboco. A sujeira não funciona porque pode ser convertida em grama ou algo semelhante, o que destruiria a linha. - -Para rebocar, o cabo deve ser clicado com a colher de alvenaria. O material com o qual o cabo deve ser rebocado deve estar no canto mais à esquerda do inventário do jogador. -Os cabos podem ser tornados visíveis novamente clicando no bloco com a colher de alvenaria. - -Além dos cabos, a caixa de junção TA e a caixa de interruptores de energia TA também podem ser rebocadas. - -[ta3_powercable|image] - -### TA Caixa de Junção Elétrica - -Com a caixa de junção, a eletricidade pode ser distribuída em até 6 direções. Caixas de junção também podem ser rebocadas (ocultas) com uma colher de alvenaria e tornadas visíveis novamente. - -[ta3_powerjunction|image] - -### TA Linha de Energia - -Com a linha de energia TA e os postes de eletricidade, é possível realizar linhas aéreas razoavelmente realistas. As cabeças dos postes também servem para proteger a linha de energia (proteção). Um poste deve ser colocado a cada 16 m ou menos. A proteção se aplica apenas à linha de energia e aos postes; no entanto, todos os outros blocos nesta área não estão protegidos. - -[ta3_powerline|image] - -### TA Poste de Energia -Usado para construir postes de eletricidade. É protegido contra destruição pela cabeça do poste de eletricidade e só pode ser removido pelo proprietário. - -[ta3_powerpole|image] - -### TA Topo do Poste de Energia -Possui até quatro braços e permite assim a distribuição de eletricidade em até 6 direções. -A cabeça do poste de eletricidade protege as linhas de energia e os postes dentro de um raio de 8 m. - -[ta3_powerpole4|image] - -### TA Topo do Poste de Energia 2 - -Esta cabeça de poste de eletricidade tem dois braços fixos e é usada para as linhas aéreas. No entanto, também pode transmitir corrente para baixo e para cima. -A cabeça do poste de eletricidade protege as linhas de energia e os postes dentro de um raio de 8 m. - -[ta3_powerpole2|image] - -### TA Interruptor de Energia - -O interruptor pode ser usado para ligar e desligar a energia. Para isso, o interruptor deve ser colocado em uma caixa de interruptor de energia. A caixa de interruptor de energia deve ser conectada ao cabo de energia em ambos os lados. - -[ta3_powerswitch|image] - -### TA Interruptor de Energia Pequeno - -O interruptor pode ser usado para ligar e desligar a energia. Para isso, o interruptor deve ser colocado em uma caixa de interruptor de energia. A caixa de interruptor de energia deve ser conectada ao cabo de energia em ambos os lados. - -[ta3_powerswitchsmall|image] - -### TA Caixa de Interruptor de Energia - -Veja o interruptor de energia TA. - -[ta3_powerswitchbox|image] - -### TA3 Pequeno Gerador de Energia - -O pequeno gerador de energia funciona com gasolina e pode ser usado para consumidores pequenos com até 12 ku. A gasolina queima por 150s em carga total. Correspondentemente mais tempo em carga parcial (50% de carga = tempo duplo). - -O gerador de energia só pode armazenar 50 unidades de gasolina. Portanto, é aconselhável um tanque adicional e uma bomba. - -[ta3_tinygenerator|image] - -### TA3 Bloco Acumulador - -O bloco acumulador (bateria recarregável) é usado para armazenar energia excedente e fornece automaticamente energia em caso de queda de energia (se disponível). -Vários blocos de acumulador juntos formam um sistema de armazenamento de energia TA3. Cada bloco de acumulador possui um display para o estado de carga e para a carga armazenada. -Os valores para toda a rede são sempre exibidos aqui. A carga armazenada é exibida em "kud" ou "ku-dias" (análogo a kWh). Assim, 5 kud correspondem, por exemplo, a 5 ku para um dia de jogo (20 minutos) ou 1 ku para 5 dias de jogo. - -Um bloco de acumulador tem 3,33 kud. - -[ta3_akkublock|image] - -### TA3 Terminal de Energia - -O terminal de energia deve ser conectado à rede elétrica. Ele exibe dados da rede elétrica. - -As informações mais importantes são exibidas na metade superior: - -- potência do gerador atual/máxima -- consumo de energia atual de todos os consumidores -- corrente de carga atual dentro/fora do sistema de armazenamento -- Estado de carga atual do sistema de armazenamento em percentual - -O número de blocos da rede é exibido na metade inferior. - -Dados adicionais sobre os geradores e sistemas de armazenamento podem ser consultados através da guia "console". - -[ta3_powerterminal|image] - -### TA3 Motor Elétrico - -O Motor Elétrico TA3 é necessário para operar as máquinas TA2 através da rede elétrica. O Motor Elétrico TA3 converte eletricidade em potência de eixo. -Se o motor elétrico não for alimentado com energia suficiente, ele entra em um estado de falha e deve ser reativado com um clique direito. - -O motor elétrico consome no máximo 40 ku de eletricidade e fornece do outro lado no máximo 39 ku como potência de eixo. Portanto, ele consome um ku para a conversão. - -[ta3_motor|image] - - -## TA3 Forno Industrial - -O forno industrial TA3 serve como complemento aos fornos normais. Isso significa que todos os produtos podem ser fabricados com receitas de "cozimento", mesmo em um forno industrial. No entanto, também existem receitas especiais que só podem ser feitas em um forno industrial. -O forno industrial possui seu próprio menu para seleção de receitas. Dependendo dos produtos no inventário do forno industrial à esquerda, o produto de saída pode ser selecionado à direita. - -O forno industrial requer eletricidade (para o impulsionador) e óleo combustível/gasolina para o queimador. O forno industrial deve ser montado conforme mostrado no plano à direita. - -Veja também o aquecedor TA4. - -[ta3_furnace|plan] - -### TA3 Forno - Queimador de Óleo - -Parte do forno industrial TA3. - -O queimador de óleo pode ser operado com óleo bruto, óleo combustível, nafta ou gasolina. O tempo de queima é de 64 s para óleo bruto, 80 s para óleo combustível, 90 s para nafta e 100 s para gasolina. - -O queimador de óleo pode armazenar apenas 50 unidades de combustível. Portanto, é aconselhável um tanque adicional e uma bomba. - -[ta3_furnacefirebox|image] - -### TA3 Forno - Parte Superior - -Faz parte do forno industrial TA3. Consulte o forno industrial TA3. - -[ta3_furnace|image] - -### TA3 Reforço - -Faz parte do forno industrial TA3. Consulte o forno industrial TA3. - -[ta3_booster|image] - - -## Líquidos - -Líquidos como água ou óleo só podem ser bombeados através de tubulações especiais e armazenados em tanques. Assim como com a água, existem recipientes (latas, barris) nos quais o líquido pode ser armazenado e transportado. - -Também é possível conectar vários tanques usando as tubulações amarelas e conectores. No entanto, os tanques devem ter o mesmo conteúdo e sempre deve haver pelo menos um tubo amarelo entre o tanque, a bomba e o tubo distribuidor. - -Por exemplo, não é possível conectar dois tanques diretamente a um tubo distribuidor. - -O enchimento de líquidos é usado para transferir líquidos de recipientes para tanques. O plano mostra como latas ou barris com líquidos são empurrados para um enchimento de líquidos através de empurradores. O recipiente é esvaziado no enchimento de líquidos e o líquido é conduzido para baixo no tanque. - -O enchimento de líquidos também pode ser colocado sob um tanque para esvaziar o tanque. - -[ta3_tank|plan] - -### TA3 Tanque - -Líquidos podem ser armazenados em um tanque. Um tanque pode ser preenchido ou esvaziado usando uma bomba. Para fazer isso, a bomba deve ser conectada ao tanque por meio de um tubo (tubos amarelos). - -Um tanque também pode ser preenchido ou esvaziado manualmente clicando no tanque com um recipiente de líquido cheio ou vazio (barril, galão). Deve-se observar que os barris só podem ser completamente preenchidos ou esvaziados. Se, por exemplo, houver menos de 10 unidades no tanque, esse restante deve ser removido com galões ou esvaziado com uma bomba. - -Um tanque TA3 pode armazenar 1000 unidades ou 100 barris de líquido. - -[ta3_tank|image] - -### TA3 Bomba - -A bomba pode ser usada para bombear líquidos de tanques ou recipientes para outros tanques ou recipientes. A direção da bomba (seta) deve ser observada. As linhas amarelas e os conectores também permitem organizar vários tanques em cada lado da bomba. No entanto, os tanques devem ter o mesmo conteúdo. - -A bomba TA3 bombeia 4 unidades de líquido a cada dois segundos. - -Observação 1: A bomba não deve ser colocada diretamente ao lado do tanque. Deve sempre haver pelo menos um pedaço de tubo amarelo entre eles. - -[ta3_pump|image] - -### TA Liquid Filler - -O liquid filler é usado para transferir líquidos entre recipientes e tanques. - -- Se o liquid filler for colocado sob um tanque e barris vazios forem colocados no liquid filler com um empurrador ou manualmente, o conteúdo do tanque é transferido para os barris e os barris podem ser removidos da saída -- Se o liquid filler for colocado em cima de um tanque e se recipientes cheios forem colocados no liquid filler com um empurrador ou manualmente, o conteúdo é transferido para o tanque e os recipientes vazios podem ser removidos no lado de saída - -Deve-se observar que os barris só podem ser completamente cheios ou esvaziados. Se, por exemplo, houver menos de 10 unidades no tanque, este restante deve ser removido com recipientes ou bombeado vazio. - -[ta3_filler|image] - -### TA4 Tubos(pipe) - -Os tubos amarelos são usados para a transmissão de gás e líquidos. -O comprimento máximo do tubo é 100m. - -[ta3_pipe|image] - -### TA3 Tubos de parede (entre-blocos) - -Os blocos servem como aberturas de parede para os tubos, para que não fiquem buracos abertos. - -[ta3_pipe_wall_entry|image] - -### TA Válvula - -Existe uma válvula para os tubos amarelos, que pode ser aberta e fechada com um clique do mouse. -A válvula também pode ser controlada por comandos ligar/desligar. - -[ta3_valve|image] - - -## Produção de Óleo - -Para alimentar seus geradores e fogões com óleo, você deve primeiro procurar óleo e construir uma torre de perfuração para extrair o óleo. -Para isso, são utilizados o explorador de óleo TA3, a caixa de perfuração de óleo TA3 e o macaco de bomba de óleo TA3. - -[techage_ta3|image] - -### TA3 Explorador de petróleo - -Você pode procurar petróleo com o explorador de petróleo. Para fazer isso, coloque o bloco no chão e clique com o botão direito para iniciar a busca. O explorador de petróleo pode ser usado tanto acima quanto abaixo do solo em todas as profundidades. -A saída do chat mostra a profundidade até a qual o petróleo foi procurado e quanto petróleo foi encontrado. -Você pode clicar várias vezes no bloco para procurar petróleo em áreas mais profundas. Os campos de petróleo variam em tamanho de 4.000 a 20.000 itens. - -Se a busca não der certo, você deve mover o bloco aproximadamente 16 m para frente. -O explorador de petróleo sempre procura petróleo em todo o bloco do mapa e abaixo, no qual foi colocado. Uma nova busca no mesmo bloco do mapa (campo 16x16) portanto, não faz sentido. - -Se o petróleo for encontrado, a localização para a torre de perfuração é exibida. Você precisa erguer a torre de perfuração dentro da área mostrada, é melhor marcar o local com uma placa e proteger toda a área contra jogadores estrangeiros. - -Não desista de procurar petróleo muito rapidamente. Se tiver azar, pode levar muito tempo para encontrar um poço de petróleo. -Também não faz sentido procurar em uma área que outro jogador já tenha procurado. A chance de encontrar petróleo é a mesma para todos os jogadores. - -O explorador de petróleo pode ser sempre usado para procurar petróleo. - -[ta3_oilexplorer|image] - -### TA3 Caixa de perfuração de petróleo - -A caixa de perfuração de petróleo deve ser colocada na posição indicada pelo explorador de petróleo. Perfurar petróleo em outro lugar não tem sentido. -Se o botão na caixa de perfuração de petróleo for clicado, a torre de perfuração será erguida acima da caixa. Isso leva alguns segundos. -A caixa de perfuração de petróleo tem 4 lados, em IN o tubo de perfuração deve ser entregue via pusher e em OUT o material de perfuração deve ser removido. A caixa de perfuração de petróleo deve ser alimentada com eletricidade por um dos outros dois lados. - -A caixa de perfuração de petróleo perfura até o campo de petróleo (1 metro em 16 s) e requer 16 ku de eletricidade. -Depois que o campo de petróleo for alcançado, a torre de perfuração pode ser desmontada e a caixa removida. - -[ta3_drillbox|image] - -### TA3 Bomba de petróleo - -A bomba de petróleo (pumpjack) deve ser colocada no lugar da caixa de perfuração de petróleo. A bomba de petróleo também requer eletricidade (16 ku) e fornece uma unidade de petróleo a cada 8 segundos. O petróleo deve ser coletado em um tanque. Para fazer isso, a bomba de petróleo deve ser conectada ao tanque por meio de tubos amarelos. -Depois que todo o petróleo for bombeado para fora, a bomba de petróleo também pode ser removida. - -[ta3_pumpjack|image] - -### TA3 Haste de perfuração - -A haste de perfuração é necessária para perfurar. Tantos itens de haste de perfuração são necessários quanto a profundidade especificada para o campo de petróleo. A haste de perfuração é inútil após a perfuração, mas também não pode ser desmontada e permanece no solo. No entanto, há uma ferramenta para remover os blocos de haste de perfuração (-> Ferramentas -> TA3 Alicate de haste de perfuração(drill pipe pliers)). - -[ta3_drillbit|image] - -### Tanque de petróleo - -O tanque de petróleo é a versão grande do tanque TA3 (ver líquidos -> Tanque TA3). - -O tanque grande pode armazenar 4000 unidades de petróleo, mas também qualquer outro tipo de líquido. - -[oiltank|image] - - -## Transporte de Petróleo - -### Transporte de Petróleo por Vagões Tanque - -Os vagões tanque podem ser usados para transportar petróleo do poço de petróleo para a usina de processamento de petróleo. Um vagão tanque pode ser preenchido ou esvaziado diretamente usando bombas. Em ambos os casos, os tubos amarelos devem ser conectados ao vagão tanque de cima. - -Os seguintes passos são necessários: - -- Coloque o vagão tanque na frente do bloco para-choque da ferrovia. O bloco para-choque ainda não deve estar programado com um tempo para que o vagão tanque não comece automaticamente. -- Conecte o vagão tanque à bomba usando tubos amarelos. -- Ligue a bomba. -- Programe o para-choque com um tempo (10 - 20s). - -Essa sequência deve ser observada em ambos os lados (encher / esvaziar). - -[tank_cart|image] - -### Oil transportation with barrels over Minecarts - -Canisters and barrels can be loaded into the Minecarts. To do this, the oil must first be transferred to barrels. The oil barrels can be pushed directly into the Minecart with a pusher and tubes (see map). The empty barrels, which come back from the unloading station by Minecart, can be unloaded using a hopper, which is placed under the rail at the stop. - -It is not possible with the hopper to both **unload the empty barrels and load the full barrels at a stop**. The hopper immediately unloads the full barrels. It is therefore advisable to set up 2 stations on the loading and unloading side and then program the Minecart accordingly using a recording run. - -The plan shows how the oil can be pumped into a tank and filled into barrels via a liquid filler and loaded into Minecarts. - -For the Minecarts to start again automatically, the bumper blocks must be configured with the station name and waiting time. 5 s are sufficient for unloading. However, since the pushers always go into standby for several seconds when there is no Minecart, a time of 15 or more seconds must be entered for loading. - -[ta3_loading|plan] - -### Transporte de Petróleo com Barris por Minecarts - -As latas e barris podem ser carregados nos Minecarts. Para fazer isso, o petróleo deve primeiro ser transferido para os barris. Os barris de petróleo podem ser empurrados diretamente para dentro do Minecart com um empurrador e tubos (veja o mapa). Os barris vazios, que retornam da estação de descarga por Minecart, podem ser descarregados usando um funil, que é colocado sob os trilhos na parada. - -Não é possível com o funil **descarregar os barris vazios e carregar os barris cheios em uma parada**. O funil descarrega imediatamente os barris cheios. Portanto, é aconselhável configurar 2 estações no lado de carregamento e descarregamento e, em seguida, programar o Minecart de acordo com uma corrida de gravação. - -O plano mostra como o petróleo pode ser bombeado para um tanque, preenchido em barris via um dispositivo de enchimento de líquidos e carregado em Minecarts. - -Para que os Minecarts reiniciem automaticamente, os blocos para-choque devem ser configurados com o nome da estação e o tempo de espera. 5 segundos são suficientes para descarregar. No entanto, como os empurradores sempre entram em espera por vários segundos quando não há Minecart, um tempo de 15 segundos ou mais deve ser inserido para carregar. - -[ta3_loading|plan] - -### Carrinho-tanque - -O carrinho-tanque é usado para transportar líquidos. Assim como os tanques, ele pode ser cheio com bombas ou esvaziado. Em ambos os casos, o tubo amarelo deve ser conectado ao caminhão-tanque de cima. - -Cabem 200 unidades no caminhão-tanque. - -[tank_cart|image] - -### Carrinho-baú - -O carrinho-baú é usado para transportar itens. Assim como os baús, ele pode ser cheio ou esvaziado usando um empurrador. - -Cabem 4 pilhas no carrinho de baú. - -[chest_cart|image] - - -## Processamento de Petróleo - -O petróleo é uma mistura de substâncias e consiste em muitos componentes. O petróleo pode ser decomposto em seus principais componentes, como betume, óleo combustível, nafta, gasolina e gás propano, por meio de uma torre de destilação. -O processamento adicional para produtos finais ocorre no reator químico. - -[techage_ta31|image] - -### Torre de Destilação - -A torre de destilação deve ser montada como no plano no canto superior direito. -O betume é drenado pelo bloco de base. A saída está na parte de trás do bloco de base (observe a direção da seta). -Os blocos "torre de destilação" com os números: 1, 2, 3, 2, 3, 2, 3, 4 são colocados sobre este bloco base. -Óleo combustível, nafta e gasolina são drenados das aberturas de baixo para cima. O gás propano é capturado no topo. -Todas as aberturas na torre devem ser conectadas a tanques. -O reboiler deve ser conectado ao bloco "torre de destilação 1". - -O reboiler precisa de eletricidade (não mostrado no plano)! - -[ta3_distiller|plan] - -#### Refervedor(Reboiler) - -O reboiler aquece o petróleo para aproximadamente 400 °C. Ele evapora em grande parte e é alimentado na torre de destilação para resfriamento. - -O reboiler requer 14 unidades de eletricidade e produz uma unidade de betume, óleo combustível, nafta, gasolina e propano a cada 16s. -Para isso, o reboiler deve ser alimentado com petróleo por meio de uma bomba. - -[reboiler|image] - - -## Blocos Lógicos / de Comutação - -Além dos tubos para transporte de mercadorias, bem como os tubos de gás e energia, há também um nível de comunicação sem fio através do qual os blocos podem trocar dados entre si. Não é necessário desenhar linhas para isso, a conexão entre transmissor e receptor é feita apenas através do número do bloco. - -**Info:** Um número de bloco é um número único gerado pelo Techage quando muitos blocos do Techage são colocados. O número do bloco é usado para endereçamento durante a comunicação entre controladores e máquinas Techage. Todos os blocos que podem participar dessa comunicação mostram o número do bloco como texto de informações se você fixar o bloco com o cursor do mouse. - -Quais comandos um bloco suporta podem ser lidos e exibidos com a TechAge Info Tool (chave inglesa ou wrench). -Os comandos mais simples suportados por quase todos os blocos são: - -- `on` - para ligar o bloco / máquina / lâmpada -- `off` - para desligar o bloco / máquina / lâmpada - -Com a ajuda do Terminal TA3, esses comandos podem ser testados muito facilmente. Suponha que uma lâmpada de sinalização seja o número 123. -Então com: - - cmd 123 on - -a lâmpada pode ser ligada e com: - - cmd 123 off - -a lâmpada pode ser desligada novamente. Esses comandos devem ser inseridos no campo de entrada do terminal TA3. - -Comandos como `on` e `off` são enviados ao destinatário sem que uma resposta seja enviada de volta. Portanto, esses comandos podem ser enviados para vários destinatários ao mesmo tempo, por exemplo, com um botão de pressão / interruptor, se vários números forem inseridos no campo de entrada. - -Um comando como `state` solicita o status de um bloco. O bloco então envia seu status de volta. Esse tipo de comando confirmado só pode ser enviado para um destinatário de cada vez. -Esse comando também pode ser testado com o terminal TA3 em um empurrador, por exemplo: - - cmd 123 state - -As respostas possíveis do empurrador são: -- `running` -> Estou funcionando -- `stopped` -> desligado -- `standby` -> nada a fazer porque o inventário da fonte está vazio -- `blocked` -> não pode fazer nada porque o inventário de destino está cheio - -Esse status e outras informações também são exibidos quando a chave inglesa(wrench) é clicada no bloco. - -[ta3_logic|image] - -### TA3 Botão / Interruptor -O botão/interruptor envia comandos `on` / `off` para os blocos que foram configurados através dos números. -O botão/interruptor pode ser configurado como um botão ou um interruptor. Se for configurado como um botão, o tempo entre os comandos `on` e `off` pode ser definido. Com o modo de operação "no botão", apenas um comando `on` e nenhum comando `off` é enviado. - -A caixa de seleção "público" pode ser usada para definir se o botão pode ser usado por todos (marcado) ou apenas pelo próprio proprietário (não marcado). - -Nota: Com o programador, os números dos blocos podem ser facilmente coletados e configurados. - -[ta3_button|image] - -### TA3 Conversor de Comandos - -Com o conversor de comandos TA3, os comandos `on` / `off` podem ser convertidos em outros comandos, e o encaminhamento pode ser impedido ou atrasado. -Deve-se inserir o número do bloco de destino ou os números dos blocos de destino, os comandos a serem enviados e os tempos de atraso em segundos. Se nenhum comando for inserido, nada será enviado. - -Os números também podem ser programados usando o programador Techage(programmer). - -[ta3_command_converter|image] - -### TA3 Flip-Flop - -O flip-flop TA3 muda de estado a cada comando `on` recebido. Os comandos `off` recebidos são ignorados. Dependendo da alteração de status, os comandos `on` / `off` são enviados alternadamente. Deve-se inserir o número do bloco de destino ou os números dos blocos de destino. Os números também podem ser programados usando o programador Techage. - -Por exemplo, lâmpadas podem ser ligadas e desligadas com a ajuda de botões. - -[ta3_flipflop|image] - -### Bloco Lógico TA3 - -O bloco lógico TA3 pode ser programado de forma que um ou mais comandos de entrada estejam vinculados a um comando de saída e sejam enviados. Este bloco pode, portanto, substituir vários elementos lógicos, como AND, OR, NOT, XOR, etc. -Os comandos de entrada para o bloco lógico são comandos `ligar` / `desligar`. -Os comandos de entrada são referenciados pelo número, por exemplo, `1234` para o comando do remetente com o número 1234. -O mesmo se aplica aos comandos de saída. - -Uma regra é estruturada da seguinte forma: - -``` - = on/off if is true -``` - -`` é o número do bloco para o qual o comando deve ser enviado. -`` é uma expressão booleana onde os números de entrada são avaliados. - -**Exemplos para a expressão de entrada** - -Negar sinal (NOT): - - 1234 == off - -AND lógico: - - 1234 == on e 2345 == on - -OR lógico: - - 1234 == ligar ou 2345 == ligar - -Os seguintes operadores são permitidos: `and` `or` `on` `off` `me` `==` `~=` `(` `)` - -Se a expressão for verdadeira, um comando é enviado para o bloco com o número ``. -Até quatro regras podem ser definidas, sendo que todas as regras são sempre verificadas quando um comando é recebido. -O tempo interno de processamento para todos os comandos é de 100 ms. - -Seu próprio número de nó pode ser referenciado usando a palavra-chave `me`. Isso permite que o bloco envie a si mesmo um comando (função flip-flop). - -O tempo de bloqueio define uma pausa após um comando, durante a qual o bloco lógico não aceita mais comandos externos. Comandos recebidos durante o período de bloqueio são descartados. O tempo de bloqueio pode ser definido em segundos. - -[ta3_logic|image] - -### TA3 Repetidor - -O repetidor envia o sinal recebido para todos os números configurados. -Isso pode fazer sentido, por exemplo, se você quiser controlar muitos blocos ao mesmo tempo. O repetidor pode ser configurado com o programador, o que não é possível com todos os blocos. - -[ta3_repeater|image] - -### TA3 Sequenciador - -O sequenciador pode enviar uma série de comandos `on` / `off`, em que o intervalo entre os comandos deve ser especificado em segundos. Você pode usá-lo para fazer uma lâmpada piscar, por exemplo. -Até 8 comandos podem ser configurados, cada um com número de bloco de destino e aguardando o próximo comando. -O sequenciador repete os comandos indefinidamente quando "Run endless" está ativado. -Se nada for selecionado, apenas o tempo especificado em segundos é aguardado. - -[ta3_sequencer|image] - -### TA3 Temporizador - -O temporizador pode enviar comandos controlados pelo tempo. O horário, o(s) número(s) de destino e o comando em si podem ser especificados para cada linha de comando. Isso significa que as lâmpadas podem ser ligadas à noite e desligadas pela manhã. - -[ta3_timer|image] - -### TA3 Terminal - -O terminal é usado principalmente para testar a interface de comando de outros blocos (veja "Blocos lógicos / de comutação"). -Você também pode atribuir comandos a teclas e usar o terminal de maneira produtiva. - - set - -Com `set 1 ON cmd 123 on`, por exemplo, a tecla do usuário 1 pode ser programada com o comando `cmd 123 on`. Se a tecla for pressionada, o comando é enviado e a resposta é exibida na tela. - -O terminal possui os seguintes comandos locais: -- `clear` limpa a tela -- `help` exibe uma página de ajuda -- `pub` alterna para o modo público -- `priv` alterna para o modo privado - -No modo privado, o terminal só pode ser usado por jogadores que podem construir neste local, ou seja, que têm direitos de proteção. - -No modo público, todos os jogadores podem usar as teclas preconfiguradas. - -[ta3_terminal|image] - - -### Lâmpada Colorida TechAge - -A lâmpada de sinalização pode ser ligada ou desligada com o comando `on` / `off`. Esta lâmpada não precisa de eletricidade e pode ser colorida com a ferramenta de aerografia do mod "Dyes Unificados" e via comandos Lua/Beduino. - -Com o comando de chat `/ta_color`, a paleta de cores com os valores para os comandos Lua/Beduino é exibida e com `/ta_send color ` a cor pode ser alterada. - -[ta3_colorlamp|image] - -### Blocos de Porta/Portão - -Com esses blocos, você pode criar portas e portões que podem ser abertos por meio de comandos (blocos desaparecem) e fechados novamente. Um controlador de porta é necessário para cada portão ou porta. - -A aparência dos blocos pode ser ajustada por meio do menu de blocos. -Isso permite a criação de portas secretas que só se abrem para certos jogadores (com a ajuda do detector de jogadores). - -[ta3_doorblock|image] - -### TA3 Controlador de Porta - -O controlador de porta é usado para controlar os blocos de porta/portão TA3. Com o controlador de porta, os números dos blocos de porta/portão devem ser inseridos. Se um comando `on` / `off` for enviado para o controlador de porta, isso abre/fecha a porta ou portão. - -[ta3_doorcontroller|image] - -### Controlador de Porta TA3 II - -O Controlador de Porta II pode remover e definir todos os tipos de blocos. Para ensinar ao Controlador de Porta II, o botão "Record" deve ser pressionado. Em seguida, todos os blocos que devem fazer parte da porta/portão devem ser clicados. Depois, o botão "Done" deve ser pressionado. Até 16 blocos podem ser selecionados. Os blocos removidos são salvos no inventário do controlador. A função do controlador pode ser testada manualmente usando os botões "Remove" ou "Set". Se um comando `on` /`off` for enviado para o Controlador de Porta II, ele remove ou define os blocos também. - -Com `$send_cmnd(número_do_nó, "exchange", 2)` blocos individuais podem ser definidos, removidos ou substituídos por outros blocos do inventário. - -Com `$send_cmnd(número_do_nó, "set", 2)` um bloco do inventário pode ser definido explicitamente, desde que o slot do inventário não esteja vazio. - -Um bloco pode ser removido novamente com `$send_cmnd(número_do_nó, "dig", 2)` se o slot do inventário estiver vazio. - -O nome do bloco definido é retornado com `$send_cmnd(número_do_nó, "get", 2)`. - -O número do slot do inventário (1 .. 16) deve ser passado como carga útil em todos os três casos. - -Isso também pode ser usado para simular escadas extensíveis e coisas do tipo. - -[ta3_doorcontroller|image] - -### TA3 Bloco de Som - -Diferentes sons podem ser reproduzidos com o bloco de som. Todos os sons dos Mods Techage, Signs Bot, Hyperloop, Unified Inventory, TA4 Jetpack e Minetest Game estão disponíveis. - -Os sons podem ser selecionados e reproduzidos pelo menu e via comando. - -- Comando `on` para reproduzir um som -- Comando `sound <índice>` para selecionar um som via o índice -- Comando `gain ` para ajustar o volume via o valor `` (1 a 5). - -[ta3_soundblock|image] - -### TA3 Conversor Mesecons - -O conversor Mesecons é utilizado para converter comandos de ligar/desligar do Techage em sinais Mesecons e vice-versa. -Para fazer isso, um ou mais números de nó devem ser inseridos e o conversor deve ser conectado a blocos Mesecons por meio de cabos Mesecons. O conversor Mesecons também pode ser configurado com o programador. -O conversor Mesecons aceita até 5 comandos por segundo; ele se desativa em cargas mais altas. - -**Este nó só existe se o mod mesecons estiver ativo!** - -[ta3_mesecons_converter|image] - - -## Detectores - -Os detectores escaneiam o ambiente e enviam um comando `on` quando a busca é reconhecida. - -[ta3_nodedetector|image] - - -### TA3 Detector - -O detector é um bloco de tubo especial que detecta quando itens passam pelo tubo. Para fazer isso, ele deve ser conectado a tubos dos dois lados. Se os itens forem empurrados para o detector com um empurrador(pusher), eles são passados automaticamente. -Ele envia um comando `on` quando um item é reconhecido, seguido por um `off` um segundo depois. -Em seguida, outros comandos são bloqueados por 8 segundos. -O tempo de espera e os itens que devem acionar um comando podem ser configurados usando o menu de chave inglesa(wrench). - -[ta3_detector|image] - -### TA3 Cart Detector - -O detector de carrinho envia um comando `on` se reconhecer um carrinho (Minecart) diretamente na frente dele. Além disso, o detector também pode reiniciar o carrinho quando recebe um comando `on`. - -O detector também pode ser programado com seu próprio número. Nesse caso, ele empurra todos os vagões que param perto dele (um bloco em todas as direções). - -[ta3_cartdetector|image] - - -### TA3 Node Detector - -O detector de nó envia um comando `on` se detectar que nós (blocos) aparecem ou desaparecem na frente dele, mas deve ser configurado de acordo. Após retornar o detector ao estado padrão (bloco cinza), um comando `off` é enviado. Blocos válidos são todos os tipos de blocos e plantas, mas não animais ou jogadores. O alcance do sensor é de 3 blocos por metro na direção da seta. - -[ta3_nodedetector|image] - -### TA3 Detector de jogador(Player detector) - -O detector de jogador envia um comando `on` se detectar um jogador dentro de 4m do bloco. Se o jogador sair da área, um comando `off` é enviado. -Se a pesquisa deve ser limitada a jogadores específicos, esses nomes de jogador também podem ser inseridos. - -[ta3_playerdetector|image] - -### TA3 Detector de luz(Light detector) - -O detector de luz envia um comando `on` se o nível de luz do bloco acima exceder um certo nível, que pode ser definido através do menu de clique direito. -Se você tiver um Controlador Lua TA4, pode obter o nível exato de luz com $get_cmd(num, 'light_level') - -[ta3_lightdetector|image] - - -## Máquinas TA3 - -TA3 possui as mesmas máquinas que o TA2, apenas estas são mais poderosas e requerem eletricidade em vez de movimento por eixo. -Portanto, abaixo são fornecidos apenas os dados técnicos diferentes. - -[ta3_grinder|image] - - -### TA3 Pusher - -A função corresponde à do TA2. -A capacidade de processamento é de 6 itens a cada 2 segundos. - -[ta3_pusher|image] - -### TA3 Distributor - -A função do Distribuidor TA3 corresponde à do TA2. -A capacidade de processamento é de 12 itens a cada 4 segundos. - -[ta3_distributor|image] - - -### TA3 Autocrafter - -A função corresponde à do TA2. -A capacidade de processamento é de 2 itens a cada 4 segundos. O autocrafter requer 6 ku de eletricidade. - -[ta3_autocrafter|image] - - -### TA3 Electronic Fab - -A função corresponde à do TA2, apenas os chips WLAN do TA4 são produzidos aqui. -A capacidade de processamento é de um chip a cada 6 segundos. O bloco requer 12 ku de eletricidade para isso. - -[ta3_electronicfab|image] - -### TA3 Quarry - -A função corresponde à do TA2. -A profundidade máxima é de 40 metros. A pedreira requer 12 ku de eletricidade. - -[ta3_quarry|image] - - -### TA3 Gravel Sieve - -A função corresponde à do TA2. -A capacidade de processamento é de 2 itens a cada 4 segundos. O bloco requer 4 ku de eletricidade. - -[ta3_gravelsieve|image] - - -### TA3 Gravel Rinser - -A função corresponde à do TA2. -A probabilidade também é a mesma que a do TA2. O bloco também requer 3 ku de eletricidade. -Mas, ao contrário do TA2, o status do bloco TA3 pode ser lido (controlador) - -[ta3_gravelrinser|image] - - -### TA3 Grinder - -A função corresponde à do TA2. -A capacidade de processamento é de 2 itens a cada 4 segundos. O bloco requer 6 ku de eletricidade. - -[ta3_grinder|image] - -### TA3 Injetor - -O injetor é um TA3 pusher com propriedades especiais. Ele possui um menu para configuração. Até 8 itens podem ser configurados aqui. Ele apenas pega esses itens de um baú para passá-los para as máquinas com receitas (autocrafter, forno industrial e electronic fab). - -Ao passar, apenas uma posição no inventário é usada na máquina de destino. Se, por exemplo, apenas as três primeiras entradas estiverem configuradas no injetor, apenas as três primeiras posições de armazenamento no inventário da máquina serão usadas. Isso evita o transbordamento no inventário da máquina. - -O injetor também pode ser alternado para o "modo pull". Então ele apenas retira itens do baú das posições que estão definidas na configuração do injetor. Nesse caso, o tipo e a posição do item devem corresponder. Isso permite esvaziar entradas específicas do inventário de um baú. - -A capacidade de processamento é de até 8 vezes um item a cada 4 segundos. - -[ta3_injector|image] - - -## Ferramentas - -### Techage Info Tool - -O Techage Info Tool (chave inglesa de ponta aberta) possui várias funções. Ele mostra a hora, posição, temperatura e bioma quando um bloco desconhecido é clicado. -Se você clicar em um bloco TechAge com interface de comando, todos os dados disponíveis serão mostrados (consulte também "Blocos lógicos / de comutação"). - -Com Shift + clique direito, um menu estendido pode ser aberto para alguns blocos. Dependendo do bloco, dados adicionais podem ser chamados ou configurações especiais podem ser feitas aqui. No caso de um gerador, por exemplo, a curva de carga/desligamento pode ser programada. - -[ta3_end_wrench|image] - -### TechAge Programmer (Programador) - -Com o programador, números de bloco podem ser coletados de vários blocos com um clique direito e gravados em um bloco como um botão / interruptor com um clique esquerdo. -Se você clicar no ar, a memória interna é apagada. - -[ta3_programmer|image] - -### TechAge Trowel / Trowel - -A colher de pedreiro é usada para revestir cabos de energia. Veja também "Cabo de energia TA". - -[ta3_trowel|image] - -### TA3 chave de cano - -Esta ferramenta pode ser usada para remover blocos de tubo se, por exemplo, um túnel precisar passar por lá. - -[ta3_drill_pipe_wrench|image] - -### Techage Screwdriver - -A chave de fenda Techage serve como substituto da chave de fenda normal. Ela possui as seguintes funções: - -- Clique esquerdo: girar o bloco para a esquerda -- Clique direito: girar a face visível do bloco para cima -- Shift + clique esquerdo: salvar o alinhamento do bloco clicado -- Shift + clique direito: aplicar o alinhamento salvo ao bloco clicado - -[ta3_screwdriver|image] - -### TechAge Assembly Tool - -A TechAge Assembly Tool é usada para remover e reposicionar blocos Techage sem que esses blocos percam seu número de bloco ou recebam um novo número ao serem configurados. Isso é útil, por exemplo, para pedreiras, já que muitas vezes precisam ser movidas. - -- Botão esquerdo: remover um bloco -- Botão direito: configurar um bloco - -O bloco que foi removido anteriormente com a ferramenta de montagem e que será colocado novamente deve estar no extremo esquerdo do inventário do jogador. - -[techage:assembly_tool|image] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/techage/manuals/manual_ta4_DE.md b/techage/manuals/manual_ta4_DE.md deleted file mode 100644 index 925ace8..0000000 --- a/techage/manuals/manual_ta4_DE.md +++ /dev/null @@ -1,1024 +0,0 @@ -# TA4: Gegenwart - -Regenerative Energiequellen wie Wind, Sonne und Biokraft helfen dir, das Ölzeitalter zu verlassen. Mit modernen Technologien und intelligenten Maschinen machst du dich auf in die Zukunft. - -[techage_ta4|image] - - -## Windkraftanlage - -Eine Windkraftanlage liefern immer dann Strom, wenn Wind vorhanden ist. Im Spiel gibt es keinen Wind, aber die Mod simuliert dies dadurch, dass sich nur morgens (5:00 - 9:00) und abends (17:00 - 21:00) die Windräder drehen. Eine Windkraftanlage liefert nur dann Strom, wenn sie an einer geeigneten Stelle aufgestellt ist. - -Die TA Windkraftanlagen sind reine Offshore Anlagen, das heißt, die müssen im Meer errichtet werden. Dies bedeutet, dass Windkraftanlagen nur in einem Meer (occean) Biom errichtet werden können und dass um den Mast herum ausreichend Wasser und freie Sicht vorhanden sein müssen. - -Um eine geeignete Stelle zu finden, musst du mit dem Schraubenschlüssel (TechAge Info Werkzeug) auf das Wasser klicken. Ob diese Stelle für den Mast der Windkraftanlage geeignet ist, wird dir als Chat Nachricht angezeigt. - -Der Strom muss vom Rotor-Block durch den Mast nach unten geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit TA4 Säulenblöcke "verputzen". Unten kann eine Arbeitsplattform errichtet werden. Der Plan rechts zeigt den Aufbau im oberen Teil. - -Die Windkraftanlage liefert eine Leistung von 70 ku, aber dies nur 8 Stunden am Tag (siehe oben). - -[ta4_windturbine|plan] - - -### TA4 Windkraftanlage / Wind Turbine - -Der Windkraftanlagenblock (Rotor) ist das Herzstück der Windkraftanlage. Dieser Block muss oben auf den Mast gesetzt werden. Idealerweise auf Y = 15, dann bleibst du noch gerade innerhalb eines Map-/Forceload-Blocks. -Beim Starten der Windkraftanlage werden alle Bedingungen für den Betrieb der Windkraftanlage überprüft. Sofern alle Bedingungen erfüllt sind, erscheinen auch automatisch die Rotorblätter (Flügel). Anderenfalls wird eine Fehlermeldung angezeigt. - -[ta4_windturbine|image] - - -### TA4 Windkraftanlagengondel / Wind Turbine Nacelle - -Dieser Block muss an das schwarze Ende des Wind Turbinen Block gesetzt werden. - -[ta4_nacelle|image] - - -### TA4 Wind Turbine Signal Lamp - -Dieses Blinklicht ist nur für dekorative Zwecke und kann oben auf den Wind Turbinen Block gesetzt werden. - -[ta4_blinklamp|image] - - -### TA4 Säule / Pillar - -Damit wird der Mast für die Windkraftanlage gebaut. Allerdings werden diese Blöcke nicht von Hand gesetzt sondern müssen mit Hilfe der Kelle gesetzt werden, so dass die Stromleitung zur Mastspitze mit diesen Blöcken ersetzt wird (siehe unter TA Stromkabel). - -[ta4_pillar|image] - - -## Solaranlage - -Die Solaranlage produziert nur Strom, wenn die Sonne scheint. Im Spiel ist das jeder Spieltag von morgens 6:00 bis abends 18:00. -In dieser Zeit steht immer die gleiche Leistung zur Verfügung. Nach 18:00 schalten die Solarmodule komplett ab. - -Für die Leistung der Solarmodule ist die Biome Temperatur entscheidend. Je heißer die Temperatur, um so höher der Ertrag. -Die Biome Temperatur kann mit dem Techage Info Tool (Schraubenschlüssel) bestimmt werden. Sie schwankt typischerweise zwischen 0 und 100: - -- bei 100 steht die volle Leistung zur Verfügung -- bei 50 steht die halbe Leistung zur Verfügung -- bei 0 steht keine Leistung zur Verfügung - -Es empfiehlt sich daher, nach heißen Steppen und Wüsten für die Solaranlage Ausschau zu halten. -Für den Stromtransport stehen die Überlandleitungen zur Verfügung. -Es kann aber auch Wasserstoff produziert werden, welcher sich transportieren und am Ziel wieder zu Strom umwandeln lässt. - -Die kleinste Einheit bei einer Solaranlage sind zwei Solarmodule und ein Trägermodul. Das Trägermodul muss zuerst gesetzt werden, die zwei Solarmodule dann links und rechts daneben (nicht darüber!). - -Der Plan rechts zeigt 3 Einheiten mit je zwei Solarmodulen und einem Trägermodul, über rote Kabel mit dem Wechselrichter verbunden. - -Solarmodule liefern Gleichspannung, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser besteht aus zwei Blöcken, einen für das rote Kabel zu den Solarmodulen (DC) und einen für das graue Stromkabel ins Stromnetz (AC). - -Der Kartenbereich, wo die Solaranlage steht, muss komplett geladen sein. Die gilt auch für die direkte Position über dem Solarmodul, denn dort wird regelmäßig die Lichtstärke gemessen. Es empfiehlt sich daher, zuerst einen Forceload Block zu setzen, und dann innerhalb dieses Bereiches die Module zu platzieren. - -[ta4_solarplant|plan] - - -### TA4 Solarmodul / Solar Module - -Das Solarmodul muss an das Trägermodul gesetzt werden. Es sind immer zwei Solarmodule notwendig. -Im Paar leisten die Solarmodule bis 3 ku, je nach Temperatur. -Bei den Solarmodul muss darauf geachtet werden, dass diese das volle Tageslicht haben und nicht durch Blöcke oder Bäume beschattet sind. Getestet kann dies mit dem Info Tool (Schraubenschlüssel). - -[ta4_solarmodule|image] - - -### TA4 Solar Trägermodul / Carrier Module - -Das Trägermodul gibt es in zwei Bauhöhen (1m und 2m). Funktionell sind beide identisch. -Die Trägermodule können direkt aneinander gesetzt und so zu einer Modulreihe verbunden werden. Die Verbindung zum Wechselrichter oder zu anderen Modulreihen muss mit den roten Niederspannungskabeln bzw. den Niederspannungsverteilerboxen hergestellt werden. - -[ta4_solarcarrier|image] - - -### TA4 Solar Wechselrichter / Solar Inverter - -Der Wechselrichter wandelt den Solarstrom (DC) in Wechselstrom (AC) um, so dass dieser in das Stromnetz eingespeist werden kann. -Ein Wechselrichter kann maximal 100 ku an Strom einspeisen, was 33 Solarmodulen oder auch mehr entspricht. - -[ta4_solar_inverter|image] - - -### TA4 Niederspannungskabel / Low Power Cable - -Das Niederspannungskabel dient zur Verbindung von Solar-Modulreihen mit dem Wechselrichter. Das Kabel darf nicht für andere Zwecke benutzt werden. - -Die maximale Leitungslänge beträgt 200 m. - -[ta4_powercable|image] - - -### TA4 Niederspannungsverteilerbox / Low Power Box - -Die Verteilerbox muss auf den Boden gesetzt werden. Sie besitzt nur 4 Anschlüsse (in die 4 Himmelsrichtungen). - -[ta4_powerbox|image] - - -### TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell - -Die Straßenlampen-Solarzelle dient, wie der Name schon sagt, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet, die Lampe leuchtet nur im Dunkeln. - -Diese Solarzelle kann nicht mit den anderen Solarmodulen kombiniert werden. - -[ta4_minicell|image] - - - -## Energiespeicher - -Der TA4 Energiespeicher ersetzt den Batterie Block aus TA3. - -Der Energiespeicher besteht aus einer Betonhülle (Concrete Block) gefüllt mit Gravel. Es gibt 5 Größen vom Speicher: - -- Hülle mit 5x5x5 Concrete Blocks, gefüllt mit 27 Gravel, Speicherkapazität: 22.5 kud -- Hülle mit 7x7x7 Concrete Blocks, gefüllt mit 125 Gravel, Speicherkapazität: 104 kud -- Hülle mit 9x9x9 Concrete Blocks, gefüllt mit 343 Gravel, Speicherkapazität: 286 kud -- Hülle mit 11x11x11 Concrete Blocks, gefüllt mit 729 Gravel, Speicherkapazität: 610 kud -- Hülle mit 13x13x13 Concrete Blocks, gefüllt mit 1331 Gravel, Speicherkapazität: 1112 kud - -In der Betonhülle darf ein Fenster aus einem Obsidian Glas Block sein. Dieses muss ziemlich in der Mitte der Wand platziert werden. Durch dieses Fenster sieht man, ob der Speicher mehr als 80 % geladen ist. Im Plan rechts sieht man den Aufbau aus TA4 Wärmetauscher bestehend aus 3 Blöcken, der TA4 Turbine und dem TA4 Generator. Beim Wärmetauscher ist auf die Ausrichtung zu achten (der Pfeil bei Block 1 muss zur Turbine zeigen). - -Entgegen dem Plan rechts müssen die Anschlüsse am Speicherblock auf gleicher Ebene sein (horizontal angeordnet, also nicht unten und oben). Die Rohrzuläufe (TA4 Pipe Inlet) müssen genau in der Mitte der Wand sein und stehen sich damit gegenüber. Als Röhren kommen die gelben TA4 Röhren zum Einsatz. Die TA3 Dampfrohre können hier nicht verwendet werden. -Sowohl der Generator als auch der Wärmetauscher haben einen Stromanschluss und müssen mit dem Stromnetz verbunden werden. - -Im Prinzip arbeitet das das Wärmespeichersystem genau gleich wie die Akkus, nur mit viel mehr Speicherkapazität. - -Damit das Wärmespeichersystem funktioniert, müssen alle Blöcke (auch Betonhülle und Gravel) mit Hilfe eines Forceloadblockes geladen sein. - -[ta4_storagesystem|plan] - - -### TA4 Wärmetauscher / Heat Exchanger - -Der Wärmetauscher besteht aus 3 Teilen, die aufeinander gesetzt werden müssen, wobei der Pfeil des ersten Blockes Richtung Turbine zeigen muss. Die Rohrleitungen müssen mit den gelben TA4 Röhren aufgebaut werden. -Der Wärmetauscher muss am Stromnetz angeschlossen werden. Über den Wärmetauscher wird der Energiespeicher wieder aufgeladen, sofern ausreichend Strom zur Verfügung steht. - -[ta4_heatexchanger|image] - - -### TA4 Turbine - -Die Turbine ist Teil des Energiespeichers. Sie muss neben den Generator gesetzt und über TA4 Röhren, wie im Plan abgebildet, mit dem Wärmetauscher verbunden werden. - -[ta4_turbine|image] - - -### TA4 Generator - -Der Generator ist Teil des Energiespeichers. Er dient zur Stromerzeugung und gibt damt die Energie des Energiespeichers wieder ab. Daher muss auch der Generator am Stromnetz angeschlossen werden. - -Wichtig: Wärmetauscher und Generator müssen mit ein und demselben Stromnetz verbunden sein! - -[ta4_generator|image] - - -### TA4 Rohrzulauf / TA4 Pipe Inlet - -Je ein Rohrzulaufblock muss auf beiden Seiten des Speicherblockes eingebaut werden. Die Blöcke müssen sich exakt gegenüber stehen. - -Die Rohrzulaufblöcke können **nicht** als normale Wanddurchbrüche verwendet werden, dazu die TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke verwenden. - -[ta4_pipeinlet|image] - - -### TA4 Röhre / Pipe - -Die gelben Röhren dienen bei TA4 zur Weiterleitung von Gas und Flüssigkeiten. -Die maximale Leitungslänge beträgt 100 m. - -[ta4_pipe|image] - - - -## Stromverteilung - -Mit Hilfe von Stromkabeln und Verteilerdosen können Stromnetze von bis zu 1000 Blöcke/Knoten aufgebaut werden. Hierbei ist aber zu beachten, dass Verteilerdosen auch mitgezählt werden müssen. Somit können bis zu 500 Generatoren/Speichersysteme/Maschinen/Lampen an einem Stromnetz hängen. - -Mit Hilfe von Trenntransformator und Stromzähler können Netzwerke zu noch größeren Strukturen verbunden werden. - -[ta4_transformer|image] - - - -### TA4 Trenntransformator / TA4 Isolation Transformer - -Mit Hilfe eines Trenntransformators können zwei Stromnetze zu einem größeren Netzwerk verbunden werden. Der Trenntransformator kann Strom in beide Richtungen übertragen. - -Der Trenntransformator kann bis zu 300 ku übertragen. Der Maximalwert ist über das Schraubenschlüsselmenü einstellbar. - -[ta4_transformer|image] - - - -### TA4 Stromzähler / TA4 Electric Meter - -Mit Hilfe eines Stromzählers können zwei Stromnetze zu einem größeren Netzwerk verbunden werden. Der Stromzähler leitet den Strom nur in eine Richtungen weiter (Pfeil beachten). Die durchgeleitete Menge an elektrischer Energie (in kud) wird gemessen und angezeigt. Dieser Wert kann auch über das Kommando `consumption` durch einen Lua Controller abgefragt werden. Die aktuelle Stromstärke kann über `current` abgefragt werden. - -Der Stromzähler kann bis zu 200 ku durchleiten. Der Maximalwert ist über das Schraubenschlüsselmenü einstellbar. - -Über das Schraubenschlüsselmenü kann auch ein Countdown für die Leistungsabgabe eingegeben werden. Läuft dieser Countdown auf Null, schaltet sich der Stromzähler ab. Der Countdown kann über das Kommando `countdown` abgefragt werden. - - - -[ta4_electricmeter|image] - - - -### TA4 Laser - -Der TA4 Laser dient zur kabellosen Stromübertagung. Dazu sind zwei Blöcke notwendig: TA4 Laserstrahl Sender und TA4 Laserstrahl Empfänger. Zwischen beiden Blöcken muss sich eine Luftstrecke befinden, so dass der Laserstrahl vom Sender bis zum Empfänger aufgebaut werden kann. - -Zuerst muss der Sender platziert werden. Dieser schaltet sofort den Laserstahls ein und zeigt damit mögliche Positionen des Empfängers an. Mögliche Positionen für den Empfänger werden auch über eine Chat-Nachricht ausgegeben. Mit dem Laser lassen sich Strecken bis 96 Blöcke überbrücken. - -Ist die Verbindung aufgebaut (es muss dazu noch kein Strom fließen), wird dies über den Info-Text des Senders und auch des Empfängers angezeigt. - -Die Laserblöcke selbst benötigen keinen Strom. - -[ta4_laser|image] - - - -## Wasserstoff - -Strom kann mittels Elektrolyse in Wasserstoff und Sauerstoff aufgespalten werden. Auf der anderen Seite kann über eine Brennstoffzelle Wasserstoff mit Sauerstoff aus der Luft wieder in Strom umgewandelt werden. -Damit können Stromspitzen oder ein Überangebot an Strom in Wasserstoff umgewandelt und so gespeichert werden. - -Im Spiel kann Strom mit Hilfe des Elektrolyseurs in Wasserstoff und Wasserstoff über die Brennstoffzelle wieder in Strom umgewandelt werden. -Damit kann Strom (in Form von Wasserstoff) nicht nur in Tanks gelagert, sonder mit dem Tankwagen auch transportiert werden. - -Die Umwandlung von Strom in Wasserstoff und zurück ist aber verlustbehaftet. Von 100 Einheiten Strom kommen nach der Umwandlung in Wasserstoff und zurück nur 95 Einheiten Strom wieder raus. - -[ta4_hydrogen|image] - - -### Elektrolyseur - -Der Elektrolyseur wandelt Strom in Wasserstoff um. -Es muss von links mit Strom versorgt werden. Rechts kann Wasserstoff über Röhren und Pumpen entnommen werden. - -Der Elektrolyseur kann bis zu 35 ku an Strom aufnehmen und generiert dann alle 4 s ein Wasserstoff Item. -In den Elektrolyseur passen 200 Einheiten Wasserstoff. - -Der Elektrolyseur besitzt ein Schraubenschlüssel-Menü zur Einstellung der Stromaufnahme und des Abschaltpunkts. - -Unterschreitet die im Stromnetz gespeicherte Leistung den angegebenen Wert des Abschaltpunkts, so schaltet sich der Elektrolyseur automatisch ab. Damit kann ein Leerlaufen der Speichersysteme verhindert werden. - -[ta4_electrolyzer|image] - - -### Brennstoffzelle - -Die Brennstoffzelle wandelt Wasserstoff in Strom um. -Sie muss von links per Pumpe mit Wasserstoff versorgt werden. Rechts ist der Stromanschluss. - -Die Brennstoffzelle kann bis zu 34 ku an Strom abgeben und benötigt dazu alle 4 s ein Wasserstoff Item. - -Normalerweise arbeitet die Brennstoffzelle als Generator der Kategorie 2 (wie auch anderen Speichersystemen). -In diesem Fall können keine anderen Blöcke der Kategorie 2 wie der Akku-Block geladen werden. -Über das Kontrollkästchen kann die Brennstoffzelle jedoch auch als Generator der Kategorie 1 eingesetzt werden. - -[ta4_fuelcell|image] - - -## Chemischer Reaktor / chemical reactor - -Der Reaktor dient dazu, die über den Destillationsturm oder aus anderen Rezepten gewonnenen Zutaten zu neuen Produkten weiter zu verarbeiten. Der Plan links zeigt nur eine mögliche Variante, da die Anordnung der Silos und Tanks rezeptabhängig ist. - -Das primäre Ausgabeprodukt wird immer an der Seite des Reaktorständers ausgegeben, unabhängig davon, ob es sich um ein Pulver oder eine Flüssigkeit handelt. Das (sekundäre) Abfallprodukt wird immer unten am Reaktorständers ausgegeben. - -Ein Reaktor besteht aus: -- div. Tanks und Silos mit den Zutaten, die über Leitungen mit dem Dosierer verbunden sind -- optional einem Reaktorsockel, welcher die Abfälle aus dem Reaktor ableitet (nur bei Rezepten mit zwei Ausgabestoffen notwendig) -- dem Reaktorständer, der auf den Sockel gesetzt werden muss (sofern vorhanden). Der Ständer hat einen Stromanschluss und zieht bei Betrieb 8 ku. -- dem eigentlichen Reaktorbehälter, der auf den Reaktorständer gesetzt werden muss -- dem Einfüllstutzen der auf den Reaktorbehälter gesetzt werden muss -- dem Dosierer, welcher über Leitungen mit den Tanks oder Silos sowie dem Einfüllstutzen verbunden werden muss - -Hinweis 1: Flüssigkeiten werden nur in Tanks gelagert, feste Stoffe und Stoffe in Pulverform nur in Silos. Dies gilt für Zutaten und Ausgabestoffe. - -Hinweis 2: Tanks oder Silos mit verschiedenen Inhalten dürfen nicht zu einem Leitungssystem verbunden werden. Mehrere Tanks oder Silos mit gleichem Inhalt dürfen dagegen parallel an einer Leitung hängen. - -Beim Cracken werden lange Kette von Kohlenwasserstoffen unter Verwendung eines Katalysator in kurze Ketten gebrochen. -Als Katalysator dient Gibbsitpulver (wird nicht verbraucht). Damit kann Bitumen in Schweröl, Schweröl in Naphtha und Naphtha in Benzin umgewandelt werden. - -Bei der Hydrierung werden einem Molekül Paare von Wasserstoffatomen hinzugefügt, um kurzkettige Kohlenwasserstoffe in lange umzuwandeln. -Hier wird Eisenpulver als Katalysator benötigt (wird nicht verbraucht). Damit kann Propangas in Isobutan, Isobutan in Benzin, Benzin in Naphtha, -Naphtha in Schweröl und Schweröl in Bitumen umgewandelt werden. - -[ta4_reactor|plan] - - -### TA4 Dosierer / doser - -Teil des Chemischen Reaktors. -Auf allen 4 Seiten der Dosierers können Leitungen für Eingangsmaterialien angeschlossen werden. Nach oben werden die Materialien für den Reaktor ausgegeben. - -Über den Dosierer kann das Rezept eingestellt und der Reaktor gestartet werden. - -Wie auch bei anderen Maschinen: -- geht der Dosierer in den standby Zustand, so fehlen ein oder mehrere Zutaten -- geht der Dosierer in den blocked Zustand, so ist Ausgabetank oder Silo voll, defekt oder falsch angeschlossen - -Der Dosierer benötigt keinen Strom. Alle 10 s wird ein Rezept abgearbeitet. - -[ta4_doser|image] - -### TA4 Reaktor / reactor - -Teil des Chemischen Reaktors. Der Reaktor verfügt über ein Inventar für die Katalysator -Gegenstände (für Cracking- und Hydrierungs-Rezepte). - -[ta4_reactor|image] - - -### TA4 Einfüllstutzen / fillerpipe - -Teil des Chemischen Reaktors. Muss auf den Reaktor gesetzt werden. Wenn dies nicht klappt, ggf. das Rohr an der Position darüber nochmals entfernen und neu setzen. - -[ta4_fillerpipe|image] - - -### TA4 Reaktorständer / reactor stand - -Teil des Chemischen Reaktors. Hier ist auch der Stromanschluss für den Reaktor. Der Reaktor benötigt 8 ku Strom. - -Der Ständer hat zwei Leitungsanschlüsse, nach rechst für das primäre Ausgabeprodukt und nach unten für den Abfall, wie bspw. Rotschlamm bei der Aluminiumherstellung. - -[ta4_reactorstand|image] - - -### TA4 Reaktorsockel / reactor base - -Teil des Chemischen Reaktors. Wird für den Abfluss des Abfallproduktes benötigt. - -[ta4_reactorbase|image] - - -### TA4 Silo / silo - -Teil des Chemischen Reaktors. Wird zur Aufbewahrung von Stoffen in Pulver- oder Granulatform benötigt. - -[ta4_silo|image] - - - - -## ICTA Controller - -Der ICTA Controller (ICTA steht für "If Condition Then Action") dient zur Überwachung und Steuerung von Maschinen. Mit dem Controller kann man Daten von Maschinen und anderen Blöcken einlesen und abhängig davon andere Maschinen und Blöcke ein-/ausschalten. - -Einlesen von Maschinendaten sowie das Steuern von Blöcken und Maschinen erfolgt über sogenannte Kommandos. Für das Verständnis, wie Kommandos funktionieren, ist das Kapitel TA3 -> Logik-/Schalt-Blöcke wichtig. - -Der Controller benötigt für den Betrieb eine Batterie. Das Display dient zur Ausgabe von Daten, der Signal Tower zur Anzeige von Fehlern. - -[ta4_icta_controller|image] - - - -### TA4 ICTA Controller - -Der Controller arbeitet auf das Basis von ```IF THEN ``` Regeln. Es können bis zu 8 Regeln pro Controller angelegt werden. - -Beispiele für Regeln sind: - -- Wenn ein Verteiler verstopft ist (```blocked```), soll der Schieber davor ausgeschaltet werden -- Wenn eine Maschine einen Fehler anzeigt, soll dieser auf dem Display ausgegeben werden - -Der Controller prüft diese Regeln zyklisch. Dazu muss pro Regel eine Zykluszeit in Sekunden (```Cycle/s```) angegeben werden (1..1000). - -Für Regeln die einen on/off Eingang auswerten, bspw. von einen Schalter oder Detektor, muss als Zykluszeit 0 angegeben werden. Der Wert 0 bedeutet, dass diese Regel immer dann ausgeführt werden soll, wenn sich das Eingangssignal geändert hat, also bspw. der Button einen neuen Wert gesendet hat. - -Alle Regeln sollten nur so oft wie notwendig ausgeführt werden. Dies hat zwei Vorteile: - -- die Batterie des Controllers hält länger (jeder Controller benötigt eine Batterie) -- die Last für den Server ist geringer (damit weniger Lags) - -Man muss für jede action eine Verzögerungszeit (```after/s```) einstellen. Soll die Aktion sofort ausgeführt werden, ist 0 einzugeben. - -Der Controller hat eine eigene Hilfe und Hinweise zu allen Kommandos über das Controller-Menü. - -[ta4_icta_controller|image] - -### Batterie - -Die Batterie muss in unmittelbarer Nähe zum Controller platziert werden, also an einer der 26 Positionen um den Controller herum. - -[ta4_battery|image] - -### TA4 Display - -Das Display zeigt nach dem Platzieren seine Nummer an. Über diese Nummer kann das Display angesprochen werden. Auf dem Display können Texte ausgegeben werden, wobei das Display 5 Zeilen und damit 5 unterschiedliche Texte darstellen kann. - -Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden, muss dem Text das Zeichen „\t“ (Tabulator) vorangestellt werden. - -Das Display wird maximal ein mal pro Sekunde aktualisiert. - -[ta4_display|image] - -### TA4 Display XL - -Das TA4 Display XL hat die doppelte Größ wie das TA4 Display. - -Textzeilen werden immer linksbündig ausgegeben. Soll der Text horizontal zentriert ausgerichtet werden, muss dem Text das Zeichen „\t“ (Tabulator) vorangestellt werden. - -Das Display wird maximal alle zwei Sekunden aktualisiert. - -[ta4_displayXL|image] - - -### TA4 Signal Tower - -Der Signal Tower kann rot, grün und orange anzeigen. Eine Kombination der 3 Farben ist nicht möglich. - -[ta4_signaltower|image] - - - -## TA4 Lua Controller - -Der Lua Controller muss, wie der Name schon sagt, in der Programmiersprache Lua programmiert werden. Außerdem sollte man etwas Englisch können (oder Google bemühen), denn die Anleitung dazu gibt es nur in Englisch: - -https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md - -Auch der Lua Controller benötigt eine Batterie. Die Batterie muss in unmittelbarer Nähe zum Controller platziert werden, also an einer der 26 Positionen um den Controller herum. - -[ta4_lua_controller|image] - -### TA4 Lua Server - -Der Server dient zur zentralen Speicherung von Daten von mehreren Lua Controllern. Es speichert auch die Daten über einen Server-Neustart hinweg. - -[ta4_lua_server|image] - -### TA4 Sensor Kiste/Chest - -Die TA4 Sensor Kiste dient zum Aufbau von Automatischen Lagern oder Verkaufsautomaten in Verbindung mit dem Lua Controller. -Wird etwas in die Kiste gelegt, oder entnommen, oder eine der Tasten "F1"/"F2" gedrückt, so wird ein Event-Signal an den Lua Controller gesendet. -Die Sensor Kiste unterstützt folgende Kommandos: - -- Über `state = $send_cmnd(, "state")` kann der Status der Kiste abgefragt werden. Mögliche Antworten sind: "empty", "loaded", "full" -- Über `name, action = $send_cmnd(, "action")` kann die letzte Spieleraktion abgefragt werden. `name` ist der Spielername, Als `action` wird zurückgeliefert: "put", "take", "f1", "f2". -- Über `stacks = $send_cmnd(, "stacks")` kann der Inhalt der Kiste ausgelesen werden. Siehe dazu: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest -- Über `$send_cmnd(, "text", "press both buttons and\nput something into the chest")` kann der Text im Menü der Sensor Kiste gesetzt werden. - -Über die Checkbox "Erlaube öffentlichen Zugriff" kann eingestellt werden, ob die Kiste von jedem genutzt werden darf, oder nur von Spielern die hier Zugriffsrechte haben. - - -[ta4_sensor_chest|image] - -### TA4 Lua Controller Terminal - -Das Terminal dient zur Ein-/Ausgabe für den Lua Controller. - -[ta4_terminal|image] - - - -## TA4 Logik-/Schalt-Module - -### TA4 Taster/Schalter / Button/Switch - -Beim TA4 Taster/Schalter hat sich nur das Aussehen geändert. Die Funktionalität ist gleich wie beim TA3 Taster/Schalter. Mit dem Schraubenschlüssel-Menü können die Daten aber nachträglich geändert werden. - -[ta4_button|image] - -### TA4 2x Taster / 2x Button - -Dieser Block hat zwei Taster, die über das Schraubenschlüssel-Menü individuell konfiguriert werden können. Für beide Taster kann die Beschriftung und die Zielblockadresse konfiguriert werden. Zusätzlich kann für beide Taster das Kommando konfiguriert werden, welches gesendet werden soll. - -[ta4_button_2x|image] - -### TA4 4x Taster / 4x Button - -Dieser Block hat vier Taster, die über das Schraubenschlüssel-Menü individuell konfiguriert werden können. Für jeden Taster kann die Beschriftung und die Zielblockadresse konfiguriert werden. Zusätzlich kann für jeden Taster das Kommando konfiguriert werden, welches gesendet werden soll. - -[ta4_button_4x|image] - -### TA4 2x Signallampe / 2x Signal Lamp - -Dieser Block hat zwei Lampen, die individuell angesteuert werden können. Jede Lampe kann die Farben "rot", "grün" und "orange" anzeigen. Über das Schraubenschlüssel-Menü kann für beide Lampen die Beschriftung konfiguriert werden. Die Lampen können über folgende Kommandos angesteuert werden: - -- Lampe 1 auf rot schalten: `$send_cmnd(1234, "red", 1)` -- Lampe 2 auf grün schalten: `$send_cmnd(1234, "green", 2)` -- Lampe 1 auf orange schalten: `$send_cmnd(1234, "amber", 1)` -- Lampe 2 aus schalten: `$send_cmnd(1234, "off", 2)` - -[ta4_signallamp_2x|image] - -### TA4 4x Signallampe / 4x Signal Lamp - -Dieser Block hat vier Lampen, die individuell angesteuert werden können. Jede Lampe kann die Farben "rot", "grün" und "orange" anzeigen. Über das Schraubenschlüssel-Menü kann für alle Lampen die Beschriftung konfiguriert werden. Die Lampen können über folgende Kommandos angesteuert werden: - -- Lampe 1 auf rot schalten: `$send_cmnd(1234, "red", 1)` -- Lampe 2 auf grün schalten: `$send_cmnd(1234, "green", 2)` -- Lampe 3 auf orange schalten: `$send_cmnd(1234, "amber", 3)` -- Lampe 4 aus schalten: `$send_cmnd(1234, "off", 4)` - -[ta4_signallamp_4x|image] - -### TA4 Spieler Detektor / Player Detector - -Beim TA4 Spieler Detektor hat sich nur das Aussehen geändert. Die Funktionalität ist gleich wie beim TA3 Spieler Detektor. - -[ta4_playerdetector|image] - -### TA4 Zustandssammler / State Collector - -[ta4_collector|image] - -Der Zustandssammler fragt der Reihe nach alle konfigurierten Maschinen nach dem Status ab. Wenn eine der Maschinen einen vorkonfigurierte Status erreicht oder überschritten hat, wird ein "on" Kommando gesendet. Damit können bspw. vom einem Lua Controller aus sehr einfach viele Maschinen auf Störungen überwacht werden. - -### TA4 Detektor / Detector - -Die Funktionalität ist gleich wie beim TA3 Detektor / Detector. Zusätzlich zählt der Detector aber die weitergegebenen Items. -Diesen Zähler kann man über das Kommando 'count' abfragen und über 'reset' zurücksetzen. - -[ta4_detector|image] - -### TA4 Block Detektor / Node Detector - -Die Funktionalität ist gleich wie beim TA3 Block Detektor. - -Im Unterschied zum TA3 Block Detektor können hier die Positionen, die überwacht werden sollen, individuell konfiguriert werden. Dazu muss der "Aufzeichnen" Button gedrückt werden. Dann müssen alle Blöcke angeklickt werden, von denen die Position überprüft werden soll. Danach muss der "Fertig" Button gedrückt werden. - -Es können bis zu 4 Blöcke ausgewählt werden. - -[ta4_nodedetector|image] - -### TA4 Energiespeicher-Ladungsdetektor / Energy Storage Charge Detector - -Der Ladungsdetektor misst alle 8 s den Ladezustand des Energiespeichers des Stromnetzwerkes. - -Fällt der Wert unter eine konfigurierbare Schwelle (Schaltpunkt), wird ein Kommando (default: "off") versendet. Steigt der Wert wieder über diesen Schaltpunkt, so wird ein zweites Kommando (default: "on") gesendet. Damit lassen sich Verbraucher vom Netz trennen, wenn der Ladezustand des Energiespeichers unter den angegebenen Schaltpunkt sinkt. - -Der Ladungsdetektor muss dazu über eine Verteilerdose an das Stromnetz angeschlossen werden. Die Konfiguration des Ladungsdetektors erfolgt über das Gabelschlüsselmenü. - -[ta4_chargedetector|image] - -### TA4 Blicksensor / Gaze Sensor - -Der TA4 Blicksensor generiert ein Kommando, wenn der Block vom Besitzer oder anderen konfigurierten Spielern angesehen/fokussiert wird und sendet ein zweites Kommando, wenn der Block nicht mehr fokussiert wird. Er dient damit als Ersatz für Taster/Schalter, um bspw. Türen zu öffnen/schließen. - -Der TA4 Blicksensor kann nur mit dem Gabelschlüsselmenü programmiert werden. Hat man einen Gabelschlüssel in der Hand, löst der Sensor nicht aus, auch wenn dieser fokussiert wird. - -[ta4_gaze_sensor|image] - -### TA4 Sequenzer - -über den TA4 Sequenzer können ganze Abläufe programmiert werden. Hier ein Beispiel: - -``` --- this is a comment -[1] send 1234 a2b -[30] send 1234 b2a -[60] goto 1 -``` - -- Jede Zeile beginnt mit einem Nummer, welche einem Zeitpunkt entspricht `[]` -- Für Zeitpunkte sind Werte von 1 bis 50000 zulässig -- 1 entspricht 100 ms, 50000 entspricht in etwa 4 Spieltagen -- Leerzeilen oder Kommentare sind erlaubt (`-- comment`) -- Mit `send ` kann man ein Kommando an einen Block senden -- Mit `goto ` kann man an eine andere Zeile/Zeitpunkt springen -- Mit `stop` kann man den Sequenzer verzögert stoppen, so dass er kein neues Kommando - von einem Taster oder anderem Block annimmt (um eine Bewegung abzuschließen) - Ohne `stop` geht der Sequenzer sofort nach dem letzten Kommando in den stopped Modus. - -Der TA4 Sequenzer unterstützt folgende techage Kommandos: - -- `goto ` Zu einer Kommandozeile springen und damit den Sequenzer starten -- `stop` Den Sequenzer anhalten -- `on` und `off` als Alias für `goto 1` bzw. `stop` - -Das `goto` Kommando wird nur angenommen, wenn der Sequenzer gestoppt ist. - -Über das Gabelschlüssel-Menü kann beim Sequenzer die Zykluszeit (normal: 100 ms) geändert werden. - -[ta4_sequencer|image] - - - - -## Move/Dreh-Controller - -### TA4 Move Controller - -Der TA4 Move Controller ist ähnlich zum "Door Controller 2", aber die ausgewählten Blöcke werden nicht entfernt, sondern können bewegt werden. -Da die bewegten Blöcke Spieler und Mobs mitnehmen können, die auf dem Block stehen, können damit Fahrstühle und ähnliche Transportsysteme gebaut werden. - -Anleitung: - -- Controller setzen und die Blöcke, die bewegt werden sollen, über das Menü (Taste "Aufzeichnen") an-trainieren (Es können bis zu 16 Blöcke an-trainiert werden) -- die "Flugstrecke" muss über eine x,y,z Angabe (relativ) eingegeben werden (die maximale Distanz (x+y+z) beträgt 200 m) -- mit den Menü-Tasten "Bewege A-B" sowie "Bewege B-A" kann die Bewegung getestet werden -- man kann auch durch Wände oder andere Blöcke fliegen -- auch die Zielposition für die Blöcke kann belegt sein. Die Blöcke werden in diesem Falle "unsichtbar" gespeichert. Dies ist für Schiebetüren und ähnliches gedacht - -Der Move Controller unterstützt folgende techage Kommandos: - -- `a2b` Bewege Block von A nach B -- `b2a` Bewege Block von B nach A -- `move` Bewege Block auf die andere Seite - -Über das Schraubenschlüssel-Menü kann auf die Betriebsart `move xyz` umgeschaltet werden. Nach der Umschaltung werden folgende techage Kommandos unterstützt: - -- `move2` Beim Kommando muss zusätzlich die Flugstrecke als x,y,z Vektor angegeben werden. - Beispiel Lua Controller: `$send_cmnd(MOVE_CTLR, "move2", "0,12,0")` -- `reset` Block/Blöcke zurück in Startposition bewegen - -**Wichtige Hinweise:** - -- Sofern mehrere Blöcke bewegt werden sollen, muss der Block, der die Spieler/Mobs mitnehmen soll, beim Antrainieren als erstes angeklickt werden. -- Hat der Block, der die Spieler/Mobs mitnehmen soll, eine reduzierte Höhe, so muss die Höhe im Controller über das Schraubenschlüsselmenü eingestellt werden (bspw. Höhe = 0.5). Ansonsten wird der Spieler/Mob nicht "gefunden" und damit nicht mitgenommen. - -[ta4_movecontroller|image] - -### TA4 Drehcontroller / Turn Controller - -Der TA4 Drehcontroller ist ähnlich zum Move Controller", aber die ausgewählten Blöcke werden nicht bewegt, sondern um ihr Zentrum nach rechts oder links gedreht. - -Anleitung: - -- Controller setzen und die Blöcke, die bewegt werden sollen, über das Menü an-trainieren (Es können bis zu 16 Blöcke an-trainiert werden) -- mit den Menü-Tasten "Drehe links" sowie "Drehe rechts" kann die Bewegung getestet werden - -Der Drehcontroller unterstützt folgende techage Kommandos: - -- `left` Drehe nach links -- `right` Drehe nach rechts -- `uturn` Drehe um 180 Grad - -[ta4_turncontroller|image] - - - - -## TA4 Lampen - -TA4 beinhaltet eine Reihe von leistungsstarken Lampen, die eine bessere Ausleuchtung ermöglichen oder Spezialaufgaben übernehmen. - -### TA4 LED Pflanzenlampe / TA4 LED Grow Light - -Die TA4 LED Pflanzenlampe ermöglicht ein schnelles und kräftiges Wachstum aller Pflanzen aus der `farming` Mod. Die Lampe beleuchtet ein 3x3 großes Feld, so dass sich damit auch Pflanzen unter Tage anbauen lassen. -Die Lampe muss mit einem Abstand von einem Block über dem Boden in der Mitte des 3x3 Feldes platziert werden. - -Zusätzlich kann die Lampe auch zur Blumenzucht genutzt werden. Wird die Lampe über ein 3x3 großes Blumenbeet aus "Garden Soil" (Mod `compost`) platziert, so wachsen dort die Blumen ganz von selbst (über und unter Tage). - -Abernten kann man die Blumen mit den Signs Bot, der auch über ein entsprechendes Zeichen verfügt, das vor das Blumenfeld gestellt werden muss. - -Die Lampe benötigt 1 ku Strom. - -[ta4_growlight|image] - -### TA4 LED Straßenlampe / TA4 LED Street Lamp - -Die TA4 LED Straßenlampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe besteht aus dem Lampengehäuse, Lampenarm und Lampenmast Blöcken. - -Der Strom muss von unten durch den Mast nach oben zum Lampengehäuse geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit Lampenmast Blöcken "verputzen". - -Die Lampe benötigt 1 ku Strom. - -[ta4_streetlamp|image] - -### TA4 LED Industrielampe / TA4 LED Industrial Lamp - -Die TA4 LED Industrielampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe muss von oben mit Strom versorgt werden. - -Die Lampe benötigt 1 ku Strom. - -[ta4_industriallamp|image] - - - - -## TA4 Flüssigkeitsfilter - -Im Flüssigkeitsfilter wird Rotschlamm gefiltert. -Dabei entsteht entweder Lauge, welche unten in einem Tank gesammelt werden kann oder Wüstenkopfsteinpflaster, welches sich im Filter absetzt. -Wenn der Filter zu sehr verstopft ist, muss er geleert und neu befüllt werden. -Der Filter besteht aus einer Fundament-Ebene, auf der 7 identische Filterschichten platziert werden. -Ganz oben befindet sich die Einfüllebene. - -[ta4_liquid_filter|image] - -### Fundament-Ebene - -Der Aufbau dieser Ebene kann dem Plan entnommen werden. - -Im Tank wird die Lauge gesammelt. - -[ta4_liquid_filter_base|plan] - -### Schotter-Ebene - -Diese Ebene muss so wie im Plan gezeigt mit Schotter befüllt werden. -Insgesamt müssen sieben Lagen Schotter übereinander liegen. -Dabei wird mit der Zeit der Filter verunreinigt, sodass das Füllmaterial erneuert werden muss. - -[ta4_liquid_filter_gravel|plan] - -### Einfüll-Ebene - -Diese Ebene dient zum Befüllen des Filters mit Rotschlamm. -In den Einfüllstutzen muss Rotschlamm mittels einer Pumpe geleitet werden. - -[ta4_liquid_filter_top|plan] - - - -## TA4 Teilchenbeschleuniger / Collider - -Der Teilchenbeschleuniger ist eine Forschungsanlage, bei der Grundlagenforschung betrieben wird. Hier können Erfahrungspunkte (experience points) gesammelt werden, welche für TA5 (Future Age) benötigt werden. - -Der Teilchenbeschleuniger muss wie sein Original am CERN in Genf unterirdisch aufgebaut werden. Die Standardeinstellung ist hier Y <= -28. Der Wert kann aber per Konfiguration vom Server Personal geändert werden. Ab besten nachfragen, oder mit dem "TA4 Collider Detector Worker" Block ausprobieren. - -Pro Spieler kann nur ein Teilchenbeschleuniger betrieben werden. Es macht also keinen Sinn, zwei oder mehrere Teilchenbeschleuniger aufzubauen. Erfahrungspunkte werden dem Spieler gutgeschrieben, dem der Teilchenbeschleuniger gehört. Die Erfahrungspunkte können nicht übertragen werden. - -Ein Teilchenbeschleuniger besteht aus einem "Ring" aus Röhren und Magneten sowie dem Detektor mit Kühlanlage. - -- Der Detektor ist das Herz der Anlage. Hier finden die wissenschaftlichen Experimente statt. Der Detektor ist 3x3x7 Blöcke groß. -- 22 TA4 Collider Magnete (nicht die TA4 Collider Detector Magnete!) müssen über jeweils 5 Blöcken der TA4 Vakuumröhre miteinander verbunden werden. Das ganze bildet (wie rechts im Plan abgebildet) ein Quadrat mit einer Kantenlänge von 37 Metern. - -Der Plan zeigt die Anlage von oben: - -- der graue Block ist der Detektor mit dem Worker-Block in der Mitte -- die roten Blöcke sind die Magnete, das blaue die Vakuumröhren - -[techage_collider_plan|plan] - -### Detektor - -Der Detektor wird mit Hilfe des "TA4 Collider Detector Worker" Blocks automatisch aufgebaut (ähnlich wie beim Bohrturm). Alle dazu notwendigen Materialien müssen zuvor in den Worker-Block gelegt werden. Auf dem Worker-Block ist der Detektor symbolisch dargestellt. Der Detektor wird über dem Worker-Block in Querrichtung errichtet. - -Der Detektor kann mit Hilfe des Worker-Blocks auch wieder abgebaut werden. - -Auf den beiden Stirnseiten des Detektors befinden sich die Anschlüsse für Strom, Gas und Vakuumröhre. Oben muss eine TA4 Pumpe angeschlossen werden, um die Röhre leer zu saugen / das Vakuum zu erzeugen. - -Auf der Rückseite des Detektors muss das Kühlsystem angeschlossen werden. Im Plan rechts ist das Kühlsystem abgebildet. Hier wird neben dem TA4 Wärmetauscher des Energiespeichers (welcher hier zur Kühlung genutzt wird), auch ein TA4 Kühlerblock benötigt. - -Hinweis: Der Pfeil des Wärmetauschers muss vom Detektor weg zeigen. Auch der Wärmetauscher muss mit Strom versorgt werden. - -[ta4_cooler|plan] - -### Steuerung / TA4 Terminal - -Der Teilchenbeschleuniger wird über ein TA4 Terminal gesteuert (nicht über das TA4 Lua Controller Terminal). - -Dieses Terminal muss mit dem Detektor verbunden werden. Die Nummer des Detektors wird als Infotext am Worker-Block angezeigt. - -Das Terminal unterstützt folgende Kommandos: - -- `connect ` (verbinden mit dem Detektor) -- `start` (starten des Detektors) -- `stop` (stoppen des Detektors) -- `test ` (überprüfen eines Magneten) -- `points` (abfragen der bereits erreichten Erfahrungspunkte) - -Tritt beim `start` an einem Magneten ein Fehler auf, so wird die Nummer des Magneten ausgegeben. Über das `test` Kommando können weitere Informationen zum Fehler des Magneten angefordert werden. - -[ta4_terminal|image] - -### Kühlung und Strom - -Jeder TA4 Collider Magnet muss zusätzlich (wie rechts im Plan abgebildet) mit Strom sowie mit Isobutan zur Kühlung versorgt werden: - -- Der Anschluss für den Strom ist auf der Oberseite des Magneten. -- Der Anschluss für die Kühlung ist auf der Vorderseite des Magneten. -- Für die Kühlung der gesamten Anlage wird zusätzlich eine TA4 Pumpe und ein TA4 Tank mit mindestens 250 Einheiten Isobutan benötigt. -- Die Anlage benötigt auch einiges an Strom. Daher ist eine eigene Stromversorgung mit mindestens 145 ku sinnvoll. - -[techage_collider_plan2|plan] - -### Aufbau - -Beim Aufbau des Teilchenbeschleunigers empfiehlt sich folgende Reihenfolge: - -- Einen Forceload Block setzen. Nur der Detektor mit der Kühlanlage muss sich im Bereich des Forceload Blockes befinden. -- Den Worker-Block setzen, mit Items füllen und den Detektor über das Menü aufbauen -- Den Ring mit Röhren und Magneten aufbauen -- Alle Magnete und den Detektor mit Stromkabel verbinden -- Alle Magnete und den Detektor mit den gelben Röhren verbinden und das Isobutan mit einer Pumpe in das Röhrensystem pumpen. -- Eine TA4 Pumpe als Vakuumpumpe auf dem Detektor installieren und einschalten (es wird kein zusätzlicher Tank benötigt). Geht die Pumpe in den "standby", ist das Vakuum hergestellt. Dies dauert einige Sekunden -- den Kühler (Wärmetauscher) aufbauen und mit dem Stromkabel verbinden -- Das TA4 Terminal vor den Detektor setzen und über `connect ` mit dem Detektor verbinden -- Die Stromversorgung einschalten/herstellen -- den Kühler (Wärmetauscher) einschalten -- den Detektor über `start` am TA4 Terminal einschalten. Der Detektor geht nach einigen Prüfschritten in den Normalbetrieb oder gibt einen Fehler aus. -- Der Teilchenbeschleunigers muss im Dauerbetrieb laufen und liefert dann nach und nach Erfahrungspunkte. Für 10 Punkte muss der Teilchenbeschleuniger schon einige Stunden laufen. - -[techage_ta4c|image] - - - - -## Weitere TA4 Blöcke - -### TA4 Rezept Block - -Im Rezept Block können bis zu 10 Rezepte gespeichert werden. Diese Rezepte können dann über ein TA4 Autocrafter Kommando abgerufen werden. Dies ermöglicht eine Rezept-Konfiguration des Autocrafters über ein Kommando. Die Rezepte des Rezept Blocks können auch direkt per Kommando abgefragt werden. - -`input ` liest ein Rezept aus dem TA4 Rezeptblock. `` ist die Nummer des Rezepts. Der Block gibt eine Liste von Rezept-Zutaten zurück. - -Beispiel: `$send_cmnd(1234, "input", 1)` - -[ta4_recipeblock|image] - -### TA4 Autocrafter - -Die Funktion entspricht der von TA3. - -Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Autocrafter benötigt hierfür 9 ku Strom. - -Zusätzlich unterstützt der TA4 Autocrafter die Auswahl unterschiedlicher Rezepte über folgende Kommandos: - -`recipe "."` schaltet den Autocrafter auf ein Rezept des TA4 Rezept Blocks um. `` ist die Nummer des Rezept Blocks, `` die Rezept-Nummer. Beispiel: `$send_cmnd(1234, "recipe", "5467.1")` - -Alternativ kann ein Rezept auch über die Zutatenliste ausgewählt werden, wie bspw.: -`$send_cmnd(1234, "recipe", "default:coal_lump,,,default:stick")` -Hier müssen alle technische Namen eines Rezeptes durch Kommas getrennt angegeben werden. Siehe auch das Kommando `input` beim TA4 Rezept Block. - -Das Kommando `flush` verschiebt alle Artikel vom Eingabeinventar in das Ausgabeinventar. Das Kommando liefert `true` zurück, wenn das Eingabeinventar dabei vollständig geleert wurde. Falls `false` zurückgeliefert wurde (Ausgabeinventar voll), muss das Kommando zu einem späteren Zeitpunkt wiederholt werden. - - - -[ta4_autocrafter|image] - -### TA4 Tank / TA4 Tank - -Siehe TA3 Tank. - -In einen TA4 Tank passen 2000 Einheiten oder 200 Fässer einer Flüssigkeit. - -[ta4_tank|image] - -### TA4 Pumpe / TA4 Pump - -Siehe TA3 Pumpe. - -Die TA4 Pumpe pumpt 8 Einheiten Flüssigkeit alle zwei Sekunden. - -In der Betriebsart "Durchflussbegrenzer" kann die Anzahl der Einheiten, die von der Pumpe gepumpt werden, begrenzt werden. Die Betriebsart Durchflussbegrenzer kann über das Gabelschlüssel-Menü aktiviert werden, indem im Menü die Anzahl an Einheiten konfiguriert wird. Sobald die konfigurierte Anzahl an Einheiten gepumpt wurden, schaltet sich die Pumpe ab. Wird die Pumpe wieder eingeschaltet, pumpt sie wieder die konfigurierte Anzahl an Einheiten und schaltet sich dann ab. - -Der Durchflussbegrenzer kann auch per Lua- oder Beduino Controller konfiguriert und gestartet werden. - -Zusätzlich unterstützt die Pumpe das Kommando `flowrate`. Damit kann die Gesamtdurchflussmenge durch die Pumpe abgefragt werden. - -[ta4_pump|image] - -### TA4 Ofenheizung / furnace heater - -Mit TA4 hat der Industrieofen auch seine elektrische Heizung. Der Ölbrenner und auch das Gebläse können mit der Ofenheizung ersetzt werden. - -Die Ofenheizung benötigt 14 ku Strom. - -[ta4_furnaceheater|image] - -### TA4 Wasserpumpe / Water Pump (veraltet) - -Dieser Block kann nicht mehr gecraftet werden und wird durch den TA4 Wassereinlass Block ersetzt. - -### TA4 Wassereinlass / TA4 Water Inlet - -Für manche Rezepte wird Wasser benötigt. Das Wasser muss mit einer Pumpe aus dem Meer (Wasser auf y = 1) gepumpt werden. Ein "Pool" aus ein paar Wasserblöcken ist dafür nicht ausreichend! - -Dazu muss der Wassereinlass-Block ins Wasser gesetzt und über Röhren mit der Pumpe verbunden werden. Wird der Block ins Wasser gesetzt, so muss darauf geachtet werden, dass sich unter dem Block Wasser befindet (Wasser muss mindestens 2 Blöcke tief sein). - -[ta4_waterinlet|image] - -### TA4 Röhren / TA4 Tube - -TA4 hat auch seine eigenen Röhren im TA4 Design. Diese können wie Standard Röhren eingesetzt werden. -Aber: TA4 Schieber und TA4 Verteiler erreichen ihre volle Leistungsfähigkeit nur beim Einsatz mit TA4 Röhren. - -[ta4_tube|image] - -### TA4 Schieber / Pusher - -Die Funktion entspricht grundsätzlich der von TA2/TA3. Zusätzlich kann aber über ein Menü konfiguriert werden, welche Gegenstände aus einer TA4 Kiste geholt und weiter transportiert werden sollen. -Die Verarbeitungsleistung beträgt 12 Items alle 2 s, sofern auf beiden Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 6 Items alle 2 s. - -In der Betriebsart "Durchlaufbegrenzer" kann die Anzahl der Items, die von dem Schieber bewegt werden, begrenzt werden. Die Betriebsart Durchlaufbegrenzer kann über das Gabelschlüssel-Menü aktiviert werden, indem im Menü die Anzahl an Items konfiguriert wird. Sobald die konfigurierte Anzahl an Items bewegt wurden, schaltet sich der Schieber ab. Wird der Schieber wieder eingeschaltet, bewegt er wieder die konfigurierte Anzahl an Items und schaltet sich dann ab. - -Der TA4 Schieber kann auch per Lua- oder Beduino Controller konfiguriert und gestartet werden. - -Hier die zusätzlichen Kommandos für den Lua Controller: - -- `config` dient zur Konfiguration des Schiebers, analog zum manuellen Konfiguration über das Menü. - Beispiel: `$send_cmnd(1234, "config", "default:dirt")` - Mit `$send_cmnd(1234, "config", "")` wird die Konfiguration gelöscht -- `limit` dient zum Setzen der Anzahl der Items für die Durchlaufbegrenzer Betriebsart: - Beispiel: `$send_cmnd(1234, "init", 7)` - - -[ta4_pusher|image] - -### TA4 Kiste / TA4 Chest - -Die Funktion entspricht der von TA3. Die Kiste kann aber mehr Inhalt aufnehmen. - -Zusätzlich besitzt die TA4 Kiste ein Schatteninventar zur Konfiguration. Hier können bestimmte Speicherplätze mit einem Item vorbelegt werden. Vorbelegte Speicherplätze werden beim Füllen nur mit diesen Items belegt. Zum Leeren eines vorbelegten Speicherplatzes wird ein TA4 Schieber oder TA4 Injektor mit entsprechender Konfiguration benötigt. - -[ta4_chest|image] - -### TA4 8x2000 Kiste / TA4 8x2000 Chest - -Die TA4 8x2000 Kiste hat kein normales Inventar wir andere Kisten, sondern verfügt über 8 Speicher, wobei jeder Speicher bis zu 2000 Items einer Sorte aufnehmen kann. Über die orangefarbenen Taster können Items in den Speicher verschoben bzw. wieder heraus geholt werden. Die Kiste kann auch wie sonst üblich mit einem Schieber (TA2, TA3 oder TA4) gefüllt bzw. geleert werden. - -Wird die Kiste mit einem Schieber gefüllt, so füllen sich alle Speicherplätze von links nach rechts. Sind alle 8 Speicher voll und können keine weiteren Items hinzugefügt werden, so werden weitere Items werden abgewiesen. - -**Reihenfunktion** - -Mehrere TA4 8x2000 Kisten können zu einer großen Kiste mit mehr Inhalt verbunden werden. Dazu müssen die Kisten in einer Reihe hintereinander gesetzt werden. - -Zuerst muss die Front-Kiste gesetzt werden, dann werden die Stapel-Kisten mit gleicher Blickrichtung dahinter gesetzt (alle Kisten haben die Front in Richtung Spieler). Bei 2 Kisten in Reihe erhöht sich die Größe auf 8x4000, usw. - -Die angereihten Kisten können nun nicht mehr entfernt werden. Um die Kisten wieder abbauen zu können, gibt es zwei Möglichkeiten: - -- Die Frontkiste leeren und entfernen. Damit wird die nächste Kiste entsperrt und kann entfernt werden. -- Die Frontkiste soweit leeren dass alle Speicherplätzen maximal 2000 Items beinhalten. Damit wird die nächste Kiste entsperrt und kann entfernt werden. - -Die Kisten haben eine "Reihenfolge" Checkbox. Wird diese Checkbox aktiviert, werden die Speicherplätze durch einen Schieber nicht mehr vollständig entleert. Das letzte Item verbleibt als Vorbelegung in dem Speicherplatz. Damit ergibt sich eine feste Zuordnung von Items zu Speicherplätzen. - -Die Kiste kann nur von den Spielern genutzt werden, die an diesem Ort auch bauen können, also Protection Rechte besitzen. Es spielt dabei keine Rolle, wer die Kiste setzt. - -Der Kiste besitzt ein zusätzliches Kommandos für den Lua Controller: - -- `count` dient zur Anfrage, wie viele Items in der Kiste sind. - Beispiel 1: `$send_cmnd(CHEST, "count")` --> Summe der Items über alle 8 Speicher - Beispiel 2: `$send_cmnd(CHEST, "count", 2)` --> Anzahl der Items in Speicher 2 (zweiter von links) -- `storesize` wird verwendet, um die Größe eines der acht Speicher auszulesen - Beispiel: `$send_cmnd(CHEST, "storesize")` -> Funktion liefert bspw. 6000 zurück - -[ta4_8x2000_chest|image] - - - -### TA4 Verteiler / Distributor - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 24 Items alle 4 s, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 12 Items alle 4 s. - -[ta4_distributor|image] - -### TA4 Hochleistungs-Verteiler / High Performance Distributor - -Die Funktion entspricht dem normalen TA4 Verteiler, mit zwei Unterschieden: -Die Verarbeitungsleistung beträgt 36 Items alle 4 s, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s. -Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden. - -[ta4_high_performance_distributor|image] - -### TA4 Kiessieb / Gravel Sieve - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 5 ku Strom. - -[ta4_gravelsieve|image] - -### TA4 Mühle / Grinder - -Die Funktion entspricht der von TA2. -Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 9 ku Strom. - -[ta4_grinder|image] - -### TA4 Steinbrecher / Quarry - -Die Funktion entspricht weitgehend der von TA2. - -Zusätzlich kann die Lochgröße zwischen 3x3 und 11x11 Blöcken eingestellt werden. -Die maximale Tiefe beträgt 80 Meter. Der Steinbrecher benötigt 14 ku Strom. - -[ta4_quarry|image] - -### TA4 Elektronikfabrik / Electronic Fab - -Die Funktion entspricht der von TA2, nur werden hier verschiedene Chips produziert. -Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierfür 12 ku Strom. - -[ta4_electronicfab|image] - -### TA4 Injektor / Injector - -Die Funktion entspricht der von TA3. - -Die Verarbeitungsleistung beträgt bis zu 8 mal vier Items alle 4 Sekunden. - -[ta4_injector|image] - -### TA4 Recycler - -Der Recycler ist eine Maschine, die alle Techage Rezepte rückwärts abarbeitet, also Maschinen und Blöcke wieder in die Bestandteile zerlegen kann. Die Maschine kann so ziemlich alle Techage und Hyperloop Blöcke zerlegen. -Aber nicht alle Zutaten/Materialien der Rezepte lassen sich recyclen: - -- Holz wird zu Sticks -- Stein wird zu Sand oder Kies -- Halbleiter/Chips können nicht recycelt werden -- Werkzeuge können nicht recycelt werden - -Die Verarbeitungsleistung beträgt ein Item alle 8 s. Der Block benötigt hierfür 16 ku Strom. - -[ta4_recycler|image] diff --git a/techage/manuals/manual_ta4_EN.md b/techage/manuals/manual_ta4_EN.md deleted file mode 100644 index 6dd91d4..0000000 --- a/techage/manuals/manual_ta4_EN.md +++ /dev/null @@ -1,1017 +0,0 @@ -# TA4: Present - -Renewable energy sources such as wind, sun and biofuels help you to leave the oil age. With modern technologies and intelligent machines you set out into the future. - -[techage_ta4|image] - - -## Wind Turbine - -A wind turbine always supplies electricity when there is wind. There is no wind in the game, but the mod simulates this by turning the wind turbines only in the morning (5:00 - 9:00) and in the evening (17:00 - 21:00). A wind turbine only supplies electricity if it is set up in a suitable location. - -The TA wind power plants are pure offshore plants, which means that they have to be built in the sea. This means that wind turbines can only be build in a sea (occean) biome and that there must be sufficient water and a clear view around the mast. - -To find a suitable spot, click on the water with the wrench (TechAge Info Tool). A chat message will show you whether this position is suitable for the mast of the wind turbine. - -The current must be led from the rotor block down through the mast. First pull the power line up and then "plaster" the power cable with TA4 pillar blocks. A work platform can be built below. The plan on the right shows the structure in the upper part. - -The wind turbine delivers 70 ku, but only 8 hours a day (see above). - -[ta4_windturbine|plan] - - -### TA4 Wind Turbine - -The wind turbine block (rotor) is the heart of the wind turbine. This block must be placed on top of the mast. Ideally at Y = 15, then you just stay within a map / forceload block. -When you start the turbine, all conditions for the operation of the wind turbine are checked. If all conditions are met, the rotor blades (wings) appear automatically. Otherwise you will get an error message. - -[ta4_windturbine|image] - - -### TA4 Wind Turbine Nacelle - -This block must be placed on the black end of the wind turbine block. - -[ta4_nacelle|image] - - -### TA4 Wind Turbine Signal Lamp - -This flashing light is only for decorative purposes and can be placed on top of the wind turbine block. - -[ta4_blinklamp|image] - - -### TA4 Pillar - -This builds the mast for the wind turbine. However, these blocks are not set by hand but must be set with the help of a trowel, so that the power line to the mast tip is replaced with these blocks (see under TA power cable). - -[ta4_pillar|image] - - -## Solar System - -The solar system only produces electricity when the sun is shining. In the game this is every game day from 6:00 am to 6:00 pm. -The same power is always available during this time. After 6:00 p.m., the solar modules switch off completely. - -The biome temperature is decisive for the performance of the solar modules. The hotter the temperature, the higher the yield. -The biome temperature can be determined with the Techage Info Tool (wrench). It typically fluctuates between 0 and 100: - -- full power is available at 100 -- at 50, half the power is available -- at 0 there is no service available - -It is therefore advisable to look for hot steppes and deserts for the solar system. -The overhead lines are available for the transport of electricity. -However, hydrogen can also be produced, which can be transported and converted back into electricity at the destination. - -The smallest unit in a solar system is two solar modules and one carrier module. The carrier module must be placed first, the two solar modules to the left and right next to it (not above!). - -The plan on the right shows 3 units, each with two solar modules and one carrier module, connected to the inverter via red cables. - -Solar modules supply DC voltage, which cannot be fed directly into the power grid. Therefore, the solar units must first be connected to the inverter via the red cable. This consists of two blocks, one for the red cable to the solar modules (DC) and one for the gray power cable to the power grid (AC). - -The map area where the solar system is located must be fully loaded. This also applies to the direct position above the solar module, because the light intensity is regularly measured there. It is therefore advisable to first set a forceload block and then to place the modules within this area. - -[ta4_solarplant|plan] - - -### TA4 Solar Module - -The solar module must be placed on the carrier module. Two solar modules are always required. -In a pair, the solar modules perform up to 3 ku, depending on the temperature. -With the solar modules, care must be taken that they have full daylight and are not shaded by blocks or trees. This can be tested with the Info Tool (wrench). - -[ta4_solarmodule|image] - - -### TA4 Solar Carrier Module - -The carrier module is available in two heights (1m and 2m). Both are functionally identical. -The carrier modules can be placed directly next to one another and thus connected to form a row of modules. The connection to the inverter or to other module series must be made with the red low-voltage cables or the low-voltage junction boxes. - -[ta4_solarcarrier|image] - - -### TA4 Solar Inverter - -The inverter converts the solar power (DC) into alternating current (AC) so that it can be fed into the power grid. -An inverter can feed a maximum of 100 ku of electricity, which corresponds to 33 solar modules or more. - -[ta4_solar_inverter|image] - - -### TA4 Low Power Cable - -The low voltage cable is used to connect rows of solar modules to the inverter. The cable must not be used for other purposes. - -The maximum cable length is 200 m. - -[ta4_powercable|image] - - -### TA4 Low Voltage Junction Box - -The junction box must be placed on the floor. It has only 4 connections (in the 4 directions). - -[ta4_powerbox|image] - - -### TA4 Street Lamp Solar Cell - -As the name suggests, the street lamp solar cell is used to power a street lamp. A solar cell can supply two lamps (1 ku). The solar cell stores the sun's energy during the day and delivers the electricity to the lamp at night. That means the lamp only glows in the dark. - -This solar cell cannot be combined with the other solar modules. - -[ta4_minicell|image] - - - -## Thermal Energy Storage - -The thermal energy storage replaces the battery block from TA3. - -The thermal energy store consists of a concrete shell (concrete blocks) filled with gravel. Five sizes of the storage are possible: - -- Cover with 5x5x5 concrete blocks, filled with 27 gravel, storage capacity: 22.5 kud -- Cover with 7x7x7 concrete blocks, filled with 125 gravel, storage capacity: 104 kud -- Cover with 9x9x9 concrete blocks, filled with 343 gravel, storage capacity: 286 kud -- Cover with 11x11x11 concrete blocks, filled with 729 gravel, storage capacity: 610 kud -- Cover with 13x13x13 concrete blocks, filled with 1331 gravel, storage capacity: 1112 kud - -A window made of an obsidian glass block may be in the concrete shell. This must be placed fairly in the middle of the wall. Through this window you can see whether the storage is loaded more than 80%. In the plan on the right you can see the structure of TA4 heat exchanger consisting of 3 blocks, the TA4 turbine and the TA4 generator. Pay attention to the alignment of the heat exchanger (the arrow at block 1 must point to the turbine). - -Contrary to the plan on the right, the connections on the storage block must be on the same level (arranged horizontally, i.e. not below and above). The pipe inlets (TA4 Pipe Inlet) must be exactly in the middle of the wall and face each other. The yellow TA4 pipes are used as steam pipes. The TA3 steam pipes cannot be used here. -Both the generator and the heat exchanger have a power connection and must be connected to the power grid. - -In principle, the heat storage system works exactly the same as the batteries, only with much more storage capacity. - -In order for the heat storage system to work, all blocks (also the concrete shell and gravel) must be loaded using a forceload block. - -[ta4_storagesystem|plan] - - -### TA4 Heat Exchanger - -The heat exchanger consists of 3 parts that must be placed on top of each other, with the arrow of the first block pointing towards the turbine. The pipes must be built with the yellow TA4 pipes. -The heat exchanger must be connected to the power grid. The energy storage device is recharged via the heat exchanger, provided that sufficient electricity is available. - -[ta4_heatexchanger|image] - - -### TA4 Turbine - -The turbine is part of the energy storage. It must be placed next to the generator and connected to the heat exchanger via TA4 tubes as shown in the plan. - -[ta4_turbine|image] - - -### TA4 Generator - -The generator is used to generate electricity. Therefore, the generator must also be connected to the power grid. -The generator is part of the energy storage. It is used to generate electricity and thus releases the energy from the energy storage unit. Therefore, the generator must also be connected to the power grid. - -Important: Both, heat exchanger and generator must be connected to the same power grid! - -[ta4_generator|image] - - -### TA4 Pipe Inlet - -One pipe inlet block each must be installed on both sides of the storage block. The blocks must face each other exactly. - -The pipe inlet blocks **cannot** be used as normal wall openings, use the TA3 pipe wall entry blocks instead. - -[ta4_pipeinlet|image] - - -### TA4 Pipe - -With TA4, the yellow pipes are used for the transmission of gas and liquids. -The maximum cable length is 100 m. - -[ta4_pipe|image] - - - -## Power Distribution - -With the help of power cables and junction boxes, power networks of up to 1000 blocks/nodes can be set up. However, it should be noted that distribution boxes must also be counted. This means that up to 500 generators/storage systems/machines/lamps can be connected to a power grid. - -With the help of an isolating transformer and electricity meter, networks can be connected to form even larger structures. - -[ta4_transformer|image] - -### TA4 Isolation Transformer - -With the help of an isolating transformer, two power grids can be connected to form a larger network. The isolation transformer can transmit electricity in both directions. - -The isolation transformer can transmit up to 300 ku. The maximum value is adjustable via the wrench menu. - -[ta4_transformer|image] - -### TA4 Electric Meter - -With the help of an electricity meter, two electricity networks can be connected to form a larger network. The electricity meter only transmits electricity in one direction (note arrow). The amount of electrical energy passed through (in kud) is measured and displayed. This value can also be queried by a Lua controller using the `consumption` command. The current current can be queried via the command `current`. - -The electricity meter can pass up to 200 ku. The maximum value is adjustable via the wrench menu. - -A power output countdown can also be entered via the wrench menu. When this countdown reaches zero, the electricity meter switches off. The countdown can be queried using the `countdown` command. - -[ta4_electricmeter|image] - -### TA4 Laser - -The TA4 laser is used for wireless power transmission. Two blocks are required for this: TA4 Laser Beam Emitter and TA4 Laser Beam Receiver. There must be an air gap between the two blocks so that the laser beam can be built up from the emitter to the receiver. First the emitter must be placed. This immediately switches on the laser beam and shows possible positions of the receiver. Possible positions for the receiver are also output via a chat message. - -With the laser, distances of up to 96 blocks can be bridged. Once the connection has been established (no current has to flow), this is indicated via the info text of the emitter and also of the receiver. - -The laser blocks themselves do not require any electricity. - -[ta4_laser|image] - - - -## Hydrogen - -Electrolysis can be used to split electricity into hydrogen and oxygen. On the other hand, hydrogen can be converted back into electricity with oxygen from the air using a fuel cell. -This enables current peaks or an excess supply of electricity to be converted into hydrogen and thus stored. - -In the game, electricity can be converted back into electricity via the fuel cell using the electrolyzer in hydrogen and hydrogen. -This means that electricity (in the form of hydrogen) can not only be stored in tanks, but also transported by means of the tank cart. - -However, the conversion of electricity into hydrogen and back is lossy. Out of 100 units of electricity, only 95 units of electricity come out after the conversion to hydrogen and back. - -[ta4_hydrogen|image] - - -### Electrolyzer - -The electrolyzer converts electricity into hydrogen. -It must be powered from the left. On the right, hydrogen can be extracted via pipes and pumps. - -The electrolyzer can draw up to 35 ku of electricity and then generates a hydrogen item every 4 s. -200 units of hydrogen fit into the electrolyzer. - -The electrolyzer has a wrench menu for setting the current consumption and the switch-off point. - -If the power stored in the power grid falls below the specified value of the switch-off point, the electrolyzer switches off automatically. This prevents the storage systems from running empty. - -[ta4_electrolyzer|image] - - -### Fuel Cell - -The fuel cell converts hydrogen into electricity. -It must be supplied with hydrogen from the left by a pump. The power connection is on the right. - -The fuel cell can deliver up to 34 ku of electricity and needs a hydrogen item every 4 s. - -Usually the fuel cell works as a category 2 generator (like other storage systems). -In this case, no other category 2 blocks such as the battery block can be charged. However, the fuel cell can also be used as a category 1 generator via the check box. - -[ta4_fuelcell|image] - - -## Chemical Reactor - -The reactor is used to process the ingredients obtained from the distillation tower or from other recipes into new products. -The plan on the left shows only one possible variant, since the arrangement of the silos and tanks depends on the recipe. - -The primary output product is always output to the side of the reactor stand, regardless of whether it is a powder or a liquid. The (secondary) waste product is always discharged at the bottom of the reactor stand. - -A reactor consists of: -- Various tanks and silos with the ingredients that are connected to the doser via pipes -- optionally a reactor base, which discharges the waste from the reactor (only necessary for recipes with two output products) -- the reactor stand, which must be placed on the base (if available). The stand has a power connection and draws 8 ku during operation. -- The reactor vessel that has to be placed on the reactor stand -- The filler pipe that must be placed on the reactor vessel -- The dosing device, which has to be connected to the tanks or silos and the filler pipe via pipes - -Note 1: Liquids are only stored in tanks, solids and substances in powder form only in silos. This applies to ingredients and output products. - -Note 2: Tanks or silos with different contents must not be connected to a pipe system. In contrast, several tanks or silos with the same content may hang in parallel on one line. - -Cracking breaks long chains of hydrocarbons into short chains using a catalyst. -Gibbsite powder serves as a catalyst (is not consumed). It can be used to convert bitumen into fueloil, fueloil into naphtha and naphtha into gasoline. - -In hydrogenation, pairs of hydrogen atoms are added to a molecule to convert short-chain hydrocarbons into long ones. -Here iron powder is required as a catalyst (is not consumed). It can be used to convert gas (propane) into isobutane, -isobutane into gasoline, gasoline into naphtha, naphtha into fueloil, and fueloil into bitumen. - - -[ta4_reactor|plan] - - -### TA4 Doser - -Part of the chemical reactor. -Pipes for input materials can be connected on all 4 sides of the doser. The materials for the reactor are discharged upwards. - -The recipe can be set and the reactor started via the doser. - -As with other machines: -- if the doser is in standby mode, one or more ingredients are missing -- if the doser is in the blocked state, the output tank or silo is full, defective or incorrectly connected - -The doser does not need any electricity. A recipe is processed every 10 s. - -[ta4_doser|image] - -### TA4 Reactor - -Part of the chemical reactor. The reactor has a inventory for the catalyst items (for cracking and hydrogenation recipes). - -[ta4_reactor|image] - - -### TA4 Filler Pipe - -Part of the chemical reactor. Must be placed on the reactor. If this does not work, remove the pipe at the position above and place it again. - -[ta4_fillerpipe|image] - - -### TA4 Reactor Stand - -Part of the chemical reactor. Here is also the power connection for the reactor. The reactor requires 8 ku of electricity. - -The stand has two pipe connections, to the right for the starting product and down for the waste, such as red mud in aluminum production. - -[ta4_reactorstand|image] - - -### TA4 Reactor Base - -Part of the chemical reactor. Is required for the drainage of the waste product. - -[ta4_reactorbase|image] - - -### TA4 Silo - -Part of the chemical reactor. Is required to store substances in powder or granule form. - -[ta4_silo|image] - - - - -## ICTA Controller - -The ICTA controller (ICTA stands for "If Condition Then Action") is used to monitor and control machines. The controller can be used to read in data from machines and other blocks and, depending on this, switch other machines and blocks on / off. - -Machine data is read in and blocks and machines are controlled using commands. Chapter TA3 -> Logic / switching blocks is important for understanding how commands work. - -The controller requires a battery to operate. The display is used to output data, the signal tower to display errors. - -[ta4_icta_controller|image] - - - -### TA4 ICTA controller - -The controller works on the basis of `IF THEN ` rules. Up to 8 rules can be created per controller. - -Examples of rules are: - -- If a distributor is `blocked`, the pusher in front of it should be switched off -- If a machine shows an error, this should be shown on the display - -The controller checks these rules cyclically. To do this, a cycle time in seconds (`` Cycle / s '') must be specified for each rule (1..1000). - -For rules that evaluate an on / off input, e.g. from a switch or detector, cycle time 0 must be specified. The value 0 means that this rule should always be carried out when the input signal has changed, e.g. the button has sent a new value. - -All rules should only be executed as often as necessary. This has two advantages: - -- the battery of the controller lasts longer (each controller needs a battery) -- the load for the server is lower (therefore fewer lags) - -You have to set a delay time (`after/s`) for each action. If the action is to be carried out immediately, 0 must be entered. - -The controller has its own help and information on all commands via the controller menu. - -[ta4_icta_controller|image] - -### Battery - -The battery must be placed in close proximity to the controller, i.e. in one of the 26 positions around the controller. - -[ta4_battery|image] - -### TA4 Display - -The display shows its number after placement. The display can be addressed via this number. Texts can be output on the display, whereby the display can display 5 lines and thus 5 different texts. - -Lines of text are always left-aligned. If the text is to be centered horizontally, the text must be preceded by the character "\t" (tabulator). - -The display is updated at most once per second. - -[ta4_display|image] - -### TA4 Display XL - -The TA4 Display XL is twice the size of the TA4 display. - -Lines of text are always left-aligned. If the text is to be centered horizontally, the text must be preceded by the character "\t" (tabulator). - -The display is updated every two seconds at most. - -[ta4_displayXL|image] - - -### TA4 Signal Tower - -The signal tower can display red, green and orange. A combination of the 3 colors is not possible. - -[ta4_signaltower|image] - - - -## TA4 Lua Controller - -As the name suggests, the Lua controller must be programmed in the Lua programming language. The manual in English is here available: - -https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md - -The Lua controller also requires a battery. The battery must be placed in close proximity to the controller, i.e. in one of the 26 positions around the controller. - -[ta4_lua_controller|image] - -### TA4 Lua Server - -The server is used for the central storage of data from several Lua controllers. It also saves the data after a server restart. - -[ta4_lua_server|image] - -### TA4 Sensor Box / Chest - -The TA4 sensor box is used to set up automatic warehouses or vending machines in conjunction with the Lua controller. -If something is put into the box or removed, or one of the "F1" / "F2" keys is pressed, an event signal is sent to the Lua controller. -The sensor box supports the following commands: - -- The status of the box can be queried via `state = $send_cmnd(, "state")`. Possible answers are: "empty", "loaded", "full" -- The last player action can be queried via `name, action = $send_cmnd(, "action")`. `name` is the player name. One of the following is returned as `action`: "put", "take", "f1", "f2". -- The contents of the box can be read out via `stacks = $send_cmnd(, "stacks")`. See: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest -- Via `$send_cmnd(, "text", "press both buttons and\nput something into the chest")` the text can be set in the menu of the sensor box. - -The checkbox "Allow public chest access" can be used to set whether the box can be used by everyone or only by players who have access/protection rights here. - -[ta4_sensor_chest|image] - -### TA4 Lua Controller Terminal - -The terminal is used for input / output for the Lua controller. - -[ta4_terminal|image] - - - -## TA4 Logic/Switching Modules - -### TA4 Button/Switch - -Only the appearance of the TA4 button/switch has changed. The functionality is the same as with the TA3 button/switch. With the wrench menu, however, the data can be changed later. - -[ta4_button|image] - -### TA4 2x Button - -This block has two buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition, the command that is to be sent can be configured for each button. - -[ta4_button_2x|image] - - -### TA4 4x Button - -This block has four buttons that can be individually configured using the wrench menu. The labeling and the target block address can be configured for each button. In addition, the command that is to be sent can be configured for each button. - -[ta4_button_4x|image] - -### TA4 2x Signal Lamp - -This block has two lamps that can be controlled individually. Each lamp can display the colors "red", "green" and "amber". The labeling for both lamps can be configured via the wrench menu. The lamps can be controlled using the following commands: - -- Switch lamp 1 to red: `$send_cmnd(1234, "red", 1)` -- Switch lamp 2 to green: `$send_cmnd(1234, "green ", 2)` -- Switch lamp 1 to orange: `$send_cmnd(1234, "amber", 1)` -- Switch lamp 2 off: `$send_cmnd(1234, "off", 2)` - -[ta4_signallamp_2x|image] - -### TA4 4x Signal Lamp - -This block has four lamps that can be controlled individually. Each lamp can display the colors "red", "green" and "amber". The labeling for all lamps can be configured via the wrench menu. The lamps can be controlled using the following commands: - -- Switch lamp 1 to red: `$send_cmnd(1234, "red", 1)` -- Switch lamp 2 to green: `$send_cmnd(1234, "green ", 2)` -- Switch lamp 3 to orange: `$send_cmnd(1234, "amber", 3)` -- Switch lamp 4 off: `$send_cmnd(1234, "off", 4)` - -[ta4_signallamp_4x|image] - -### TA4 Player Detector - -Only the appearance of the TA4 player detector has changed. The functionality is the same as with the TA3 player detector. - -[ta4_playerdetector|image] - -### TA4 State Collector - -[ta4_collector|image] - -The status collector queries all configured machines in turn for the status. If one of the machines has reached or exceeded a preconfigured status, an "on" command is sent. For example, many machines can be easily monitored for faults from a Lua controller. - -### TA4 Detector - -The functionality is the same as for the TA3 detector. In addition, the detector counts the items passed on. -This counter can be queried with the 'count' command and reset with 'reset'. - -[ta4_detector|image] - -### TA4 Node Detector - -The functionality is the same as with the TA3 Node Detector. - -In contrast to the TA3 node detector, the positions to be monitored can be configured individually here. To do this, the "Record" button must be pressed. Then all blocks must be clicked, the position of which is to be checked. Then the "Done" button must be pressed. - -Up to 4 blocks can be selected. - -[ta4_nodedetector|image] - -### TA4 Energy Storage Charge Detector - -The charge detector measures the state of charge of the power grid's energy storage every 8 s. - -If the value falls below a configurable threshold (switching point), a command (default: "off") is sent. If the value rises above this switching point again, a second command (default: "on") is sent. This allows consumers to be disconnected from the grid when the charge level of the energy storage device falls below the specified switching point. - -To do this, the charge detector must be connected to the grid via a junction box. The charge detector is configured via the open-end wrench menu. - -[ta4_chargedetector|image] - -### TA4 Gaze Sensor - -The TA4 gaze sensor generates a command when the block is viewed/focused by the owner or other configured players and sends a second command when the block is no longer focused. It thus serves as a replacement for buttons/switches, for example to open/close doors. - -The TA4 Gaze Sensor can only be programmed using the open-end wrench menu. If you have an open-end wrench in your hand, the sensor does not trigger, even if it is focused. - -[ta4_gaze_sensor|image] - -### TA4 Sequencer - -Entire processes can be programmed using the TA4 sequencer. Here's an example: - -``` --- this is a comment -[1] send 1234 a2b -[30] send 1234 b2a -[60] goto 1 -``` - -- Each line begins with a number which corresponds to a point in time `[]` -- Values from 1 to 50000 are permitted for times -- 1 corresponds to 100 ms, 50000 corresponds to about 4 game days -- Empty lines or comments are allowed (`-- comment`) -- With `send ` you can send a command to a block -- With `goto ` you can jump to another line / point in time -- With `stop` you can stop the sequencer with a delay so that it does not receive a new command - accepts from a button or other block (to complete a movement) - Without `stop`, the sequencer goes into stopped mode immediately after the last command. - -The TA4 sequencer supports the following techage commands: - -- `goto ` Jump to a command line and start the sequencer -- `stop` Stop the sequencer -- `on` and `off` as aliases for `goto 1` resp. `stop` - -The `goto` command is only accepted when the sequencer is stopped. - -The cycle time (default: 100 ms) can be changed for the sequencer via the open-end wrench menu. - -[ta4_sequencer|image] - - - -## Move/Turn Controller - -### TA4 Move Controller - -The TA4 Move Controller is similar to "Door Controller 2", but the selected blocks are not removed, but can be moved. -Since the moving blocks can take players and mobs standing on the block with them, elevators and similar transport systems can be built with them. - -Instructions: - -- Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained) -- the "flight route" must be entered via an x, y, z specification (relative) (the maximum distance (x+y+z) is 200 m) -- The movement can be tested with the menu buttons "Move A-B" and "Move B-A" -- you can also fly through walls or other blocks -- The target position for the blocks can also be occupied. In this case, the blocks are saved "invisibly". This is intended for sliding doors and the like - -The Move Controller supports the following techage commands: - -- `a2b` Move block from A to B. -- `b2a` Move block from B to A. -- `move` Move block to the other side - -You can switch to the `move xyz` operating mode via the wrench menu. After switching, the following techage commands are supported: - -- `move2` With the command, the flight route must also be specified as an x,y,z vector. - Example Lua Controller: `$send_cmnd(MOVE_CTLR, "move2", "0,12,0")` -- `reset` move block(s) back to start position - -**Important instructions:** - -- If several blocks are to be moved, the block that is to take the players/mobs must be clicked first when training. -- If the block that is supposed to take the players/mobs has a reduced height, the height must be set in the controller using the open-ended wrench menu (e.g. height = 0.5). Otherwise the player/mob will not be "found" and will not be taken away. - -[ta4_movecontroller|image] - -### TA4 Turn Controller - -The TA4 turn controller is similar to the "Move Controller", but the selected blocks are not moved, but rotated around their center to the right or left. - -Instructions: - -- Set the controller and train the blocks to be moved via the menu (up to 16 blocks can be trained) -- The movement can be tested with the menu buttons "Turn left" and "Turn right" - -The turn controller supports the following techage commands: - -- `left` Turn left -- `right` Turn right -- `uturn` Turn 180 degrees - -[ta4_turncontroller|image] - - - - -## TA4 Lamps - -TA4 contains a series of powerful lamps that enable better illumination or take on special tasks. - -### TA4 LED Grow Light - -The TA4 LED grow light enables fast and vigorous growth of all plants from the `farming` mod. The lamp illuminates a 3x3 field, so that plants can also be grown underground. -The lamp must be placed one block above the ground in the middle of the 3x3 field. - -The lamp can also be used to grow flowers. If the lamp is placed over a 3x3 flower bed made of "Garden Soil" (Mod `compost`), the flowers grow there automatically (above and below ground). - -You can harvest the flowers with the Signs Bot, which also has a corresponding sign that must be placed in front of the flower field. - -The lamp requires 1 ku of electricity. - -[ta4_growlight|image] - -### TA4 Street Lamp - -The TA4 LED street lamp is a lamp with particularly strong illumination. The lamp consists of the lamp housing, lamp arm and lamp pole blocks. - -The current must be led from below through the mast up to the lamp housing. First pull the power line up and then "plaster" the power cable with lamp pole blocks. - -The lamp requires 1 ku of electricity. - -[ta4_streetlamp|image] - -### TA4 LED Industrial Lamp - -The TA4 LED industrial lamp is a lamp with particularly strong illumination. The lamp must be powered from above. - -The lamp requires 1 ku of electricity. - -[ta4_industriallamp|image] - - - - -## TA4 Liquid Filter - -The liquid filter filters red mud. -A part of the red mud becomes lye, which can be collected at the bottom in a tank. -The other part becomes desert cobblestone and clutters the filter material. -If the filter is too clogged, it has to be cleaned and re-filled. -The filter consists of a base layer, 7 identical filter layers and a filling layer at the top. - -[ta4_liquid_filter|image] - -### Base Layer - -You can see the structure of this layer in the plan. - -The lye is collected in the tank. - -[ta4_liquid_filter_base|plan] - -### Gravel Layer - -This layer has to be filled with gravel as shown in the plan. -In total, there must be seven layers of gravel. -The filter will become cluttered over time, so that it has to be cleaned and re-filled. - -[ta4_liquid_filter_gravel|plan] - -### Filling Layer - -This layer is used to fill the filter with red mud. -The red mud must be pumped into the filler pipe. - -[ta4_liquid_filter_top|plan] - - - - -## TA4 Collider (Particle Accelerator) - -The Collider is a research facility that conducts basic research. Experience points can be collected here, which are required for TA5 (Future Age). - -Like its original at CERN in Geneva, the collider must be built underground. The standard setting here is Y <= -28. The value can, however, be changed by the server personnel via configuration. Please ask or try the "TA4 Collider Detector Worker" block. - -Only one collider can be operated per player. So it makes no sense to set up two or more colliders. Experience points are credited to the player who owns the collider. The experience points cannot be transferred. - -A collider consists of a "ring" made of tubes and magnets as well as a detector with a cooling system. - -- The detector is the heart of the system. This is where the scientific experiments take place. The detector is 3x3x7 blocks in size. -- 22 TA4 Collider Magnets (not the TA4 Collider Detector Magnets!) must be connected to each other via 5 blocks of the TA4 vacuum tube. Each magnet also requires electricity and a gas connection for cooling. The whole thing forms (as shown in the plan on the right) a square with an edge length of 37 meters. - -The plan shows the facility from above: - -- the gray block is the detector with the worker block in the middle -- the red blocks are the magnets, the blue the vacuum tubes - -[techage_collider_plan|plan] - -### Detector - -The detector is set up automatically with the help of the "TA4 Collider Detector Worker" block (similar to the derrick). All of the materials required for this must first be placed in the worker block. The detector is shown symbolically on the worker block. The detector is set up across the worker block. - -The detector can also be dismantled again with the help of the worker block. - -The connections for electricity, gas and vacuum tubes are located on the two front sides of the detector. A TA4 pump must be connected at the top in order to suck the tube empty / to create the vacuum. - -The cooling system must be connected to the rear of the detector. The cooling system is shown in the plan on the right. In addition to the TA4 heat exchanger of the energy storage unit (which is used here for cooling), a TA4 cooler block is also required. - -Note: The arrow on the heat exchanger must point away from the detector. The heat exchanger must also be supplied with electricity. - -[ta4_cooler|plan] - - -- In addition, cooling is required, which must also be installed at the detector. Isobutane is required for cooling. -- The system requires quite a bit of electricity. Therefore, it makes sense to have your own power supply. - -### Control / TA4 Terminal - -The collider is controlled via a TA4 terminal (not via the TA4 Lua controller terminal). - -This terminal must be connected to the detector. The number of the detector is displayed as info text on the worker block. - -The terminal supports the following commands: - -- `connect ` (connect to the detector) -- `start` (starting the detector) -- `stop` (stop the detector) -- `test ` (checking a magnet) -- `points` (query of the experience points already achieved) - -If an error occurs on a magnet during the `start`, the number of the magnet is output. The `test` command can be used to request further information on the magnet error. - -[ta4_terminal|image] - -### Cooling and power - -Each TA4 Collider magnet must also be supplied with electricity (as shown on the right in the plan) and with Isobutane for cooling: - -- The connection for the power is on the top of the magnet. -- The connection for the cooling is on the front of the magnet. -- A TA4 pump and a TA4 tank with at least 250 units of isobutane are also required to cool the entire system. -- The system also requires a lot of electricity. It therefore makes sense to have your own power supply with at least 145 ku. - -[techage_collider_plan2|plan] - -### Construction - -The following sequence is recommended when setting up the collider: - -- Put a forceload block. Only the detector with the cooling system has to be in the area of ​​the forceload block. -- Set the worker block, fill it with items and set up the detector via the menu -- Build the ring with tubes and magnets -- Connect all magnets and the detector with power cables -- Connect all magnets and the detector with the yellow tubes and pump the isobutane into the tube system with a pump -- Install a TA4 pump as a vacuum pump on the detector and switch it on (no additional tank is required). If the pump goes into "standby", the vacuum is established. This will take a few seconds -- assemble the cooler (heat exchanger) and connect it to the power cable -- Place the TA4 terminal in front of the detector and connect it to the detector via `connect ` -- Switch on / connect the power supply -- switch on the cooler (heat exchanger) -- Switch on the detector via `start` on the TA4 terminal. After a few test steps, the detector goes into normal operation or outputs an error. -- The collider has to run continuously and then gradually delivers experience points. For 10 points, the collider has to run for a few hours - -[techage_ta4c|image] - - - - -## More TA4 Blocks - -### TA4 Recipe Block - -Up to 10 recipes can be saved in the recipe block. These recipes can then be called up via a TA4 Autocrafter command. This enables the autocrafter's recipe to be configured using a command. The recipes in the recipe block can also be queried directly using a command. - -`input ` reads a recipe from the TA4 recipe block. `` is the number of the recipe. The block returns a list of recipe ingredients. - -Example: `$send_cmnd(1234, "input", 1)` - -[ta4_recipeblock|image] - -### TA4 Autocrafter - -The function corresponds to that of TA3. - -The processing power is 4 items every 4 s. The autocrafter requires 9 ku of electricity for this. - -In addition, the TA4 Autocrafter supports the selection of different recipes using the following commands: - -`recipe "."` switches the autocrafter to a recipe from the TA4 Recipe Block. `` is the number of the recipe block, `` the recipe number. Example: `$send_cmnd(1234, "recipe", "5467.1")` - -Alternatively, a recipe can also be selected via the list of ingredients, such as: -`$send_cmnd(1234, "recipe", "default:coal_lump,,,default:stick")` -All technical names of a recipe must be specified here, separated by commas. See also the command `input` in the TA4 recipe block. - -The `flush` command moves all items from the input inventory to the output inventory. The command returns `true` if the input inventory was completely emptied. If `false` was returned (output inventory full), the command must be repeated at a later time. - -[ta4_autocrafter|image] - -### TA4 Tank - -See TA3 tank. - -A TA4 tank can hold 2000 units or 200 barrels of liquid. - -[ta4_tank|image] - -### TA4 Pump - -See TA3 pump. - -The TA4 pump pumps 8 units of liquid every two seconds. - -In the "Flow limiter" mode, the number of units pumped by the pump can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of units in the menu. Once the configured number of units have been pumped, the pump will turn off. When the pump is turned on again, it will pump the configured number of units again and then turn off. - -The flow limiter can also be configured and started using a Lua or Beduino controller. - -The pump also supports the `flowrate` command. This allows the total flow rate through the pump to be queried. - -[ta4_pump|image] - -### TA4 Furnace Heater - -With TA4, the industrial furnace also has its electrical heating. The oil burner and the blower can be replaced with the heater. - -The heater requires 14 ku of electricity. - -[ta4_furnaceheater|image] - -### TA4 Water Pump (deprecated) - -This block can no longer be crafted and will be replaced by the TA4 water inlet block. - -### TA4 Water Inlet - -Some recipes require water. The water must be pumped from the sea with a pump (water at y = 1). A "pool" made up of a few water blocks is not sufficient for this! - -To do this, the water inlet block must be placed in the water and connected to the pump via pipes. If the block is placed in the water, it must be ensured that there is water under the block (water must be at least 2 blocks deep). - -[ta4_waterinlet|image] - -### TA4 Tube - -TA4 also has its own tubes in the TA4 design. These can be used like standard tubes. -But: TA4 pushers and TA4 distributors only achieve their full performance when used with TA4 tubes. - -[ta4_tube|image] - -### TA4 Pusher - -The function basically corresponds to that of TA2 / TA3. In addition, a menu can be used to configure which objects should be taken from a TA4 chest and transported further. -The processing power is 12 items every 2 s, if TA4 tubes are used on both sides. Otherwise there are only 6 items every 2 s. - -In the "flow limiter" mode, the number of items that are moved by the pusher can be limited. The flow limiter mode can be activated via the open-end wrench menu by configuring the number of items in the menu. As soon as the configured number of items have been moved, the pusher switches off. If the pusher is switched on again, it moves the configured number of items again and then switches off. - -The TA4 pusher can also be configured and started using a Lua or Beduino controller. - -Here are the additional commands for the Lua controller: - -- `config` is used to configure the pusher, analogous to manual configuration via the menu. - Example: `$send_cmnd(1234, "config", "default:dirt")` - With `$send_cmnd(1234, "config", "")` the configuration is deleted -- `limit` is used to set the number of items for the flow limiter mode: - Example: `$send_cmnd(1234, "init", 7)` - -[ta4_pusher|image] - -### TA4 Chest - -The function corresponds to that of TA3. The chest can hold more content. - -In addition, the TA4 chest has a shadow inventory for configuration. Here certain stack locations can be pre-assigned with an item. Pre-assigned inventory stacks are only filled with these items when filling. A TA4 pusher or TA4 injector with the appropriate configuration is required to empty a pre-assigned inventory stacks. - -[ta4_chest|image] - -### TA4 8x2000 Chest - -The TA4 8x2000 chest does not have a normal inventory like other chest, but has 8 stores, whereby each store can hold up to 2000 items of one sort. The orange buttons can be used to move items to or from the store. The box can also be filled or emptied with a pusher (TA2, TA3 or TA4) as usual. - -If the chest is filled with a pusher, all stores fill from left to right. If all 8 stores are full and no further items can be added, further items are rejected. - -**Row function** - -Several TA4 8x2000 chests can be connected to a large chest with more content. To do this, the chests must be placed in a row one after the other. - -First the front chest must be placed, then the stacking chests are placed behind with the same direction of view (all boxes have the front towards the player). With 2 chests in a row, the size increases to 8x4000, etc. - -The rows of chests can no longer be removed. There are two ways to dismantle the chests: - -- Empty and remove the front chest. This unlocks the next chest and can be removed. -- Empty the front chest so far that all stores contain a maximum of 2000 items. This unlocks the next chest and can be removed. - -The chests have an "order" checkbox. If this checkbox is activated, the stores are no longer completely emptied by a pusher. The last item remains in the store as a default. This results in a fixed assignment of items to storage locations. - -The chest can only be used by players who can build at this location, i.e. who have protection rights. It does not matter who sets the chest. - -The chest has an additional command for the Lua controller: - -- `count` is used to request how many items are in the chest. - Example 1: `$send_cmnd(CHEST, "count")` -> Sum of items across all 8 stores - Example 2: `$send_cmnd(CHEST, "count", 2)` -> number of items in store 2 (second from left) -- `storesize` is used to read the size of one of the eight stores: - Example: `$send_cmnd(CHEST, "storesize")` -> function returns e.g. 6000 - -[ta4_8x2000_chest|image] - - - -### TA4 Distributor - -The function corresponds to that of TA2. -The processing power is 24 items every 4 s, provided TA4 tubes are used on all sides. Otherwise there are only 12 items every 4 s. - -[ta4_distributor|image] - -### TA4 High Performance Distributor - -The function corresponds to that of the normal TA4 distributor, with two differences: -The processing power is 36 items every 4 s, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s. -Furthermore, up to 8 items can be configured per direction. - -[ta4_high_performance_distributor|image] - -### TA4 Gravel Sieve - -The function corresponds to that of TA2. -The processing power is 4 items every 4 s. The block requires 5 ku of electricity. - -[ta4_gravelsieve|image] - -### TA4 Grinder - -The function corresponds to that of TA2. -The processing power is 4 items every 4 s. The block requires 9 ku of electricity. - -[ta4_grinder|image] - -### TA4 Quarry - -The function largely corresponds to that of TA2. - -In addition, the hole size can be set between 3x3 and 11x11 blocks. -The maximum depth is 80 meters. The quarry requires 14 ku of electricity. - -[ta4_quarry|image] - -### TA4 Electronic Fab - -The function corresponds to that of TA2, only different chips are produced here. -The processing power is one chip every 6 s. The block requires 12 ku of electricity for this. - -[ta4_electronicfab|image] - -### TA4 Injector - -The function corresponds to that of TA3. - -The processing power is up to 8 times four items every 4 seconds. - -[ta4_injector|image] - -### TA4 Recycler - -The recycler is a machine that processes all Techage recipes backwards, i.e. it can dismantle machines and blocks back into their components. - -The machine can disassemble pretty much any Techage and Hyperloop blocks. But not all recipe items/materials can be recycled: - -- Wood turns into sticks -- Stone turns into sand or gravel -- Semiconductors / chips cannot be recycled -- Tools cannot be recycled - -The processing power is one item every 8 s. The block requires 16 ku of electricity for this. - -[ta4_recycler|image] diff --git a/techage/manuals/manual_ta4_pt-BR.md b/techage/manuals/manual_ta4_pt-BR.md deleted file mode 100644 index 8930b47..0000000 --- a/techage/manuals/manual_ta4_pt-BR.md +++ /dev/null @@ -1,1017 +0,0 @@ -# TA4: Presente - -Fontes de energia renováveis, como vento, sol e biocombustíveis, ajudam você a sair da era do petróleo. Com tecnologias modernas e máquinas inteligentes, você parte para o futuro. - -[techage_ta4|image] - - -## Turbina eólica - -Uma turbina eólica sempre fornece eletricidade quando há vento. Não há vento no jogo, mas o mod simula isso girando as turbinas eólicas somente pela manhã (5:00 - 9:00) e à noite (17:00 - 21:00). Uma turbina eólica só fornece eletricidade se estiver instalada em um local adequado. - -As usinas eólicas da TA são usinas puramente offshore, o que significa que elas precisam ser construídas no mar. Isso significa que as turbinas eólicas só podem ser construídas em um bioma marinho (oceano) e que deve haver água suficiente e uma visão clara ao redor do mastro. - -Para encontrar um local adequado, clique na água com a chave inglesa (TechAge Info Tool). Uma mensagem de bate-papo mostrará se essa posição é adequada para o mastro da turbina eólica. - -A corrente deve ser conduzida do bloco do rotor até o mastro. Primeiro, puxe a linha de energia para cima e, em seguida, "engesse" o cabo de energia com blocos de pilar TA4. Uma plataforma de trabalho pode ser construída abaixo. A planta à direita mostra a estrutura na parte superior. - -A turbina eólica fornece 70 ku, mas apenas 8 horas por dia (veja acima). - -[ta4_windturbine|plan] - - -### Turbina eólica TA4 - -O bloco da turbina eólica (rotor) é o coração da turbina eólica. Esse bloco deve ser colocado no topo do mastro. Idealmente, em Y = 15, então você fica dentro de um bloco de mapa/carga. -Quando você inicia a turbina, todas as condições para a operação da turbina eólica são verificadas. Se todas as condições forem atendidas, as pás do rotor (asas) aparecerão automaticamente. Caso contrário, você receberá uma mensagem de erro. - -[ta4_windturbine|image] - - -### Nacelle da turbina eólica TA4 - -Esse bloco deve ser colocado na extremidade preta do bloco da turbina eólica. - -[ta4_nacelle|image] - - -### Lâmpada de sinalização de turbina eólica TA4 - -Essa luz intermitente serve apenas para fins decorativos e pode ser colocada na parte superior do bloco da turbina eólica. - -[ta4_blinklamp|image] - - -### Pilar TA4 - -Isso constrói o mastro da turbina eólica. No entanto, esses blocos não são fixados manualmente, mas devem ser fixados com a ajuda de uma espátula(trowel), de modo que a linha de energia para a ponta do mastro seja substituída por esses blocos (consulte Cabo de energia TA). - -[ta4_pillar|image] - - -## Sistema Solar - -O sistema solar só produz eletricidade quando o sol está brilhando. No jogo, isso ocorre todo dia de jogo, das 6h às 18h. -A mesma energia está sempre disponível durante esse período. Após as 18h00, os módulos solares se desligam completamente. - -A temperatura do bioma é decisiva para o desempenho dos módulos solares. Quanto mais quente for a temperatura, maior será o rendimento. -A temperatura do bioma pode ser determinada com a Techage Info Tool (chave inglesa). Normalmente, ela oscila entre 0 e 100: - -- a potência total está disponível a 100 -- a 50, metade da potência está disponível -- em 0, não há serviço disponível - -Portanto, é aconselhável procurar estepes e desertos quentes para o sistema solar. -As linhas aéreas estão disponíveis para o transporte de eletricidade. -No entanto, também é possível produzir hidrogênio, que pode ser transportado e convertido novamente em eletricidade no destino. - -A menor unidade em um sistema solar é composta por dois módulos solares e um módulo de transporte. O módulo de transporte deve ser colocado primeiro, com os dois módulos solares à esquerda e à direita próximos a ele (não acima!). - -A planta à direita mostra 3 unidades, cada uma com dois módulos solares e um módulo de suporte, conectadas ao inversor por meio de cabos vermelhos. - -Os módulos solares fornecem tensão CC, que não pode ser alimentada diretamente na rede elétrica. Portanto, as unidades solares devem primeiro ser conectadas ao inversor por meio do cabo vermelho. Ele consiste em dois blocos, um para o cabo vermelho dos módulos solares (CC) e outro para o cabo de alimentação cinza da rede elétrica (CA). - -A área do mapa onde o sistema solar está localizado deve estar totalmente carregada. Isso também se aplica à posição direta acima do módulo solar, pois a intensidade da luz é medida regularmente nesse local. Portanto, é aconselhável definir primeiro um bloco de carga e depois colocar os módulos dentro dessa área. - -[ta4_solarplant|plan] - - -### Módulo solar TA4 - -O módulo solar deve ser colocado no módulo de suporte. São sempre necessários dois módulos solares. -Em um par, os módulos solares têm desempenho de até 3 ku, dependendo da temperatura. -Com os módulos solares, deve-se tomar cuidado para que eles tenham plena luz do dia e não sejam sombreados por blocos ou árvores. Isso pode ser testado com a Info Tool (wrench ou chave inglesa). - -[ta4_solarmodule|image] - - -### Módulo de transporte solar TA4 - -O módulo de suporte está disponível em duas alturas (1m e 2m). Ambos são funcionalmente idênticos. -Os módulos portadores podem ser colocados diretamente um ao lado do outro e, assim, conectados para formar uma fileira de módulos. A conexão com o inversor ou com outras séries de módulos deve ser feita com os cabos vermelhos de baixa tensão ou com as caixas de junção de baixa tensão. - -[ta4_solarcarrier|image] - - -### Inversor solar TA4 - -O inversor converte a energia solar (CC) em corrente alternada (CA) para que ela possa ser alimentada na rede elétrica. -Um inversor pode alimentar um máximo de 100 ku de eletricidade, o que corresponde a 33 módulos solares ou mais. - -[ta4_solar_inverter|image] - - -### Cabo de baixa potência TA4 - -O cabo de baixa tensão é usado para conectar fileiras de módulos solares ao inversor. O cabo não deve ser usado para outros fins. - -O comprimento máximo do cabo é de 200 m. - -[ta4_powercable|image] - - -### Caixa de junção de baixa tensão TA4 - -A caixa de junção deve ser colocada no chão. Ela tem apenas 4 conexões (nas 4 direções). - -[ta4_powerbox|image] - - -### Célula solar para lâmpadas de rua TA4 - -Como o nome sugere, a célula solar para lâmpadas de rua é usada para alimentar uma lâmpada de rua. Uma célula solar pode alimentar duas lâmpadas (1 ku). A célula solar armazena a energia do sol durante o dia e fornece a eletricidade para a lâmpada à noite. Isso significa que a lâmpada só brilha no escuro. - -Essa célula solar não pode ser combinada com os outros módulos solares. - -[ta4_minicell|image] - - - -## Armazenamento de energia térmica - -O armazenamento de energia térmica substitui o bloco de baterias do TA3. - -O armazenamento de energia térmica consiste em uma concha de concreto (blocos de concreto) preenchida com cascalho. São possíveis cinco tamanhos de armazenamento: - -- Cobertura com blocos de concreto 5x5x5, preenchida com 27 cascalhos, capacidade de armazenamento: 22,5 kud -- Cobertura com blocos de concreto 7x7x7, preenchidos com cascalho 125, capacidade de armazenamento: 104 kud -- Cobertura com blocos de concreto 9x9x9, preenchida com 343 cascalhos, capacidade de armazenamento: 286 kud -- Cobertura com blocos de concreto 11x11x11, preenchida com 729 cascalhos, capacidade de armazenamento: 610 kud -- Cobertura com blocos de concreto 13x13x13, preenchidos com cascalho 1331, capacidade de armazenamento: 1112 kud - -Uma janela feita de um bloco de vidro de obsidiana pode ser colocada na estrutura de concreto. Ela deve ser colocada bem no meio da parede. Por essa janela, é possível ver se o armazenamento está carregado em mais de 80%. Na planta à direita, você pode ver a estrutura do trocador de calor TA4, que consiste em 3 blocos, a turbina TA4 e o gerador TA4. Preste atenção ao alinhamento do trocador de calor (a seta no bloco 1 deve apontar para a turbina). - -Ao contrário da planta à direita, as conexões no bloco de armazenamento devem estar no mesmo nível (dispostas horizontalmente, ou seja, não abaixo e acima). As entradas de tubulação (TA4 Pipe Inlet) devem estar exatamente no meio da parede e de frente uma para a outra. Os tubos TA4 amarelos são usados como tubos de vapor. Os tubos de vapor TA3 não podem ser usados aqui. -Tanto o gerador quanto o trocador de calor têm uma conexão de energia e devem ser conectados à rede elétrica. - -Em princípio, o sistema de armazenamento de calor funciona exatamente da mesma forma que as baterias, só que com muito mais capacidade de armazenamento. - -Para que o sistema de armazenamento de calor funcione, todos os blocos (também a casca de concreto e o cascalho) devem ser carregados usando um bloco forceload. - -[ta4_storagesystem|plan] - - -### Trocador de calor TA4 - -O trocador de calor consiste em três partes que devem ser colocadas umas sobre as outras, com a seta do primeiro bloco apontando para a turbina. Os tubos devem ser construídos com os tubos TA4 amarelos. -O trocador de calor deve ser conectado à rede elétrica. O dispositivo de armazenamento de energia é recarregado por meio do trocador de calor, desde que haja eletricidade suficiente disponível. - -[ta4_heatexchanger|image] - - -### Turbina TA4 - -A turbina faz parte do armazenamento de energia. Ela deve ser colocada ao lado do gerador e conectada ao trocador de calor por meio de tubos TA4, conforme mostrado na planta. - -[ta4_turbine|image] - - -### Gerador TA4 - -O gerador é usado para gerar eletricidade. Portanto, o gerador também deve ser conectado à rede elétrica. -O gerador faz parte do armazenamento de energia. Ele é usado para gerar eletricidade e, assim, liberar a energia da unidade de armazenamento de energia. Portanto, o gerador também deve ser conectado à rede elétrica. - -Importante: Tanto o trocador de calor quanto o gerador devem estar conectados à mesma rede elétrica! - -[ta4_generator|image] - - -### Entrada do tubo TA4 - -Um bloco de entrada de tubo deve ser instalado em cada um dos dois lados do bloco de armazenamento. Os blocos devem estar exatamente de frente um para o outro. - -Os blocos de entrada de tubo **não** podem ser usados como aberturas normais de parede; em vez disso, use os blocos de entrada de tubo TA3 na parede. - -[ta4_pipeinlet|image] - - -### Tubo TA4 - -Com o TA4, os tubos amarelos são usados para a transmissão de gás e líquidos. -O comprimento máximo do cabo é de 100 m. - -[ta4_pipe|image] - - - -## Distribuição de energia - -Com a ajuda de cabos de energia e caixas de junção, é possível configurar redes de energia de até 1.000 blocos/nós. Entretanto, deve-se observar que as caixas de distribuição também devem ser contadas. Isso significa que até 500 geradores/sistemas de armazenamento/máquinas/lâmpadas podem ser conectados a uma rede elétrica. - -Com a ajuda de um transformador de isolamento e de um medidor de eletricidade, as redes podem ser conectadas para formar estruturas ainda maiores. - -[ta4_transformer|image] - -### Transformador de isolamento TA4 - -Com a ajuda de um transformador de isolamento, duas redes de energia podem ser conectadas para formar uma rede maior. O transformador de isolamento pode transmitir eletricidade em ambas as direções. - -O transformador de isolamento pode transmitir até 300 ku. O valor máximo é ajustável por meio do menu da chave inglesa. - -[ta4_transformer|image] - -### Medidor elétrico TA4 - -Com a ajuda de um medidor de eletricidade, duas redes de eletricidade podem ser conectadas para formar uma rede maior. O medidor de eletricidade transmite eletricidade somente em uma direção (observe a seta). A quantidade de energia elétrica transmitida (em kud) é medida e exibida. Esse valor também pode ser consultado por um controlador Lua usando o comando `consumption`. A corrente atual pode ser consultada por meio do comando `current`. - -O medidor de eletricidade pode passar até 200 ku. O valor máximo é ajustável por meio do menu da chave inglesa. - -Uma contagem regressiva da potência de saída também pode ser inserida por meio do menu da chave inglesa. Quando essa contagem regressiva chega a zero, o medidor de eletricidade é desligado. A contagem regressiva pode ser consultada com o comando `countdown`. - -[ta4_electricmeter|image] - -### Laser TA4 - -O laser TA4 é usado para transmissão de energia sem fio. Para isso, são necessários dois blocos: Emissor de feixe de laser TA4 e Receptor de feixe de laser TA4. Deve haver um espaço de ar entre os dois blocos para que o feixe de laser possa ser construído a partir do emissor até o receptor. Primeiro, o emissor deve ser colocado. Isso liga imediatamente o feixe de laser e mostra as possíveis posições do receptor. As possíveis posições do receptor também são exibidas por meio de uma mensagem de bate-papo. - -Com o laser, distâncias de até 96 blocos podem ser superadas. Depois que a conexão é estabelecida (não é necessário haver fluxo de corrente), isso é indicado por meio do texto informativo do emissor e também do receptor. - -Os blocos de laser em si não requerem eletricidade. - -[ta4_laser|image] - - - -## Hidrogênio - -A eletrólise pode ser usada para dividir a eletricidade em hidrogênio e oxigênio. Por outro lado, o hidrogênio pode ser convertido novamente em eletricidade com o oxigênio do ar usando uma célula de combustível. -Isso permite que os picos de corrente ou um excesso de fornecimento de eletricidade sejam convertidos em hidrogênio e, portanto, armazenados. - -No jogo, a eletricidade pode ser convertida novamente em eletricidade por meio da célula de combustível usando o eletrolisador em hidrogênio e hidrogênio. -Isso significa que a eletricidade (na forma de hidrogênio) pode não apenas ser armazenada em tanques, mas também transportada por meio do carrinho-tanque. - -No entanto, a conversão de eletricidade em hidrogênio e vice-versa é deficitária. De 100 unidades de eletricidade, apenas 95 unidades de eletricidade saem após a conversão em hidrogênio e vice-versa. - -[ta4_hydrogen|image] - - -### Eletrolisador - -O eletrolisador converte eletricidade em hidrogênio. -Ele deve ser alimentado pela esquerda. À direita, o hidrogênio pode ser extraído por meio de tubos e bombas. - -O eletrolisador pode consumir até 35 ku de eletricidade e, em seguida, gera um item de hidrogênio a cada 4 s. -200 unidades de hidrogênio cabem no eletrolisador. - -O eletrolisador tem um menu de chave inglesa para definir o consumo de corrente e o ponto de desligamento. - -Se a energia armazenada na rede elétrica cair abaixo do valor especificado do ponto de desligamento, o eletrolisador se desliga automaticamente. Isso evita que os sistemas de armazenamento fiquem vazios. - -[ta4_electrolyzer|image] - - -### Célula de combustível - -A célula de combustível converte hidrogênio em eletricidade. -Ele deve ser abastecido com hidrogênio pela esquerda por meio de uma bomba. A conexão de energia está à direita. - -A célula de combustível pode fornecer até 34 ku de eletricidade e precisa de um item de hidrogênio a cada 4 s. - -Normalmente, a célula de combustível funciona como um gerador de categoria 2 (como outros sistemas de armazenamento). -Nesse caso, nenhum outro bloco de categoria 2, como o bloco de bateria, pode ser carregado. No entanto, a célula de combustível também pode ser usada como um gerador de categoria 1 por meio da caixa de seleção. - -[ta4_fuelcell|image] - - -## Reator químico - -O reator é usado para processar os ingredientes obtidos da torre de destilação ou de outras receitas em novos produtos. -A planta à esquerda mostra apenas uma variante possível, pois a disposição dos silos e tanques depende da receita. - -O produto primário de saída é sempre descarregado na lateral do suporte do reator, independentemente de ser um pó ou um líquido. O produto residual (secundário) é sempre descarregado na parte inferior do suporte do reator. - -Um reator consiste em: -- Vários tanques e silos com os ingredientes que são conectados ao dosador por meio de tubos -- opcionalmente, uma base do reator, que descarrega os resíduos do reator (necessário apenas para receitas com dois produtos de saída) -- o suporte do reator, que deve ser colocado na base (se disponível). O suporte tem uma conexão de energia e consome 8 ku durante a operação. -- O vaso do reator que deve ser colocado no suporte do reator -- O tubo de enchimento que deve ser colocado no vaso do reator -- O dispositivo de dosagem, que deve ser conectado aos tanques ou silos e ao tubo de enchimento por meio de tubos - -Observação 1: Os líquidos são armazenados somente em tanques e os sólidos e substâncias em pó somente em silos. Isso se aplica a ingredientes e produtos finais. - -Observação 2: Os tanques ou silos com conteúdos diferentes não devem ser conectados a um sistema de tubulação. Por outro lado, vários tanques ou silos com o mesmo conteúdo podem ser pendurados em paralelo em uma linha. - -O craqueamento quebra cadeias longas de hidrocarbonetos em cadeias curtas usando um catalisador. -O pó de gibbsita serve como catalisador (não é consumido). Ele pode ser usado para converter betume em óleo combustível, óleo combustível em nafta e nafta em gasolina. - -Na hidrogenação, pares de átomos de hidrogênio são adicionados a uma molécula para converter hidrocarbonetos de cadeia curta em longa. -Aqui, o pó de ferro é necessário como catalisador (não é consumido). Ele pode ser usado para converter gás (propano) em isobutano, -isobutano em gasolina, gasolina em nafta, nafta em óleo combustível e óleo combustível em betume. - - -[ta4_reactor|plan] - - -### Dosador TA4 - -Parte do reator químico. -As tubulações para materiais de entrada podem ser conectadas em todos os quatro lados do dosador. Os materiais para o reator são descarregados para cima. - -A receita pode ser definida e o reator pode ser iniciado por meio do dosador. - -Como em outras máquinas: -- se o dosador estiver no modo de espera, um ou mais ingredientes estão faltando -- se o dosador estiver no estado bloqueado, o tanque ou silo de saída está cheio, com defeito ou conectado incorretamente - -O dosador não precisa de eletricidade. Uma receita é processada a cada 10 s. - -[ta4_doser|image] - -### Reator TA4 - -Parte do reator químico. O reator tem um inventário para os itens de catalisador (para receitas de craqueamento e hidrogenação). - -[ta4_reactor|image] - - -### Tubo de enchimento TA4 - -Parte do reator químico. Deve ser colocado no reator. Se isso não funcionar, remova o tubo na posição acima e coloque-o novamente. - -[ta4_fillerpipe|image] - - -### Suporte do reator TA4 - -Parte do reator químico. Aqui também está a conexão de energia para o reator. O reator requer 8 ku de eletricidade. - -O suporte tem duas conexões de tubulação, à direita para o produto inicial e abaixo para os resíduos, como a lama vermelha na produção de alumínio. - -[ta4_reactorstand|image] - - -### Base do reator TA4 - -Parte do reator químico. É necessário para a drenagem do produto residual. - -[ta4_reactorbase|image] - - -### Silo TA4 - -Parte do reator químico. É necessário para armazenar substâncias em forma de pó ou grânulos. - -[ta4_silo|image] - - - - -## Controlador ICTA - -O controlador ICTA (ICTA significa "If Condition Then Action") é usado para monitorar e controlar máquinas. O controlador pode ser usado para ler dados de máquinas e outros blocos e, dependendo disso, ligar/desligar outras máquinas e blocos. - -Os dados da máquina são lidos e os blocos e máquinas são controlados por meio de comandos. O capítulo TA3 -> Blocos lógicos/comutação é importante para entender como os comandos funcionam. - -O controlador requer uma bateria para funcionar. O visor é usado para emitir dados, a torre de sinalização para exibir erros. - -[ta4_icta_controller|image] - - - -### Controlador TA4 ICTA - -O controlador funciona com base nas regras `IF THEN `. Podem ser criadas até 8 regras por controlador. - -Exemplos de regras são: - -- Se um distribuidor estiver "bloqueado", o empurrador na frente dele deve ser desligado -- Se uma máquina apresentar um erro, isso deverá ser mostrado no visor - -O controlador verifica essas regras ciclicamente. Para fazer isso, um tempo de ciclo em segundos (`` Cycle / s '') deve ser especificado para cada regra (1...1000). - -Para regras que avaliam uma entrada ligada/desligada, por exemplo, de um interruptor ou detector, o tempo de ciclo 0 deve ser especificado. O valor 0 significa que essa regra deve ser sempre executada quando o sinal de entrada for alterado, por exemplo, quando o botão enviar um novo valor. - -Todas as regras devem ser executadas apenas com a frequência necessária. Isso tem duas vantagens: - -- a bateria do controlador dura mais (cada controlador precisa de uma bateria) -- a carga do servidor é menor (portanto, menos atrasos) - -Você deve definir um tempo de atraso (`depois/s`) para cada ação. Se a ação tiver que ser executada imediatamente, deve-se inserir 0. - -O controlador tem sua própria ajuda e informações sobre todos os comandos por meio do menu do controlador. - -[ta4_icta_controller|image] - -### Bateria - -A bateria deve ser colocada bem próxima ao controlador, ou seja, em uma das 26 posições ao redor do controlador. - -[ta4_battery|image] - -### Exibição do TA4 - -O display mostra seu número após a colocação. O display pode ser endereçado por meio desse número. Os textos podem ser exibidos no visor, sendo que o visor pode exibir 5 linhas e, portanto, 5 textos diferentes. - -As linhas de texto são sempre alinhadas à esquerda. Se o texto tiver que ser centralizado horizontalmente, deverá ser precedido pelo caractere "\t" (tabulador). - -O visor é atualizado no máximo uma vez por segundo. - -[ta4_display|image] - -### TA4 Display XL - -O TA4 Display XL tem o dobro do tamanho do display TA4. - -As linhas de texto são sempre alinhadas à esquerda. Se o texto tiver que ser centralizado horizontalmente, deverá ser precedido pelo caractere "\t" (tabulador). - -O visor é atualizado a cada dois segundos, no máximo. - -[ta4_displayXL|image] - - -### Torre de sinalização TA4 - -A torre de sinalização pode exibir vermelho, verde e laranja. Não é possível uma combinação das três cores. - -[ta4_signaltower|image] - - - -## Controlador TA4 Lua - -Como o nome sugere, o controlador Lua deve ser programado na linguagem de programação Lua. O manual em inglês está disponível aqui: - -https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md - -O controlador Lua também requer uma bateria. A bateria deve ser colocada bem próxima ao controlador, ou seja, em uma das 26 posições ao redor do controlador. - -[ta4_lua_controller|image] - -### Servidor TA4 Lua - -O servidor é usado para o armazenamento central de dados de vários controladores Lua. Ele também salva os dados após a reinicialização do servidor. - -[ta4_lua_server|image] - -### Caixa do sensor TA4 / baú - -A caixa de sensores TA4 é usada para configurar armazéns automáticos ou máquinas de venda automática em conjunto com o controlador Lua. -Se algo for colocado na caixa ou removido, ou se uma das teclas "F1"/"F2" for pressionada, um sinal de evento será enviado ao controlador Lua. -A caixa do sensor suporta os seguintes comandos: - -- O status da caixa pode ser consultado por meio de `state = $send_cmnd(, "state")`. As respostas possíveis são: "empty" (vazio), "loaded" (carregado), "full" (cheio) -- A última ação do jogador pode ser consultada por meio de `name, action = $send_cmnd(, "action")`. `name` é o nome do jogador. Uma das seguintes opções é retornada como `action`: "put", "take", "f1", "f2". -- O conteúdo da caixa pode ser lido por meio de `stacks = $send_cmnd(, "stacks")`. Consulte: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest -- Por meio de `$send_cmnd(, "text", "pressione ambos os botões e coloque algo no peito")`, o texto pode ser definido no menu da caixa do sensor. - -A caixa de seleção "Allow public chest access" (Permitir acesso público ao baú) pode ser usada para definir se a caixa pode ser usada por todos ou somente por jogadores que tenham direitos de acesso/proteção aqui. - -[ta4_sensor_chest|image] - -### Terminal do controlador TA4 Lua - -O terminal é usado para entrada/saída do controlador Lua. - -[ta4_terminal|image] - - - -## Módulos de lógica/comutação TA4 - -### Botão/interruptor TA4 - -Apenas a aparência do botão/chave TA4 foi alterada. A funcionalidade é a mesma do botão/chave TA3. No entanto, com o menu da chave inglesa, os dados podem ser alterados posteriormente. - -[ta4_button|image] - -### Botão TA4 2x - -Esse bloco tem dois botões que podem ser configurados individualmente por meio do menu de chave inglesa. A rotulagem e o endereço do bloco de destino podem ser configurados para cada botão. Além disso, o comando a ser enviado pode ser configurado para cada botão. - -[ta4_button_2x|image] - - -### Botão TA4 4x - -Esse bloco tem quatro botões que podem ser configurados individualmente por meio do menu de chave inglesa. A rotulagem e o endereço do bloco de destino podem ser configurados para cada botão. Além disso, o comando a ser enviado pode ser configurado para cada botão. - -[ta4_button_4x|image] - -### Lâmpada de sinalização TA4 2x - -Esse bloco tem duas lâmpadas que podem ser controladas individualmente. Cada lâmpada pode exibir as cores "vermelho", "verde" e "âmbar". A rotulagem de ambas as lâmpadas pode ser configurada por meio do menu de chave inglesa. As lâmpadas podem ser controladas usando os seguintes comandos: - -- Mudar a lâmpada 1 para vermelho: `$send_cmnd(1234, "red", 1)` -- Mude a lâmpada 2 para verde: `$send_cmnd(1234, "green ", 2)` -- Mudar a lâmpada 1 para laranja: `$send_cmnd(1234, "amber", 1)` -- Desligar a lâmpada 2: `$send_cmnd(1234, "off", 2)` - -[ta4_signallamp_2x|image] - -### Lâmpada de sinalização TA4 4x - -Esse bloco tem quatro lâmpadas que podem ser controladas individualmente. Cada lâmpada pode exibir as cores "vermelho", "verde" e "âmbar". A rotulagem de todas as lâmpadas pode ser configurada por meio do menu de chave inglesa. As lâmpadas podem ser controladas usando os seguintes comandos: - -- Mudar a lâmpada 1 para vermelho: `$send_cmnd(1234, "red", 1)` -- Mude a lâmpada 2 para verde: `$send_cmnd(1234, "green ", 2)` -- Mudar a lâmpada 3 para laranja: `$send_cmnd(1234, "amber", 3)` -- Desligar a lâmpada 4: `$send_cmnd(1234, "off", 4)` - -[ta4_signallamp_4x|image] - -### Detector de jogadores TA4 - -Apenas a aparência do detector de player TA4 foi alterada. A funcionalidade é a mesma do detector de player TA3. - -[ta4_playerdetector|image] - -### Coletor de estado TA4 - -[ta4_collector|image] - -O coletor de status consulta todas as máquinas configuradas para obter o status. Se uma das máquinas tiver atingido ou excedido um status pré-configurado, um comando "on" será enviado. Por exemplo, muitas máquinas podem ser facilmente monitoradas quanto a falhas a partir de um controlador Lua. - -### Detector TA4 - -A funcionalidade é a mesma do detector TA3. Além disso, o detector conta os itens passados adiante. -Esse contador pode ser consultado com o comando "count" e redefinido com "reset". - -[ta4_detector|image] - -### Detector de nó TA4 - -A funcionalidade é a mesma do TA3 Node Detector. - -Ao contrário do detector de nós TA3, as posições a serem monitoradas podem ser configuradas individualmente aqui. Para fazer isso, o botão "Record" (Registrar) deve ser pressionado. Em seguida, todos os blocos devem ser clicados, cuja posição deve ser verificada. Em seguida, o botão "Done" (Concluído) deve ser pressionado. - -Podem ser selecionados até 4 blocos. - -[ta4_nodedetector|image] - -### Detector de carga de armazenamento de energia TA4 - -O detector de carga mede o estado de carga do armazenamento de energia da rede elétrica a cada 8 s. - -Se o valor ficar abaixo de um limite configurável (ponto de comutação), um comando (padrão: "off") será enviado. Se o valor subir novamente acima desse ponto de comutação, um segundo comando (padrão: "on") será enviado. Isso permite que os consumidores sejam desconectados da rede quando o nível de carga do dispositivo de armazenamento de energia cair abaixo do ponto de comutação especificado. - -Para fazer isso, o detector de carga deve ser conectado à rede por meio de uma caixa de junção. O detector de carga é configurado por meio do menu da chave de boca. - -[ta4_chargedetector|image] - -### Sensor de olhar TA4 - -O sensor de olhar TA4 gera um comando quando o bloco é visto/focado pelo proprietário ou por outros jogadores configurados e envia um segundo comando quando o bloco não é mais focalizado. Assim, ele substitui os botões/interruptores, por exemplo, para abrir/fechar portas. - -O TA4 Gaze Sensor só pode ser programado usando o menu da chave de boca. Se você tiver uma chave de boca na mão, o sensor não será acionado, mesmo que esteja focalizado. - -[ta4_gaze_sensor|image] - -### Sequenciador TA4 - -Processos inteiros podem ser programados usando o sequenciador TA4. Veja um exemplo: - -``` --- este é um comentário -[1] send 1234 a2b -[30] send 1234 b2a -[60] goto 1 -``` - -- Cada linha começa com um número que corresponde a um ponto no tempo `[]` -- São permitidos valores de 1 a 50000 para os tempos -- 1 corresponde a 100 ms, 50000 corresponde a cerca de 4 dias de jogo -- Linhas vazias ou comentários são permitidos (`-- comment`) -- Com `send `, você pode enviar um comando para um bloco -- Com `goto ` você pode pular para outra linha/ponto no tempo -- Com `stop` você pode parar o sequenciador com um atraso para que ele não receba um novo comando - aceita de um botão ou outro bloco (para concluir um movimento) - Sem `stop`, o sequenciador entra no modo parado imediatamente após o último comando. - -O sequenciador TA4 suporta os seguintes comandos de tecnologia: - -- `goto ` Salta para uma linha de comando e inicia o sequenciador -- `stop` Parar o sequenciador -- `on` e `off` como aliases para `goto 1` e `stop` - -O comando `goto` só é aceito quando o sequenciador está parado. - -O tempo de ciclo (padrão: 100 ms) pode ser alterado para o sequenciador por meio do menu da chave de boca. - -[ta4_sequencer|image] - - - -## Controlador de movimento/volta - -### Controlador de movimento TA4 - -O TA4 Move Controller é semelhante ao "Door Controller 2", mas os blocos selecionados não são removidos, mas podem ser movidos. -Como os blocos móveis podem levar consigo os jogadores e as multidões que estão no bloco, é possível construir elevadores e sistemas de transporte semelhantes com eles. - -Instruções: - -- Defina o controlador e treine os blocos a serem movidos por meio do menu (até 16 blocos podem ser treinados) -- A "rota de voo" deve ser inserida por meio de uma especificação x, y, z (relativa) (a distância máxima (x+y+z) é de 200 m) -- O movimento pode ser testado com os botões de menu "Move A-B" e "Move B-A" -- Você também pode voar através de paredes ou outros blocos -- A posição de destino dos blocos também pode ser ocupada. Nesse caso, os blocos são salvos de forma "invisível". Isso se destina a portas deslizantes e similares - -O Move Controller é compatível com os seguintes comandos de tecnologia: - -- `a2b` Mover o bloco de A para B. -- `b2a` Mover o bloco de B para A. -- `move` Mover o bloco para o outro lado - -Você pode alternar para o modo de operação `move xyz` por meio do menu de chave inglesa. Após a mudança, os seguintes comandos técnicos são suportados: - -- `move2` Com o comando, a rota de voo também deve ser especificada como um vetor x,y,z. - Exemplo de controlador Lua: `$send_cmnd(MOVE_CTLR, "move2", "0,12,0")` -- `reset` move o(s) bloco(s) de volta à posição inicial - -**Instruções importantes:** - -- Se vários blocos tiverem de ser movidos, o bloco que levará os jogadores/mobs deverá ser clicado primeiro durante o treinamento. -- Se o bloco que deve levar os jogadores/móbile tiver uma altura reduzida, a altura deverá ser definida no controlador usando o menu de chave de boca aberto (por exemplo, altura = 0,5). Caso contrário, o jogador/móbile não será "encontrado" e não será levado embora. - -[ta4_movecontroller|image] - -### Controlador de giro TA4 - -O controlador de giro do TA4 é semelhante ao "Move Controller", mas os blocos selecionados não são movidos, mas girados em torno de seu centro para a direita ou para a esquerda. - -Instruções: - -- Defina o controlador e treine os blocos a serem movidos por meio do menu (até 16 blocos podem ser treinados) -- O movimento pode ser testado com os botões de menu "Turn left" (Virar à esquerda) e "Turn right" (Virar à direita) - -O controlador de giro suporta os seguintes comandos de tecnologia: - -- `left` Vire à esquerda -- `direita` Vire à direita -- `uturn` Girar 180 graus - -[ta4_turncontroller|image] - - - - -## Lâmpadas TA4 - -O TA4 contém uma série de lâmpadas potentes que permitem uma melhor iluminação ou a realização de tarefas especiais. - -### Luz de cultivo LED TA4 - -A lâmpada de cultivo TA4 LED permite o crescimento rápido e vigoroso de todas as plantas do modo `farming`. A lâmpada ilumina um campo de 3x3, de modo que as plantas também podem ser cultivadas no subsolo. -A lâmpada deve ser colocada um bloco acima do solo no meio do campo 3x3. - -A lâmpada também pode ser usada para cultivar flores. Se a lâmpada for colocada sobre um canteiro de flores 3x3 feito de "Garden Soil" (Mod `compost`), as flores crescerão automaticamente (acima e abaixo do solo). - -Você pode colher as flores com o Signs Bot, que também tem uma placa correspondente que deve ser colocada na frente do campo de flores. - -A lâmpada requer 1 ku de eletricidade. - -[ta4_growlight|image] - -### Lâmpada de rua TA4 - -A lâmpada de rua de LED TA4 é uma lâmpada com iluminação particularmente forte. A lâmpada consiste no compartimento da lâmpada, no braço da lâmpada e nos blocos do poste da lâmpada. - -A corrente deve ser conduzida de baixo para cima, através do mastro, até o compartimento da lâmpada. Primeiro, puxe o cabo de alimentação para cima e, em seguida, "engesse" o cabo de alimentação com blocos de postes de iluminação. - -A lâmpada requer 1 ku de eletricidade. - -[ta4_streetlamp|image] - -### Lâmpada industrial de LED TA4 - -A lâmpada industrial de LED TA4 é uma lâmpada com iluminação particularmente forte. A lâmpada deve ser alimentada por cima. - -A lâmpada requer 1 ku de eletricidade. - -[ta4_industriallamp|image] - - - - -## Filtro líquido TA4 - -O filtro de líquidos filtra a lama vermelha. -Uma parte da lama vermelha se transforma em soda cáustica, que pode ser coletada no fundo de um tanque. -A outra parte se transforma em um paralelepípedo do deserto e obstrui o material do filtro. -Se o filtro estiver muito entupido, ele deverá ser limpo e enchido novamente. -O filtro consiste em uma camada de base, 7 camadas de filtro idênticas e uma camada de enchimento na parte superior. - -[ta4_liquid_filter|image] - -### Camada de base - -Você pode ver a estrutura dessa camada no plano. - -A soda cáustica é coletada no tanque. - -[ta4_liquid_filter_base|plan] - -### Camada de cascalho - -Essa camada deve ser preenchida com cascalho, conforme mostrado no plano. -No total, deve haver sete camadas de cascalho. -O filtro ficará obstruído com o tempo, de modo que precisará ser limpo e preenchido novamente. - -[ta4_liquid_filter_gravel|plan] - -### Camada de enchimento - -Essa camada é usada para preencher o filtro com lama vermelha. -A lama vermelha deve ser bombeada para o tubo de enchimento. - -[ta4_liquid_filter_top|plan] - - - - -## Colisor TA4 (acelerador de partículas) - -O Collider é uma instalação de pesquisa que realiza pesquisas básicas. É possível coletar pontos de experiência aqui, que são necessários para o TA5 (Future Age). - -Como seu original no CERN em Genebra, o colisor deve ser construído no subsolo. A configuração padrão aqui é Y <= -28. O valor pode, no entanto, ser alterado pela equipe do servidor por meio da configuração. Pergunte ou tente o bloco "TA4 Collider Detector Worker". - -Somente um colisor pode ser operado por jogador. Portanto, não faz sentido configurar dois ou mais colisores. Os pontos de experiência são creditados ao jogador que possui o colisor. Os pontos de experiência não podem ser transferidos. - -Um colisor consiste em um "anel" feito de tubos e ímãs, além de um detector com um sistema de resfriamento. - -- O detector é o coração do sistema. É nele que os experimentos científicos são realizados. O detector tem o tamanho de 3x3x7 blocos. -- 22 ímãs do colisor TA4 (não os ímãs do detector do colisor TA4!) devem ser conectados uns aos outros por meio de 5 blocos do tubo de vácuo TA4. Cada ímã também requer eletricidade e uma conexão de gás para resfriamento. O conjunto forma (como mostrado na planta à direita) um quadrado com um comprimento de borda de 37 metros. - -A planta mostra a instalação vista de cima: - -- O bloco cinza é o detector com o bloco de trabalho no meio -- Os blocos vermelhos são os ímãs, os azuis são os tubos de vácuo - -[techage_collider_plan|plan] - -### Detector - -O detector é configurado automaticamente com a ajuda do bloco "TA4 Collider Detector Worker" (semelhante à torre). Todos os materiais necessários para isso devem ser colocados primeiro no bloco do trabalhador. O detector é mostrado simbolicamente no bloco do trabalhador. O detector é montado no bloco de trabalho. - -O detector também pode ser desmontado novamente com a ajuda do bloco de trabalho. - -As conexões para eletricidade, gás e tubos de vácuo estão localizadas nos dois lados frontais do detector. Uma bomba TA4 deve ser conectada na parte superior para sugar o tubo vazio/criar o vácuo. - -O sistema de resfriamento deve ser conectado à parte traseira do detector. O sistema de resfriamento é mostrado na planta à direita. Além do trocador de calor TA4 da unidade de armazenamento de energia (que é usado aqui para resfriamento), também é necessário um bloco resfriador TA4. - -Observação: A seta no trocador de calor deve apontar para longe do detector. O trocador de calor também deve ser alimentado com eletricidade. - -[ta4_cooler|plan] - - -- Além disso, é necessário resfriamento, que também deve ser instalado no detector. O isobutano é necessário para o resfriamento. -- O sistema requer uma quantidade considerável de eletricidade. Portanto, faz sentido ter sua própria fonte de alimentação. - -### Controle / Terminal TA4 - -O colisor é controlado por meio de um terminal TA4 (não por meio do terminal do controlador TA4 Lua). - -Esse terminal deve ser conectado ao detector. O número do detector é exibido como texto informativo no bloco de trabalho. - -O terminal suporta os seguintes comandos: - -- `connect ` (conectar-se ao detector) -- `start` (iniciar o detector) -- `stop` (parar o detector) -- `test ` (verificação de um ímã) -- `points` (consulta dos pontos de experiência já obtidos) - -Se ocorrer um erro em um ímã durante o `start`, o número do ímã será exibido. O comando `test` pode ser usado para solicitar mais informações sobre o erro do ímã. - -[ta4_terminal|image] - -### Resfriamento e energia - -Cada ímã do Colisor TA4 também deve ser abastecido com eletricidade (conforme mostrado à direita na planta) e com isobutano para resfriamento: - -- A conexão para a alimentação está na parte superior do ímã. -- A conexão para o resfriamento está na parte frontal do ímã. -- Uma bomba TA4 e um tanque TA4 com pelo menos 250 unidades de isobutano também são necessários para resfriar todo o sistema. -- O sistema também requer muita eletricidade. Portanto, faz sentido ter sua própria fonte de alimentação com pelo menos 145 ku. - -[techage_collider_plan2|plan] - -### Construção - -A sequência a seguir é recomendada ao configurar o colisor: - -- Coloque um bloco de carga forçada. Somente o detector com o sistema de resfriamento deve estar na área do bloco de carga forçada. -- Defina o bloco de trabalho, preencha-o com itens e configure o detector por meio do menu -- Construa o anel com tubos e ímãs -- Conecte todos os ímãs e o detector com os cabos de alimentação -- Conecte todos os ímãs e o detector com os tubos amarelos e bombeie o isobutano no sistema de tubos com uma bomba -- Instale uma bomba TA4 como uma bomba de vácuo no detector e ligue-a (não é necessário nenhum tanque adicional). Se a bomba entrar em "standby", o vácuo será estabelecido. Isso levará alguns segundos -- Monte o resfriador (trocador de calor) e conecte-o ao cabo de alimentação -- Coloque o terminal TA4 na frente do detector e conecte-o ao detector por meio de `connect ` -- Ligar/conectar a fonte de alimentação -- ligar o resfriador (trocador de calor) -- Ligue o detector por meio de `start` no terminal TA4. Após algumas etapas de teste, o detector entra em operação normal ou emite um erro. -- O colisor precisa ser executado continuamente e, em seguida, fornece gradualmente pontos de experiência. Para obter 10 pontos, o colisor precisa funcionar por algumas horas - -[techage_ta4c|image] - - - - -## Mais blocos TA4 - -### Bloco de receitas TA4 - -Até 10 receitas podem ser salvas no bloco de receitas. Essas receitas podem então ser chamadas por meio de um comando do TA4 Autocrafter. Isso permite que a receita do autocrafter seja configurada por meio de um comando. As receitas no bloco de receitas também podem ser consultadas diretamente por meio de um comando. - -`input ` lê uma receita do bloco de receitas do TA4. `` é o número da receita. O bloco retorna uma lista de ingredientes da receita. - -Exemplo: `$send_cmnd(1234, "input", 1)` - -[ta4_recipeblock|image] - -### TA4 Autocrafter - -A função corresponde à do TA3. - -A capacidade de processamento é de 4 itens a cada 4 s. O autocrafter requer 9 ku de eletricidade para isso. - -Além disso, o TA4 Autocrafter suporta a seleção de diferentes receitas usando os seguintes comandos: - -`recipe "."` muda o autocrafter para uma receita do bloco de receitas TA4. `` é o número do bloco de receitas, `` é o número da receita. Exemplo: `$send_cmnd(1234, "recipe", "5467.1")` - -Como alternativa, uma receita também pode ser selecionada por meio da lista de ingredientes, por exemplo: -`$send_cmnd(1234, "recipe", "default:coal_lump,,,default:stick")` -Todos os nomes técnicos de uma receita devem ser especificados aqui, separados por vírgulas. Consulte também o comando `input` no bloco de receitas do TA4. - -O comando `flush` move todos os itens do inventário de entrada para o inventário de saída. O comando retorna `true` se o inventário de entrada tiver sido completamente esvaziado. Se `false` for retornado (inventário de saída cheio), o comando deverá ser repetido em um momento posterior. - -[ta4_autocrafter|image] - -### Tanque TA4 - -Consulte o tanque TA3. - -Um tanque TA4 pode conter 2.000 unidades ou 200 barris de líquido. - -[ta4_tank|image] - -### Bomba TA4 - -Consulte a bomba TA3. - -A bomba TA4 bombeia 8 unidades de líquido a cada dois segundos. - -No modo "Flow limiter" (Limitador de fluxo), o número de unidades bombeadas pela bomba pode ser limitado. O modo de limitador de fluxo pode ser ativado por meio do menu da chave de boca, configurando o número de unidades no menu. Quando o número configurado de unidades tiver sido bombeado, a bomba será desligada. Quando a bomba for ligada novamente, ela bombeará o número configurado de unidades novamente e, em seguida, será desligada. - -O limitador de fluxo também pode ser configurado e iniciado usando um controlador Lua ou Beduino. - -A bomba também é compatível com o comando `flowrate`. Isso permite que a taxa de fluxo total através da bomba seja consultada. - -[ta4_pump|image] - -### Aquecedor de forno TA4 - -Com o TA4, o forno industrial também tem seu aquecimento elétrico. O queimador de óleo e o soprador podem ser substituídos pelo aquecedor. - -O aquecedor requer 14 ku de eletricidade. - -[ta4_furnaceheater|image] - -### Bomba d'água TA4 (obsoleta) - -Esse bloco não poderá mais ser fabricado e será substituído pelo bloco de entrada de água TA4. - -### Entrada de água TA4 - -Algumas receitas requerem água. A água deve ser bombeada do mar com uma bomba (água em y = 1). Uma "piscina" composta de alguns blocos de água não é suficiente para isso! - -Para fazer isso, o bloco de entrada de água deve ser colocado na água e conectado à bomba por meio de tubos. Se o bloco for colocado na água, é preciso garantir que haja água sob o bloco (a água deve ter pelo menos 2 blocos de profundidade). - -[ta4_waterinlet|image] - -### Tubo TA4 - -O TA4 também tem seus próprios tubos no design do TA4. Eles podem ser usados como os tubos padrão. -Mas: Os empurradores e distribuidores TA4 só atingem seu desempenho total quando usados com tubos TA4. - -[ta4_tube|image] - -### TA4 Pusher - -A função corresponde basicamente à do TA2 / TA3. Além disso, um menu pode ser usado para configurar quais objetos devem ser retirados de um baú TA4 e transportados posteriormente. -A capacidade de processamento é de 12 itens a cada 2 s, se forem usados tubos TA4 em ambos os lados. Caso contrário, haverá apenas 6 itens a cada 2 s. - -No modo "limitador de fluxo", o número de itens que são movidos pelo empurrador pode ser limitado. O modo limitador de fluxo pode ser ativado por meio do menu da chave de boca, configurando o número de itens no menu. Assim que o número configurado de itens tiver sido movido, o empurrador se desliga. Se o empurrador for ligado novamente, ele moverá o número configurado de itens novamente e depois se desligará. - -O empurrador TA4 também pode ser configurado e iniciado usando um controlador Lua ou Beduino. - -Aqui estão os comandos adicionais para o controlador Lua: - -- O `config` é usado para configurar o empurrador, de forma análoga à configuração manual por meio do menu. - Exemplo: `$send_cmnd(1234, "config", "default:dirt")` - Com `$send_cmnd(1234, "config", "")`, a configuração é excluída -- `limit` é usado para definir o número de itens para o modo de limitador de fluxo: - Exemplo: `$send_cmnd(1234, "init", 7)` - -[ta4_pusher|image] - -### Peito TA4 - -A função corresponde à do TA3. O baú pode conter mais conteúdo. - -Além disso, o baú do TA4 tem um shadow inventory para configuração. Aqui, determinados locais de pilha podem ser pré-atribuídos a um item. As pilhas de inventário pré-atribuídas só são preenchidas com esses itens durante o preenchimento. É necessário um empurrador ou injetor TA4 com a configuração apropriada para esvaziar as pilhas de inventário pré-atribuídas. - -[ta4_chest|image] - -### Baú TA4 8x2000 - -O baú TA4 8x2000 não tem um inventário normal como os outros baús, mas tem 8 lojas, sendo que cada loja pode armazenar até 2.000 itens de um tipo. Os botões laranja podem ser usados para mover itens de ou para a loja. A caixa também pode ser preenchida ou esvaziada com um empurrador (TA2, TA3 ou TA4) como de costume. - -Se o baú for preenchido com um empurrador, todos os depósitos serão preenchidos da esquerda para a direita. Se todos os 8 depósitos estiverem cheios e nenhum outro item puder ser adicionado, os itens adicionais serão rejeitados. - -**Função de linha** - -Vários baús TA4 8x2000 podem ser conectados a um baú grande com mais conteúdo. Para fazer isso, os baús devem ser colocados em uma fileira, um após o outro. - -Primeiro, o baú da frente deve ser colocado e, em seguida, os baús empilhados são colocados atrás com a mesma direção de visão (todas as caixas têm a frente voltada para o jogador). Com 2 baús em uma fileira, o tamanho aumenta para 8x4000, etc. - -As fileiras de baús não podem mais ser removidas. Há duas maneiras de desmontar os baús: - -- Esvazie e remova o baú da frente. Isso desbloqueia o próximo baú e pode ser removido. -- Esvazie o baú da frente até o ponto em que todas as lojas contenham no máximo 2.000 itens. Isso desbloqueia o próximo baú e pode ser removido. - -Os baús têm uma caixa de seleção de "pedido". Se essa caixa de seleção for ativada, os depósitos não serão mais completamente esvaziados por um empurrador. O último item permanece no depósito como padrão. Isso resulta em uma atribuição fixa de itens aos locais de armazenamento. - -O baú só pode ser usado por jogadores que podem construir nesse local, ou seja, que têm direitos de proteção. Não importa quem coloca o baú. - -O baú tem um comando adicional para o controlador Lua: - -- `count` é usado para solicitar quantos itens estão no baú. - Exemplo 1: `$send_cmnd(CHEST, "count")` -> Soma dos itens em todas as 8 lojas - Exemplo 2: `$send_cmnd(CHEST, "count", 2)` -> número de itens na loja 2 (segunda a partir da esquerda) -- `storesize` é usado para ler o tamanho de um dos oito armazenamentos: - Exemplo: `$send_cmnd(CHEST, "storesize")` -> a função retorna, por exemplo, 6000 - -[ta4_8x2000_chest|image] - - - -### Distribuidor TA4 - -A função corresponde à do TA2. -A capacidade de processamento é de 24 itens a cada 4 s, desde que os tubos TA4 sejam usados em todos os lados. Caso contrário, haverá apenas 12 itens a cada 4 s. - -[ta4_distributor|image] - -### Distribuidor de alto desempenho TA4 - -A função corresponde à do distribuidor TA4 normal, com duas diferenças: -A capacidade de processamento é de 36 itens a cada 4 s, desde que os tubos TA4 sejam usados em todos os lados. Caso contrário, haverá apenas 18 itens a cada 4 s. -Além disso, até 8 itens podem ser configurados por direção. - -[ta4_high_performance_distributor|image] - -### Peneira de cascalho TA4 - -A função corresponde à do TA2. -A capacidade de processamento é de 4 itens a cada 4 s. O bloco requer 5 ku de eletricidade. - -[ta4_gravelsieve|image] - -### Moedor TA4 - -A função corresponde à do TA2. -A capacidade de processamento é de 4 itens a cada 4 s. O bloco requer 9 ku de eletricidade. - -[ta4_grinder|image] - -### Pedreira TA4 - -A função corresponde em grande parte à do TA2. - -Além disso, o tamanho do furo pode ser definido entre blocos de 3x3 e 11x11. -A profundidade máxima é de 80 metros. A pedreira requer 14 ku de eletricidade. - -[ta4_quarry|image] - -### Fab. eletrônica TA4 - -A função corresponde à do TA2, apenas chips diferentes são produzidos aqui. -A capacidade de processamento é de um chip a cada 6 s. O bloco requer 12 ku de eletricidade para isso. - -[ta4_electronicfab|image] - -### Injetor TA4 - -A função corresponde à do TA3. - -O poder de processamento é de até 8 vezes quatro itens a cada 4 segundos. - -[ta4_injector|image] - -### Reciclador TA4 - -O reciclador é uma máquina que processa todas as receitas de Techage de trás para frente, ou seja, pode desmontar máquinas e blocos e transformá-los em seus componentes. - -A máquina pode desmontar praticamente todos os blocos da Techage e do Hyperloop. Mas nem todos os itens/materiais da receita podem ser reciclados: - -- A madeira se transforma em gravetos -- A pedra se transforma em areia ou cascalho -- Os semicondutores/chips não podem ser reciclados -- As ferramentas não podem ser recicladas - -A capacidade de processamento é de um item a cada 8 s. O bloco requer 16 ku de eletricidade para isso. - -[ta4_recycler|image] \ No newline at end of file diff --git a/techage/manuals/manual_ta5_DE.md b/techage/manuals/manual_ta5_DE.md deleted file mode 100644 index 0520715..0000000 --- a/techage/manuals/manual_ta5_DE.md +++ /dev/null @@ -1,177 +0,0 @@ -# TA5: Zukunft - -Maschinen zur Überwindung von Raum und Zeit, neue Energiequellen und andere Errungenschaften prägen dein Leben. - -Für die Herstellung und Nutzung von TA5 Maschinen und Blöcken sind Erfahrungspunkte (experience points) notwendig. Diese können nur über den Teilchenbeschleuniger aus TA4 erarbeitet werden. - -[techage_ta5|image] - -## Energiequellen - -### TA5 Fusionsreaktor - -Kernfusion bedeutet das Verschmelzen zweier Atomkerne. Dabei können, je nach Reaktion, große Mengen von Energie freigesetzt werden. Kernfusionen, bei denen Energie frei wird, laufen in Form von Kettenreaktionen ab. Sie sind die Quelle der Energie der Sterne, zum Beispiel auch unserer Sonne. Ein Fusionsreaktor wandelt die Energie, die bei einer kontrollierten Kernfusion frei wird, in elektrischen Strom um. - -**Wie funktionieren ein Fusionsreaktor?** - -Ein Fusionsreaktor funktioniert nach dem klassischen Prinzip eines Wärmekraftwerks: Wasser wird erhitzt und treibt eine Dampfturbine an, deren Bewegungsenergie von einem Generator in Strom gewandelt wird. - -Ein Fusionskraftwerk benötigt zunächst eine hohe Menge an Energie, da ein Plasma erzeugt werden muss. „Plasma“ nennt man den vierten Zustand von Stoffen, nach fest, flüssig und gasförmig. Dafür wird viel Strom benötigt. Erst durch diese extreme Energiekonzentration zündet die Fusionsreaktion und mit der abgegebenen Wärme wird über den Wärmetauscher Strom erzeugt. Der Generator liefert dann 800 ku an Strom. - -Der Plan rechts zeigt einen Schnitt durch den Fusionsreaktor. - -Für den Betrieb des Fusionsreaktors werden 60 Erfahrungspunkte benötigt. Der Fusionsreaktur muss komplett in einem Forceload Block Bereich aufgebaut werden. - -[ta5_fusion_reactor|plan] - -#### TA5 Fusionreaktor Magnet - -Für den Aufbau des Fusionsreaktor werden insgesamt 60 TA5 Fusionreaktor Magnete benötigt. Diese bilden den Ring, in dem sich das Plasma bildet. Der TA5 Fusionsreaktor Magnete benötigt Strom und hat zwei Anschlüsse für die Kühlung. - -Es gibt zwei Typen von Magneten, so dass auch alle Seiten des Magnets, die zum Plasmaring zeigen, mit einem Hitzeschild geschützt werden können. - -Bei den Eckmagneten auf der Innenseite des Rings ist jeweils eine Anschlussseite verdeckt (Strom oder Kühlung) und kann daher nicht angeschlossen werden. Dies ist technisch nicht machbar und hat daher keinen Einfluß auf die Funktion des Fusionsreaktor. - -[ta5_magnet|image] - -#### TA5 Pumpe - -Die Pumpe wird benötigt, um den Kühlkreislauf mit Isobutan zu füllen. Es werden ca. 350 Einheiten Isobutan benötigt. - -Hinweis: Die TA5 Pumpe kann nur zum Füllen des Kühlkreislaufs genutzt werden, ein Abpumpen des Kühlmittels ist nicht möglich. Daher sollte die Pumpe erst eingeschaltet werden, wenn die Magnete korrekt platziert und alle Strom- und Kühlleitungen angeschlossen sind. - -[ta5_pump|image] - -#### TA5 Wärmetauscher - -Der TA5 Wärmetauscher wird benötigt, um die im Fusionsreaktor erzeugte Hitze zuerst in Dampf und dann in Strom umzuwandeln. Der Wärmetauscher selbst benötigt dazu 5 ku Strom. Der Aufbau gleicht dem Wärmetauscher des Energiespeichers aus TA4. - -Hinweis: Der TA5 Wärmetauscher hat zwei Anschlüsse (blau und grün) für den Kühlkreislauf. Über die grünen und blauen Röhren müssen der Wärmetauscher und alle Magnete zu einem Kühlkreislauf verbunden werden. - -Über den Start-Button des Wärmetauschers kann der Kühlkreislauf auf Vollständigkeit geprüft werden, auch wenn noch kein Kühlmittel eingefüllt wurde. - -[ta5_heatexchanger|plan] - -#### TA5 Fusionreaktor Controller - -Über den TA5 Fusionreaktor Controller wird der Fusionreaktors eingeschaltet. Dabei muss zuerst die Kühlung/Wärmetauscher und dann der Controller eingeschaltet werden. Es dauert ca. 2 min, bis der Reaktor in Gang kommt und Strom liefert. Der Fusionreaktor und damit der Controller benötigt 400 ku an Strom, um das Plasma aufrecht zu erhalten. - -[ta5_fr_controller|image] - -#### TA5 Fusionreaktor Hülle - -Der komplette Reaktor muss mit einer Hülle umgeben werden, die den enormen Druck, den die Magnete auf das Plasma ausüben, abfängt und die Umgebung vor Strahlung schützt. Ohne diese Hülle kann der Reaktor nicht gestartet werden. Mit der TechAge Kelle können auch Stromkabel und Kühlleitungen des Fusionreaktors in die Hülle integriert werden. - -[ta5_fr_shell|image] - -#### TA5 Fusionreaktor Kern - -Der Kern muss in der Mitte des Reaktors sitzen. Siehe Abbildung unter "TA5 Fusionsreaktor". Auch hierfür wird die TechAge Kelle benötigt. - -[ta5_fr_nucleus|image] - -## Energiespeicher - -### TA5 Hybrid-Speicher (geplant) - -## Logik Blöcke - -## Transport und Verkehr - -### TA5 Flug Controller - -Der TA5 Flug Controller ist ähnlich zum TA4 Move Controller. Im Gegensatz zum TA4 Move Controller können hier mehrere Bewegungen zu einer Flugstrecke kombiniert werden. Diese Flugstrecke kann im Eingabefeld über mehrere x,y,z Angaben definiert werden (eine Bewegung pro Zeile). Über "Speichern" wird die Flugstrecke geprüft und gespeichert. Bei einem Fehler wird eine Fehlermeldung ausgegeben. - -Mit der Taste "Test" wird die Flugstrecke mit den absoluten Koordinaten zur Überprüfung im Chat ausgegeben. - -Die maximale Distanz für die gesammte Flugstrecke beträgt 1500 m. Es können bis zu 32 Blöcke antrainiert werden. - -Die Nutzung des TA5 Flug Controllers benötigt 40 Erfahrungspunkte. - -**Teleport Mode** - -Wird der `Teleport Mode` aktiviert (auf `enable` gesetzt), kann ein Spieler auch ohne Blöcke bewegt werden. Dazu muss die Startposition über die Taste "Aufzeichnen" konfiguriert werden. Es kann hier nur eine Position konfiguriert werden. Das Spieler, der bewegt werden soll, muss dazu auf dieser Position stehen. - -[ta5_flycontroller|image] - -### TA5 Hyperloop Kiste / TA5 Hyperloop Chest - -Die TA5 Hyperloop Kiste erlaubt den Transport von Gegenständen über ein Hyperloop Netzwerk. - -Die TA5 Hyperloop Kiste muss man dazu auf eine Hyperloop Junction stellen. Die Kiste besitzt ein spezielles Menü, mit dem man das Pairing von zwei Kisten durchführen kann. Dinge, die in der Kiste sind, werden zur Gegenstelle teleportiert. Die Kiste kann auch mit einem Schieber gefüllt/geleert werden. - -Für das Pairing musst du zuerst auf der einen Seite einen Namen für die Kiste eingeben, dann kannst du bei der anderen Kiste diesen Namen auswählen und so die beiden Blöcke verbinden. - -Die Nutzung der TA5 Hyperloop Kiste benötigt 15 Erfahrungspunkte. - -[ta5_chest|image] - -### TA5 Hyperloop Tank / TA5 Hyperloop Tank - -Der TA5 Hyperloop Tank erlaubt den Transport von Flüssigkeiten über ein Hyperloop Netzwerk. - -Den TA5 Hyperloop Tank muss man dazu auf eine Hyperloop Junction stellen. Der Tank besitzt ein spezielles Menü, mit dem man das Pairing von zwei Tanks durchführen kann. Flüssigkeiten, die in dem Tank sind, werden zur Gegenstelle teleportiert. Der Tank kann auch mit einer Pumpe gefüllt/geleert werden. - -Für das Pairing musst du zuerst auf der einen Seite einen Namen für den Tank eingeben, dann kannst du bei dem anderen Tank diesen Namen auswählen und so die beiden Blöcke verbinden. - -Die Nutzung des TA5 Hyperloop Tanks benötigt 15 Erfahrungspunkte. - -[ta5_tank|image] - -### TA5-Raumgleiter (geplant) - -Dank einem Spezialantrieb für Lichtgeschwindigkeit können mit dem Raumgleiter auch große Entfernungen sehr schnell überwunden werden. - -## Teleport Blöcke - -Mit Teleport-Blöcken können Dinge zwischen zwei Teleport-Blöcken übertragen werden, ohne dass sich dazwischen eine Röhre oder Leitung befinden muss. Für das Pairing der Blöcke musst du zuerst auf der einen Seite einen Namen für den Block eingeben, dann kannst du bei dem anderen Block diesen Namen auswählen und so die beiden Blöcke verbinden. Das Pairung kann nur von einem Spieler durchgeführt werden (Spielername wird geprüft) und muss vor einem Server-Neustart abgeschlossen sein. Anderenfalls gehen die Pairing-Daten verloren. - -Der Plan rechts zeigt, wie die Blöcke genutzt werden können. - -[ta5_teleport|plan] - -### TA5 Teleport Block Gegenstände / TA5 Teleport Block Items - -Diese Teleport-Blöcke erlauben die Übertragung von Gegenständen und ersetzen somit eine Röhre. Dabei können Entfernungen von bis zu 500 Blöcken überbrückt werden. - -Ein Teleport-Block benötigt 12 ku Strom. - -Für die Nutzung der Teleport-Blöcke werden 30 Erfahrungspunkte benötigt. - -[ta5_tele_tube|image] - -### TA5 Teleport Block Flüssigkeiten / TA5 Teleport Block Liquids - -Diese Teleport-Blöcke erlauben die Übertragung von Flüssigkeiten und ersetzen somit eine gelbe Leitung. Dabei können Entfernungen von bis zu 500 Blöcken überbrückt werden. - -Ein Teleport-Block benötigt 12 ku Strom. - -Für die Nutzung der Teleport-Blöcke werden 30 Erfahrungspunkte benötigt. - -[ta5_tele_pipe|image] - -### Hyperloop Teleport Blöcke (geplant) - -Die Hyperloop Teleport Blöcke erlauben den Aufbau von Hyperloop Netzwerk ohne Hyperloop-Röhren. - -Die Nutzung der Hyperloop Teleport Blöcke benötigt 60 Erfahrungspunkte. - -## Weitere TA5 Blöcke/Items - -### TA5 Container (geplant) - -Der TA5 Container erlaubt Techage Anlagen ein- und an einer anderen Stelle wieder auszupacken. - -Für die Nutzung des TA5 Containers werden 80 Erfahrungspunkte benötigt. - -### TA5 KI Chip / TA5 AI Chip - -Der TA5 KI Chip wird teilweise zur Herstellung von TA5 Blöcken benötigt. Der TA5 KI Chip kann nur auf der TA4 Elektronik Fab hergestellt werden. Dazu werden 10 Erfahrungspunkte benötigt. - -[ta5_aichip|image] - -### TA5 KI Chip II / TA5 AI Chip II - -Der TA5 KI Chip II wird zur Herstellung des TA5 Fusionsreaktors benötigt. Der TA5 KI Chip II kann nur auf der TA4 Elektronik Fab hergestellt werden. Dazu werden 25 Erfahrungspunkte benötigt. - -[ta5_aichip2|image] \ No newline at end of file diff --git a/techage/manuals/manual_ta5_EN.md b/techage/manuals/manual_ta5_EN.md deleted file mode 100644 index fa90707..0000000 --- a/techage/manuals/manual_ta5_EN.md +++ /dev/null @@ -1,177 +0,0 @@ -# TA5: Future - -Machines to overcome space and time, new sources of energy and other achievements shape your life. - -Experience points are required for the manufacture and use of TA5 machines and blocks. These can only be worked out using the collider from TA4. - -[techage_ta5|image] - -## Energy Sources - -### TA5 Fusion Reactor - -Nuclear fusion means the fusing of two atomic nuclei. Depending on the reaction, large amounts of energy can be released. Nuclear fusions, in which energy is released, take place in the form of chain reactions. They are the source of the energy of the stars, including our sun, for example. A fusion reactor converts the energy released during controlled nuclear fusion into electricity. - -**How ​​do fusion reactors work?** - -A fusion reactor works according to the classic principle of a thermal power plant: water is heated and drives a steam turbine, whose kinetic energy is converted into electricity by a generator. - -A fusion power plant initially requires a large amount of energy, since a plasma has to be generated. "Plasma" is the name given to the fourth state of matter, after solid, liquid and gaseous. This requires a lot of electricity. Only through this extreme concentration of energy does the fusion reaction ignite and the heat given off is used to generate electricity via the heat exchanger. The generator then delivers 800 ku of electricity. - -The plan on the right shows a section through the fusion reactor. - -60 experience points are required to operate the fusion reactor. The fusion reactor must be built entirely in a forceload block area. - -[ta5_fusion_reactor|plan] - -#### TA5 Fusion Reactor Magnet - -A total of 60 TA5 Fusion Reactor Magnets are required to set up the fusion reactor. These form the ring in which the plasma forms. The TA5 Fusion Reactor Magnets requires power and has two ports for cooling. - -There are two types of magnets, so all sides of the magnet that face the plasma ring can also be protected with a heat shield. - -With the corner magnets on the inside of the ring, one connection side is covered (power or cooling) and can therefore not be connected. This is technically not feasible and therefore has no influence on the function of the fusion reactor. - -[ta5_magnet|image] - -#### TA5 Pump - -The pump is required to fill the cooling circuit with isobutane. About 350 units of isobutane are required. - -Note: The TA5 pump can only be used to fill the cooling circuit, pumping out the coolant is not possible. Therefore, the pump should not be switched on until the magnets are correctly placed and all power and cooling lines are connected. - -[ta5_pump|image] - -#### TA5 Heat Exchanger - -The TA5 Heat Exchanger is required to convert the heat generated in the fusion reactor first to steam and then to electricity. The Heat Exchanger itself requires 5 ku electricity. The structure is similar to the Heat Exchanger of the energy store from TA4. - -Note: The TA5 Heat Exchanger has two connections (blue and green) for the cooling circuit. The heat exchanger and all magnets must be connected to form a cooling circuit via the green and blue pipes. - -The cooling circuit can be checked for completeness using the start button on the heat exchanger, even if no coolant has yet been filled in. - -[ta5_heatexchanger|plan] - -#### TA5 Fusion Reactor Controller - -The fusion reactor is switched on via the TA5 Fusion Reactor Controller. The cooling/Heat Exchanger must be switched on first and then the controller. It takes about 2 minutes for the reactor to start up and supply electricity. The fusion reactor and thus the controller requires 400 ku of electricity to maintain the plasma. - -[ta5_fr_controller|image] - -#### TA5 Fusion Reactor Shell - -The entire reactor must be surrounded by a shell that absorbs the enormous pressure that the magnets exert on the plasma and protects the environment from radiation. Without this shell, the reactor cannot be started. With the TechAge Trowel, power cables and cooling pipes of the fusion reactor can also be integrated into the shell. - -[ta5_fr_shell|image] - -#### TA5 Fusion Reactor Core - -The core must sit in the center of the reactor. See illustration under "TA5 Fusion Reactor". The TechAge Trowel is also required for this. - -[ta5_fr_nucleus|image] - -## Energy Storage - -### TA5 Hybrid Storage (planned) - -## Logic blocks - -## Transport and Traffic - -### TA5 Flight Controller - -The TA5 Flight Controller is similar to the TA4 Move Controller. In contrast to the TA4 Move Controller, several movements can be combined into one flight route. This flight route can be defined in the input field using several x,y,z entries (one movement per line). The flight route is checked and saved via "Save". In the event of an error, an error message is issued. - -With the "Test" button, the flight route with the absolute coordinates is output for checking in the chat. - -The maximum distance for the entire flight distance is 1500 m. Up to 32 blocks can be trained. - -The use of the TA5 Flight Controller requires 40 experience points. - -**Teleport mode** - -If the 'Teleport Mode' is enabled, a player can also be moved without blocks. To do this, the start position must be configured using the "Record" button. Only one position can be configured here. The player to be moved must be in that position. - -[ta5_flycontroller|image] - -### TA5 Hyperloop Chest - -The TA5 Hyperloop Chest allows objects to be transported over a Hyperloop network. - -The TA5 Hyperloop Chest has to be placed on a Hyperloop Junction. The chest has a special menu, with which you can pair two chests. Things that are in the chest are teleported to the remote station. The chest can also be filled/emptied with a pusher. - -For pairing you first have to enter a name for the chest on one side, then you can select this name for the other chest and thus connect the two blocks. - -The use of the TA5 Hyperloop Chest requires 15 experience points. - -[ta5_chest|image] - -### TA5 Hyperloop Tank - -The TA5 Hyperloop Tank allows liquids to be transported over a Hyperloop network. - -The TA5 Hyperloop Tank has to be placed on a Hyperloop Junction.The tank has a special menu, with which you can pair two tanks. Liquids in the tank will be teleported to the remote station. The tank can also be filled/emptied with a pump. - -For pairing you first have to enter a name for the tank on one side, then you can select this name for the other tank and thus connect the two blocks. - -The use of the TA5 Hyperloop Tank requires 15 experience points. - -[ta5_tank|image] - - - -## Teleport Blocks - -Teleport blocks allow things to be transferred between two teleport blocks without the need for a pipe or tube in between. To pair the blocks, you first have to enter a name for the block on one side, then you can select this name for the other block and thus connect the two blocks. Pairing can only be carried out by one player (player name is checked) and must be completed before the server is restarted. Otherwise the pairing data will be lost. - -The map on the right shows how the blocks can be used. - -[ta5_teleport|plan] - -### TA5 Teleport Block Items - -These teleport blocks allow the transfer of items and thus replace a tube. Distances of up to 500 blocks can be bridged. - -Each Teleport blocks requires 12 ku of electricity. - -30 experience points are required to use the teleport blocks. - -[ta5_tele_tube|image] - -### TA5 Teleport Block Liquids - -These teleport blocks allow the transfer of liquids and thus replace a pipe. Distances of up to 500 blocks can be bridged. - -Each Teleport blocks requires 12 ku of electricity. - -30 experience points are required to use the teleport blocks. - -[ta5_tele_pipe|image] - -### Hyperloop Teleport Blocks (planned) - -The Hyperloop Teleport Blocks allow the construction of a Hyperloop network without Hyperloop tubes. - -The use of the Hyperloop Teleport Blocks requires 60 experience points. - - - -## More TA5 Blocks/Items - -### TA5 Container (planned) - -The TA5 container allows Techage systems to be packed and unpacked at another location. - -80 experience points are required to use the TA5 container. - -### TA5 AI Chip - -The TA5 AI Chip is partly required for the production of TA5 blocks. The TA5 AI Chip can only be manufactured at the TA4 Electronics Fab. This requires 10 experience points. - -[ta5_aichip|image] - -### TA5 AI Chip II - -The TA5 AI Chip II is required to build the TA5 Fusion Reactor. The TA5 AI Chip II can only be manufactured at the TA4 Electronics Fab. This requires 25 experience points. - -[ta5_aichip2|image] diff --git a/techage/manuals/manual_ta5_pt-BR.md b/techage/manuals/manual_ta5_pt-BR.md deleted file mode 100644 index dc90ca8..0000000 --- a/techage/manuals/manual_ta5_pt-BR.md +++ /dev/null @@ -1,177 +0,0 @@ -# TA5: Futuro - -Máquinas para superar o espaço e o tempo, novas fontes de energia e outras conquistas moldam sua vida. - -São necessários pontos de experiência para a fabricação e o uso de máquinas e blocos TA5. Eles só podem ser calculados usando o colisor do TA4. - -[techage_ta5|image] - -## Fontes de energia - -### Reator de fusão TA5 - -A fusão nuclear significa a fusão de dois núcleos atômicos. Dependendo da reação, grandes quantidades de energia podem ser liberadas. As fusões nucleares, nas quais a energia é liberada, ocorrem na forma de reações em cadeia. Elas são a fonte de energia das estrelas, inclusive do nosso sol, por exemplo. Um reator de fusão converte a energia liberada durante a fusão nuclear controlada em eletricidade. - -**Como funcionam os reatores de fusão?** - -Um reator de fusão funciona de acordo com o princípio clássico de uma usina de energia térmica: a água é aquecida e aciona uma turbina a vapor, cuja energia cinética é convertida em eletricidade por um gerador. - -Uma usina de fusão requer inicialmente uma grande quantidade de energia, pois é necessário gerar um plasma. "Plasma" é o nome dado ao quarto estado da matéria, depois do sólido, líquido e gasoso. Isso requer uma grande quantidade de eletricidade. Somente por meio dessa concentração extrema de energia é que a reação de fusão se inflama e o calor liberado é usado para gerar eletricidade por meio do trocador de calor. O gerador fornece então 800 ku de eletricidade. - -A planta à direita mostra uma seção do reator de fusão. - -São necessários 60 pontos de experiência para operar o reator de fusão. O reator de fusão deve ser construído inteiramente em uma área de bloco de carga. - -[ta5_fusion_reactor|plan] - -#### Ímã do reator de fusão TA5 - -Um total de 60 ímãs de reator de fusão TA5 é necessário para configurar o reator de fusão. Eles formam o anel no qual o plasma se forma. O TA5 Fusion Reactor Magnets requer energia e tem duas portas para resfriamento. - -Há dois tipos de ímãs, portanto, todos os lados do ímã voltados para o anel de plasma também podem ser protegidos com um protetor térmico. - -Com os ímãs de canto na parte interna do anel, um lado da conexão é coberto (energia ou resfriamento) e, portanto, não pode ser conectado. Isso não é tecnicamente viável e, portanto, não influencia a função do reator de fusão. - -[ta5_magnet|image] - -#### Bomba TA5 - -A bomba é necessária para encher o circuito de resfriamento com isobutano. São necessárias cerca de 350 unidades de isobutano. - -Observação: A bomba TA5 só pode ser usada para encher o circuito de resfriamento; não é possível bombear o líquido de arrefecimento para fora. Portanto, a bomba não deve ser ligada até que os ímãs estejam corretamente posicionados e todas as linhas de alimentação e resfriamento estejam conectadas. - -[ta5_pump|image] - -#### Trocador de calor TA5 - -O trocador de calor TA5 é necessário para converter o calor gerado no reator de fusão primeiro em vapor e depois em eletricidade. O próprio trocador de calor requer 5 ku de eletricidade. A estrutura é semelhante à do trocador de calor do depósito de energia do TA4. - -Observação: O trocador de calor TA5 tem duas conexões (azul e verde) para o circuito de resfriamento. O trocador de calor e todos os ímãs devem ser conectados para formar um circuito de resfriamento por meio dos tubos verde e azul. - -É possível verificar se o circuito de resfriamento está completo usando o botão de partida no trocador de calor, mesmo que o líquido de arrefecimento ainda não tenha sido abastecido. - -[ta5_heatexchanger|plan] - -#### Controlador do reator de fusão TA5 - -O reator de fusão é ligado por meio do controlador do reator de fusão TA5. O resfriamento/trocador de calor deve ser ligado primeiro e depois o controlador. Leva cerca de 2 minutos para o reator iniciar e fornecer eletricidade. O reator de fusão e, portanto, o controlador requerem 400 ku de eletricidade para manter o plasma. - -[ta5_fr_controller|image] - -#### Carcaça do reator de fusão TA5 - -O reator inteiro deve ser cercado por um invólucro que absorva a enorme pressão que os ímãs exercem sobre o plasma e proteja o ambiente da radiação. Sem esse invólucro, o reator não pode ser iniciado. Com a TechAge Trowel, os cabos de energia e os tubos de resfriamento do reator de fusão também podem ser integrados à carcaça. - -[ta5_fr_shell|image] - -#### Núcleo do reator de fusão TA5 - -O núcleo deve ficar no centro do reator. Veja a ilustração em "TA5 Fusion Reactor". A espátula TechAge também é necessária para isso. - -[ta5_fr_nucleus|image] - -## Armazenamento de energia - -### Armazenamento híbrido TA5 (planejado) - -## Blocos lógicos - -## Transporte e tráfego - -### Controlador de voo TA5 - -O controlador de voo TA5 é semelhante ao controlador de movimento TA4. Ao contrário do TA4 Move Controller, vários movimentos podem ser combinados em uma rota de voo. Essa rota de voo pode ser definida no campo de entrada usando várias entradas x,y,z (um movimento por linha). A rota de voo é verificada e salva por meio de "Save" (Salvar). Em caso de erro, é emitida uma mensagem de erro. - -Com o botão "Test" (Testar), a rota de voo com as coordenadas absolutas é emitida para verificação no bate-papo. - -A distância máxima para toda a distância de voo é de 1.500 m. Até 32 blocos podem ser treinados. - -O uso do controlador de voo TA5 requer 40 pontos de experiência. - -**Modo teletransporte** - -Se o "Teleport Mode" (Modo de teletransporte) estiver ativado, o jogador também poderá ser movido sem blocos. Para fazer isso, a posição inicial deve ser configurada usando o botão "Record" (Registrar). Somente uma posição pode ser configurada aqui. O jogador a ser movido deve estar nessa posição. - -[ta5_flycontroller|image] - -### TA5 Hyperloop Chest - -O TA5 Hyperloop Chest permite que objetos sejam transportados em uma rede Hyperloop. - -O Baú Hyperloop TA5 deve ser colocado em uma Junção Hyperloop. O baú tem um menu especial, com o qual você pode emparelhar dois baús. Os itens que estão no baú são teletransportados para a estação remota. O baú também pode ser preenchido/esvaziado com um empurrador. - -Para fazer o emparelhamento, primeiro você precisa inserir um nome para o baú de um lado e, em seguida, selecionar esse nome para o outro baú e, assim, conectar os dois blocos. - -O uso do Baú do Hyperloop TA5 requer 15 pontos de experiência. - -[ta5_chest|image] - -### Tanque de hyperloop TA5 - -O TA5 Hyperloop Tank permite o transporte de líquidos em uma rede Hyperloop. - -O TA5 Hyperloop Tank deve ser colocado em um Hyperloop Junction. O tanque tem um menu especial, com o qual você pode emparelhar dois tanques. Os líquidos no tanque serão teletransportados para a estação remota. O tanque também pode ser enchido/esvaziado com uma bomba. - -Para fazer o emparelhamento, primeiro é necessário inserir um nome para o tanque de um lado e, em seguida, selecionar esse nome para o outro tanque e, assim, conectar os dois blocos. - -O uso do TA5 Hyperloop Tank requer 15 pontos de experiência. - -[ta5_tank|image] - - - -## Blocos de teletransporte - -Os blocos de teletransporte permitem a transferência de objetos entre dois blocos de teletransporte sem a necessidade de um cano ou tubo entre eles. Para emparelhar os blocos, primeiro é preciso digitar um nome para o bloco de um lado e, em seguida, selecionar esse nome para o outro bloco e, assim, conectar os dois blocos. O emparelhamento só pode ser realizado por um jogador (o nome do jogador é verificado) e deve ser concluído antes de o servidor ser reiniciado. Caso contrário, os dados de emparelhamento serão perdidos. - -O mapa à direita mostra como os blocos podem ser usados. - -[ta5_teleport|plan] - -### Itens do bloco de teletransporte TA5 - -Esses blocos de teletransporte permitem a transferência de itens e, portanto, substituem um tubo. Distâncias de até 500 blocos podem ser transpostas. - -Cada bloco de teletransporte requer 12 ku de eletricidade. - -São necessários 30 pontos de experiência para usar os blocos de teletransporte. - -[ta5_tele_tube|image] - -### Líquidos do bloco de teletransporte TA5 - -Esses blocos de teletransporte permitem a transferência de líquidos e, portanto, substituem um cano. Distâncias de até 500 blocos podem ser transpostas. - -Cada bloco de teletransporte requer 12 ku de eletricidade. - -São necessários 30 pontos de experiência para usar os blocos de teletransporte. - -[ta5_tele_pipe|image] - -### Blocos de teletransporte Hyperloop (planejados) - -Os blocos de teletransporte Hyperloop permitem a construção de uma rede Hyperloop sem tubos Hyperloop. - -O uso dos blocos de teletransporte Hyperloop requer 60 pontos de experiência. - - - -## Mais blocos/itens TA5 - -### Contêiner TA5 (planejado) - -O contêiner TA5 permite que os sistemas Techage sejam embalados e desembalados em outro local. - -São necessários 80 pontos de experiência para usar o contêiner TA5. - -### Chip TA5 AI - -O chip TA5 AI é parcialmente necessário para a produção de blocos TA5. O chip de IA TA5 só pode ser fabricado na fábrica de eletrônicos TA4. Isso requer 10 pontos de experiência. - -[ta5_aichip|image] - -### Chip TA5 AI II - -O TA5 AI Chip II é necessário para construir o Reator de Fusão TA5. O TA5 AI Chip II só pode ser fabricado na fábrica de eletrônicos TA4. Isso requer 25 pontos de experiência. - -[ta5_aichip2|image] \ No newline at end of file diff --git a/techage/manuals/markdown_to_lua.py b/techage/manuals/markdown_to_lua.py deleted file mode 100644 index 28512d1..0000000 --- a/techage/manuals/markdown_to_lua.py +++ /dev/null @@ -1,271 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# install mistune v0.8.4 with: pip install mistune==0.8.4 - -import re -import mistune - -assert(mistune.__version__ == "0.8.4") - -__version__ = "1.0" - -class WikiLinkInlineLexer(mistune.InlineLexer): - def enable_wiki_link(self): - # add wiki_link rules - self.rules.wiki_link = re.compile( - r'\[' # [ - r'([\s\S]+?\|[\s\S]+?)' # name| img-type - r'\](?!\])' # ] - ) - - # Add wiki_link parser to default rules - # you can insert it some place you like - # but place matters, maybe 3 is not good - self.default_rules.insert(3, 'wiki_link') - - def output_wiki_link(self, m): - text = m.group(1) - name, itype = text.split('|') - # you can create an custom render - # you can also return the html if you like - return self.renderer.wiki_link(name, itype) - -class MarkdownToLua(mistune.Renderer): - def __init__(self, *args, **kwargs): - mistune.Renderer.__init__(self, *args, **kwargs) - self.item_name = "" - self.plan_table = "" - self.is_first_header = True - self.text_chunck = [] - self.lTitle = [] - self.lText = [] - self.lItemName = [] - self.lPlanTable = [] - print("Markdown-to-Lua v%s" % __version__) - - def m2l_formspec_escape(self, text): - text = text.replace("\\", "") - text = text.replace("[", "\\\\[") - text = text.replace("]", "\\\\]") - text = text.replace(";", "\\\\;") - text = text.replace(",", "\\\\,") - text = text.replace('"', '\\"') - text = text.replace('\n', '\\n') - return text - - def m2l_add_last_paragraph(self): - """ - Used to add a text block before the next header or at the end of the document - """ - self.lText.append(self.text_chunck) - self.text_chunck = [] - self.lItemName.append(self.item_name) - self.item_name = "" - self.lPlanTable.append(self.plan_table) - self.plan_table = "" - ## - ## Block Level - ## - def block_code(self, code, lang): - text = self.m2l_formspec_escape(code.strip()) - lines = text.split("\\n") - lines = [" " + item for item in lines] - self.text_chunck.extend(lines) - self.text_chunck.append("") - return "" - - def header(self, text, level, raw=None): - if not self.is_first_header: - self.m2l_add_last_paragraph() - self.is_first_header = False - self.lTitle.append("%u,%s" % (level, self.m2l_formspec_escape(text))) - return "" - - def hrule(self): - self.text_chunck.append("\n----------------------------------------------------\n") - return "" - - def paragraph(self, text): - lines = text.split("\\n") + [""] - self.text_chunck.extend(lines) - return "" - - def list(self, body, ordered=True): - lines = body.split("\n") - self.text_chunck.extend(lines) - return "" - - def list_item(self, text): - return " - %s\n" % text.strip() - ## - ## Span Level - ## - def emphasis(self, text): - return "*%s*" % self.m2l_formspec_escape(text) - - def double_emphasis(self, text): - return "*%s*" % self.m2l_formspec_escape(text) - - def codespan(self, text): - return "'%s'" % self.m2l_formspec_escape(text) - - def text(self, text): - return self.m2l_formspec_escape(text) - - def link(self, link, title, content): - """ - Used for plans and images: - [myimage](/image/) - [myplan](/plan/) - """ - if link == "/image/": - self.item_name = content - elif link == "/plan/": - self.plan_table = content - return content - - def wiki_link(self, name, itype): - """ - Used for plans and images: - [myimage|image] - [myplan|plan] - """ - if itype == "image": - self.item_name = name - elif itype == "plan": - self.plan_table = name - return "" - - def autolink(self, link, is_email=False): - return link - - def linebreak(self): - return "\\n" - - def newline(self): - return "\\n" - - def inline_html(self, text): - #print(text) - pass - - def parse_md_file(self, src_name): - print(" - Read MD file '%s'" % src_name) - inline = WikiLinkInlineLexer(self) - # enable the feature - inline.enable_wiki_link() - md = mistune.Markdown(renderer=self, inline=inline) - md.renderer.src_name = src_name - md.render(open(src_name, 'r').read()) - md.renderer.m2l_add_last_paragraph() - - def lua_table(self, key, lData): - lOut = [] - lOut.append(" %s = {" % key) - for line in lData: - lOut.append(' "%s",' % line) - lOut.append(" }") - return "\n".join(lOut) - - def lua_text_table(self, key, lData): - lOut = [] - lOut.append(" %s = {" % key) - for lines in lData: - for line in lines[:-1]: - line = line.replace('
', '\\n') - lOut.append(' "%s\\n"..' % line) - if len(lines) > 0: - lOut.append(' "%s\\n",' % lines[-1]) - else: - lOut.append(' "",') - lOut.append(" }") - return "\n".join(lOut) - - def gen_lua_file(self, dest_name): - print(" - Write Lua file '%s'" % dest_name) - lOut = [] - s = ",\n".join([self.lua_table("titles", self.lTitle), - self.lua_text_table("texts", self.lText), - self.lua_table("images", self.lItemName), - self.lua_table("plans", self.lPlanTable)]) - open(dest_name, "w").write("return {\n%s\n}" % s) - print("done.") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_DE.md") -m2l.gen_lua_file("../doc/manual_DE.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_RU.md") -m2l.gen_lua_file("../doc/manual_RU.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta1_DE.md") -m2l.gen_lua_file("../doc/manual_ta1_DE.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta2_DE.md") -m2l.gen_lua_file("../doc/manual_ta2_DE.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta3_DE.md") -m2l.gen_lua_file("../doc/manual_ta3_DE.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta4_DE.md") -m2l.gen_lua_file("../doc/manual_ta4_DE.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta5_DE.md") -m2l.gen_lua_file("../doc/manual_ta5_DE.lua") - - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_EN.md") -m2l.gen_lua_file("../doc/manual_EN.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta1_EN.md") -m2l.gen_lua_file("../doc/manual_ta1_EN.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta2_EN.md") -m2l.gen_lua_file("../doc/manual_ta2_EN.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta3_EN.md") -m2l.gen_lua_file("../doc/manual_ta3_EN.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta4_EN.md") -m2l.gen_lua_file("../doc/manual_ta4_EN.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta5_EN.md") -m2l.gen_lua_file("../doc/manual_ta5_EN.lua") - - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_pt-BR.md") -m2l.gen_lua_file("../doc/manual_pt-BR.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta1_pt-BR.md") -m2l.gen_lua_file("../doc/manual_ta1_pt-BR.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta2_pt-BR.md") -m2l.gen_lua_file("../doc/manual_ta2_pt-BR.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta3_pt-BR.md") -m2l.gen_lua_file("../doc/manual_ta3_pt-BR.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta4_pt-BR.md") -m2l.gen_lua_file("../doc/manual_ta4_pt-BR.lua") - -m2l = MarkdownToLua() -m2l.parse_md_file("./manual_ta5_pt-BR.md") -m2l.gen_lua_file("../doc/manual_ta5_pt-BR.lua") diff --git a/techage/manuals/ta4_icta_controller_DE.md b/techage/manuals/ta4_icta_controller_DE.md deleted file mode 100644 index 70a34ec..0000000 --- a/techage/manuals/ta4_icta_controller_DE.md +++ /dev/null @@ -1,112 +0,0 @@ -# TA4 ICTA Controller - -Der ICTA Controller (ICTA steht für "If Condition Then Action") dient zur Überwachung und Steuerung von Maschinen. Mit dem Controller kann man Daten von Maschinen und anderen Blöcken einlesen und abhängig davon andere Maschinen und Blöcke ein-/ausschalten. - -### 8 Steuerregeln - -Der Controller arbeitet auf das Basis von Regeln, wobei bis zu 8 Regeln pro Controller angelegt werden können. - -Beispiele für Regeln sind: - -- Wenn ein Verteiler verstopft ist (```blocked```), soll der Schieber davor ausgeschaltet werden -- Wenn eine Maschine den Fehlerzustand (`fault`) anzeigt, soll eine Lampe zur Fehleranzeige eingeschaltet werden -- Wenn ein Spieler in der Nähe eines Spieler Detektors ist, soll sein Name auf einem Display ausgegeben werden -- Wenn ein Minecart am Cart-Sensor erkannt wird, soll das Cart beladen werden (Schieber eingeschaltet) - -Alle Regeln sollten nur so oft wie notwendig ausgeführt werden. Dies hat zwei Vorteile: - -- die Batterie des Controllers hält länger (jeder Controller benötigt eine Batterie) -- die Last für den Server ist geringer (damit weniger Lags) - -### Zyklische Ausführung von Regeln - -Diese Regeln werden vom Controller zyklisch geprüft. Ist eine Bedingung (condition) erfüllt, wird die Aktion (action) ausgeführt. Solange die Bedingung nicht erfüllt ist, passiert nichts. Auch wenn die Bedingung bei der letzten Bearbeitung der Regel schon erfüllt war und damit die Aktion ausgeführt wurde, passiert nichts mehr. Die Bedingung muss zuerst ungültig und dann wieder gültig werden, so dass die Aktion erneut ausgeführt wird. - -Wie oft eine Regel vom Controller geprüft wird, kann für jede Regel einzeln konfiguriert werden. Pro Regel muss dazu eine Zykluszeit in Sekunden (`Cycle/s`) angegeben werden (1..1000). - -### Ereignis gesteuerte Ausführung von Regeln - -Alternativ zu den zyklisch geprüften Regeln gibt es auch die Ereignis gesteuerte Ausführung von Regeln. - -Ereignisse sind Kommandos, die von anderen Blöcken an den Controller gesendet werden. Beispiele sind Sensoren und Schalter. Diese senden `on`/`off` Kommandos. Wird bspw. der Schalter eingeschaltet, sendet dieser ein `on` Kommando, wird er ausgeschaltet, sendet dieser ein `off` Kommando an den Block mit der Nummer, die beim Schalter konfiguriert wurde. - -Bei Regeln, die Ereignis-gesteuert ausgeführt werden sollen, muss als Zykluszeit 0 angegeben werden. - -### Verzögerungszeit - -Man muss für jede Aktion eine Verzögerungszeit (```after/s```) einstellen. Soll die Aktion sofort ausgeführt werden, ist 0 einzugeben. - -#### Bedingungen / Conditions - -Für jede Regel kann eine der folgenden Bedingungen konfiguriert werden. Pro Regel kann aber immer nur eine Bedingung konfiguriert werden. - -- `initial` - Diese Bedingung ist immer nach dem Einschalten des Controllers erfüllt und dient bspw. dazu, eine Lampe auszuschalten, um sie dann beim Auftreten eines Fehlers wieder einschalten zu können. - -- `true` - Diese Bedingung ist immer erfüllt und dient bspw. dazu, eine Lampe blinken zu lassen . Dazu werden zwei Regeln benötigt. Haben bspw. beide Regeln eine Zykluszeit von 2 s, aber die erste Regel eine Verzögerungszeit von 0 s und die zweite Regel eine Verzögerungszeit von 1 s, so kann damit eine Lampe zyklisch ein- und wieder ausgeschaltet werden. - -- `condition` - Hier kann abhängig von einer anderen Regel eine Aktion gestartet werden. Dazu muss die Nummer der anderen Regel (1..8) angegeben werden. Damit können 2 Aktionen mit einer `condition` ausgeführt werden. Über die zusätzlich konfigurierbare Bedingung kam mit `was not true` erreicht werden, dass bspw. eine Lampe wieder ausgeschaltet wird, wenn die Bedingung nicht mehr erfüllt ist. - -- `inputs` - Damit kann der empfangene Wert `on` / `off` eines Kommandos (Ereignis) ausgewertet werden. Hier bitte beachten: Bei Regeln, die Ereignis-gesteuert ausgeführt werden sollen, muss als Zykluszeit 0 angegeben werden. - -- `read block state` - Damit kann der Status einer Maschine abgefragt werden. Die Nummer der Maschine (Blocknummer) muss eingegeben werden. Mögliche Maschinenzustände sind: - - - `running` --> Maschine ist am arbeiten - - `stopped` --> Maschine ist ausgeschaltet - - `standby` --> Maschine hat nichts zu tun, da bspw. das Inventar leer ist - - `blocked` -->Maschine kann nichts tun, da bspw. das Ausgangs-Inventar voll ist - - `fault` --> Maschine hat einen Fehler. Weitere Informationen liefert ggf. das Maschinen-Menü - - `unloaded` --> Maschinen in größerer Entfernung können ohne Forceload Block vom Server entladen worden sein. Diese sind dann nicht aktiv. - - Ist eine konfigurierte Bedingung erfüllt, also bspw. `block nummer 456 is stopped`, so wird die Aktion ausgeführt. - - **Info:** Eine **Blocknummer** ist eine eindeutige Zahl, die von Techage beim Setzen von vielen Techage Blöcken generiert und als Infotext hinter dem Blocknamen angezeigt wird. Die Blocknummer dient zur Adressierung bei der Kommunikation zwischen Techage Controllern und Maschinen. - - Welche Maschinen welche Statusinformationen liefern, kann am einfachsten mit dem Schraubenschlüssel /Techage Info Werkzeug direkt an der Maschine festgestellt werden. - -- `read amount of fuel` - Damit kann ausgelesen werden, wie viel Sprit eine Maschine noch hat (typisch 0-99 Einheiten) und mit einem Wert auf 'größer' oder 'kleiner' verglichen werden. Ist die konfigurierte Bedingung erfüllt, wird die Aktion ausgeführt. - `read power/liquid load` - Damit kann die Ladung eines Akkus oder des Wärmespeichers in Prozent (Werte von 0..100) abgefragt und mit der konfigurierten Bedingung auf 'größer'/'kleiner' geprüft werden. Ist die Bedingung erfüllt, wird die Aktion ausgeführt. - -- `read delivered power` - Damit kann die Strommenge abgefragt werden, die ein Generator (in ku) abgibt. Der Wert kann mit der konfigurierten Bedingung auf 'größer'/'kleiner' geprüft werden. Ist die Bedingung erfüllt, wird die Aktion ausgeführt. Da Akkus nicht nur Strom abgeben sondern auch aufnehmen, ist dieser Wert, wenn der Akku geladen wird, negativ. - -- `read chest state` - Damit kann der Zustand eines TA3/TA4 Chests/Kiste abgefragt und ausgewertet werden. Kisten liefern die Zustände: - - - `empty` - Die Kiste ist leer - - `loaded` - Die Kiste teilweise gefüllt - - `full` - Alle Stacks der Kiste sind zumindest teilweise belegt - - Ist die Bedingung erfüllt, wird die Aktion ausgeführt. - -- `read Signal Tower state` - Damit kann die Farbe eines Signal Towers abgefragt und geprüft werden. Signal Tower liefern die Werte `off`, `green`, `amber`, `red`. Ist die Bedingung erfüllt, wird die Aktion ausgeführt. - -- `read Player Detector` - Damit kann ein Spieler Detektor abgefragt werden. Der Detektor liefert den Namen des Spielers in der Nähe des Detektor. Soll nicht nur ein bestimmter, sondern jeder Spielername an einem Display ausgegeben werden, so ist bei 'player name(s)' `*` einzugeben. - Es können auch mehrere Namen durch Leerzeichen getrennt eingegeben werden. Soll die Aktion ausgeführt werden, wenn kein Spieler in der Nähe ist, ist `-` einzugeben. - -### Aktionen /Actions - -Für alle Aktionen, die einen Block (wie bspw. eine Lampe) steuern, muss die Nummer des Blocks bei der Aktion angegeben werden. Pro Regel kann nur eine Aktion konfiguriert werden. - -- `print to output window` - Bspw. für Testzwecke kann ein Text im Controller-Menü (unter 'outp') ausgegeben werden. Dies ist vor allem bei der Fehlersuche hilfreich. -- `send Signal Tower command` - Damit kann die Farbe des Signal Towers gesetzt werden. Mögliche Werte sind: `off`, `green`, `amber`, `red`. -- `turn block off/on` - Damit kann ein Block oder Maschine aus- bzw. wieder eingeschaltet werden. -- `Display: overwrite one line` - Damit kann ein Text auf dem Display ausgegeben werden. Die Zeilennummer auf dem Display (1..5) muss dabei angegeben werden. - Soll der Spielername des Spieler Detektors aus der Bedingung ausgegeben werden, ist bei 'text' ein - `*`-Zeichen einzugeben. -- `Display: Clear screen` - Löschen des Bildschirms -- `send chat message` - Damit kann man sich selber eine Chat Nachricht senden. -- `open/close door` - Damit können die Standard-Türen geöffnet und geschlossen werden. Da die Türen keine Nummern haben, müssen die Koordinaten der Türe eingegeben werden. Die Koordination einer Türe können sehr einfach mit dem Schraubenschlüssel /Techage Info Werkzeug bestimmt werden. -- `turn Distributor filter on/off` - Damit können die Filter/Ausgänge eines Verteilers ein- und ausgeschaltet werden. Der entsprechende Ausgang muss über die Farbe angegeben werden. - -### Sonstiges - -Der Controller hat eine eigene Hilfe und Hinweise zu allen Kommandos über das Controller-Menü. - -Einlesen von Maschinendaten sowie das Steuern von Blöcken und Maschinen erfolgt über sogenannte Kommandos. Für das Verständnis, wie Kommandos funktionieren, ist das Kapitel TA3 -> Logik-/Schalt-Blöcke in der In-Game Hilfe (Konstruktionsplan) hilfreich. - -Die Hilfe existiert auch als PDF zum Drucken oder offline Lesen: - -https://github.com/joe7575/techage/blob/master/manuals/ta4_icta_controller_DE.pdf - - - - - diff --git a/techage/manuals/ta4_icta_controller_DE.pdf b/techage/manuals/ta4_icta_controller_DE.pdf deleted file mode 100644 index 18d5f10..0000000 Binary files a/techage/manuals/ta4_icta_controller_DE.pdf and /dev/null differ diff --git a/techage/manuals/ta4_icta_controller_EN.md b/techage/manuals/ta4_icta_controller_EN.md deleted file mode 100644 index 7904489..0000000 --- a/techage/manuals/ta4_icta_controller_EN.md +++ /dev/null @@ -1,108 +0,0 @@ -# TA4 ICTA Controller - -The ICTA controller (ICTA stands for "If Condition Then Action") is used to monitor and control machines. The controller can be used to read in data from machines and other blocks and, depending on this, switch other machines and blocks on / off. - -### 8 Controller Rules - -The controller works on the basis of rules, whereby up to 8 rules can be created per controller. - -Examples of rules are: - -- If a distributor is blocked, the pusher in front of it should be switched off -- If a machine displays the fault state, a lamp should be switched on to indicate the fault -- If a player is close to a player detector, his name should be shown on a display -- If a Minecart is recognized by the cart sensor, the cart should be loaded (pusher switched on) - -All rules should only be executed as often as necessary. This has two advantages: - -- the battery of the controller lasts longer (each controller needs a battery) -- the load for the server is lower (therefore fewer lags) - -### Cyclic execution of rules - -These rules are checked cyclically by the controller. If a condition is met, the action is carried out. As long as the condition is not met, nothing happens. Even if the condition was already met when the rule was last edited and the action was carried out, nothing happens. The condition must first become invalid and then apply again so that the action is executed again. - -How often a rule is checked by the controller can be configured individually for each rule. A cycle time in seconds (`Cycle/s`) must be specified for each rule (1..1000). - -### Event-driven execution of rules - -As an alternative to the cyclically checked rules, there is also the event-controlled execution of rules. - -Events are commands that are sent from other blocks to the controller. Examples are sensors and switches. These send `on` / `off` commands. For example, if the switch is switched on, it sends an `on` command, if it is switched off, it sends an `off` command to the block with the number that was configured for the switch. - -For rules that are to be executed in an event-controlled manner, cycle time 0 must be specified. - -### Delay Time - -You have to set a delay time (`after/s`) for each action. If the action is to be carried out immediately, 0 must be entered. - -#### Terms / Conditions - -One of the following conditions can be configured for each rule. However, only one condition can be configured per rule. - -- `initial` - This condition is always met after the controller is switched on and is used, for example, to switch off a lamp so that it can then be switched on again if an error occurs. - -- `true` - This condition is always fulfilled and is used, for example, to make a lamp flash. Two rules are required for this. For example, if both rules have a cycle time of 2 s, but the first rule has a delay time of 0 s and the second rule has a delay time of 1 s, then a lamp can be cyclically switched on and off again. - -- `condition` - Depending on another rule, an action can be started here. To do this, the number of the other rule (1..8) must be specified. This means that 2 actions can be carried out with one `condition`. With the additional configurable condition, `was not true` was used to switch off a lamp, for example, when the condition is no longer met. - -- `inputs` - This enables the received value `on` / `off` of a command (event) to be evaluated. Please note here: For rules that are to be executed event-controlled, cycle time 0 must be specified. - -- `read block state` - This allows the status of a machine to be queried. The machine number (block number) must be entered. Possible machine states are: - - - `running` -> machine is working - - `stopped` -> machine is switched off - - `standby` -> machine has nothing to do, for example because the inventory is empty - - `blocked` -> machine cannot do anything, e.g. the initial inventory is full - - `fault` -> machine has a fault. The machine menu may provide further information - - `unloaded` -> Machines at a greater distance may have been unloaded from the server without a forceload block. Then these are not active. - - If a configured condition is fulfilled, e.g. `block number 456 is stopped`, the action is carried out. - - **Info:** A **block number** is a unique number that is generated by Techage when many Techage blocks are placed and is displayed as information text behind the block name. The block number is used for addressing during communication between Techage controllers and machines. - - The easiest way to determine which machines provide which status information is with the wrench / Techage Info tool directly on the machine. - -- `read amount of fuel` - This can be used to read out how much fuel a machine still has (typically 0-99 units) and to compare it with a value of 'larger' or 'smaller'. If the configured condition is met, the action is carried out. - `read power / liquid load` - This means that the charge of a battery or the heat storage device can be queried in percent (values ​​from 0..100) and checked for 'larger' / 'smaller' with the configured condition. If the condition is met, the action is carried out. - -- `read delivered power` - This can be used to query the amount of electricity that a generator (in ku) is delivering. The value can be checked with the configured condition for 'larger' / 'smaller'. If the condition is met, the action is carried out. Since batteries not only emit electricity but also absorb, this value is negative when the battery is charged. - -- `read chest state` - This enables the status of a TA3/TA4 chest to be queried and evaluated. Chests provide the states: - - - `empty` - the chest is empty - - `loaded` - the chest partially filled - - `full` - All stacks in the chest are at least partially occupied - - If the condition is met, the action is carried out. - -- `read Signal Tower state` - This allows the color of a Signal Tower to be queried and checked. Signal towers deliver the values ​​`off`, `green`, `amber`, `red`. If the condition is met, the action is carried out. - -- `read Player Detector` - This can be used to query a player detector. The detector provides the player's name near the detector. If not only a specific but every player's name is to be shown on a display, enter '*' in 'player name (s). - You can also enter multiple names separated by spaces. If the action is to be carried out when there is no player nearby, enter `-`. - -### Actions - -For all actions that control a block (such as a lamp), the number of the block must be specified in the action. Only one action can be configured per rule. - -- `print to output window` - e.g. a text can be output in the controller menu (under 'outp') for test purposes. This is especially helpful when troubleshooting. -- `send Signal Tower command` - This allows the color of the Signal Tower to be set. Possible values ​​are: `off`,` green`, `amber`,` red`. -- `turn block off / on` - This enables a block or machine to be switched on or off again. -- `Display: overwrite one line` - This allows text to be output on the display. The line number on the display (1..5) must be specified. - If the player name of the player detector is to be output from the condition, then 'text' is on - Enter the `*` character. -- `Display: Clear screen` - clear the screen -- `send chat message` - This allows you to send yourself a chat message. -- `open / close door` - This allows the standard doors to be opened and closed. Since the doors have no numbers, the coordinates of the door must be entered. The coordination of a door can be easily determined with the wrench / Techage Info tool. -- `Turn distributor filter on / off` - This enables the filter / outputs of a distributor to be switched on and off. The corresponding output must be specified via the color. - -### Miscellaneous - -The controller has its own help and information on all commands via the controller menu. - -Machine data is read in and blocks and machines are controlled using commands. To understand how commands work, the chapter TA3 -> Logic / switching blocks in the in-game help (construction plan) is helpful. - - - - - diff --git a/techage/manuals/ta4_lua_controller_EN.md b/techage/manuals/ta4_lua_controller_EN.md deleted file mode 100644 index 5b1b625..0000000 --- a/techage/manuals/ta4_lua_controller_EN.md +++ /dev/null @@ -1,760 +0,0 @@ -# TA4 Lua Controller - -![Lua Controller](https://github.com/joe7575/techage/blob/master/textures/techage_lua_controller_inventory.png) - -The TA4 Lua Controller is a small computer, programmable in Lua to control your machinery. -In contrast to the ICTA Controller this controller allows to implement larger and more complex programs. - -But to write Lua scripts, some knowledge with the programming language Lua is required. - -Minetest uses Lua 5.1. The reference document for Lua 5.1 is [here](https://www.lua.org/manual/5.1/). The book [Programming in Lua (first edition)](https://www.lua.org/pil/contents.html) is also a perfect source for learning Lua. - -This TA4 Lua Controller manual is also available as PDF: - -https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.pdf - - - -## Table of Contents - -- [TA4 Lua Controller](#ta4-lua-controller) - - [Table of Contents](#table-of-contents) - - [TA4 Lua Controller Blocks](#ta4-lua-controller-blocks) - - [TA4 Lua Controller](#ta4-lua-controller-1) - - [Battery](#battery) - - [TA4 Lua Server](#ta4-lua-server) - - [TA4 Lua Controller Terminal](#ta4-lua-controller-terminal) - - [TA4 Sensor Chest](#ta4-sensor-chest) - - [Lua Functions and Environment](#lua-functions-and-environment) - - [Lua Functions and Limitations](#lua-functions-and-limitations) - - [Arrays, Stores, and Sets](#arrays-stores-and-sets) - - [Arrays](#arrays) - - [Stores](#stores) - - [Sets](#sets) - - [Initialization, Cyclic Task, and Events](#initialization-cyclic-task-and-events) - - [Initialization](#initialization) - - [Cyclic Task](#cyclic-task) - - [Events](#events) - - [Lua Controller Functions](#lua-controller-functions) - - [Controller local Functions](#controller-local-functions) - - [Input Example](#input-example) - - [Techage Command Functions](#techage-command-functions) - - [Server and Terminal Functions](#server-and-terminal-functions) - - [Communication between Lua Controllers](#communication-between-lua-controllers) - - [Further Functions](#further-functions) - - [Example Scripts](#example-scripts) - - [Simple Counter](#simple-counter) - - [Hello World](#hello-world) - - [For Loop with range(from, to)](#for-loop-with-rangefrom-to) - - [Monitoring Chest \& Furnace](#monitoring-chest--furnace) - - [Simple Calculator](#simple-calculator) - - [Welcome Display](#welcome-display) - - [Sensor Chest](#sensor-chest) - - [Read the "TA4 4x Button"](#read-the-ta4-4x-button) - - [Emails](#emails) - - - -## TA4 Lua Controller Blocks - -### TA4 Lua Controller - -The controller block has a menu form with the following tabs: - -- the `init` tab for the initialization code block -- the `func` tab for the Lua functions -- the `loop` tab for the main code block -- the `outp` tab for debugging outputs via `$print()` -- the `notes` tab for your code snippets or other notes (like a clipboard) -- the `help` tab with information to the available functions - -The controller needs power to work. A battery pack has to be placed nearby. - -### Battery - -The battery pack has to be placed near the controller (1 block distance). -The needed battery power is directly dependent on the CPU time the controller consumes. -Because of that, it is important to optimize the execution time of the code (which helps the admin to keep server lags down :)) - -The controller will be restarted (init() is called) every time the Minetest server starts again. -To store data non-volatile (to pass a server restart), the "TA4 Lua Server" block has to be used. - -### TA4 Lua Server - -The Server block is used to store data from Lua Controllers nonvolatile. It can also be used for communication purposes between several Lua Controllers. -Only configured players have access to the server. Therefore, the server has a menu to enter player names. - -For special Server functions, see "Server and Terminal Functions" - -### TA4 Lua Controller Terminal - -The Terminal is used to send command strings to the controller. -In turn, the controller can send text strings to the terminal. -The Terminal has a help system for internal commands. Its supports the following commands: - -- `clear` = clear the screen -- `help` = output this message -- `pub` = switch terminal to public use (everybody can enter commands) -- `priv` = switch terminal to private use (only the owner can enter commands) -- `send on/off` = send on/off event to e. g. lamps (for testing purposes) -- `msg ` = send a text message to another Controller (for testing purposes) - -For special Terminal functions for the TA4 Lua Controller, see "Server and Terminal Functions" - -### TA4 Sensor Chest - -tbd. - -## Lua Functions and Environment - -### Lua Functions and Limitations - -The controller uses a subset of the language Lua, called SaferLua. It allows the safe and secure execution of Lua scripts, but has the following limitations: - -- limited code length -- limited execution time -- limited memory use -- limited possibilities to call functions - -SaferLua follows the standard Lua syntax with the following restrictions: - -- no `while` or `repeat` loops (to prevent endless loops) -- no table constructor {..}, see "Arrays, Stores, and Sets" for comfortable alternatives -- limited runtime environment - -SaferLua directly supports the following standard functions: - -- math.floor -- math.abs -- math.max -- math.min -- math.random -- tonumber -- tostring -- unpack -- type -- string.byte -- string.char -- string.find -- string.format -- string.gmatch -- string.gsub -- string.len -- string.lower -- string.match -- string.rep -- string.sub -- string.upper -- string.split (result is an Array) -- string.split2 (result are multiple returns like the Lua function unpack) -- string.trim - -For own function definitions, the menu tab 'func' can be used. Here you write your functions like: - -```lua -function foo(a, b) - return a + b -end -``` - -Each SaferLua program has access to the following system variables: - -- ticks - a counter which increments by one each call of `loop()` -- elapsed - the amount of seconds since the last call of `loop()` -- event - a boolean flag (true/false) to signal the execution of `loop()` based on an occurred event - -### Arrays, Stores, and Sets - -It is not possible to easily control the memory usage of a Lua table at runtime. Therefore, Lua tables can't be used for SaferLua programs. Because of this, there are the following alternatives, which are secure shells over the Lua table type: - -#### Arrays - -_Arrays_ are lists of elements, which can be addressed by means of an index. An index must be an integer number. The first element in an _array_ has the index value 1. _Arrays_ have the following methods: - -- add(value) - add a new element at the end of the array -- set(idx, value) - overwrite an existing array element on index `idx` -- get(idx) - return the value of the array element on index `idx` -- remove(idx) - remove the array element on index `idx` -- insert(idx, val) - insert a new element at index `idx` (the array becomes one element longer) -- size() - return the number of _array_ elements -- memsize() - return the needed _array_ memory space -- next() - `for` loop iterator function, returning `idx,val` -- sort(reverse) - sort the _array_ elements in place. If _reverse_ is `true`, sort in descending order. - - -Example: - -```lua -a = Array(1,2,3,4) --> {1,2,3,4} -a.add(6) --> {1,2,3,4,6} -a.set(2, 8) --> {1,8,3,4,6} -a.get(2) --> function returns 8 -a.insert(5,7) --> {1,8,3,4,7,6} -a.remove(3) --> {1,8,4,7,6} -a.insert(1, "hello") --> {"hello",1,8,4,7,6} -a.size() --> function returns 6 -a.memsize() --> function returns 10 -for idx,val in a.next() do - ... -end -``` - -#### Stores - -Unlike _arrays_, which are indexed by a range of numbers, _stores_ are indexed by keys, which can be a string or a number. The main operations on a _store_ are storing a value with some key and extracting the value given the key. -The _store_ has the following methods: - -- set(key, val) - store/overwrite the value `val` behind the keyword `key` -- get(key) - read the value behind `key` -- del(key) - delete a value -- size() - return the number of _store_ elements -- memsize() - return the needed _store_ memory space -- next() - `for` loop iterator function, returning `key,val` -- keys(order) - return an _array_ with the keys. If _order_ is `"up"` or `"down"`, return the keys as sorted _array_, in order of the _store_ values. - -Example: - -```lua -s = Store("a", 4, "b", 5) --> {a = 4, b = 5} -s.set("val", 12) --> {a = 4, b = 5, val = 12} -s.get("val") --> returns 12 -s.set(0, "hello") --> {a = 4, b = 5, val = 12, [0] = "hello"} -s.del("val") --> {a = 4, b = 5, [0] = "hello"} -s.size() --> function returns 3 -s.memsize() --> function returns 9 -for key,val in s.next() do - ... -end -``` - -Keys sort example: - -```lua -s = Store() --> {} -s.set("Joe", 800) --> {Joe=800} -s.set("Susi", 1000) --> {Joe=800, Susi=1000} -s.set("Tom", 60) --> {Joe=800, Susi=1000, Tom=60} -s.keys() --> {Joe, Susi, Tom} -s.keys("down") --> {Susi, Joe, Tom} -s.keys("up") --> {Tom, Joe, Susi} -``` - -#### Sets - -A _set_ is an unordered collection with no duplicate elements. The basic use of a _set_ is to test if an element is in the _set_, e.g. if a player name is stored in the _set_. -The _set_ has the following methods: - -- add(val) - add a value to the _set_ -- del(val) - delete a value from the _set_ -- has(val) - test if value is stored in the _set_ -- size() - return the number of _set_ elements -- memsize() - return the needed _set_ memory space -- next() - `for` loop iterator function, returning `idx,val` - -Example: - -```lua -s = Set("Tom", "Lucy") --> {Tom = true, Lucy = true} -s.add("Susi") --> {Tom = true, Lucy = true, Susi = true} -s.del("Tom") --> {Lucy = true, Susi = true} -s.has("Susi") --> function returns `true` -s.has("Mike") --> function returns `false` -s.size() --> function returns 2 -s.memsize() --> function returns 8 -for idx,val in s.next() do - ... -end -``` - -All three types of data structures allow nested elements, e.g. you can store a _set_ in a _store_ or an _array_ and so on. But note that the overall size over all data structures can't exceed the predefined limit. This value is configurable for the server admin. The default value is 1000. -The configured limit can be determined via `memsize()`: - -```lua -memsize() --> function returns 1000 (example) -``` - -### Initialization, Cyclic Task, and Events - -The TA4 Lua Controller distinguishes between the initialization phase (just after the controller was started) and the continuous operational phase, in which the normal code is executed. - -#### Initialization - -During the initialization phase the function `init()` is executed once. The `init()` function is typically used to initialize variables, clean the display, or reset other blocks: - -```lua --- initialize variables -counter = 1 -table = Store() -player_name = "unknown" - -# reset blocks -$clear_screen("123") -- "123" is the number-string of the display -$send_cmnd("2345", "off") -- turn off the blocks with the number "2345" -``` - - -#### Cyclic Task - -During the continuous operational phase the `loop()` function is cyclically called. -Code witch should be executed cyclically has to be placed here. -The cycle frequency is per default once per second but can be changed via: - -```lua -$loopcycle(0) -- no loop cyle any more -$loopcycle(1) -- call the loop function every second -$loopcycle(10) -- call the loop function every 10 seconds -``` - -The provided number must be an integer value. -The cycle frequency can be changed in the `init()` function, but also in the `loop()` function. - -#### Events - -To be able to react directly on received commands, the TA4 Lua Controller supports events. -Events are usually turned off, but can be activated with the function `events()`: - -```lua -$events(true) -- enable events -$events(false) -- disable events -``` - -If an event occurs (a command was received from another block), the `loop()` is executed (in addition to the normal loop cycle). In this case the system variable 'event' is set: - -```lua -if event then - -- event has occurred - if $get_input("3456") == "on" then -- check input from block "3456" - -- do some action... - end -end -``` - -The first occurred event will directly be processed, further events may be delayed. The TA4 Lua Controller allows a maximum of one event every 100 ms. - - -## Lua Controller Functions - -In addition to Lua standard function the Lua Controller provides the following functions: - -### Controller local Functions - -- `$print(text)` - Output a text string on the 'outp' tab of the controller menu. - E.g.: `$print("Hello "..name)` -- `$loopcycle(seconds)` - This function allows to change the call frequency of the controller loop() function, witch is per default one second. For more info, see "Cyclic Task" -- `$events(bool)` - Enable/disable event handling. For more info, see "Events" -- `$get_ms_time()` - Returns the time with millisecond precision -- `$get_gametime()` - Returns the time, in seconds, since the world was created -- `$time_as_str()` - Read the time of day (ingame) as text string in 24h format, like "18:45" -- `$time_as_num()` - Read the time of day (ingame) as integer number in 24h format, like 1845 -- `$get_input(num)` - Read an input value provided by an external block with the given number _num_. The block has to be configured with the number of the controller to be able to send status messages (on/off commands) to the controller. _num_ is the number (data type string) of the remote block, like "1234". - -#### Input Example -- A Player Detector with number "456" is configured to send on/off commands to the TA4 Lua Controller with number "345". -- The TA4 Lua Controller will receive these commands as input value. -- The program on the SaferLua Controller can always read the last input value from the Player Detector with number "456" by means of: - -`sts = $get_input("456")` - - -### Techage Command Functions - -With the `$send_cmnd(num, ident, add_data)` function, you can send commands to and retrieve data from another block with the given number _num_. -The possible commands can be classified in two groups: Commands for reading data and commands for triggering an action. -Please note, that this is not a technical distinction, only a logical. - -**Reading data** - -- _ident_ specifies the data to be read. -- _add_data_ is for additional data and normally not needed. -- The result is block dependent (see table below) - - -| ident | returned data | comment | -| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| "state" | one of: "running", "stopped", "blocked", "standby", "fault", or "unloaded" | Techage machine state, used by many machines | -| "state" | one of: "red", "amber", "green", "off" | Signal Tower state | -| "state" | one of: "empty", "loaded", "full" | State of a chest or Sensor Chest | -| "state" | one of: "on", "off" | State of a TA4 Button | -| "fuel" | number | fuel value of a fuel consuming block | -| "depth" | number | Read the current depth value of a quarry block (1..80) | -| "load" | number | Read the load value in percent (0..100) of a accu, or battery block. | -| "load" | number | Read the load value in percent (0..100) of a tank or silo.
Silo and tank return two values:
The percentage value and the absolute value in units.
Example: percent, absolute = $send_cmnd("223", "load") | -| "load" | number | Read the grid storage amount (state of charge) in percent (0..100) from a TA3 Power Terminal. | -| "delivered" | number | Read the current delivered power value of a generator block. A power consuming block (accu) provides a negative value | -| "flowrate" | Total flow rate in liquid units | Only for TA4 Pumps | -| "action" | player-name, action-string | Only for Sensor Chests | -| "stacks" | Array with up to 4 Stores with the inventory content (see example) | Only for Sensor Chests | -| "count" | number | Read the item counter of the TA4 Item Detector block | -| "count" | number of items | Read the total amount of TA4 chest items. An optional number as `add_data` is used to address only one inventory slot (1..8, from left to right). | -| "count" | number of items | Read the number of pushed items for a TA4 Pusher in "flow limiter" mode | -| "count" | number of units | Read the number of pumped liquid units for a TA4 Pump in "flow limiter" mode | -| "itemstring" | item string of the given slot | Specific command for the TA4 8x2000 Chest to read the item type (technical name) of one chest slot, specified via `add_data` (1..8).
Example: s = $send_cmnd("223", "itemstring", 1) | -| "output" | recipe output string,
e.g.: "default:glass" | Only for the Industrial Furnace. If no recipe is active, the command returns "unknown" | -| "input" | \ | Read a recipe from the TA4 Recipe Block. `` is the number of the recipe. The block return a list of recipe items. | -| "name" | \ | Player name of the TA3/TA4 Player Detector or TA4 Button | -| "time" | number | Time in system ticks (norm. 100 ms) when the TA4 Button is clicked | -| "consumption" | number | TA4 Electric Meter: Amount of electrical energy passed through | -| "countdown" | number | TA4 Electric Meter: Countdown value for the amount of electrical energy passed through | -| "current" | number | TA4 Electric Meter: Current flow of electricity (current) | - - - -**Trigger an action** - -- _num_ is the number of the remote block, like "1234" -- _cmnd_ is the command -- _data_ is additional data (see table below) - -| cmnd | data | comment | -| -------------------------------- | ------------ | ------------------------------------------------------------ | -| "on", "off" | nil | turn a node on/off (machine, lamp,...) | -| "red, "amber", "green", "off" | nil | set Signal Tower color | -| "red, "amber", "green", "off" | lamp number (1..4) | Set the signal lamp color. Valid for "TA4 2x Signal Lamp" and "TA4 4x Signal Lamp" | -| "port" | string
`=on/off` | Enable/disable a Distributor filter slot..
Example: `"yellow=on"`
colors: red, green, blue, yellow | -| "config" | "\ \" | Configure a Distributor filter slot, like: "red default:dirt dye:blue" | -| "text" | text string | Text to be used for the Sensor Chest menu | -| "reset" | nil | Reset item and countdown counters of the TA4 Item Detector block | -| "countdown" | number | Set countdown counter of the TA4 Item Detector block to the given value and
start countdown mode. | -| "limit" | number | Configure a TA4 Pusher with the number of items that are allowed to be pushed ("flow limiter" mode)
limit = 0 turns off the "flow limiter" mode | -| "limit" | number | Configure a TA4 Pump with the number of liquid units that are allowed to be pumped ("flow limiter" mode)
limit = 0 turns off the "flow limiter" mode | -| "config" | item string | Configure the TA4 pusher.
Example: `wool:blue` | -| "exchange" | inventory slot number | TA3 Door Controller II (techage:ta3_doorcontroller2)
Exchange a block
*idx* is the inventory slot number (1..n) of/for the block to be exchanged | -| "set" | inventory slot number | TA3 Door Controller II (techage:ta3_doorcontroller2)
Set/add a block
*idx* is the inventory slot number (1..n) with the block to be set | -| "dig" | inventory slot number | TA3 Door Controller II (techage:ta3_doorcontroller2)
Dig/remove a block
*idx* is the empty inventory slot number (1..n) for the block | -| "a2b" | nil | TA4 Move Controller command to move the block(s) from position A to B | -| "b2a" | nil | TA4 Move Controller command to move the block(s) from position B to A | -| "move" | nil | TA4 Move Controller command to move the block(s) to the opposite position | -| "move2" | x,y,z | TA4 Move Controller command to move the block(s) by the given
x/y/z-distance. Valid ranges for x, y, and z are -100 to 100.
Example: `$send_cmnd("1674", "move2", "0,4,0")` | -| "reset" | nil | Reset TA4 Move Controller (move block(s) to start position) | -| "left" | nil | TA4 Turn Controller command to turn the block(s) to the left | -| "right" | nil | TA4 Turn Controller command to turn the block(s) to the right | -| "uturn" | nil | TA4 Turn Controller command to turn the block(s) 180 degrees | -| "recipe" | `,,...` | Set the TA4 Autocrafter recipe.
Example for the torch recipe: `default:coal_lump,,,default:stick`
Hint: Empty fields may only be left out at the end of the item list! | -| "recipe" | `.` | Set the TA4 Autocrafter recipe with a recipe from a TA4 Recipe Block.
`` is the TA4 Recipe Block number
`` is the number of the recipe in the TA4 Recipe Block | -| "goto" | `` | Start command for the TA4 Sequencer. `` is the time slot like `[1]` where the execution starts. | -| "stop" | nil | Stop command for the TA4 Sequencer. | -| "gain" | volume | Set volume of the sound block (`volume` is a value between 0 and 1.0) | -| "sound" | index | Select sound sample of the sound block | -| "color" | \ | Set the color of the TechAge Color Lamp and TechAge Color Lamp 2 (color = 0..255) | - -### Server and Terminal Functions - -The Server is used to store data permanently/non-volatile. It can also be used to share data between several Controllers. -- `$server_write(num, key, value)` - Store a value on the server under the key _key_. _key_ must be a string. _value_ can be either a number, string, boolean, nil or data structure. - **This function does not allow nested data structures**. - _num_ is the number of the Server. - Example: `$server_write("0123", "state", state)` -- `$server_read(num, key)` - Read a value from the server. _key_ must be a string. _num_ is the number of the Server, like "1234". - -The Terminal can send text strings as events to the Controller. -In contrast the Controller can send text strings to the terminal. - -- `$get_term()` - Read a text command received from the Terminal -- `$put_term(num, text)` - Send a text string to the Terminal. _num_ is the number of the Terminal. - -### Communication between Lua Controllers - -Messages are used to transport data between Controllers. Messages can contain arbitrary data. Incoming messages are stored in order (up to 10) and can be read one after the other. - -* `$get_msg([raw])` - Read a received message. The function returns the sender number as string and the message. (see example "Emails"). If the _raw_ parameter is not set or false, the message is guaranteed to be a string. -* `$send_msg(num, msg)` - Send a message to another Controller. _num_ is the destination number as string. (see example "Emails") - -### Further Functions - -* `$chat(text)` - Send yourself a chat message. _text_ is a text string. -* `$door(pos, text)` - Open/Close a door at position "pos". - Example: `$door("123,7,-1200", "close")`. - Hint: Use the Techage Info Tool to determine the door position. -* `$item_description("default:apple")` - Get the description (item name) for a specified itemstring, e. g. determined via the TA4 8x2000 Chest command `itemstring`: - `str = $send_cmnd("223", "itemstring", 1)` - `descr = $item_description(str)` - -* `$display(num, row, text)` Send a text string to the display with number _num_. _row_ is the display row, a value from 1 to 5, or 0 to add the text string at the bottom (scroll screen mode). _text_ is the string to be displayed. If the first char of the string is a blank, the text will be horizontally centered. -* `$clear_screen(num)` Clear the screen of the display with number _num_. -* `$position(num)` Returns the position as string "'(x,y,z)" of the device with the given _num_. - -## Example Scripts - -### Simple Counter - -Very simple example with output on the Controller menu. - -init() code: - -```lua -a = 1 -``` - -loop() code: - -```lua -a = a + 1 -$print("a = "..a) -``` - - - -### Hello World - -"Hello world" example with output on the Display. - -init() code: - -```lua -a = Array("Hello", "world", "of", "Minetest") - -$clear_screen("0669") - -for i,text in a.next() do - $display("0669", i, text) -end -``` - - - -### For Loop with range(from, to) - -Second "Hello world" example with output on the Display, -implemented by means of a for/range loop. - -init() code: - -```lua -a = Array("Hello", "world", "of", "Minetest") - -$clear_screen("0669") - -for i in range(1, 4) do - text = a.get(i) - $display("0669", i, text) -end -``` - - - -### Monitoring Chest & Furnace - -More realistic example to read Pusher states and output them on a display: - -init() code: - -```lua -DISPLAY = "1234" -- adapt this to your display number -min = 0 -``` - -loop() code: - -```lua --- call code every 60 sec -if ticks % 60 == 0 then - -- output time in minutes - min = min + 1 - $display(DISPLAY, 1, min.." min") - - -- Cactus chest overrun - sts = $send_cmnd("1034", "state") -- read pusher status - if sts == "blocked" then $display(DISPLAY, 2, "Cactus full") end - - -- Tree chest overrun - sts = $send_cmnd("1065", "state") -- read pusher status - if sts == "blocked" then $display(DISPLAY, 3, "Tree full") end - - -- Furnace fuel empty - sts = $send_cmnd("1544", "state") -- read pusher status - if sts == "standby" then $display(DISPLAY, 4, "Furnace fuel") end -end -``` - - - - -### Simple Calculator - -A simple calculator (adds entered numbers) by means of a Lua Controller and a Terminal. - -init() code: - -```lua -$events(true) -$loopcycle(0) - -TERM = "360" -- terminal number, to be adapted! -sum = 0 -$put_term(TERM, "sum = "..sum) -``` - -loop() code: - -```lua -s = $get_term() -- read text from terminal -if s then - val = tonumber(s) or 0 -- convert to number - sum = sum + val - text = string.format("+%d = %d", val, sum) -- format output string - $put_term(TERM, text) -- output to terminal -end -``` - - - -### Welcome Display - -In addition to the controller, you also need a player detector and a display. -When the Player Detector detects a player the player name is shown on the display: - -init() code: - -```lua -$events(true) -$loopcycle(0) - -SENSOR = "365" -- player detector number, to be adapted! -DISPLAY = "367" -- display number, to be adapted! - -$clear_screen(DISPLAY) -``` - -loop() code: - -```lua -if event then - name = $send_cmnd(SENSOR, "name") - if name == "" then -- no player arround - $clear_screen(DISPLAY) - else - $display(DISPLAY, 2, " Welcome") - $display(DISPLAY, 3, " "..name) - end -end -``` - - - -### Sensor Chest - -The following example shows the functions/commands to be used with the Sensor Chest: - -init() code: - -```lua -$events(true) -$loopcycle(0) - -SENSOR = "372" -- sensor chest number, to be adapted! - -$send_cmnd(SENSOR, "text", "press both buttons and\nput something into the chest") -``` - -loop() code: - -```lua -if event and $get_input(SENSOR) == "on" then - -- read inventory state - state = $send_cmnd(SENSOR, "state") - $print("state: "..state) - -- read player name and action - name, action = $send_cmnd(SENSOR, "action") - $print("action"..": "..name.." "..action) - -- read inventory content - stacks = $send_cmnd(SENSOR, "stacks") - for i,stack in stacks.next() do - $print("stack: "..stack.get("name").." "..stack.get("count")) - end - $print("") -end -``` - - - -### Read the "TA4 4x Button" - -For the `$get_input(...)` function, the Lua controller expects received `on`/`off` commands. However, the "TA4 4x Button" is not able to send an `on` command followed by an `off` command. To be able to receive commands from "TA4 4x Button", the `$get_msg()` function has to be used. - -Therefore, the "TA4 4x Button" (Type set to "button") has to be programmed with commands like: `msg 1`, `msg 2`, `msg 3`, `msg 4`. - -The following example demonstrates receiving "TA4 4x Button" commands: - -init() code: - -```lua -$events(true) -$loopcycle(0) - -BUTTON = "372" -- "TA4 4x Button" number, to be adapted! -``` - -loop() code: - -```lua -if event then - num,text = $get_msg() - if num == BUTTON then - $print("button: " .. text) - end -end -``` - -If the buttons are pressed, the "outp" window of the Lua controller will look like: - -``` -button: 1 -button: 4 -button: 3 -button: 2 -``` - - - -### Emails - -For an email system you need a TA4 Lua Server and a TA4 Lua Controller with Terminal per player. -The TA4 Lua Server serves as database for player name/block number resolution. - -* Each Player needs its own Terminal and Controller. The Terminal has to be connected with the Controller -* Each Controller runs the same Lua Script, only the numbers and the owner names are different -* To send a message, enter the receiver name and the text message like `Tom: hello` into the Terminal -* The Lua script will determine the destination number and send the message to the destination Controller -* All players who should be able to take part in the email system have to be entered into the Server form - -init() code: - -```lua -$loopcycle(0) -$events(true) - --- Start: update to your conditions -TERM = "360" -CONTROLLER = "359" -NAME = "Tom" -SERVER = "363" --- End: update to your conditions - -$print($server_write(SERVER, NAME, CONTROLLER)) -$print($server_write(SERVER, CONTROLLER, NAME)) -``` - -loop() code: - -```lua --- read from Terminal and send the message -s = $get_term() -if s then - name,text = string.split2(s, ":", false, 1) - num = $server_read(SERVER, name) - if num then - $send_msg(num, text) - $put_term(TERM, "message sent") - end -end - --- read message and output to terminal -num,text = $get_msg() -if num then - name = $server_read(SERVER, num) - if name then - $put_term(TERM, name..": "..text) - end -end -``` diff --git a/techage/manuals/ta4_lua_controller_EN.pdf b/techage/manuals/ta4_lua_controller_EN.pdf deleted file mode 100644 index 33a11a0..0000000 Binary files a/techage/manuals/ta4_lua_controller_EN.pdf and /dev/null differ diff --git a/techage/manuals/ta_kvstore.md b/techage/manuals/ta_kvstore.md deleted file mode 100644 index bfdbca8..0000000 --- a/techage/manuals/ta_kvstore.md +++ /dev/null @@ -1,78 +0,0 @@ -# Techage/Beduino Key/Value Store - -The key/value store simplifies the handling/comparison of strings. - -The following example shows the use of the Key/Value Store, here to check the names from the Player Detector: - -```c -import "lib/ta_kvstore.c" -import "lib/ta_iom.c" - -var s[16]; - -func init() { - // Init and fill-up the k/v store - ta_kv_init(); - ta_kv_add("singleplayer", 1); - ta_kv_add("Tom", 2); - ta_kv_add("Betty", 3); - ta_kv_add("Joe", 4); -} - -func loop() { - var val; - - if(event()) { // Signal from player detector received - request_data(5, 144, "", s); // Request player name from player detector - val = ta_kv_get(s); // Read value for the given name in 's' - if(val == 1) { - // do A... - } else if(val == 2) { - // do B... - } else if(val == 3) { - // do C... - } - } -} -``` - - - -Each controller has a key/value store that must be initialized via `ta_kv_init()` and filled via `ta_kv_add` before it can be used. - -### ta_kv_init - -Initializes the key/value store. Has to be called once at the beginning. - -```c -ta_kv_init() -``` - - - -### ta_kv_add - -Add a new key/value pair to the store. - -- *key_str* is the string -- *value* is the value to be stored, which can be read again using the key string - -```c - ta_kv_add(key_str, value) -``` - - - -### ta_kv_get - -Read a value from thre store. - -- *key_str* is the string - -The function returns 0, if *key_str* is unknown. - -```c -ta_kv_get(key_str) -``` - - diff --git a/techage/manuals/toc_DE.md b/techage/manuals/toc_DE.md deleted file mode 100644 index 93cc625..0000000 --- a/techage/manuals/toc_DE.md +++ /dev/null @@ -1,260 +0,0 @@ -# Inhaltsverzeichnis - -- [Tech Age Mod](./manual_DE.md#tech-age-mod) - - [Hinweise](./manual_DE.md#hinweise) - - [Änderungen ab Version 1.0](./manual_DE.md#änderungen-ab-version-1.0) - - [Tipps zur Umstellung](./manual_DE.md#tipps-zur-umstellung) - - [Erze und Mineralien](./manual_DE.md#erze-und-mineralien) - - [Meridium](./manual_DE.md#meridium) - - [Usmium](./manual_DE.md#usmium) - - [Baborium](./manual_DE.md#baborium) - - [Erdöl](./manual_DE.md#erdöl) - - [Bauxit](./manual_DE.md#bauxit) - - [Basalt](./manual_DE.md#basalt) -- [TA1: Eisenzeitalter](./manual_ta1_DE.md#ta1:-eisenzeitalter) - - [Köhler / Coal Pile](./manual_ta1_DE.md#köhler--coal-pile) - - [Kohlebrenner / Coal Burner](./manual_ta1_DE.md#kohlebrenner--coal-burner) - - [Wassermühle](./manual_ta1_DE.md#wassermühle) - - [TA1 Mühle](./manual_ta1_DE.md#ta1-mühle) - - [TA1 Schleusenschieber / TA1 Sluice Gate](./manual_ta1_DE.md#ta1-schleusenschieber--ta1-sluice-gate) - - [TA1 Schleusengriff / TA1 Sluice Handle](./manual_ta1_DE.md#ta1-schleusengriff--ta1-sluice-handle) - - [TA1 Apfelholzbrett / TA1 Apple Wood Board](./manual_ta1_DE.md#ta1-apfelholzbrett--ta1-apple-wood-board) - - [TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board](./manual_ta1_DE.md#ta1-apfel-mühlbachbrett--ta1-apple-millrace-board) - - [Erze und Werkzeuge](./manual_ta1_DE.md#erze-und-werkzeuge) - - [Hammer](./manual_ta1_DE.md#hammer) - - [Kiessieb / Gravel Sieve](./manual_ta1_DE.md#kiessieb--gravel-sieve) - - [Trichter / Hopper](./manual_ta1_DE.md#trichter--hopper) - - [Kies sieben mit dem Trichter](./manual_ta1_DE.md#kies-sieben-mit-dem-trichter) - - [Meridium](./manual_ta1_DE.md#meridium) -- [TA2: Dampfzeitalter](./manual_ta2_DE.md#ta2:-dampfzeitalter) - - [Dampfmaschine](./manual_ta2_DE.md#dampfmaschine) - - [TA2 Feuerbox / Firebox](./manual_ta2_DE.md#ta2-feuerbox--firebox) - - [TA2 Boiler](./manual_ta2_DE.md#ta2-boiler) - - [TA2 Zylinder /Cylinder](./manual_ta2_DE.md#ta2-zylinder-cylinder) - - [TA2 Schwungrad / Flywheel](./manual_ta2_DE.md#ta2-schwungrad--flywheel) - - [TA2 Dampfleitungen / Steam Pipe](./manual_ta2_DE.md#ta2-dampfleitungen--steam-pipe) - - [TA2 Antriebsachsen / TA2 Drive Axle](./manual_ta2_DE.md#ta2-antriebsachsen--ta2-drive-axle) - - [TA2 Stromgenerator / TA2 Power Generator](./manual_ta2_DE.md#ta2-stromgenerator--ta2-power-generator) - - [TA2 Energiespeicher](./manual_ta2_DE.md#ta2-energiespeicher) - - [TA2 Seilwinde / TA2 Winch](./manual_ta2_DE.md#ta2-seilwinde---ta2-winch) - - [TA2 Gewichtekiste / TA2 Weight Chest](./manual_ta2_DE.md#ta2-gewichtekiste--ta2-weight-chest) - - [Items schieben und sortieren](./manual_ta2_DE.md#items-schieben-und-sortieren) - - [Röhren / TechAge Tube](./manual_ta2_DE.md#röhren--techage-tube) - - [Röhren Konzentrator / Tube Concentrator](./manual_ta2_DE.md#röhren-konzentrator--tube-concentrator) - - [TA2 Schieber / Pusher](./manual_ta2_DE.md#ta2-schieber--pusher) - - [TA2 Verteiler / Distributor](./manual_ta2_DE.md#ta2-verteiler--distributor) - - [Kieswaschanlage](./manual_ta2_DE.md#kieswaschanlage) - - [TA2 Kiesspüler / Gravel Rinser](./manual_ta2_DE.md#ta2-kiesspüler--gravel-rinser) - - [Stein brechen\\, mahlen und sieben](./manual_ta2_DE.md#stein-brechen\\,-mahlen-und-sieben) - - [TA2 Steinbrecher / Quarry](./manual_ta2_DE.md#ta2-steinbrecher--quarry) - - [TA2 Mühle / Grinder](./manual_ta2_DE.md#ta2-mühle--grinder) - - [TA2 Kiessieb / Gravel Sieve](./manual_ta2_DE.md#ta2-kiessieb--gravel-sieve) - - [Items produzieren](./manual_ta2_DE.md#items-produzieren) - - [TA2 Autocrafter](./manual_ta2_DE.md#ta2-autocrafter) - - [TA2 Elektronikfabrik / Electronic Fab](./manual_ta2_DE.md#ta2-elektronikfabrik--electronic-fab) - - [Sonstige Blöcke](./manual_ta2_DE.md#sonstige-blöcke) - - [TA2 Flüssigkeitensammler / Liquid Sampler](./manual_ta2_DE.md#ta2-flüssigkeitensammler--liquid-sampler) - - [TA2 Gesicherte Kiste / Protected Chest](./manual_ta2_DE.md#ta2-gesicherte-kiste--protected-chest) - - [Techage Forceload Block](./manual_ta2_DE.md#techage-forceload-block) -- [TA3: Ölzeitalter](./manual_ta3_DE.md#ta3:-ölzeitalter) - - [Kohlekraftwerk / Ölkraftwerk](./manual_ta3_DE.md#kohlekraftwerk--ölkraftwerk) - - [TA3 Kraftwerks-Feuerbox / Power Station Firebox](./manual_ta3_DE.md#ta3-kraftwerks-feuerbox--power-station-firebox) - - [TA3 Kraftwerks-Ölbrenner / TA3 Power Station Oil Burner](./manual_ta3_DE.md#ta3-kraftwerks-ölbrenner--ta3-power-station-oil-burner) - - [TA3 Boiler unten/oben](./manual_ta3_DE.md#ta3-boiler-untenoben) - - [TA3 Turbine](./manual_ta3_DE.md#ta3-turbine) - - [TA3 Generator](./manual_ta3_DE.md#ta3-generator) - - [TA3 Kühler / Cooler](./manual_ta3_DE.md#ta3-kühler--cooler) - - [Elektrischer Strom](./manual_ta3_DE.md#elektrischer-strom) - - [Bedeutung von Speichersystemen](./manual_ta3_DE.md#bedeutung-von-speichersystemen) - - [TA Stromkabel / Electric Cable](./manual_ta3_DE.md#ta-stromkabel--electric-cable) - - [TA Verteilerdose / Electric Junction Box](./manual_ta3_DE.md#ta-verteilerdose--electric-junction-box) - - [TA Stromleitung / Power Line](./manual_ta3_DE.md#ta-stromleitung--power-line) - - [TA Strommast / Power Pole](./manual_ta3_DE.md#ta-strommast--power-pole) - - [TA Strommastkopf / Power Pole Top](./manual_ta3_DE.md#ta-strommastkopf--power-pole-top) - - [TA Strommastkopf 2 / Power Pole Top 2](./manual_ta3_DE.md#ta-strommastkopf-2--power-pole-top-2) - - [TA Stromschalter / Power Switch](./manual_ta3_DE.md#ta-stromschalter--power-switch) - - [TA Stromschalter klein / Power Switch Small](./manual_ta3_DE.md#ta-stromschalter-klein--power-switch-small) - - [TA Stromschalterbox / Power Switch Box](./manual_ta3_DE.md#ta-stromschalterbox--power-switch-box) - - [TA3 Kleiner Stromgenerator / Tiny Power Generator](./manual_ta3_DE.md#ta3-kleiner-stromgenerator--tiny-power-generator) - - [TA3 Akku Block / Akku Box](./manual_ta3_DE.md#ta3-akku-block---akku-box) - - [TA3 Strom Terminal / Power Terminal](./manual_ta3_DE.md#ta3-strom-terminal--power-terminal) - - [TA3 Elektromotor / TA3 Electric Motor](./manual_ta3_DE.md#ta3-elektromotor--ta3-electric-motor) - - [TA3 Industrieofen](./manual_ta3_DE.md#ta3-industrieofen) - - [TA3 Ofen-Ölbrenner / Furnace Oil Burner](./manual_ta3_DE.md#ta3-ofen-ölbrenner--furnace-oil-burner) - - [TA3 Ofenoberteil / Furnace Top](./manual_ta3_DE.md#ta3-ofenoberteil--furnace-top) - - [TA3 Gebläse / Booster](./manual_ta3_DE.md#ta3-gebläse--booster) - - [Flüssigkeiten](./manual_ta3_DE.md#flüssigkeiten) - - [TA3 Tank / TA3 Tank](./manual_ta3_DE.md#ta3-tank--ta3-tank) - - [TA3 Pumpe / TA3 Pump](./manual_ta3_DE.md#ta3-pumpe--ta3-pump) - - [TA Einfülltrichter / TA Liquid Filler](./manual_ta3_DE.md#ta-einfülltrichter--ta-liquid-filler) - - [TA4 Röhre / Pipe](./manual_ta3_DE.md#ta4-röhre--pipe) - - [TA3 Rohr/Wanddurchbruch / TA3 Pipe Wall Entry Blöcke](./manual_ta3_DE.md#ta3-rohrwanddurchbruch--ta3-pipe-wall-entry-blöcke) - - [TA Ventil / TA Valve](./manual_ta3_DE.md#ta-ventil--ta-valve) - - [Öl-Förderung](./manual_ta3_DE.md#öl-förderung) - - [TA3 Ölexplorer / Oil Explorer](./manual_ta3_DE.md#ta3-ölexplorer--oil-explorer) - - [TA3 Ölbohrkiste / Oil Drill Box](./manual_ta3_DE.md#ta3-ölbohrkiste--oil-drill-box) - - [TA3 Ölpumpe / Oil Pumpjack](./manual_ta3_DE.md#ta3-ölpumpe--oil-pumpjack) - - [TA3 Bohrgestänge / Drill Pipe](./manual_ta3_DE.md#ta3-bohrgestänge--drill-pipe) - - [Öltank / Oil Tank](./manual_ta3_DE.md#öltank--oil-tank) - - [Öl-Transport](./manual_ta3_DE.md#öl-transport) - - [Öl-Transport mit dem Tankwagen](./manual_ta3_DE.md#öl-transport-mit-dem-tankwagen) - - [Öl-Transport mit Fässern über Minecarts](./manual_ta3_DE.md#öl-transport-mit-fässern-über-minecarts) - - [Tankwagen / Tank Cart](./manual_ta3_DE.md#tankwagen--tank-cart) - - [Kistenwagen / Chest Cart](./manual_ta3_DE.md#kistenwagen--chest-cart) - - [Öl-Verarbeitung](./manual_ta3_DE.md#öl-verarbeitung) - - [Destillationsturm / distiller tower](./manual_ta3_DE.md#destillationsturm--distiller-tower) - - [Aufkocher / reboiler)](./manual_ta3_DE.md#aufkocher--reboiler)) - - [Logik-/Schalt-Blöcke](./manual_ta3_DE.md#logik-schalt-blöcke) - - [TA3 Taster/Schalter / Button/Switch](./manual_ta3_DE.md#ta3-tasterschalter--buttonswitch) - - [TA3 Kommando Konverter / Command Converter](./manual_ta3_DE.md#ta3-kommando-konverter--command-converter) - - [TA3 Flipflop / Flip-Flop](./manual_ta3_DE.md#ta3-flipflop--flip-flop) - - [TA3 Logikblock / Logic Block](./manual_ta3_DE.md#ta3-logikblock--logic-block) - - [TA3 Wiederholer / Repeater](./manual_ta3_DE.md#ta3-wiederholer--repeater) - - [TA3 Sequenzer / Sequencer](./manual_ta3_DE.md#ta3-sequenzer--sequencer) - - [TA3 Timer](./manual_ta3_DE.md#ta3-timer) - - [TA3 Terminal](./manual_ta3_DE.md#ta3-terminal) - - [TechAge Farblampe / Color Lamp](./manual_ta3_DE.md#techage-farblampe--color-lamp) - - [Tür/Tor Blöcke / Door/Gate Blocks](./manual_ta3_DE.md#türtor-blöcke--doorgate-blocks) - - [TA3 Tür Controller / Door Controller](./manual_ta3_DE.md#ta3-tür-controller--door-controller) - - [TA3 Tür Controller II / Door Controller II](./manual_ta3_DE.md#ta3-tür-controller-ii--door-controller-ii) - - [TA3 Sound Block](./manual_ta3_DE.md#ta3-sound-block) - - [TA3 Mesecons Umsetzer / TA3 Mesecons Converter](./manual_ta3_DE.md#ta3-mesecons-umsetzer--ta3-mesecons-converter) - - [Detektoren](./manual_ta3_DE.md#detektoren) - - [TA3 Detektor / Detector](./manual_ta3_DE.md#ta3-detektor--detector) - - [TA3 Wagen Detektor / Cart Detector](./manual_ta3_DE.md#ta3-wagen-detektor--cart-detector) - - [TA3 Block Detektor / Node Detector](./manual_ta3_DE.md#ta3-block-detektor--node-detector) - - [TA3 Spieler Detektor / Player Detector](./manual_ta3_DE.md#ta3-spieler-detektor--player-detector) - - [TA3 Lichtdetektor](./manual_ta3_DE.md#ta3-lichtdetektor) - - [TA3 Maschinen](./manual_ta3_DE.md#ta3-maschinen) - - [TA3 Schieber / Pusher](./manual_ta3_DE.md#ta3-schieber--pusher) - - [TA3 Verteiler / Distributor](./manual_ta3_DE.md#ta3-verteiler--distributor) - - [TA3 Autocrafter](./manual_ta3_DE.md#ta3-autocrafter) - - [TA3 Elektronikfabrik / Electronic Fab](./manual_ta3_DE.md#ta3-elektronikfabrik--electronic-fab) - - [TA3 Steinbrecher / Quarry](./manual_ta3_DE.md#ta3-steinbrecher--quarry) - - [TA3 Kiessieb / Gravel Sieve](./manual_ta3_DE.md#ta3-kiessieb--gravel-sieve) - - [TA3 Kieswaschanlage / Gravel Rinser](./manual_ta3_DE.md#ta3-kieswaschanlage--gravel-rinser) - - [TA3 Mühle / Grinder](./manual_ta3_DE.md#ta3-mühle--grinder) - - [TA3 Injektor / Injector](./manual_ta3_DE.md#ta3-injektor--injector) - - [Werkzeuge](./manual_ta3_DE.md#werkzeuge) - - [Techage Info Tool](./manual_ta3_DE.md#techage-info-tool) - - [TechAge Programmer](./manual_ta3_DE.md#techage-programmer) - - [TechAge Kelle / Trowel](./manual_ta3_DE.md#techage-kelle--trowel) - - [TA3 Bohrgestängezange / TA3 Drill Pipe Wrench](./manual_ta3_DE.md#ta3-bohrgestängezange--ta3-drill-pipe-wrench) - - [Techage Schraubendreher](./manual_ta3_DE.md#techage-schraubendreher) -- [TA4: Gegenwart](./manual_ta4_DE.md#ta4:-gegenwart) - - [Windkraftanlage](./manual_ta4_DE.md#windkraftanlage) - - [TA4 Windkraftanlage / Wind Turbine](./manual_ta4_DE.md#ta4-windkraftanlage--wind-turbine) - - [TA4 Windkraftanlagengondel / Wind Turbine Nacelle](./manual_ta4_DE.md#ta4-windkraftanlagengondel--wind-turbine-nacelle) - - [TA4 Wind Turbine Signal Lamp](./manual_ta4_DE.md#ta4-wind-turbine-signal-lamp) - - [TA4 Säule / Pillar](./manual_ta4_DE.md#ta4-säule--pillar) - - [Solaranlage](./manual_ta4_DE.md#solaranlage) - - [TA4 Solarmodul / Solar Module](./manual_ta4_DE.md#ta4-solarmodul--solar-module) - - [TA4 Solar Trägermodul / Carrier Module](./manual_ta4_DE.md#ta4-solar-trägermodul--carrier-module) - - [TA4 Solar Wechselrichter / Solar Inverter](./manual_ta4_DE.md#ta4-solar-wechselrichter--solar-inverter) - - [TA4 Niederspannungskabel / Low Power Cable](./manual_ta4_DE.md#ta4-niederspannungskabel--low-power-cable) - - [TA4 Niederspannungsverteilerbox / Low Power Box](./manual_ta4_DE.md#ta4-niederspannungsverteilerbox--low-power-box) - - [TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell](./manual_ta4_DE.md#ta4-straßenlampen-solarzelle--streetlamp-solar-cell) - - [Energiespeicher](./manual_ta4_DE.md#energiespeicher) - - [TA4 Wärmetauscher / Heat Exchanger](./manual_ta4_DE.md#ta4-wärmetauscher--heat-exchanger) - - [TA4 Turbine](./manual_ta4_DE.md#ta4-turbine) - - [TA4 Generator](./manual_ta4_DE.md#ta4-generator) - - [TA4 Rohrzulauf / TA4 Pipe Inlet](./manual_ta4_DE.md#ta4-rohrzulauf--ta4-pipe-inlet) - - [TA4 Röhre / Pipe](./manual_ta4_DE.md#ta4-röhre--pipe) - - [Stromverteilung](./manual_ta4_DE.md#stromverteilung) - - [TA4 Trenntransformator / TA4 Isolation Transformer](./manual_ta4_DE.md#ta4-trenntransformator--ta4-isolation-transformer) - - [TA4 Stromzähler / TA4 Electric Meter](./manual_ta4_DE.md#ta4-stromzähler--ta4-electric-meter) - - [TA4 Laser](./manual_ta4_DE.md#ta4-laser) - - [Wasserstoff](./manual_ta4_DE.md#wasserstoff) - - [Elektrolyseur](./manual_ta4_DE.md#elektrolyseur) - - [Brennstoffzelle](./manual_ta4_DE.md#brennstoffzelle) - - [Chemischer Reaktor / chemical reactor](./manual_ta4_DE.md#chemischer-reaktor--chemical-reactor) - - [TA4 Dosierer / doser](./manual_ta4_DE.md#ta4-dosierer--doser) - - [TA4 Reaktor / reactor](./manual_ta4_DE.md#ta4-reaktor--reactor) - - [TA4 Einfüllstutzen / fillerpipe](./manual_ta4_DE.md#ta4-einfüllstutzen--fillerpipe) - - [TA4 Reaktorständer / reactor stand](./manual_ta4_DE.md#ta4-reaktorständer--reactor-stand) - - [TA4 Reaktorsockel / reactor base](./manual_ta4_DE.md#ta4-reaktorsockel--reactor-base) - - [TA4 Silo / silo](./manual_ta4_DE.md#ta4-silo--silo) - - [ICTA Controller](./manual_ta4_DE.md#icta-controller) - - [TA4 ICTA Controller](./manual_ta4_DE.md#ta4-icta-controller) - - [Batterie](./manual_ta4_DE.md#batterie) - - [TA4 Display](./manual_ta4_DE.md#ta4-display) - - [TA4 Display XL](./manual_ta4_DE.md#ta4-display-xl) - - [TA4 Signal Tower](./manual_ta4_DE.md#ta4-signal-tower) - - [TA4 Lua Controller](./manual_ta4_DE.md#ta4-lua-controller) - - [TA4 Lua Server](./manual_ta4_DE.md#ta4-lua-server) - - [TA4 Sensor Kiste/Chest](./manual_ta4_DE.md#ta4-sensor-kistechest) - - [TA4 Lua Controller Terminal](./manual_ta4_DE.md#ta4-lua-controller-terminal) - - [TA4 Logik-/Schalt-Module](./manual_ta4_DE.md#ta4-logik-schalt-module) - - [TA4 Taster/Schalter / Button/Switch](./manual_ta4_DE.md#ta4-tasterschalter--buttonswitch) - - [TA4 2x Taster / 2x Button](./manual_ta4_DE.md#ta4-2x-taster--2x-button) - - [TA4 4x Taster / 4x Button](./manual_ta4_DE.md#ta4-4x-taster--4x-button) - - [TA4 2x Signallampe / 2x Signal Lamp](./manual_ta4_DE.md#ta4-2x-signallampe--2x-signal-lamp) - - [TA4 4x Signallampe / 4x Signal Lamp](./manual_ta4_DE.md#ta4-4x-signallampe--4x-signal-lamp) - - [TA4 Spieler Detektor / Player Detector](./manual_ta4_DE.md#ta4-spieler-detektor--player-detector) - - [TA4 Zustandssammler / State Collector](./manual_ta4_DE.md#ta4-zustandssammler--state-collector) - - [TA4 Detektor / Detector](./manual_ta4_DE.md#ta4-detektor--detector) - - [TA4 Block Detektor / Node Detector](./manual_ta4_DE.md#ta4-block-detektor--node-detector) - - [TA4 Energiespeicher-Ladungsdetektor / Energy Storage Charge Detector](./manual_ta4_DE.md#ta4-energiespeicher-ladungsdetektor--energy-storage-charge-detector) - - [TA4 Blicksensor / Gaze Sensor](./manual_ta4_DE.md#ta4-blicksensor--gaze-sensor) - - [TA4 Sequenzer](./manual_ta4_DE.md#ta4-sequenzer) - - [Move/Dreh-Controller](./manual_ta4_DE.md#movedreh-controller) - - [TA4 Move Controller](./manual_ta4_DE.md#ta4-move-controller) - - [TA4 Drehcontroller / Turn Controller](./manual_ta4_DE.md#ta4-drehcontroller--turn-controller) - - [TA4 Lampen](./manual_ta4_DE.md#ta4-lampen) - - [TA4 LED Pflanzenlampe / TA4 LED Grow Light](./manual_ta4_DE.md#ta4-led-pflanzenlampe--ta4-led-grow-light) - - [TA4 LED Straßenlampe / TA4 LED Street Lamp](./manual_ta4_DE.md#ta4-led-straßenlampe--ta4-led-street-lamp) - - [TA4 LED Industrielampe / TA4 LED Industrial Lamp](./manual_ta4_DE.md#ta4-led-industrielampe--ta4-led-industrial-lamp) - - [TA4 Flüssigkeitsfilter](./manual_ta4_DE.md#ta4-flüssigkeitsfilter) - - [Fundament-Ebene](./manual_ta4_DE.md#fundament-ebene) - - [Schotter-Ebene](./manual_ta4_DE.md#schotter-ebene) - - [Einfüll-Ebene](./manual_ta4_DE.md#einfüll-ebene) - - [TA4 Teilchenbeschleuniger / Collider](./manual_ta4_DE.md#ta4-teilchenbeschleuniger--collider) - - [Detektor](./manual_ta4_DE.md#detektor) - - [Steuerung / TA4 Terminal](./manual_ta4_DE.md#steuerung--ta4-terminal) - - [Aufbau](./manual_ta4_DE.md#aufbau) - - [Weitere TA4 Blöcke](./manual_ta4_DE.md#weitere-ta4-blöcke) - - [TA4 Rezept Block](./manual_ta4_DE.md#ta4-rezept-block) - - [TA4 Autocrafter](./manual_ta4_DE.md#ta4-autocrafter) - - [TA4 Tank / TA4 Tank](./manual_ta4_DE.md#ta4-tank--ta4-tank) - - [TA4 Pumpe / TA4 Pump](./manual_ta4_DE.md#ta4-pumpe--ta4-pump) - - [TA4 Ofenheizung / furnace heater](./manual_ta4_DE.md#ta4-ofenheizung--furnace-heater) - - [TA4 Wasserpumpe / Water Pump (veraltet)](./manual_ta4_DE.md#ta4-wasserpumpe--water-pump-(veraltet)) - - [TA4 Wassereinlass / TA4 Water Inlet](./manual_ta4_DE.md#ta4-wassereinlass--ta4-water-inlet) - - [TA4 Röhren / TA4 Tube](./manual_ta4_DE.md#ta4-röhren--ta4-tube) - - [TA4 Schieber / Pusher](./manual_ta4_DE.md#ta4-schieber--pusher) - - [TA4 Kiste / TA4 Chest](./manual_ta4_DE.md#ta4-kiste--ta4-chest) - - [TA4 8x2000 Kiste / TA4 8x2000 Chest](./manual_ta4_DE.md#ta4-8x2000-kiste--ta4-8x2000-chest) - - [TA4 Verteiler / Distributor](./manual_ta4_DE.md#ta4-verteiler--distributor) - - [TA4 Hochleistungs-Verteiler / High Performance Distributor](./manual_ta4_DE.md#ta4-hochleistungs-verteiler--high-performance-distributor) - - [TA4 Kiessieb / Gravel Sieve](./manual_ta4_DE.md#ta4-kiessieb--gravel-sieve) - - [TA4 Mühle / Grinder](./manual_ta4_DE.md#ta4-mühle--grinder) - - [TA4 Steinbrecher / Quarry](./manual_ta4_DE.md#ta4-steinbrecher--quarry) - - [TA4 Elektronikfabrik / Electronic Fab](./manual_ta4_DE.md#ta4-elektronikfabrik--electronic-fab) - - [TA4 Injektor / Injector](./manual_ta4_DE.md#ta4-injektor--injector) - - [TA4 Recycler](./manual_ta4_DE.md#ta4-recycler) - - [TA4 Item Durchlaufbegrenzer / Item Flow Limiter](./manual_ta4_DE.md#ta4-item-durchlaufbegrenzer--item-flow-limiter) -- [TA5: Zukunft](./manual_ta5_DE.md#ta5:-zukunft) - - [Energiequellen](./manual_ta5_DE.md#energiequellen) - - [TA5 Fusionsreaktor](./manual_ta5_DE.md#ta5-fusionsreaktor) - - [TA5 Fusionreaktor Magnet](./manual_ta5_DE.md#ta5-fusionreaktor-magnet) - - [TA5 Pumpe](./manual_ta5_DE.md#ta5-pumpe) - - [TA5 Wärmetauscher](./manual_ta5_DE.md#ta5-wärmetauscher) - - [TA5 Fusionreaktor Controller](./manual_ta5_DE.md#ta5-fusionreaktor-controller) - - [TA5 Fusionreaktor Hülle](./manual_ta5_DE.md#ta5-fusionreaktor-hülle) - - [TA5 Fusionreaktor Kern](./manual_ta5_DE.md#ta5-fusionreaktor-kern) - - [Energiespeicher](./manual_ta5_DE.md#energiespeicher) - - [TA5 Hybrid-Speicher (geplant)](./manual_ta5_DE.md#ta5-hybrid-speicher-(geplant)) - - [Logik Blöcke](./manual_ta5_DE.md#logik-blöcke) - - [Transport und Verkehr](./manual_ta5_DE.md#transport-und-verkehr) - - [TA5 Flug Controller](./manual_ta5_DE.md#ta5-flug-controller) - - [TA5 Hyperloop Kiste / TA5 Hyperloop Chest](./manual_ta5_DE.md#ta5-hyperloop-kiste--ta5-hyperloop-chest) - - [TA5 Hyperloop Tank / TA5 Hyperloop Tank](./manual_ta5_DE.md#ta5-hyperloop-tank--ta5-hyperloop-tank) - - [TA5-Raumgleiter (geplant)](./manual_ta5_DE.md#ta5-raumgleiter-(geplant)) - - [Teleport Blöcke](./manual_ta5_DE.md#teleport-blöcke) - - [TA5 Teleport Block Gegenstände / TA5 Teleport Block Items](./manual_ta5_DE.md#ta5-teleport-block-gegenstände--ta5-teleport-block-items) - - [TA5 Teleport Block Flüssigkeiten / TA5 Teleport Block Liquids](./manual_ta5_DE.md#ta5-teleport-block-flüssigkeiten--ta5-teleport-block-liquids) - - [Hyperloop Teleport Blöcke (geplant)](./manual_ta5_DE.md#hyperloop-teleport-blöcke-(geplant)) - - [Weitere TA5 Blöcke/Items](./manual_ta5_DE.md#weitere-ta5-blöckeitems) - - [TA5 Container (geplant)](./manual_ta5_DE.md#ta5-container-(geplant)) - - [TA5 KI Chip / TA5 AI Chip](./manual_ta5_DE.md#ta5-ki-chip--ta5-ai-chip) - - [TA5 KI Chip II / TA5 AI Chip II](./manual_ta5_DE.md#ta5-ki-chip-ii--ta5-ai-chip-ii) \ No newline at end of file diff --git a/techage/manuals/toc_EN.md b/techage/manuals/toc_EN.md deleted file mode 100644 index 52c10de..0000000 --- a/techage/manuals/toc_EN.md +++ /dev/null @@ -1,261 +0,0 @@ -# Table of Contents - -- [Tech Age Mod](./manual_EN.md#tech-age-mod) - - [Hints](./manual_EN.md#hints) - - [Changes from version 1.0](./manual_EN.md#changes-from-version-1.0) - - [Tips on switching](./manual_EN.md#tips-on-switching) - - [Ores and Minerals](./manual_EN.md#ores-and-minerals) - - [Meridium](./manual_EN.md#meridium) - - [Usmium](./manual_EN.md#usmium) - - [Baborium](./manual_EN.md#baborium) - - [Petroleum](./manual_EN.md#petroleum) - - [Bauxite](./manual_EN.md#bauxite) - - [Basalt](./manual_EN.md#basalt) - - [History](./manual_EN.md#history) -- [TA1: Iron Age](./manual_ta1_EN.md#ta1:-iron-age) - - [Charcoal Pile (charcoal burner)](./manual_ta1_EN.md#charcoal-pile-(charcoal-burner)) - - [Melting Furnace](./manual_ta1_EN.md#melting-furnace) - - [Watermill](./manual_ta1_EN.md#watermill) - - [TA1 mill](./manual_ta1_EN.md#ta1-mill) - - [TA1 sluice gate](./manual_ta1_EN.md#ta1-sluice-gate) - - [TA1 sluice handle](./manual_ta1_EN.md#ta1-sluice-handle) - - [TA1 Apple Wood Board](./manual_ta1_EN.md#ta1-apple-wood-board) - - [TA1 Apple Millrace Board](./manual_ta1_EN.md#ta1-apple-millrace-board) - - [Ores and Tools](./manual_ta1_EN.md#ores-and-tools) - - [Hammer](./manual_ta1_EN.md#hammer) - - [Gravel Sieve](./manual_ta1_EN.md#gravel-sieve) - - [Hopper](./manual_ta1_EN.md#hopper) - - [Gravel seven with the hopper](./manual_ta1_EN.md#gravel-seven-with-the-hopper) - - [Meridium](./manual_ta1_EN.md#meridium) -- [TA2: Steam Age](./manual_ta2_EN.md#ta2:-steam-age) - - [Steam Engine](./manual_ta2_EN.md#steam-engine) - - [TA2 Firebox](./manual_ta2_EN.md#ta2-firebox) - - [TA2 Boiler](./manual_ta2_EN.md#ta2-boiler) - - [TA2 Cylinder](./manual_ta2_EN.md#ta2-cylinder) - - [TA2 Flywheel](./manual_ta2_EN.md#ta2-flywheel) - - [TA2 Steam Pipes](./manual_ta2_EN.md#ta2-steam-pipes) - - [TA2 Drive Axle / TA2 Gearbox](./manual_ta2_EN.md#ta2-drive-axle--ta2-gearbox) - - [TA2 Power Generator](./manual_ta2_EN.md#ta2-power-generator) - - [TA2 energy storage](./manual_ta2_EN.md#ta2-energy-storage) - - [TA2 Winch](./manual_ta2_EN.md#ta2-winch) - - [TA2 Weight Chest](./manual_ta2_EN.md#ta2-weight-chest) - - [Push and sort items](./manual_ta2_EN.md#push-and-sort-items) - - [TechAge Tube](./manual_ta2_EN.md#techage-tube) - - [Tube Concentrator](./manual_ta2_EN.md#tube-concentrator) - - [TA2 Pusher](./manual_ta2_EN.md#ta2-pusher) - - [TA2 Distributor](./manual_ta2_EN.md#ta2-distributor) - - [Gravel washer](./manual_ta2_EN.md#gravel-washer) - - [TA2 Gravel Rinser](./manual_ta2_EN.md#ta2-gravel-rinser) - - [Dig stone\\, grind and sieve](./manual_ta2_EN.md#dig-stone\\,-grind-and-sieve) - - [TA2 Quarry](./manual_ta2_EN.md#ta2-quarry) - - [TA2 Grinder](./manual_ta2_EN.md#ta2-grinder) - - [TA2 Gravel Sieve](./manual_ta2_EN.md#ta2-gravel-sieve) - - [Produce Items](./manual_ta2_EN.md#produce-items) - - [TA2 Autocrafter](./manual_ta2_EN.md#ta2-autocrafter) - - [TA2 Electronic Fab](./manual_ta2_EN.md#ta2-electronic-fab) - - [Other blocks](./manual_ta2_EN.md#other-blocks) - - [TA2 Liquid Sampler](./manual_ta2_EN.md#ta2-liquid-sampler) - - [TA2 Protected Chest](./manual_ta2_EN.md#ta2-protected-chest) - - [Techage Forceload Block](./manual_ta2_EN.md#techage-forceload-block) -- [TA3: Oil Age](./manual_ta3_EN.md#ta3:-oil-age) - - [Coal-fired Power Station / Oil-fired Power Station](./manual_ta3_EN.md#coal-fired-power-station--oil-fired-power-station) - - [TA3 power station firebox](./manual_ta3_EN.md#ta3-power-station-firebox) - - [TA3 Power Station Oil Burner](./manual_ta3_EN.md#ta3-power-station-oil-burner) - - [TA3 boiler base / top](./manual_ta3_EN.md#ta3-boiler-base--top) - - [TA3 turbine](./manual_ta3_EN.md#ta3-turbine) - - [TA3 generator](./manual_ta3_EN.md#ta3-generator) - - [TA3 cooler](./manual_ta3_EN.md#ta3-cooler) - - [Electrical current](./manual_ta3_EN.md#electrical-current) - - [Importance of storage systems](./manual_ta3_EN.md#importance-of-storage-systems) - - [TA Electric Cable](./manual_ta3_EN.md#ta-electric-cable) - - [TA Electric Junction Box](./manual_ta3_EN.md#ta-electric-junction-box) - - [TA Power Line](./manual_ta3_EN.md#ta-power-line) - - [TA Power Pole](./manual_ta3_EN.md#ta-power-pole) - - [TA Power Pole Top](./manual_ta3_EN.md#ta-power-pole-top) - - [TA Power Pole Top 2](./manual_ta3_EN.md#ta-power-pole-top-2) - - [TA Power Switch](./manual_ta3_EN.md#ta-power-switch) - - [TA Power Switch Small](./manual_ta3_EN.md#ta-power-switch-small) - - [TA Power Switch Box](./manual_ta3_EN.md#ta-power-switch-box) - - [TA3 Small Power Generator](./manual_ta3_EN.md#ta3-small-power-generator) - - [TA3 Battery Block](./manual_ta3_EN.md#ta3-battery-block) - - [TA3 Power Terminal](./manual_ta3_EN.md#ta3-power-terminal) - - [TA3 Electric Motor](./manual_ta3_EN.md#ta3-electric-motor) - - [TA3 Industrial Furnace](./manual_ta3_EN.md#ta3-industrial-furnace) - - [TA3 Furnace Oil Burner](./manual_ta3_EN.md#ta3-furnace-oil-burner) - - [TA3 Furnace Top](./manual_ta3_EN.md#ta3-furnace-top) - - [TA3 Booster](./manual_ta3_EN.md#ta3-booster) - - [Liquids](./manual_ta3_EN.md#liquids) - - [TA3 Tank](./manual_ta3_EN.md#ta3-tank) - - [TA3 Pump](./manual_ta3_EN.md#ta3-pump) - - [TA Liquid Filler](./manual_ta3_EN.md#ta-liquid-filler) - - [TA4 Pipe](./manual_ta3_EN.md#ta4-pipe) - - [TA3 Pipe Wall Entry Blocks](./manual_ta3_EN.md#ta3-pipe-wall-entry-blocks) - - [TA Valve](./manual_ta3_EN.md#ta-valve) - - [Oil Production](./manual_ta3_EN.md#oil-production) - - [TA3 Oil Explorer](./manual_ta3_EN.md#ta3-oil-explorer) - - [TA3 Oil Drill Box](./manual_ta3_EN.md#ta3-oil-drill-box) - - [TA3 Oil Pumpjack](./manual_ta3_EN.md#ta3-oil-pumpjack) - - [TA3 Drill Pipe](./manual_ta3_EN.md#ta3-drill-pipe) - - [Oil tank](./manual_ta3_EN.md#oil-tank) - - [Oil Transportation](./manual_ta3_EN.md#oil-transportation) - - [Oil transportation by Tank Carts](./manual_ta3_EN.md#oil-transportation-by-tank-carts) - - [Oil transportation with barrels over Minecarts](./manual_ta3_EN.md#oil-transportation-with-barrels-over-minecarts) - - [Tank Cart](./manual_ta3_EN.md#tank-cart) - - [Chest Cart](./manual_ta3_EN.md#chest-cart) - - [Oil Processing](./manual_ta3_EN.md#oil-processing) - - [Distillation Tower](./manual_ta3_EN.md#distillation-tower) - - [Reboiler](./manual_ta3_EN.md#reboiler) - - [Logic / Switching Blocks](./manual_ta3_EN.md#logic--switching-blocks) - - [TA3 Button / Switch](./manual_ta3_EN.md#ta3-button--switch) - - [TA3 Command Converter](./manual_ta3_EN.md#ta3-command-converter) - - [TA3 Flip-Flop](./manual_ta3_EN.md#ta3-flip-flop) - - [TA3 Logic Block](./manual_ta3_EN.md#ta3-logic-block) - - [TA3 Repeater](./manual_ta3_EN.md#ta3-repeater) - - [TA3 Sequencer](./manual_ta3_EN.md#ta3-sequencer) - - [TA3 Timer](./manual_ta3_EN.md#ta3-timer) - - [TA3 Terminal](./manual_ta3_EN.md#ta3-terminal) - - [TechAge Color Lamp](./manual_ta3_EN.md#techage-color-lamp) - - [Door/Gate Blocks](./manual_ta3_EN.md#doorgate-blocks) - - [TA3 Door Controller](./manual_ta3_EN.md#ta3-door-controller) - - [TA3 Door Controller II](./manual_ta3_EN.md#ta3-door-controller-ii) - - [TA3 Sound Block](./manual_ta3_EN.md#ta3-sound-block) - - [TA3 Mesecons Converter](./manual_ta3_EN.md#ta3-mesecons-converter) - - [Detectors](./manual_ta3_EN.md#detectors) - - [TA3 Detector](./manual_ta3_EN.md#ta3-detector) - - [TA3 Cart Detector](./manual_ta3_EN.md#ta3-cart-detector) - - [TA3 Node Detector](./manual_ta3_EN.md#ta3-node-detector) - - [TA3 Player Detector](./manual_ta3_EN.md#ta3-player-detector) - - [TA3 Light Detector](./manual_ta3_EN.md#ta3-light-detector) - - [TA3 Machines](./manual_ta3_EN.md#ta3-machines) - - [TA3 Pusher](./manual_ta3_EN.md#ta3-pusher) - - [TA3 Distributor](./manual_ta3_EN.md#ta3-distributor) - - [TA3 Autocrafter](./manual_ta3_EN.md#ta3-autocrafter) - - [TA3 Electronic Fab](./manual_ta3_EN.md#ta3-electronic-fab) - - [TA3 Quarry](./manual_ta3_EN.md#ta3-quarry) - - [TA3 Gravel Sieve](./manual_ta3_EN.md#ta3-gravel-sieve) - - [TA3 Gravel Rinser](./manual_ta3_EN.md#ta3-gravel-rinser) - - [TA3 Grinder](./manual_ta3_EN.md#ta3-grinder) - - [TA3 Injector](./manual_ta3_EN.md#ta3-injector) - - [TA3 Item Flow Limiter](./manual_ta3_EN.md#ta3-item-flow-limiter) - - [Tools](./manual_ta3_EN.md#tools) - - [Techage Info Tool](./manual_ta3_EN.md#techage-info-tool) - - [TechAge Programmer](./manual_ta3_EN.md#techage-programmer) - - [TechAge Trowel / Trowel](./manual_ta3_EN.md#techage-trowel--trowel) - - [TA3 drill pipe wrench](./manual_ta3_EN.md#ta3-drill-pipe-wrench) - - [Techage Screwdriver](./manual_ta3_EN.md#techage-screwdriver) -- [TA4: Present](./manual_ta4_EN.md#ta4:-present) - - [Wind Turbine](./manual_ta4_EN.md#wind-turbine) - - [TA4 Wind Turbine](./manual_ta4_EN.md#ta4-wind-turbine) - - [TA4 Wind Turbine Nacelle](./manual_ta4_EN.md#ta4-wind-turbine-nacelle) - - [TA4 Wind Turbine Signal Lamp](./manual_ta4_EN.md#ta4-wind-turbine-signal-lamp) - - [TA4 Pillar](./manual_ta4_EN.md#ta4-pillar) - - [Solar System](./manual_ta4_EN.md#solar-system) - - [TA4 Solar Module](./manual_ta4_EN.md#ta4-solar-module) - - [TA4 Solar Carrier Module](./manual_ta4_EN.md#ta4-solar-carrier-module) - - [TA4 Solar Inverter](./manual_ta4_EN.md#ta4-solar-inverter) - - [TA4 Low Power Cable](./manual_ta4_EN.md#ta4-low-power-cable) - - [TA4 Low Voltage Junction Box](./manual_ta4_EN.md#ta4-low-voltage-junction-box) - - [TA4 Street Lamp Solar Cell](./manual_ta4_EN.md#ta4-street-lamp-solar-cell) - - [Thermal Energy Storage](./manual_ta4_EN.md#thermal-energy-storage) - - [TA4 Heat Exchanger](./manual_ta4_EN.md#ta4-heat-exchanger) - - [TA4 Turbine](./manual_ta4_EN.md#ta4-turbine) - - [TA4 Generator](./manual_ta4_EN.md#ta4-generator) - - [TA4 Pipe Inlet](./manual_ta4_EN.md#ta4-pipe-inlet) - - [TA4 Pipe](./manual_ta4_EN.md#ta4-pipe) - - [Power Distribution](./manual_ta4_EN.md#power-distribution) - - [TA4 Isolation Transformer](./manual_ta4_EN.md#ta4-isolation-transformer) - - [TA4 Electric Meter](./manual_ta4_EN.md#ta4-electric-meter) - - [TA4 Laser](./manual_ta4_EN.md#ta4-laser) - - [Hydrogen](./manual_ta4_EN.md#hydrogen) - - [Electrolyzer](./manual_ta4_EN.md#electrolyzer) - - [Fuel Cell](./manual_ta4_EN.md#fuel-cell) - - [Chemical Reactor](./manual_ta4_EN.md#chemical-reactor) - - [TA4 Doser](./manual_ta4_EN.md#ta4-doser) - - [TA4 Reactor](./manual_ta4_EN.md#ta4-reactor) - - [TA4 Filler Pipe](./manual_ta4_EN.md#ta4-filler-pipe) - - [TA4 Reactor Stand](./manual_ta4_EN.md#ta4-reactor-stand) - - [TA4 Reactor Base](./manual_ta4_EN.md#ta4-reactor-base) - - [TA4 Silo](./manual_ta4_EN.md#ta4-silo) - - [ICTA Controller](./manual_ta4_EN.md#icta-controller) - - [TA4 ICTA controller](./manual_ta4_EN.md#ta4-icta-controller) - - [Battery](./manual_ta4_EN.md#battery) - - [TA4 Display](./manual_ta4_EN.md#ta4-display) - - [TA4 Display XL](./manual_ta4_EN.md#ta4-display-xl) - - [TA4 Signal Tower](./manual_ta4_EN.md#ta4-signal-tower) - - [TA4 Lua Controller](./manual_ta4_EN.md#ta4-lua-controller) - - [TA4 Lua Server](./manual_ta4_EN.md#ta4-lua-server) - - [TA4 Sensor Box / Chest](./manual_ta4_EN.md#ta4-sensor-box--chest) - - [TA4 Lua Controller Terminal](./manual_ta4_EN.md#ta4-lua-controller-terminal) - - [TA4 Logic/Switching Modules](./manual_ta4_EN.md#ta4-logicswitching-modules) - - [TA4 Button/Switch](./manual_ta4_EN.md#ta4-buttonswitch) - - [TA4 2x Button](./manual_ta4_EN.md#ta4-2x-button) - - [TA4 4x Button](./manual_ta4_EN.md#ta4-4x-button) - - [TA4 2x Signal Lamp](./manual_ta4_EN.md#ta4-2x-signal-lamp) - - [TA4 4x Signal Lamp](./manual_ta4_EN.md#ta4-4x-signal-lamp) - - [TA4 Player Detector](./manual_ta4_EN.md#ta4-player-detector) - - [TA4 State Collector](./manual_ta4_EN.md#ta4-state-collector) - - [TA4 Detector](./manual_ta4_EN.md#ta4-detector) - - [TA4 Node Detector](./manual_ta4_EN.md#ta4-node-detector) - - [TA4 Energy Storage Charge Detector](./manual_ta4_EN.md#ta4-energy-storage-charge-detector) - - [TA4 Gaze Sensor](./manual_ta4_EN.md#ta4-gaze-sensor) - - [TA4 Sequencer](./manual_ta4_EN.md#ta4-sequencer) - - [Move/Turn Controller](./manual_ta4_EN.md#moveturn-controller) - - [TA4 Move Controller](./manual_ta4_EN.md#ta4-move-controller) - - [TA4 Turn Controller](./manual_ta4_EN.md#ta4-turn-controller) - - [TA4 Lamps](./manual_ta4_EN.md#ta4-lamps) - - [TA4 LED Grow Light](./manual_ta4_EN.md#ta4-led-grow-light) - - [TA4 Street Lamp](./manual_ta4_EN.md#ta4-street-lamp) - - [TA4 LED Industrial Lamp](./manual_ta4_EN.md#ta4-led-industrial-lamp) - - [TA4 Liquid Filter](./manual_ta4_EN.md#ta4-liquid-filter) - - [Base Layer](./manual_ta4_EN.md#base-layer) - - [Gravel Layer](./manual_ta4_EN.md#gravel-layer) - - [Filling Layer](./manual_ta4_EN.md#filling-layer) - - [TA4 Collider (Particle Accelerator)](./manual_ta4_EN.md#ta4-collider-(particle-accelerator)) - - [Detector](./manual_ta4_EN.md#detector) - - [Control / TA4 Terminal](./manual_ta4_EN.md#control--ta4-terminal) - - [Construction](./manual_ta4_EN.md#construction) - - [More TA4 Blocks](./manual_ta4_EN.md#more-ta4-blocks) - - [TA4 Recipe Block](./manual_ta4_EN.md#ta4-recipe-block) - - [TA4 Autocrafter](./manual_ta4_EN.md#ta4-autocrafter) - - [TA4 Tank](./manual_ta4_EN.md#ta4-tank) - - [TA4 Pump](./manual_ta4_EN.md#ta4-pump) - - [TA4 Furnace Heater](./manual_ta4_EN.md#ta4-furnace-heater) - - [TA4 Water Pump (deprecated)](./manual_ta4_EN.md#ta4-water-pump-(deprecated)) - - [TA4 Water Inlet](./manual_ta4_EN.md#ta4-water-inlet) - - [TA4 Tube](./manual_ta4_EN.md#ta4-tube) - - [TA4 Pusher](./manual_ta4_EN.md#ta4-pusher) - - [TA4 Chest](./manual_ta4_EN.md#ta4-chest) - - [TA4 8x2000 Chest](./manual_ta4_EN.md#ta4-8x2000-chest) - - [TA4 Distributor](./manual_ta4_EN.md#ta4-distributor) - - [TA4 High Performance Distributor](./manual_ta4_EN.md#ta4-high-performance-distributor) - - [TA4 Gravel Sieve](./manual_ta4_EN.md#ta4-gravel-sieve) - - [TA4 Grinder](./manual_ta4_EN.md#ta4-grinder) - - [TA4 Quarry](./manual_ta4_EN.md#ta4-quarry) - - [TA4 Electronic Fab](./manual_ta4_EN.md#ta4-electronic-fab) - - [TA4 Injector](./manual_ta4_EN.md#ta4-injector) - - [TA4 Recycler](./manual_ta4_EN.md#ta4-recycler) - - [TA4 Item Flow Limiter](./manual_ta4_EN.md#ta4-item-flow-limiter) -- [TA5: Future](./manual_ta5_EN.md#ta5:-future) - - [Energy Sources](./manual_ta5_EN.md#energy-sources) - - [TA5 Fusion Reactor](./manual_ta5_EN.md#ta5-fusion-reactor) - - [TA5 Fusion Reactor Magnet](./manual_ta5_EN.md#ta5-fusion-reactor-magnet) - - [TA5 Pump](./manual_ta5_EN.md#ta5-pump) - - [TA5 Heat Exchanger](./manual_ta5_EN.md#ta5-heat-exchanger) - - [TA5 Fusion Reactor Controller](./manual_ta5_EN.md#ta5-fusion-reactor-controller) - - [TA5 Fusion Reactor Shell](./manual_ta5_EN.md#ta5-fusion-reactor-shell) - - [TA5 Fusion Reactor Core](./manual_ta5_EN.md#ta5-fusion-reactor-core) - - [Energy Storage](./manual_ta5_EN.md#energy-storage) - - [TA5 Hybrid Storage (planned)](./manual_ta5_EN.md#ta5-hybrid-storage-(planned)) - - [Logic blocks](./manual_ta5_EN.md#logic-blocks) - - [Transport and Traffic](./manual_ta5_EN.md#transport-and-traffic) - - [TA5 Flight Controller](./manual_ta5_EN.md#ta5-flight-controller) - - [TA5 Hyperloop Chest](./manual_ta5_EN.md#ta5-hyperloop-chest) - - [TA5 Hyperloop Tank](./manual_ta5_EN.md#ta5-hyperloop-tank) - - [Teleport Blocks](./manual_ta5_EN.md#teleport-blocks) - - [TA5 Teleport Block Items](./manual_ta5_EN.md#ta5-teleport-block-items) - - [TA5 Teleport Block Liquids](./manual_ta5_EN.md#ta5-teleport-block-liquids) - - [Hyperloop Teleport Blocks (planned)](./manual_ta5_EN.md#hyperloop-teleport-blocks-(planned)) - - [More TA5 Blocks/Items](./manual_ta5_EN.md#more-ta5-blocksitems) - - [TA5 Container (planned)](./manual_ta5_EN.md#ta5-container-(planned)) - - [TA5 AI Chip](./manual_ta5_EN.md#ta5-ai-chip) - - [TA5 AI Chip II](./manual_ta5_EN.md#ta5-ai-chip-ii) \ No newline at end of file diff --git a/techage/mod.conf b/techage/mod.conf deleted file mode 100644 index 8f76061..0000000 --- a/techage/mod.conf +++ /dev/null @@ -1,5 +0,0 @@ -name = techage -depends = default,doors,flowers,tubelib2,networks,basic_materials,bucket,stairs,screwdriver,minecart,lcdlib,safer_lua,doclib -optional_depends = unified_inventory,wielded_light,unifieddyes,moreores,ethereal,mesecons,mesecons_materials,mesecons_mvps,digtron,bakedclay,moreblocks,i3,creative,craftguide,farming -description = Techage, go through 5 tech ages in search of wealth and power! -supported_games = minetest_game diff --git a/techage/models/size.py b/techage/models/size.py deleted file mode 100644 index 620294c..0000000 --- a/techage/models/size.py +++ /dev/null @@ -1,9 +0,0 @@ -lOut = [] -for line in file("techage_boiler_large.obj"): - words = line.split(" ") - if words[0] == "v": - words[1] = "%1.6f" % (float(words[1]) * 1.2) - words[3] = "%1.6f" % (float(words[3]) * 1.2) - line = " ".join(words) - lOut.append(line.strip()) -file("techage_boiler_bigger.obj", "wt").write("\n".join(lOut)) diff --git a/techage/models/techage_cylinder_07.obj b/techage/models/techage_cylinder_07.obj deleted file mode 100644 index 2bd0f8a..0000000 --- a/techage/models/techage_cylinder_07.obj +++ /dev/null @@ -1,124 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'oven.blend' -# www.blender.org -o Cylinder -v 0.000000 -0.500000 -0.360000 -v 0.000000 0.500000 -0.360000 -v 0.137766 -0.500000 -0.332597 -v 0.137766 0.500000 -0.332597 -v 0.254558 -0.500000 -0.254558 -v 0.254558 0.500000 -0.254558 -v 0.332597 -0.500000 -0.137766 -v 0.332597 0.500000 -0.137766 -v 0.360000 -0.500000 0.000000 -v 0.360000 0.500000 0.000000 -v 0.332597 -0.500000 0.137766 -v 0.332597 0.500000 0.137766 -v 0.254558 -0.500000 0.254558 -v 0.254558 0.500000 0.254558 -v 0.137766 -0.500000 0.332597 -v 0.137766 0.500000 0.332597 -v 0.000000 -0.500000 0.360000 -v 0.000000 0.500000 0.360000 -v -0.137766 -0.500000 0.332597 -v -0.137766 0.500000 0.332597 -v -0.254558 -0.500000 0.254559 -v -0.254558 0.500000 0.254559 -v -0.332597 -0.500000 0.137766 -v -0.332597 0.500000 0.137766 -v -0.360000 -0.500000 -0.000000 -v -0.360000 0.500000 -0.000000 -v -0.332597 -0.500000 -0.137766 -v -0.332597 0.500000 -0.137766 -v -0.254558 -0.500000 -0.254559 -v -0.254558 0.500000 -0.254559 -v -0.137766 -0.500000 -0.332597 -v -0.137766 0.500000 -0.332597 -vt 0.5486 0.5000 -vt 0.5486 1.0000 -vt 0.4725 1.0000 -vt 0.4725 0.5000 -vt 0.4142 1.0000 -vt 0.4142 0.5000 -vt 1.0000 0.5000 -vt 1.0000 1.0000 -vt 0.9239 1.0000 -vt 0.9239 0.5000 -vt 0.8415 1.0000 -vt 0.8415 0.5000 -vt 0.7654 1.0000 -vt 0.7654 0.5000 -vt 0.4142 0.5000 -vt 0.4142 0.0000 -vt 0.4725 0.0000 -vt 0.4725 0.5000 -vt 0.5486 0.0000 -vt 0.5486 0.5000 -vt 0.6310 0.0000 -vt 0.6310 0.5000 -vt 0.7071 0.0000 -vt 0.7071 0.5000 -vt 0.7654 0.0000 -vt 0.7654 0.5000 -vt 0.8415 0.0000 -vt 0.8415 0.5000 -vt 0.9239 0.0000 -vt 0.9239 0.5000 -vt 1.0000 0.0000 -vt 1.0000 0.5000 -vt 0.7654 0.5000 -vt 0.7654 1.0000 -vt 0.7071 1.0000 -vt 0.7071 0.5000 -vt 0.3244 0.4749 -vt 0.3827 0.5370 -vt 0.4142 0.6181 -vt 0.4142 0.7059 -vt 0.3827 0.7870 -vt 0.3244 0.8491 -vt 0.2483 0.8827 -vt 0.1659 0.8827 -vt 0.0898 0.8491 -vt 0.0315 0.7870 -vt 0.0000 0.7059 -vt 0.0000 0.6181 -vt 0.0315 0.5370 -vt 0.0898 0.4749 -vt 0.1659 0.4414 -vt 0.2483 0.4414 -vt 0.6310 1.0000 -vt 0.6310 0.5000 -vt 0.0000 0.2646 -vt 0.0000 0.1768 -vt 0.0315 0.0957 -vt 0.0898 0.0336 -vt 0.1659 0.0000 -vt 0.2483 0.0000 -vt 0.3244 0.0336 -vt 0.3827 0.0957 -vt 0.4142 0.1768 -vt 0.4142 0.2646 -vt 0.3827 0.3457 -vt 0.3244 0.4078 -vt 0.2483 0.4414 -vt 0.1659 0.4414 -vt 0.0898 0.4078 -vt 0.0315 0.3457 -s off -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/7 6/8 8/9 7/10 -f 7/10 8/9 10/11 9/12 -f 9/12 10/11 12/13 11/14 -f 11/15 12/16 14/17 13/18 -f 13/18 14/17 16/19 15/20 -f 15/20 16/19 18/21 17/22 -f 17/22 18/21 20/23 19/24 -f 19/24 20/23 22/25 21/26 -f 21/26 22/25 24/27 23/28 -f 23/28 24/27 26/29 25/30 -f 25/30 26/29 28/31 27/32 -f 27/33 28/34 30/35 29/36 -f 4/37 2/38 32/39 30/40 28/41 26/42 24/43 22/44 20/45 18/46 16/47 14/48 12/49 10/50 8/51 6/52 -f 29/36 30/35 32/53 31/54 -f 31/54 32/53 2/2 1/1 -f 1/55 3/56 5/57 7/58 9/59 11/60 13/61 15/62 17/63 19/64 21/65 23/66 25/67 27/68 29/69 31/70 \ No newline at end of file diff --git a/techage/models/techage_cylinder_09.obj b/techage/models/techage_cylinder_09.obj deleted file mode 100644 index ab56cfb..0000000 --- a/techage/models/techage_cylinder_09.obj +++ /dev/null @@ -1,124 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'test.blend' -# www.blender.org -o Cylinder -v 0.000000 -0.500000 -0.450000 -v 0.000000 0.500000 -0.450000 -v 0.172208 -0.500000 -0.415746 -v 0.172208 0.500000 -0.415746 -v 0.318198 -0.500000 -0.318198 -v 0.318198 0.500000 -0.318198 -v 0.415746 -0.500000 -0.172208 -v 0.415746 0.500000 -0.172208 -v 0.450000 -0.500000 0.000000 -v 0.450000 0.500000 0.000000 -v 0.415746 -0.500000 0.172208 -v 0.415746 0.500000 0.172208 -v 0.318198 -0.500000 0.318198 -v 0.318198 0.500000 0.318198 -v 0.172208 -0.500000 0.415746 -v 0.172208 0.500000 0.415746 -v 0.000000 -0.500000 0.450000 -v 0.000000 0.500000 0.450000 -v -0.172207 -0.500000 0.415746 -v -0.172207 0.500000 0.415746 -v -0.318198 -0.500000 0.318198 -v -0.318198 0.500000 0.318198 -v -0.415746 -0.500000 0.172208 -v -0.415746 0.500000 0.172208 -v -0.450000 -0.500000 -0.000000 -v -0.450000 0.500000 -0.000000 -v -0.415746 -0.500000 -0.172208 -v -0.415746 0.500000 -0.172208 -v -0.318198 -0.500000 -0.318198 -v -0.318198 0.500000 -0.318198 -v -0.172207 -0.500000 -0.415746 -v -0.172207 0.500000 -0.415746 -vt 0.5486 0.5000 -vt 0.5486 1.0000 -vt 0.4725 1.0000 -vt 0.4725 0.5000 -vt 0.4142 1.0000 -vt 0.4142 0.5000 -vt 1.0000 0.5000 -vt 1.0000 1.0000 -vt 0.9239 1.0000 -vt 0.9239 0.5000 -vt 0.8415 1.0000 -vt 0.8415 0.5000 -vt 0.7654 1.0000 -vt 0.7654 0.5000 -vt 0.4142 0.5000 -vt 0.4142 0.0000 -vt 0.4725 0.0000 -vt 0.4725 0.5000 -vt 0.5486 0.0000 -vt 0.5486 0.5000 -vt 0.6310 0.0000 -vt 0.6310 0.5000 -vt 0.7071 0.0000 -vt 0.7071 0.5000 -vt 0.7654 0.0000 -vt 0.7654 0.5000 -vt 0.8415 0.0000 -vt 0.8415 0.5000 -vt 0.9239 0.0000 -vt 0.9239 0.5000 -vt 1.0000 0.0000 -vt 1.0000 0.5000 -vt 0.7654 0.5000 -vt 0.7654 1.0000 -vt 0.7071 1.0000 -vt 0.7071 0.5000 -vt 0.3244 0.4749 -vt 0.3827 0.5370 -vt 0.4142 0.6181 -vt 0.4142 0.7059 -vt 0.3827 0.7870 -vt 0.3244 0.8491 -vt 0.2483 0.8827 -vt 0.1659 0.8827 -vt 0.0898 0.8491 -vt 0.0315 0.7870 -vt 0.0000 0.7059 -vt 0.0000 0.6181 -vt 0.0315 0.5370 -vt 0.0898 0.4749 -vt 0.1659 0.4414 -vt 0.2483 0.4414 -vt 0.6310 1.0000 -vt 0.6310 0.5000 -vt 0.0000 0.2646 -vt 0.0000 0.1768 -vt 0.0315 0.0957 -vt 0.0898 0.0336 -vt 0.1659 0.0000 -vt 0.2483 0.0000 -vt 0.3244 0.0336 -vt 0.3827 0.0957 -vt 0.4142 0.1768 -vt 0.4142 0.2646 -vt 0.3827 0.3457 -vt 0.3244 0.4078 -vt 0.2483 0.4414 -vt 0.1659 0.4414 -vt 0.0898 0.4078 -vt 0.0315 0.3457 -s off -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/7 6/8 8/9 7/10 -f 7/10 8/9 10/11 9/12 -f 9/12 10/11 12/13 11/14 -f 11/15 12/16 14/17 13/18 -f 13/18 14/17 16/19 15/20 -f 15/20 16/19 18/21 17/22 -f 17/22 18/21 20/23 19/24 -f 19/24 20/23 22/25 21/26 -f 21/26 22/25 24/27 23/28 -f 23/28 24/27 26/29 25/30 -f 25/30 26/29 28/31 27/32 -f 27/33 28/34 30/35 29/36 -f 4/37 2/38 32/39 30/40 28/41 26/42 24/43 22/44 20/45 18/46 16/47 14/48 12/49 10/50 8/51 6/52 -f 29/36 30/35 32/53 31/54 -f 31/54 32/53 2/2 1/1 -f 1/55 3/56 5/57 7/58 9/59 11/60 13/61 15/62 17/63 19/64 21/65 23/66 25/67 27/68 29/69 31/70 diff --git a/techage/models/techage_cylinder_12.obj b/techage/models/techage_cylinder_12.obj deleted file mode 100644 index ac86532..0000000 --- a/techage/models/techage_cylinder_12.obj +++ /dev/null @@ -1,124 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'oven.blend' -# www.blender.org -o Cylinder -v 0.000000 -0.500000 -0.600000 -v 0.000000 0.500000 -0.600000 -v 0.229610 -0.500000 -0.554328 -v 0.229610 0.500000 -0.554328 -v 0.424264 -0.500000 -0.424264 -v 0.424264 0.500000 -0.424264 -v 0.554328 -0.500000 -0.229610 -v 0.554328 0.500000 -0.229610 -v 0.600000 -0.500000 0.000000 -v 0.600000 0.500000 0.000000 -v 0.554328 -0.500000 0.229610 -v 0.554328 0.500000 0.229610 -v 0.424264 -0.500000 0.424264 -v 0.424264 0.500000 0.424264 -v 0.229610 -0.500000 0.554328 -v 0.229610 0.500000 0.554328 -v 0.000000 -0.500000 0.600000 -v 0.000000 0.500000 0.600000 -v -0.229610 -0.500000 0.554328 -v -0.229610 0.500000 0.554328 -v -0.424264 -0.500000 0.424264 -v -0.424264 0.500000 0.424264 -v -0.554328 -0.500000 0.229610 -v -0.554328 0.500000 0.229610 -v -0.600000 -0.500000 -0.000000 -v -0.600000 0.500000 -0.000000 -v -0.554328 -0.500000 -0.229610 -v -0.554328 0.500000 -0.229610 -v -0.424264 -0.500000 -0.424264 -v -0.424264 0.500000 -0.424264 -v -0.229610 -0.500000 -0.554328 -v -0.229610 0.500000 -0.554328 -vt 0.5486 0.5000 -vt 0.5486 1.0000 -vt 0.4725 1.0000 -vt 0.4725 0.5000 -vt 0.4142 1.0000 -vt 0.4142 0.5000 -vt 1.0000 0.5000 -vt 1.0000 1.0000 -vt 0.9239 1.0000 -vt 0.9239 0.5000 -vt 0.8415 1.0000 -vt 0.8415 0.5000 -vt 0.7654 1.0000 -vt 0.7654 0.5000 -vt 0.4142 0.5000 -vt 0.4142 0.0000 -vt 0.4725 0.0000 -vt 0.4725 0.5000 -vt 0.5486 0.0000 -vt 0.5486 0.5000 -vt 0.6310 0.0000 -vt 0.6310 0.5000 -vt 0.7071 0.0000 -vt 0.7071 0.5000 -vt 0.7654 0.0000 -vt 0.7654 0.5000 -vt 0.8415 0.0000 -vt 0.8415 0.5000 -vt 0.9239 0.0000 -vt 0.9239 0.5000 -vt 1.0000 0.0000 -vt 1.0000 0.5000 -vt 0.7654 0.5000 -vt 0.7654 1.0000 -vt 0.7071 1.0000 -vt 0.7071 0.5000 -vt 0.3244 0.4749 -vt 0.3827 0.5370 -vt 0.4142 0.6181 -vt 0.4142 0.7059 -vt 0.3827 0.7870 -vt 0.3244 0.8491 -vt 0.2483 0.8827 -vt 0.1659 0.8827 -vt 0.0898 0.8491 -vt 0.0315 0.7870 -vt 0.0000 0.7059 -vt 0.0000 0.6181 -vt 0.0315 0.5370 -vt 0.0898 0.4749 -vt 0.1659 0.4414 -vt 0.2483 0.4414 -vt 0.6310 1.0000 -vt 0.6310 0.5000 -vt 0.0000 0.2646 -vt 0.0000 0.1768 -vt 0.0315 0.0957 -vt 0.0898 0.0336 -vt 0.1659 0.0000 -vt 0.2483 0.0000 -vt 0.3244 0.0336 -vt 0.3827 0.0957 -vt 0.4142 0.1768 -vt 0.4142 0.2646 -vt 0.3827 0.3457 -vt 0.3244 0.4078 -vt 0.2483 0.4414 -vt 0.1659 0.4414 -vt 0.0898 0.4078 -vt 0.0315 0.3457 -s off -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/7 6/8 8/9 7/10 -f 7/10 8/9 10/11 9/12 -f 9/12 10/11 12/13 11/14 -f 11/15 12/16 14/17 13/18 -f 13/18 14/17 16/19 15/20 -f 15/20 16/19 18/21 17/22 -f 17/22 18/21 20/23 19/24 -f 19/24 20/23 22/25 21/26 -f 21/26 22/25 24/27 23/28 -f 23/28 24/27 26/29 25/30 -f 25/30 26/29 28/31 27/32 -f 27/33 28/34 30/35 29/36 -f 4/37 2/38 32/39 30/40 28/41 26/42 24/43 22/44 20/45 18/46 16/47 14/48 12/49 10/50 8/51 6/52 -f 29/36 30/35 32/53 31/54 -f 31/54 32/53 2/2 1/1 -f 1/55 3/56 5/57 7/58 9/59 11/60 13/61 15/62 17/63 19/64 21/65 23/66 25/67 27/68 29/69 31/70 diff --git a/techage/models/techage_cylinder_12h.obj b/techage/models/techage_cylinder_12h.obj deleted file mode 100644 index 0103304..0000000 --- a/techage/models/techage_cylinder_12h.obj +++ /dev/null @@ -1,124 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'oven.blend' -# www.blender.org -o Cylinder -v 0.000000 -0.750000 -0.600000 -v 0.000000 1.0 -0.600000 -v 0.229610 -0.750000 -0.554328 -v 0.229610 1.0 -0.554328 -v 0.424264 -0.750000 -0.424264 -v 0.424264 1.0 -0.424264 -v 0.554328 -0.750000 -0.229610 -v 0.554328 1.0 -0.229610 -v 0.600000 -0.750000 0.000000 -v 0.600000 1.0 0.000000 -v 0.554328 -0.750000 0.229610 -v 0.554328 1.0 0.229610 -v 0.424264 -0.750000 0.424264 -v 0.424264 1.0 0.424264 -v 0.229610 -0.750000 0.554328 -v 0.229610 1.0 0.554328 -v 0.000000 -0.750000 0.600000 -v 0.000000 1.0 0.600000 -v -0.229610 -0.750000 0.554328 -v -0.229610 1.0 0.554328 -v -0.424264 -0.750000 0.424264 -v -0.424264 1.0 0.424264 -v -0.554328 -0.750000 0.229610 -v -0.554328 1.0 0.229610 -v -0.600000 -0.750000 -0.000000 -v -0.600000 1.0 -0.000000 -v -0.554328 -0.750000 -0.229610 -v -0.554328 1.0 -0.229610 -v -0.424264 -0.750000 -0.424264 -v -0.424264 1.0 -0.424264 -v -0.229610 -0.750000 -0.554328 -v -0.229610 1.0 -0.554328 -vt 0.5486 0.5000 -vt 0.5486 1.0000 -vt 0.4725 1.0000 -vt 0.4725 0.5000 -vt 0.4142 1.0000 -vt 0.4142 0.5000 -vt 1.0000 0.5000 -vt 1.0000 1.0000 -vt 0.9239 1.0000 -vt 0.9239 0.5000 -vt 0.8415 1.0000 -vt 0.8415 0.5000 -vt 0.7654 1.0000 -vt 0.7654 0.5000 -vt 0.4142 0.5000 -vt 0.4142 0.0000 -vt 0.4725 0.0000 -vt 0.4725 0.5000 -vt 0.5486 0.0000 -vt 0.5486 0.5000 -vt 0.6310 0.0000 -vt 0.6310 0.5000 -vt 0.7071 0.0000 -vt 0.7071 0.5000 -vt 0.7654 0.0000 -vt 0.7654 0.5000 -vt 0.8415 0.0000 -vt 0.8415 0.5000 -vt 0.9239 0.0000 -vt 0.9239 0.5000 -vt 1.0000 0.0000 -vt 1.0000 0.5000 -vt 0.7654 0.5000 -vt 0.7654 1.0000 -vt 0.7071 1.0000 -vt 0.7071 0.5000 -vt 0.3244 0.4749 -vt 0.3827 0.5370 -vt 0.4142 0.6181 -vt 0.4142 0.7059 -vt 0.3827 0.7870 -vt 0.3244 0.8491 -vt 0.2483 0.8827 -vt 0.1659 0.8827 -vt 0.0898 0.8491 -vt 0.0315 0.7870 -vt 0.0000 0.7059 -vt 0.0000 0.6181 -vt 0.0315 0.5370 -vt 0.0898 0.4749 -vt 0.1659 0.4414 -vt 0.2483 0.4414 -vt 0.6310 1.0000 -vt 0.6310 0.5000 -vt 0.0000 0.2646 -vt 0.0000 0.1768 -vt 0.0315 0.0957 -vt 0.0898 0.0336 -vt 0.1659 0.0000 -vt 0.2483 0.0000 -vt 0.3244 0.0336 -vt 0.3827 0.0957 -vt 0.4142 0.1768 -vt 0.4142 0.2646 -vt 0.3827 0.3457 -vt 0.3244 0.4078 -vt 0.2483 0.4414 -vt 0.1659 0.4414 -vt 0.0898 0.4078 -vt 0.0315 0.3457 -s off -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/7 6/8 8/9 7/10 -f 7/10 8/9 10/11 9/12 -f 9/12 10/11 12/13 11/14 -f 11/15 12/16 14/17 13/18 -f 13/18 14/17 16/19 15/20 -f 15/20 16/19 18/21 17/22 -f 17/22 18/21 20/23 19/24 -f 19/24 20/23 22/25 21/26 -f 21/26 22/25 24/27 23/28 -f 23/28 24/27 26/29 25/30 -f 25/30 26/29 28/31 27/32 -f 27/33 28/34 30/35 29/36 -f 4/37 2/38 32/39 30/40 28/41 26/42 24/43 22/44 20/45 18/46 16/47 14/48 12/49 10/50 8/51 6/52 -f 29/36 30/35 32/53 31/54 -f 31/54 32/53 2/2 1/1 -f 1/55 3/56 5/57 7/58 9/59 11/60 13/61 15/62 17/63 19/64 21/65 23/66 25/67 27/68 29/69 31/70 diff --git a/techage/models/techage_cylinder_14.obj b/techage/models/techage_cylinder_14.obj deleted file mode 100644 index 85c47e8..0000000 --- a/techage/models/techage_cylinder_14.obj +++ /dev/null @@ -1,124 +0,0 @@ -# Blender v2.78 (sub 0) OBJ File: 'oven.blend' -# www.blender.org -o Cylinder -v 0.000000 -0.500000 -0.720000 -v 0.000000 0.500000 -0.720000 -v 0.275532 -0.500000 -0.665194 -v 0.275532 0.500000 -0.665194 -v 0.509117 -0.500000 -0.509117 -v 0.509117 0.500000 -0.509117 -v 0.665194 -0.500000 -0.275532 -v 0.665194 0.500000 -0.275532 -v 0.720000 -0.500000 0.000000 -v 0.720000 0.500000 0.000000 -v 0.665194 -0.500000 0.275532 -v 0.665194 0.500000 0.275532 -v 0.509117 -0.500000 0.509117 -v 0.509117 0.500000 0.509117 -v 0.275532 -0.500000 0.665194 -v 0.275532 0.500000 0.665194 -v 0.000000 -0.500000 0.720000 -v 0.000000 0.500000 0.720000 -v -0.275532 -0.500000 0.665194 -v -0.275532 0.500000 0.665194 -v -0.509117 -0.500000 0.509117 -v -0.509117 0.500000 0.509117 -v -0.665194 -0.500000 0.275532 -v -0.665194 0.500000 0.275532 -v -0.720000 -0.500000 -0.000000 -v -0.720000 0.500000 -0.000000 -v -0.665194 -0.500000 -0.275532 -v -0.665194 0.500000 -0.275532 -v -0.509117 -0.500000 -0.509117 -v -0.509117 0.500000 -0.509117 -v -0.275532 -0.500000 -0.665194 -v -0.275532 0.500000 -0.665194 -vt 0.5486 0.5000 -vt 0.5486 1.0000 -vt 0.4725 1.0000 -vt 0.4725 0.5000 -vt 0.4142 1.0000 -vt 0.4142 0.5000 -vt 1.0000 0.5000 -vt 1.0000 1.0000 -vt 0.9239 1.0000 -vt 0.9239 0.5000 -vt 0.8415 1.0000 -vt 0.8415 0.5000 -vt 0.7654 1.0000 -vt 0.7654 0.5000 -vt 0.4142 0.5000 -vt 0.4142 0.0000 -vt 0.4725 0.0000 -vt 0.4725 0.5000 -vt 0.5486 0.0000 -vt 0.5486 0.5000 -vt 0.6310 0.0000 -vt 0.6310 0.5000 -vt 0.7071 0.0000 -vt 0.7071 0.5000 -vt 0.7654 0.0000 -vt 0.7654 0.5000 -vt 0.8415 0.0000 -vt 0.8415 0.5000 -vt 0.9239 0.0000 -vt 0.9239 0.5000 -vt 1.0000 0.0000 -vt 1.0000 0.5000 -vt 0.7654 0.5000 -vt 0.7654 1.0000 -vt 0.7071 1.0000 -vt 0.7071 0.5000 -vt 0.3244 0.4749 -vt 0.3827 0.5370 -vt 0.4142 0.6181 -vt 0.4142 0.7059 -vt 0.3827 0.7870 -vt 0.3244 0.8491 -vt 0.2483 0.8827 -vt 0.1659 0.8827 -vt 0.0898 0.8491 -vt 0.0315 0.7870 -vt 0.0000 0.7059 -vt 0.0000 0.6181 -vt 0.0315 0.5370 -vt 0.0898 0.4749 -vt 0.1659 0.4414 -vt 0.2483 0.4414 -vt 0.6310 1.0000 -vt 0.6310 0.5000 -vt 0.0000 0.2646 -vt 0.0000 0.1768 -vt 0.0315 0.0957 -vt 0.0898 0.0336 -vt 0.1659 0.0000 -vt 0.2483 0.0000 -vt 0.3244 0.0336 -vt 0.3827 0.0957 -vt 0.4142 0.1768 -vt 0.4142 0.2646 -vt 0.3827 0.3457 -vt 0.3244 0.4078 -vt 0.2483 0.4414 -vt 0.1659 0.4414 -vt 0.0898 0.4078 -vt 0.0315 0.3457 -s off -f 1/1 2/2 4/3 3/4 -f 3/4 4/3 6/5 5/6 -f 5/7 6/8 8/9 7/10 -f 7/10 8/9 10/11 9/12 -f 9/12 10/11 12/13 11/14 -f 11/15 12/16 14/17 13/18 -f 13/18 14/17 16/19 15/20 -f 15/20 16/19 18/21 17/22 -f 17/22 18/21 20/23 19/24 -f 19/24 20/23 22/25 21/26 -f 21/26 22/25 24/27 23/28 -f 23/28 24/27 26/29 25/30 -f 25/30 26/29 28/31 27/32 -f 27/33 28/34 30/35 29/36 -f 4/37 2/38 32/39 30/40 28/41 26/42 24/43 22/44 20/45 18/46 16/47 14/48 12/49 10/50 8/51 6/52 -f 29/36 30/35 32/53 31/54 -f 31/54 32/53 2/2 1/1 -f 1/55 3/56 5/57 7/58 9/59 11/60 13/61 15/62 17/63 19/64 21/65 23/66 25/67 27/68 29/69 31/70 \ No newline at end of file diff --git a/techage/models/techage_rotor.b3d b/techage/models/techage_rotor.b3d deleted file mode 100644 index afd8f0c..0000000 Binary files a/techage/models/techage_rotor.b3d and /dev/null differ diff --git a/techage/move_controller/doorblock.lua b/techage/move_controller/doorblock.lua deleted file mode 100644 index 6874479..0000000 --- a/techage/move_controller/doorblock.lua +++ /dev/null @@ -1,108 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Door block - -]]-- - -local M = minetest.get_meta -local S = techage.S - --- See also gateblock!!! -local NUM_TEXTURES = 22 - -local sTextures = "Wood,Aspen Wood,Jungle Wood,Pine Wood,".. - "Cobblestone,Sandstone,Stone,Desert Sandstone,".. - "Desert Stone,Silver Sandstone,Mossy Cobble,Desert Cobble,".. - "Copper,Steel,Tin,Coral,".. - "Glas,Obsidian Glas,Basalt Glass,Basalt Glass 2,".. - "Ice,Gate Wood" - -local tTextures = { - ["Wood"]=1, ["Aspen Wood"]=2, ["Jungle Wood"]=3, ["Pine Wood"]=4, - ["Cobblestone"]=5, ["Sandstone"]=6, ["Stone"]=7, ["Desert Sandstone"]=8, - ["Desert Stone"]=9, ["Silver Sandstone"]=10, ["Mossy Cobble"]=11, ["Desert Cobble"]=12, - ["Copper"]=13, ["Steel"]=14, ["Tin"]=15, ["Coral"]=16, - ["Glas"]=17, ["Obsidian Glas"]=18, ["Basalt Glass"]=19, ["Basalt Glass 2"]=20, - ["Ice"]=21, ["Gate Wood"]=22, -} - -local tPgns = {"default_wood.png", "default_aspen_wood.png", "default_junglewood.png", "default_pine_wood.png", - "default_cobble.png", "default_sandstone.png", "default_stone.png", "default_desert_sandstone.png", - "default_desert_stone_block.png", "default_silver_sandstone.png", "default_mossycobble.png", "default_desert_cobble.png", - "default_copper_block.png", "default_steel_block.png", "default_tin_block.png", "default_coral_skeleton.png", - "default_glass.png", "default_obsidian_glass.png", "techage_basalt_glass.png", "techage_basalt_glass2.png", - "default_ice.png", "techage_gate.png"} - -for idx,pgn in ipairs(tPgns) do - minetest.register_node("techage:doorblock"..idx, { - description = S("TechAge Door Block"), - tiles = { - pgn.."^[transformR90", - pgn, - pgn.."^[transformR90", - pgn.."^[transformR90", - pgn, - pgn.."^[transformFX", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, -1/16, 8/16, 8/16, 1/16}, - }, - }, - - after_place_node = function(pos, placer) - M(pos):set_string("formspec", "size[3,2]".. - "label[0,0;Select texture]".. - "dropdown[0,0.5;3;type;"..sTextures..";"..NUM_TEXTURES.."]".. - "button_exit[0.5,1.5;2,1;exit;Save]") - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - if fields.type then - node.name = "techage:doorblock"..tTextures[fields.type] - minetest.swap_node(pos, node) - end - if fields.exit then - meta:set_string("formspec", "") - local number = techage.add_node(pos, node.name) - meta:set_string("infotext", S("TechAge Door Block").." "..number) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - paramtype2 = "facedir", - use_texture_alpha = techage.BLEND, - sunlight_propagates = true, - sounds = default.node_sound_stone_defaults(), - groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, - not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, - is_ground_content = false, - drop = "techage:doorblock"..NUM_TEXTURES, - }, - techage.register_node({"techage:doorblock"..idx}, {})) -end - -minetest.register_craft({ - output = "techage:doorblock"..NUM_TEXTURES, - recipe = { - {"techage:basalt_glass_thin", "", ""}, - {"default:mese_crystal_fragment", "",""}, - {"group:wood", "", ""}, - }, -}) diff --git a/techage/move_controller/doorcontroller.lua b/techage/move_controller/doorcontroller.lua deleted file mode 100644 index 2b99ad7..0000000 --- a/techage/move_controller/doorcontroller.lua +++ /dev/null @@ -1,147 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Door/Gate Controller - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic - -local function formspec(meta) - local numbers = meta:get_string("numbers") or "" - return "size[7.5,3]".. - "field[0.5,1;7,1;numbers;"..S("Insert door/gate block number(s)")..";"..numbers.."]" .. - "button_exit[2,2;3,1;exit;"..S("Save").."]" -end - -local function store_door_data(pos) - local nvm = techage.get_nvm(pos) - nvm.door_state = false - local numbers = M(pos):get_string("numbers") - nvm.door_blocks = {} - for _,num in ipairs(string.split(numbers, " ")) do - local info = techage.get_node_info(num) - if info and info.pos then - local node = techage.get_node_lvm(info.pos) - table.insert(nvm.door_blocks, {pos = info.pos, name = node.name, param2 = node.param2}) - end - end -end - -local function swap_door_nodes(pos, open) - local nvm = techage.get_nvm(pos) - if nvm.door_state ~= open then - nvm.door_state = open - for _,item in ipairs(nvm.door_blocks or {}) do - if item.pos and item.name and item.param2 then - local node = techage.get_node_lvm(item.pos) - if open then - if node.name == item.name then - minetest.remove_node(item.pos) - item.removed = true - else - item.removed = false - end - elseif techage.is_air_like(node.name) and item.removed then - minetest.add_node(item.pos, {name = item.name, param2 = item.param2}) - end - end - end - end -end - -minetest.register_node("techage:ta3_doorcontroller", { - description = S("TA3 Door Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_doorcontroller.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local mem = techage.get_mem(pos) - logic.after_place_node(pos, placer, "techage:ta3_doorcontroller", S("TA3 Door Controller")) - logic.infotext(meta, S("TA3 Door Controller")) - meta:set_string("formspec", formspec(meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - if techage.check_numbers(fields.numbers, player:get_player_name()) then - swap_door_nodes(pos, false) - meta:set_string("numbers", fields.numbers) - logic.infotext(M(pos), S("TA3 Door Controller")) - meta:set_string("formspec", formspec(meta)) - store_door_data(pos) - end - end, - - techage_set_numbers = function(pos, numbers, player_name) - local meta = M(pos) - local res = logic.set_numbers(pos, numbers, player_name, S("TA3 Door Controller")) - if res then - swap_door_nodes(pos, false) - meta:set_string("formspec", formspec(meta)) - store_door_data(pos) - end - return res - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - swap_door_nodes(pos, false) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:ta3_doorcontroller"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - swap_door_nodes(pos, true) - elseif topic == "off" then - swap_door_nodes(pos, false) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - swap_door_nodes(pos, true) - return 0 - elseif topic == 1 and payload[1] == 0 then - swap_door_nodes(pos, false) - return 0 - else - return 2 - end - end, -}) - -minetest.register_craft({ - output = "techage:ta3_doorcontroller", - recipe = { - {"", "group:wood",""}, - {"techage:vacuum_tube", "", "default:mese_crystal_fragment"}, - {"", "group:wood", ""}, - }, -}) diff --git a/techage/move_controller/doorcontroller2.lua b/techage/move_controller/doorcontroller2.lua deleted file mode 100644 index 7804314..0000000 --- a/techage/move_controller/doorcontroller2.lua +++ /dev/null @@ -1,636 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Door/Gate Controller II - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S = techage.S - -local logic = techage.logic -local fly = techage.flylib - -local NUMSLOTS = 16 - -local MarkedNodes = {} -- t[player] = {{entity, pos},...} -local CurrentPos -- to mark punched entities - --------------------------------------------------------------------------- --- helper functions --------------------------------------------------------------------------- -local function count_nodes(tbl, name) - if tbl[name] then - tbl[name] = tbl[name] + 1 - else - tbl[name] = 1 - end -end - -local function take_node(tbl, name) - if tbl[name] and tbl[name] > 0 then - tbl[name] = tbl[name] - 1 - return true - end -end - -local function next_node(tbl) - return function(tbl) - local name, cnt = next(tbl) - if cnt and cnt > 0 then - cnt = cnt - 1 - if cnt == 0 then - tbl[name] = nil - else - tbl[name] = cnt - end - return name - end - end, tbl -end - -local function get_new_nodename(item) - local name = item:get_name() - if name == "" then - return "air" - end - return name -end - -local function get_node_name(nvm, slot) - nvm.pos_list = nvm.pos_list or {} - local pos = nvm.pos_list[slot] - if pos then - return techage.get_node_lvm(pos).name - end - return "unknown" -end - -local function is_simple_node(name) - local ndef = minetest.registered_nodes[name] - return name ~= "air" and techage.can_dig_node(name, ndef) -end - --------------------------------------------------------------------------- --- Marker --------------------------------------------------------------------------- -local function unmark_position(name, pos) - pos = vector.round(pos) - for idx,item in ipairs(MarkedNodes[name] or {}) do - if vector.equals(pos, item.pos) then - item.entity:remove() - table.remove(MarkedNodes[name], idx) - CurrentPos = pos - return - end - end -end - -local function unmark_all(name) - for _,item in ipairs(MarkedNodes[name] or {}) do - item.entity:remove() - end - MarkedNodes[name] = nil -end - -local function mark_position(name, pos) - MarkedNodes[name] = MarkedNodes[name] or {} - pos = vector.round(pos) - if not CurrentPos or not vector.equals(pos, CurrentPos) then -- entity not punched? - local entity = minetest.add_entity(pos, "techage:marker") - if entity ~= nil then - entity:get_luaentity().player_name = name - table.insert(MarkedNodes[name], {pos = pos, entity = entity}) - end - CurrentPos = nil - return true - end - CurrentPos = nil -end - -local function get_poslist(name) - local lst = {} - for _,item in ipairs(MarkedNodes[name] or {}) do - table.insert(lst, item.pos) - end - return lst -end - -minetest.register_entity(":techage:marker", { - initial_properties = { - visual = "cube", - textures = { - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - "techage_cube_mark.png", - }, - physical = false, - visual_size = {x = 1.1, y = 1.1}, - collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, - glow = 8, - }, - on_step = function(self, dtime) - self.ttl = (self.ttl or 2400) - 1 - if self.ttl <= 0 then - local pos = self.object:get_pos() - unmark_position(self.player_name, pos) - end - end, - on_punch = function(self, hitter) - local pos = self.object:get_pos() - local name = hitter:get_player_name() - if name == self.player_name then - unmark_position(name, pos) - end - end, -}) - --------------------------------------------------------------------------- --- formspec --------------------------------------------------------------------------- -local function formspec1(nvm, meta) - local status = meta:get_string("status") - local play_sound = dump(nvm.play_sound or false) - return "size[8,7]".. - "tabheader[0,0;tab;"..S("Ctrl,Inv")..";1;;true]".. - "button[0.7,0.2;3,1;record;"..S("Record").."]".. - "button[4.3,0.2;3,1;ready;"..S("Done").."]".. - "button[0.7,1.2;3,1;reset;"..S("Reset").."]".. - "button[4.3,1.2;3,1;exchange;"..S("Exchange").."]".. - "checkbox[4.3,2.1;play_sound;"..S("with door sound")..";"..play_sound.."]".. - "label[0.5,2.3;"..status.."]".. - "list[current_player;main;0,3.3;8,4;]" -end - -local function formspec2() - return "size[8,7]".. - "tabheader[0,0;tab;"..S("Ctrl,Inv")..";2;;true]".. - "label[0.3,0.0;1]".. - "label[7.3,0.0;8]".. - "label[0.3,2.4;9]".. - "label[7.3,2.4;16]".. - "list[context;main;0,0.5;8,2;]".. - "list[current_player;main;0,3.3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -local function play_sound(pos) - minetest.sound_play("techage_button", { - pos = pos, - gain = 1, - max_hear_distance = 15}) -end - --------------------------------------------------------------------------- --- Configuration --------------------------------------------------------------------------- --- Store the current state of inventory and placed nodes -local function store_config(pos, nvm) - local meta = M(pos) - local inv = meta:get_inventory() - local item_list = inv:get_list("main") - local nodes = {exp_nodes = {}, inv_nodes = {}} - - nvm.pos_list = nvm.pos_list or {} - nvm.param2_list = nvm.param2_list or {} - - for idx = 1, NUMSLOTS do - local pos = nvm.pos_list[idx] - - if pos then - local param2 = nvm.param2_list[idx] or 0 - local item = item_list[idx] - if item and item:get_count() > 0 then - nodes.inv_nodes[idx] = {name = item:get_name(), param2 = param2} - end - - local node = techage.get_node_lvm(pos) - if is_simple_node(node.name) or node.name == "air" then - nodes.exp_nodes[idx] = techage.get_node_lvm(pos) - end - end - end - meta:set_string("stored_config", minetest.serialize(nodes)) -end - --- Generate a table of currently available inventory and placed nodes -local function available_nodes(pos, nvm, item_list) - local nodes = {} - nvm.pos_list = nvm.pos_list or {} - - for idx = 1, NUMSLOTS do - local item = item_list[idx] - if item and item:get_count() > 0 then - count_nodes(nodes, item:get_name()) - end - - local pos = nvm.pos_list[idx] - if pos then - local node = techage.get_node_lvm(pos) - if is_simple_node(node.name) then - count_nodes(nodes, node.name) - end - end - end - return nodes -end - -local function restore_config(pos, nvm) - local meta = M(pos) - local inv = meta:get_inventory() - local item_list = inv:get_list("main") - local stock = available_nodes(pos, nvm, item_list) - local nodes = minetest.deserialize(meta:get_string("stored_config")) or {} - nvm.pos_list = nvm.pos_list or {} - - inv:set_list("main", {}) - item_list = inv:get_list("main") - - for idx, node in pairs(nodes.inv_nodes or {}) do - if take_node(stock, node.name) then - item_list[idx] = ItemStack(node.name) - end - end - inv:set_list("main", item_list) - - for idx, node in pairs(nodes.exp_nodes or {}) do - local pos = nvm.pos_list[idx] - if take_node(stock, node.name) then - local param2 = nvm.param2_list[idx] or 0 - fly.exchange_node(pos, node.name, param2) - nvm.expected_nodenames[idx] = node.name - else - fly.remove_node(pos) - nvm.expected_nodenames[idx] = "air" - end - end - - for name in next_node(stock) do - inv:add_item("main", ItemStack(name)) - end - - return true -end - --------------------------------------------------------------------------- --- Exchange nodes --------------------------------------------------------------------------- -local function exchange_node(pos, item, param2) - local node = minetest.get_node_or_nil(pos) - if node and (is_simple_node(node.name) or node.name == "air") then - if item and is_simple_node(item:get_name()) then - fly.exchange_node(pos, item:get_name(), param2) - else - fly.remove_node(pos) - end - if not techage.is_air_like(node.name) then - return ItemStack(node.name), node.param2 - else - return ItemStack(), param2 - end - end - return item, param2 -end - -local function expected_node(pos, nvm, idx, force, new_nodename) - local expected_name = force and nvm.expected_nodenames[idx] or nil - if expected_name then - local node = techage.get_node_lvm(pos) - if expected_name == node.name then - nvm.expected_nodenames[idx] = new_nodename - return true - else - return false - end - end - nvm.expected_nodenames[idx] = new_nodename - return true -end - -local function exchange_nodes(pos, nvm, slot, force) - local meta = M(pos) - local inv = meta:get_inventory() - - local item_list = inv:get_list("main") - local res = false - nvm.pos_list = nvm.pos_list or {} - nvm.param2_list = nvm.param2_list or {} - nvm.expected_nodenames = nvm.expected_nodenames or {} - - for idx = (slot or 1), (slot or NUMSLOTS) do - local pos = nvm.pos_list[idx] - local item = item_list[idx] - if pos then - if (force == nil) - or (force == "exch") - or (force == "dig" and item:get_count() == 0) - or (force == "set" and item:get_count() > 0) then - if expected_node(pos, nvm, idx, force, get_new_nodename(item)) then - item_list[idx], nvm.param2_list[idx] = exchange_node(pos, item, nvm.param2_list[idx]) - end - res = true - end - end - end - - inv:set_list("main", item_list) - return res -end - -local function show_nodes(pos) - local nvm = techage.get_nvm(pos) - if not nvm.is_on then - nvm.is_on = true - if nvm.play_sound then - minetest.sound_play("doors_door_close", { - pos = pos, - gain = 1, - max_hear_distance = 15}) - end - return exchange_nodes(pos, nvm) - end -end - -local function hide_nodes(pos) - local nvm = techage.get_nvm(pos) - if nvm.is_on then - nvm.is_on = false - if nvm.play_sound then - minetest.sound_play("doors_door_open", { - pos = pos, - gain = 1, - max_hear_distance = 15}) - end - return exchange_nodes(pos, nvm) - end -end - -local function exch_nodes(pos) - local nvm = techage.get_nvm(pos) - if nvm.play_sound then - minetest.sound_play("doors_door_open", { - pos = pos, - gain = 1, - max_hear_distance = 15}) - end - return exchange_nodes(pos, nvm) -end - -minetest.register_node("techage:ta3_doorcontroller2", { - description = S("TA3 Door Controller II"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_doorcontroller.png", - }, - - after_place_node = function(pos, placer, itemstack) - local meta = M(pos) - local inv = meta:get_inventory() - inv:set_size('main', NUMSLOTS) - logic.after_place_node(pos, placer, "techage:ta3_doorcontroller2", S("TA3 Door Controller II")) - logic.infotext(meta, S("TA3 Door Controller II")) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec1(nvm, meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if fields.tab == "2" then - meta:set_string("formspec", formspec2(meta)) - return - elseif fields.tab == "1" then - meta:set_string("formspec", formspec1(nvm, meta)) - return - elseif fields.record then - local inv = meta:get_inventory() - nvm.pos_list = {} - meta:set_string("status", S("Recording...")) - local name = player:get_player_name() - minetest.chat_send_player(name, S("Click on all the blocks that are part of the door/gate")) - nvm.expected_nodenames = {} - MarkedNodes[name] = {} - meta:set_string("stored_config", "") - meta:set_string("formspec", formspec1(nvm, meta)) - elseif fields.ready then - local name = player:get_player_name() - local pos_list = get_poslist(name) - local text = #pos_list.." "..S("block positions are stored.") - meta:set_string("status", text) - nvm.pos_list = pos_list - nvm.expected_nodenames = {} - unmark_all(name) - meta:set_string("stored_config", "") - meta:set_string("formspec", formspec1(nvm, meta)) - elseif fields.exchange then - if exch_nodes(pos) then - store_config(pos, nvm) - meta:set_string("status", S("Blocks exchanged")) - meta:set_string("formspec", formspec1(nvm, meta)) - local name = player:get_player_name() - MarkedNodes[name] = nil - end - elseif fields.reset then - restore_config(pos, nvm) - meta:set_string("status", S("Blocks reset")) - meta:set_string("formspec", formspec1(nvm, meta)) - local name = player:get_player_name() - MarkedNodes[name] = nil - elseif fields.play_sound then - nvm.play_sound = fields.play_sound == "true" - meta:set_string("formspec", formspec1(nvm, meta)) - end - end, - - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return 1 - end, - allow_metadata_inventory_take = function(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return 1 - end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if is_simple_node(stack:get_name()) then - return 1 - end - return 0 - end, - - can_dig = function(pos, player) - if player and minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - - local inv = minetest.get_inventory({type="node", pos=pos}) - return inv:is_empty("main") - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local name = digger:get_player_name() - unmark_all(name) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:ta3_doorcontroller2"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "on" then - return hide_nodes(pos) - elseif topic == "off" then - return show_nodes(pos) - elseif topic == "exchange" then - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, tonumber(payload), "exch") - elseif topic == "set" then - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, tonumber(payload), "set") - elseif topic == "dig" then - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, tonumber(payload), "dig") - elseif topic == "get" then - local nvm = techage.get_nvm(pos) - return get_node_name(nvm, tonumber(payload)) - elseif topic == "reset" then - local nvm = techage.get_nvm(pos) - return restore_config(pos, nvm) - end - return false - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - if topic == 1 and payload[1] == 1 then - return hide_nodes(pos) and 0 or 3 - elseif topic == 1 and payload[1] == 0 then - return show_nodes(pos) and 0 or 3 - elseif topic == 9 and payload[1] == 0 then -- Exchange Block - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, payload[2] or 1, "exch") and 0 or 3 - elseif topic == 9 and payload[1] == 1 then -- Set Block - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, payload[2] or 1, "set") and 0 or 3 - elseif topic == 9 and payload[1] == 2 then -- Dig Block - local nvm = techage.get_nvm(pos) - return exchange_nodes(pos, nvm, payload[2] or 1, "dig") and 0 or 3 - elseif topic == 9 and payload[1] == 3 then -- reset - local nvm = techage.get_nvm(pos) - return restore_config(pos, nvm) and 0 or 3 - end - return 2 - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 147 then -- Get Name - local nvm = techage.get_nvm(pos) - return 0, get_node_name(nvm, payload[1] or 1) - end - return 2, "" - end, - on_node_load = function(pos) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - meta:set_string("status", "") - meta:set_string("formspec", formspec1(nvm, meta)) - local pos_list = minetest.deserialize(meta:get_string("pos_list")) - if pos_list then - nvm.pos_list = pos_list - meta:set_string("pos_list", "") - local inv = meta:get_inventory() - if inv:is_empty("main") then - nvm.is_on = true - end - end - local param2_list = minetest.deserialize(meta:get_string("param2_list")) - if param2_list then - nvm.param2_list = param2_list - meta:set_string("param2_list", "") - end - end, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:ta3_doorcontroller2", - recipe = {"techage:ta3_doorcontroller"}, -}) - -minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) - if puncher and puncher:is_player() then - local name = puncher:get_player_name() - - if not MarkedNodes[name] then - return - end - - if not minetest.is_protected(pointed_thing.under, name) then - mark_position(name, pointed_thing.under) - end - end -end) - -local Doors = { - "doors:door_steel", - "doors:prison_door", - "doors:rusty_prison_door", - "doors:trapdoor_steel", - "doors:door_glass", - "doors:door_obsidian_glass", - "doors:japanese_door", - "doors:screen_door", - "doors:slide_door", - "doors:trapdoor", - "doors:woodglass_door", - "xpanes:door_steel_bar", - "xpanes:trapdoor_steel_bar", -} - -for _, name in ipairs(Doors) do - for _, postfix in ipairs({"a", "b", "c", "d"}) do - techage.register_simple_nodes({name .. "_" .. postfix}, true) - fly.protect_door_from_being_opened(name .. "_" .. postfix) - end -end - -local ProtectorDoors = { - "protector:door_steel", - "protector:door_wood", - "protector:trapdoor", - "protector:trapdoor_steel", -} - -for _, name in ipairs(ProtectorDoors) do - for _, postfix in ipairs({"b_1", "b_2", "t_1", "t_2"}) do - techage.register_simple_nodes({name .. "_" .. postfix}, true) - fly.protect_door_from_being_opened(name .. "_" .. postfix) - end -end diff --git a/techage/move_controller/flycontroller.lua b/techage/move_controller/flycontroller.lua deleted file mode 100644 index 70a21b3..0000000 --- a/techage/move_controller/flycontroller.lua +++ /dev/null @@ -1,271 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 Fly Controller - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local S = techage.S - -local MP = minetest.get_modpath("techage") -local mark = dofile(MP .. "/basis/mark_lib.lua") -local fly = techage.flylib - -local MAX_DIST = 1500 -local MAX_BLOCKS = 32 -local EX_POINTS = 40 - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "0.5,1,2,4,6,8", - name = "max_speed", - label = S("Maximum Speed"), - tooltip = S("Maximum speed for moving blocks"), - default = "8", - }, - { - type = "float", - name = "height", - label = S("Move block height"), - tooltip = S("Value in the range of 0.0 to 1.0"), - default = "1.0", - }, - { - type = "float", - name = "offset", - label = S("Object offset"), - tooltip = S("Y-offset for non-player objects like vehicles (-0.5 to 0.5)"), - default = "0.0", - }, - { - type = "dropdown", - choices = "disable,enable", - name = "teleport_mode", - label = S("Teleport mode"), - tooltip = S("Move a player without moving blocks"), - default = "disable", - }, -} - -local function formspec(nvm, meta) - local status = meta:get_string("status") - local path = minetest.formspec_escape(meta:contains("fs_path") and meta:get_string("fs_path") or - meta:contains("path") and meta:get_string("path") or "0,3,0") - return "size[8,6.7]" .. - "style_type[textarea;font=mono;textcolor=#FFFFFF;border=true]" .. - "box[0,-0.1;7.2,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("TA5 Fly Controller")) .. "]" .. - techage.wrench_image(7.4, -0.05) .. - "button[0.1,0.7;3.8,1;record;" .. S("Record") .. "]" .. - "button[4.1,0.7;3.8,1;done;" .. S("Done") .. "]" .. - "textarea[0.4,2.1;3.8,4.4;path;" .. S("Flight route (A to B)") .. ";"..path.."]" .. - "button[4.1,1.8;3.8,1;store;" .. S("Store") .. "]" .. - "button[4.1,2.6;3.8,1;test;" .. S("Test") .. "]" .. - "button[4.1,3.4;3.8,1;moveAB;" .. S("Move A-B") .. "]" .. - "button[4.1,4.2;3.8,1;moveBA;" .. S("Move B-A") .. "]" .. - "button[4.1,5.0;3.8,1;move;" .. S("Move") .. "]" .. - "label[0.3,6.3;" .. status .. "]" -end - -minetest.register_node("techage:ta5_flycontroller", { - description = S("TA5 Fly Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_movecontroller.png", - }, - - after_place_node = function(pos, placer, itemstack) - local meta = M(pos) - techage.logic.after_place_node(pos, placer, "techage:ta5_flycontroller", S("TA5 Fly Controller")) - techage.logic.infotext(meta, S("TA5 Fly Controller")) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(nvm, meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if techage.get_expoints(player) < EX_POINTS then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if fields.record then - nvm.lpos1 = {} - nvm.lpos2 = {} - nvm.moveBA = false - nvm.running = nil - meta:set_string("status", S("Recording...")) - local name = player:get_player_name() - minetest.chat_send_player(name, S("Click on all blocks that shall be moved")) - mark.start(name, MAX_BLOCKS) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.done then - local name = player:get_player_name() - local pos_list = mark.get_poslist(name) - local _, err = fly.to_path(fields.path, MAX_DIST) - if not err then - meta:set_string("fs_path", fields.path) - meta:set_string("path", fields.path) - end - nvm.running = nil - local text = #pos_list.." "..S("block positions are stored.") - meta:set_string("status", text) - nvm.lpos1 = pos_list - mark.unmark_all(name) - mark.stop(name) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.store then - local _, err = fly.to_path(fields.path, MAX_DIST) - if not err then - meta:set_string("path", fields.path) - meta:set_string("fs_path", fields.path) - meta:set_string("status", S("Stored")) - else - meta:set_string("path", "0,0,0") - meta:set_string("fs_path", fields.path) - meta:set_string("status", err) - end - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - nvm.moveBA = false - nvm.running = nil - elseif fields.test then - local path, err = fly.to_path(fields.path, MAX_DIST) - if err then - meta:set_string("status", err) - elseif path and nvm.lpos1 and nvm.lpos1[1] then - local pos = table.copy(nvm.lpos1[1]) - if pos then - for _, offs in ipairs(path) do - local pos2 = vector.add(pos, offs) - local s = string.format("[TA4 Fly Controller] %s + %s = %s", P2S(pos), P2S(offs), P2S(pos2)) - minetest.chat_send_player(player:get_player_name(), s) - pos = pos2 - end - meta:set_string("status", S("See chat output")) - else - minetest.chat_send_player(player:get_player_name(), S("[TA4 Fly Controller] Recording is missing!")) - meta:set_string("status", S("Error: Recording is missing !!")) - end - else - if nvm.lpos1 then - minetest.chat_send_player(player:get_player_name(), S("[TA4 Fly Controller] Invalid path!")) - meta:set_string("status", S("Error: Invalid path !!")) - else - minetest.chat_send_player(player:get_player_name(), S("[TA4 Fly Controller] Recording is missing!")) - meta:set_string("status", S("Error: Recording is missing !!")) - end - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.moveAB then - meta:set_string("status", "") - if fly.move_to_other_pos(pos, false) then - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.moveBA then - meta:set_string("status", "") - if fly.move_to_other_pos(pos, true) then - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.move then - meta:set_string("status", "") - if fly.move_to_other_pos(pos, nvm.moveBA) then - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - end - meta:set_string("formspec", formspec(nvm, meta)) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local name = digger:get_player_name() - mark.unmark_all(name) - mark.stop(name) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta5_formspec = {menu=WRENCH_MENU, ex_points=EX_POINTS}, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -local INFO = [[Commands: 'state', 'a2b', 'b2a', 'move']] - -techage.register_node({"techage:ta5_flycontroller"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "info" then - return INFO - elseif topic == "state" then - return nvm.running and "running" or "stopped" - elseif topic == "a2b" then - return fly.move_to_other_pos(pos, false) - elseif topic == "b2a" then - return fly.move_to_other_pos(pos, true) - elseif topic == "move" then - return fly.move_to_other_pos(pos, nvm.moveBA) - end - return false - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 11 then - if payload[1] == 1 then - return fly.move_to_other_pos(pos, false) and 0 or 3 - elseif payload[1] == 2 then - return fly.move_to_other_pos(pos, true) and 0 or 3 - elseif payload[1] == 3 then - return fly.move_to_other_pos(pos, nvm.moveBA) and 0 or 3 - end - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 129 then - return 0, {nvm.running and 1 or 6} - end - return 2, "" - end, - on_node_load = function(pos, node) - M(pos):set_string("status", "") - end, -}) - -minetest.register_craft({ - output = "techage:ta5_flycontroller", - recipe = { - {"default:steel_ingot", "dye:red", "default:steel_ingot"}, - {"techage:aluminum", "techage:ta5_aichip", "techage:aluminum"}, - {"group:wood", "basic_materials:gear_steel", "group:wood"}, - }, -}) diff --git a/techage/move_controller/gateblock.lua b/techage/move_controller/gateblock.lua deleted file mode 100644 index 57f6826..0000000 --- a/techage/move_controller/gateblock.lua +++ /dev/null @@ -1,94 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Gate Block to disappear - -]]-- - -local M = minetest.get_meta -local S = techage.S - --- See also doorblock!!! -local NUM_TEXTURES = 22 - -local sTextures = "Wood,Aspen Wood,Jungle Wood,Pine Wood,".. - "Cobblestone,Sandstone,Stone,Desert Sandstone,".. - "Desert Stone,Silver Sandstone,Mossy Cobble,Desert Cobble,".. - "Copper,Steel,Tin,Coral,".. - "Glas,Obsidian Glas,Basalt Glass,Basalt Glass 2,".. - "Ice,Gate Wood" - -local tTextures = { - ["Wood"]=1, ["Aspen Wood"]=2, ["Jungle Wood"]=3, ["Pine Wood"]=4, - ["Cobblestone"]=5, ["Sandstone"]=6, ["Stone"]=7, ["Desert Sandstone"]=8, - ["Desert Stone"]=9, ["Silver Sandstone"]=10, ["Mossy Cobble"]=11, ["Desert Cobble"]=12, - ["Copper"]=13, ["Steel"]=14, ["Tin"]=15, ["Coral"]=16, - ["Glas"]=17, ["Obsidian Glas"]=18, ["Basalt Glass"]=19, ["Basalt Glass 2"]=20, - ["Ice"]=21, ["Gate Wood"]=22, -} - -local tPgns = {"default_wood.png", "default_aspen_wood.png", "default_junglewood.png", "default_pine_wood.png", - "default_cobble.png", "default_sandstone.png", "default_stone.png", "default_desert_sandstone.png", - "default_desert_stone_block.png", "default_silver_sandstone.png", "default_mossycobble.png", "default_desert_cobble.png", - "default_copper_block.png", "default_steel_block.png", "default_tin_block.png", "default_coral_skeleton.png", - "default_glass.png", "default_obsidian_glass.png", "techage_basalt_glass.png", "techage_basalt_glass2.png", - "default_ice.png", "techage_gate.png"} - -for idx,pgn in ipairs(tPgns) do - minetest.register_node("techage:gateblock"..idx, { - description = S("TechAge Gate Block"), - tiles = {pgn}, - drawtype = "glasslike", - after_place_node = function(pos, placer) - M(pos):set_string("formspec", "size[3,2]".. - "label[0,0;Select texture]".. - "dropdown[0,0.5;3;type;"..sTextures..";"..NUM_TEXTURES.."]".. - "button_exit[0.5,1.5;2,1;exit;Save]") - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - if fields.type then - node.name = "techage:gateblock"..tTextures[fields.type] - minetest.swap_node(pos, node) - end - if fields.exit then - meta:set_string("formspec", "") - local number = techage.add_node(pos, node.name) - meta:set_string("infotext", S("TechAge Gate Block").." "..number) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - paramtype2 = "facedir", - use_texture_alpha = techage.BLEND, - sunlight_propagates = true, - sounds = default.node_sound_stone_defaults(), - groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, - not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, - is_ground_content = false, - drop = "techage:gateblock"..NUM_TEXTURES, - }, - techage.register_node({"techage:gateblock"..idx}, {})) -end - -minetest.register_craft({ - output = "techage:gateblock"..NUM_TEXTURES, - recipe = { - {"techage:basalt_glass", "", ""}, - {"default:mese_crystal_fragment", "",""}, - {"group:wood", "", ""}, - }, -}) diff --git a/techage/move_controller/movecontroller.lua b/techage/move_controller/movecontroller.lua deleted file mode 100644 index 5f7ce00..0000000 --- a/techage/move_controller/movecontroller.lua +++ /dev/null @@ -1,335 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Move Controller - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local S = techage.S - -local MP = minetest.get_modpath("techage") -local mark = dofile(MP .. "/basis/mark_lib.lua") -local fly = techage.flylib - -local MAX_DIST = 200 -local MAX_BLOCKS = 16 - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "0.5,1,2,4,6,8", - name = "max_speed", - label = S("Maximum Speed"), - tooltip = S("Maximum speed for moving blocks"), - default = "8", - }, - { - type = "float", - name = "height", - label = S("Move block height"), - tooltip = S("Value in the range of 0.0 to 1.0"), - default = "1.0", - }, - { - type = "float", - name = "offset", - label = S("Object offset"), - tooltip = S("Y-offset for non-player objects like vehicles (-0.5 to 0.5)"), - default = "0.0", - }, - { - type = "dropdown", - choices = "A-B / B-A,move xyz", - name = "opmode", - label = S("Operational mode"), - tooltip = S("Switch to the remote controlled 'move xyz' mode"), - default = "A-B / B-A", - }, -} - -local function formspec(nvm, meta) - local status = meta:get_string("status") - local path = minetest.formspec_escape(meta:contains("path") and meta:get_string("path") or "0,3,0") - local buttons - if meta:get_string("opmode") == "move xyz" then - buttons = "field[0.4,2.5;3.8,1;path;" .. S("Move distance") .. ";" .. path .. "]" .. - "button_exit[4.1,2.2;3.8,1;move2;" .. S("Move") .. "]" .. - "button_exit[0.1,3.3;3.8,1;reset;" .. S("Reset") .. "]" - else - buttons = "field[0.4,2.5;3.8,1;path;" .. S("Move distance (A to B)") .. ";" .. path .. "]" .. - "button_exit[0.1,3.3;3.8,1;moveAB;" .. S("Move A-B") .. "]" .. - "button_exit[4.1,3.3;3.8,1;moveBA;" .. S("Move B-A") .. "]" .. - "button[4.1,2.2;3.8,1;store;" .. S("Store") .. "]" - end - return "size[8,5]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;7.2,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("TA4 Move Controller")) .. "]" .. - techage.wrench_image(7.4, -0.05) .. - "button[0.1,0.8;3.8,1;record;" .. S("Record") .. "]" .. - "button[4.1,0.8;3.8,1;done;" .. S("Done") .. "]" .. - buttons .. - "label[0.3,4.3;" .. status .. "]" -end - -minetest.register_node("techage:ta4_movecontroller", { - description = S("TA4 Move Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_movecontroller.png", - }, - - after_place_node = function(pos, placer, itemstack) - local meta = M(pos) - techage.logic.after_place_node(pos, placer, "techage:ta4_movecontroller", S("TA4 Move Controller")) - techage.logic.infotext(meta, S("TA4 Move Controller")) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(nvm, meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if fields.record then - nvm.lpos1 = {} - nvm.lpos2 = {} - nvm.moveBA = false - nvm.running = nil - nvm.lastpos = nil - meta:set_string("status", S("Recording...")) - local name = player:get_player_name() - minetest.chat_send_player(name, S("Click on all blocks that shall be moved")) - mark.unmark_all(name) - mark.start(name, MAX_BLOCKS) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.done then - local name = player:get_player_name() - local pos_list = mark.get_poslist(name) - if fly.to_vector(fields.path or "", MAX_DIST) then - meta:set_string("path", fields.path) - end - local text = #pos_list.." "..S("block positions are stored.") - nvm.running = nil - nvm.lastpos = nil - meta:set_string("status", text) - nvm.lpos1 = pos_list - mark.unmark_all(name) - mark.stop(name) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.store then - if fly.to_vector(fields.path or "", MAX_DIST) then - meta:set_string("path", fields.path) - meta:set_string("status", S("Stored")) - else - meta:set_string("status", S("Error: Invalid distance !!")) - end - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - nvm.moveBA = false - nvm.running = nil - nvm.lastpos = nil - elseif fields.moveAB then - meta:set_string("status", "") - if fly.move_to_other_pos(pos, false) then - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.moveBA then - meta:set_string("status", "") - if fly.move_to_other_pos(pos, true) then - meta:set_string("formspec", formspec(nvm, meta)) - local name = player:get_player_name() - mark.stop(name) - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.move2 then - if fly.to_vector(fields.path or "", MAX_DIST) then - meta:set_string("path", fields.path) - end - local line = fly.to_vector(meta:get_string("path"), MAX_DIST) - if line then - fly.move_to(pos, line) - end - elseif fields.reset then - fly.reset_move(pos) - end - end, - - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - if not clicker or minetest.is_protected(pos, clicker:get_player_name()) then - return - end - local meta = M(pos) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(nvm, meta)) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local name = digger:get_player_name() - mark.unmark_all(name) - mark.stop(name) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - ta4_formspec = WRENCH_MENU, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -local INFO = [[Commands: 'state', 'a2b', 'b2a', 'move']] - -techage.register_node({"techage:ta4_movecontroller"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - local move_xyz = M(pos):get_string("opmode") == "move xyz" - if topic == "info" then - return INFO - elseif topic == "state" then - return nvm.running and "running" or "stopped" - elseif not move_xyz and topic == "a2b" then - return fly.move_to_other_pos(pos, false) - elseif not move_xyz and topic == "b2a" then - return fly.move_to_other_pos(pos, true) - elseif not move_xyz and topic == "move" then - return fly.move_to_other_pos(pos, nvm.moveBA == false) - elseif move_xyz and topic == "move2" then - local line = fly.to_vector(payload, MAX_DIST) - if line then - return fly.move_to(pos, line) - end - return false - elseif topic == "reset" then - return fly.reset_move(pos) - end - return false - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - local move_xyz = M(pos):get_string("opmode") == "move xyz" - --print("on_beduino_receive_cmnd", P2S(pos), move_xyz, topic, payload[1]) - if not move_xyz and topic == 11 then - if payload[1] == 1 then - return fly.move_to_other_pos(pos, false) and 0 or 3 - elseif payload[1] == 2 then - return fly.move_to_other_pos(pos, true) and 0 or 3 - elseif payload[1] == 3 then - return fly.move_to_other_pos(pos, nvm.moveBA == false) and 0 or 3 - end - elseif move_xyz and topic == 18 then -- move xyz - local line = { - x = techage.in_range(techage.beduino_signed_var(payload[1]), -100, 100), - y = techage.in_range(techage.beduino_signed_var(payload[2]), -100, 100), - z = techage.in_range(techage.beduino_signed_var(payload[3]), -100, 100), - } - return fly.move_to(pos, line) and 0 or 3 - elseif move_xyz and topic == 19 then -- reset - return fly.reset_move(pos) and 0 or 3 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 129 then - return 0, {nvm.running and 1 or 6} - end - return 2, "" - end, - on_node_load = function(pos, node) - M(pos):set_string("teleport_mode", "") -- delete not working (legacy) op mode - M(pos):set_string("status", "") - end, -}) - -minetest.register_node("techage:rack_and_pinion", { - description = S("TA Rack and Pinion"), - tiles = { - -- up, down, right, left, back, front - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "default_steel_block.png", - "techage_rack_and_pinion.png", - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -6/32, -16/32, 14.1/32, 6/32, 16/32, 16/32}, - }, - }, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "facedir", - is_ground_content = false, - groups = {cracky = 1, level = 2}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:moveblock", { - description = "Techage Invisible Move Block", - drawtype = "glasslike_framed_optional", - inventory_image = 'techage_inv_invisible.png', - tiles = {"blank.png"}, - selection_box = { - type = "fixed", - fixed = { - {-16/32, -16/32, -16/32, 16/32, -14/32, 16/32}, - }, - }, - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - walkable = false, - pointable = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_glass_defaults(), -}) - - -minetest.register_craft({ - output = "techage:ta4_movecontroller", - recipe = { - {"default:steel_ingot", "dye:blue", "default:steel_ingot"}, - {"default:mese_crystal_fragment", "techage:ta4_wlanchip", "default:mese_crystal_fragment"}, - {"group:wood", "basic_materials:gear_steel", "group:wood"}, - }, -}) - -minetest.register_craft({ - output = "techage:rack_and_pinion 10", - recipe = { - {"", "default:steel_ingot", ""}, - {"basic_materials:steel_bar", "default:steel_ingot", "basic_materials:steel_bar"}, - {"", "default:steel_ingot", ""}, - }, -}) diff --git a/techage/move_controller/soundblock.lua b/techage/move_controller/soundblock.lua deleted file mode 100644 index 7743f0f..0000000 --- a/techage/move_controller/soundblock.lua +++ /dev/null @@ -1,149 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Sound Block - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local t = {} -for idx, ogg in ipairs(techage.OggFileList) do - t[idx] = idx .. "," .. ogg -end -local OGG_FILES = table.concat(t, ",") - -local logic = techage.logic - -local GAIN = {0.05 ,0.1, 0.2, 0.5, 1.0} - - -local function play_sound(pos, ogg, gain) - minetest.sound_play(ogg, { - pos = pos, - gain = GAIN[gain or 1] or 1, - max_hear_distance = 15}) -end - -local function formspec(meta) - local idx = meta:contains("idx") and meta:get_int("idx") or 1 - local gain = meta:contains("gain") and meta:get_int("gain") or 1 - return "size[8,8]".. - "tablecolumns[text,width=5;text]".. - "table[0,0;8,6;oggfiles;" .. OGG_FILES .. ";" .. idx .. "]" .. - "dropdown[0,6.5;5.5,1.4;gain;1,2,3,4,5;" .. gain .. "]" .. - "button[2.5,7.2;3,1;play;" .. S("Play") .. "]" -end - -local function play_predefined_sound(pos) - local mem = techage.get_mem(pos) - if not mem.blocking_time or (mem.blocking_time < minetest.get_gametime()) then - local idx = M(pos):get_int("idx") - local ogg = techage.OggFileList[idx or 1] or techage.OggFileList[1] - local gain = M(pos):get_int("gain") - play_sound(pos, ogg, gain) - mem.blocking_time = minetest.get_gametime() + 2 - return true - end -end - -minetest.register_node("techage:ta3_soundblock", { - description = S("TA3 Sound Block"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_sound.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - logic.after_place_node(pos, placer, "techage:ta3_soundblock", S("TA3 Sound Block")) - logic.infotext(meta, S("TA3 Sound Block")) - meta:set_string("formspec", formspec(meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - if fields.oggfiles then - local mem = techage.get_mem(pos) - local t = minetest.explode_table_event(fields.oggfiles) - mem.idx = t.row - end - if fields.gain then - M(pos):set_int("gain", tonumber(fields.gain) or 1) - end - if fields.play then - local mem = techage.get_mem(pos) - M(pos):set_int("idx", mem.idx or 1) - local ogg = techage.OggFileList[mem.idx or 1] or techage.OggFileList[1] - play_sound(pos, ogg, M(pos):get_int("gain")) - end - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -local INFO = [[Commands: 'on', 'sound', 'gain']] - -techage.register_node({"techage:ta3_soundblock"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "info" then - return INFO - elseif topic == "on" then - play_predefined_sound(pos) - elseif topic == "sound" then - M(pos):set_int("idx", tonumber(payload or 1) or 1) - elseif topic == "gain" then - M(pos):set_int("gain", tonumber(payload or 1) or 1) - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - print("ta3_soundblock", topic, payload[1], payload[2]) - if topic == 1 then - if payload[1] == 1 then - play_predefined_sound(pos) - return 0 - end - elseif topic == 14 then - if payload[1] == 1 then - M(pos):set_int("gain", payload[2]) - return 0 - elseif payload[1] == 2 then - M(pos):set_int("idx", payload[2]) - return 0 - end - end - return 2 -- unknown or invalid topic - end, - on_node_load = function(pos) - local meta = M(pos) - meta:set_string("formspec", formspec(meta)) - end -}) - -minetest.register_craft({ - output = "techage:ta3_soundblock", - recipe = { - {"", "group:wood",""}, - {"techage:vacuum_tube", "basic_materials:gold_wire", "techage:usmium_nuggets"}, - {"", "group:wood", ""}, - }, -}) diff --git a/techage/move_controller/turncontroller.lua b/techage/move_controller/turncontroller.lua deleted file mode 100644 index 10fb4cb..0000000 --- a/techage/move_controller/turncontroller.lua +++ /dev/null @@ -1,207 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Turn Controller - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local S = techage.S - -local MP = minetest.get_modpath("techage") -local mark = dofile(MP .. "/basis/mark_lib.lua") -local fly = techage.flylib - -local MAX_BLOCKS = 16 - -local function formspec(nvm, meta) - local status = meta:get_string("status") - local path = meta:contains("path") and meta:get_string("path") or "0,3,0" - return "size[8,3]" .. - "box[0,-0.1;7.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("TA4 Turn Controller")) .. "]" .. - --techage.wrench_image(7.4, -0.05) .. - "button[0.1,0.7;3.8,1;record;" .. S("Record") .. "]" .. - "button[4.1,0.7;3.8,1;done;" .. S("Done") .. "]" .. - "button[0.1,1.5;3.8,1;left;" .. S("Turn left") .. "]" .. - "button[4.1,1.5;3.8,1;right;" .. S("Turn right") .. "]" .. - "label[0.3,2.5;" .. status .. "]" -end - -minetest.register_node("techage:ta4_turncontroller", { - description = S("TA4 Turn Controller"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_turn.png", - }, - - after_place_node = function(pos, placer, itemstack) - local meta = M(pos) - techage.logic.after_place_node(pos, placer, "techage:ta4_turncontroller", S("TA4 Turn Controller")) - techage.logic.infotext(meta, S("TA4 Turn Controller")) - local nvm = techage.get_nvm(pos) - meta:set_string("formspec", formspec(nvm, meta)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - - local meta = M(pos) - local nvm = techage.get_nvm(pos) - - if fields.record then - nvm.lpos1 = {} - nvm.lpos2 = {} - meta:set_string("status", S("Recording...")) - local name = player:get_player_name() - minetest.chat_send_player(name, S("Click on all blocks that shall be turned")) - mark.start(name, MAX_BLOCKS) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.done then - local name = player:get_player_name() - local pos_list = mark.get_poslist(name) - local text = #pos_list.." "..S("block positions are stored.") - meta:set_string("status", text) - nvm.lpos = pos_list - mark.unmark_all(name) - mark.stop(name) - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.left then - meta:set_string("status", "") - if nvm.lpos then - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "l") - if new_posses then - nvm.lpos = new_posses - local name = player:get_player_name() - mark.stop(name) - end - end - meta:set_string("formspec", formspec(nvm, meta)) - elseif fields.right then - meta:set_string("status", "") - if nvm.lpos then - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - local name = player:get_player_name() - mark.stop(name) - end - end - meta:set_string("formspec", formspec(nvm, meta)) - end - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local name = digger:get_player_name() - mark.unmark_all(name) - mark.stop(name) - techage.remove_node(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -local INFO = [[Commands: 'left', 'right', 'uturn']] - -techage.register_node({"techage:ta4_turncontroller"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "info" then - return INFO - elseif topic == "left" then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "l") - if new_posses then - nvm.lpos = new_posses - return true - end - return false - elseif topic == "right" then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - return true - end - return false - elseif topic == "uturn" then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - return true - end - end - return false - end - return false - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 12 then - if payload[1] == 1 then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "l") - if new_posses then - nvm.lpos = new_posses - return 0 - end - return 3 - elseif payload[1] == 2 then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - return 0 - end - return 3 - elseif payload[1] == 3 then - local nvm = techage.get_nvm(pos) - local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - new_posses = fly.rotate_nodes(pos, nvm.lpos, "r") - if new_posses then - nvm.lpos = new_posses - return 0 - end - end - return 3 - end - return 2 - else - return 2 - end - end, - on_node_load = function(pos, node) - M(pos):set_string("status", "") - end, -}) - -minetest.register_craft({ - output = "techage:ta4_turncontroller", - recipe = { - {"default:steel_ingot", "dye:blue", "default:steel_ingot"}, - {"techage:aluminum", "techage:baborium_ingot", "techage:aluminum"}, - {"group:wood", "basic_materials:gear_steel", "group:wood"}, - }, -}) diff --git a/techage/oil/distiller.lua b/techage/oil/distiller.lua deleted file mode 100644 index ff4dec8..0000000 --- a/techage/oil/distiller.lua +++ /dev/null @@ -1,269 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Distillation Tower - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - - -local function orientation(pos, names) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - for _,name in ipairs(names) do - if node.name == name then - local param2 = node.param2 - node = minetest.get_node(pos) - node.param2 = param2 - minetest.swap_node(pos, node) - return - end - end - minetest.remove_node(pos) - return true -end - -local function after_place_node(pos, placer) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) -end - -minetest.register_node("techage:ta3_distiller_base", { - description = S("TA3 Distillation Tower Base"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^techage_appl_arrowXL.png^techage_appl_hole_pipe.png", - "techage_concrete.png", - "techage_concrete.png", - "techage_concrete.png", - "techage_concrete.png^techage_appl_hole_pipe.png", - "techage_concrete.png", - }, - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = {-6/8, -4/8, -6/8, 6/8, 4/8, 6/8}, - }, - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -liquid.register_nodes({"techage:ta3_distiller_base"}, Pipe, "pump", {"B"}, {}) - -minetest.register_node("techage:ta3_distiller1", { - description = S("TA3 Distillation Tower 1"), - tiles = {"techage_distiller1.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_14.obj", - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - - after_place_node = function(pos, placer) - local res = orientation(pos, {"techage:ta3_distiller_base"}) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "B")) - after_place_node(pos, placer) - return res - end, - after_dig_node = after_dig_node, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta3_distiller1"}, Pipe, "pump", {"F"}, {}) - -minetest.register_node("techage:ta3_distiller2", { - description = S("TA3 Distillation Tower 2"), - tiles = {"techage_distiller2.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_14.obj", - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - - after_place_node = function(pos, placer) - return orientation(pos, {"techage:ta3_distiller1", "techage:ta3_distiller3"}) - end, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_distiller3", { - description = S("TA3 Distillation Tower 3"), - tiles = {"techage_distiller3.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_14.obj", - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - - after_place_node = function(pos, placer) - local res = orientation(pos, {"techage:ta3_distiller2"}) - return res - end, - after_dig_node = after_dig_node, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta3_distiller3"}, Pipe, "pump", {"B"}, {}) - -minetest.register_node("techage:ta3_distiller4", { - description = S("TA3 Distillation Tower 4"), - tiles = {"techage_distiller4.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_14.obj", - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - collision_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - - after_place_node = function(pos, placer) - local res = orientation(pos, {"techage:ta3_distiller3"}) - after_place_node(pos, placer) - return res - end, - after_dig_node = after_dig_node, - - paramtype = "light", - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -liquid.register_nodes({"techage:ta3_distiller4"}, Pipe, "pump", {"U"}, {}) - -local Liquids = {"techage:bitumen", "techage:fueloil", "techage:naphtha", "techage:gasoline", "techage:gas"} -local YPos = {-1, 2, 4, 6, 7} - -techage.register_node({"techage:ta3_distiller1"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "put" then - local nvm = techage.get_nvm(pos) - nvm.idx = nvm.idx or 1 - local outdir - if nvm.idx == 5 then - outdir = 6 -- up - else - outdir = M(pos):get_int("outdir") - end - local pos2 = {x = pos.x, y = pos.y + YPos[nvm.idx], z = pos.z} - local leftover = liquid.put(pos2, Pipe, outdir, Liquids[nvm.idx], 1) - if leftover == 0 then - nvm.idx = (nvm.idx % 5) + 1 - end - return leftover - end - end, -}) - -minetest.register_craft({ - output = 'techage:ta3_distiller2', - recipe = { - {'default:steel_ingot', 'default:tin_ingot', 'default:steel_ingot'}, - {'techage:iron_ingot', 'techage:ta3_barrel_empty', 'techage:iron_ingot'}, - {'default:steel_ingot', 'default:tin_ingot', 'default:steel_ingot'}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_distiller1', - recipe = { - {'', '', ''}, - {'techage:ta3_pipeS', 'techage:ta3_distiller2', ''}, - {'', '', ''}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_distiller3', - recipe = { - {'', '', ''}, - {'', 'techage:ta3_distiller2', 'techage:ta3_pipeS'}, - {'', '', ''}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_distiller4', - recipe = { - {'', 'techage:ta3_pipeS', ''}, - {'', 'techage:ta3_distiller2', ''}, - {'', '', ''}, - } -}) - -minetest.register_craft({ - output = 'techage:ta3_distiller_base', - recipe = { - {'basic_materials:concrete_block', 'techage:ta3_pipeS', 'basic_materials:concrete_block'}, - {'', 'techage:ta3_pipeS', 'techage:ta3_pipeS'}, - {'basic_materials:concrete_block', '', 'basic_materials:concrete_block'}, - } -}) diff --git a/techage/oil/drillbox.lua b/techage/oil/drillbox.lua deleted file mode 100644 index 63b9c92..0000000 --- a/techage/oil/drillbox.lua +++ /dev/null @@ -1,319 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Oil Drill Box - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 16 - -local formspec0 = "size[5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "image[1,0;3.4,3.4;techage_ta3.png]".. - "button_exit[1,3.2;3,1;build;"..S("Build derrick").."]" - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_oildrill", { - pos = pos, - gain = 1, - max_hear_distance = 15, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function formspec(self, pos, nvm) - if not nvm.assemble_build then - return formspec0 - end - local depth = M(pos):get_int("depth") - local curr_depth = pos.y - (nvm.drill_pos or pos).y - return "size[8,8]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;1,1;1,1;]".. - "label[1.3,0.5;IN]".. - "item_image[1,1;1,1;techage:oil_drillbit]".. - "label[1,2;"..S("Drill Bit").."]".. - "label[0.5,3;"..S("Depth")..": "..curr_depth.."/"..depth.."]".. - "image[3.5,0;1,1;"..techage.get_power_image(pos, nvm).."]".. - "image[3.5,1;1,1;techage_form_arrow.png]".. - "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "label[6.2,0.5;OUT]".. - "list[context;dst;6,1;1,1;]".. - "button_exit[5,3;3,1;remove;"..S("Remove derrick").."]".. - "list[current_player;main;0,4;8,4;]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4) -end - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - local crd = CRD(pos) - if listname == "src" then - crd.State:start_if_standby(pos) - return stack:get_count() - end - return 0 -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) -end - -local function on_node_state_change(pos, old_state, new_state) - if new_state == techage.RUNNING then - play_sound(pos) - else - stop_sound(pos) - end -end - -local function drilling(pos, crd, nvm, inv) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - nvm.drill_pos = nvm.drill_pos or {x=pos.x, y=pos.y-1, z=pos.z} - local owner = M(pos):get_string("owner") - local depth = M(pos):get_int("depth") - local curr_depth = pos.y - (nvm.drill_pos or pos).y - local node = techage.get_node_lvm(nvm.drill_pos) - local ndef = minetest.registered_nodes[node.name] - - if not inv:contains_item("src", ItemStack("techage:oil_drillbit")) then - crd.State:idle(pos, nvm, S("Drill bits missing")) - elseif curr_depth >= depth then - M(pos):set_string("oil_found", "true") - crd.State:stop(pos, nvm) - elseif node.name == "techage:oilstorage" then -- old oil bubble node? - nvm.drill_pos.y = nvm.drill_pos.y-1 - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - elseif minetest.is_protected(nvm.drill_pos, owner) then - crd.State:fault(pos, nvm, S("Drill area is protected")) - elseif node.name == "techage:oil_drillbit2" then - nvm.drill_pos.y = nvm.drill_pos.y-1 - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - elseif minetest.get_item_group(node.name, "lava") >= 1 then - minetest.swap_node(nvm.drill_pos, {name = "techage:oil_drillbit2"}) - inv:remove_item("src", ItemStack("techage:oil_drillbit")) - nvm.drill_pos.y = nvm.drill_pos.y-1 - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - elseif techage.can_dig_node(node.name, ndef) then - local drop_name = techage.dropped_node(node, ndef) - if drop_name then - local item = ItemStack(drop_name) - if not inv:room_for_item("dst", item) then - crd.State:blocked(pos, nvm, S("item output blocked")) - return - end - inv:add_item("dst", item) - end - minetest.swap_node(nvm.drill_pos, {name = "techage:oil_drillbit2"}) - inv:remove_item("src", ItemStack("techage:oil_drillbit")) - nvm.drill_pos.y = nvm.drill_pos.y-1 - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - elseif node.name == "ignore" then - -- load world and pause the drilling for one step - minetest.emerge_area(nvm.drill_pos, nvm.drill_pos) - end -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - local inv = M(pos):get_inventory() - if inv then - drilling(pos, crd, nvm, inv) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) - end -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local nvm = techage.get_nvm(pos) - if nvm.assemble_locked or nvm.assemble_build then - return false - end - local inv = M(pos):get_inventory() - return inv:is_empty("dst") and inv:is_empty("src") -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if fields.build then - techage.oiltower.build(pos, player:get_player_name()) - elseif fields.remove then - local inv = M(pos):get_inventory() - if inv:is_empty("dst") and inv:is_empty("src") then - techage.oiltower.remove(pos, player:get_player_name()) - end - else - local nvm = techage.get_nvm(pos) - if not nvm.assemble_locked and M(pos):get_string("oil_found") ~= "true" then - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) - end - end -end - -local tiles = {} --- '#' will be replaced by the stage number -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_outp.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_inp.png", - "techage_filling_ta#.png^techage_appl_oildrill.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_appl_oildrill.png^techage_frame_ta#.png", -} -tiles.act = tiles.pas - -local tubing = { - on_pull_item = function(pos, in_dir, num) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.get_items(pos, inv, "dst", num) - end - end, - on_push_item = function(pos, in_dir, stack) - local nvm = techage.get_nvm(pos) - if not nvm.assemble_locked then - local meta = minetest.get_meta(pos) - if meta:get_int("push_dir") == in_dir then - local inv = M(pos):get_inventory() - CRD(pos).State:start_if_standby(pos) - return techage.put_items(inv, "src", stack) - end - end - end, - on_unpull_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - if meta:get_int("pull_dir") == in_dir then - local inv = M(pos):get_inventory() - return techage.put_items(inv, "dst", stack) - end - end, - on_recv_message = function(pos, src, topic, payload) - return CRD(pos).State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end, - on_node_load = function(pos, node) - CRD(pos).State:on_node_load(pos) - local nvm = techage.get_nvm(pos) - nvm.assemble_locked = false - if nvm.techage_state == techage.RUNNING then - play_sound(pos) - end - end, -} - -local _, node_name_ta3, _ = - techage.register_consumer("drillbox", S("Oil Drill Box"), tiles, { - drawtype = "normal", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - on_state_change = on_node_state_change, - after_place_node = function(pos, placer) - local inv = M(pos):get_inventory() - inv:set_size("src", 1) - inv:set_size("dst", 1) - local info = techage.explore.get_oil_info(pos) - M(pos):set_int("depth", info.depth - 5) -- oil bubble - M(pos):set_int("amount", info.amount) - M(pos):set_string("oil_found", "false") - M(pos):set_string("owner", placer:get_player_name()) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if oldmetadata.fields.oil_found == "true" then - minetest.set_node(pos, {name = "techage:oil_source"}) - end - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - power_consumption = {0,10,16,24}, - tube_sides = {L=1, R=1}, - }, - {false, false, true, false}) -- TA3 only - -minetest.register_craft({ - output = node_name_ta3, - recipe = { - {"default:steel_ingot", "default:diamond", "default:steel_ingot"}, - {"techage:tubeS", "basic_materials:gear_steel", "techage:tubeS"}, - {"default:steel_ingot", "techage:vacuum_tube", "default:steel_ingot"}, - }, -}) diff --git a/techage/oil/explore.lua b/techage/oil/explore.lua deleted file mode 100644 index bc2407f..0000000 --- a/techage/oil/explore.lua +++ /dev/null @@ -1,350 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Oil Explorer - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S = techage.S - -local PROBABILITY = 100 -local OIL_MIN = 4096 -local OIL_MAX = 20000 -local DEPTH_MIN = 16 -local DEPTH_MAX = 25*16 -local DEPTH_STEP = 16 -local YPOS_MAX = -6*16 -- oil can't found below this level -local OIL_BUBBLE_SIZE = 4096 - -local seed = tonumber(minetest.settings:get("techage_oil_exploration_seed")) or 1234 -- confidental! - -local InvalidGroundNodes = { - ["air"] = true, -} - -local ValidGroundNodes = { - ["default:cobble"] = true, - ["default:mossycobble"] = true, - ["default:desert_cobble"] = true, -} - -local function oil_amount(pos) - if pos.y > YPOS_MAX then return 0 end - local block_key = seed + - math.floor((pos.z + 32768) / 16) * 4096 * 4096 + - math.floor((pos.y + 32768) / 16) * 4096 + - math.floor((pos.x + 32768) / 16) - math.randomseed(block_key) - math.random(); math.random(); math.random() - local has_oil = math.random(1,PROBABILITY) == 1 - if has_oil then - local amount = math.random(OIL_MIN, OIL_MAX) - return amount - end - -- Generate new randomseed after use - math.randomseed(os.time()) - return 0 -end - -local function center(coord) - return (math.floor(coord/16) * 16) + 8 -end - -local function basis(coord) - return (math.floor(coord/16) * 16) -end - --- determine the mapblock coordinates -local function mapblock_coordinates(pos) - local pos1 = {x = basis(pos.x), y = basis(pos.y), z = basis(pos.z)} - local pos2 = {x = pos1.x + 15, y = pos1.y + 15, z = pos1.z + 15} - return pos1, pos2 -end - -local function calc_depth(pos, explore_pos) - return pos.y - explore_pos.y + 1 -end - --- posC is the center position of the oil bubble --- idx is the vmdata index --- function returns the real position {x,y,z} -local function calc_vmdata_pos(posC, idx) - local rest, xoffs, yoffs, zoffs - - rest = idx - 1 - xoffs = rest % 16 - rest = math.floor(rest / 16) - zoffs = rest % 16 - rest = math.floor(rest / 16) - yoffs = rest % 16 - return {x = basis(posC.x) + xoffs, y = basis(posC.y) + yoffs, z = basis(posC.z) + zoffs} -end - -local function calc_vmdata_index(xoffs, yoffs, zoffs) - return (xoffs + (yoffs * 16) + (zoffs * 16 * 16)) + 1 -end - --- from/to are x/z-offsets (0..15) for one layer of oil within one mapblock -local function gen_oil_slice(yoffs, from, to, vmdata, id) - for xoffs = from, to do - for zoffs = from, to do - vmdata[calc_vmdata_index(xoffs, yoffs, zoffs)] = id - end - end -end - -local function gen_oil_bubble(vmdata) - local id = minetest.get_content_id("techage:oil_source") - - gen_oil_slice(1, 3, 12, vmdata, id) - gen_oil_slice(2, 2, 13, vmdata, id) - for offs = 3, 12 do - gen_oil_slice(offs, 1, 14, vmdata, id) - end - gen_oil_slice(13, 2, 13, vmdata, id) - gen_oil_slice(14, 3, 12, vmdata, id) -end - -local function useable_stone_block(data) - local valid = {} - for _,id in ipairs(data) do - if not valid[id] then - local itemname = minetest.get_name_from_content_id(id) - if not ValidGroundNodes[itemname] then - local ndef = minetest.registered_nodes[itemname] - if InvalidGroundNodes[itemname] or not ndef or ndef.is_ground_content == false then - return false - end - end - valid[id] = true - end - end - return true -end - -local function get_next_explore_pos(pos) - local meta = M(pos) - local ypos = meta:get_int("exploration_ypos") - if ypos == 0 then - ypos = math.min(YPOS_MAX, center(pos.y)) - end - local d = calc_depth(pos, {y = ypos}) - if d + DEPTH_STEP < DEPTH_MAX then - ypos = ypos - DEPTH_STEP - local posC = {x = center(pos.x), y = center(ypos), z = center(pos.z)} - local node = techage.get_node_lvm(posC) - if node.name ~= "ignore" then - meta:set_int("exploration_ypos", ypos) - else - -- load world and pause for one step - minetest.emerge_area(posC, posC) - end - - end - return {x = center(pos.x), y = center(ypos), z = center(pos.z)} -end - -local function get_oil_amount(pos) - return M(pos):get_int("oil_amount") -end - -local function set_oil_amount(pos, amount) - minetest.set_node(pos, {name = "techage:oilstorage"}) - M(pos):set_int("oil_amount", amount) - M(pos):set_int("initial_oil_amount", amount) -end - -local function status(pos, player_name, explore_pos, amount) - local depth = calc_depth(pos, explore_pos) - minetest.chat_send_player(player_name, - "[TA Oil] "..P2S(explore_pos).." "..S("depth")..": "..depth..", "..S("Oil")..": "..amount.." ") -end - -local function marker(player_name, pos) - local posC = {x = center(pos.x), y = pos.y, z = center(pos.z)} - local pos1 = {x = posC.x - 2, y = posC.y - 2, z = posC.z - 2} - local pos2 = {x = posC.x + 2, y = posC.y + 7, z = posC.z + 2} - techage.switch_region(player_name, pos1, pos2) -end - --- check if oil can be placed and if so, do it and return true -local function generate_oil_bubble(posC, amount) - local pos1, pos2 = mapblock_coordinates(posC) - local vm = minetest.get_voxel_manip(pos1, pos2) - local data = vm:get_data() - - if useable_stone_block(data) then - gen_oil_bubble(data) - vm:set_data(data) - vm:write_to_map() - vm:update_map() - set_oil_amount(posC, amount) - return true - end - return false -end - -local function explore_area(pos, node, player_name) - if M(pos):get_int("oil_amount") == 0 then -- nothing found so far? - local posC, amount - - node.name = "techage:oilexplorer_on" - minetest.swap_node(pos, node) - minetest.get_node_timer(pos):start(2.2) - minetest.sound_play("techage_explore", { - pos = pos, - max_hear_distance = 8}) - - for i = 1,4 do - posC = get_next_explore_pos(pos) - amount = oil_amount(posC) - if amount > 0 then - break - end - end - - if amount > 0 then - if get_oil_amount(posC) == 0 then -- not explored so far? - if generate_oil_bubble(posC, amount) then - marker(player_name, pos) - else - amount = 0 - end - end - M(pos):set_int("oil_amount", amount) - end - - minetest.after(2, status, pos, player_name, posC, amount) - else - local explore_pos = {x = center(pos.x), y = M(pos):get_int("exploration_ypos"), z = center(pos.z)} - status(pos, player_name, explore_pos, M(pos):get_int("oil_amount")) - marker(player_name, pos) - end -end - --- Used as storage for already explored blocks -minetest.register_node("techage:oilstorage", { - description = S("TA3 Oil Storage"), - tiles = {"default_stone.png"}, - groups = {not_in_creative_inventory=1}, - diggable = false, - drop = "", - is_ground_content = false, -}) - -minetest.register_node("techage:oilexplorer", { - description = S("TA3 Oil Explorer"), - tiles = { - "techage_filling_ta3.png^techage_appl_oilexplorer_top.png^techage_frame_ta3_top.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_oilexplorer.png", - }, - - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - explore_area(pos, node, clicker:get_player_name()) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.unmark_region(digger:get_player_name()) - local xpos = (math.floor(pos.x / 16) * 16) - local ypos = (math.floor(pos.y / 16) * 16) - local zpos = (math.floor(pos.z / 16) * 16) - local pos1 = {x=xpos, y=ypos, z=zpos} - local pos2 = {x=xpos+15, y=ypos+15, z=zpos+15} - techage.mark_region(digger:get_player_name(), pos1, pos2) - end, - is_ground_content = false, - groups = {snappy=2,cracky=2,oddly_breakable_by_hand=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:oilexplorer_on", { - description = S("TA3 Oil Explorer"), - tiles = { - { - name = "techage_filling4_ta3.png^techage_appl_oilexplorer_top4.png^techage_frame4_ta3_top.png", - backface_culling = false, - animation = { - type = "vertical_frames", - - aspect_w = 32, - aspect_h = 32, - length = 1.2, - }, - }, - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_oilexplorer.png", - }, - - on_timer = function(pos,elapsed) - local node = minetest.get_node(pos) - node.name = "techage:oilexplorer" - minetest.swap_node(pos, node) - end, - - diggable = false, - is_ground_content = false, - paramtype = "light", - light_source = 8, - groups = {not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:oilexplorer", - recipe = { - {"group:wood", "default:diamond", "group:wood"}, - {"techage:baborium_ingot", "basic_materials:gear_steel", "techage:usmium_nuggets"}, - {"group:wood", "techage:vacuum_tube", "group:wood"}, - }, -}) - - -techage.explore = {} - -function techage.explore.get_oil_info(pos) - local amount = 0 - local depth = DEPTH_MIN - local posC = {x = center(pos.x), y = center(pos.y) - DEPTH_MIN, z = center(pos.z)} - while amount == 0 and depth < DEPTH_MAX do - amount = get_oil_amount(posC) - depth = calc_depth(pos, posC) - posC.y = posC.y - DEPTH_STEP - end - posC.y = posC.y + DEPTH_STEP - return {depth = depth, amount = amount, storage_pos = posC} -end - -function techage.explore.get_oil_amount(posC) - local meta = M(posC) - if meta:get_int("initial_oil_amount") == 0 then - meta:set_int("initial_oil_amount", meta:get_int("oil_amount")) - end - return meta:get_int("oil_amount"), meta:get_int("initial_oil_amount") -end - -function techage.explore.dec_oil_amount(posC) - local oil_amount, oil_initial = techage.explore.get_oil_amount(posC) - oil_amount = oil_amount - 1 - M(posC):set_int("oil_amount", oil_amount) - - local idx = math.floor(oil_amount * OIL_BUBBLE_SIZE / oil_initial) - idx = idx + 256 -- last level is stone, so add one level - if idx <= (OIL_BUBBLE_SIZE - 256) then -- first level is stone, too - local pos = calc_vmdata_pos(posC, idx) - local node = techage.get_node_lvm(pos) - if node.name == "techage:oil_source" then - minetest.remove_node(pos) - end - end - return oil_amount -end diff --git a/techage/oil/gasflare.lua b/techage/oil/gasflare.lua deleted file mode 100644 index e8edb96..0000000 --- a/techage/oil/gasflare.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Gas flare - -]]-- - - -local HEIGHT = 7 - -local function remove_flame(pos) - local idx - for idx=HEIGHT,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - local node = minetest.get_node(pos) - if string.find(node.name, "techage:flame") then - minetest.remove_node(pos) - end - end -end - -local function flame(pos) - local idx - for idx=HEIGHT,1,-1 do - pos = {x=pos.x, y=pos.y+1, z=pos.z} - idx = math.min(idx, 12) - local node = minetest.get_node(pos) - if node.name ~= "air" then - return - end - minetest.add_node(pos, {name = "techage:flame"..math.min(idx,7)}) - local meta = minetest.get_meta(pos) - end -end - - -local lRatio = {120, 110, 95, 75, 55, 28, 0} -local lColor = {"400040", "600020", "800000", "800000", "800000", "800000", "800000"} -for idx,ratio in ipairs(lRatio) do - local color = "techage_flame_animated.png^[colorize:#"..lColor[idx].."B0:"..ratio - minetest.register_node("techage:flame"..idx, { - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/8, -4/8, -2/8, 3/8, 4/8, 2/8}, - {-2/8, -4/8, -3/8, 2/8, 4/8, 3/8}, - }, - }, - tiles = { - { - name = color, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 1 - }, - }, - }, - - after_destruct = function(pos, oldnode) - pos.y = pos.y + 1 - local node = minetest.get_node(pos) - if minetest.get_item_group(node.name, "techage_flame") > 0 then - minetest.remove_node(pos) - end - end, - - use_texture_alpha = techage.BLEND, - inventory_image = "techage_flame.png", - paramtype = "light", - light_source = 13, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - damage_per_second = 4 + idx, - groups = {igniter = 2, dig_immediate = 3, techage_flame=1, not_in_creative_inventory=1}, - drop = "", - }) -end - -local function start_flarestack(pos, playername) - if minetest.is_protected( - {x=pos.x, y=pos.y+1, z=pos.z}, - playername) then - return - end - local meta = minetest.get_meta(pos) - flame({x=pos.x, y=pos.y+1, z=pos.z}) - local handle = minetest.sound_play("gasflare", { - pos = pos, - max_hear_distance = 20, - gain = 1, - loop = true}) - --print("handle", handle) - meta:set_int("handle", handle) -end - -local function stop_flarestack(pos, handle) - remove_flame({x=pos.x, y=pos.y+1, z=pos.z}) - minetest.sound_stop(handle) -end - -minetest.register_node("techage:gasflare", { - description = "gas flare", - tiles = { - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png", - "techage_gasflare.png^techage_appl_hole_pipe.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local node = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) - if node.name ~= "air" then - return - end - minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "techage:gasflare2"}) - end, - - on_punch = function(pos, node, puncher) - local meta = minetest.get_meta(pos) - local handle = meta:get_int("handle") - minetest.sound_stop(handle) - start_flarestack(pos, puncher:get_player_name()) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - --print(dump(oldmetadata)) - stop_flarestack(pos, oldmetadata.fields.handle) - local node = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) - if node.name == "techage:gasflare2" then - minetest.remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:gasflare2", { - description = "", - tiles = { - "techage_gasflare.png^techage_appl_hole_tube.png", - "techage_gasflare.png" - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -4/8, -1/8, 1/8, 4/8, 1/8}, - {-4/8, 3/8, -4/8, 4/8, 4/8, 4/8}, - }, - }, - paramtype = "light", - light_source = 0, - sunlight_propagates = true, - paramtype2 = "facedir", - diggable = false, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) diff --git a/techage/oil/pumpjack.lua b/techage/oil/pumpjack.lua deleted file mode 100644 index 2756e54..0000000 --- a/techage/oil/pumpjack.lua +++ /dev/null @@ -1,259 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Pumpjack - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta -local P = minetest.string_to_pos -local S = techage.S -local Pipe = techage.LiquidPipe -local liquid = networks.liquid - --- Consumer Related Data -local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end -local CRDN = function(node) return (minetest.registered_nodes[node.name] or {}).consumer end - -local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 10 -local CYCLE_TIME = 8 - -local function has_oil(pos, meta) - local storage_pos = meta:get_string("storage_pos") - if storage_pos ~= "" then - local amount, initial_amount = techage.explore.get_oil_amount(P(storage_pos)) - if amount > 0 then - return true - end - end -end - -local function dec_oil_item(pos, meta) - local storage_pos = meta:get_string("storage_pos") - if storage_pos ~= "" then - techage.explore.dec_oil_amount(P(storage_pos)) - end -end - -local function formspec(self, pos, nvm) - local amount = 0 - local storage_pos = M(pos):get_string("storage_pos") - if storage_pos ~= "" then - amount = techage.explore.get_oil_amount(P(storage_pos)) - end - return "size[5,3]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;4.8,0.5;#c6e8ff]".. - "label[1.5,-0.1;"..minetest.colorize( "#000000", S("Pumpjack")).."]".. - "image[0.5,1.5;1,1;techage_liquid2_inv.png^[colorize:#000000^techage_liquid1_inv.png]".. - "image[4,0.8;1,1;"..techage.get_power_image(pos, nvm).."]".. - "tooltip[4,0.8;1,1;"..S("needs power").."]".. - "label[0,0.8;"..S("Oil amount")..": "..amount.."]".. - "image_button[2,2.2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2,2.2;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_reboiler", { - pos = pos, - gain = 1, - max_hear_distance = 15, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function on_node_state_change(pos, old_state, new_state) - if new_state == techage.RUNNING then - play_sound(pos) - else - stop_sound(pos) - end -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) -end - -local function pumping(pos, crd, meta, nvm) - if has_oil(pos, meta) then - local leftover = liquid.put(pos, Pipe, 6, "techage:oil_source", 1) - if leftover and leftover > 0 then - crd.State:blocked(pos, nvm) - stop_sound(pos) - return - end - dec_oil_item(pos, meta) - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) - return - end - crd.State:fault(pos, nvm, S("no oil")) -end - -local function keep_running(pos, elapsed) - local nvm = techage.get_nvm(pos) - local crd = CRD(pos) - pumping(pos, crd, M(pos), nvm) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(crd.State, pos, nvm)) - end -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - CRD(pos).State:state_button_event(pos, nvm, fields) -end - -local tiles = {} - --- '#' will be replaced by the stage number -tiles.pas = { - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_hole_pipe.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_hole_pipe.png", - "techage_appl_pumpjack.png^techage_frame_ta#.png", - "techage_appl_pumpjack.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png^[transformR90]", - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png^[transformR90]", -} -tiles.act = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_hole_pipe.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_hole_pipe.png", - { - name = "techage_appl_pumpjack14.png^techage_frame14_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_appl_pumpjack14.png^techage_frame14_ta#.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png^[transformR90]", - "techage_filling_ta#.png^techage_frame_ta#_top.png^techage_appl_arrow.png^[transformR90]", -} - -local tubing = { - on_recv_message = function(pos, src, topic, payload) - if topic == "load" then - local storage_pos = M(pos):get_string("storage_pos") - if storage_pos ~= "" then - local amount, capa = techage.explore.get_oil_amount(P(storage_pos)) - if amount and capa and capa > 0 then - return techage.power.percent(capa or 0, amount or 0), amount or 0 - end - end - else - return CRD(pos).State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 134 then -- Load - local storage_pos = M(pos):get_string("storage_pos") - if storage_pos ~= "" then - local amount, capa = techage.explore.get_oil_amount(P(storage_pos)) - if amount and capa and capa > 0 then - if payload[1] == 1 then - return 0, {techage.power.percent(capa or 0, amount or 0)} - else - return 0, {math.min(amount or 0, 65535)} - end - end - end - return 2 - else - return CRD(pos).State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos, node) - CRD(pos).State:on_node_load(pos) - if node.name == "techage:ta3_pumpjack_act" then - play_sound(pos) - end - end, -} - -local _, node_name_ta3, _ = - techage.register_consumer("pumpjack", S("Oil Pumpjack"), tiles, { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - on_state_change = on_node_state_change, - after_place_node = function(pos, placer) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node.name == "techage:oil_drillbit2" then - local info = techage.explore.get_oil_info(pos) - if info then - M(pos):set_string("storage_pos", P2S(info.storage_pos)) - end - end - Pipe:after_place_node(pos) - end, - power_sides = {F=1, B=1, L=1, R=1, D=1}, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - node_timer = keep_running, - on_rotate = screwdriver.disallow, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_node(pos) - end, - - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - num_items = {0,1,1,1}, - power_consumption = {0,16,16,16}, - }, - {false, false, true, false}) -- TA3 only - -minetest.register_craft({ - output = "techage:ta3_pumpjack_pas", - recipe = { - {"", "techage:usmium_nuggets", ""}, - {"dye:red", "techage:ta3_pusher_pas", "dye:red"}, - {"", "techage:oil_drillbit", ""}, - }, -}) - -liquid.register_nodes({"techage:ta3_pumpjack_pas", "techage:ta3_pumpjack_act"}, Pipe, "pump", {"U"}, {}) diff --git a/techage/oil/reboiler.lua b/techage/oil/reboiler.lua deleted file mode 100644 index 17c6250..0000000 --- a/techage/oil/reboiler.lua +++ /dev/null @@ -1,272 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Oil Reboiler - -]]-- - -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S -local Flip = networks.Flip -local Pipe = techage.LiquidPipe -local Cable = techage.ElectricCable -local liquid = networks.liquid -local power = networks.power - -local CYCLE_TIME = 2 -local WAITING_CYCLES = 5 -- in case BLOCKED -local PWR_NEEDED = 14 - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_reboiler", { - pos = pos, - gain = 1, - max_hear_distance = 15, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function swap_node(pos, on) - local nvm = techage.get_nvm(pos) - local node = techage.get_node_lvm(pos) - if on and node.name == "techage:ta3_reboiler" then - node.name = "techage:ta3_reboiler_on" - minetest.swap_node(pos, node) - play_sound(pos) - elseif not on and node.name == "techage:ta3_reboiler_on" then - node.name = "techage:ta3_reboiler" - minetest.swap_node(pos, node) - stop_sound(pos) - end -end - -local function pump_cmnd(pos) - local leftover = techage.transfer( - pos, - "R", -- outdir - "put", -- topic - nil, -- payload - Pipe, -- Pipe - {"techage:ta3_distiller1"}) - - -- number of processed oil items - return 1 - (tonumber(leftover) or 1) -end - -local function new_state(pos, nvm, state) - if nvm.state ~= state then - nvm.state = state - M(pos):set_string("infotext", S("TA3 Oil Reboiler") .. ": " .. techage.StateStrings[state]) - swap_node(pos, state == techage.RUNNING) - end -end - -local function on_timer(pos) - local nvm = techage.get_nvm(pos) - nvm.oil_amount = nvm.oil_amount or 0 - - -- Power handling - if nvm.state == techage.STOPPED then - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed == PWR_NEEDED then - new_state(pos, nvm, techage.RUNNING) - return true - end - elseif nvm.state == techage.RUNNING then - local consumed = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if consumed < PWR_NEEDED then - local nvm = techage.get_nvm(pos) - new_state(pos, nvm, techage.STOPPED) - return true - end - elseif nvm.state == techage.BLOCKED or nvm.state == techage.STANDBY then - if not power.power_available(pos, Cable) then - local nvm = techage.get_nvm(pos) - new_state(pos, nvm, techage.STOPPED) - return true - end - end - - -- Oil handling - if nvm.state == techage.RUNNING then - if nvm.oil_amount >= 1 then - local processed = pump_cmnd(pos) - nvm.oil_amount = nvm.oil_amount - processed - nvm.waiting_cycles = WAITING_CYCLES - if processed == 0 then - new_state(pos, nvm, techage.BLOCKED) - else - new_state(pos, nvm, techage.RUNNING) - end - else - nvm.waiting_cycles = (nvm.waiting_cycles or 0) - 1 - if nvm.waiting_cycles <= 0 then - new_state(pos, nvm, techage.STANDBY) - end - end - elseif nvm.state == techage.BLOCKED then - nvm.waiting_cycles = nvm.waiting_cycles - 1 - if nvm.waiting_cycles <= 0 then - new_state(pos, nvm, techage.RUNNING) - end - else - -- STANDBY: 'put' will trigger the state change - end - return true -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - new_state(pos, nvm, techage.STOPPED) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - nvm.oil_amount = 0 - new_state(pos, nvm, techage.STOPPED) - minetest.get_node_timer(pos):start(CYCLE_TIME) -end - -minetest.register_node("techage:ta3_reboiler", { - description = S("TA3 Oil Reboiler"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_reboiler.png^techage_frame_ta3.png^[transformFX", - "techage_filling_ta3.png^techage_appl_reboiler.png^techage_frame_ta3.png", - }, - - on_timer = on_timer, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_rightclick = on_rightclick, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:ta3_reboiler_on", { - description = S("TA3 Oil Reboiler"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_pipe.png^techage_frame_ta3.png", - { - name = "techage_filling4_ta3.png^techage_appl_reboiler4.png^techage_frame4_ta3.png^[transformFX", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_reboiler4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 2.0, - }, - }, - }, - - on_timer = on_timer, - on_rightclick = on_rightclick, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - diggable = false, - groups = {not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -local liquid_def = { - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - nvm.oil_amount = nvm.oil_amount or 0 - - if nvm.state == techage.STANDBY or nvm.state == techage.RUNNING then - if name == "techage:oil_source" and amount > 0 then - if nvm.state == techage.STANDBY then - new_state(pos, nvm, techage.RUNNING) - end - -- Take one oil item every 2 cycles - -- Hint: We have to take two items, because the pump will pause for 4 cycles, - -- if nothing is taken. - nvm.take = nvm.take ~= true - if nvm.take and nvm.oil_amount < 5 then - nvm.oil_amount = nvm.oil_amount + 2 - return amount - 2 - end - end - end - return amount - end -} - -liquid.register_nodes({"techage:ta3_reboiler", "techage:ta3_reboiler_on"}, Pipe, "tank", {"L", "R"}, liquid_def) -power.register_nodes({"techage:ta3_reboiler", "techage:ta3_reboiler_on"}, Cable, "con") - -techage.register_node({"techage:ta3_reboiler", "techage:ta3_reboiler_on"}, { - on_node_load = function(pos, node) - if node.name == "techage:ta3_reboiler_on" then - play_sound(pos) - end - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_craft({ - output = "techage:ta3_reboiler", - recipe = { - {"", "basic_materials:heating_element", ""}, - {"default:mese_crystal_fragment", "techage:t3_pump", "default:mese_crystal_fragment"}, - {"", "basic_materials:heating_element", ""}, - }, -}) diff --git a/techage/oil/tower.lua b/techage/oil/tower.lua deleted file mode 100644 index dfe9337..0000000 --- a/techage/oil/tower.lua +++ /dev/null @@ -1,286 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Oil Tower - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -minetest.register_node("techage:oiltower1", { - description = S("TA3 Derrick"), - tiles = { - "techage_oil_tower1.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -7/16, 8/16, 8/16}, - { 7/16, -8/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, - {-8/16, 7/16, -8/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, 8/16, -7/16}, - {-8/16, -8/16, 7/16, 8/16, 8/16, 8/16}, - }, - }, - drop = "", - diggable = false, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oiltower2", { - description = S("TA3 Derrick"), - tiles = { - -- up, down, right, left, back, front - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower2.png^[transformFX", - "techage_oil_tower2.png", - "techage_oil_tower2.png", - "techage_oil_tower2.png^[transformFX", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -7/16, 8/16, 4/16}, - { 3/16, -8/16, -8/16, 4/16, 8/16, 4/16}, - {-8/16, -8/16, -8/16, 4/16, -7/16, 4/16}, - {-8/16, 7/16, -8/16, 4/16, 8/16, 4/16}, - {-8/16, -8/16, -8/16, 4/16, 8/16, -7/16}, - {-8/16, -8/16, 3/16, 4/16, 8/16, 4/16}, - }, - }, - drop = "", - diggable = false, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oiltower3", { - description = S("TA3 Derrick"), - tiles = { - -- up, down, right, left, back, front - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower3.png^[transformFX", - "techage_oil_tower3.png", - "techage_oil_tower3.png", - "techage_oil_tower3.png^[transformFX", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -7/16, 8/16, 0/16}, - {-1/16, -8/16, -8/16, 0/16, 8/16, 0/16}, - {-8/16, -8/16, -8/16, 0/16, -7/16, 0/16}, - {-8/16, 7/16, -8/16, 0/16, 8/16, 0/16}, - {-8/16, -8/16, -8/16, 0/16, 8/16, -7/16}, - {-8/16, -8/16, -1/16, 0/16, 8/16, 0/16}, - }, - }, - drop = "", - diggable = false, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oiltower4", { - description = S("TA3 Derrick"), - tiles = { - -- up, down, right, left, back, front - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower_top.png^[transformR180", - "techage_oil_tower4.png^[transformFX", - "techage_oil_tower4.png", - "techage_oil_tower4.png", - "techage_oil_tower4.png^[transformFX", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, -7/16, 8/16, -4/16}, - {-5/16, -8/16, -8/16, -4/16, 8/16, -4/16}, - {-8/16, -8/16, -8/16, -4/16, -7/16, -4/16}, - {-8/16, 7/16, -8/16, -4/16, 8/16, -4/16}, - {-8/16, -8/16, -8/16, -4/16, 8/16, -7/16}, - {-8/16, -8/16, -5/16, -4/16, 8/16, -4/16}, - }, - }, - drop = "", - diggable = false, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oiltower5", { - description = S("TA4 Derrick"), - tiles = { - -- up, down, right, left, back, front - "techage_oil_tower1.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, 7/16, 8/16, 8/16, 8/16}, - }, - }, - drop = "", - diggable = false, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oil_drillbit", { - description = S("TA3 Drill Pipe"), - drawtype = "plantlike", - tiles = {"techage_oil_drillbit.png"}, - inventory_image = "techage_oil_drillbit_inv.png", - wield_image = "techage_oil_drillbit_inv.png", - visual_scale = 1, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - groups = {cracky = 1}, - is_ground_content = false, -}) - -minetest.register_node("techage:oil_drillbit2", { - description = S("TA3 Drill Pipe"), - drawtype = "plantlike", - tiles = {"techage_oil_drillbit.png"}, - inventory_image = "techage_oil_drillbit_inv.png", - wield_image = "techage_oil_drillbit_inv.png", - visual_scale = 1, - paramtype = "light", - use_texture_alpha = techage.CLIP, - drop = "", - diggable = false, - sunlight_propagates = true, - groups = {not_in_creative_inventory = 1}, - is_ground_content = false, -}) - -local AssemblyPlan = { - -- y-offs, path, facedir-offs, name - - -- level 0 - { 0, {0,1}, 0, "techage:oiltower1"}, - { 0, {0,3}, 0, "techage:oiltower1"}, - { 0, {2,1}, 0, "techage:oiltower1"}, - { 0, {2,3}, 0, "techage:oiltower1"}, - -- level 1 - { 1, {0,1}, 0, "techage:oiltower1"}, - { 1, {0,3}, 0, "techage:oiltower1"}, - { 1, {2,1}, 0, "techage:oiltower1"}, - { 1, {2,3}, 0, "techage:oiltower1"}, - { 1, {0}, 2, "techage:oiltower5"}, - { 1, {1}, 3, "techage:oiltower5"}, - { 1, {2}, 0, "techage:oiltower5"}, - { 1, {3}, 1, "techage:oiltower5"}, - -- level 2 - { 2, {0,1}, 0, "techage:oiltower2"}, - { 2, {0,3}, 3, "techage:oiltower2"}, - { 2, {2,1}, 1, "techage:oiltower2"}, - { 2, {2,3}, 2, "techage:oiltower2"}, - { 2, {0}, 2, "techage:oiltower5"}, - { 2, {1}, 3, "techage:oiltower5"}, - { 2, {2}, 0, "techage:oiltower5"}, - { 2, {3}, 1, "techage:oiltower5"}, - -- level 3 - { 3, {0,1}, 0, "techage:oiltower3"}, - { 3, {0,3}, 3, "techage:oiltower3"}, - { 3, {2,1}, 1, "techage:oiltower3"}, - { 3, {2,3}, 2, "techage:oiltower3"}, - { 3, {0}, 2, "techage:oiltower5"}, - { 3, {1}, 3, "techage:oiltower5"}, - { 3, {2}, 0, "techage:oiltower5"}, - { 3, {3}, 1, "techage:oiltower5"}, - -- level 4 - { 4, {0,1}, 0, "techage:oiltower4"}, - { 4, {0,3}, 3, "techage:oiltower4"}, - { 4, {2,1}, 1, "techage:oiltower4"}, - { 4, {2,3}, 2, "techage:oiltower4"}, - { 4, {0}, 2, "techage:oiltower5"}, - { 4, {1}, 3, "techage:oiltower5"}, - { 4, {2}, 0, "techage:oiltower5"}, - { 4, {3}, 1, "techage:oiltower5"}, - -- level 5 - { 5, {0}, 2, "techage:oiltower5"}, - { 5, {1}, 3, "techage:oiltower5"}, - { 5, {2}, 0, "techage:oiltower5"}, - { 5, {3}, 1, "techage:oiltower5"}, - -- level 6 - { 6, {0}, 2, "techage:oiltower5"}, - { 6, {1}, 3, "techage:oiltower5"}, - { 6, {2}, 0, "techage:oiltower5"}, - { 6, {3}, 1, "techage:oiltower5"}, - -- level 7 - { 7, {}, 0, "techage:oiltower1"}, - -- drill bits - { 1, {}, 0, "techage:oil_drillbit2"}, - { 2, {}, 0, "techage:oil_drillbit2"}, - { 3, {}, 0, "techage:oil_drillbit2"}, - { 4, {}, 0, "techage:oil_drillbit2"}, - { 5, {}, 0, "techage:oil_drillbit2"}, - { 6, {}, 0, "techage:oil_drillbit2"}, -} - -minetest.register_craft({ - output = "techage:oil_drillbit 12", - recipe = { - {"", "default:steel_ingot", "default:obsidian_shard"}, - {"", "default:steel_ingot", ""}, - {"default:obsidian_shard", "default:steel_ingot", ""}, - }, -}) - -techage.oiltower = {} - --- Two important flags: --- 1) mem.assemble_locked is true while the tower is being assembled/disassembled --- 2) mem.assemble_build is true if the tower is assembled -function techage.oiltower.build(pos, player_name) - minetest.chat_send_player(player_name, S("[TA] Derrick is being built!")) - techage.assemble.build(pos, AssemblyPlan, player_name) -end - -function techage.oiltower.remove(pos, player_name) - minetest.chat_send_player(player_name, S("[TA] Derrick is being removed!")) - techage.assemble.remove(pos, AssemblyPlan, player_name) -end diff --git a/techage/power/drive_axle.lua b/techage/power/drive_axle.lua deleted file mode 100644 index 6811ecc..0000000 --- a/techage/power/drive_axle.lua +++ /dev/null @@ -1,194 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Drive Axles for the Steam Engine - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local power = networks.power - -local Axle = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = 10, - show_infotext = false, - tube_type = "axle", - primary_node_names = {"techage:axle", "techage:axle_on", "techage:ta2_clutch_on"}, - secondary_node_names = {}, - after_place_tube = function(pos, param2, tube_type, num_tubes, state) - local node = minetest.get_node(pos) - local name = node.name - if name == "techage:axle_on" or name == "techage:axle" then - if state == "on" then -- texture state - minetest.swap_node(pos, {name = "techage:axle_on", param2 = param2}) - else - minetest.swap_node(pos, {name = "techage:axle", param2 = param2}) - end - else - minetest.swap_node(pos, {name = name, param2 = param2}) - end - end, -}) - --- Use global callback instead of node related functions -Axle:register_on_tube_update2(function(pos, outdir, tlib2, node) - power.update_network(pos, outdir, tlib2, node) -end) - -minetest.register_node("techage:axle", { - description = S("TA2 Drive Axle"), - tiles = { - "techage_axleR.png", - "techage_axleR.png", - "techage_axle.png", - "techage_axle.png", - "techage_axle_clutch.png", - "techage_axle_clutch.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Axle:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/16, -3/16, -4/8, 3/16, 3/16, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 3, cracky = 3, snappy = 3}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:axle_on", { - description = S("TA2 Drive Axle"), - tiles = { - { - name = "techage_axle4R.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_axle4R.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_axle4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_axle4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_axle_clutch4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_axle_clutch4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Axle:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/16, -3/16, -4/8, 3/16, 3/16, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - diggable = false, - groups = {not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:axle 3", - recipe = { - {"default:junglewood", "", "default:wood"}, - {"", "techage:iron_ingot", ""}, - {"default:wood", "", "default:junglewood"}, - }, -}) - - -techage.Axle = Axle diff --git a/techage/power/electric_cable.lua b/techage/power/electric_cable.lua deleted file mode 100644 index 80b89cf..0000000 --- a/techage/power/electric_cable.lua +++ /dev/null @@ -1,193 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Electric Cables (AC) - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local power = networks.power - -local ELE1_MAX_CABLE_LENGHT = 1000 - -local Cable = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = ELE1_MAX_CABLE_LENGHT, - show_infotext = false, - tube_type = "ele1", - primary_node_names = {"techage:electric_cableS", "techage:electric_cableA", - "techage:power_line", "techage:power_lineS", "techage:power_lineA", - "techage:power_pole2", "techage:powerswitch_box", "techage:powerswitch_box_on"}, - secondary_node_names = {}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - local node = minetest.get_node(pos) - local name = node.name - local color_param2 = math.floor(node.param2 / 32) * 32 - if name == "techage:powerswitch_box" or name == "techage:powerswitch_box_on" or name == "techage:powerswitch_box_off" then - minetest.swap_node(pos, {name = name, param2 = param2 % 32}) - elseif name == "techage:power_line" or name == "techage:power_lineS" or name == "techage:power_lineA" then - minetest.swap_node(pos, {name = "techage:power_line"..tube_type, param2 = param2 % 32}) - elseif name == "techage:power_pole2" then - -- nothing - elseif not networks.hidden_name(pos) then - minetest.swap_node(pos, {name = "techage:electric_cable"..tube_type, param2 = param2 % 32 + color_param2}) - end - M(pos):set_int("netw_param2", param2) - M(pos):set_int("netw_color_param2", color_param2) - end, -}) - --- Enable hidden cables -networks.use_metadata(Cable) -networks.register_hidden_message("Use the trowel tool to remove the node.") - --- Use global callback instead of node related functions -Cable:register_on_tube_update2(function(pos, outdir, tlib2, node) - power.update_network(pos, outdir, tlib2, node) -end) - -local preserve_metadata = function(pos, oldnode, oldmeta, drops) - for _,drop in ipairs(drops) do - local meta = drop:get_meta() - if meta:get_int("palette_index") == 0 then - meta:set_string("palette_index", "") - end - end -end - -minetest.register_node("techage:electric_cableS", { - description = S("TA Electric Cable"), - tiles = { - -- up, down, right, left, back, front - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - }, - overlay_tiles = { - "", - "", - "", - "", - { name = "techage_electric_cable_end.png", color = "white" }, - { name = "techage_electric_cable_end.png", color = "white" }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "colorfacedir", -- important! - palette = "techage_cable_palette.png", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/32, -3/32, -4/8, 3/32, 3/32, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, techage_trowel = 1}, - sounds = default.node_sound_defaults(), - preserve_metadata = preserve_metadata, -}) - -minetest.register_node("techage:electric_cableA", { - description = S("TA Electric Cable"), - tiles = { - -- up, down, right, left, back, front - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - "techage_electric_cable.png", - }, - overlay_tiles = { - "", - { name = "techage_electric_cable_end.png", color = "white" }, - "", - "", - "", - { name = "techage_electric_cable_end.png", color = "white" }, - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "colorfacedir", -- important! - palette = "techage_cable_palette.png", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/32, -4/8, -3/32, 3/32, 3/32, 3/32}, - {-3/32, -3/32, -4/8, 3/32, 3/32, -3/32}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, - techage_trowel = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), - drop = { - items = { - { items = { "techage:electric_cableS" }, inherit_color = true }, - } - }, - preserve_metadata = preserve_metadata, -}) - -minetest.register_craft({ - output = "techage:electric_cableS 6", - recipe = { - {"basic_materials:plastic_sheet", "", ""}, - {"", "default:copper_ingot", ""}, - {"", "", "basic_materials:plastic_sheet"}, - }, -}) - -techage.ElectricCable = Cable -techage.ELE1_MAX_CABLE_LENGTH = ELE1_MAX_CABLE_LENGHT - - -for idx, color in ipairs({ "white", "grey", "black", "brown", "yellow", "red", "dark_green", "blue" }) do - minetest.register_craft({ - output = idx == 1 and "techage:electric_cableS 8" or minetest.itemstring_with_palette("techage:electric_cableS 8", (idx-1)*32), - recipe = { - { "techage:electric_cableS", "techage:electric_cableS", "techage:electric_cableS", }, - { "techage:electric_cableS", "dye:"..color, "techage:electric_cableS", }, - { "techage:electric_cableS", "techage:electric_cableS", "techage:electric_cableS", }, - } - }) -end diff --git a/techage/power/formspecs.lua b/techage/power/formspecs.lua deleted file mode 100644 index 5791c9a..0000000 --- a/techage/power/formspecs.lua +++ /dev/null @@ -1,321 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Power Formspec Functions - -]]-- - ---local P2S = minetest.pos_to_string ---local M = minetest.get_meta ---local N = function(pos) return minetest.get_node(pos).name end -local S = techage.S - -local CYCLE_TIME = 2 -local CYCLES_PER_DAY = 20 * 60 / CYCLE_TIME - -local in_range = techage.in_range -local power = networks.power -techage.power = {} - -------------------------------------------------------------------------------- --- Helper function -------------------------------------------------------------------------------- -local function round(val) - val = tonumber(val) or 0 - if val > 100 then - return math.floor(val + 0.5) - elseif val > 10 then - return math.floor((val * 10) + 0.5) / 10 - else - return math.floor((val * 100) + 0.5) / 100 - end -end - -local function calc_percent(max_val, curr_val) - return round(math.min(((curr_val or 0) * 100) / (max_val or 1.0), 100)) -end - -------------------------------------------------------------------------------- --- Local bar functions -------------------------------------------------------------------------------- --- charging > 0 ==> charging --- charging < 0 ==> uncharging --- charging = 0 ==> off --- percent: 0..100 -local function charging_bar(charging, percent) - if charging > 0 then - return "techage_form_level_off.png^[lowpart:" .. percent .. ":techage_form_level_charge.png" - elseif charging < 0 then - return "techage_form_level_unload.png^[lowpart:" .. percent .. ":techage_form_level_off.png" - else - return "techage_form_level_off.png" - end -end - -local function power_bar(current_power, max_power) - local percent, ypos - - current_power = current_power or 0 - - if current_power == 0 then - percent = 0 - ypos = 2.8 - else - percent = calc_percent(max_power, current_power) - -- 0.4 to 2.8 = 2.4 - local offs = 2.4 - (current_power / max_power) * 2.4 - ypos = 0.4 + in_range(offs, 0.4, 2.4) - end - current_power = round(current_power) - max_power = round(max_power) - percent = (percent + 5) / 1.1 -- texture correction - - return "label[0.7,0.4;" .. max_power .. " ku]" .. - "image[0,0.5;1,3;" .. - "techage_form_level_bg.png^[lowpart:" .. percent .. - ":techage_form_level_fg.png]" .. - "label[0.7," .. ypos .. ";" .. current_power .. " ku]" -end - -local function storage_bar(current_power, max_power) - local percent, ypos - max_power = (max_power or 1) / CYCLES_PER_DAY - current_power = (current_power or 0) / CYCLES_PER_DAY - - if current_power == 0 then - percent = 0 - ypos = 2.8 - else - percent = calc_percent(max_power, current_power) - -- 0.4 to 2.8 = 2.4 - local offs = 2.4 - (current_power / max_power) * 2.4 - ypos = 0.4 + in_range(offs, 0.4, 2.4) - end - current_power = round(current_power) - max_power = round(max_power) - - local percent2 = (percent + 5) / 1.1 -- texture correction - return "label[0.7,0.4;" .. max_power .. " kud]" .. - "image[0,0.5;1,3;".. - "techage_form_level_bg.png^[lowpart:" .. percent2 .. - ":techage_form_level_fg.png]" .. - "label[0.7," .. ypos .. ";" .. round(percent) .. " %]" -end - -------------------------------------------------------------------------------- --- API bar functions -------------------------------------------------------------------------------- -function techage.formspec_power_bar(pos, x, y, label, current_power, max_power) - return "container["..x..","..y.."]".. - "box[0,0;2.3,3.3;#395c74]".. - "label[0.2,0;"..label.."]".. - power_bar(current_power, max_power).. - "container_end[]" -end - -function techage.formspec_charging_bar(pos, x, y, label, data) - local charging = 0 - local percent = 50 - local ypos = 1.6 - - if data then - charging = data.provided - data.consumed - if charging > 0 then - percent = 50 + (charging / data.available * 50) - ypos = 1.6 - (charging / data.available * 1.2) - elseif charging < 0 then - percent = 50 + (charging / data.consumed * 50) - ypos = 1.6 - (charging / data.consumed * 1.2) - end - end - ypos = in_range(ypos, 0.4, 2.8) - - return "container[".. x .. "," .. y .. "]" .. - "box[0,0;2.3,3.3;#395c74]" .. - "label[0.2,0;" .. label .. "]" .. - "image[0,0.5;1,3;" .. charging_bar(charging, percent) .. "]" .. - "label[0.75," .. ypos .. ";" .. round(charging) .. " ku]" .. - "container_end[]" -end - -function techage.formspec_storage_bar(pos, x, y, label, curr_load, max_load) - curr_load = curr_load or 0 - - return "container[" .. x .. "," .. y .. "]" .. - "box[0,0;2.3,3.3;#395c74]" .. - "label[0.2,0;" .. label .. "]" .. - storage_bar(curr_load, max_load) .. - "container_end[]" -end - -function techage.formspec_meter(pos, x, y, label, value, unit) - return "container[" .. x .. "," .. y .. "]" .. - "box[0,0;2.3,0.9;#395c74]" .. - "label[0.2,0.0;" .. label .. ":]" .. - "label[0.2,0.4;" .. round(value) .. " " .. unit .. "]" .. - "container_end[]" -end - -------------------------------------------------------------------------------- --- API formspec functions -------------------------------------------------------------------------------- -function techage.wrench_image(x, y) - return "image["..x.."," .. y .. ";0.5,0.5;techage_inv_wrench.png]" .. - "tooltip["..x.."," .. y .. ";0.5,0.5;" .. S("Block has a wrench menu") .. ";#0C3D32;#FFFFFF]" -end - -function techage.storage_formspec(self, pos, nvm, label, netw_data, curr_load, max_load) - return "size[6.3,4]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;6.1,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", label) .. "]" .. - techage.formspec_charging_bar(pos, 0.0, 0.8, S("Charging"), netw_data) .. - techage.formspec_storage_bar (pos, 3.8, 0.8, S("Storage"), curr_load, max_load) .. - "image_button[2.7,2;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[2.7,2;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -function techage.generator_formspec(self, pos, nvm, label, provided, max_available, ta2) - local tooltip = "" - if not ta2 then - tooltip = techage.wrench_tooltip(4.4, -0.05) - end - return "size[5,4]" .. - default.gui_bg .. - default.gui_bg_img .. - default.gui_slots .. - "box[0,-0.1;4.8,0.5;#c6e8ff]" .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", label) .. "]" .. - tooltip.. - techage.formspec_power_bar(pos, 0, 0.8, S("Power"), provided, max_available) .. - "image_button[3.2,2.0;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3.2,2.0;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -function techage.generator_settings(tier, available) - if tier == "ta3" then - return { - { - type = "const", - name = "available", - label = S("Maximum output [ku]"), - tooltip = S("The maximum power the generator can provide"), - value = available, - }, - { - type = "output", - name = "provided", - label = S("Current output [ku]"), - tooltip = S("The current power the generator provides"), - }, - { - type = "dropdown", - choices = "0% - 20%,20% - 40%,40% - 60%,60% - 80%,80% - 100%,90% - 100%", - name = "termpoint", - label = S("Charge termination"), - tooltip = S("Range in which the generator reduces its power"), - default = "80% - 100%", - }, - } - else - return { - { - type = "const", - name = "available", - label = S("Maximum output [ku]"), - tooltip = S("The maximum power the generator can provide"), - value = available, - }, - { - type = "output", - name = "provided", - label = S("Current output [ku]"), - tooltip = S("The current power the generator provides"), - }, - { - type = "dropdown", - choices = "0% - 20%,20% - 40%,40% - 60%,60% - 80%,80% - 100%,90% - 100%", - name = "termpoint", - label = S("Charge termination"), - tooltip = S("Range in which the generator reduces its power"), - default = "80% - 100%", - }, - } - end -end - - -function techage.evaluate_charge_termination(nvm, meta) - local termpoint = meta:get_string("termpoint") - if termpoint == "0% - 20%" then - meta:set_string("termpoint1", 0.0) - meta:set_string("termpoint2", 0.2) - elseif termpoint == "20% - 40%" then - meta:set_string("termpoint1", 0.2) - meta:set_string("termpoint2", 0.4) - elseif termpoint == "40% - 60%" then - meta:set_string("termpoint1", 0.4) - meta:set_string("termpoint2", 0.6) - elseif termpoint == "60% - 80%" then - meta:set_string("termpoint1", 0.6) - meta:set_string("termpoint2", 0.8) - elseif termpoint == "80% - 100%" then - meta:set_string("termpoint1", 0.8) - meta:set_string("termpoint2", 1.0) - elseif termpoint == "90% - 100%" then - meta:set_string("termpoint1", 0.9) - meta:set_string("termpoint2", 1.0) - else - meta:set_string("termpoint", "80% - 100%") - meta:set_string("termpoint1", 0.8) - meta:set_string("termpoint2", 1.0) - end -end - -techage.power.percent = calc_percent -techage.CYCLES_PER_DAY = CYCLES_PER_DAY -techage.round = round - -------------------------------------------------------------------------------- --- Still used legacy functions -------------------------------------------------------------------------------- -function techage.formspec_label_bar(pos, x, y, label, max_power, current_power, unit) - local percent, ypos - - max_power = max_power or 1 - unit = unit or "ku" - current_power = current_power or 0 - - if current_power == 0 then - percent = 0 - ypos = 2.8 - else - percent = techage.power.percent(max_power, current_power) - -- 0.4 to 2.8 = 2.4 - local offs = 2.4 - (current_power / max_power) * 2.4 - ypos = 0.4 + in_range(offs, 0.4, 2.4) - end - if current_power >= 100 then - current_power = math.floor(current_power) - end - percent = (percent + 5) / 1.1 -- texture correction - return "container["..x..","..y.."]".. - "box[0,0;2.3,3.3;#395c74]".. - "label[0.2,0;"..label.."]".. - "label[0.7,0.4;"..max_power.." "..unit.."]".. - "image[0,0.5;1,3;".. - "techage_form_level_bg.png^[lowpart:"..percent.. - ":techage_form_level_fg.png]".. - "label[0.7,"..ypos..";"..current_power.." "..unit.."]".. - "container_end[]" - -end diff --git a/techage/power/gearbox.lua b/techage/power/gearbox.lua deleted file mode 100644 index d4406dc..0000000 --- a/techage/power/gearbox.lua +++ /dev/null @@ -1,146 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Gearbox - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local PWR_NEEDED = 1 -local CYCLE_TIME = 2 - -local Axle = techage.Axle -local power = networks.power - --- Axles texture animation -local function switch_axles(pos, on) - for _,outdir in ipairs(networks.get_outdirs(pos, Axle)) do - Axle:switch_tube_line(pos, outdir, on and "on" or "off") - end -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function node_timer_on(pos, elapsed) - local consumed = power.consume_power(pos, Axle, 0, PWR_NEEDED) - if consumed == 0 then - swap_node(pos, "techage:gearbox") - switch_axles(pos, false) - end - return true -end - -local function node_timer_off(pos, elapsed) - if power.power_available(pos, Axle, 0) then - swap_node(pos, "techage:gearbox_on") - switch_axles(pos, true) - end - return true -end - --- to be able to restart the node after server crashes -local function techage_on_repair(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) -end - -local function after_place_node(pos) - Axle:after_place_node(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) -end - -local function after_dig_node(pos, oldnode) - Axle:after_dig_node(pos) -end - -local function tubelib2_on_update2_on(pos, outdir, tlib2, node) - power.update_network(pos, 0, tlib2, node) - switch_axles(pos, true) -end - -local function tubelib2_on_update2_off(pos, outdir, tlib2, node) - power.update_network(pos, 0, tlib2, node) - switch_axles(pos, false) -end - -minetest.register_node("techage:gearbox", { - description = S("TA2 Gearbox"), - tiles = {"techage_filling_ta2.png^techage_axle_gearbox.png^techage_frame_ta2.png"}, - - on_timer = node_timer_off, - techage_on_repair = techage_on_repair, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2_off, - paramtype = "light", - light_source = 0, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_node("techage:gearbox_on", { - tiles = { - -- up, down, right, left, back, front - { - name = "techage_filling4_ta2.png^techage_axle_gearbox4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - }, - - on_timer = node_timer_on, - techage_on_repair = techage_on_repair, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2_on, - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - drop = "", - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:gearbox", "techage:gearbox_on"}, Axle, "junc") - -techage.register_node({"techage:gearbox", "techage:gearbox_on"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_craft({ - output = "techage:gearbox 2", - recipe = { - {"default:junglewood", "techage:axle", "default:wood"}, - {"techage:axle", "techage:iron_ingot", "techage:axle"}, - {"default:wood", "techage:axle", "default:junglewood"}, - }, -}) diff --git a/techage/power/junctionbox.lua b/techage/power/junctionbox.lua deleted file mode 100644 index 81e0310..0000000 --- a/techage/power/junctionbox.lua +++ /dev/null @@ -1,66 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Junction box for electrical power distribution - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local size = 3/32 -local Boxes = { - {{-size, -size, size, size, size, 0.5 }}, -- z+ - {{-size, -size, -size, 0.5, size, size}}, -- x+ - {{-size, -size, -0.5, size, size, size}}, -- z- - {{-0.5, -size, -size, size, size, size}}, -- x- - {{-size, -0.5, -size, size, size, size}}, -- y- - {{-size, -size, -size, size, 0.5, size}}, -- y+ -} - -local names = networks.register_junction("techage:electric_junction", 2/8, Boxes, Cable, { - description = S("TA Electric Junction Box"), - tiles = {"techage_electric_junction.png"}, - use_texture_alpha = techage.CLIP, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, techage_trowel = 1}, - sounds = default.node_sound_defaults(), - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local name = "techage:electric_junction" .. networks.junction_type(pos, Cable) - minetest.swap_node(pos, {name = name, param2 = 0}) - Cable:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - if not networks.hidden_name(pos) then - local name = "techage:electric_junction" .. networks.junction_type(pos, Cable) - minetest.swap_node(pos, {name = name, param2 = 0}) - end - power.update_network(pos, 0, tlib2, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - end, -}) - -power.register_nodes(names, Cable, "junc") - -minetest.register_craft({ - output = "techage:electric_junction0 2", - recipe = { - {"", "basic_materials:plastic_sheet", ""}, - {"basic_materials:plastic_sheet", "default:copper_ingot", "basic_materials:plastic_sheet"}, - {"", "basic_materials:plastic_sheet", ""}, - }, -}) diff --git a/techage/power/power_line.lua b/techage/power/power_line.lua deleted file mode 100644 index 780552d..0000000 --- a/techage/power/power_line.lua +++ /dev/null @@ -1,370 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Power line for electrical landline -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local function can_dig(pos, digger) - if digger and digger:is_player() then - if M(pos):get_string("owner") == digger:get_player_name() then - return true - end - if minetest.check_player_privs(digger:get_player_name(), "powerline") then - return true - end - end - return false -end - --- legacy node -minetest.register_node("techage:power_line", { - description = S("TA Power Line"), - tiles = {"techage_power_line.png"}, - inventory_image = 'techage_power_line_inv.png', - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/32, -1/32, -4/8, 1/32, 1/32, 4/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-2/32, -2/32, -4/8, 2/32, 2/32, 4/8}, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - drop = "techage:power_lineS", - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), -}) - --- new nodes lineS/lineA -minetest.register_node("techage:power_lineS", { - description = S("TA Power Line"), - tiles = {"techage_power_line.png"}, - inventory_image = 'techage_power_line_inv.png', - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/32, -1/32, -4/8, 1/32, 1/32, 4/8}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-2/32, -2/32, -4/8, 2/32, 2/32, 4/8}, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - drop = "techage:power_lineS", - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("techage:power_lineA", { - description = S("TA Power Line"), - tiles = { - "techage_power_line.png", - "techage_power_line.png^[transformR180", - "techage_power_line.png^[transformR270", - "techage_power_line.png", - "techage_power_line.png", - "techage_power_line.png", - }, - inventory_image = 'techage_power_line_inv.png', - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/32, -16/32, -1/32, 1/32, -15/32, 1/32}, - {-1/32, -16/32, -2/32, 1/32, -14/32, 0/32}, - {-1/32, -15/32, -3/32, 1/32, -13/32, -1/32}, - {-1/32, -14/32, -4/32, 1/32, -12/32, -2/32}, - {-1/32, -13/32, -5/32, 1/32, -11/32, -3/32}, - {-1/32, -12/32, -6/32, 1/32, -10/32, -4/32}, - {-1/32, -11/32, -7/32, 1/32, -9/32, -5/32}, - {-1/32, -10/32, -8/32, 1/32, -8/32, -6/32}, - {-1/32, -9/32, -9/32, 1/32, -7/32, -7/32}, - {-1/32, -8/32, -10/32, 1/32, -6/32, -8/32}, - {-1/32, -7/32, -11/32, 1/32, -5/32, -9/32}, - {-1/32, -6/32, -12/32, 1/32, -4/32, -10/32}, - {-1/32, -5/32, -13/32, 1/32, -3/32, -11/32}, - {-1/32, -4/32, -14/32, 1/32, -2/32, -12/32}, - {-1/32, -3/32, -15/32, 1/32, -1/32, -13/32}, - {-1/32, -2/32, -16/32, 1/32, 0/32, -14/32}, - {-1/32, -1/32, -16/32, 1/32, 1/32, -15/32}, - }, - }, - selection_box = { - type = "fixed", - fixed = {-2/32, -16/32, 2/32, 2/32, 2/32, -16/32}, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - drop = "techage:power_lineS", - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("techage:power_pole2", { - description = S("TA Power Pole Top 2 (for landlines)"), - tiles = { - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole.png" - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -4/32, -16/32, -4/32, 4/32, 16/32, 4/32}, - { -1/32, -6/32, -16/32, 1/32, -4/32, 16/32}, - { -2/32, -4/32, -16/32, 2/32, 4/32, -12/32}, - { -2/32, -4/32, 12/32, 2/32, 4/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - M(pos):set_string("owner", placer:get_player_name()) - if techage.is_protected(pos, placer:get_player_name()) then - minetest.chat_send_player(placer:get_player_name(), "position is protected ") - minetest.remove_node(pos) - return true - end - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.chat_send_player(placer:get_player_name(), "invalid pole position ") - minetest.remove_node(pos) - Cable:after_dig_node(pos) - return true - end - return false - end, - can_dig = can_dig, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - --- dummy node for the inventory and to be placed and imediately replaced -minetest.register_node("techage:power_pole", { - description = S("TA Power Pole Top (for up to 6 connections)"), - tiles = { - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole.png" - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -4/32, -16/32, -4/32, 4/32, 16/32, 4/32}, - {-16/32, -6/32, -1/32, 16/32, -4/32, 1/32}, - { -1/32, -6/32, -16/32, 1/32, -4/32, 16/32}, - {-16/32, -4/32, -2/32, -12/32, 4/32, 2/32}, - { 12/32, -4/32, -2/32, 16/32, 4/32, 2/32}, - { -2/32, -4/32, -16/32, 2/32, 4/32, -12/32}, - { -2/32, -4/32, 12/32, 2/32, 4/32, 16/32}, - }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - M(pos):set_string("owner", placer:get_player_name()) - if techage.is_protected(pos, placer:get_player_name()) then - minetest.chat_send_player(placer:get_player_name(), "position is protected ") - minetest.remove_node(pos) - return true - end - local node = minetest.get_node(pos) - node.name = "techage:power_pole_conn" - minetest.swap_node(pos, node) - Cable:after_place_node(pos) - end, - - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, -}) - - --- secondary node like a junction -minetest.register_node("techage:power_pole_conn", { - description = "TA Power Pole Top (for up to 6 connections)", - tiles = { - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole_top.png", - "default_wood.png^techage_power_pole.png" - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "connected", - fixed = {{ -4/32, -16/32, -4/32, 4/32, 16/32, 4/32}}, - - connect_left = {{-16/32, -6/32, -1/32, 1/32, -4/32, 1/32}, - {-16/32, -4/32, -2/32, -12/32, 4/32, 2/32}}, - connect_right = {{ -1/32, -6/32, -1/32, 16/32, -4/32, 1/32}, - {12/32, -4/32, -2/32, 16/32, 4/32, 2/32}}, - connect_back = {{-1/32, -6/32, -1/32, 1/32, -4/32, 16/32}, - {-2/32, -4/32, 12/32, 2/32, 4/32, 16/32}}, - connect_front = {{-1/32, -6/32, -16/32, 1/32, -4/32, 1/32}, - {-2/32, -4/32, -16/32, 2/32, 4/32, -12/32}}, - }, - connects_to = {"techage:power_line", "techage:power_lineS", "techage:power_lineA"}, - - can_dig = can_dig, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - end, - - drop = "techage:power_pole", - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), -}) - -power.register_nodes({"techage:power_pole_conn"}, Cable, "junc") - -minetest.register_node("techage:power_pole3", { - description = S("TA Power Pole"), - tiles = { - "default_wood.png", - "default_wood.png", - "default_wood.png" - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -4/32, -16/32, -4/32, 4/32, 16/32, 4/32}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_craft({ - output = "techage:power_lineS 24", - recipe = { - {"default:copper_ingot", "", ""}, - {"", "default:copper_ingot", ""}, - {"", "", "default:copper_ingot"}, - }, -}) - -minetest.register_craft({ - output = "techage:power_pole2", - recipe = { - {"", "default:stick", ""}, - {"techage:power_lineS", "default:copper_ingot", "techage:power_lineS"}, - {"", "default:stick", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:power_pole", - recipe = { - {"", "", ""}, - {"", "techage:power_pole2", ""}, - {"", "techage:power_pole2", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:power_pole3 4", - recipe = { - {"", "group:wood", ""}, - {"", "techage:power_lineS", ""}, - {"", "group:wood", ""}, - }, -}) diff --git a/techage/power/power_terminal.lua b/techage/power/power_terminal.lua deleted file mode 100644 index 3602ab5..0000000 --- a/techage/power/power_terminal.lua +++ /dev/null @@ -1,15 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Terminal Old - -]]-- - -minetest.register_alias_force("techage:power_terminal", "techage:ta3_power_terminal") diff --git a/techage/power/power_terminal2.lua b/techage/power/power_terminal2.lua deleted file mode 100644 index cc13626..0000000 --- a/techage/power/power_terminal2.lua +++ /dev/null @@ -1,342 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Terminal - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta -local N = function(pos) return minetest.get_node(pos).name end -local S = techage.S - -local CYCLE_TIME = 2 - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local HELP = S([[Commands -help . . . print this text -cls . . . . clear screen -gen . . print generators -sto . . print storage systems -con1 . . print consumers with power consumption between 1 and 10 ku -con2 . . print consumers with power consumption with 10 ku or above -]]) - -local function row(num, label, data) - local y = 4.0 + num * 0.5 - return - "box[0," .. y .. ";9.8,0.4;#395c74]".. - "label[0.2,"..y..";" .. label .. "]" .. - "label[8.5,"..y..";" .. data .. "]" -end - -local function formspec1(pos, data) - local mem = techage.get_mem(pos) - local outdir = M(pos):get_int("outdir") - local netw = networks.get_network_table(pos, Cable, outdir, true) or {} - data = data or power.get_network_data(pos, Cable, outdir) - - mem.star = ((mem.star or 0) + 1) % 2 - local star = mem.star == 1 and "*" or "" - local storage_provided = math.max(data.consumed - data.available, 0) - local available = math.max(data.consumed, data.available) - - return "size[10,8]".. - "tabheader[0,0;tab;status,console;1;;true]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;9.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize( "#000000", S("Network Data")).."]".. - "label[9.5,-0.1;"..minetest.colorize( "#000000", star).."]".. - techage.formspec_power_bar(pos, 0.0, 0.7, S("Generator"), data.provided, data.available).. - techage.formspec_power_bar(pos, 2.5, 0.7, S("Consumer"), data.consumed, available).. - techage.formspec_charging_bar(pos, 5.0, 0.7, S("Charging"), data).. - techage.formspec_storage_bar(pos, 7.5, 0.7, S("Storage"), data.curr_load, data.max_capa).. - - row(1, S("Number of network nodes:"), netw.num_nodes or 0) .. - row(2, S("Number of generators:"), #(netw.gen or {})) .. - row(3, S("Number of consumers:"), #(netw.con or {})) .. - row(4, S("Number of storage systems:"), #(netw.sto or {})) -end - -local function formspec2(pos) - local mem = techage.get_mem(pos) - local meta = M(pos) - local output = meta:get_string("output") - local command = mem.cmnd or "help" - output = minetest.formspec_escape(output) - output = output:gsub("\n", ",") - - return "size[10,8]".. - "tabheader[0,0;tab;status,console;2;;true]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;9.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize( "#000000", S("Network Data")).."]".. - --"style_type[table,field;font=mono]".. - "table[0,0.5;9.8,6.8;output;"..output..";200]".. - "field[0.4,7.7;7.6,1;cmnd;;"..command.."]" .. - "field_close_on_enter[cmnd;false]".. - "button[7.9,7.4;2,1;enter;"..S("Enter").."]" -end - --------------------------------------------------------------------------------------- ---Overwrite networks.power.consume_power function --------------------------------------------------------------------------------------- -local origin_consume_power = networks.power.consume_power - -function networks.power.consume_power(pos, tlib2, outdir, amount) - local nvm = techage.get_nvm(pos) - nvm.power_taken = origin_consume_power(pos, tlib2, outdir, amount) - return nvm.power_taken -end - -local function get_consumer_power_consumption(pos) - if pos then - local nvm = techage.get_nvm(pos) - if nvm.running or techage.needs_power(nvm) then - return nvm.power_taken or 0 - end - end - return 0 -end - -local function generators(pos) - local tbl = {} - local outdir = M(pos):get_int("outdir") - local resp = control.request(pos, Cable, outdir, "gen", "info") - for _, item in ipairs(resp) do - if item.running then - local s = string.format("%s (%s): %s/%u ku (%s)", - item.type, item.number, techage.round(item.provided), item.available, item.termpoint) - tbl[#tbl + 1] = s - else - local s = string.format("%s (%s): off", - item.type, item.number) - tbl[#tbl + 1] = s - end - end - table.sort(tbl) - return table.concat(tbl, "\n") -end - -local function storages(pos) - local tbl = {} - local outdir = M(pos):get_int("outdir") - local resp = control.request(pos, Cable, outdir, "sto", "info") - for _, item in ipairs(resp) do - -- TA4/TA5 heatexchangers are no storage systems - if item.capa and item.capa > 1 then - if item.running then - local s = string.format("%s (%s): %s/%s kud", - item.type, item.number, - techage.round(item.load / techage.CYCLES_PER_DAY), - techage.round(item.capa / techage.CYCLES_PER_DAY)) - tbl[#tbl + 1] = s - else - local s = string.format("%s (%s): %s/%s kud (off)", - item.type, item.number, - techage.round(item.load / techage.CYCLES_PER_DAY), - techage.round(item.capa / techage.CYCLES_PER_DAY)) - tbl[#tbl + 1] = s - end - end - end - table.sort(tbl) - return table.concat(tbl, "\n") -end - -local function consumers(pos, min, max) - local tbl = {} - local outdir = M(pos):get_int("outdir") - local netw = networks.get_network_table(pos, Cable, outdir) or {} - for _,item in ipairs(netw.con or {}) do - local number = techage.get_node_number(item.pos) - if number then - local name = techage.get_node_lvm(item.pos).name - name = (minetest.registered_nodes[name] or {}).description or "unknown" - local taken = techage.round(get_consumer_power_consumption(item.pos)) - if taken > min and taken < max then - tbl[#tbl + 1] = string.format("%s (%s): %s ku", name, number, taken) - end - else - local name = techage.get_node_lvm(item.pos).name - name = (minetest.registered_nodes[name] or {}).description or "unknown" - local taken = techage.round(get_consumer_power_consumption(item.pos)) - if taken > min and taken < max then - tbl[#tbl + 1] = string.format("%s: %s ku", name, taken) - end - end - end - table.sort(tbl) - return table.concat(tbl, "\n") -end - -local function output(pos, command, text) - local meta = M(pos) - text = meta:get_string("output") .. "\n$ " .. command .. "\n" .. (text or "") - text = text:sub(-5000,-1) - meta:set_string("output", text) -end - -local function command(pos, nvm, command) - local meta = M(pos) - - if command then - command = command:sub(1,80) - command = string.trim(command) - local cmd, data = unpack(string.split(command, " ", false, 1)) - - if cmd == "cls" then - meta:set_string("output", "") - elseif cmd == "help" then - output(pos, command, HELP) - elseif cmd == "gen" then - output(pos, command, generators(pos)) - elseif cmd == "sto" then - output(pos, command, storages(pos)) - elseif cmd == "con1" then - output(pos, command, consumers(pos, 1, 10)) - elseif cmd == "con2" then - output(pos, command, consumers(pos, 9, 1000)) - elseif command ~= "" then - output(pos, command, "") - end - end -end - -minetest.register_node("techage:ta3_power_terminal", { - description = S("TA3 Power Terminal"), - inventory_image = "techage_power_terminal_front.png", - tiles = { - "techage_power_terminal_top.png", - "techage_power_terminal_top.png", - "techage_power_terminal_side.png", - "techage_power_terminal_side.png", - "techage_power_terminal_back.png", - "techage_power_terminal_front.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 0/16, 8/16, 8/16, 8/16}, - }, - }, - - after_place_node = function(pos, placer) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "B")) - Cable:after_place_node(pos) - M(pos):set_string("formspec", formspec1(pos)) - local number = techage.add_node(pos, "techage:ta3_power_terminal") - M(pos):set_string("node_number", number) - M(pos):set_string("owner", placer:get_player_name()) - M(pos):set_string("infotext", S("TA3 Power Terminal").." "..number) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) - end, - on_rightclick = function(pos, node, clicker) - local mem = techage.get_mem(pos) - if mem.active_formspec == 2 then - M(pos):set_string("formspec", formspec2(pos)) - else - M(pos):set_string("formspec", formspec1(pos)) - minetest.get_node_timer(pos):start(CYCLE_TIME) - techage.set_activeformspec(pos, clicker) - mem.active_formspec = 1 - end - end, - on_timer = function(pos, elapsed) - if techage.is_activeformspec(pos) then - local outdir = M(pos):get_int("outdir") - local data = power.get_network_data(pos, Cable, outdir) - M(pos):set_string("formspec", formspec1(pos, data)) - return true - end - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - - if fields.key_enter_field or fields.enter then - command(pos, nvm, fields.cmnd) - mem.cmnd = "" - M(pos):set_string("formspec", formspec2(pos, mem)) - mem.cmnd = fields.cmnd - elseif fields.tab == "1" then - M(pos):set_string("formspec", formspec1(pos)) - techage.set_activeformspec(pos, player) - minetest.get_node_timer(pos):start(CYCLE_TIME) - mem.active_formspec = 1 - elseif fields.tab == "2" then - M(pos):set_string("formspec", formspec2(pos)) - techage.reset_activeformspec(pos, player) - mem.active_formspec = 2 - elseif fields.key_up and mem.cmnd then - M(pos):set_string("formspec", formspec2(pos)) - end - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - on_rotate = screwdriver.disallow, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, level = 2}, - sounds = default.node_sound_metal_defaults(), -}) - -power.register_nodes({"techage:ta3_power_terminal"}, Cable, "con", {"B"}) - -techage.register_node({"techage:ta3_power_terminal"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "load" then - local outdir = M(pos):get_int("outdir") - local value = networks.power.get_storage_percent(pos, Cable, outdir) - return techage.round(value) - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 134 then - local outdir = M(pos):get_int("outdir") - local value = networks.power.get_storage_percent(pos, Cable, outdir) - return 0, {math.floor(value + 0.5)} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - output = "techage:ta3_power_terminal", - recipe = { - {"", "techage:usmium_nuggets", "default:steel_ingot"}, - {"", "techage:basalt_glass_thin", "default:copper_ingot"}, - {"", "techage:vacuum_tube", "default:steel_ingot"}, - }, -}) diff --git a/techage/power/powerswitch.lua b/techage/power/powerswitch.lua deleted file mode 100644 index 9881524..0000000 --- a/techage/power/powerswitch.lua +++ /dev/null @@ -1,303 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Switch (large and small) - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local Param2ToDir = { - [0] = 6, - [1] = 5, - [2] = 2, - [3] = 4, - [4] = 1, - [5] = 3, -} - -local function sign_in(pos, node) - local dir = Param2ToDir[node.param2] - local pos2 = tubelib2.get_pos(pos, dir) - M(pos2):set_int("switch_sign_in", 1) -end - -local function sign_off(pos, node) - local dir = Param2ToDir[node.param2] - local pos2 = tubelib2.get_pos(pos, dir) - M(pos2):set_int("switch_sign_in", 0) -end - -local function switch_on(pos, node, clicker, name) - if clicker and minetest.is_protected(pos, clicker:get_player_name()) then - return - end - node.name = name - minetest.swap_node(pos, node) - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - local dir = Param2ToDir[node.param2] - local pos2 = tubelib2.get_pos(pos, dir) - - techage.legacy_switches(pos2) - power.turn_switch_on(pos2, Cable, "techage:powerswitch_box_off", "techage:powerswitch_box_on") -end - -local function switch_off(pos, node, clicker, name) - if clicker and minetest.is_protected(pos, clicker:get_player_name()) then - return - end - node.name = name - minetest.swap_node(pos, node) - minetest.get_node_timer(pos):stop() - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5, - }) - local dir = Param2ToDir[node.param2] - local pos2 = tubelib2.get_pos(pos, dir) - - techage.legacy_switches(pos2) - power.turn_switch_off(pos2, Cable, "techage:powerswitch_box_off", "techage:powerswitch_box_on") -end - - -minetest.register_node("techage:powerswitch", { - description = S("TA Power Switch"), - inventory_image = "techage_appl_switch_inv.png", - tiles = { - 'techage_appl_switch_off.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -1/4, -8/16, -1/4, 1/4, -7/16, 1/4}, - { -1/6, -12/16, -1/6, 1/6, -8/16, 1/6}, - }, - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local number = techage.add_node(pos, "techage:powerswitch") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA Power Switch").." "..number) - local node = minetest.get_node(pos) - switch_on(pos, node, placer, "techage:powerswitch_on") - sign_in(pos, node) - end, - - on_rightclick = function(pos, node, clicker) - switch_on(pos, node, clicker, "techage:powerswitch_on") - end, - - after_dig_node = sign_off, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_node("techage:powerswitch_on", { - description = S("TA Power Switch"), - inventory_image = "techage_appl_switch_inv.png", - tiles = { - 'techage_appl_switch_on.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -1/4, -8/16, -1/4, 1/4, -7/16, 1/4}, - { -1/6, -12/16, -1/6, 1/6, -8/16, 1/6}, - }, - }, - - on_rightclick = function(pos, node, clicker) - switch_off(pos, node, clicker, "techage:powerswitch") - end, - - after_dig_node = sign_off, - drop = "techage:powerswitch", - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:powerswitchsmall", { - description = S("TA Power Switch Small"), - inventory_image = "techage_smart_button_inventory.png", - tiles = { - 'techage_smart_button_off.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -5/32, -16/32, -5/32, 5/32, -15/32, 5/32}, - { -2/16, -12/16, -2/16, 2/16, -8/16, 2/16}, - }, - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local number = techage.add_node(pos, "techage:powerswitchsmall") - meta:set_string("node_number", number) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA Power Switch Small").." "..number) - local node = minetest.get_node(pos) - switch_on(pos, node, placer, "techage:powerswitchsmall_on") - sign_in(pos, node) - end, - - on_rightclick = function(pos, node, clicker) - switch_on(pos, node, clicker, "techage:powerswitchsmall_on") - end, - - after_dig_node = sign_off, - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - - -minetest.register_node("techage:powerswitchsmall_on", { - description = S("TA Power Switch Small"), - inventory_image = "techage_appl_switch_inv.png", - tiles = { - 'techage_smart_button_on.png', - }, - - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -5/32, -16/32, -5/32, 5/32, -15/32, 5/32}, - { -2/16, -12/16, -2/16, 2/16, -8/16, 2/16}, - }, - }, - - on_rightclick = function(pos, node, clicker) - switch_off(pos, node, clicker, "techage:powerswitchsmall") - end, - - after_dig_node = sign_off, - drop = "techage:powerswitchsmall", - on_rotate = screwdriver.disallow, - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - paramtype2 = "wallmounted", - groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:powerswitch", "techage:powerswitch_on", - "techage:powerswitchsmall", "techage:powerswitchsmall_on"}, { - on_recv_message = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == "on" and node.name == "techage:powerswitch" then - switch_on(pos, node, nil, "techage:powerswitch_on") - return true - elseif topic == "on" and node.name == "techage:powerswitchsmall" then - switch_on(pos, node, nil, "techage:powerswitchsmall_on") - return true - elseif topic == "off" and node.name == "techage:powerswitch_on" then - switch_off(pos, node, nil, "techage:powerswitch") - return true - elseif topic == "off" and node.name == "techage:powerswitchsmall_on" then - switch_off(pos, node, nil, "techage:powerswitchsmall") - return true - elseif topic == "state" then - if node.name == "techage:powerswitch_on" or - node.name == "techage:powerswitchsmall_on" then - return "on" - end - return "off" - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == 1 and payload[1] == 1 and node.name == "techage:powerswitch" then - switch_on(pos, node, nil, "techage:powerswitch_on") - return 0 - elseif topic == 1 and payload[1] == 1 and node.name == "techage:powerswitchsmall" then - switch_on(pos, node, nil, "techage:powerswitchsmall_on") - return 0 - elseif topic == 1 and payload[1] == 0 and node.name == "techage:powerswitch_on" then - switch_off(pos, node, nil, "techage:powerswitch") - return 0 - elseif topic == 1 and payload[1] == 0 and node.name == "techage:powerswitchsmall_on" then - switch_off(pos, node, nil, "techage:powerswitchsmall") - return 0 - else - return 2 - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local node = techage.get_node_lvm(pos) - if topic == 131 or topic == 142 then - if node.name == "techage:powerswitch_on" or - node.name == "techage:powerswitchsmall_on" then - return 0, {1} - end - return 0, {0} - else - return 2, "" - end - end, -}) - -minetest.register_craft({ - output = "techage:powerswitch 2", - recipe = { - {"", "", ""}, - {"dye:yellow", "dye:red", "dye:yellow"}, - {"basic_materials:plastic_sheet", "basic_materials:copper_wire", "basic_materials:plastic_sheet"}, - }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:powerswitchsmall", - recipe = {"techage:powerswitch"}, -}) diff --git a/techage/power/powerswitchbox.lua b/techage/power/powerswitchbox.lua deleted file mode 100644 index 14cde4c..0000000 --- a/techage/power/powerswitchbox.lua +++ /dev/null @@ -1,148 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Power Switch Box -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta -local N = techage.get_node_lvm -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local node_box = { - type = "fixed", - fixed = { - { -1/4, -1/4, -2/4, 1/4, 1/4, 2/4}, - }, -} - -function techage.legacy_switches(pos) - local meta = M(pos) - local node = N(pos) - - if node.name == "techage:powerswitch_box" then - if meta:get_int("netw_param2") == 0 then - node.name = "techage:powerswitch_box_off" - else - node.name = "techage:powerswitch_box_on" - end - minetest.swap_node(pos, node) - elseif meta:get_string("netw_name") == "techage:powerswitch_box" then - if meta:get_int("netw_param2") == 0 then - meta:set_string("netw_name", "techage:powerswitch_box_off") - else - meta:set_string("netw_name", "techage:powerswitch_box_on") - end - end - - if meta:contains("tl2_param2_copy") then - meta:set_string("netw_param2_copy", meta:get_string("tl2_param2_copy")) - meta:set_string("tl2_param2_copy", "") - end -end - - --- The on-switch is a "primary node" like cables -minetest.register_node("techage:powerswitch_box_on", { - description = S("TA Power Switch Box"), - paramtype = "light", - drawtype = "nodebox", - node_box = node_box, - tiles = { - "techage_electric_switch.png^[transformR90", - "techage_electric_switch.png^[transformR90", - "techage_electric_switch.png", - "techage_electric_switch.png", - "techage_electric_junction.png", - "techage_electric_junction.png", - }, - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - on_rightclick = function(pos, node, clicker) - techage.legacy_switches(pos) - if M(pos):get_int("switch_sign_in") ~= 1 then - if power.turn_switch_off(pos, Cable, "techage:powerswitch_box_off", "techage:powerswitch_box_on") then - minetest.sound_play("doors_glass_door_open", { - pos = pos, - gain = 1, - max_hear_distance = 5}) - end - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode, oldmetadata) - end, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy=2, cracky=2, crumbly=2, techage_trowel = 1}, - sounds = default.node_sound_defaults(), -}) - --- The off-switch is a "secondary node" without connection sides -minetest.register_node("techage:powerswitch_box_off", { - description = S("TA Power Switch Box"), - paramtype = "light", - drawtype = "nodebox", - node_box = node_box, - tiles = { - "techage_electric_switch_off.png^[transformR90", - "techage_electric_switch_off.png^[transformR90", - "techage_electric_switch_off.png", - "techage_electric_switch_off.png", - "techage_electric_junction.png", - "techage_electric_junction.png", - }, - on_rightclick = function(pos, node, clicker) - techage.legacy_switches(pos) - if M(pos):get_int("switch_sign_in") ~= 1 then - if power.turn_switch_on(pos, Cable, "techage:powerswitch_box_off", "techage:powerswitch_box_on") then - minetest.sound_play("doors_glass_door_open", { - pos = pos, - gain = 1, - max_hear_distance = 5}) - end - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - end, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - drop = "techage:powerswitch_box_on", - groups = {choppy=2, cracky=2, crumbly=2, techage_trowel = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), -}) - -power.register_nodes({"techage:powerswitch_box_off"}, Cable, "con", {}) - -minetest.register_craft({ - output = "techage:powerswitch_box_on", - recipe = { - {"", "basic_materials:plastic_sheet", ""}, - {"techage:electric_cableS", "basic_materials:copper_wire", "techage:electric_cableS"}, - {"", "basic_materials:plastic_sheet", ""}, - }, -}) diff --git a/techage/power/powerswitchbox_legacy.lua b/techage/power/powerswitchbox_legacy.lua deleted file mode 100644 index 9fd27b5..0000000 --- a/techage/power/powerswitchbox_legacy.lua +++ /dev/null @@ -1,71 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Old Power Switch Box -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local M = minetest.get_meta -local N = function(pos) return minetest.get_node(pos).name end -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -local node_box = { - type = "fixed", - fixed = { - { -1/4, -1/4, -2/4, 1/4, 1/4, 2/4}, - }, -} - --- legacy node -minetest.register_node("techage:powerswitch_box", { - description = S("TA Power Switch Box"), - tiles = { - -- up, down, right, left, back, front - 'techage_electric_switch.png^[transformR90', - 'techage_electric_switch.png^[transformR90', - 'techage_electric_switch.png', - 'techage_electric_switch.png', - 'techage_electric_junction.png', - 'techage_electric_junction.png', - }, - - drawtype = "nodebox", - node_box = node_box, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - local node = minetest.get_node(pos) - minetest.swap_node(pos, {name = "techage:powerswitch_box_on", param2 = node.param2}) - - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - on_rotate = screwdriver.disallow, -- important! - paramtype2 = "facedir", - drop = "techage:powerswitch_box_on", - groups = {choppy=2, cracky=2, crumbly=2, techage_trowel = 1, not_in_creative_inventory = 1}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) diff --git a/techage/power/protection.lua b/techage/power/protection.lua deleted file mode 100644 index 639c3af..0000000 --- a/techage/power/protection.lua +++ /dev/null @@ -1,71 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3/TA4 Power line Protection -]]-- - -local M = minetest.get_meta -local S = techage.S - -local RANGE = 8 - -local IsNodeUnderObservation = {} - --- Register all nodes, which should be protected by the "techage:power_pole" -function techage.register_powerline_node(name) - IsNodeUnderObservation[name] = true -end - -local function powerpole_found(pos, name, range) - local pos1 = {x=pos.x-range, y=pos.y-range, z=pos.z-range} - local pos2 = {x=pos.x+range, y=pos.y+range, z=pos.z+range} - for _,npos in ipairs(minetest.find_nodes_in_area(pos1, pos2, { - "techage:power_pole", "techage:power_pole_conn", - "techage:power_pole2"})) do - if minetest.get_meta(npos):get_string("owner") ~= name then - return true - end - end - return false -end - -local function is_protected(pos, name, range) - if minetest.check_player_privs(name, "powerline") - or not powerpole_found(pos, name, range) then - return false - end - return true -end - -function techage.is_protected(pos, name) - return is_protected(pos, name, RANGE+3) -end - - -local old_is_protected = minetest.is_protected - -function minetest.is_protected(pos, name) - local node = techage.get_node_lvm(pos) - if IsNodeUnderObservation[node.name] and is_protected(pos, name, RANGE) then - return true - end - return old_is_protected(pos, name) -end - -minetest.register_privilege("powerline", { - description = S("Allow to dig/place Techage power lines nearby power poles"), - give_to_singleplayer = false, - give_to_admin = true, -}) - -techage.register_powerline_node("techage:power_line") -techage.register_powerline_node("techage:power_lineS") -techage.register_powerline_node("techage:power_lineA") -techage.register_powerline_node("techage:power_pole3") diff --git a/techage/power/steam_pipe.lua b/techage/power/steam_pipe.lua deleted file mode 100644 index a46fb95..0000000 --- a/techage/power/steam_pipe.lua +++ /dev/null @@ -1,116 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Steam pipes for the Steam Engine - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Pipe = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = 12, - show_infotext = false, - force_to_use_tubes = true, - tube_type = "pipe1", - primary_node_names = {"techage:steam_pipeS", "techage:steam_pipeA"}, - secondary_node_names = {"techage:cylinder", "techage:cylinder_on", "techage:boiler2"}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - minetest.swap_node(pos, {name = "techage:steam_pipe"..tube_type, param2 = param2}) - end, -}) - -minetest.register_node("techage:steam_pipeS", { - description = S("TA2 Steam Pipe"), - tiles = { - "techage_steam_pipe.png^[transformR90", - "techage_steam_pipe.png^[transformR90", - "techage_steam_pipe.png", - "techage_steam_pipe.png", - "techage_steam_hole.png", - "techage_steam_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Pipe:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -4/8, 1/8, 1/8, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly=3, cracky=3, snappy=3}, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_node("techage:steam_pipeA", { - description = S("TA2 Steam Pipe"), - tiles = { - "techage_steam_knee2.png", - "techage_steam_hole2.png^[transformR180", - "techage_steam_knee.png^[transformR270", - "techage_steam_knee.png", - "techage_steam_knee2.png", - "techage_steam_hole2.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Pipe:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -4/8, -1/8, 1/8, 1/8, 1/8}, - {-1/8, -1/8, -4/8, 1/8, 1/8, -1/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly=3, cracky=3, snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_metal_defaults(), - drop = "techage:steam_pipeS", -}) - -minetest.register_craft({ - output = "techage:steam_pipeS 3", - recipe = { - {'', '', "default:bronze_ingot"}, - {'', 'techage:iron_ingot', ''}, - {"default:bronze_ingot", '', ''}, - }, -}) - -techage.SteamPipe = Pipe diff --git a/techage/power/ta4_cable.lua b/techage/power/ta4_cable.lua deleted file mode 100644 index 40ef060..0000000 --- a/techage/power/ta4_cable.lua +++ /dev/null @@ -1,189 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Low Power Cable for solar plants - -]]-- - --- for lazy programmers -local S2P = minetest.string_to_pos -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local power = networks.power - -local ELE2_MAX_CABLE_LENGHT = 200 - -local Cable = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = ELE2_MAX_CABLE_LENGHT, - show_infotext = false, - tube_type = "ele2", - primary_node_names = {"techage:ta4_power_cableS", "techage:ta4_power_cableA", - "techage:ta4_cable_wall_entry"}, - secondary_node_names = {}, - after_place_tube = function(pos, param2, tube_type, num_tubes) - local name = minetest.get_node(pos).name - if name == "techage:ta4_cable_wall_entry" then - minetest.swap_node(pos, {name = "techage:ta4_cable_wall_entry", param2 = param2}) - else - minetest.swap_node(pos, {name = "techage:ta4_power_cable"..tube_type, param2 = param2}) - end - end, -}) - --- Use global callback instead of node related functions -Cable:register_on_tube_update2(function(pos, outdir, tlib2, node) - power.update_network(pos, outdir, tlib2, node) -end) - -minetest.register_node("techage:ta4_power_cableS", { - description = S("TA4 Low Power Cable"), - tiles = { - -- up, down, right, left, back, front - "techage_ta4_cable.png", - "techage_ta4_cable.png", - "techage_ta4_cable.png", - "techage_ta4_cable.png", - "techage_ta4_cable_end.png", - "techage_ta4_cable_end.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -1/16, -4/8, 1/16, 1/16, 4/8}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("techage:ta4_power_cableA", { - description = S("TA4 Low Power Cable"), - tiles = { - -- up, down, right, left, back, front - "techage_ta4_cable.png", - "techage_ta4_cable_end.png", - "techage_ta4_cable.png", - "techage_ta4_cable.png", - "techage_ta4_cable.png", - "techage_ta4_cable_end.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/16, -4/8, -1/16, 1/16, 1/16, 1/16}, - {-1/16, -1/16, -4/8, 1/16, 1/16, -1/16}, - }, - }, - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_defaults(), - drop = "techage:ta4_power_cableS", -}) - -minetest.register_node("techage:ta4_power_box", { - description = S("TA4 Low Power Box"), - tiles = { - "techage_ta4_junctionbox_top.png", - "techage_ta4_junctionbox_top.png", - "techage_ta4_junctionbox_side.png^techage_appl_ta4_cable.png", - }, - - paramtype2 = "facedir", -- important! - drawtype = "nodebox", - node_box = { - type = "connected", - fixed = { - { -3/16, -3/16, -3/16, 3/16, 3/16, 3/16}, -- box - { -1/16, -7/16, -1/16, 1/16, -3/16, 1/16}, -- post - { -3/16, -8/16, -3/16, 3/16, -7/16, 3/16}, -- base - }, - - connect_left = {{ -1/2, -1/16, -1/16, 0, 1/16, 1/16}}, - connect_right = {{ 0, -1/16, -1/16, 1/2, 1/16, 1/16}}, - connect_back = {{-1/16, -1/16, 0, 1/16, 1/16, 1/2}}, - connect_front = {{-1/16, -1/16, -1/2, 1/16, 1/16, 0}}, - }, - connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS", - "techage:ta4_solar_inverter", "techage:ta4_solar_carrier", - "techage:ta4_solar_carrierB", "techage:ta4_cable_wall_entry"}, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - Cable:after_place_node(pos) - end, - tubelib2_on_update2 = function(pos, dir1, tlib2, node) - power.update_network(pos, 0, tlib2, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:after_dig_node(pos) - end, - - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky=2, crumbly=2, choppy=2}, - sounds = default.node_sound_defaults(), -}) - -power.register_nodes({"techage:ta4_power_box"}, Cable, "junc", {"L", "R", "F", "B"}) - -minetest.register_craft({ - output = "techage:ta4_power_cableS 8", - recipe = { - {"basic_materials:plastic_sheet", "dye:red", ""}, - {"", "default:copper_ingot", ""}, - {"", "dye:red", "basic_materials:plastic_sheet"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_power_box 2", - recipe = { - {"techage:ta4_power_cableS", "basic_materials:plastic_sheet", "techage:ta4_power_cableS"}, - {"basic_materials:plastic_sheet", "default:copper_ingot", "basic_materials:plastic_sheet"}, - {"techage:ta4_power_cableS", "basic_materials:plastic_sheet", "techage:ta4_power_cableS"}, - },}) - -techage.TA4_Cable = Cable diff --git a/techage/power/ta4_cable_wall_entry.lua b/techage/power/ta4_cable_wall_entry.lua deleted file mode 100644 index fb96be6..0000000 --- a/techage/power/ta4_cable_wall_entry.lua +++ /dev/null @@ -1,57 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 cable wall entry - -]]-- - -local S = techage.S - -local TA4_Cable = techage.TA4_Cable - -minetest.register_node("techage:ta4_cable_wall_entry", { - description = S("TA4 Cable Wall Entry"), - tiles = { - -- up, down, right, left, back, front - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png", - "basic_materials_concrete_block.png^techage_ta4_cable_hole.png", - "basic_materials_concrete_block.png^techage_ta4_cable_hole.png", - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not TA4_Cable:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - TA4_Cable:after_dig_tube(pos, oldnode) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - groups = {crumbly = 2, cracky = 2, snappy = 2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta4_cable_wall_entry", - recipe = { - {"", "techage:ta4_power_cableS", ""}, - {"", "basic_materials:concrete_block", ""}, - {"", "",""}, - }, -}) diff --git a/techage/recipe_checker.lua b/techage/recipe_checker.lua deleted file mode 100644 index aa81d50..0000000 --- a/techage/recipe_checker.lua +++ /dev/null @@ -1,39 +0,0 @@ --- --- Script to check recipe overlaps --- -local Recipes = {} - - -local function recipe_key(items) - local tbl = {} - for idx = 1,9 do - tbl[#tbl + 1] = items[idx] or "#" - end - return table.concat(tbl, "-") -end - -minetest.after(1, function() - for name,_ in pairs(minetest.registered_items) do - local mod = string.split(name, ":")[1] - if mod == "techage" or mod == "signs_bot" or mod == "vm16" or mod == "beduino" then - local recipes = minetest.get_all_craft_recipes(name) - if recipes then - for _,recipe in ipairs(recipes) do - if recipe and recipe.items then - --print(dump(recipe.items)) - local key = recipe_key(recipe.items) - if Recipes[key] then - if not string.find(name, "slab") and not string.find(name, "stair") then - local text = Recipes[key].." and "..name.." have the same incredients" - minetest.log("error", text) - end - end - Recipes[key] = name - end - end - end - end - end -end) - -print ("[techage] Recipe checker loaded") diff --git a/techage/screenshot.png b/techage/screenshot.png deleted file mode 100644 index d3aa7b6..0000000 Binary files a/techage/screenshot.png and /dev/null differ diff --git a/techage/settingtypes.txt b/techage/settingtypes.txt deleted file mode 100644 index a118e13..0000000 --- a/techage/settingtypes.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Maximim number of Forceload Blocks per player (default 20) -techage_max_num_forceload_blocks (Max. number of Forceload Blocks) int 20 - -# Rarity factor to find ores when sieving with the Gravel Sieve -# 1.0 is according to the mapgen generator -# 2.0 means half as many ores as result -# 0.5 means twice as many ores as result -techage_ore_rarity (Rarity factor to find ores) float 1.0 - -# Enable alternative recipes for steel and bronze. -# Instead of the furnace the player has to use the Coal Burner. -techage_modified_recipes_enabled (Enable alternative recipes for steel and bronze) bool false - -# Seed for the oil exploration random function. -# Change this for your server in order not to be able to predict the oil reserves! -techage_oil_exploration_seed (techage oil exploration seed) int 1234 - - -# Use the external Lua library 'lua-marshal' for faster serialization/deserialization -# of node meta data. See also 'README.md'. -techage_use_marshal (use lua-marshal as serialize/deserialize functions) bool false - -# Use the external library 'lsqlite3' for for faster storing of data. -# See also 'README.md'. -techage_use_sqlite (use sqlite database) bool false - -# To reduce the server CPU load, the number of sent techage commands -# per player and minute can be limited. -techage_command_limit (Max. number of commands sent per minute) int 1200 - -# Colliders are huge systems and should not be built on the surface. -# 'techage_collider_min_depth specifies' the min. depth (Y) to build a TA4 Collider -techage_collider_min_depth (Min. depth to build a TA4 Collider) int -30 - -# Average waiting time in minutes to get one Collider expoint. -# Default value is 40, which means one point every 40 min. -techage_expoint_rate_in_min (average waiting time for one expoint) int 40 - -# For testing purpuses only -techage_recipe_checker_enabled (test techage recipes) bool false - -# Enables stair aliases (to prevent unknown nodes) -techage_stair_aliases_enabled (Enable stair aliases) bool false \ No newline at end of file diff --git a/techage/solar/inverter.lua b/techage/solar/inverter.lua deleted file mode 100644 index dc65574..0000000 --- a/techage/solar/inverter.lua +++ /dev/null @@ -1,266 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Solar Power DC/AC Inverter - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos - -local Cable = techage.ElectricCable -local Solar = techage.TA4_Cable -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local PWR_PERF = 100 -local COUNTDOWN_TICKS = 1 - -local function determine_power(pos, nvm) - -- determine DC node position - local outdir = M(pos):get_int("leftdir") - local netw = networks.get_network_table(pos, Solar, outdir) or {} - local num_inv = #(netw.con or {}) - local max_power = 0 - for _, power in ipairs(control.request(pos, Solar, outdir, "junc", "power")) do - max_power = max_power + power - end - - if num_inv == 1 then -- only one inverter is allowed - nvm.max_power = math.min(PWR_PERF, max_power) - else - nvm.max_power = 0 - end - return max_power, num_inv -end - -local function has_dc_power(pos, nvm) - local time = minetest.get_timeofday() or 0 - if time < 6.00/24.00 or time > 18.00/24.00 then - nvm.ticks = 0 - nvm.max_power = 0 - return false - end - nvm.ticks = nvm.ticks or 0 - if (nvm.ticks % 30) == 0 then -- calculate max_power not to often - determine_power(pos, nvm) - else - nvm.max_power = nvm.max_power or 0 - end - nvm.ticks = nvm.ticks + 1 - return nvm.max_power > 0 -end - -local function formspec(self, pos, nvm) - local max_power = nvm.max_power or 0 - local provided = nvm.provided or 0 - local arrow = "image[2.5,1.5;1,1;techage_form_arrow_bg.png^[transformR270]" - if techage.is_running(nvm) then - arrow = "image[2.5,1.5;1,1;techage_form_arrow_fg.png^[transformR270]" - end - return "size[6,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;5.8,0.5;#c6e8ff]".. - "label[2.5,-0.1;"..minetest.colorize( "#000000", S("Inverter")).."]".. - techage.formspec_power_bar(pos, 0, 0.8, S("Power DC"), max_power, PWR_PERF).. - techage.formspec_power_bar(pos, 3.5, 0.8, S("Power AC"), provided, max_power).. - arrow.. - "image_button[2.5,3;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[2.5,3;1,1;"..self:get_state_tooltip(nvm).."]" -end - -local function can_start(pos, nvm, state) - local max_power, num_inverter = determine_power(pos, nvm) - if num_inverter > 1 then return S("solar network error") end - if max_power == 0 then return S("no solar power") end - return true -end - -local function start_node(pos, nvm, state) - local meta = M(pos) - nvm.provided = 0 - nvm.ticks = 0 - local outdir = meta:get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) - techage.evaluate_charge_termination(nvm, meta) -end - -local function stop_node(pos, nvm, state) - nvm.provided = 0 - nvm.running = nil -- legacy - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_solar_inverter", - cycle_time = CYCLE_TIME, - standby_ticks = 2, - formspec_func = formspec, - infotext_name = S("TA4 Solar Inverter"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - local has_power = has_dc_power(pos, nvm) - if running and not has_power then - State:standby(pos, nvm) - stop_node(pos, nvm, State) - elseif not running and has_power then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local meta = M(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, nvm.max_power, tp1, tp2) - local val = power.get_storage_load(pos, Cable, outdir, nvm.max_power) - if val > 0 then - nvm.load = val - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - determine_power(pos, nvm) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / nvm.max_power, perf = nvm.max_power, capa = nvm.max_power * 2} - end -end - -minetest.register_node("techage:ta4_solar_inverter", { - description = S("TA4 Solar Inverter"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_ta4_cable.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inverter.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inverter.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - - after_place_node = function(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_int("leftdir", networks.side_to_outdir(pos, "L")) - Cable:after_place_node(pos) - Solar:after_place_node(pos) - local number = techage.add_node(pos, "techage:ta4_solar_inverter") - State:node_init(pos, nvm, number) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end, - - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - Solar:after_dig_node(pos) - techage.del_mem(pos) - end, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta4", PWR_PERF) -}) - -power.register_nodes({"techage:ta4_solar_inverter"}, Cable, "gen", {"R"}) -power.register_nodes({"techage:ta4_solar_inverter"}, Solar, "con", {"L"}) - -techage.register_node({"techage:ta4_solar_inverter"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "delivered" then - return math.floor((nvm.provided or 0) + 0.5) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 135 then -- Delivered Power - return 0, {math.floor((nvm.provided or 0) + 0.5)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, -}) - -control.register_nodes({"techage:ta4_solar_inverter"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Solar Inverter"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = nvm.max_power or 0, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_solar_inverter", - recipe = { - {'default:steel_ingot', 'dye:green', 'default:steel_ingot'}, - {'', 'techage:ta4_wlanchip', 'techage:electric_cableS'}, - {'default:steel_ingot', "techage:baborium_ingot", 'default:steel_ingot'}, - }, -}) - -techage.register_node_for_v1_transition({"techage:ta4_solar_inverter"}, function(pos, node) - power.update_network(pos, nil, Solar) -end) diff --git a/techage/solar/minicell.lua b/techage/solar/minicell.lua deleted file mode 100644 index a95839f..0000000 --- a/techage/solar/minicell.lua +++ /dev/null @@ -1,171 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Streetlamp Solar Cell - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 2 -local PWR_PERF = 1 -local PWR_CAPA = 2400 -- ticks (2s) with 1 ku ==> 80 min = 4 game days - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.capa = nvm.capa or 0 - pos.y = pos.y + 1 - local light = minetest.get_node_light(pos) or 0 - local t = minetest.get_timeofday() - pos.y = pos.y - 1 - - if t > 0.25 and t < 0.75 then - if nvm.providing then - nvm.providing = false - nvm.provided = 0 - end - if light >= (minetest.LIGHT_MAX - 1) then - nvm.capa = math.min(nvm.capa + PWR_PERF * 1.2, PWR_CAPA) - end - else - if nvm.capa > 0 then - if not nvm.providing then - power.start_storage_calc(pos, Cable, 5) - nvm.providing = true - else - nvm.provided = power.provide_power(pos, Cable, 5, PWR_PERF, 0.8, 1.0) - nvm.capa = nvm.capa - nvm.provided - end - else - power.start_storage_calc(pos, Cable, 5) - nvm.providing = false - nvm.provided = 0 - nvm.capa = 0 - end - end - return true -end - -local function after_place_node(pos) - local meta = M(pos) - local number = techage.add_node(pos, "techage:ta4_solar_minicell") - meta:set_string("node_number", number) - meta:set_string("infotext", S("TA4 Streetlamp Solar Cell").." "..number) - local nvm = techage.get_nvm(pos) - nvm.capa = 0 - nvm.providing = false - minetest.get_node_timer(pos):start(CYCLE_TIME) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata) - Cable:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -minetest.register_node("techage:ta4_solar_minicell", { - description = S("TA4 Streetlamp Solar Cell"), - tiles = { - -- up, down, right, left, back, front - "techage_solar_cell_mini_top.png", - "techage_solar_cell_mini_bottom.png", - "techage_solar_cell_mini_side.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-14/32, -8/32, -14/32, 14/32, -6/32, 14/32}, - {-7/32, -16/32, -7/32, 7/32, -8/32, 7/32}, - }, - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - use_texture_alpha = techage.CLIP, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_timer = node_timer, -}) - -power.register_nodes({"techage:ta4_solar_minicell"}, Cable, "gen", {"D"}) - -control.register_nodes({"techage:ta4_solar_minicell"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Streetlamp Solar Cell"), - number = meta:get_string("node_number") or "", - running = nvm.providing or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = "80% - 100%", - } - end - return false - end, - } -) - -techage.register_node({"techage:ta4_solar_minicell"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - if nvm.providing then - return "discharging" - elseif (nvm.capa or 0) > 0 then - return "charging" - else - return "unused" - end - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 145 then -- Solar Cell State - if nvm.providing then - return 0, {2} - elseif (nvm.capa or 0) > 0 then - return 0, {1} - else - return 0, {0} - end - else - return 2, "" - end - end, - on_node_load = function(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_craft({ - output = "techage:ta4_solar_minicell", - recipe = { - {"", "techage:ta4_wlanchip", ""}, - {"techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer"}, - {"default:tin_ingot", "techage:iron_ingot", "default:copper_ingot"}, - }, -}) diff --git a/techage/solar/solarcell.lua b/techage/solar/solarcell.lua deleted file mode 100644 index c0c92fa..0000000 --- a/techage/solar/solarcell.lua +++ /dev/null @@ -1,293 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Solar Module and Carriers - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local PWR_PERF = 3 - -local Cable = techage.TA4_Cable -local power = networks.power -local control = networks.control - -local function temperature(pos) - local data = minetest.get_biome_data(pos) - if data then - return math.floor(data.heat) or 0 - end - return 0 -end - --- return the required param2 for solar modules -local function get_param2(pos, side) - local dir = networks.side_to_outdir(pos, side) - return (dir + 1) % 4 -end - --- do we have enough light? -local function light(pos) - if minetest.get_node(pos).name ~= "air" then return false end - local light = minetest.get_node_light(pos) or 0 - return light >= (15 - 1) -end - --- check if solar module is available and has the correct orientation -local function is_solar_module(base_pos, pos, side) - local pos1 = techage.get_pos(pos, side) - if pos1 then - local node = techage.get_node_lvm(pos1) - if node and node.name == "techage:ta4_solar_module" and - light({x = pos1.x, y = pos1.y + 1, z = pos1.z}) then - if side == "L" and node.param2 == M(base_pos):get_int("left_param2") then - return true - elseif side == "R" and node.param2 == M(base_pos):get_int("right_param2") then - return true - end - end - end - return false -end - --- provide the available power, which is temperature dependent -local function on_getpower1(pos) - local pos1 = {x = pos.x, y = pos.y, z = pos.z} - if is_solar_module(pos, pos1, "L") and is_solar_module(pos, pos1, "R") then - return PWR_PERF * M(pos):get_int("temperature") / 100.0 - end - return 0 -end - -local function on_getpower2(pos) - local pos1 = {x = pos.x, y = pos.y+1, z = pos.z} - if is_solar_module(pos, pos1, "L") and is_solar_module(pos, pos1, "R") then - return PWR_PERF * M(pos):get_int("temperature") / 100.0 - end - return 0 -end - -local function after_place_node(pos) - M(pos):set_int("temperature", temperature(pos)) - M(pos):set_int("left_param2", get_param2(pos, "L")) - M(pos):set_int("right_param2", get_param2(pos, "R")) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Cable:after_dig_node(pos) -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - power.update_network(pos, 0, tlib2, node) -end - -minetest.register_node("techage:ta4_solar_module", { - description = S("TA4 Solar Module"), - inventory_image = "techage_solar_module_top.png", - tiles = { - -- up, down, right, left, back, front - "techage_solar_module_top.png", - "techage_solar_module_bottom.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, 7/16, -1/2, 1/2, 8/16, 16/16}, - }, - }, - techage_info = function(pos) - local power = 0 - local pos1 = {x = pos.x, y = pos.y + 1, z = pos.z} - if light(pos1) then - power = PWR_PERF * temperature(pos) / 200.0 - end - local light = minetest.get_node_light(pos1).." / " ..15 - return S("power").." = "..power..", "..S("light").." = "..light - end, - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("techage:ta4_solar_carrier", { - description = S("TA4 Solar Carrier Module"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten^techage_appl_ta4_cable.png", - "techage_concrete.png^[brighten^techage_appl_ta4_cable.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/8, -8/16, -1/2, 3/8, -6/16, 1/2}, - {-1/8, -6/16, -1/2, 1/8, 6/16, 1/2}, - {-3/8, 5/16, -1/2, 3/8, 7/16, 1/2}, - }, - }, - after_place_node = function(pos) - M(pos):set_int("temperature", temperature(pos)) - M(pos):set_int("left_param2", get_param2(pos, "L")) - M(pos):set_int("right_param2", get_param2(pos, "R")) - end, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:ta4_solar_carrierB", { - description = S("TA4 Solar Carrier Module B"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^[brighten^techage_appl_ta4_cable.png", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten^techage_appl_ta4_cable.png", - "techage_concrete.png^[brighten^techage_appl_ta4_cable.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-3/8, -8/16, -1/2, 3/8, -6/16, 1/2}, - {-1/8, -6/16, -1/2, 1/8, 8/16, 1/2}, - }, - }, - after_place_node = function(pos) - M(pos):set_int("temperature", temperature(pos)) - M(pos):set_int("left_param2", get_param2(pos, "L")) - M(pos):set_int("right_param2", get_param2(pos, "R")) - Cable:after_place_node(pos) - end, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("techage:ta4_solar_carrierT", { - description = S("TA4 Solar Carrier Module T"), - tiles = { - -- up, down, right, left, back, front - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - "techage_concrete.png^[brighten", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -8/16, -1/2, 1/8, 6/16, 1/2}, - {-3/8, 5/16, -1/2, 3/8, 7/16, 1/2}, - }, - }, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -power.register_nodes({"techage:ta4_solar_carrier", "techage:ta4_solar_carrierB"}, Cable, "junc", {"F", "B"}) - -control.register_nodes({"techage:ta4_solar_carrier"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "power" then - return on_getpower1(pos) - end - end, - } -) - -control.register_nodes({"techage:ta4_solar_carrierB"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "power" then - return on_getpower2(pos) - end - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_solar_module", - recipe = { - {"techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer"}, - {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, - {"", "", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_solar_carrierB 2", - recipe = { - {"", "default:steel_ingot", ""}, - {"", "techage:ta4_power_cableS", ""}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_solar_carrierT 2", - recipe = { - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"", "default:steel_ingot", ""}, - {"", "techage:ta4_power_cableS", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_solar_carrier", - recipe = { - {"", "techage:ta4_solar_carrierT", ""}, - {"", "techage:ta4_solar_carrierB", ""}, - {"", "", ""}, - }, -}) diff --git a/techage/sounds/techage_booster.ogg b/techage/sounds/techage_booster.ogg deleted file mode 100644 index 63faead..0000000 Binary files a/techage/sounds/techage_booster.ogg and /dev/null differ diff --git a/techage/sounds/techage_button.ogg b/techage/sounds/techage_button.ogg deleted file mode 100644 index 3d6b28c..0000000 Binary files a/techage/sounds/techage_button.ogg and /dev/null differ diff --git a/techage/sounds/techage_explore.ogg b/techage/sounds/techage_explore.ogg deleted file mode 100644 index fa714e0..0000000 Binary files a/techage/sounds/techage_explore.ogg and /dev/null differ diff --git a/techage/sounds/techage_gasflare.ogg b/techage/sounds/techage_gasflare.ogg deleted file mode 100644 index 1338c88..0000000 Binary files a/techage/sounds/techage_gasflare.ogg and /dev/null differ diff --git a/techage/sounds/techage_generator.ogg b/techage/sounds/techage_generator.ogg deleted file mode 100644 index 17a2e62..0000000 Binary files a/techage/sounds/techage_generator.ogg and /dev/null differ diff --git a/techage/sounds/techage_hum.ogg b/techage/sounds/techage_hum.ogg deleted file mode 100644 index b90b66d..0000000 Binary files a/techage/sounds/techage_hum.ogg and /dev/null differ diff --git a/techage/sounds/techage_mill.ogg b/techage/sounds/techage_mill.ogg deleted file mode 100644 index de0617b..0000000 Binary files a/techage/sounds/techage_mill.ogg and /dev/null differ diff --git a/techage/sounds/techage_oildrill.ogg b/techage/sounds/techage_oildrill.ogg deleted file mode 100644 index 2300bc9..0000000 Binary files a/techage/sounds/techage_oildrill.ogg and /dev/null differ diff --git a/techage/sounds/techage_quarry.ogg b/techage/sounds/techage_quarry.ogg deleted file mode 100644 index fec51bd..0000000 Binary files a/techage/sounds/techage_quarry.ogg and /dev/null differ diff --git a/techage/sounds/techage_reactor.ogg b/techage/sounds/techage_reactor.ogg deleted file mode 100644 index 27329b0..0000000 Binary files a/techage/sounds/techage_reactor.ogg and /dev/null differ diff --git a/techage/sounds/techage_reboiler.ogg b/techage/sounds/techage_reboiler.ogg deleted file mode 100644 index ad89dc8..0000000 Binary files a/techage/sounds/techage_reboiler.ogg and /dev/null differ diff --git a/techage/sounds/techage_steamengine.ogg b/techage/sounds/techage_steamengine.ogg deleted file mode 100644 index 649a3de..0000000 Binary files a/techage/sounds/techage_steamengine.ogg and /dev/null differ diff --git a/techage/sounds/techage_tool1.ogg b/techage/sounds/techage_tool1.ogg deleted file mode 100644 index 705c42d..0000000 Binary files a/techage/sounds/techage_tool1.ogg and /dev/null differ diff --git a/techage/sounds/techage_tool2.ogg b/techage/sounds/techage_tool2.ogg deleted file mode 100644 index 8b4dc5d..0000000 Binary files a/techage/sounds/techage_tool2.ogg and /dev/null differ diff --git a/techage/sounds/techage_turbine.ogg b/techage/sounds/techage_turbine.ogg deleted file mode 100644 index 37dcce5..0000000 Binary files a/techage/sounds/techage_turbine.ogg and /dev/null differ diff --git a/techage/sounds/techage_valve.ogg b/techage/sounds/techage_valve.ogg deleted file mode 100644 index c293fbf..0000000 Binary files a/techage/sounds/techage_valve.ogg and /dev/null differ diff --git a/techage/sounds/techage_watermill.ogg b/techage/sounds/techage_watermill.ogg deleted file mode 100644 index 246479b..0000000 Binary files a/techage/sounds/techage_watermill.ogg and /dev/null differ diff --git a/techage/steam_engine/boiler.lua b/techage/steam_engine/boiler.lua deleted file mode 100644 index dbb0bf1..0000000 --- a/techage/steam_engine/boiler.lua +++ /dev/null @@ -1,139 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Steam Engine Boiler - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 4 -local WATER_CONSUMPTION = 0.5 - -local Pipe = techage.SteamPipe -local boiler = techage.boiler - -local function steaming(pos, nvm, temp) - if temp >= 80 then - local wc = WATER_CONSUMPTION * (nvm.power_ratio or 1) - nvm.water_level = math.max((nvm.water_level or 0) - wc, 0) - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local temp = boiler.water_temperature(pos, nvm) - steaming(pos, nvm, temp) - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", boiler.formspec(pos, nvm)) - end - return temp > 20 -end - -local function after_place_node(pos) - local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node.name ~= "techage:boiler1" then - minetest.remove_node(pos) - return true - end -end - -local function after_dig_node(pos, oldnode) - Pipe:after_dig_node(pos) - techage.del_mem(pos) -end - --- boiler2: Main part, needed as generator -minetest.register_node("techage:boiler2", { - description = S("TA2 Boiler Top"), - tiles = {"techage_boiler2.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_09.obj", - selection_box = { - type = "fixed", - fixed = {-10/32, -48/32, -10/32, 10/32, 16/32, 10/32}, - }, - - can_dig = boiler.can_dig, - on_timer = node_timer, - on_rightclick = boiler.on_rightclick, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - on_punch = boiler.on_punch, - - paramtype = "light", - groups = {cracky=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:boiler2"}) - -techage.register_node({"techage:boiler2"}, { - on_transfer = function(pos, in_dir, topic, payload) - if topic == "trigger" then - if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "techage:boiler1" then - return 0 - end - local nvm = techage.get_nvm(pos) - nvm.fire_trigger = true - if not minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):start(CYCLE_TIME) - end - if (nvm.temperature or 20) > 80 then - nvm.power_ratio = techage.transfer(pos, 6, "trigger", nil, Pipe, { - "techage:cylinder", "techage:cylinder_on"}) or 0 - return nvm.power_ratio - else - return 0 - end - end - end, -}) - -minetest.register_node("techage:boiler1", { - description = S("TA2 Boiler Base"), - tiles = {"techage_boiler.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_09.obj", - selection_box = { - type = "fixed", - fixed = {-8/32, -16/32, -8/32, 8/32, 16/32, 8/32}, - }, - - paramtype = "light", - groups = {cracky=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - - - -minetest.register_craft({ - output = "techage:boiler1", - recipe = { - {"techage:iron_ingot", "", "techage:iron_ingot"}, - {"default:bronze_ingot", "", "default:bronze_ingot"}, - {"techage:iron_ingot", "default:bronze_ingot", "techage:iron_ingot"}, - }, -}) - -minetest.register_craft({ - output = "techage:boiler2", - recipe = { - {"techage:iron_ingot", "techage:steam_pipeS", "techage:iron_ingot"}, - {"default:bronze_ingot", "", "default:bronze_ingot"}, - {"techage:iron_ingot", "", "techage:iron_ingot"}, - }, -}) diff --git a/techage/steam_engine/cylinder.lua b/techage/steam_engine/cylinder.lua deleted file mode 100644 index ecdcef2..0000000 --- a/techage/steam_engine/cylinder.lua +++ /dev/null @@ -1,176 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2020 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Steam Engine Cylinder - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.SteamPipe - -local function transfer_flywheel(pos, topic, payload) - return techage.transfer(pos, "R", topic, payload, nil, - {"techage:flywheel", "techage:flywheel_on"}) -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_steamengine", { - pos = pos, - gain = 0.5, - max_hear_distance = 8, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function after_place_node(pos) - Pipe:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - stop_sound(pos) - Pipe:after_dig_node(pos) - techage.del_mem(pos) -end - -local function tubelib2_on_update2(pos, outdir, tlib2, node) - swap_node(pos, "techage:cylinder") - stop_sound(pos) -end - -minetest.register_node("techage:cylinder", { - description = S("TA2 Cylinder"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_open.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_steam_hole.png", - "techage_filling_ta2.png^techage_cylinder.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_cylinder.png^techage_frame_ta2.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:cylinder_on", { - description = S("TA2 Cylinder"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_open.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_steam_hole.png", - { - name = "techage_filling4_ta2.png^techage_cylinder4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - { - name = "techage_filling4_ta2.png^techage_cylinder4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - - tubelib2_on_update2 = tubelib2_on_update2, - - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -Pipe:add_secondary_node_names({"techage:cylinder", "techage:cylinder_on"}) - -techage.register_node({"techage:cylinder", "techage:cylinder_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then -- used by firebox - local power = transfer_flywheel(pos, topic, payload) - if not power or power <= 0 and nvm.running then - swap_node(pos, "techage:cylinder") - stop_sound(pos) - nvm.running = false - return 0 - end - return power - elseif topic == "start" then -- used by flywheel - swap_node(pos, "techage:cylinder_on") - play_sound(pos) - nvm.running = true - return true - elseif topic == "stop" then -- used by flywheel - swap_node(pos, "techage:cylinder") - stop_sound(pos) - nvm.running = false - return true - end - end, - on_node_load = function(pos, node) - --print("on_node_load", node.name) - if node.name == "techage:cylinder_on" then - play_sound(pos) - end - end, -}) - -minetest.register_craft({ - output = "techage:cylinder", - recipe = { - {"basic_materials:steel_bar", "techage:iron_ingot", "default:wood"}, - {"techage:steam_pipeS", "basic_materials:gear_steel", ""}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/steam_engine/firebox.lua b/techage/steam_engine/firebox.lua deleted file mode 100644 index cca8ece..0000000 --- a/techage/steam_engine/firebox.lua +++ /dev/null @@ -1,172 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Steam Engine Firebox - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local firebox = techage.firebox - -local CYCLE_TIME = 2 -local BURN_CYCLE_FACTOR = 0.8 - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.running then - local power = techage.transfer( - {x=pos.x, y=pos.y+2, z=pos.z}, - nil, -- outdir - "trigger", -- topic - nil, -- payload - nil, -- network - {"techage:boiler2"} -- nodenames - ) - nvm.burn_cycles = (nvm.burn_cycles or 0) - math.max((power or 0.1), 0.1) - if nvm.burn_cycles <= 0 then - local taken = firebox.get_fuel(pos) - if taken then - nvm.burn_cycles = (firebox.Burntime[taken:get_name()] or 1) / CYCLE_TIME * BURN_CYCLE_FACTOR - nvm.burn_cycles_total = nvm.burn_cycles - else - nvm.running = false - firebox.swap_node(pos, "techage:firebox") - M(pos):set_string("formspec", firebox.formspec(nvm)) - return false - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", firebox.formspec(nvm)) - end - return true - end -end - -minetest.register_node("techage:firebox", { - description = S("TA2 Firebox"), - tiles = { - -- up, down, right, left, back, front - "techage_firebox.png^techage_appl_open.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_appl_firehole.png^techage_frame_ta2.png", - }, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - - on_timer = node_timer, - can_dig = firebox.can_dig, - allow_metadata_inventory_put = firebox.allow_metadata_inventory_put, - allow_metadata_inventory_take = firebox.allow_metadata_inventory_take, - on_rightclick = firebox.on_rightclick, - - on_construct = function(pos) - local nvm = techage.get_nvm(pos) - nvm.running = false - nvm.burn_cycles = 0 - local meta = M(pos) - meta:set_string("formspec", firebox.formspec(nvm)) - local inv = meta:get_inventory() - inv:set_size('fuel', 1) - end, - - on_metadata_inventory_put = function(pos, listname, index, stack, player) - local nvm = techage.get_nvm(pos) - nvm.running = true - -- activate the formspec fire temporarily - nvm.burn_cycles = firebox.Burntime[stack:get_name()] / CYCLE_TIME - nvm.burn_cycles_total = nvm.burn_cycles - M(pos):set_string("formspec", firebox.formspec(nvm)) - nvm.burn_cycles = 0 - firebox.swap_node(pos, "techage:firebox_on") - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_node("techage:firebox_on", { - description = S("TA2 Firebox"), - tiles = { - -- up, down, right, left, back, front - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - "techage_firebox.png^techage_frame_ta2.png", - { - name = "techage_firebox4.png^techage_appl_firehole4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.4, - }, - }, - }, - paramtype2 = "facedir", - light_source = 8, - on_rotate = screwdriver.disallow, - groups = {cracky=2, not_in_creative_inventory=1}, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), - drop = "techage:firebox", - - on_timer = node_timer, - can_dig = firebox.can_dig, - allow_metadata_inventory_put = firebox.allow_metadata_inventory_put, - allow_metadata_inventory_take = firebox.allow_metadata_inventory_take, - on_receive_fields = firebox.on_receive_fields, - on_rightclick = firebox.on_rightclick, -}) - -minetest.register_craft({ - output = "techage:firebox", - recipe = { - {'default:stone', 'default:stone', 'default:stone'}, - {'techage:iron_ingot', '', 'techage:iron_ingot'}, - {'default:stone', 'default:stone', 'default:stone'}, - }, -}) - -techage.register_node({"techage:firebox", "techage:firebox_on"}, { - on_push_item = function(pos, in_dir, stack) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if firebox.Burntime[stack:get_name()] then - if inv:room_for_item("fuel", stack) then - inv:add_item("fuel", stack) - minetest.get_node_timer(pos):start(CYCLE_TIME) - return true - end - end - return false - end, -}) - -minetest.register_lbm({ - label = "[techage] Steam engine firebox", - name = "techage:steam_engine", - nodenames = {"techage:firebox_on"}, - run_at_every_load = true, - action = function(pos, node) - local nvm = techage.get_nvm(pos) - nvm.running = true - minetest.get_node_timer(pos):start(CYCLE_TIME) - end -}) diff --git a/techage/steam_engine/flywheel.lua b/techage/steam_engine/flywheel.lua deleted file mode 100644 index c68cedd..0000000 --- a/techage/steam_engine/flywheel.lua +++ /dev/null @@ -1,238 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Steam Engine Flywheel - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 -local PWR_PERF = 25 - -local Axle = techage.Axle -local power = networks.power - --- Axles texture animation -local function switch_axles(pos, on) - local outdir = M(pos):get_int("outdir") - Axle:switch_tube_line(pos, outdir, on and "on" or "off") -end - -local function formspec(self, pos, nvm) - return techage.generator_formspec(self, pos, nvm, S("Flywheel"), nvm.provided, PWR_PERF, true) -end - -local function transfer_cylinder(pos, topic, payload) - return techage.transfer(pos, "L", topic, payload, nil, - {"techage:cylinder", "techage:cylinder_on"}) -end - -local function can_start(pos, nvm, state) - return (nvm.firebox_trigger or 0) > 0 -- by means of firebox -end - -local function start_node(pos, nvm, state) - switch_axles(pos, true) - local outdir = M(pos):get_int("outdir") - transfer_cylinder(pos, "start") - power.start_storage_calc(pos, Axle, outdir) -end - -local function stop_node(pos, nvm, state) - switch_axles(pos, false) - local outdir = M(pos):get_int("outdir") - nvm.provided = 0 - transfer_cylinder(pos, "stop") - power.start_storage_calc(pos, Axle, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:flywheel", - node_name_active = "techage:flywheel_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - nvm.firebox_trigger = (nvm.firebox_trigger or 0) - 1 - local running = techage.is_running(nvm) - if running and nvm.firebox_trigger <= 0 then - State:standby(pos, nvm) - stop_node(pos, nvm, State) - elseif not running and nvm.firebox_trigger > 0 then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local outdir = M(pos):get_int("outdir") - nvm.provided = power.provide_power(pos, Axle, outdir, PWR_PERF) - local val = power.get_storage_load(pos, Axle, outdir, PWR_PERF) - if val > 0 then - nvm.load = val - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm,_ = techage.get_nvm(pos, true) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function after_place_node(pos) - local nvm = techage.get_nvm(pos) - State:node_init(pos, nvm, "") - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - Axle:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode) - Axle:after_dig_node(pos) - techage.del_mem(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 4} - end -end - -minetest.register_node("techage:flywheel", { - description = S("TA2 Flywheel"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_axle_clutch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_open.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_flywheel.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_flywheel.png^[transformFX]", - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:flywheel_on", { - description = S("TA2 Flywheel"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - { - name = "techage_filling4_ta2.png^techage_axle_clutch4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - "techage_filling_ta2.png^techage_appl_open.png^techage_frame_ta2.png", - { - name = "techage_filling8_ta2.png^techage_frame8_ta2.png^techage_flywheel8.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 64, - aspect_h = 64, - length = 1.2, - }, - }, - { - name = "techage_filling8_ta2.png^techage_frame8_ta2.png^techage_flywheel8.png^[transformFX]", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 64, - aspect_h = 64, - length = 1.2, - }, - }, - }, - - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_timer = node_timer, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - - drop = "", - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:flywheel", "techage:flywheel_on"}, Axle, "gen", {"R"}) - -techage.register_node({"techage:flywheel", "techage:flywheel_on"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then - nvm.firebox_trigger = 3 - if techage.is_running(nvm) then - return math.max((nvm.provided or PWR_PERF) / PWR_PERF, 0.1) - else - return 0 - end - end - end, - on_node_load = function(pos, node) - State:on_node_load(pos) - end, -}) - -minetest.register_craft({ - output = "techage:flywheel", - recipe = { - {"basic_materials:steel_bar", "dye:red", "default:wood"}, - {"", "basic_materials:gear_steel", "techage:axle"}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/ta1_watermill/mill.lua b/techage/ta1_watermill/mill.lua deleted file mode 100644 index c511ce3..0000000 --- a/techage/ta1_watermill/mill.lua +++ /dev/null @@ -1,178 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA1 Mill - -]]-- - -local M = minetest.get_meta -local S = techage.S - -local function start_mill(pos) - local obj = minetest.add_entity(pos, "techage:ta1_mill_entity") - minetest.remove_node(pos) -end - -local function stop_mill(pos, self) - minetest.swap_node(pos, {name = "techage:ta1_mill", param2 = 0}) - minetest.get_node_timer(pos):start(2) - self.object:remove() -end - -local function has_power(pos, y_offs) - local pos1 = {x = pos.x, y = pos.y + y_offs, z = pos.z} - local nvm = techage.get_nvm(pos1) - nvm.watermill_trigger = (nvm.watermill_trigger or 1) - 1 - return nvm.watermill_trigger > 0 -end - -techage.ta1_mill_has_power = has_power - -minetest.register_node("techage:ta1_mill_gear", { - description = S("TA1 Mill Gear"), - tiles = { - "default_wood.png^techage_axle_bearing.png^[transformR90", - "default_wood.png^techage_axle_bearing.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -1/2, -1/2, 1/2, -1/8, 1/2}, - {-1/8, -1/8, -1/2, 1/8, 1/8, 1/2}, - }, - }, - - after_place_node = function(pos, placer) - techage.TA1Axle:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.TA1Axle:after_dig_node(pos) - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, -}) - -techage.register_node({"techage:ta1_mill_gear"}, { - on_transfer = function(pos, in_dir, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "trigger" then - nvm.watermill_trigger = 4 - return true - end - end, -}) - -minetest.register_node("techage:ta1_mill", { - description = S("TA1 Mill"), - tiles = { - -- up, down, right, left, back, front - "techage_mill_side.png", - "techage_mill_side.png", - "techage_mill_side.png", - "techage_mill_side.png", - "techage_mill_front.png", - "techage_mill_front.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -1/8, 1/8, 4/8, 1/8}, - {-3/8, -3/8, -4/8, -1/8, 3/8, 4/8}, - {-3/8, -4/8, -3/8, -1/8, 4/8, 3/8}, - { 1/8, -3/8, -4/8, 3/8, 3/8, 4/8}, - { 1/8, -4/8, -3/8, 3/8, 4/8, 3/8}, - }, - }, - - after_place_node = function(pos, placer) - minetest.get_node_timer(pos):start(2) - end, - - on_rightclick = function(pos, node, clicker) - start_mill(pos) - end, - - on_timer = function(pos, elapsed) - if has_power(pos, 1) then - start_mill(pos) - end - return true - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, -}) - -minetest.register_entity("techage:ta1_mill_entity", { - initial_properties = { - physical = true, - visual = "wielditem", - wield_item = "techage:ta1_mill", - visual_size = {x=0.67, y=0.67, z=0.67}, - static_save = true, - automatic_rotate = -math.pi * 0.2, - pointable = false, - }, - - on_step = function(self, dtime) - self.dtime = (self.dtime or 0) + dtime - - if self.dtime > 2 then - local pos = vector.round(self.object:get_pos()) - if not has_power(pos, 1) then - stop_mill(pos, self) - end - self.dtime = 0 - minetest.sound_play("techage_mill", {gain = 0.3, pos = pos, - max_hear_distance = 10}, true) - end - end, - - on_rightclick = function(self, clicker) - local pos = vector.round(self.object:get_pos()) - stop_mill(pos, self) - end, -}) - -techage.register_node({"techage:ta1_mill"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(2) - end, -}) - -minetest.register_craft({ - output = "techage:ta1_mill_gear", - recipe = { - {"default:wood", "", "default:wood"}, - {"techage:ta1_axle", "default:wood", "techage:ta1_axle"}, - {"default:wood", "techage:ta1_axle", "default:wood"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta1_mill", - recipe = { - {"", "techage:iron_ingot", ""}, - {"stairs:slab_stone", "techage:iron_ingot", "stairs:slab_stone"}, - {"", "", ""}, - }, -}) diff --git a/techage/ta1_watermill/millboard.lua b/techage/ta1_watermill/millboard.lua deleted file mode 100644 index 445b9ce..0000000 --- a/techage/ta1_watermill/millboard.lua +++ /dev/null @@ -1,91 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA1 mill boards - -]]-- - -local M = minetest.get_meta -local S = techage.S - -local function register_board1(output, description, tiles, input) - minetest.register_node(output, { - description = description, - tiles = tiles, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -4/8, -1/2, 1/2, -3/8, 1/2}, - }, - }, - paramtype2 = "wallmounted", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), - }) - - minetest.register_craft({ - output = output .. " 3", - recipe = { - {"", "", input}, - {"", "", input}, - {"", "", input}, - }, - }) -end - -local function register_board2(output, description, tiles, input1, input2) - minetest.register_node(output, { - description = description, - tiles = tiles, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, 3/8, -1/2, 1/2, 4/8, 1/2}, - {-1/2, 3/16, -2/16, 1/2, 6/16, 2/16}, - {-1/2, -5/16, -1/16, 1/2, -3/16, 1/16}, - }, - }, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fence = 1}, - sounds = default.node_sound_wood_defaults(), - }) - - minetest.register_craft({ - output = output, - recipe = { - {"", input1, ""}, - {"", input2, ""}, - {"", "", ""}, - }, - }) -end - -register_board1("techage:ta1_board1_apple", S("TA1 Apple Wood Board"), {"default_wood.png"}, "stairs:slab_wood") -register_board1("techage:ta1_board1_jungle", S("TA1 Jungle Wood Board"), {"default_junglewood.png"}, "stairs:slab_junglewood") -register_board1("techage:ta1_board1_pine", S("TA1 Pine Wood Board"), {"default_pine_wood.png"}, "stairs:slab_pine_wood") -register_board1("techage:ta1_board1_acacia", S("TA1 Acacia Wood Board"), {"default_acacia_wood.png"}, "stairs:slab_acacia_wood") -register_board1("techage:ta1_board1_aspen", S("TA1 Aspen Wood Board"), {"default_aspen_wood.png"}, "stairs:slab_aspen_wood") - -register_board2("techage:ta1_board2_apple", S("TA1 Apple Millrace Board"), {"default_wood.png"}, "techage:ta1_board1_apple", "default:fence_rail_wood") -register_board2("techage:ta1_board2_jungle", S("TA1 Jungle Millrace Board"), {"default_junglewood.png"}, "techage:ta1_board1_jungle", "default:fence_rail_junglewood") -register_board2("techage:ta1_board2_pine", S("TA1 Pine Millrace Board"), {"default_pine_wood.png"}, "techage:ta1_board1_pine", "default:fence_rail_pine_wood") -register_board2("techage:ta1_board2_acacia", S("TA1 Acacia Millrace Board"), {"default_acacia_wood.png"}, "techage:ta1_board1_acacia", "default:fence_rail_acacia_wood") -register_board2("techage:ta1_board2_aspen", S("TA1 Aspen Millrace Board"), {"default_aspen_wood.png"}, "techage:ta1_board1_aspen", "default:fence_rail_aspen_wood") diff --git a/techage/ta1_watermill/sluice.lua b/techage/ta1_watermill/sluice.lua deleted file mode 100644 index 5af0371..0000000 --- a/techage/ta1_watermill/sluice.lua +++ /dev/null @@ -1,195 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA1 Sluice Gate - -]]-- - -local S = techage.S - -local M = minetest.get_meta -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos - -local function check_position(pos, facedir) - local dir = minetest.facedir_to_dir(facedir) - local pos_ = vector.add(pos, dir) - local node = minetest.get_node(pos_) - return (node.name == "default:water_source" or node.name == "default:water_flowing"), pos_ -end - --- Function checks if water is avaliable and --- returns the pos for the new water block, and the result (true/false). -local function has_water(pos, facedir) - local res1, pos1 = check_position(pos, (facedir + 1) % 4) - local res2, pos2 = check_position(pos, (facedir + 3) % 4) - - if res1 and not res2 then - M(pos):set_string("millrace_pos", P2S(pos2)) - return pos2, true - end - - if not res1 and res2 then - M(pos):set_string("millrace_pos", P2S(pos1)) - return pos1, true - end - - local pos3 = S2P(M(pos):get_string("millrace_pos")) - if pos3 then - return pos3, true - end - return pos1, false -end - -local function on_rightclick(pos, node, clicker, itemstack, pointed_thing) - if minetest.is_protected(pos, clicker:get_player_name()) then - return - end - - local pos2 = vector.add(pos, {x = 0, y = -1, z = 0}) - local node2 = minetest.get_node(pos2) - local pos3, res = has_water(pos2, node2.param2) - local node3 = minetest.get_node(pos3) - - if node2.name == "techage:ta1_sluice_closed" then - minetest.swap_node(pos, {name = "techage:ta1_sluice_handle_open", param2 = node.param2}) - minetest.swap_node(pos2, {name = "techage:ta1_sluice_open", param2 = node.param2}) - if res and (node3.name == "air" or node3.name == "default:water_flowing") then - minetest.add_node(pos3, {name = "default:water_source"}) - minetest.get_node_timer(pos3):start(2) - end - minetest.sound_play("doors_door_open", {gain = 0.5, pos = pos, - max_hear_distance = 10}, true) - elseif node2.name == "techage:ta1_sluice_open" then - minetest.swap_node(pos, {name = "techage:ta1_sluice_handle_closed", param2 = node.param2}) - minetest.swap_node(pos2, {name = "techage:ta1_sluice_closed", param2 = node.param2}) - if res and node3.name == "default:water_source" then - minetest.add_node(pos3, {name = "air"}) - end - minetest.sound_play("doors_door_close", {gain = 0.5, pos = pos, - max_hear_distance = 10}, true) - end -end - -minetest.register_node("techage:ta1_sluice_closed", { - description = S("TA1 Sluice Gate"), - tiles = { - "default_wood.png^techage_junglewood_top.png", - "default_wood.png", - "default_wood.png^techage_junglewood.png", - "default_wood.png^techage_junglewood.png", - "default_wood.png", - "default_wood.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, 5/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, 8/16, -5/16}, - {-8/16, -8/16, -8/16, 8/16, -5/16, 8/16}, - {-1/16, -5/16, -7/16, 1/16, 8/16, 7/16}, - }, - }, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta1_sluice_open", { - description = S("TA1 Sluice Gate"), - tiles = {"default_wood.png"}, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, 5/16, 8/16, 8/16, 8/16}, - {-8/16, -8/16, -8/16, 8/16, 8/16, -5/16}, - {-8/16, -8/16, -8/16, 8/16, -5/16, 8/16}, - }, - }, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta1_sluice_closed", -}) - -minetest.register_node("techage:ta1_sluice_handle_closed", { - description = S("TA1 Sluice Handle"), - tiles = {"default_wood.png"}, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 0/16, 8/16}, - {-1/16, 0/16, -1/16, 1/16, 4/16, 1/16}, - {-1/16, 2/16, -4/16, 1/16, 4/16, 4/16}, - }, - }, - on_rightclick = on_rightclick, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta1_sluice_handle_open", { - description = S("TA1 Sluice Handle"), - tiles = {"default_wood.png"}, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, 0/16, 8/16}, - {-1/16, 0/16, -1/16, 1/16, 14/16, 1/16}, - {-1/16, 14/16, -4/16, 1/16, 16/16, 4/16}, - }, - }, - on_rightclick = on_rightclick, - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory = 1}, - sounds = default.node_sound_wood_defaults(), - drop = "techage:ta1_sluice_handle_closed", -}) - -minetest.register_craft({ - output = "techage:ta1_sluice_closed", - recipe = { - {"", "", ""}, - {"techage:ta1_board1_apple", "techage:ta1_board1_jungle", "techage:ta1_board1_apple"}, - {"", "techage:ta1_board1_apple", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta1_sluice_handle_closed", - recipe = { - {"default:stick", "default:stick", "default:stick"}, - {"", "default:stick", ""}, - {"", "stairs:slab_wood", ""}, - }, -}) diff --git a/techage/ta1_watermill/ta1_axle.lua b/techage/ta1_watermill/ta1_axle.lua deleted file mode 100644 index 51aaa5a..0000000 --- a/techage/ta1_watermill/ta1_axle.lua +++ /dev/null @@ -1,176 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA1 Axles for the Watermill - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Axle = tubelib2.Tube:new({ - dirs_to_check = {1,2,3,4,5,6}, - max_tube_length = 10, - show_infotext = false, - tube_type = "axle1", - primary_node_names = {"techage:ta1_axle"}, - secondary_node_names = {"techage:ta1_mill_gear", "techage:ta1_axle_bearing1", "techage:ta1_axle_bearing2"}, - after_place_tube = function(pos, param2, tube_type, num_tubes, state) - minetest.swap_node(pos, {name = "techage:ta1_axle", param2 = param2}) - end, -}) - -Axle:set_valid_sides("techage:ta1_mill_gear", {"F", "B"}) -Axle:set_valid_sides("techage:ta1_axle_bearing1", {"F", "B"}) -Axle:set_valid_sides("techage:ta1_axle_bearing2", {"F", "B"}) - -minetest.register_node("techage:ta1_axle", { - description = S("TA1 Axle"), - tiles = { - "techage_axle_bearing.png^[transformR90", - "techage_axle_bearing.png^[transformR90", - "techage_axle_bearing.png", - "techage_axle_bearing.png", - "techage_axle_bearing.png", - "techage_axle_bearing.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/8, -1/8, -4/8, 1/8, 1/8, 4/8}, - }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - if not Axle:after_place_tube(pos, placer, pointed_thing) then - minetest.remove_node(pos) - return true - end - return false - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_tube(pos, oldnode, oldmetadata) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {crumbly = 3, cracky = 3, snappy = 3}, - sounds = default.node_sound_wood_defaults(), -}) - --- Bearings are defined as secondary nodes which forward received 'on_transfer' commands -minetest.register_node("techage:ta1_axle_bearing1", { - description = S("TA1 Axle Bearing"), - tiles = { - "default_stone_brick.png^techage_axle_bearing.png^[transformR90", - "default_stone_brick.png^techage_axle_bearing.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -1/2, -1/2, 1/2, -1/8, 1/2}, - {-1/8, -1/8, -1/2, 1/8, 1/8, 1/2}, - }, - }, - - after_place_node = function(pos, placer) - Axle:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_node(pos) - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, -}) - -minetest.register_node("techage:ta1_axle_bearing2", { - description = S("TA1 Axle Bearing"), - tiles = { - -- up, down, right, left, back, front - "default_stone_brick.png", - "default_stone_brick.png", - "default_stone_brick.png", - "default_stone_brick.png", - "default_stone_brick.png^techage_axle_bearing_front.png", - "default_stone_brick.png^techage_axle_bearing_front.png", - }, - - after_place_node = function(pos, placer) - Axle:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_node(pos) - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2}, -}) - -techage.register_node({"techage:ta1_axle_bearing1", "techage:ta1_axle_bearing2"}, { - on_transfer = function(pos, in_dir, topic, payload) - return techage.transfer( - pos, - in_dir, -- outdir - topic, - payload, - Axle, -- network - nil) -- valid nodes - end, -}) - - -minetest.register_craft({ - output = "techage:ta1_axle", - recipe = { - {"", "", ""}, - {"techage:iron_ingot", "dye:black", "techage:iron_ingot"}, - {"", "", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta1_axle_bearing1", - recipe = { - {"", "", ""}, - {"", "techage:ta1_axle", ""}, - {"", "stairs:slab_stonebrick", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta1_axle_bearing2", - recipe = { - {"", "", ""}, - {"", "techage:ta1_axle", ""}, - {"", "default:stonebrick", ""}, - }, -}) - -techage.TA1Axle = Axle diff --git a/techage/ta1_watermill/watermill.lua b/techage/ta1_watermill/watermill.lua deleted file mode 100644 index e1673a4..0000000 --- a/techage/ta1_watermill/watermill.lua +++ /dev/null @@ -1,319 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA1 Watermill - -]]-- - -local M = minetest.get_meta -local S = techage.S - -local function calc_dir(dir, facedir) - if facedir == 1 then - return {x = dir.z, y = dir.y, z = -dir.x} - elseif facedir == 2 then - return {x = -dir.x, y = dir.y, z = -dir.z} - elseif facedir == 3 then - return {x = -dir.z, y = dir.y, z = dir.x} - end - return {x = dir.x, y = dir.y, z = dir.z} -end - -local function add_node(pos, dir, facedir, node_name) - local pos2 = vector.add(pos, calc_dir(dir, facedir)) - local node = minetest.get_node(pos2) - if techage.is_air_like(node.name) then - minetest.swap_node(pos2, {name = node_name}) - end -end - -local function remove_node(pos, dir, facedir, node_name) - local pos2 = vector.add(pos, calc_dir(dir, facedir)) - local node = minetest.get_node(pos2) - if node.name == node_name then - minetest.swap_node(pos2, {name = "air"}) - end -end - -local function water_flowing(pos, facedir, tRes) - facedir = ((facedir or 0) + 1) % 4 - local dir = minetest.facedir_to_dir(facedir) - - local pos2 = vector.add(pos, dir) - pos2.y = pos2.y + 1 - local node = minetest.get_node(pos2) - if node.name == "default:water_flowing" or node.name == "default:river_water_flowing" then - tRes.backward = false - return true - end - - pos2 = vector.subtract(pos, dir) - pos2.y = pos2.y + 1 - node = minetest.get_node(pos2) - if node.name == "default:water_flowing" or node.name == "default:river_water_flowing" then - tRes.backward = true - return true - end -end - -local function enough_space(pos, facedir) - local pos1 = vector.add(pos, calc_dir({x =-1, y =-1, z = 0}, facedir)) - local pos2 = vector.add(pos, calc_dir({x = 1, y = 1, z = 0}, facedir)) - local _, nodes = minetest.find_nodes_in_area(pos1, pos2, {"air"}) - return nodes["air"] and nodes["air"] == 8 -end - -local function remove_nodes(pos, facedir) - remove_node(pos, {x = 0, y = 1, z = 0}, facedir, "techage:water_stop") - remove_node(pos, {x =-1, y = 0, z = 0}, facedir, "techage:water_stop") - remove_node(pos, {x = 1, y = 0, z = 0}, facedir, "techage:water_stop") - remove_node(pos, {x =-1, y = 1, z =-1}, facedir, "techage:water_stop") - remove_node(pos, {x = 1, y = 1, z =-1}, facedir, "techage:water_stop") - remove_node(pos, {x =-1, y = 1, z = 1}, facedir, "techage:water_stop") - remove_node(pos, {x = 1, y = 1, z = 1}, facedir, "techage:water_stop") -end - -local function start_wheel(pos, facedir, backward) - local obj = minetest.add_entity(pos, "techage:ta1_watermill_entity") - local dir = minetest.facedir_to_dir(facedir) - local yaw = minetest.dir_to_yaw(dir) - if backward then - obj:set_rotation({x=-math.pi/2, y=yaw, z=0}) - else - obj:set_rotation({x=math.pi/2, y=yaw, z=0}) - end - local self = obj:get_luaentity() - self.facedir = facedir - - add_node(pos, {x = 0, y = 1, z = 0}, facedir, "techage:water_stop") - add_node(pos, {x =-1, y = 0, z = 0}, facedir, "techage:water_stop") - add_node(pos, {x = 1, y = 0, z = 0}, facedir, "techage:water_stop") - add_node(pos, {x =-1, y = 1, z =-1}, facedir, "techage:water_stop") - add_node(pos, {x = 1, y = 1, z =-1}, facedir, "techage:water_stop") - add_node(pos, {x =-1, y = 1, z = 1}, facedir, "techage:water_stop") - add_node(pos, {x = 1, y = 1, z = 1}, facedir, "techage:water_stop") - minetest.remove_node(pos) -end - -local function stop_wheel(pos, self) - self.facedir = self.facedir or 0 - if self.facedir == 0 or self.facedir == 2 then - minetest.swap_node(pos, {name = "techage:ta1_watermill", param2 = 4}) - M(pos):set_int("facedir", self.facedir) - minetest.get_node_timer(pos):start(2) - elseif self.facedir == 1 or self.facedir == 3 then - minetest.swap_node(pos, {name = "techage:ta1_watermill", param2 = 13}) - M(pos):set_int("facedir", self.facedir) - minetest.get_node_timer(pos):start(2) - end - - remove_nodes(pos, self.facedir) - self.object:remove() -end - -local function trigger_consumer(pos, facedir) - local outdir = facedir + 1 - local resp = techage.transfer( - pos, - outdir, -- outdir - "trigger", -- topic - nil, -- payload - techage.TA1Axle, -- network - nil) -- valid nodes - if not resp then - outdir = tubelib2.Turn180Deg[outdir] - resp = techage.transfer( - pos, - outdir, -- outdir - "trigger", -- topic - nil, -- payload - techage.TA1Axle, -- network - nil) -- valid nodes - end -end - -minetest.register_node("techage:ta1_watermill", { - description = S("TA1 Watermill"), - tiles = { - -- up, down, right, left, back, front - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - - {-4.5/2, -1/2, 0.8/2, 4.5/2, 1/2, 1.0/2}, - {-4.5/2, -1/2, -1.0/2, 4.5/2, 1/2, -0.8/2}, - {-3.8/2, -1/2, 2.1/2, 3.8/2, 1/2, 2.3/2}, - {-3.8/2, -1/2, -2.3/2, 3.8/2, 1/2, -2.1/2}, - - { 0.8/2, -1/2, -4.5/2, 1.0/2, 1/2, 4.5/2}, - {-1.0/2, -1/2, -4.5/2, -0.8/2, 1/2, 4.5/2}, - { 2.1/2, -1/2, -3.8/2, 2.3/2, 1/2, 3.8/2}, - {-2.3/2, -1/2, -3.8/2, -2.1/2, 1/2, 3.8/2}, - }, - }, - on_rightclick = function(pos, node, clicker) - start_wheel(pos, M(pos):get_int("facedir")) - end, - - on_timer = function(pos, elapsed) - local tRes = {} - if water_flowing(pos, M(pos):get_int("facedir"), tRes) then - start_wheel(pos, M(pos):get_int("facedir"), tRes.backward) - end - return true - end, - - paramtype2 = "facedir", - paramtype = "light", - use_texture_alpha = techage.CLIP, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 2, crumbly = 2, choppy = 2, not_in_creative_inventory = 1}, - node_placement_prediction = "", - drop = "techage:ta1_watermill_inv", -}) - --- A smaller one for the inventory -minetest.register_node("techage:ta1_watermill_inv", { - description = S("TA1 Watermill"), - --inventory_image = "techage_waterwheel_inv.png", - --wield_image = "techage_waterwheel_inv.png", - tiles = { - -- up, down, right, left, back, front - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - "default_wood.png", - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/4, -1/4, -1/4, 1/4, 1/4, 1/4}, - - {-4.5/4, 0.8/4, -1/4, 4.5/4, 1.0/4, 1/4}, - {-4.5/4, -1.0/4, -1/4, 4.5/4, -0.8/4, 1/4}, - {-3.8/4, 2.1/4, -1/4, 3.8/4, 2.3/4, 1/4}, - {-3.8/4, -2.3/4, -1/4, 3.8/4, -2.1/4, 1/4}, - - { 0.8/4, -4.5/4, -1/4, 1.0/4, 4.5/4, 1/4}, - {-1.0/4, -4.5/4, -1/4, -0.8/4, 4.5/4, 1/4}, - { 2.1/4, -3.8/4, -1/4, 2.3/4, 3.8/4, 1/4}, - {-2.3/4, -3.8/4, -1/4, -2.1/4, 3.8/4, 1/4}, - }, - }, - - after_place_node = function(pos, placer) - local node = minetest.get_node(pos) - M(pos):set_int("facedir", node.param2) - remove_nodes(pos, node.param2) - if (node.param2 == 0 or node.param2 == 2) and enough_space(pos, node.param2) then - minetest.swap_node(pos, {name = "techage:ta1_watermill", param2 = 4}) - minetest.get_node_timer(pos):start(2) - elseif (node.param2 == 1 or node.param2 == 3) and enough_space(pos, node.param2) then - minetest.swap_node(pos, {name = "techage:ta1_watermill", param2 = 13}) - minetest.get_node_timer(pos):start(2) - else - minetest.remove_node(pos) - return true - end - end, - - paramtype2 = "facedir", - node_placement_prediction = "", - diggable = false, -}) - -techage.register_node({"techage:ta1_watermill"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(2) - end, -}) - - -minetest.register_entity("techage:ta1_watermill_entity", { - initial_properties = { - physical = true, - collisionbox = {-0.5, -1.5, -1.5, 0.5, 1.5, 1.5}, - visual = "wielditem", - wield_item = "techage:ta1_watermill", - visual_size = {x=0.67, y=0.67, z=0.67}, - static_save = true, - automatic_rotate = -math.pi * 0.2, - pointable = false, - }, - - on_step = function(self, dtime) - self.dtime = (self.dtime or 0) + dtime - - if self.dtime > 2 then - self.dtime = 0 - local pos = vector.round(self.object:get_pos()) - if not water_flowing(pos, self.facedir, {}) then - stop_wheel(pos, self) - end - trigger_consumer(pos, self.facedir) - minetest.sound_play("techage_watermill", {gain = 0.5, pos = pos, - max_hear_distance = 10}, true) - end - end, - - on_rightclick = function(self, clicker) - local pos = vector.round(self.object:get_pos()) - stop_wheel(pos, self) - end, - - on_activate = function(self, staticdata) - self.facedir = tonumber(staticdata) or 0 - end, - - get_staticdata = function(self) - return self.facedir - end, -}) - -minetest.register_node("techage:water_stop", { - description = "Water Stop", - drawtype = "glasslike_framed_optional", - tiles = {"blank.png"}, - inventory_image = 'techage_invisible_inv.png', - - use_texture_alpha = "blend", - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - sunlight_propagates = true, - is_ground_content = false, - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - sounds = default.node_sound_glass_defaults(), - drop = "", -}) - -minetest.register_craft({ - output = "techage:ta1_watermill_inv", - recipe = { - {"techage:ta1_board1_apple", "techage:ta1_board1_apple", "techage:ta1_board1_apple"}, - {"techage:ta1_board1_apple", "default:wood", "techage:ta1_board1_apple"}, - {"techage:ta1_board1_apple", "techage:ta1_board1_apple", "techage:ta1_board1_apple"}, - }, -}) diff --git a/techage/ta2_energy_storage/ta2_clutch.lua b/techage/ta2_energy_storage/ta2_clutch.lua deleted file mode 100644 index 4438135..0000000 --- a/techage/ta2_energy_storage/ta2_clutch.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Axle clutch - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local DESCR = S("TA2 Clutch") - -local Axle = techage.Axle -local power = networks.power -local control = networks.control - --- Search for a gearbox, which is part of the axle network -local function get_gearbox_pos(pos) - local outdir = M(pos):get_int("outdir") - local pos1, dir1 = Axle:get_connected_node_pos(pos, outdir) - if pos1 then - local node = minetest.get_node(pos1) - --print("get_gearbox_pos", node.name) - if node.name == "techage:gearbox_on" or node.name == "techage:gearbox" then - return pos1 - end - end -end - --- Send to the winches -local function control_cmnd(pos, topic) - -- The clutch is not part of the axle network, - -- so we have to use a helper function to be able - -- to send a command into the network. - local pos1 = get_gearbox_pos(pos) - if pos1 then - control.send(pos1, Axle, 0, "sto", topic) - end -end - -local function switch_on(pos, node) - if node.name == "techage:ta2_clutch_off" then - control_cmnd(pos, "on") - node.name = "techage:ta2_clutch_on" - minetest.swap_node(pos, node) - Axle:after_place_tube(pos) - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5}) - end -end - -local function switch_off(pos, node) - if node.name == "techage:ta2_clutch_on" then - control_cmnd(pos, "off") - minetest.swap_node(pos, {name = "techage:ta2_clutch_off", param2 = M(pos):get_int("outdir") - 1}) - Axle:after_dig_tube(pos, node) - minetest.sound_play("techage_button", { - pos = pos, - gain = 0.5, - max_hear_distance = 5}) - end -end - -minetest.register_node("techage:ta2_clutch_off", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_appl_clutch.png^techage_appl_arrow3.png^techage_frame_ta2.png^[transformR90", - "techage_filling_ta2.png^techage_appl_clutch.png^techage_appl_arrow3.png^techage_frame_ta2.png^[transformR270", - "techage_filling_ta2.png^techage_appl_clutch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_clutch.png^techage_frame_ta2.png^[transformR180", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_clutch_clutch.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_clutch_clutch.png", - }, - after_place_node = function(pos, placer, itemstack, pointed_thing) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "B")) - end, - on_rightclick = switch_on, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta2_clutch_on", { - description = DESCR, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_appl_clutch_on.png^techage_frame_ta2.png^[transformR90", - "techage_filling_ta2.png^techage_appl_clutch_on.png^techage_frame_ta2.png^[transformR270", - "techage_filling_ta2.png^techage_appl_clutch_on.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_clutch_on.png^techage_frame_ta2.png^[transformR180", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_clutch_clutch.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_clutch_clutch.png", - }, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Axle:after_dig_tube(pos, oldnode, oldmetadata) - end, - on_rightclick = switch_off, - paramtype2 = "facedir", - drop = "techage:ta2_clutch_off", - groups = {cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta2_clutch_off", - recipe = { - {"default:junglewood", "techage:axle", "default:wood"}, - {"techage:axle", "basic_materials:gear_steel", "techage:axle"}, - {"default:wood", "techage:axle", "default:junglewood"}, - }, -}) diff --git a/techage/ta2_energy_storage/ta2_rope.lua b/techage/ta2_energy_storage/ta2_rope.lua deleted file mode 100644 index 492461e..0000000 --- a/techage/ta2_energy_storage/ta2_rope.lua +++ /dev/null @@ -1,85 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - Rope for TA2 gravity-based energy storage - -]]-- - -local Entities = {} - --- Return first pos after start pos and the destination pos -local function get_positions(pos, length, force) - local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z} -- start pos - local pos2 = {x = pos.x, y = pos.y - 1 - length, z = pos.z} -- end pos - if force then - return pos1, pos2 -- force given length - end - local _, pos3 = minetest.line_of_sight(pos1, pos2) - return pos1, pos3 or pos2 -- new values -end - -local function del_rope(pos) - local key = minetest.hash_node_position(pos) - local rope = Entities[key] - if rope then - rope:remove() - Entities[key] = nil - end - return key -end - -local function add_rope(pos, pos1, pos2) - local key = del_rope(pos) - - pos1.y = pos1.y + 0.5 -- from - pos2.y = pos2.y - 0.5 -- to - local pos3 = {x = pos1.x, y = (pos1.y + pos2.y) / 2, z = pos1.z} -- mid-pos - local length = math.abs(pos1.y - pos2.y) - - local rope = minetest.add_entity(pos3, "techage:ta2_rope") - if rope then - rope:set_properties({visual_size = {x = 0.06, y = length}, collisionbox = {x = 0.06, y = length}}) - end - Entities[key] = rope -end - -minetest.register_entity("techage:ta2_rope", { - initial_properties = { - visual = "cube", - textures = { - "techage_rope.png", - "techage_rope.png", - "techage_rope.png", - "techage_rope.png", - "techage_rope.png", - "techage_rope.png", - }, - use_texture_alpha = false, - physical = true, - collide_with_objects = true, - pointable = true, - static_save = false, - visual_size = {x = 0.06, y = 10, z = 0.06}, - shaded = true, - }, -}) - -------------------------------------------------------------------------------- --- API functions -------------------------------------------------------------------------------- -function techage.renew_rope(pos, length, force) - local pos1, pos2 = get_positions(pos, length, force) - if pos1 then - add_rope(pos, pos1, pos2) - return pos1, pos2 - end -end - -techage.del_rope = del_rope diff --git a/techage/ta2_energy_storage/ta2_weight_chest.lua b/techage/ta2_energy_storage/ta2_weight_chest.lua deleted file mode 100644 index 16b97b0..0000000 --- a/techage/ta2_energy_storage/ta2_weight_chest.lua +++ /dev/null @@ -1,137 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - Chest for TA2 gravity-based energy storage - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local function valid_weight_items(stack) - local name = stack:get_name() - local ndef = minetest.registered_nodes[name] - if ndef then - if minetest.get_item_group(name, "stone") > 0 then - return true - end - if minetest.get_item_group(name, "cobble") > 0 then - return true - end - if minetest.get_item_group(name, "gravel") > 0 then - return true - end - if minetest.get_item_group(name, "sand") > 0 then - return true - end - end -end - -minetest.register_entity("techage:ta2_weight_chest_entity", { - initial_properties = { - physical = true, - pointable = false, - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - visual = "wielditem", - textures = {"techage:ta2_weight_chest"}, - visual_size = {x=0.66, y=0.66, z=0.66}, - static_save = false, - }, -}) - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - if not valid_weight_items(stack) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -local function formspec() - return "size[8,6.7]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;1.5,0.2;5,2;]".. - "list[current_player;main;0,3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:ta2_weight_chest", { - description = S("TA2 Weight Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 10) - end, - - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec()) - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA2 Weight Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta2_weight_chest", - recipe = { - {"", "", ""}, - {"basic_materials:steel_strip", "techage:chest_ta2", "basic_materials:steel_strip"}, - {"", "", ""}, - }, -}) diff --git a/techage/ta2_energy_storage/ta2_winch.lua b/techage/ta2_energy_storage/ta2_winch.lua deleted file mode 100644 index b9fd848..0000000 --- a/techage/ta2_energy_storage/ta2_winch.lua +++ /dev/null @@ -1,225 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - Winch for TA2 gravity-based energy storage - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local MIN_LOAD = 99 -- 1 stack -local MAX_ROPE_LEN = 10 -local CYCLE_TIME = 2 - -local Axle = techage.Axle -local power = networks.power -local control = networks.control - - -local function chest_pos(pos) - local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z} -- start pos - local pos2 = {x = pos.x, y = pos.y - 1 - MAX_ROPE_LEN, z = pos.z} -- end pos - local _, pos3 = minetest.line_of_sight(pos1, pos2) - return pos3 or pos2 -end - -local function chest_load(nvm, pos) - local amount = 0 - local inv = minetest.get_inventory({type = "node", pos = pos}) - nvm.stored_items = {} - for i = 1, inv:get_size("main") do - local stack = inv:get_stack("main", i) - nvm.stored_items[i] = {name = stack:get_name(), count = stack:get_count()} - amount = amount + stack:get_count() - end - return amount * 3 -end - -local function chest_full(pos) - local nvm = techage.get_nvm(pos) - local pos1 = chest_pos(pos) - local node = minetest.get_node(pos1) - if node.name == "techage:ta2_weight_chest" then - return chest_load(nvm, pos1) >= MIN_LOAD - end -end - -local function add_chest_entity(pos, nvm) - local mem = techage.get_mem(pos) - local length - - if not nvm.capa or nvm.capa == 0 then - length = (nvm.length or MAX_ROPE_LEN) * (1 - (nvm.load or 0)) - else - length = (nvm.length or MAX_ROPE_LEN) * (1 - (nvm.load or 0) / nvm.capa) - end - local y = pos.y - length - 1 - techage.renew_rope(pos, length, true) - if mem.obj then - mem.obj:remove() - end - mem.obj = minetest.add_entity({x = pos.x, y = y, z = pos.z}, "techage:ta2_weight_chest_entity") -end - --- Add chest node, remove chest entity instead -local function add_chest(pos) - local mem = techage.get_mem(pos) - local nvm = techage.get_nvm(pos) - if mem.obj then - mem.obj:remove() - mem.obj = nil - end - if nvm.capa and nvm.capa >= MIN_LOAD then - local pos1 = {x = pos.x, y = pos.y - (nvm.length or 1) - 1, z = pos.z} - minetest.add_node(pos1, {name = "techage:ta2_weight_chest", param2 = 0}) - local ndef = minetest.registered_nodes["techage:ta2_weight_chest"] - ndef.on_construct(pos1) - ndef.after_place_node(pos1) - local inv = minetest.get_inventory({type = "node", pos = pos1}) - for i, item in ipairs(nvm.stored_items or {}) do - inv:set_stack("main", i, item) - end - end - nvm.capa = 0 -end - --- Remove chest node, add rope and chest entity instead -local function remove_chest(pos) - local mem = techage.get_mem(pos) - local nvm = techage.get_nvm(pos) - local pos1 = chest_pos(pos) - local mass = chest_load(nvm, pos1) - if mass > 0 then - nvm.length = pos.y - pos1.y - 1 - nvm.capa = mass * nvm.length / MAX_ROPE_LEN - minetest.remove_node(pos1) - mem.obj = minetest.add_entity(pos1, "techage:ta2_weight_chest_entity") - techage.renew_rope(pos, nvm.length) - return true - end -end - -minetest.register_node("techage:ta2_winch", { - description = S("TA2 Winch"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_appl_arrow2.png^techage_frame_ta2.png^[transformR270", - "techage_filling_ta2.png^techage_appl_arrow2.png^techage_frame_ta2.png^techage_appl_winch_hole.png^[transformR270", - "techage_filling_ta2.png^techage_axle_gearbox.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", - }, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - local outdir = networks.side_to_outdir(pos, "R") - M(pos):set_int("outdir", outdir) - Axle:after_place_node(pos, {outdir}) - minetest.get_node_timer(pos):start(CYCLE_TIME) - techage.renew_rope(pos, MAX_ROPE_LEN - 1) - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - local outdir = M(pos):get_int("outdir") - nvm.capa = nvm.capa or 1 - nvm.load = nvm.load or 0 - - if nvm.blocked then - -- Keep the network active - power.get_storage_load(pos, Axle, outdir, nvm.capa) - return true - end - if not nvm.running and power.power_available(pos, Axle, outdir) and chest_full(pos) then - remove_chest(pos) - nvm.running = true - power.start_storage_calc(pos, Axle, outdir) - elseif nvm.running and nvm.load < 2 and not power.power_available(pos, Axle, outdir) then - add_chest(pos) - nvm.running = false - power.start_storage_calc(pos, Axle, outdir) - end - - if nvm.running then - nvm.load = power.get_storage_load(pos, Axle, outdir, nvm.capa) or 0 - if nvm.load > 2 then - add_chest_entity(pos, nvm) - end - else - techage.renew_rope(pos, 50) - end - return true - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - add_chest(pos) - techage.del_rope(pos) - local outdir = tonumber(oldmetadata.fields.outdir or 0) - power.start_storage_calc(pos, Axle, outdir) - Axle:after_dig_node(pos, {outdir}) - techage.del_mem(pos) - end, - - get_storage_data = function(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - nvm.capa = nvm.capa or 1 - if nvm.running and not nvm.blocked then - return {level = (nvm.load or 0) / nvm.capa, capa = nvm.capa} - end - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:ta2_winch"}, Axle, "sto", {"R"}) - -techage.register_node({"techage:ta2_winch"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(CYCLE_TIME) - local nvm = techage.get_nvm(pos) - if nvm.running then - add_chest_entity(pos, nvm) - end - end, -}) - -control.register_nodes({"techage:ta2_winch"}, { - on_receive = function(pos, tlib2, topic, payload) - --print("on_receive", topic) - local nvm = techage.get_nvm(pos) - if topic == "on" then - nvm.blocked = false - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Axle, outdir) - elseif topic == "off" then - nvm.blocked = true - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Axle, outdir) - end - end, - } -) - -minetest.register_craft({ - output = "techage:ta2_winch", - recipe = { - {"farming:string", "farming:string", "farming:string"}, - {"farming:string", "techage:gearbox", "farming:string"}, - {"farming:string", "farming:string", "farming:string"}, - }, -}) diff --git a/techage/ta3_power/akkubox.lua b/techage/ta3_power/akkubox.lua deleted file mode 100644 index 120fee4..0000000 --- a/techage/ta3_power/akkubox.lua +++ /dev/null @@ -1,214 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Accu Box - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 2 -local PWR_CAPA = 2000 - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control -local in_range = techage.in_range - - -local function formspec(self, pos, nvm) - local data - - if nvm.running then - local outdir = M(pos):get_int("outdir") - data = power.get_network_data(pos, Cable, outdir) - end - return techage.storage_formspec(self, pos, nvm, S("TA3 Accu Box"), data, nvm.capa, PWR_CAPA) -end - -local function start_node(pos, nvm, state) - nvm.running = true - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local function stop_node(pos, nvm, state) - nvm.running = false - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta3_akku", - cycle_time = CYCLE_TIME, - standby_ticks = 0, - formspec_func = formspec, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - if nvm.running then - local outdir = M(pos):get_int("outdir") - local capa = power.get_storage_load(pos, Cable, outdir, PWR_CAPA) or 0 - if capa > 0 then - nvm.capa = capa - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return true -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_storage_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if nvm.running then - return {level = (nvm.capa or 0) / PWR_CAPA, capa = PWR_CAPA} - end -end - -local function get_capa(itemstack) - local meta = itemstack:get_meta() - if meta then - return in_range(meta:get_int("capa") * (PWR_CAPA/100), 0, 3000) - end - return 0 -end - -local function set_capa(pos, oldnode, oldmetadata, drops) - local nvm = techage.get_nvm(pos) - local capa = nvm.capa - local meta = drops[1]:get_meta() - capa = techage.power.percent(PWR_CAPA, capa) - capa = (math.floor((capa or 0) / 5)) * 5 - meta:set_int("capa", capa) - local text = S("TA3 Accu Box").." ("..capa.." %)" - meta:set_string("description", text) -end - -local function after_place_node(pos, placer, itemstack) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local own_num = techage.add_node(pos, "techage:ta3_akku") - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", S("TA3 Accu Box").." "..own_num) - local outdir = networks.side_to_outdir(pos, "R") - meta:set_int("outdir", outdir) - meta:set_string("formspec", formspec(State, pos, nvm)) - Cable:after_place_node(pos, {outdir}) - State:node_init(pos, nvm, own_num) - nvm.capa = get_capa(itemstack) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - local outdir = tonumber(oldmetadata.fields.outdir or 0) - Cable:after_dig_node(pos, {outdir}) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -minetest.register_node("techage:ta3_akku", { - description = S("TA3 Accu Box"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_hole_electric.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_source.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_source.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_source.png", - }, - - on_timer = node_timer, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_storage_data = get_storage_data, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), - preserve_metadata = set_capa, -}) - -power.register_nodes({"techage:ta3_akku"}, Cable, "sto", {"R"}) - --- for logical communication -techage.register_node({"techage:ta3_akku"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "load" then - return techage.power.percent(PWR_CAPA, nvm.capa) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 134 then -- load - return 0, {math.floor(techage.power.percent(PWR_CAPA, nvm.capa) + 0.5)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, -}) - -control.register_nodes({"techage:ta3_akku"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - return { - type = S("TA3 Accu Box"), - number = M(pos):get_string("node_number") or "", - running = nvm.running or false, - capa = PWR_CAPA , - load = nvm.capa or 0, - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta3_akku", - recipe = { - {"default:tin_ingot", "default:tin_ingot", "default:wood"}, - {"default:copper_ingot", "default:copper_ingot", "techage:electric_cableS"}, - {"techage:iron_ingot", "techage:iron_ingot", "default:wood"}, - }, -}) diff --git a/techage/ta3_power/axle2power.lua b/techage/ta3_power/axle2power.lua deleted file mode 100644 index 1f6ff63..0000000 --- a/techage/ta3_power/axle2power.lua +++ /dev/null @@ -1,202 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA2 Power Generator - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos - -local Cable = techage.ElectricCable -local Axle = techage.Axle -local power = networks.power -local control = networks.control - -local CYCLE_TIME = 2 -local PWR_PERF = 24 - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function node_timer_on(pos, elapsed) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local outdir = meta:get_int("outdir") - nvm.buffer = nvm.buffer or 0 - - local amount = math.min(PWR_PERF * 2 - nvm.buffer, PWR_PERF) - local taken = power.consume_power(pos, Axle, networks.Flip[outdir], amount) - nvm.buffer = nvm.buffer + taken - 1 -- some loss - - if nvm.buffer >= PWR_PERF then - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, 0.8, 1.0) - nvm.load = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - nvm.buffer = nvm.buffer - nvm.provided - end - if amount > 0 and taken == 0 then - swap_node(pos, "techage:ta2_generator_off") - local outdir = M(pos):get_int("outdir") - nvm.running = false - power.start_storage_calc(pos, Cable, outdir) - end - return true -end - -local function node_timer_off(pos, elapsed) - local nvm = techage.get_nvm(pos) - local outdir = M(pos):get_int("outdir") - - if power.power_available(pos, Axle, networks.Flip[outdir]) then - swap_node(pos, "techage:ta2_generator_on") - nvm.running = true - power.start_storage_calc(pos, Cable, outdir) - end - return true -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if nvm.running then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - - -minetest.register_node("techage:ta2_generator_off", { - description = S("TA2 Power Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2_top.png^techage_appl_arrow.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_hole_electric.png", - "techage_filling_ta2.png^techage_axle_clutch.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_generator_red.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_generator_red.png^[transformFX]", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - - after_place_node = function(pos) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Cable:after_place_node(pos) - Axle:after_place_node(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - M(pos):set_string("infotext", S("TA2 Power Generator")) - end, - - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - Axle:after_dig_node(pos) - techage.del_mem(pos) - end, - - on_timer = node_timer_off, - get_generator_data = get_generator_data, -}) - -minetest.register_node("techage:ta2_generator_on", { - description = S("TA2 Power Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2_top.png^techage_appl_arrow.png", - "techage_filling_ta2.png^techage_frame_ta2.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_hole_electric.png", - { - name = "techage_filling4_ta2.png^techage_axle_clutch4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - { - name = "techage_filling4_ta2.png^techage_appl_generator_red4.png^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - { - name = "techage_filling4_ta2.png^techage_appl_generator_red4.png^[transformFX]^techage_frame4_ta2.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - }, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - is_ground_content = false, - drop = "", - groups = {not_in_creative_inventory=1}, - diggable = false, - - on_timer = node_timer_on, - get_generator_data = get_generator_data, -}) - -techage.register_node({"techage:ta2_generator_off", "techage:ta2_generator_on"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -power.register_nodes({"techage:ta2_generator_off", "techage:ta2_generator_on"}, Axle, "con", {"L"}) -power.register_nodes({"techage:ta2_generator_off", "techage:ta2_generator_on"}, Cable, "gen", {"R"}) - -control.register_nodes({"techage:ta2_generator_off", "techage:ta2_generator_on"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA2 Power Generator"), - number = "---", - running = true, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = "80% - 100%", - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta2_generator_off", - recipe = { - {"basic_materials:steel_bar", "dye:red", "default:wood"}, - {'techage:axle', 'basic_materials:gear_steel', 'techage:electric_cableS'}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/ta3_power/power2axle.lua b/techage/ta3_power/power2axle.lua deleted file mode 100644 index 82f2e6e..0000000 --- a/techage/ta3_power/power2axle.lua +++ /dev/null @@ -1,186 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Electric Motor - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos - -local Cable = techage.ElectricCable -local Axle = techage.Axle -local power = networks.power - -local CYCLE_TIME = 2 -local PWR_PERF = 40 - --- Axles texture animation -local function switch_axles(pos, on) - local outdir = M(pos):get_int("outdir") - Axle:switch_tube_line(pos, outdir, on and "on" or "off") -end - -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - -local function node_timer_on(pos, elapsed) - local nvm = techage.get_nvm(pos) - local outdir = M(pos):get_int("outdir") - nvm.buffer = nvm.buffer or 0 - - local amount = math.min(PWR_PERF * 2 - nvm.buffer, PWR_PERF) - local taken = power.consume_power(pos, Cable, networks.Flip[outdir], amount) - nvm.buffer = nvm.buffer + taken - 1 -- some loss - - if nvm.buffer >= PWR_PERF then - nvm.provided = power.provide_power(pos, Axle, outdir, PWR_PERF) - nvm.load = power.get_storage_load(pos, Axle, outdir, PWR_PERF) - nvm.buffer = nvm.buffer - nvm.provided - end - if amount > 0 and taken == 0 then - swap_node(pos, "techage:ta3_motor_off") - switch_axles(pos, false) - local outdir = M(pos):get_int("outdir") - nvm.running = false - power.start_storage_calc(pos, Cable, outdir) - end - return true -end - -local function node_timer_off(pos, elapsed) - local nvm = techage.get_nvm(pos) - local outdir = M(pos):get_int("outdir") - - if power.power_available(pos, Cable) then - swap_node(pos, "techage:ta3_motor_on") - switch_axles(pos, true) - nvm.running = true - power.start_storage_calc(pos, Cable, outdir) - end - return true -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if nvm.running then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -minetest.register_node("techage:ta3_motor_off", { - description = S("TA3 Electric Motor"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_axle_clutch.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_generator_red.png^[transformFX]", - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_generator_red.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - - after_place_node = function(pos) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Cable:after_place_node(pos) - Axle:after_place_node(pos) - minetest.get_node_timer(pos):start(CYCLE_TIME) - M(pos):set_string("infotext", S("TA3 Electric Motor")) - end, - - after_dig_node = function(pos, oldnode) - Cable:after_dig_node(pos) - Axle:after_dig_node(pos) - techage.del_mem(pos) - end, - - on_timer = node_timer_off, - get_generator_data = get_generator_data, -}) - -minetest.register_node("techage:ta3_motor_on", { - description = S("TA3 Electric Motor"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta3.png^techage_frame_ta3_top.png^techage_appl_arrow.png", - "techage_filling_ta3.png^techage_frame_ta3.png", - { - name = "techage_filling4_ta3.png^techage_axle_clutch4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.6, - }, - }, - "techage_filling_ta3.png^techage_frame_ta3.png^techage_appl_hole_electric.png", - { - name = "techage_filling4_ta3.png^techage_appl_generator_red4.png^[transformFX]^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - { - name = "techage_filling4_ta3.png^techage_appl_generator_red4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.3, - }, - }, - }, - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - is_ground_content = false, - drop = "", - groups = {not_in_creative_inventory=1}, - diggable = false, - - on_timer = node_timer_on, - get_generator_data = get_generator_data, -}) - -techage.register_node({"techage:ta3_motor_off", "techage:ta3_motor_on"}, { - on_node_load = function(pos, node) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -power.register_nodes({"techage:ta3_motor_off", "techage:ta3_motor_on"}, Axle, "gen", {"R"}) -power.register_nodes({"techage:ta3_motor_off", "techage:ta3_motor_on"}, Cable, "con", {"L"}) - -minetest.register_craft({ - output = "techage:ta3_motor_off", - recipe = { - {"basic_materials:steel_bar", "dye:red", "default:wood"}, - {'techage:electric_cableS', 'basic_materials:gear_steel', 'techage:axle'}, - {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, - }, -}) diff --git a/techage/ta3_power/tiny_generator.lua b/techage/ta3_power/tiny_generator.lua deleted file mode 100644 index 2a8ea35..0000000 --- a/techage/ta3_power/tiny_generator.lua +++ /dev/null @@ -1,400 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA3 Tiny Power Generator - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local firebox = techage.firebox -local fuel = techage.fuel -local Pipe = techage.LiquidPipe -local power = networks.power -local liquid = networks.liquid -local control = networks.control - -local CYCLE_TIME = 2 -local STANDBY_TICKS = 1 -local COUNTDOWN_TICKS = 2 -local PWR_PERF = 12 -local EFFICIENCY = 2.5 - -local function formspec(self, pos, nvm) - return "size[5,4]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;4.8,0.5;#c6e8ff]".. - "label[0.2,-0.1;"..minetest.colorize( "#000000", S("Tiny Generator")).."]".. - fuel.fuel_container(0, 0.9, nvm).. - "image[1.4,1.6;1,1;techage_form_arrow_bg.png^[transformR270]".. - "image_button[1.4,3.2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[1.5,3;1,1;"..self:get_state_tooltip(nvm).."]".. - techage.formspec_power_bar(pos, 2.5, 0.8, S("Electricity"), nvm.provided, PWR_PERF) -end - -local function play_sound(pos) - local mem = techage.get_mem(pos) - if not mem.handle or mem.handle == -1 then - mem.handle = minetest.sound_play("techage_generator", { - pos = pos, - gain = 1, - max_hear_distance = 10, - loop = true}) - if mem.handle == -1 then - minetest.after(1, play_sound, pos) - end - end -end - -local function stop_sound(pos) - local mem = techage.get_mem(pos) - if mem.handle then - minetest.sound_stop(mem.handle) - mem.handle = nil - end -end - -local function has_fuel(pos, nvm) - return (nvm.burn_cycles or 0) > 0 or (nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0) -end - -local function can_start(pos, nvm, state) - if has_fuel(pos, nvm) then - return true - end - return S("no fuel") -end - -local function start_node(pos, nvm, state) - local meta = M(pos) - nvm.provided = 0 - local outdir = meta:get_int("outdir") - play_sound(pos) - power.start_storage_calc(pos, Cable, outdir) - techage.evaluate_charge_termination(nvm, meta) -end - -local function stop_node(pos, nvm, state) - nvm.provided = 0 - local outdir = M(pos):get_int("outdir") - stop_sound(pos) - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:tiny_generator", - node_name_active = "techage:tiny_generator_on", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - infotext_name = S("TA3 Tiny Power Generator"), - can_start = can_start, - start_node = start_node, - stop_node = stop_node, -}) - -local function burning(pos, nvm) - local ratio = math.max((nvm.provided or PWR_PERF) / PWR_PERF, 0.02) - - nvm.liquid = nvm.liquid or {} - nvm.liquid.amount = nvm.liquid.amount or 0 - nvm.burn_cycles = (nvm.burn_cycles or 0) - ratio - if nvm.burn_cycles <= 0 then - if nvm.liquid.amount > 0 then - nvm.liquid.amount = nvm.liquid.amount - 1 - nvm.burn_cycles = fuel.burntime(nvm.liquid.name) * EFFICIENCY / CYCLE_TIME - nvm.burn_cycles_total = nvm.burn_cycles - else - nvm.liquid.name = nil - end - end -end - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - local fuel = has_fuel(pos, nvm) - if running and not fuel then - State:standby(pos, nvm, S("no fuel")) - stop_node(pos, nvm, State) - elseif not running and fuel then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local meta = M(pos) - local outdir = meta:get_int("outdir") - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) - local val = power.get_storage_load(pos, Cable, outdir, PWR_PERF) - if val > 0 then - nvm.load = val - end - burning(pos, nvm) - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function on_rightclick(pos, node, clicker) - local nvm = techage.get_nvm(pos) - techage.set_activeformspec(pos, clicker) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -minetest.register_node("techage:tiny_generator", { - description = S("TA3 Tiny Power Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_appl_electric_gen_top.png^techage_frame_ta3_top.png", - "techage_appl_electric_gen_top.png^techage_frame_ta3.png", - "techage_appl_electric_gen_side.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_appl_electric_gen_side.png^techage_frame_ta3.png", - "techage_appl_electric_gen_front.png^[transformFX]^techage_frame_ta3.png", - "techage_appl_electric_gen_front.png^techage_frame_ta3.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - - after_place_node = function(pos, placer, itemstack) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:tiny_generator") - nvm.burn_cycles = 0 - if itemstack then - local stack_meta = itemstack:get_meta() - if stack_meta then - local liquid_name = stack_meta:get_string("liquid_name") - local liquid_amount = stack_meta:get_int("liquid_amount") - if liquid_name ~= "" and fuel.burntime(liquid.name) and - liquid_amount >= 0 and liquid_amount <= fuel.CAPACITY then - nvm.liquid = nvm.liquid or {} - nvm.liquid.name = liquid_name - nvm.liquid.amount = liquid_amount - end - end - end - State:node_init(pos, nvm, number) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) - Pipe:after_place_node(pos) - Cable:after_place_node(pos) - end, - - after_dig_node = function(pos, oldnode) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - preserve_metadata = function(pos, oldnode, oldmetadata, drops) - local nvm = techage.get_nvm(pos) - if nvm.liquid and nvm.liquid.name and nvm.liquid.amount > 0 then - -- generator tank is not empty - local meta = drops[1]:get_meta() - meta:set_string("liquid_name", nvm.liquid.name) - meta:set_int("liquid_amount", nvm.liquid.amount) - meta:set_string("description", S("TA3 Tiny Power Generator") .. " (fuel: " .. - tostring(nvm.liquid and nvm.liquid.amount or 0) .. "/" .. - tostring(fuel.CAPACITY) .. ")") - end - end, - - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta3", PWR_PERF), - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_punch = fuel.on_punch, - on_timer = node_timer, -}) - -minetest.register_node("techage:tiny_generator_on", { - description = S("TA3 Tiny Power Generator"), - tiles = { - -- up, down, right, left, back, front - "techage_appl_electric_gen_top.png^techage_frame_ta3_top.png", - "techage_appl_electric_gen_top.png^techage_frame_ta3.png", - "techage_appl_electric_gen_side.png^techage_appl_hole_electric.png^techage_frame_ta3.png", - "techage_appl_electric_gen_side.png^techage_frame_ta3.png", - { - name = "techage_appl_electric_gen_front4.png^[transformFX]^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - { - name = "techage_appl_electric_gen_front4.png^techage_frame4_ta3.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 0.8, - }, - }, - }, - - paramtype = "light", - paramtype2 = "facedir", - groups = {not_in_creative_inventory=1}, - diggable = false, - light_source = 4, - on_rotate = screwdriver.disallow, - is_ground_content = false, - - get_generator_data = get_generator_data, - ta3_formspec = techage.generator_settings("ta3", PWR_PERF), - on_receive_fields = on_receive_fields, - on_rightclick = on_rightclick, - on_punch = fuel.on_punch, - on_timer = node_timer, - can_dig = fuel.can_dig, -}) - -local liquid_def = { - fuel_cat = fuel.BT_GASOLINE, - capa = fuel.CAPACITY, - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - if techage.fuel.valid_fuel(name, fuel.BT_GASOLINE) then - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, fuel.CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end - return amount - end, - take = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local taken = liquid.srv_take(nvm, name, amount) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return taken - end, - untake = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - local leftover = liquid.srv_put(nvm, name, amount, fuel.CAPACITY) - if techage.is_activeformspec(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return leftover - end, -} - -power.register_nodes({"techage:tiny_generator", "techage:tiny_generator_on"}, Cable, "gen", {"R"}) -liquid.register_nodes({"techage:tiny_generator", "techage:tiny_generator_on"}, Pipe, "tank", nil, liquid_def) - -control.register_nodes({"techage:tiny_generator", "techage:tiny_generator_on"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA3 Tiny Power Generator"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -techage.register_node({"techage:tiny_generator", "techage:tiny_generator_on"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "delivered" then - return nvm.provided or 0 - elseif topic == "fuel" then - return techage.fuel.get_fuel_amount(nvm) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 135 then - return 0, {nvm.provided or 0} - elseif topic == 132 then - return 0, {techage.fuel.get_fuel_amount(nvm)} - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, - on_node_load = function(pos, node) - State:on_node_load(pos) - if node.name == "techage:tiny_generator_on" then - play_sound(pos) - end - local inv = M(pos):get_inventory() - if not inv:is_empty("fuel") then - local nvm = techage.get_nvm(pos) - nvm.liquid = nvm.liquid or {} - local count = inv:get_stack("fuel", 1):get_count() - nvm.liquid.amount = (nvm.liquid.amount or 0) + count - nvm.liquid.name = "techage:gasoline" - inv:set_stack("fuel", 1, nil) - end - end, -}) - -minetest.register_craft({ - output = "techage:tiny_generator", - recipe = { - {'default:steel_ingot', 'techage:usmium_nuggets', 'default:steel_ingot'}, - {'dye:red', 'basic_materials:gear_steel', 'techage:electric_cableS'}, - {'default:steel_ingot', 'techage:vacuum_tube', 'default:steel_ingot'}, - }, -}) diff --git a/techage/ta4_power/electricmeter.lua b/techage/ta4_power/electricmeter.lua deleted file mode 100644 index 7951ff0..0000000 --- a/techage/ta4_power/electricmeter.lua +++ /dev/null @@ -1,255 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Electric Meter (to separate networks) - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 2 -local PWR_PERF = 200 - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "200 ku,150 ku,100 ku,50 ku,20 ku", - name = "current", - label = S("Max. power"), - tooltip = S("Maximum power passed through"), - default = "100 ku", - values = {200, 150, 100, 50, 20} - }, - { - type = "number", - name = "countdown", - label = S("Power countdown"), - tooltip = S("Amount of power to be provided before the device turns off"), - default = "0", - }, -} - -local function max_current(pos) - local meta = M(pos) - if meta:contains("current") then - local current = meta:get_int("current") - return current > 0 and current or PWR_PERF - end - return PWR_PERF -end - -local function formspec(self, pos, nvm, power) - local units = (nvm.units or 0) / techage.CYCLES_PER_DAY - nvm.countdown = nvm.countdown or M(pos):get_int("countdown") - power = power or 0 - - return "size[5,4]" .. - "box[0,-0.1;4.8,0.5;#c6e8ff]" .. - techage.wrench_image(4.4, -0.08) .. - "label[0.2,-0.1;" .. minetest.colorize( "#000000", S("TA4 Electric Meter")).."]" .. - techage.formspec_power_bar(pos, 0.0, 0.7, S("Power"), power, max_current(pos)) .. - techage.formspec_meter(pos, 2.5, 0.7, S("Consumption"), units, "kud") .. - techage.formspec_meter(pos, 2.5, 1.7, S("Countdown"), nvm.countdown, "kud") .. - "image_button[3.2,3.0;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3.2,2.2;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -local function start_node(pos, nvm, state) - local outdir = M(pos):get_int("outdir") - nvm.load = 0 - nvm.countdown = M(pos):get_int("countdown") - power.start_storage_calc(pos, Cable, outdir) - outdir = networks.Flip[outdir] - power.start_storage_calc(pos, Cable, outdir) -end - -local function stop_node(pos, nvm, state) - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) - outdir = networks.Flip[outdir] - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_electricmeter", - infotext_name = S("TA4 Electric Meter"), - cycle_time = CYCLE_TIME, - standby_ticks = 0, - formspec_func = formspec, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local data - if techage.is_running(nvm) then - local outdir2 = M(pos):get_int("outdir") - local outdir1 = networks.Flip[outdir2] - local current = max_current(pos) - data = power.transfer_simplex(pos, Cable, outdir1, Cable, outdir2, current) - if data then - nvm.countdown = nvm.countdown or M(pos):get_int("countdown") - nvm.load = (data.curr_load1 / data.max_capa1 + data.curr_load2 / data.max_capa2) / 2 * current - nvm.moved = data.moved - nvm.units = (nvm.units or 0) + data.moved - State:keep_running(pos, nvm) - if nvm.countdown > 0 then - nvm.countdown = nvm.countdown - (data.moved / techage.CYCLES_PER_DAY) - if nvm.countdown <= 0 then - State:stop(pos, nvm) - end - end - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm, nvm.moved)) - end - return true -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function after_place_node(pos, placer, itemstack) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local own_num = techage.add_node(pos, "techage:ta4_electricmeter") - meta:set_string("owner", placer:get_player_name()) - local outdir = networks.side_to_outdir(pos, "R") - meta:set_int("outdir", outdir) - Cable:after_place_node(pos, {outdir, networks.Flip[outdir]}) - State:node_init(pos, nvm, own_num) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - local outdir = tonumber(oldmetadata.fields.outdir or 0) - Cable:after_dig_node(pos, {outdir, networks.Flip[outdir]}) - techage.del_mem(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - -- check for secondary/generator side - if outdir == M(pos):get_int("outdir") then - if techage.is_running(nvm) then - local current = max_current(pos) - return {level = (nvm.load or 0) / current, perf = current, capa = current * 2} - end - end -end - -minetest.register_node("techage:ta4_electricmeter", { - description = S("TA4 Electric Meter"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_arrow.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_meter.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_meter.png", - }, - - on_timer = node_timer, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - ta4_formspec = WRENCH_MENU, - get_generator_data = get_generator_data, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:ta4_electricmeter"}, Cable, "gen", {"R", "L"}) - --- for logical communication -techage.register_node({"techage:ta4_electricmeter"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "consumption" then - return math.floor((nvm.units or 0) / techage.CYCLES_PER_DAY) - elseif topic == "countdown" then - return math.floor((nvm.countdown or 0) + 0.5) - elseif topic == "current" then - return math.floor((nvm.moved or 0) + 0.5) - else - return State:on_receive_message(pos, topic, payload) - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 146 then - if payload[1] == 0 then -- Consumption - return 0, {math.floor((nvm.units or 0) / techage.CYCLES_PER_DAY)} - elseif payload[1] == 0 then -- countdown - return 0, {math.floor((nvm.countdown or 0) + 0.5)} - else -- current - return 0, {math.floor((nvm.moved or 0) + 0.5)} - end - else - return State:on_beduino_request_data(pos, topic, payload) - end - end, -}) - -control.register_nodes({"techage:ta4_electricmeter"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Electric Meter"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = max_current(pos), - provided = nvm.moved or 0, - termpoint = "-", - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_electricmeter", - recipe = { - {"default:steel_ingot", "dye:blue", "default:steel_ingot"}, - {"techage:electric_cableS", "basic_materials:gold_wire", "techage:electric_cableS"}, - {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, - }, - replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, }, -}) diff --git a/techage/ta4_power/laser.lua b/techage/ta4_power/laser.lua deleted file mode 100644 index f8acb13..0000000 --- a/techage/ta4_power/laser.lua +++ /dev/null @@ -1,168 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - TA4 Laser beam emitter and receiver - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Cable = techage.ElectricCable -local power = networks.power - -minetest.register_node("techage:ta4_laser_emitter", { - description = S("TA4 Laser Beam Emitter"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser_hole.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - }, - - after_place_node = function(pos, placer) - local tube_dir = networks.side_to_outdir(pos, "F") - Cable:prepare_pairing(pos, tube_dir, "") - Cable:after_place_node(pos, {tube_dir}) - local number = techage.add_node(pos, "techage:ta4_laser_emitter") - M(pos):set_string("node_number", number) - local res, pos1, pos2 = techage.renew_laser(pos, true) - if pos1 then - local node = techage.get_node_lvm(pos2) - if node.name == "techage:ta4_laser_receiver" then - Cable:pairing(pos2, "laser") - Cable:pairing(pos, "laser") - else - minetest.chat_send_player(placer:get_player_name(), - S("Valid destination positions:") .. " " .. - P2S(pos1) .. " " .. S("to") .. " " .. P2S(pos2)) - end - else - minetest.chat_send_player(placer:get_player_name(), S("Laser beam error!")) - end - minetest.get_node_timer(pos):start(2) - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - local res, pos1, pos2 = techage.renew_laser(pos) - if pos1 then - local node = techage.get_node_lvm(pos2) - if node.name == "techage:ta4_laser_receiver" then - Cable:pairing(pos2, "laser") - Cable:pairing(pos, "laser") - nvm.running = true - else - local metadata = M(pos):to_table() - Cable:stop_pairing(pos, metadata, "") - local tube_dir = tonumber(metadata.fields.tube_dir or 0) - Cable:after_dig_node(pos, {tube_dir}) - nvm.running = false - end - elseif not res then - techage.del_laser(pos) - local metadata = M(pos):to_table() - Cable:stop_pairing(pos, metadata, "") - local tube_dir = tonumber(metadata.fields.tube_dir or 0) - Cable:after_dig_node(pos, {tube_dir}) - nvm.running = false - end - return true - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.del_laser(pos) - Cable:stop_pairing(pos, oldmetadata, "") - local tube_dir = tonumber(oldmetadata.fields.tube_dir or 0) - Cable:after_dig_node(pos, {tube_dir}) - end, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node("techage:ta4_laser_receiver", { - description = S("TA4 Laser Beam Receiver"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser_hole.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - }, - - after_place_node = function(pos, placer) - local tube_dir = networks.side_to_outdir(pos, "F") - Cable:prepare_pairing(pos, tube_dir, "") - Cable:after_place_node(pos, {tube_dir}) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - Cable:stop_pairing(pos, oldmetadata, "") - local tube_dir = tonumber(oldmetadata.fields.tube_dir or 0) - Cable:after_dig_node(pos, {tube_dir}) - end, - - paramtype2 = "facedir", - on_rotate = screwdriver.disallow, - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -techage.register_node({"techage:ta4_laser_emitter"}, { - on_recv_message = function(pos, src, topic, payload) - if topic == "state" then - local nvm = techage.get_nvm(pos) - return nvm.running and "running" or "stopped" - else - return "unsupported" - end - end, - on_beduino_request_data = function(pos, src, topic, payload) - if topic == 142 then -- Binary State - local nvm = techage.get_nvm(pos) - return 0, {nvm.running and 1 or 0} - else - return 2, "" - end - end, -}) - -power.register_nodes({"techage:ta4_laser_emitter", "techage:ta4_laser_receiver"}, Cable, "special", {"F"}) - -minetest.register_craft({ - output = "techage:ta4_laser_emitter", - recipe = { - {"techage:ta4_carbon_fiber", "dye:blue", "techage:ta4_carbon_fiber"}, - {"techage:electric_cableS", "basic_materials:energy_crystal_simple", "techage:ta4_leds"}, - {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_laser_receiver", - recipe = { - {"techage:ta4_carbon_fiber", "dye:blue", "techage:ta4_carbon_fiber"}, - {"techage:electric_cableS", "basic_materials:gold_wire", "default:obsidian_glass"}, - {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, - }, -}) diff --git a/techage/ta4_power/transformer.lua b/techage/ta4_power/transformer.lua deleted file mode 100644 index 82d86bc..0000000 --- a/techage/ta4_power/transformer.lua +++ /dev/null @@ -1,211 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Isolation Transformer (to separate networks) - -]]-- - --- for lazy programmers -local P2S = minetest.pos_to_string -local M = minetest.get_meta -local S = techage.S - -local CYCLE_TIME = 2 -local PWR_PERF = 100 - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local WRENCH_MENU = { - { - type = "dropdown", - choices = "300 ku,200 ku,150 ku,100 ku,50 ku,20 ku", - name = "current", - label = S("Max. power"), - tooltip = S("Maximum power passed through"), - default = "100 ku", - values = {300, 200, 150, 100, 50, 20} - }, -} - -local function max_current(pos) - local meta = M(pos) - if meta:contains("current") then - local current = meta:get_int("current") - return current > 0 and current or PWR_PERF - end - return PWR_PERF -end - -local function formspec(self, pos, nvm, data) - data = data or {curr_load1 = 0, curr_load2 = 0, max_capa1 = 0, max_capa2 = 0, moved = 0} - return "size[7.5,5.2]".. - "box[0,-0.1;7.3,0.5;#c6e8ff]".. - techage.wrench_image(6.9, -0.08) .. - "label[0.2,-0.1;"..minetest.colorize( "#000000", S("TA4 Isolation Transformer")).."]".. - techage.formspec_storage_bar(pos, 0.0, 0.7, S("Storage"), data.curr_load1, data.max_capa1).. - techage.formspec_power_bar(pos, 2.5, 0.7, S("Power"), data.moved, max_current(pos)).. - techage.formspec_storage_bar(pos, 5.0, 0.7, S("Storage"), data.curr_load2, data.max_capa2).. - "image_button[3.3,4.3;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3.3,4.3;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -local function start_node(pos, nvm, state) - local outdir = M(pos):get_int("outdir") - nvm.load = 0 - power.start_storage_calc(pos, Cable, outdir) - outdir = networks.Flip[outdir] - power.start_storage_calc(pos, Cable, outdir) -end - -local function stop_node(pos, nvm, state) - local outdir = M(pos):get_int("outdir") - power.start_storage_calc(pos, Cable, outdir) - outdir = networks.Flip[outdir] - power.start_storage_calc(pos, Cable, outdir) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_transformer", - infotext_name = S("TA4 Isolation Transformer"), - cycle_time = CYCLE_TIME, - standby_ticks = 0, - formspec_func = formspec, - start_node = start_node, - stop_node = stop_node, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local data - if techage.is_running(nvm) then - local outdir2 = M(pos):get_int("outdir") - local outdir1 = networks.Flip[outdir2] - local current = max_current(pos) - data = power.transfer_duplex(pos, Cable, outdir1, Cable, outdir2, current) - if data then - nvm.load = (data.curr_load1 / data.max_capa1 + data.curr_load2 / data.max_capa2) / 2 * current - nvm.moved = data.moved - end - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm, data)) - end - return true -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) -end - -local function after_place_node(pos, placer, itemstack) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local own_num = techage.add_node(pos, "techage:ta4_transformer") - meta:set_string("owner", placer:get_player_name()) - local outdir = networks.side_to_outdir(pos, "R") - meta:set_int("outdir", outdir) - Cable:after_place_node(pos, {outdir, networks.Flip[outdir]}) - State:node_init(pos, nvm, own_num) -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - local outdir = tonumber(oldmetadata.fields.outdir or 0) - Cable:after_dig_node(pos, {outdir, networks.Flip[outdir]}) - techage.del_mem(pos) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - local current = max_current(pos) - return {level = (nvm.load or 0) / current, perf = current, capa = current * 2} - end -end - -minetest.register_node("techage:ta4_transformer", { - description = S("TA4 Isolation Transformer"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_trafo.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_trafo.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_trafo.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - "techage_trafo.png^techage_frame_ta4.png", - "techage_trafo.png^techage_frame_ta4.png", - }, - - on_timer = node_timer, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - ta4_formspec = WRENCH_MENU, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -power.register_nodes({"techage:ta4_transformer"}, Cable, "gen", {"R", "L"}) - --- for logical communication -techage.register_node({"techage:ta4_transformer"}, { - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - -control.register_nodes({"techage:ta4_transformer"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Isolation Transformer"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = max_current(pos), - provided = nvm.moved or 0, - termpoint = "-", - } - end - return false - end, - } -) - -minetest.register_craft({ - output = "techage:ta4_transformer", - recipe = { - {"default:steel_ingot", "dye:blue", "default:steel_ingot"}, - {"techage:electric_cableS", "basic_materials:copper_wire", "techage:electric_cableS"}, - {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, - }, -}) diff --git a/techage/teleport/teleport_pipe.lua b/techage/teleport/teleport_pipe.lua deleted file mode 100644 index 84d19e0..0000000 --- a/techage/teleport/teleport_pipe.lua +++ /dev/null @@ -1,198 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 teleport pipe - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Pipe = techage.LiquidPipe -local teleport = techage.teleport -local Cable = techage.ElectricCable -local power = networks.power -local liquid = networks.liquid - -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 -local PWR_NEEDED = 12 -local EX_POINTS = 30 -local MAX_DIST = 500 -local DESCRIPTION = S("TA5 Teleport Block Liquids") - -local function formspec(self, pos, nvm) - local title = DESCRIPTION .. " " .. M(pos):get_string("tele_status") - return "size[8,2]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]" .. - "label[0.5,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "image_button[3.5,1;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3.5,1;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -local function can_start(pos, nvm, state) - return teleport.is_connected(pos) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_tele_pipe", - infotext_name = DESCRIPTION, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - countdown_ticks = COUNTDOWN_TICKS, - formspec_func = formspec, - can_start = can_start, -}) - -local function consume_power(pos, nvm) - if techage.needs_power(nvm) then - local taken = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if techage.is_running(nvm) then - if taken < PWR_NEEDED then - State:nopower(pos, nvm) - else - return true -- keep running - end - elseif taken == PWR_NEEDED then - State:start(pos, nvm) - end - end -end - -minetest.register_node("techage:ta5_tele_pipe", { - description = DESCRIPTION, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_tele_pipe.png", - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_pipe.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local node = minetest.get_node(pos) - local pipe_dir = techage.side_to_outdir("L", node.param2) - local number = techage.add_node(pos, "techage:ta5_tele_pipe") - State:node_init(pos, nvm, number) - meta:set_int("pipe_dir", pipe_dir) - meta:set_string("owner", placer:get_player_name()) - Pipe:after_place_node(pos, {pipe_dir}) - Cable:after_place_node(pos) - teleport.prepare_pairing(pos, "ta5_tele_pipe") - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if teleport.is_connected(pos) then - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - else - teleport.after_formspec(pos, player, fields, MAX_DIST, EX_POINTS) - end - end, - - on_rightclick = function(pos, clicker, listname) - if teleport.is_connected(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - else - M(pos):set_string("formspec", teleport.formspec(pos)) - end - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - consume_power(pos, nvm) - -- the state has to be triggered by on_push_item - State:idle(pos, nvm) - return State:is_active(nvm) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - teleport.stop_pairing(pos, oldmetadata) - Pipe:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - is_ground_content = false, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta5_tele_pipe", - recipe = { - {"techage:aluminum", "dye:red", "techage:aluminum"}, - {"techage:ta3_pipeS", "techage:usmium_nuggets", "techage:ta5_aichip"}, - {"techage:ta4_carbon_fiber", "", "techage:ta4_carbon_fiber"}, - }, -}) - -local blocked = false -- flag to prevent stack overruns (not to pump into the own "tank") -liquid.register_nodes({"techage:ta5_tele_pipe"}, Pipe, "tank", {"L"}, { - peek = function(pos) - local nvm = techage.get_nvm(pos) - return liquid.srv_peek(nvm) - end, - put = function(pos, indir, name, amount) - local nvm = techage.get_nvm(pos) - nvm.oil_amount = nvm.oil_amount or 0 - if not blocked and techage.is_operational(nvm) then - local rmt_pos = teleport.get_remote_pos(pos) - if rmt_pos then - local rmt_nvm = techage.get_nvm(rmt_pos) - if techage.is_operational(rmt_nvm) then - local pipe_dir = M(rmt_pos):get_int("pipe_dir") - blocked = true - local leftover = liquid.put(rmt_pos, Pipe, pipe_dir, name, amount) - blocked = false - if leftover < amount then - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS) - end - return leftover - else - State:blocked(pos, nvm, S("Remote block error")) - end - end - end - return amount - end -}) - -techage.register_node({"techage:ta5_tele_pipe"}, { - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - -power.register_nodes({"techage:ta5_tele_pipe"}, Cable, "con", {"B", "R", "F", "D", "U"}) -Pipe:set_valid_sides("techage:ta5_tele_pipe", {"L"}) diff --git a/techage/teleport/teleport_tube.lua b/techage/teleport/teleport_tube.lua deleted file mode 100644 index 4755c02..0000000 --- a/techage/teleport/teleport_tube.lua +++ /dev/null @@ -1,190 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA5 teleport tube - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local Tube = techage.Tube -local teleport = techage.teleport -local Cable = techage.ElectricCable -local power = networks.power - -local STANDBY_TICKS = 4 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 2 -local PWR_NEEDED = 12 -local EX_POINTS = 30 -local MAX_DIST = 500 -local DESCRIPTION = S("TA5 Teleport Block Items") - -local function formspec(self, pos, nvm) - local title = DESCRIPTION .. " " .. M(pos):get_string("tele_status") - return "size[8,2]".. - "box[0,-0.1;7.8,0.5;#c6e8ff]" .. - "label[0.5,-0.1;" .. minetest.colorize( "#000000", title) .. "]" .. - "image_button[3.5,1;1,1;" .. self:get_state_button_image(nvm) .. ";state_button;]" .. - "tooltip[3.5,1;1,1;" .. self:get_state_tooltip(nvm) .. "]" -end - -local function can_start(pos, nvm, state) - return teleport.is_connected(pos) -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta5_tele_tube", - infotext_name = DESCRIPTION, - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - countdown_ticks = COUNTDOWN_TICKS, - formspec_func = formspec, - can_start = can_start, -}) - -local function consume_power(pos, nvm) - if techage.needs_power(nvm) then - local taken = power.consume_power(pos, Cable, nil, PWR_NEEDED) - if techage.is_running(nvm) then - if taken < PWR_NEEDED then - State:nopower(pos, nvm) - else - return true -- keep running - end - elseif taken == PWR_NEEDED then - State:start(pos, nvm) - end - end -end - -minetest.register_node("techage:ta5_tele_tube", { - description = DESCRIPTION, - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_tele_tube.png", - "techage_filling_ta4.png^techage_frame_ta5_top.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_hole_tube.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_teleport.png", - }, - - after_place_node = function(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local node = minetest.get_node(pos) - local tube_dir = techage.side_to_outdir("L", node.param2) - local number = techage.add_node(pos, "techage:ta5_tele_tube") - State:node_init(pos, nvm, number) - meta:set_int("tube_dir", tube_dir) - meta:set_string("owner", placer:get_player_name()) - Tube:after_place_node(pos, {tube_dir}) - Cable:after_place_node(pos) - teleport.prepare_pairing(pos, "ta5_tele_tube") - end, - - on_receive_fields = function(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - if teleport.is_connected(pos) then - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - else - teleport.after_formspec(pos, player, fields, MAX_DIST, EX_POINTS) - end - end, - - on_rightclick = function(pos, clicker, listname) - if teleport.is_connected(pos) then - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - else - M(pos):set_string("formspec", teleport.formspec(pos)) - end - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - consume_power(pos, nvm) - -- the state has to be triggered by on_push_item - State:idle(pos, nvm) - return State:is_active(nvm) - end, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) - teleport.stop_pairing(pos, oldmetadata) - Tube:after_dig_node(pos) - Cable:after_dig_node(pos) - techage.del_mem(pos) - end, - - paramtype2 = "facedir", -- important! - on_rotate = screwdriver.disallow, -- important! - is_ground_content = false, - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "techage:ta5_tele_tube", - recipe = { - {"techage:aluminum", "dye:red", "techage:aluminum"}, - {"techage:ta4_tubeS", "techage:usmium_nuggets", "techage:ta5_aichip"}, - {"techage:ta4_carbon_fiber", "", "techage:ta4_carbon_fiber"}, - }, -}) - -techage.register_node({"techage:ta5_tele_tube"}, { - on_push_item = function(pos, in_dir, stack) - local nvm = techage.get_nvm(pos) - if techage.is_operational(nvm) then - local rmt_pos = teleport.get_remote_pos(pos) - if rmt_pos then - local rmt_nvm = techage.get_nvm(rmt_pos) - if techage.is_operational(rmt_nvm) then - local tube_dir = M(rmt_pos):get_int("tube_dir") - local leftover = techage.push_items(rmt_pos, tube_dir, stack) - -- Moved any items - if leftover then - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS) - return leftover - end - return leftover - else - State:blocked(pos, nvm, S("Remote block error")) - end - end - end - return false - end, - is_pusher = true, -- is a pulling/pushing node - - on_recv_message = function(pos, src, topic, payload) - return State:on_receive_message(pos, topic, payload) - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - return State:on_beduino_receive_cmnd(pos, topic, payload) - end, - on_beduino_request_data = function(pos, src, topic, payload) - return State:on_beduino_request_data(pos, topic, payload) - end, -}) - -power.register_nodes({"techage:ta5_tele_tube"}, Cable, "con", {"B", "R", "F", "D", "U"}) -Tube:set_valid_sides("techage:ta5_tele_tube", {"L"}) diff --git a/techage/textures/generate.py b/techage/textures/generate.py deleted file mode 100755 index 7103ade..0000000 --- a/techage/textures/generate.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Script to generate the palette PNG file. -# -# Copyright (C) 2022 Joachim Stolberg -# LGPLv2.1+ - -from PIL import Image - -MainColors = [ - 0x000080, 0x008000, 0x800000, 0x008080, 0x808000, 0x800080, - 0x0000FF, 0x00FF00, 0xFF0000, 0x00FFFF, 0xFFFF00, 0xFF00FF, - 0x0080FF, 0x8000FF, 0x80FF00, 0x00FF80, 0xFF8000, 0xFF0080, -] - -def generate(): - img = Image.new("RGB", (18, 15), color='#000000') - - # Main colors - for x in range(0,18): - img.putpixel((x, 0), MainColors[x]) - - # Grey scale - for x in range(0,18): - img.putpixel((x, 1), (x * 15, x * 15, x * 15)) - - # 216 colors palette - idx = 36 - for r in range(0,6): - for g in range(0,6): - for b in range(0,6): - x = idx % 18 - y = int(idx / 18) - img.putpixel((x, y), (r * 0x33, g * 0x33, b * 0x33)) - idx += 1 - - img.save("techage_palette256.png", "PNG") - -generate() diff --git a/techage/textures/techage_aichip.png b/techage/textures/techage_aichip.png deleted file mode 100644 index 85403ae..0000000 Binary files a/techage/textures/techage_aichip.png and /dev/null differ diff --git a/techage/textures/techage_aluminum_inv.png b/techage/textures/techage_aluminum_inv.png deleted file mode 100644 index 26f5e62..0000000 Binary files a/techage/textures/techage_aluminum_inv.png and /dev/null differ diff --git a/techage/textures/techage_appl_arrow.png b/techage/textures/techage_appl_arrow.png deleted file mode 100644 index 56bf16b..0000000 Binary files a/techage/textures/techage_appl_arrow.png and /dev/null differ diff --git a/techage/textures/techage_appl_arrow2.png b/techage/textures/techage_appl_arrow2.png deleted file mode 100644 index e86ad35..0000000 Binary files a/techage/textures/techage_appl_arrow2.png and /dev/null differ diff --git a/techage/textures/techage_appl_arrow3.png b/techage/textures/techage_appl_arrow3.png deleted file mode 100644 index e34eaf6..0000000 Binary files a/techage/textures/techage_appl_arrow3.png and /dev/null differ diff --git a/techage/textures/techage_appl_arrowXL.png b/techage/textures/techage_appl_arrowXL.png deleted file mode 100644 index 604a777..0000000 Binary files a/techage/textures/techage_appl_arrowXL.png and /dev/null differ diff --git a/techage/textures/techage_appl_arrow_white.png b/techage/textures/techage_appl_arrow_white.png deleted file mode 100644 index 17a299d..0000000 Binary files a/techage/textures/techage_appl_arrow_white.png and /dev/null differ diff --git a/techage/textures/techage_appl_autocrafter.png b/techage/textures/techage_appl_autocrafter.png deleted file mode 100644 index 95c5287..0000000 Binary files a/techage/textures/techage_appl_autocrafter.png and /dev/null differ diff --git a/techage/textures/techage_appl_autocrafter4.png b/techage/textures/techage_appl_autocrafter4.png deleted file mode 100644 index 0f9df4f..0000000 Binary files a/techage/textures/techage_appl_autocrafter4.png and /dev/null differ diff --git a/techage/textures/techage_appl_blackhole.png b/techage/textures/techage_appl_blackhole.png deleted file mode 100644 index 54137e6..0000000 Binary files a/techage/textures/techage_appl_blackhole.png and /dev/null differ diff --git a/techage/textures/techage_appl_button.png b/techage/textures/techage_appl_button.png deleted file mode 100644 index 347b3ad..0000000 Binary files a/techage/textures/techage_appl_button.png and /dev/null differ diff --git a/techage/textures/techage_appl_cartdetector.png b/techage/textures/techage_appl_cartdetector.png deleted file mode 100644 index c0e92f6..0000000 Binary files a/techage/textures/techage_appl_cartdetector.png and /dev/null differ diff --git a/techage/textures/techage_appl_cartdetector_on.png b/techage/textures/techage_appl_cartdetector_on.png deleted file mode 100644 index f498b01..0000000 Binary files a/techage/textures/techage_appl_cartdetector_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_chest_back_ta3.png b/techage/textures/techage_appl_chest_back_ta3.png deleted file mode 100644 index 770f0fa..0000000 Binary files a/techage/textures/techage_appl_chest_back_ta3.png and /dev/null differ diff --git a/techage/textures/techage_appl_chest_back_ta4.png b/techage/textures/techage_appl_chest_back_ta4.png deleted file mode 100644 index 5d90801..0000000 Binary files a/techage/textures/techage_appl_chest_back_ta4.png and /dev/null differ diff --git a/techage/textures/techage_appl_chest_front_ta3.png b/techage/textures/techage_appl_chest_front_ta3.png deleted file mode 100644 index 6644902..0000000 Binary files a/techage/textures/techage_appl_chest_front_ta3.png and /dev/null differ diff --git a/techage/textures/techage_appl_chest_front_ta4.png b/techage/textures/techage_appl_chest_front_ta4.png deleted file mode 100644 index bbb2400..0000000 Binary files a/techage/textures/techage_appl_chest_front_ta4.png and /dev/null differ diff --git a/techage/textures/techage_appl_clutch.png b/techage/textures/techage_appl_clutch.png deleted file mode 100644 index b1cc9f8..0000000 Binary files a/techage/textures/techage_appl_clutch.png and /dev/null differ diff --git a/techage/textures/techage_appl_clutch_on.png b/techage/textures/techage_appl_clutch_on.png deleted file mode 100644 index 4e85065..0000000 Binary files a/techage/textures/techage_appl_clutch_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_color_top.png b/techage/textures/techage_appl_color_top.png deleted file mode 100644 index 91954a8..0000000 Binary files a/techage/textures/techage_appl_color_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_color_top4.png b/techage/textures/techage_appl_color_top4.png deleted file mode 100644 index c43fcfa..0000000 Binary files a/techage/textures/techage_appl_color_top4.png and /dev/null differ diff --git a/techage/textures/techage_appl_command_converter.png b/techage/textures/techage_appl_command_converter.png deleted file mode 100644 index b6d765b..0000000 Binary files a/techage/textures/techage_appl_command_converter.png and /dev/null differ diff --git a/techage/textures/techage_appl_command_converter_on.png b/techage/textures/techage_appl_command_converter_on.png deleted file mode 100644 index b4b6adb..0000000 Binary files a/techage/textures/techage_appl_command_converter_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_compressor.png b/techage/textures/techage_appl_compressor.png deleted file mode 100644 index 5add516..0000000 Binary files a/techage/textures/techage_appl_compressor.png and /dev/null differ diff --git a/techage/textures/techage_appl_compressor4.png b/techage/textures/techage_appl_compressor4.png deleted file mode 100644 index 4ee4cda..0000000 Binary files a/techage/textures/techage_appl_compressor4.png and /dev/null differ diff --git a/techage/textures/techage_appl_cooler.png b/techage/textures/techage_appl_cooler.png deleted file mode 100644 index f581871..0000000 Binary files a/techage/textures/techage_appl_cooler.png and /dev/null differ diff --git a/techage/textures/techage_appl_cooler4.png b/techage/textures/techage_appl_cooler4.png deleted file mode 100644 index 952cf55..0000000 Binary files a/techage/textures/techage_appl_cooler4.png and /dev/null differ diff --git a/techage/textures/techage_appl_ctrl_unit.png b/techage/textures/techage_appl_ctrl_unit.png deleted file mode 100644 index 765e931..0000000 Binary files a/techage/textures/techage_appl_ctrl_unit.png and /dev/null differ diff --git a/techage/textures/techage_appl_ctrl_unit4.png b/techage/textures/techage_appl_ctrl_unit4.png deleted file mode 100644 index 4423392..0000000 Binary files a/techage/textures/techage_appl_ctrl_unit4.png and /dev/null differ diff --git a/techage/textures/techage_appl_defect.png b/techage/textures/techage_appl_defect.png deleted file mode 100644 index 8b528a9..0000000 Binary files a/techage/textures/techage_appl_defect.png and /dev/null differ diff --git a/techage/textures/techage_appl_detector.png b/techage/textures/techage_appl_detector.png deleted file mode 100644 index f8499d0..0000000 Binary files a/techage/textures/techage_appl_detector.png and /dev/null differ diff --git a/techage/textures/techage_appl_detector_on.png b/techage/textures/techage_appl_detector_on.png deleted file mode 100644 index d4d77b3..0000000 Binary files a/techage/textures/techage_appl_detector_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri.png b/techage/textures/techage_appl_distri.png deleted file mode 100644 index b3ad288..0000000 Binary files a/techage/textures/techage_appl_distri.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri4.png b/techage/textures/techage_appl_distri4.png deleted file mode 100644 index ad2494e..0000000 Binary files a/techage/textures/techage_appl_distri4.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri_blue.png b/techage/textures/techage_appl_distri_blue.png deleted file mode 100644 index 8d42498..0000000 Binary files a/techage/textures/techage_appl_distri_blue.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri_green.png b/techage/textures/techage_appl_distri_green.png deleted file mode 100644 index 20d7eb7..0000000 Binary files a/techage/textures/techage_appl_distri_green.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri_red.png b/techage/textures/techage_appl_distri_red.png deleted file mode 100644 index 51cf930..0000000 Binary files a/techage/textures/techage_appl_distri_red.png and /dev/null differ diff --git a/techage/textures/techage_appl_distri_yellow.png b/techage/textures/techage_appl_distri_yellow.png deleted file mode 100644 index 5b19ada..0000000 Binary files a/techage/textures/techage_appl_distri_yellow.png and /dev/null differ diff --git a/techage/textures/techage_appl_doorcontroller.png b/techage/textures/techage_appl_doorcontroller.png deleted file mode 100644 index 5bd9b21..0000000 Binary files a/techage/textures/techage_appl_doorcontroller.png and /dev/null differ diff --git a/techage/textures/techage_appl_electric_gen_front.png b/techage/textures/techage_appl_electric_gen_front.png deleted file mode 100644 index 93e03db..0000000 Binary files a/techage/textures/techage_appl_electric_gen_front.png and /dev/null differ diff --git a/techage/textures/techage_appl_electric_gen_front4.png b/techage/textures/techage_appl_electric_gen_front4.png deleted file mode 100644 index a89f7a1..0000000 Binary files a/techage/textures/techage_appl_electric_gen_front4.png and /dev/null differ diff --git a/techage/textures/techage_appl_electric_gen_side.png b/techage/textures/techage_appl_electric_gen_side.png deleted file mode 100644 index 0ea6b90..0000000 Binary files a/techage/textures/techage_appl_electric_gen_side.png and /dev/null differ diff --git a/techage/textures/techage_appl_electric_gen_top.png b/techage/textures/techage_appl_electric_gen_top.png deleted file mode 100644 index 008bfcc..0000000 Binary files a/techage/textures/techage_appl_electric_gen_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_electrolyzer.png b/techage/textures/techage_appl_electrolyzer.png deleted file mode 100644 index 9cbcaa8..0000000 Binary files a/techage/textures/techage_appl_electrolyzer.png and /dev/null differ diff --git a/techage/textures/techage_appl_electrolyzer4.png b/techage/textures/techage_appl_electrolyzer4.png deleted file mode 100644 index f60de71..0000000 Binary files a/techage/textures/techage_appl_electrolyzer4.png and /dev/null differ diff --git a/techage/textures/techage_appl_electronic_fab.png b/techage/textures/techage_appl_electronic_fab.png deleted file mode 100644 index 61d53e3..0000000 Binary files a/techage/textures/techage_appl_electronic_fab.png and /dev/null differ diff --git a/techage/textures/techage_appl_electronic_fab4.png b/techage/textures/techage_appl_electronic_fab4.png deleted file mode 100644 index f8ca342..0000000 Binary files a/techage/textures/techage_appl_electronic_fab4.png and /dev/null differ diff --git a/techage/textures/techage_appl_explosive.png b/techage/textures/techage_appl_explosive.png deleted file mode 100644 index 6141f84..0000000 Binary files a/techage/textures/techage_appl_explosive.png and /dev/null differ diff --git a/techage/textures/techage_appl_filler.png b/techage/textures/techage_appl_filler.png deleted file mode 100644 index 92205d6..0000000 Binary files a/techage/textures/techage_appl_filler.png and /dev/null differ diff --git a/techage/textures/techage_appl_filler4.png b/techage/textures/techage_appl_filler4.png deleted file mode 100644 index 19751dd..0000000 Binary files a/techage/textures/techage_appl_filler4.png and /dev/null differ diff --git a/techage/textures/techage_appl_firehole.png b/techage/textures/techage_appl_firehole.png deleted file mode 100644 index 5581214..0000000 Binary files a/techage/textures/techage_appl_firehole.png and /dev/null differ diff --git a/techage/textures/techage_appl_firehole4.png b/techage/textures/techage_appl_firehole4.png deleted file mode 100644 index a2e73af..0000000 Binary files a/techage/textures/techage_appl_firehole4.png and /dev/null differ diff --git a/techage/textures/techage_appl_flipflop.png b/techage/textures/techage_appl_flipflop.png deleted file mode 100644 index a0194c3..0000000 Binary files a/techage/textures/techage_appl_flipflop.png and /dev/null differ diff --git a/techage/textures/techage_appl_flipflop_on.png b/techage/textures/techage_appl_flipflop_on.png deleted file mode 100644 index 73d09e9..0000000 Binary files a/techage/textures/techage_appl_flipflop_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_forceload.png b/techage/textures/techage_appl_forceload.png deleted file mode 100644 index 7036991..0000000 Binary files a/techage/textures/techage_appl_forceload.png and /dev/null differ diff --git a/techage/textures/techage_appl_fuelcell.png b/techage/textures/techage_appl_fuelcell.png deleted file mode 100644 index bc9f240..0000000 Binary files a/techage/textures/techage_appl_fuelcell.png and /dev/null differ diff --git a/techage/textures/techage_appl_fuelcell4.png b/techage/textures/techage_appl_fuelcell4.png deleted file mode 100644 index 81eb130..0000000 Binary files a/techage/textures/techage_appl_fuelcell4.png and /dev/null differ diff --git a/techage/textures/techage_appl_funnel.png b/techage/textures/techage_appl_funnel.png deleted file mode 100644 index b4dc474..0000000 Binary files a/techage/textures/techage_appl_funnel.png and /dev/null differ diff --git a/techage/textures/techage_appl_funnel_top.png b/techage/textures/techage_appl_funnel_top.png deleted file mode 100644 index 953ff4e..0000000 Binary files a/techage/textures/techage_appl_funnel_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_furnace.png b/techage/textures/techage_appl_furnace.png deleted file mode 100644 index 0bb6c5f..0000000 Binary files a/techage/textures/techage_appl_furnace.png and /dev/null differ diff --git a/techage/textures/techage_appl_gaze_sensor.png b/techage/textures/techage_appl_gaze_sensor.png deleted file mode 100644 index 6ad92ea..0000000 Binary files a/techage/textures/techage_appl_gaze_sensor.png and /dev/null differ diff --git a/techage/textures/techage_appl_gaze_sensor_on.png b/techage/textures/techage_appl_gaze_sensor_on.png deleted file mode 100644 index 7a6f9d6..0000000 Binary files a/techage/textures/techage_appl_gaze_sensor_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_generator.png b/techage/textures/techage_appl_generator.png deleted file mode 100644 index 4a4a102..0000000 Binary files a/techage/textures/techage_appl_generator.png and /dev/null differ diff --git a/techage/textures/techage_appl_generator4.png b/techage/textures/techage_appl_generator4.png deleted file mode 100644 index c88a758..0000000 Binary files a/techage/textures/techage_appl_generator4.png and /dev/null differ diff --git a/techage/textures/techage_appl_generator_red.png b/techage/textures/techage_appl_generator_red.png deleted file mode 100644 index dc80c9a..0000000 Binary files a/techage/textures/techage_appl_generator_red.png and /dev/null differ diff --git a/techage/textures/techage_appl_generator_red4.png b/techage/textures/techage_appl_generator_red4.png deleted file mode 100644 index 58b3bfc..0000000 Binary files a/techage/textures/techage_appl_generator_red4.png and /dev/null differ diff --git a/techage/textures/techage_appl_grinder.png b/techage/textures/techage_appl_grinder.png deleted file mode 100644 index bf45669..0000000 Binary files a/techage/textures/techage_appl_grinder.png and /dev/null differ diff --git a/techage/textures/techage_appl_grinder2.png b/techage/textures/techage_appl_grinder2.png deleted file mode 100644 index 8e6ebe1..0000000 Binary files a/techage/textures/techage_appl_grinder2.png and /dev/null differ diff --git a/techage/textures/techage_appl_grinder4.png b/techage/textures/techage_appl_grinder4.png deleted file mode 100644 index 9546a1d..0000000 Binary files a/techage/textures/techage_appl_grinder4.png and /dev/null differ diff --git a/techage/textures/techage_appl_heater.png b/techage/textures/techage_appl_heater.png deleted file mode 100644 index bc4daf3..0000000 Binary files a/techage/textures/techage_appl_heater.png and /dev/null differ diff --git a/techage/textures/techage_appl_heater_on.png b/techage/textures/techage_appl_heater_on.png deleted file mode 100644 index 7c6365e..0000000 Binary files a/techage/textures/techage_appl_heater_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_hole_electric.png b/techage/textures/techage_appl_hole_electric.png deleted file mode 100644 index 6dfbaec..0000000 Binary files a/techage/textures/techage_appl_hole_electric.png and /dev/null differ diff --git a/techage/textures/techage_appl_hole_pipe.png b/techage/textures/techage_appl_hole_pipe.png deleted file mode 100644 index d807862..0000000 Binary files a/techage/textures/techage_appl_hole_pipe.png and /dev/null differ diff --git a/techage/textures/techage_appl_hole_ta5_pipe1.png b/techage/textures/techage_appl_hole_ta5_pipe1.png deleted file mode 100644 index fa8de79..0000000 Binary files a/techage/textures/techage_appl_hole_ta5_pipe1.png and /dev/null differ diff --git a/techage/textures/techage_appl_hole_ta5_pipe2.png b/techage/textures/techage_appl_hole_ta5_pipe2.png deleted file mode 100644 index ab2e41e..0000000 Binary files a/techage/textures/techage_appl_hole_ta5_pipe2.png and /dev/null differ diff --git a/techage/textures/techage_appl_hole_tube.png b/techage/textures/techage_appl_hole_tube.png deleted file mode 100644 index ca4ffd6..0000000 Binary files a/techage/textures/techage_appl_hole_tube.png and /dev/null differ diff --git a/techage/textures/techage_appl_hopper.png b/techage/textures/techage_appl_hopper.png deleted file mode 100644 index 7eaf8a2..0000000 Binary files a/techage/textures/techage_appl_hopper.png and /dev/null differ diff --git a/techage/textures/techage_appl_hopper_right.png b/techage/textures/techage_appl_hopper_right.png deleted file mode 100644 index 48e1037..0000000 Binary files a/techage/textures/techage_appl_hopper_right.png and /dev/null differ diff --git a/techage/textures/techage_appl_hopper_top.png b/techage/textures/techage_appl_hopper_top.png deleted file mode 100644 index 4c2fb4d..0000000 Binary files a/techage/textures/techage_appl_hopper_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_injector.png b/techage/textures/techage_appl_injector.png deleted file mode 100644 index f85958a..0000000 Binary files a/techage/textures/techage_appl_injector.png and /dev/null differ diff --git a/techage/textures/techage_appl_injector14.png b/techage/textures/techage_appl_injector14.png deleted file mode 100644 index dff0fc3..0000000 Binary files a/techage/textures/techage_appl_injector14.png and /dev/null differ diff --git a/techage/textures/techage_appl_inp.png b/techage/textures/techage_appl_inp.png deleted file mode 100644 index 431c5c4..0000000 Binary files a/techage/textures/techage_appl_inp.png and /dev/null differ diff --git a/techage/textures/techage_appl_inverter.png b/techage/textures/techage_appl_inverter.png deleted file mode 100644 index e47b40c..0000000 Binary files a/techage/textures/techage_appl_inverter.png and /dev/null differ diff --git a/techage/textures/techage_appl_inverterDC.png b/techage/textures/techage_appl_inverterDC.png deleted file mode 100644 index 6487d6c..0000000 Binary files a/techage/textures/techage_appl_inverterDC.png and /dev/null differ diff --git a/techage/textures/techage_appl_laser.png b/techage/textures/techage_appl_laser.png deleted file mode 100644 index 70f7062..0000000 Binary files a/techage/textures/techage_appl_laser.png and /dev/null differ diff --git a/techage/textures/techage_appl_laser_hole.png b/techage/textures/techage_appl_laser_hole.png deleted file mode 100644 index c445434..0000000 Binary files a/techage/textures/techage_appl_laser_hole.png and /dev/null differ diff --git a/techage/textures/techage_appl_lightdetector.png b/techage/textures/techage_appl_lightdetector.png deleted file mode 100755 index ebd2db7..0000000 Binary files a/techage/textures/techage_appl_lightdetector.png and /dev/null differ diff --git a/techage/textures/techage_appl_lightdetector_on.png b/techage/textures/techage_appl_lightdetector_on.png deleted file mode 100755 index 6994033..0000000 Binary files a/techage/textures/techage_appl_lightdetector_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_liquid_hopper.png b/techage/textures/techage_appl_liquid_hopper.png deleted file mode 100644 index 467111d..0000000 Binary files a/techage/textures/techage_appl_liquid_hopper.png and /dev/null differ diff --git a/techage/textures/techage_appl_liquidsampler.png b/techage/textures/techage_appl_liquidsampler.png deleted file mode 100644 index 1c44174..0000000 Binary files a/techage/textures/techage_appl_liquidsampler.png and /dev/null differ diff --git a/techage/textures/techage_appl_logic.png b/techage/textures/techage_appl_logic.png deleted file mode 100644 index 9dc009b..0000000 Binary files a/techage/textures/techage_appl_logic.png and /dev/null differ diff --git a/techage/textures/techage_appl_mesecons_converter.png b/techage/textures/techage_appl_mesecons_converter.png deleted file mode 100644 index 8709e5d..0000000 Binary files a/techage/textures/techage_appl_mesecons_converter.png and /dev/null differ diff --git a/techage/textures/techage_appl_meter.png b/techage/textures/techage_appl_meter.png deleted file mode 100644 index 449e972..0000000 Binary files a/techage/textures/techage_appl_meter.png and /dev/null differ diff --git a/techage/textures/techage_appl_movecontroller.png b/techage/textures/techage_appl_movecontroller.png deleted file mode 100644 index 36c22b8..0000000 Binary files a/techage/textures/techage_appl_movecontroller.png and /dev/null differ diff --git a/techage/textures/techage_appl_nodedetector.png b/techage/textures/techage_appl_nodedetector.png deleted file mode 100644 index 11d0d77..0000000 Binary files a/techage/textures/techage_appl_nodedetector.png and /dev/null differ diff --git a/techage/textures/techage_appl_nodedetector_on.png b/techage/textures/techage_appl_nodedetector_on.png deleted file mode 100644 index 1650429..0000000 Binary files a/techage/textures/techage_appl_nodedetector_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_oildrill.png b/techage/textures/techage_appl_oildrill.png deleted file mode 100644 index 70ea863..0000000 Binary files a/techage/textures/techage_appl_oildrill.png and /dev/null differ diff --git a/techage/textures/techage_appl_oilexplorer.png b/techage/textures/techage_appl_oilexplorer.png deleted file mode 100644 index 68b9e71..0000000 Binary files a/techage/textures/techage_appl_oilexplorer.png and /dev/null differ diff --git a/techage/textures/techage_appl_oilexplorer_top.png b/techage/textures/techage_appl_oilexplorer_top.png deleted file mode 100644 index cc6af98..0000000 Binary files a/techage/textures/techage_appl_oilexplorer_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_oilexplorer_top4.png b/techage/textures/techage_appl_oilexplorer_top4.png deleted file mode 100644 index 51e2378..0000000 Binary files a/techage/textures/techage_appl_oilexplorer_top4.png and /dev/null differ diff --git a/techage/textures/techage_appl_open.png b/techage/textures/techage_appl_open.png deleted file mode 100644 index f161069..0000000 Binary files a/techage/textures/techage_appl_open.png and /dev/null differ diff --git a/techage/textures/techage_appl_outp.png b/techage/textures/techage_appl_outp.png deleted file mode 100644 index 98bab9a..0000000 Binary files a/techage/textures/techage_appl_outp.png and /dev/null differ diff --git a/techage/textures/techage_appl_plasma.png b/techage/textures/techage_appl_plasma.png deleted file mode 100644 index 2cea306..0000000 Binary files a/techage/textures/techage_appl_plasma.png and /dev/null differ diff --git a/techage/textures/techage_appl_plasma4.png b/techage/textures/techage_appl_plasma4.png deleted file mode 100644 index eb3cd70..0000000 Binary files a/techage/textures/techage_appl_plasma4.png and /dev/null differ diff --git a/techage/textures/techage_appl_playerdetector.png b/techage/textures/techage_appl_playerdetector.png deleted file mode 100644 index d2efb22..0000000 Binary files a/techage/textures/techage_appl_playerdetector.png and /dev/null differ diff --git a/techage/textures/techage_appl_playerdetector_on.png b/techage/textures/techage_appl_playerdetector_on.png deleted file mode 100644 index d72b959..0000000 Binary files a/techage/textures/techage_appl_playerdetector_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_pump.png b/techage/textures/techage_appl_pump.png deleted file mode 100644 index 1044af7..0000000 Binary files a/techage/textures/techage_appl_pump.png and /dev/null differ diff --git a/techage/textures/techage_appl_pump8.png b/techage/textures/techage_appl_pump8.png deleted file mode 100644 index ca32aff..0000000 Binary files a/techage/textures/techage_appl_pump8.png and /dev/null differ diff --git a/techage/textures/techage_appl_pump_up.png b/techage/textures/techage_appl_pump_up.png deleted file mode 100644 index 887efca..0000000 Binary files a/techage/textures/techage_appl_pump_up.png and /dev/null differ diff --git a/techage/textures/techage_appl_pump_up8.png b/techage/textures/techage_appl_pump_up8.png deleted file mode 100644 index 6387c74..0000000 Binary files a/techage/textures/techage_appl_pump_up8.png and /dev/null differ diff --git a/techage/textures/techage_appl_pumpjack.png b/techage/textures/techage_appl_pumpjack.png deleted file mode 100644 index d6a34db..0000000 Binary files a/techage/textures/techage_appl_pumpjack.png and /dev/null differ diff --git a/techage/textures/techage_appl_pumpjack14.png b/techage/textures/techage_appl_pumpjack14.png deleted file mode 100644 index 5bc4fe6..0000000 Binary files a/techage/textures/techage_appl_pumpjack14.png and /dev/null differ diff --git a/techage/textures/techage_appl_pusher.png b/techage/textures/techage_appl_pusher.png deleted file mode 100644 index 7d948f3..0000000 Binary files a/techage/textures/techage_appl_pusher.png and /dev/null differ diff --git a/techage/textures/techage_appl_pusher14.png b/techage/textures/techage_appl_pusher14.png deleted file mode 100644 index 034cd97..0000000 Binary files a/techage/textures/techage_appl_pusher14.png and /dev/null differ diff --git a/techage/textures/techage_appl_quarry.png b/techage/textures/techage_appl_quarry.png deleted file mode 100644 index cd4e9b2..0000000 Binary files a/techage/textures/techage_appl_quarry.png and /dev/null differ diff --git a/techage/textures/techage_appl_reboiler.png b/techage/textures/techage_appl_reboiler.png deleted file mode 100644 index 956d23f..0000000 Binary files a/techage/textures/techage_appl_reboiler.png and /dev/null differ diff --git a/techage/textures/techage_appl_reboiler4.png b/techage/textures/techage_appl_reboiler4.png deleted file mode 100644 index 0c347f5..0000000 Binary files a/techage/textures/techage_appl_reboiler4.png and /dev/null differ diff --git a/techage/textures/techage_appl_recipeblock.png b/techage/textures/techage_appl_recipeblock.png deleted file mode 100644 index ae14cc9..0000000 Binary files a/techage/textures/techage_appl_recipeblock.png and /dev/null differ diff --git a/techage/textures/techage_appl_recycler.png b/techage/textures/techage_appl_recycler.png deleted file mode 100644 index ddfa0cc..0000000 Binary files a/techage/textures/techage_appl_recycler.png and /dev/null differ diff --git a/techage/textures/techage_appl_repeater.png b/techage/textures/techage_appl_repeater.png deleted file mode 100644 index 67ffe0f..0000000 Binary files a/techage/textures/techage_appl_repeater.png and /dev/null differ diff --git a/techage/textures/techage_appl_ribsB.png b/techage/textures/techage_appl_ribsB.png deleted file mode 100644 index 508e6f6..0000000 Binary files a/techage/textures/techage_appl_ribsB.png and /dev/null differ diff --git a/techage/textures/techage_appl_ribsM.png b/techage/textures/techage_appl_ribsM.png deleted file mode 100644 index a24d371..0000000 Binary files a/techage/textures/techage_appl_ribsM.png and /dev/null differ diff --git a/techage/textures/techage_appl_ribsT.png b/techage/textures/techage_appl_ribsT.png deleted file mode 100644 index 0925296..0000000 Binary files a/techage/textures/techage_appl_ribsT.png and /dev/null differ diff --git a/techage/textures/techage_appl_rinser.png b/techage/textures/techage_appl_rinser.png deleted file mode 100644 index eba2d4e..0000000 Binary files a/techage/textures/techage_appl_rinser.png and /dev/null differ diff --git a/techage/textures/techage_appl_rinser4_top.png b/techage/textures/techage_appl_rinser4_top.png deleted file mode 100644 index c8de9bb..0000000 Binary files a/techage/textures/techage_appl_rinser4_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_rinser_top.png b/techage/textures/techage_appl_rinser_top.png deleted file mode 100644 index 4abb220..0000000 Binary files a/techage/textures/techage_appl_rinser_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_sensor.png b/techage/textures/techage_appl_sensor.png deleted file mode 100644 index adb50a4..0000000 Binary files a/techage/textures/techage_appl_sensor.png and /dev/null differ diff --git a/techage/textures/techage_appl_sequencer.png b/techage/textures/techage_appl_sequencer.png deleted file mode 100644 index 99d9511..0000000 Binary files a/techage/textures/techage_appl_sequencer.png and /dev/null differ diff --git a/techage/textures/techage_appl_sieve.png b/techage/textures/techage_appl_sieve.png deleted file mode 100644 index 0646daa..0000000 Binary files a/techage/textures/techage_appl_sieve.png and /dev/null differ diff --git a/techage/textures/techage_appl_sieve4_top.png b/techage/textures/techage_appl_sieve4_top.png deleted file mode 100644 index 10ec29e..0000000 Binary files a/techage/textures/techage_appl_sieve4_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_sieve_top.png b/techage/textures/techage_appl_sieve_top.png deleted file mode 100644 index 4300af5..0000000 Binary files a/techage/textures/techage_appl_sieve_top.png and /dev/null differ diff --git a/techage/textures/techage_appl_silo.png b/techage/textures/techage_appl_silo.png deleted file mode 100644 index ea6addc..0000000 Binary files a/techage/textures/techage_appl_silo.png and /dev/null differ diff --git a/techage/textures/techage_appl_sound.png b/techage/textures/techage_appl_sound.png deleted file mode 100644 index 4efea64..0000000 Binary files a/techage/textures/techage_appl_sound.png and /dev/null differ diff --git a/techage/textures/techage_appl_source.png b/techage/textures/techage_appl_source.png deleted file mode 100644 index 8e37aae..0000000 Binary files a/techage/textures/techage_appl_source.png and /dev/null differ diff --git a/techage/textures/techage_appl_switch_inv.png b/techage/textures/techage_appl_switch_inv.png deleted file mode 100644 index 7437493..0000000 Binary files a/techage/textures/techage_appl_switch_inv.png and /dev/null differ diff --git a/techage/textures/techage_appl_switch_off.png b/techage/textures/techage_appl_switch_off.png deleted file mode 100644 index 1191be2..0000000 Binary files a/techage/textures/techage_appl_switch_off.png and /dev/null differ diff --git a/techage/textures/techage_appl_switch_on.png b/techage/textures/techage_appl_switch_on.png deleted file mode 100644 index 38d47b7..0000000 Binary files a/techage/textures/techage_appl_switch_on.png and /dev/null differ diff --git a/techage/textures/techage_appl_ta4_cable.png b/techage/textures/techage_appl_ta4_cable.png deleted file mode 100644 index ab2fe7a..0000000 Binary files a/techage/textures/techage_appl_ta4_cable.png and /dev/null differ diff --git a/techage/textures/techage_appl_tank.png b/techage/textures/techage_appl_tank.png deleted file mode 100644 index 62fd1ec..0000000 Binary files a/techage/textures/techage_appl_tank.png and /dev/null differ diff --git a/techage/textures/techage_appl_tele_pipe.png b/techage/textures/techage_appl_tele_pipe.png deleted file mode 100644 index 4cd509b..0000000 Binary files a/techage/textures/techage_appl_tele_pipe.png and /dev/null differ diff --git a/techage/textures/techage_appl_tele_tube.png b/techage/textures/techage_appl_tele_tube.png deleted file mode 100644 index aaffc3d..0000000 Binary files a/techage/textures/techage_appl_tele_tube.png and /dev/null differ diff --git a/techage/textures/techage_appl_teleport.png b/techage/textures/techage_appl_teleport.png deleted file mode 100644 index 1a18d59..0000000 Binary files a/techage/textures/techage_appl_teleport.png and /dev/null differ diff --git a/techage/textures/techage_appl_tes_core.png b/techage/textures/techage_appl_tes_core.png deleted file mode 100644 index e5afaca..0000000 Binary files a/techage/textures/techage_appl_tes_core.png and /dev/null differ diff --git a/techage/textures/techage_appl_tes_turb.png b/techage/textures/techage_appl_tes_turb.png deleted file mode 100644 index d693c14..0000000 Binary files a/techage/textures/techage_appl_tes_turb.png and /dev/null differ diff --git a/techage/textures/techage_appl_timer.png b/techage/textures/techage_appl_timer.png deleted file mode 100644 index 2493934..0000000 Binary files a/techage/textures/techage_appl_timer.png and /dev/null differ diff --git a/techage/textures/techage_appl_trafo.png b/techage/textures/techage_appl_trafo.png deleted file mode 100644 index 30c99c7..0000000 Binary files a/techage/textures/techage_appl_trafo.png and /dev/null differ diff --git a/techage/textures/techage_appl_turbine.png b/techage/textures/techage_appl_turbine.png deleted file mode 100644 index e3068f4..0000000 Binary files a/techage/textures/techage_appl_turbine.png and /dev/null differ diff --git a/techage/textures/techage_appl_turbine4.png b/techage/textures/techage_appl_turbine4.png deleted file mode 100644 index eb4c916..0000000 Binary files a/techage/textures/techage_appl_turbine4.png and /dev/null differ diff --git a/techage/textures/techage_appl_turn.png b/techage/textures/techage_appl_turn.png deleted file mode 100644 index fbc8b33..0000000 Binary files a/techage/textures/techage_appl_turn.png and /dev/null differ diff --git a/techage/textures/techage_appl_warehouse.png b/techage/textures/techage_appl_warehouse.png deleted file mode 100644 index f4fb3a0..0000000 Binary files a/techage/textures/techage_appl_warehouse.png and /dev/null differ diff --git a/techage/textures/techage_appl_winch.png b/techage/textures/techage_appl_winch.png deleted file mode 100644 index b45c142..0000000 Binary files a/techage/textures/techage_appl_winch.png and /dev/null differ diff --git a/techage/textures/techage_appl_winch_hole.png b/techage/textures/techage_appl_winch_hole.png deleted file mode 100644 index d4c2674..0000000 Binary files a/techage/textures/techage_appl_winch_hole.png and /dev/null differ diff --git a/techage/textures/techage_ash.png b/techage/textures/techage_ash.png deleted file mode 100644 index d3a741e..0000000 Binary files a/techage/textures/techage_ash.png and /dev/null differ diff --git a/techage/textures/techage_ash_side.png b/techage/textures/techage_ash_side.png deleted file mode 100644 index f382e26..0000000 Binary files a/techage/textures/techage_ash_side.png and /dev/null differ diff --git a/techage/textures/techage_axle.png b/techage/textures/techage_axle.png deleted file mode 100644 index 6de95a6..0000000 Binary files a/techage/textures/techage_axle.png and /dev/null differ diff --git a/techage/textures/techage_axle4.png b/techage/textures/techage_axle4.png deleted file mode 100644 index e7998ec..0000000 Binary files a/techage/textures/techage_axle4.png and /dev/null differ diff --git a/techage/textures/techage_axle4R.png b/techage/textures/techage_axle4R.png deleted file mode 100644 index 51fde65..0000000 Binary files a/techage/textures/techage_axle4R.png and /dev/null differ diff --git a/techage/textures/techage_axleR.png b/techage/textures/techage_axleR.png deleted file mode 100644 index be3697f..0000000 Binary files a/techage/textures/techage_axleR.png and /dev/null differ diff --git a/techage/textures/techage_axle_bearing.png b/techage/textures/techage_axle_bearing.png deleted file mode 100644 index 61be451..0000000 Binary files a/techage/textures/techage_axle_bearing.png and /dev/null differ diff --git a/techage/textures/techage_axle_bearing_front.png b/techage/textures/techage_axle_bearing_front.png deleted file mode 100644 index 175fb56..0000000 Binary files a/techage/textures/techage_axle_bearing_front.png and /dev/null differ diff --git a/techage/textures/techage_axle_clutch.png b/techage/textures/techage_axle_clutch.png deleted file mode 100644 index e53996a..0000000 Binary files a/techage/textures/techage_axle_clutch.png and /dev/null differ diff --git a/techage/textures/techage_axle_clutch4.png b/techage/textures/techage_axle_clutch4.png deleted file mode 100644 index 9713b29..0000000 Binary files a/techage/textures/techage_axle_clutch4.png and /dev/null differ diff --git a/techage/textures/techage_axle_gearbox.png b/techage/textures/techage_axle_gearbox.png deleted file mode 100644 index fbbba75..0000000 Binary files a/techage/textures/techage_axle_gearbox.png and /dev/null differ diff --git a/techage/textures/techage_axle_gearbox4.png b/techage/textures/techage_axle_gearbox4.png deleted file mode 100644 index 5c68afd..0000000 Binary files a/techage/textures/techage_axle_gearbox4.png and /dev/null differ diff --git a/techage/textures/techage_baborium.png b/techage/textures/techage_baborium.png deleted file mode 100644 index bccad7c..0000000 Binary files a/techage/textures/techage_baborium.png and /dev/null differ diff --git a/techage/textures/techage_baborium_ingot.png b/techage/textures/techage_baborium_ingot.png deleted file mode 100644 index a3e0feb..0000000 Binary files a/techage/textures/techage_baborium_ingot.png and /dev/null differ diff --git a/techage/textures/techage_baborium_lump.png b/techage/textures/techage_baborium_lump.png deleted file mode 100644 index b4a9220..0000000 Binary files a/techage/textures/techage_baborium_lump.png and /dev/null differ diff --git a/techage/textures/techage_barrel_inv.png b/techage/textures/techage_barrel_inv.png deleted file mode 100644 index dc9bab3..0000000 Binary files a/techage/textures/techage_barrel_inv.png and /dev/null differ diff --git a/techage/textures/techage_basalt_glass.png b/techage/textures/techage_basalt_glass.png deleted file mode 100644 index 672f794..0000000 Binary files a/techage/textures/techage_basalt_glass.png and /dev/null differ diff --git a/techage/textures/techage_basalt_glass2.png b/techage/textures/techage_basalt_glass2.png deleted file mode 100644 index e7a7b9c..0000000 Binary files a/techage/textures/techage_basalt_glass2.png and /dev/null differ diff --git a/techage/textures/techage_basalt_glass3.png b/techage/textures/techage_basalt_glass3.png deleted file mode 100644 index 672f794..0000000 Binary files a/techage/textures/techage_basalt_glass3.png and /dev/null differ diff --git a/techage/textures/techage_battery_green.png b/techage/textures/techage_battery_green.png deleted file mode 100644 index 25edc3d..0000000 Binary files a/techage/textures/techage_battery_green.png and /dev/null differ diff --git a/techage/textures/techage_battery_inventory.png b/techage/textures/techage_battery_inventory.png deleted file mode 100644 index 4750003..0000000 Binary files a/techage/textures/techage_battery_inventory.png and /dev/null differ diff --git a/techage/textures/techage_battery_red.png b/techage/textures/techage_battery_red.png deleted file mode 100644 index c825a05..0000000 Binary files a/techage/textures/techage_battery_red.png and /dev/null differ diff --git a/techage/textures/techage_bauxit_overlay.png b/techage/textures/techage_bauxit_overlay.png deleted file mode 100644 index f5ea5d6..0000000 Binary files a/techage/textures/techage_bauxit_overlay.png and /dev/null differ diff --git a/techage/textures/techage_bitumen_inv.png b/techage/textures/techage_bitumen_inv.png deleted file mode 100644 index 6ece177..0000000 Binary files a/techage/textures/techage_bitumen_inv.png and /dev/null differ diff --git a/techage/textures/techage_boiler.png b/techage/textures/techage_boiler.png deleted file mode 100644 index c0489e1..0000000 Binary files a/techage/textures/techage_boiler.png and /dev/null differ diff --git a/techage/textures/techage_boiler2.png b/techage/textures/techage_boiler2.png deleted file mode 100644 index 506a81a..0000000 Binary files a/techage/textures/techage_boiler2.png and /dev/null differ diff --git a/techage/textures/techage_box_back.png b/techage/textures/techage_box_back.png deleted file mode 100644 index 7cb14c0..0000000 Binary files a/techage/textures/techage_box_back.png and /dev/null differ diff --git a/techage/textures/techage_box_front.png b/techage/textures/techage_box_front.png deleted file mode 100644 index fc1cef2..0000000 Binary files a/techage/textures/techage_box_front.png and /dev/null differ diff --git a/techage/textures/techage_box_side.png b/techage/textures/techage_box_side.png deleted file mode 100644 index f80246f..0000000 Binary files a/techage/textures/techage_box_side.png and /dev/null differ diff --git a/techage/textures/techage_bucket_oil.png b/techage/textures/techage_bucket_oil.png deleted file mode 100644 index 7b64680..0000000 Binary files a/techage/textures/techage_bucket_oil.png and /dev/null differ diff --git a/techage/textures/techage_button_off.png b/techage/textures/techage_button_off.png deleted file mode 100644 index 60a325c..0000000 Binary files a/techage/textures/techage_button_off.png and /dev/null differ diff --git a/techage/textures/techage_button_on.png b/techage/textures/techage_button_on.png deleted file mode 100644 index 3c24226..0000000 Binary files a/techage/textures/techage_button_on.png and /dev/null differ diff --git a/techage/textures/techage_cable_palette.png b/techage/textures/techage_cable_palette.png deleted file mode 100644 index da528b5..0000000 Binary files a/techage/textures/techage_cable_palette.png and /dev/null differ diff --git a/techage/textures/techage_canister_filling.png b/techage/textures/techage_canister_filling.png deleted file mode 100644 index 04ad10f..0000000 Binary files a/techage/textures/techage_canister_filling.png and /dev/null differ diff --git a/techage/textures/techage_canister_frame.png b/techage/textures/techage_canister_frame.png deleted file mode 100644 index 4f7e18f..0000000 Binary files a/techage/textures/techage_canister_frame.png and /dev/null differ diff --git a/techage/textures/techage_carbon_fiber.png b/techage/textures/techage_carbon_fiber.png deleted file mode 100644 index 8f9e3f6..0000000 Binary files a/techage/textures/techage_carbon_fiber.png and /dev/null differ diff --git a/techage/textures/techage_ceilinglamp.png b/techage/textures/techage_ceilinglamp.png deleted file mode 100644 index 7545650..0000000 Binary files a/techage/textures/techage_ceilinglamp.png and /dev/null differ diff --git a/techage/textures/techage_ceilinglamp_bottom.png b/techage/textures/techage_ceilinglamp_bottom.png deleted file mode 100644 index 3bd03fe..0000000 Binary files a/techage/textures/techage_ceilinglamp_bottom.png and /dev/null differ diff --git a/techage/textures/techage_ceilinglamp_top.png b/techage/textures/techage_ceilinglamp_top.png deleted file mode 100644 index abe139e..0000000 Binary files a/techage/textures/techage_ceilinglamp_top.png and /dev/null differ diff --git a/techage/textures/techage_ceramic_material.png b/techage/textures/techage_ceramic_material.png deleted file mode 100644 index ce9fcf8..0000000 Binary files a/techage/textures/techage_ceramic_material.png and /dev/null differ diff --git a/techage/textures/techage_ceramic_turbine.png b/techage/textures/techage_ceramic_turbine.png deleted file mode 100644 index d2f55e5..0000000 Binary files a/techage/textures/techage_ceramic_turbine.png and /dev/null differ diff --git a/techage/textures/techage_charcoal.png b/techage/textures/techage_charcoal.png deleted file mode 100644 index d96d627..0000000 Binary files a/techage/textures/techage_charcoal.png and /dev/null differ diff --git a/techage/textures/techage_charcoal_burn.png b/techage/textures/techage_charcoal_burn.png deleted file mode 100644 index 5ef408e..0000000 Binary files a/techage/textures/techage_charcoal_burn.png and /dev/null differ diff --git a/techage/textures/techage_charge_detector_inv.png b/techage/textures/techage_charge_detector_inv.png deleted file mode 100644 index 93d48f7..0000000 Binary files a/techage/textures/techage_charge_detector_inv.png and /dev/null differ diff --git a/techage/textures/techage_charge_detector_off.png b/techage/textures/techage_charge_detector_off.png deleted file mode 100644 index fef26f4..0000000 Binary files a/techage/textures/techage_charge_detector_off.png and /dev/null differ diff --git a/techage/textures/techage_charge_detector_on.png b/techage/textures/techage_charge_detector_on.png deleted file mode 100644 index ad2743c..0000000 Binary files a/techage/textures/techage_charge_detector_on.png and /dev/null differ diff --git a/techage/textures/techage_chest_cart_bottom.png b/techage/textures/techage_chest_cart_bottom.png deleted file mode 100644 index 7aa750f..0000000 Binary files a/techage/textures/techage_chest_cart_bottom.png and /dev/null differ diff --git a/techage/textures/techage_chest_cart_front.png b/techage/textures/techage_chest_cart_front.png deleted file mode 100644 index 3bf8f76..0000000 Binary files a/techage/textures/techage_chest_cart_front.png and /dev/null differ diff --git a/techage/textures/techage_chest_cart_side.png b/techage/textures/techage_chest_cart_side.png deleted file mode 100644 index d04b4aa..0000000 Binary files a/techage/textures/techage_chest_cart_side.png and /dev/null differ diff --git a/techage/textures/techage_chest_cart_top.png b/techage/textures/techage_chest_cart_top.png deleted file mode 100644 index 646f9ec..0000000 Binary files a/techage/textures/techage_chest_cart_top.png and /dev/null differ diff --git a/techage/textures/techage_clutch_clutch.png b/techage/textures/techage_clutch_clutch.png deleted file mode 100644 index 5b0d30b..0000000 Binary files a/techage/textures/techage_clutch_clutch.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler.png b/techage/textures/techage_coal_boiler.png deleted file mode 100644 index d3a55a6..0000000 Binary files a/techage/textures/techage_coal_boiler.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler4.png b/techage/textures/techage_coal_boiler4.png deleted file mode 100644 index 66b7228..0000000 Binary files a/techage/textures/techage_coal_boiler4.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler_fire_hole.png b/techage/textures/techage_coal_boiler_fire_hole.png deleted file mode 100644 index fbb4ef2..0000000 Binary files a/techage/textures/techage_coal_boiler_fire_hole.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler_hole.png b/techage/textures/techage_coal_boiler_hole.png deleted file mode 100644 index bd2077d..0000000 Binary files a/techage/textures/techage_coal_boiler_hole.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler_inv.png b/techage/textures/techage_coal_boiler_inv.png deleted file mode 100644 index a5a8f27..0000000 Binary files a/techage/textures/techage_coal_boiler_inv.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler_mesh_base.png b/techage/textures/techage_coal_boiler_mesh_base.png deleted file mode 100644 index 17dff2f..0000000 Binary files a/techage/textures/techage_coal_boiler_mesh_base.png and /dev/null differ diff --git a/techage/textures/techage_coal_boiler_mesh_top.png b/techage/textures/techage_coal_boiler_mesh_top.png deleted file mode 100644 index fd1a9b1..0000000 Binary files a/techage/textures/techage_coal_boiler_mesh_top.png and /dev/null differ diff --git a/techage/textures/techage_collider_detector_appl.png b/techage/textures/techage_collider_detector_appl.png deleted file mode 100644 index fa8776b..0000000 Binary files a/techage/textures/techage_collider_detector_appl.png and /dev/null differ diff --git a/techage/textures/techage_collider_detector_banner.png b/techage/textures/techage_collider_detector_banner.png deleted file mode 100644 index 1718dba..0000000 Binary files a/techage/textures/techage_collider_detector_banner.png and /dev/null differ diff --git a/techage/textures/techage_collider_detector_core.png b/techage/textures/techage_collider_detector_core.png deleted file mode 100644 index b0edd8d..0000000 Binary files a/techage/textures/techage_collider_detector_core.png and /dev/null differ diff --git a/techage/textures/techage_collider_magnet.png b/techage/textures/techage_collider_magnet.png deleted file mode 100644 index 7a81fd5..0000000 Binary files a/techage/textures/techage_collider_magnet.png and /dev/null differ diff --git a/techage/textures/techage_collider_magnet_appl.png b/techage/textures/techage_collider_magnet_appl.png deleted file mode 100644 index 2f748e1..0000000 Binary files a/techage/textures/techage_collider_magnet_appl.png and /dev/null differ diff --git a/techage/textures/techage_collider_magnet_sign.png b/techage/textures/techage_collider_magnet_sign.png deleted file mode 100644 index 5493297..0000000 Binary files a/techage/textures/techage_collider_magnet_sign.png and /dev/null differ diff --git a/techage/textures/techage_collider_magnet_tube.png b/techage/textures/techage_collider_magnet_tube.png deleted file mode 100644 index 040c3e5..0000000 Binary files a/techage/textures/techage_collider_magnet_tube.png and /dev/null differ diff --git a/techage/textures/techage_collider_plan.png b/techage/textures/techage_collider_plan.png deleted file mode 100644 index 3cdc09d..0000000 Binary files a/techage/textures/techage_collider_plan.png and /dev/null differ diff --git a/techage/textures/techage_collider_plan2.png b/techage/textures/techage_collider_plan2.png deleted file mode 100644 index 14386a8..0000000 Binary files a/techage/textures/techage_collider_plan2.png and /dev/null differ diff --git a/techage/textures/techage_collider_tube.png b/techage/textures/techage_collider_tube.png deleted file mode 100644 index 2ef480b..0000000 Binary files a/techage/textures/techage_collider_tube.png and /dev/null differ diff --git a/techage/textures/techage_collider_tube_open.png b/techage/textures/techage_collider_tube_open.png deleted file mode 100644 index 21af706..0000000 Binary files a/techage/textures/techage_collider_tube_open.png and /dev/null differ diff --git a/techage/textures/techage_color16.png b/techage/textures/techage_color16.png deleted file mode 100644 index f636864..0000000 Binary files a/techage/textures/techage_color16.png and /dev/null differ diff --git a/techage/textures/techage_compressed_gravel.png b/techage/textures/techage_compressed_gravel.png deleted file mode 100644 index f5d7f23..0000000 Binary files a/techage/textures/techage_compressed_gravel.png and /dev/null differ diff --git a/techage/textures/techage_concrete.png b/techage/textures/techage_concrete.png deleted file mode 100644 index 2bead6b..0000000 Binary files a/techage/textures/techage_concrete.png and /dev/null differ diff --git a/techage/textures/techage_concrete4.png b/techage/textures/techage_concrete4.png deleted file mode 100644 index 26ab946..0000000 Binary files a/techage/textures/techage_concrete4.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan.png b/techage/textures/techage_constr_plan.png deleted file mode 100644 index 30771d2..0000000 Binary files a/techage/textures/techage_constr_plan.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_br.png b/techage/textures/techage_constr_plan_br.png deleted file mode 100644 index 96b522a..0000000 Binary files a/techage/textures/techage_constr_plan_br.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_de.png b/techage/textures/techage_constr_plan_de.png deleted file mode 100644 index e11af2e..0000000 Binary files a/techage/textures/techage_constr_plan_de.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_en.png b/techage/textures/techage_constr_plan_en.png deleted file mode 100644 index 7b71a35..0000000 Binary files a/techage/textures/techage_constr_plan_en.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_inv.png b/techage/textures/techage_constr_plan_inv.png deleted file mode 100644 index 83371e7..0000000 Binary files a/techage/textures/techage_constr_plan_inv.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_inv_br.png b/techage/textures/techage_constr_plan_inv_br.png deleted file mode 100644 index 2efd26c..0000000 Binary files a/techage/textures/techage_constr_plan_inv_br.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_inv_de.png b/techage/textures/techage_constr_plan_inv_de.png deleted file mode 100644 index 6f7092a..0000000 Binary files a/techage/textures/techage_constr_plan_inv_de.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_inv_en.png b/techage/textures/techage_constr_plan_inv_en.png deleted file mode 100644 index 6ff5364..0000000 Binary files a/techage/textures/techage_constr_plan_inv_en.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_inv_ru.png b/techage/textures/techage_constr_plan_inv_ru.png deleted file mode 100644 index 8378f22..0000000 Binary files a/techage/textures/techage_constr_plan_inv_ru.png and /dev/null differ diff --git a/techage/textures/techage_constr_plan_ru.png b/techage/textures/techage_constr_plan_ru.png deleted file mode 100644 index 5e4c49f..0000000 Binary files a/techage/textures/techage_constr_plan_ru.png and /dev/null differ diff --git a/techage/textures/techage_cooler.png b/techage/textures/techage_cooler.png deleted file mode 100644 index bce55c9..0000000 Binary files a/techage/textures/techage_cooler.png and /dev/null differ diff --git a/techage/textures/techage_cube_mark.png b/techage/textures/techage_cube_mark.png deleted file mode 100644 index 1321451..0000000 Binary files a/techage/textures/techage_cube_mark.png and /dev/null differ diff --git a/techage/textures/techage_cylinder.png b/techage/textures/techage_cylinder.png deleted file mode 100644 index deca03a..0000000 Binary files a/techage/textures/techage_cylinder.png and /dev/null differ diff --git a/techage/textures/techage_cylinder4.png b/techage/textures/techage_cylinder4.png deleted file mode 100644 index 5f678bf..0000000 Binary files a/techage/textures/techage_cylinder4.png and /dev/null differ diff --git a/techage/textures/techage_display.png b/techage/textures/techage_display.png deleted file mode 100644 index d793097..0000000 Binary files a/techage/textures/techage_display.png and /dev/null differ diff --git a/techage/textures/techage_displayXL.png b/techage/textures/techage_displayXL.png deleted file mode 100644 index f0d4363..0000000 Binary files a/techage/textures/techage_displayXL.png and /dev/null differ diff --git a/techage/textures/techage_display_inventory.png b/techage/textures/techage_display_inventory.png deleted file mode 100644 index 5f709dc..0000000 Binary files a/techage/textures/techage_display_inventory.png and /dev/null differ diff --git a/techage/textures/techage_display_inventoryXL.png b/techage/textures/techage_display_inventoryXL.png deleted file mode 100644 index bd4b322..0000000 Binary files a/techage/textures/techage_display_inventoryXL.png and /dev/null differ diff --git a/techage/textures/techage_distiller1.png b/techage/textures/techage_distiller1.png deleted file mode 100644 index 1231490..0000000 Binary files a/techage/textures/techage_distiller1.png and /dev/null differ diff --git a/techage/textures/techage_distiller2.png b/techage/textures/techage_distiller2.png deleted file mode 100644 index 497510e..0000000 Binary files a/techage/textures/techage_distiller2.png and /dev/null differ diff --git a/techage/textures/techage_distiller3.png b/techage/textures/techage_distiller3.png deleted file mode 100644 index bfe0987..0000000 Binary files a/techage/textures/techage_distiller3.png and /dev/null differ diff --git a/techage/textures/techage_distiller4.png b/techage/textures/techage_distiller4.png deleted file mode 100644 index aa479fa..0000000 Binary files a/techage/textures/techage_distiller4.png and /dev/null differ diff --git a/techage/textures/techage_distiller_inv.png b/techage/textures/techage_distiller_inv.png deleted file mode 100644 index 5b3cc19..0000000 Binary files a/techage/textures/techage_distiller_inv.png and /dev/null differ diff --git a/techage/textures/techage_electric_button.png b/techage/textures/techage_electric_button.png deleted file mode 100644 index 9a82851..0000000 Binary files a/techage/textures/techage_electric_button.png and /dev/null differ diff --git a/techage/textures/techage_electric_button_off.png b/techage/textures/techage_electric_button_off.png deleted file mode 100644 index c213a0d..0000000 Binary files a/techage/textures/techage_electric_button_off.png and /dev/null differ diff --git a/techage/textures/techage_electric_button_on.png b/techage/textures/techage_electric_button_on.png deleted file mode 100644 index 6f6dc66..0000000 Binary files a/techage/textures/techage_electric_button_on.png and /dev/null differ diff --git a/techage/textures/techage_electric_cable.png b/techage/textures/techage_electric_cable.png deleted file mode 100644 index d626283..0000000 Binary files a/techage/textures/techage_electric_cable.png and /dev/null differ diff --git a/techage/textures/techage_electric_cable_end.png b/techage/textures/techage_electric_cable_end.png deleted file mode 100644 index 0b021e1..0000000 Binary files a/techage/textures/techage_electric_cable_end.png and /dev/null differ diff --git a/techage/textures/techage_electric_cable_inv.png b/techage/textures/techage_electric_cable_inv.png deleted file mode 100644 index 1c71867..0000000 Binary files a/techage/textures/techage_electric_cable_inv.png and /dev/null differ diff --git a/techage/textures/techage_electric_junction.png b/techage/textures/techage_electric_junction.png deleted file mode 100644 index 1dc02d5..0000000 Binary files a/techage/textures/techage_electric_junction.png and /dev/null differ diff --git a/techage/textures/techage_electric_plug.png b/techage/textures/techage_electric_plug.png deleted file mode 100644 index 1d0d8f1..0000000 Binary files a/techage/textures/techage_electric_plug.png and /dev/null differ diff --git a/techage/textures/techage_electric_switch.png b/techage/textures/techage_electric_switch.png deleted file mode 100644 index 736553c..0000000 Binary files a/techage/textures/techage_electric_switch.png and /dev/null differ diff --git a/techage/textures/techage_electric_switch_off.png b/techage/textures/techage_electric_switch_off.png deleted file mode 100644 index 2880073..0000000 Binary files a/techage/textures/techage_electric_switch_off.png and /dev/null differ diff --git a/techage/textures/techage_electric_trowel.png b/techage/textures/techage_electric_trowel.png deleted file mode 100644 index 11d7941..0000000 Binary files a/techage/textures/techage_electric_trowel.png and /dev/null differ diff --git a/techage/textures/techage_end_wrench.png b/techage/textures/techage_end_wrench.png deleted file mode 100644 index a66c537..0000000 Binary files a/techage/textures/techage_end_wrench.png and /dev/null differ diff --git a/techage/textures/techage_fc_stack_inv.png b/techage/textures/techage_fc_stack_inv.png deleted file mode 100644 index baad110..0000000 Binary files a/techage/textures/techage_fc_stack_inv.png and /dev/null differ diff --git a/techage/textures/techage_fermenter_foil.png b/techage/textures/techage_fermenter_foil.png deleted file mode 100644 index 73be5d1..0000000 Binary files a/techage/textures/techage_fermenter_foil.png and /dev/null differ diff --git a/techage/textures/techage_filling4_ta2.png b/techage/textures/techage_filling4_ta2.png deleted file mode 100644 index 5f991da..0000000 Binary files a/techage/textures/techage_filling4_ta2.png and /dev/null differ diff --git a/techage/textures/techage_filling4_ta3.png b/techage/textures/techage_filling4_ta3.png deleted file mode 100644 index 4576f68..0000000 Binary files a/techage/textures/techage_filling4_ta3.png and /dev/null differ diff --git a/techage/textures/techage_filling4_ta4.png b/techage/textures/techage_filling4_ta4.png deleted file mode 100644 index 48987fe..0000000 Binary files a/techage/textures/techage_filling4_ta4.png and /dev/null differ diff --git a/techage/textures/techage_filling8_ta2.png b/techage/textures/techage_filling8_ta2.png deleted file mode 100644 index 69a88f4..0000000 Binary files a/techage/textures/techage_filling8_ta2.png and /dev/null differ diff --git a/techage/textures/techage_filling8_ta3.png b/techage/textures/techage_filling8_ta3.png deleted file mode 100644 index 74739a3..0000000 Binary files a/techage/textures/techage_filling8_ta3.png and /dev/null differ diff --git a/techage/textures/techage_filling8_ta4.png b/techage/textures/techage_filling8_ta4.png deleted file mode 100644 index b9d6311..0000000 Binary files a/techage/textures/techage_filling8_ta4.png and /dev/null differ diff --git a/techage/textures/techage_filling_metal.png b/techage/textures/techage_filling_metal.png deleted file mode 100644 index 43f0734..0000000 Binary files a/techage/textures/techage_filling_metal.png and /dev/null differ diff --git a/techage/textures/techage_filling_ta2.png b/techage/textures/techage_filling_ta2.png deleted file mode 100644 index 7767eeb..0000000 Binary files a/techage/textures/techage_filling_ta2.png and /dev/null differ diff --git a/techage/textures/techage_filling_ta3.png b/techage/textures/techage_filling_ta3.png deleted file mode 100644 index fe5a214..0000000 Binary files a/techage/textures/techage_filling_ta3.png and /dev/null differ diff --git a/techage/textures/techage_filling_ta4.png b/techage/textures/techage_filling_ta4.png deleted file mode 100644 index 8d0a03d..0000000 Binary files a/techage/textures/techage_filling_ta4.png and /dev/null differ diff --git a/techage/textures/techage_filter_inv.png b/techage/textures/techage_filter_inv.png deleted file mode 100644 index 8637db5..0000000 Binary files a/techage/textures/techage_filter_inv.png and /dev/null differ diff --git a/techage/textures/techage_firebox.png b/techage/textures/techage_firebox.png deleted file mode 100644 index 6267f3d..0000000 Binary files a/techage/textures/techage_firebox.png and /dev/null differ diff --git a/techage/textures/techage_firebox4.png b/techage/textures/techage_firebox4.png deleted file mode 100644 index e566fee..0000000 Binary files a/techage/textures/techage_firebox4.png and /dev/null differ diff --git a/techage/textures/techage_flame.png b/techage/textures/techage_flame.png deleted file mode 100644 index 0470816..0000000 Binary files a/techage/textures/techage_flame.png and /dev/null differ diff --git a/techage/textures/techage_flame_animated.png b/techage/textures/techage_flame_animated.png deleted file mode 100644 index 7418550..0000000 Binary files a/techage/textures/techage_flame_animated.png and /dev/null differ diff --git a/techage/textures/techage_flywheel.png b/techage/textures/techage_flywheel.png deleted file mode 100644 index 19e8c40..0000000 Binary files a/techage/textures/techage_flywheel.png and /dev/null differ diff --git a/techage/textures/techage_flywheel8.png b/techage/textures/techage_flywheel8.png deleted file mode 100644 index c364684..0000000 Binary files a/techage/textures/techage_flywheel8.png and /dev/null differ diff --git a/techage/textures/techage_form_add_arrow.png b/techage/textures/techage_form_add_arrow.png deleted file mode 100644 index 2be2093..0000000 Binary files a/techage/textures/techage_form_add_arrow.png and /dev/null differ diff --git a/techage/textures/techage_form_arrow.png b/techage/textures/techage_form_arrow.png deleted file mode 100644 index 8f7a90b..0000000 Binary files a/techage/textures/techage_form_arrow.png and /dev/null differ diff --git a/techage/textures/techage_form_arrow_bg.png b/techage/textures/techage_form_arrow_bg.png deleted file mode 100644 index ea2901a..0000000 Binary files a/techage/textures/techage_form_arrow_bg.png and /dev/null differ diff --git a/techage/textures/techage_form_arrow_fg.png b/techage/textures/techage_form_arrow_fg.png deleted file mode 100644 index 49124cc..0000000 Binary files a/techage/textures/techage_form_arrow_fg.png and /dev/null differ diff --git a/techage/textures/techage_form_gear_bg.png b/techage/textures/techage_form_gear_bg.png deleted file mode 100644 index b72fad2..0000000 Binary files a/techage/textures/techage_form_gear_bg.png and /dev/null differ diff --git a/techage/textures/techage_form_get_arrow.png b/techage/textures/techage_form_get_arrow.png deleted file mode 100644 index 7177da0..0000000 Binary files a/techage/textures/techage_form_get_arrow.png and /dev/null differ diff --git a/techage/textures/techage_form_grey.png b/techage/textures/techage_form_grey.png deleted file mode 100644 index 93a2fbb..0000000 Binary files a/techage/textures/techage_form_grey.png and /dev/null differ diff --git a/techage/textures/techage_form_input.png b/techage/textures/techage_form_input.png deleted file mode 100644 index b2971b9..0000000 Binary files a/techage/textures/techage_form_input.png and /dev/null differ diff --git a/techage/textures/techage_form_input_arrow.png b/techage/textures/techage_form_input_arrow.png deleted file mode 100644 index 9f76dcf..0000000 Binary files a/techage/textures/techage_form_input_arrow.png and /dev/null differ diff --git a/techage/textures/techage_form_inventory.png b/techage/textures/techage_form_inventory.png deleted file mode 100644 index 0c37bba..0000000 Binary files a/techage/textures/techage_form_inventory.png and /dev/null differ diff --git a/techage/textures/techage_form_level_bg.png b/techage/textures/techage_form_level_bg.png deleted file mode 100644 index f09ac76..0000000 Binary files a/techage/textures/techage_form_level_bg.png and /dev/null differ diff --git a/techage/textures/techage_form_level_charge.png b/techage/textures/techage_form_level_charge.png deleted file mode 100644 index c7d2c50..0000000 Binary files a/techage/textures/techage_form_level_charge.png and /dev/null differ diff --git a/techage/textures/techage_form_level_fg.png b/techage/textures/techage_form_level_fg.png deleted file mode 100644 index def4eb5..0000000 Binary files a/techage/textures/techage_form_level_fg.png and /dev/null differ diff --git a/techage/textures/techage_form_level_off.png b/techage/textures/techage_form_level_off.png deleted file mode 100644 index 04a8cf3..0000000 Binary files a/techage/textures/techage_form_level_off.png and /dev/null differ diff --git a/techage/textures/techage_form_level_red_fg.png b/techage/textures/techage_form_level_red_fg.png deleted file mode 100644 index 15aa5f2..0000000 Binary files a/techage/textures/techage_form_level_red_fg.png and /dev/null differ diff --git a/techage/textures/techage_form_level_unload.png b/techage/textures/techage_form_level_unload.png deleted file mode 100644 index 54d2cea..0000000 Binary files a/techage/textures/techage_form_level_unload.png and /dev/null differ diff --git a/techage/textures/techage_form_mask.png b/techage/textures/techage_form_mask.png deleted file mode 100644 index cfe299b..0000000 Binary files a/techage/textures/techage_form_mask.png and /dev/null differ diff --git a/techage/textures/techage_form_output_arrow.png b/techage/textures/techage_form_output_arrow.png deleted file mode 100644 index 3301c01..0000000 Binary files a/techage/textures/techage_form_output_arrow.png and /dev/null differ diff --git a/techage/textures/techage_form_tank.png b/techage/textures/techage_form_tank.png deleted file mode 100644 index 71c6b27..0000000 Binary files a/techage/textures/techage_form_tank.png and /dev/null differ diff --git a/techage/textures/techage_form_temp_bg.png b/techage/textures/techage_form_temp_bg.png deleted file mode 100644 index ea5f5b6..0000000 Binary files a/techage/textures/techage_form_temp_bg.png and /dev/null differ diff --git a/techage/textures/techage_form_temp_fg.png b/techage/textures/techage_form_temp_fg.png deleted file mode 100644 index b7e4f4e..0000000 Binary files a/techage/textures/techage_form_temp_fg.png and /dev/null differ diff --git a/techage/textures/techage_formspec_bg.png b/techage/textures/techage_formspec_bg.png deleted file mode 100644 index 1ff0453..0000000 Binary files a/techage/textures/techage_formspec_bg.png and /dev/null differ diff --git a/techage/textures/techage_frame14_ta2.png b/techage/textures/techage_frame14_ta2.png deleted file mode 100644 index b7a119a..0000000 Binary files a/techage/textures/techage_frame14_ta2.png and /dev/null differ diff --git a/techage/textures/techage_frame14_ta3.png b/techage/textures/techage_frame14_ta3.png deleted file mode 100644 index 84ac4ea..0000000 Binary files a/techage/textures/techage_frame14_ta3.png and /dev/null differ diff --git a/techage/textures/techage_frame14_ta4.png b/techage/textures/techage_frame14_ta4.png deleted file mode 100644 index 2892065..0000000 Binary files a/techage/textures/techage_frame14_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frame14_ta4_hp.png b/techage/textures/techage_frame14_ta4_hp.png deleted file mode 100644 index 74cbad7..0000000 Binary files a/techage/textures/techage_frame14_ta4_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta2.png b/techage/textures/techage_frame4_ta2.png deleted file mode 100644 index 98bb0e6..0000000 Binary files a/techage/textures/techage_frame4_ta2.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta2_top.png b/techage/textures/techage_frame4_ta2_top.png deleted file mode 100644 index 98bb0e6..0000000 Binary files a/techage/textures/techage_frame4_ta2_top.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta3.png b/techage/textures/techage_frame4_ta3.png deleted file mode 100644 index 3c837ed..0000000 Binary files a/techage/textures/techage_frame4_ta3.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta3_top.png b/techage/textures/techage_frame4_ta3_top.png deleted file mode 100644 index 3c837ed..0000000 Binary files a/techage/textures/techage_frame4_ta3_top.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta4.png b/techage/textures/techage_frame4_ta4.png deleted file mode 100644 index 542528d..0000000 Binary files a/techage/textures/techage_frame4_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta4_hp.png b/techage/textures/techage_frame4_ta4_hp.png deleted file mode 100644 index 39658cb..0000000 Binary files a/techage/textures/techage_frame4_ta4_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta4_top.png b/techage/textures/techage_frame4_ta4_top.png deleted file mode 100644 index f52be61..0000000 Binary files a/techage/textures/techage_frame4_ta4_top.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta4_top_hp.png b/techage/textures/techage_frame4_ta4_top_hp.png deleted file mode 100644 index f5064a0..0000000 Binary files a/techage/textures/techage_frame4_ta4_top_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame4_ta5.png b/techage/textures/techage_frame4_ta5.png deleted file mode 100644 index 15c168d..0000000 Binary files a/techage/textures/techage_frame4_ta5.png and /dev/null differ diff --git a/techage/textures/techage_frame8_ta2.png b/techage/textures/techage_frame8_ta2.png deleted file mode 100644 index bd97608..0000000 Binary files a/techage/textures/techage_frame8_ta2.png and /dev/null differ diff --git a/techage/textures/techage_frame8_ta3.png b/techage/textures/techage_frame8_ta3.png deleted file mode 100644 index c30737d..0000000 Binary files a/techage/textures/techage_frame8_ta3.png and /dev/null differ diff --git a/techage/textures/techage_frame8_ta4.png b/techage/textures/techage_frame8_ta4.png deleted file mode 100644 index 3df2b56..0000000 Binary files a/techage/textures/techage_frame8_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frame8_ta4_hp.png b/techage/textures/techage_frame8_ta4_hp.png deleted file mode 100644 index efc510c..0000000 Binary files a/techage/textures/techage_frame8_ta4_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame8_ta5.png b/techage/textures/techage_frame8_ta5.png deleted file mode 100644 index bd643e1..0000000 Binary files a/techage/textures/techage_frame8_ta5.png and /dev/null differ diff --git a/techage/textures/techage_frameB_ta4.png b/techage/textures/techage_frameB_ta4.png deleted file mode 100644 index 530a4b9..0000000 Binary files a/techage/textures/techage_frameB_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frameM_ta4.png b/techage/textures/techage_frameM_ta4.png deleted file mode 100644 index cf15fe9..0000000 Binary files a/techage/textures/techage_frameM_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frameT_ta4.png b/techage/textures/techage_frameT_ta4.png deleted file mode 100644 index 1204e83..0000000 Binary files a/techage/textures/techage_frameT_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frameT_ta5.png b/techage/textures/techage_frameT_ta5.png deleted file mode 100644 index d6af881..0000000 Binary files a/techage/textures/techage_frameT_ta5.png and /dev/null differ diff --git a/techage/textures/techage_frame_small_ta3.png b/techage/textures/techage_frame_small_ta3.png deleted file mode 100644 index a030d5d..0000000 Binary files a/techage/textures/techage_frame_small_ta3.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta2.png b/techage/textures/techage_frame_ta2.png deleted file mode 100644 index cc722dd..0000000 Binary files a/techage/textures/techage_frame_ta2.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta2_bottom.png b/techage/textures/techage_frame_ta2_bottom.png deleted file mode 100644 index f7ac529..0000000 Binary files a/techage/textures/techage_frame_ta2_bottom.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta2_top.png b/techage/textures/techage_frame_ta2_top.png deleted file mode 100644 index 98758b3..0000000 Binary files a/techage/textures/techage_frame_ta2_top.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta3.png b/techage/textures/techage_frame_ta3.png deleted file mode 100644 index e744bc5..0000000 Binary files a/techage/textures/techage_frame_ta3.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta3_bottom.png b/techage/textures/techage_frame_ta3_bottom.png deleted file mode 100644 index 4e23692..0000000 Binary files a/techage/textures/techage_frame_ta3_bottom.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta3_top.png b/techage/textures/techage_frame_ta3_top.png deleted file mode 100644 index e744bc5..0000000 Binary files a/techage/textures/techage_frame_ta3_top.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta4.png b/techage/textures/techage_frame_ta4.png deleted file mode 100644 index b5326f7..0000000 Binary files a/techage/textures/techage_frame_ta4.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta4_bottom.png b/techage/textures/techage_frame_ta4_bottom.png deleted file mode 100644 index af32e7a..0000000 Binary files a/techage/textures/techage_frame_ta4_bottom.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta4_hp.png b/techage/textures/techage_frame_ta4_hp.png deleted file mode 100644 index 0c62328..0000000 Binary files a/techage/textures/techage_frame_ta4_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta4_top.png b/techage/textures/techage_frame_ta4_top.png deleted file mode 100644 index ce405c6..0000000 Binary files a/techage/textures/techage_frame_ta4_top.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta4_top_hp.png b/techage/textures/techage_frame_ta4_top_hp.png deleted file mode 100644 index 1bd16b9..0000000 Binary files a/techage/textures/techage_frame_ta4_top_hp.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta5.png b/techage/textures/techage_frame_ta5.png deleted file mode 100644 index 6609d1f..0000000 Binary files a/techage/textures/techage_frame_ta5.png and /dev/null differ diff --git a/techage/textures/techage_frame_ta5_top.png b/techage/textures/techage_frame_ta5_top.png deleted file mode 100644 index 85b4276..0000000 Binary files a/techage/textures/techage_frame_ta5_top.png and /dev/null differ diff --git a/techage/textures/techage_frame_waterpump.png b/techage/textures/techage_frame_waterpump.png deleted file mode 100644 index 90b5165..0000000 Binary files a/techage/textures/techage_frame_waterpump.png and /dev/null differ diff --git a/techage/textures/techage_frame_waterpump_top.png b/techage/textures/techage_frame_waterpump_top.png deleted file mode 100644 index f7116ac..0000000 Binary files a/techage/textures/techage_frame_waterpump_top.png and /dev/null differ diff --git a/techage/textures/techage_framexl_ta3.png b/techage/textures/techage_framexl_ta3.png deleted file mode 100644 index 5683d19..0000000 Binary files a/techage/textures/techage_framexl_ta3.png and /dev/null differ diff --git a/techage/textures/techage_framexl_ta3_top.png b/techage/textures/techage_framexl_ta3_top.png deleted file mode 100644 index a610250..0000000 Binary files a/techage/textures/techage_framexl_ta3_top.png and /dev/null differ diff --git a/techage/textures/techage_furnace_ceramic.png b/techage/textures/techage_furnace_ceramic.png deleted file mode 100644 index 4b0a82b..0000000 Binary files a/techage/textures/techage_furnace_ceramic.png and /dev/null differ diff --git a/techage/textures/techage_fusion_reactor.png b/techage/textures/techage_fusion_reactor.png deleted file mode 100644 index 2516d4e..0000000 Binary files a/techage/textures/techage_fusion_reactor.png and /dev/null differ diff --git a/techage/textures/techage_gas_cylinder_large.png b/techage/textures/techage_gas_cylinder_large.png deleted file mode 100644 index 5a420db..0000000 Binary files a/techage/textures/techage_gas_cylinder_large.png and /dev/null differ diff --git a/techage/textures/techage_gas_cylinder_small.png b/techage/textures/techage_gas_cylinder_small.png deleted file mode 100644 index f6e2c4e..0000000 Binary files a/techage/textures/techage_gas_cylinder_small.png and /dev/null differ diff --git a/techage/textures/techage_gas_inv.png b/techage/textures/techage_gas_inv.png deleted file mode 100644 index ea6868d..0000000 Binary files a/techage/textures/techage_gas_inv.png and /dev/null differ diff --git a/techage/textures/techage_gasflare.png b/techage/textures/techage_gasflare.png deleted file mode 100644 index 4530dcc..0000000 Binary files a/techage/textures/techage_gasflare.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe.png b/techage/textures/techage_gaspipe.png deleted file mode 100644 index c62eb81..0000000 Binary files a/techage/textures/techage_gaspipe.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_hole.png b/techage/textures/techage_gaspipe_hole.png deleted file mode 100644 index a791768..0000000 Binary files a/techage/textures/techage_gaspipe_hole.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_hole2.png b/techage/textures/techage_gaspipe_hole2.png deleted file mode 100644 index 7caba32..0000000 Binary files a/techage/textures/techage_gaspipe_hole2.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_junction.png b/techage/textures/techage_gaspipe_junction.png deleted file mode 100644 index 2905b28..0000000 Binary files a/techage/textures/techage_gaspipe_junction.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_knee.png b/techage/textures/techage_gaspipe_knee.png deleted file mode 100644 index d145c46..0000000 Binary files a/techage/textures/techage_gaspipe_knee.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_knee2.png b/techage/textures/techage_gaspipe_knee2.png deleted file mode 100644 index a58bb1c..0000000 Binary files a/techage/textures/techage_gaspipe_knee2.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_valve_closed.png b/techage/textures/techage_gaspipe_valve_closed.png deleted file mode 100644 index 8b758b6..0000000 Binary files a/techage/textures/techage_gaspipe_valve_closed.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_valve_hole.png b/techage/textures/techage_gaspipe_valve_hole.png deleted file mode 100644 index de07823..0000000 Binary files a/techage/textures/techage_gaspipe_valve_hole.png and /dev/null differ diff --git a/techage/textures/techage_gaspipe_valve_open.png b/techage/textures/techage_gaspipe_valve_open.png deleted file mode 100644 index ef27b6f..0000000 Binary files a/techage/textures/techage_gaspipe_valve_open.png and /dev/null differ diff --git a/techage/textures/techage_gate.png b/techage/textures/techage_gate.png deleted file mode 100644 index ac51f19..0000000 Binary files a/techage/textures/techage_gate.png and /dev/null differ diff --git a/techage/textures/techage_gravel4.png b/techage/textures/techage_gravel4.png deleted file mode 100644 index 736b74d..0000000 Binary files a/techage/textures/techage_gravel4.png and /dev/null differ diff --git a/techage/textures/techage_growlight_back.png b/techage/textures/techage_growlight_back.png deleted file mode 100644 index 0c6be8c..0000000 Binary files a/techage/textures/techage_growlight_back.png and /dev/null differ diff --git a/techage/textures/techage_growlight_off.png b/techage/textures/techage_growlight_off.png deleted file mode 100644 index fd3464f..0000000 Binary files a/techage/textures/techage_growlight_off.png and /dev/null differ diff --git a/techage/textures/techage_growlight_on.png b/techage/textures/techage_growlight_on.png deleted file mode 100644 index 4e94a1a..0000000 Binary files a/techage/textures/techage_growlight_on.png and /dev/null differ diff --git a/techage/textures/techage_growlight_side.png b/techage/textures/techage_growlight_side.png deleted file mode 100644 index 9379bb5..0000000 Binary files a/techage/textures/techage_growlight_side.png and /dev/null differ diff --git a/techage/textures/techage_heat_exchanger_inv.png b/techage/textures/techage_heat_exchanger_inv.png deleted file mode 100644 index b2175f9..0000000 Binary files a/techage/textures/techage_heat_exchanger_inv.png and /dev/null differ diff --git a/techage/textures/techage_hole_ta4.png b/techage/textures/techage_hole_ta4.png deleted file mode 100644 index cc33c9a..0000000 Binary files a/techage/textures/techage_hole_ta4.png and /dev/null differ diff --git a/techage/textures/techage_hopper.png b/techage/textures/techage_hopper.png deleted file mode 100644 index f714af3..0000000 Binary files a/techage/textures/techage_hopper.png and /dev/null differ diff --git a/techage/textures/techage_hydrogen_inv.png b/techage/textures/techage_hydrogen_inv.png deleted file mode 100644 index 82aeff0..0000000 Binary files a/techage/textures/techage_hydrogen_inv.png and /dev/null differ diff --git a/techage/textures/techage_industlight4_on.png b/techage/textures/techage_industlight4_on.png deleted file mode 100644 index 0e4aa14..0000000 Binary files a/techage/textures/techage_industlight4_on.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp1.png b/techage/textures/techage_industriallamp1.png deleted file mode 100644 index 17b4c76..0000000 Binary files a/techage/textures/techage_industriallamp1.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp1_on.png b/techage/textures/techage_industriallamp1_on.png deleted file mode 100644 index 60a160f..0000000 Binary files a/techage/textures/techage_industriallamp1_on.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp2.png b/techage/textures/techage_industriallamp2.png deleted file mode 100644 index 07f0d8d..0000000 Binary files a/techage/textures/techage_industriallamp2.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp2_on.png b/techage/textures/techage_industriallamp2_on.png deleted file mode 100644 index b35eeb5..0000000 Binary files a/techage/textures/techage_industriallamp2_on.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp3.png b/techage/textures/techage_industriallamp3.png deleted file mode 100644 index 3a09df1..0000000 Binary files a/techage/textures/techage_industriallamp3.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp3_on.png b/techage/textures/techage_industriallamp3_on.png deleted file mode 100644 index 1ab99ac..0000000 Binary files a/techage/textures/techage_industriallamp3_on.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp_inv1.png b/techage/textures/techage_industriallamp_inv1.png deleted file mode 100644 index d7fbb6d..0000000 Binary files a/techage/textures/techage_industriallamp_inv1.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp_inv2.png b/techage/textures/techage_industriallamp_inv2.png deleted file mode 100644 index dd2a5d6..0000000 Binary files a/techage/textures/techage_industriallamp_inv2.png and /dev/null differ diff --git a/techage/textures/techage_industriallamp_inv3.png b/techage/textures/techage_industriallamp_inv3.png deleted file mode 100644 index 2d1556f..0000000 Binary files a/techage/textures/techage_industriallamp_inv3.png and /dev/null differ diff --git a/techage/textures/techage_inv_blue.png b/techage/textures/techage_inv_blue.png deleted file mode 100644 index b8d75c1..0000000 Binary files a/techage/textures/techage_inv_blue.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_error.png b/techage/textures/techage_inv_button_error.png deleted file mode 100644 index c01e36a..0000000 Binary files a/techage/textures/techage_inv_button_error.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_nopower.png b/techage/textures/techage_inv_button_nopower.png deleted file mode 100644 index 6e8bd0a..0000000 Binary files a/techage/textures/techage_inv_button_nopower.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_off.png b/techage/textures/techage_inv_button_off.png deleted file mode 100644 index 355fee5..0000000 Binary files a/techage/textures/techage_inv_button_off.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_on.png b/techage/textures/techage_inv_button_on.png deleted file mode 100644 index e3a9329..0000000 Binary files a/techage/textures/techage_inv_button_on.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_standby.png b/techage/textures/techage_inv_button_standby.png deleted file mode 100644 index 8e23989..0000000 Binary files a/techage/textures/techage_inv_button_standby.png and /dev/null differ diff --git a/techage/textures/techage_inv_button_warning.png b/techage/textures/techage_inv_button_warning.png deleted file mode 100644 index ba06406..0000000 Binary files a/techage/textures/techage_inv_button_warning.png and /dev/null differ diff --git a/techage/textures/techage_inv_green.png b/techage/textures/techage_inv_green.png deleted file mode 100644 index 014a96e..0000000 Binary files a/techage/textures/techage_inv_green.png and /dev/null differ diff --git a/techage/textures/techage_inv_invisible.png b/techage/textures/techage_inv_invisible.png deleted file mode 100644 index f8e65ad..0000000 Binary files a/techage/textures/techage_inv_invisible.png and /dev/null differ diff --git a/techage/textures/techage_inv_powerT2.png b/techage/textures/techage_inv_powerT2.png deleted file mode 100644 index e49c0c9..0000000 Binary files a/techage/textures/techage_inv_powerT2.png and /dev/null differ diff --git a/techage/textures/techage_inv_powerT3.png b/techage/textures/techage_inv_powerT3.png deleted file mode 100644 index f833cab..0000000 Binary files a/techage/textures/techage_inv_powerT3.png and /dev/null differ diff --git a/techage/textures/techage_inv_red.png b/techage/textures/techage_inv_red.png deleted file mode 100644 index 4e4cd2a..0000000 Binary files a/techage/textures/techage_inv_red.png and /dev/null differ diff --git a/techage/textures/techage_inv_wrench.png b/techage/textures/techage_inv_wrench.png deleted file mode 100644 index f95cc55..0000000 Binary files a/techage/textures/techage_inv_wrench.png and /dev/null differ diff --git a/techage/textures/techage_inv_yellow.png b/techage/textures/techage_inv_yellow.png deleted file mode 100644 index 8ac9343..0000000 Binary files a/techage/textures/techage_inv_yellow.png and /dev/null differ diff --git a/techage/textures/techage_invisible_inv.png b/techage/textures/techage_invisible_inv.png deleted file mode 100644 index 9374d17..0000000 Binary files a/techage/textures/techage_invisible_inv.png and /dev/null differ diff --git a/techage/textures/techage_iron_ingot.png b/techage/textures/techage_iron_ingot.png deleted file mode 100644 index 1828f3f..0000000 Binary files a/techage/textures/techage_iron_ingot.png and /dev/null differ diff --git a/techage/textures/techage_isobutane_inv.png b/techage/textures/techage_isobutane_inv.png deleted file mode 100644 index 432c96d..0000000 Binary files a/techage/textures/techage_isobutane_inv.png and /dev/null differ diff --git a/techage/textures/techage_junglewood.png b/techage/textures/techage_junglewood.png deleted file mode 100644 index 43c3733..0000000 Binary files a/techage/textures/techage_junglewood.png and /dev/null differ diff --git a/techage/textures/techage_junglewood_top.png b/techage/textures/techage_junglewood_top.png deleted file mode 100644 index 746a870..0000000 Binary files a/techage/textures/techage_junglewood_top.png and /dev/null differ diff --git a/techage/textures/techage_laser.png b/techage/textures/techage_laser.png deleted file mode 100644 index 43e14f6..0000000 Binary files a/techage/textures/techage_laser.png and /dev/null differ diff --git a/techage/textures/techage_leds.png b/techage/textures/techage_leds.png deleted file mode 100644 index d5f2e60..0000000 Binary files a/techage/textures/techage_leds.png and /dev/null differ diff --git a/techage/textures/techage_lighter.png b/techage/textures/techage_lighter.png deleted file mode 100644 index 47ec8cc..0000000 Binary files a/techage/textures/techage_lighter.png and /dev/null differ diff --git a/techage/textures/techage_lighter_burn.png b/techage/textures/techage_lighter_burn.png deleted file mode 100644 index 2950f59..0000000 Binary files a/techage/textures/techage_lighter_burn.png and /dev/null differ diff --git a/techage/textures/techage_liquid1_inv.png b/techage/textures/techage_liquid1_inv.png deleted file mode 100644 index f4bf71c..0000000 Binary files a/techage/textures/techage_liquid1_inv.png and /dev/null differ diff --git a/techage/textures/techage_liquid2_inv.png b/techage/textures/techage_liquid2_inv.png deleted file mode 100644 index 47cfd42..0000000 Binary files a/techage/textures/techage_liquid2_inv.png and /dev/null differ diff --git a/techage/textures/techage_liquid_filter_filler.png b/techage/textures/techage_liquid_filter_filler.png deleted file mode 100644 index b89fee9..0000000 Binary files a/techage/textures/techage_liquid_filter_filler.png and /dev/null differ diff --git a/techage/textures/techage_liquid_filter_filler_bottom.png b/techage/textures/techage_liquid_filter_filler_bottom.png deleted file mode 100644 index 5c7df5d..0000000 Binary files a/techage/textures/techage_liquid_filter_filler_bottom.png and /dev/null differ diff --git a/techage/textures/techage_liquidsampler.png b/techage/textures/techage_liquidsampler.png deleted file mode 100644 index 38b99ce..0000000 Binary files a/techage/textures/techage_liquidsampler.png and /dev/null differ diff --git a/techage/textures/techage_liquidsampler4.png b/techage/textures/techage_liquidsampler4.png deleted file mode 100644 index 7e81196..0000000 Binary files a/techage/textures/techage_liquidsampler4.png and /dev/null differ diff --git a/techage/textures/techage_lua_controller.png b/techage/textures/techage_lua_controller.png deleted file mode 100644 index 450dc9d..0000000 Binary files a/techage/textures/techage_lua_controller.png and /dev/null differ diff --git a/techage/textures/techage_lua_controller_inventory.png b/techage/textures/techage_lua_controller_inventory.png deleted file mode 100644 index b744d4b..0000000 Binary files a/techage/textures/techage_lua_controller_inventory.png and /dev/null differ diff --git a/techage/textures/techage_lua_server_back.png b/techage/textures/techage_lua_server_back.png deleted file mode 100644 index 66549c2..0000000 Binary files a/techage/textures/techage_lua_server_back.png and /dev/null differ diff --git a/techage/textures/techage_lua_server_front.png b/techage/textures/techage_lua_server_front.png deleted file mode 100644 index bc7f2e8..0000000 Binary files a/techage/textures/techage_lua_server_front.png and /dev/null differ diff --git a/techage/textures/techage_lua_server_side.png b/techage/textures/techage_lua_server_side.png deleted file mode 100644 index 51843c8..0000000 Binary files a/techage/textures/techage_lua_server_side.png and /dev/null differ diff --git a/techage/textures/techage_lua_server_top.png b/techage/textures/techage_lua_server_top.png deleted file mode 100644 index 04093df..0000000 Binary files a/techage/textures/techage_lua_server_top.png and /dev/null differ diff --git a/techage/textures/techage_magnet_hole.png b/techage/textures/techage_magnet_hole.png deleted file mode 100644 index 5e00e1e..0000000 Binary files a/techage/textures/techage_magnet_hole.png and /dev/null differ diff --git a/techage/textures/techage_meltingpot.png b/techage/textures/techage_meltingpot.png deleted file mode 100644 index ecbea25..0000000 Binary files a/techage/textures/techage_meltingpot.png and /dev/null differ diff --git a/techage/textures/techage_meltingpot_top_active.png b/techage/textures/techage_meltingpot_top_active.png deleted file mode 100644 index 5fc447c..0000000 Binary files a/techage/textures/techage_meltingpot_top_active.png and /dev/null differ diff --git a/techage/textures/techage_meridium_ingot.png b/techage/textures/techage_meridium_ingot.png deleted file mode 100644 index 0d5ad99..0000000 Binary files a/techage/textures/techage_meridium_ingot.png and /dev/null differ diff --git a/techage/textures/techage_meridiumaxe.png b/techage/textures/techage_meridiumaxe.png deleted file mode 100644 index 830410e..0000000 Binary files a/techage/textures/techage_meridiumaxe.png and /dev/null differ diff --git a/techage/textures/techage_meridiumpick.png b/techage/textures/techage_meridiumpick.png deleted file mode 100644 index b262947..0000000 Binary files a/techage/textures/techage_meridiumpick.png and /dev/null differ diff --git a/techage/textures/techage_meridiumshovel.png b/techage/textures/techage_meridiumshovel.png deleted file mode 100644 index 78be1d4..0000000 Binary files a/techage/textures/techage_meridiumshovel.png and /dev/null differ diff --git a/techage/textures/techage_meridiumsword.png b/techage/textures/techage_meridiumsword.png deleted file mode 100644 index 521f4d2..0000000 Binary files a/techage/textures/techage_meridiumsword.png and /dev/null differ diff --git a/techage/textures/techage_mill_base.png b/techage/textures/techage_mill_base.png deleted file mode 100644 index 50b5d33..0000000 Binary files a/techage/textures/techage_mill_base.png and /dev/null differ diff --git a/techage/textures/techage_mill_front.png b/techage/textures/techage_mill_front.png deleted file mode 100644 index 97351d4..0000000 Binary files a/techage/textures/techage_mill_front.png and /dev/null differ diff --git a/techage/textures/techage_mill_inv.png b/techage/textures/techage_mill_inv.png deleted file mode 100644 index 16ac43d..0000000 Binary files a/techage/textures/techage_mill_inv.png and /dev/null differ diff --git a/techage/textures/techage_mill_side.png b/techage/textures/techage_mill_side.png deleted file mode 100644 index d7ee649..0000000 Binary files a/techage/textures/techage_mill_side.png and /dev/null differ diff --git a/techage/textures/techage_oil.png b/techage/textures/techage_oil.png deleted file mode 100644 index 7541d05..0000000 Binary files a/techage/textures/techage_oil.png and /dev/null differ diff --git a/techage/textures/techage_oil_animated.png b/techage/textures/techage_oil_animated.png deleted file mode 100644 index 7b99375..0000000 Binary files a/techage/textures/techage_oil_animated.png and /dev/null differ diff --git a/techage/textures/techage_oil_boiler_inv.png b/techage/textures/techage_oil_boiler_inv.png deleted file mode 100644 index 9146f84..0000000 Binary files a/techage/textures/techage_oil_boiler_inv.png and /dev/null differ diff --git a/techage/textures/techage_oil_drill.png b/techage/textures/techage_oil_drill.png deleted file mode 100644 index 95a9aa6..0000000 Binary files a/techage/textures/techage_oil_drill.png and /dev/null differ diff --git a/techage/textures/techage_oil_drillbit.png b/techage/textures/techage_oil_drillbit.png deleted file mode 100644 index 7ef8775..0000000 Binary files a/techage/textures/techage_oil_drillbit.png and /dev/null differ diff --git a/techage/textures/techage_oil_drillbit_inv.png b/techage/textures/techage_oil_drillbit_inv.png deleted file mode 100644 index 5c64f83..0000000 Binary files a/techage/textures/techage_oil_drillbit_inv.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower1.png b/techage/textures/techage_oil_tower1.png deleted file mode 100644 index 30acbf2..0000000 Binary files a/techage/textures/techage_oil_tower1.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower2.png b/techage/textures/techage_oil_tower2.png deleted file mode 100644 index 8ce94d9..0000000 Binary files a/techage/textures/techage_oil_tower2.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower3.png b/techage/textures/techage_oil_tower3.png deleted file mode 100644 index 4c9b80b..0000000 Binary files a/techage/textures/techage_oil_tower3.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower4.png b/techage/textures/techage_oil_tower4.png deleted file mode 100644 index 21846ec..0000000 Binary files a/techage/textures/techage_oil_tower4.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower_inv.png b/techage/textures/techage_oil_tower_inv.png deleted file mode 100644 index 7710535..0000000 Binary files a/techage/textures/techage_oil_tower_inv.png and /dev/null differ diff --git a/techage/textures/techage_oil_tower_top.png b/techage/textures/techage_oil_tower_top.png deleted file mode 100644 index f99daad..0000000 Binary files a/techage/textures/techage_oil_tower_top.png and /dev/null differ diff --git a/techage/textures/techage_palette256.png b/techage/textures/techage_palette256.png deleted file mode 100644 index 6880d05..0000000 Binary files a/techage/textures/techage_palette256.png and /dev/null differ diff --git a/techage/textures/techage_pipe_wrench.png b/techage/textures/techage_pipe_wrench.png deleted file mode 100644 index ebc487a..0000000 Binary files a/techage/textures/techage_pipe_wrench.png and /dev/null differ diff --git a/techage/textures/techage_plasma.png b/techage/textures/techage_plasma.png deleted file mode 100644 index 1e7cf86..0000000 Binary files a/techage/textures/techage_plasma.png and /dev/null differ diff --git a/techage/textures/techage_powder_inv.png b/techage/textures/techage_powder_inv.png deleted file mode 100644 index 4ec099a..0000000 Binary files a/techage/textures/techage_powder_inv.png and /dev/null differ diff --git a/techage/textures/techage_power_line.png b/techage/textures/techage_power_line.png deleted file mode 100644 index 64d474b..0000000 Binary files a/techage/textures/techage_power_line.png and /dev/null differ diff --git a/techage/textures/techage_power_line_inv.png b/techage/textures/techage_power_line_inv.png deleted file mode 100644 index 76b9a3e..0000000 Binary files a/techage/textures/techage_power_line_inv.png and /dev/null differ diff --git a/techage/textures/techage_power_pole.png b/techage/textures/techage_power_pole.png deleted file mode 100644 index e3390fc..0000000 Binary files a/techage/textures/techage_power_pole.png and /dev/null differ diff --git a/techage/textures/techage_power_pole_top.png b/techage/textures/techage_power_pole_top.png deleted file mode 100644 index 82d570f..0000000 Binary files a/techage/textures/techage_power_pole_top.png and /dev/null differ diff --git a/techage/textures/techage_power_reduction.png b/techage/textures/techage_power_reduction.png deleted file mode 100644 index 6298226..0000000 Binary files a/techage/textures/techage_power_reduction.png and /dev/null differ diff --git a/techage/textures/techage_power_terminal_back.png b/techage/textures/techage_power_terminal_back.png deleted file mode 100644 index daeff71..0000000 Binary files a/techage/textures/techage_power_terminal_back.png and /dev/null differ diff --git a/techage/textures/techage_power_terminal_front.png b/techage/textures/techage_power_terminal_front.png deleted file mode 100644 index 6ece161..0000000 Binary files a/techage/textures/techage_power_terminal_front.png and /dev/null differ diff --git a/techage/textures/techage_power_terminal_side.png b/techage/textures/techage_power_terminal_side.png deleted file mode 100644 index 6102404..0000000 Binary files a/techage/textures/techage_power_terminal_side.png and /dev/null differ diff --git a/techage/textures/techage_power_terminal_top.png b/techage/textures/techage_power_terminal_top.png deleted file mode 100644 index 5604b88..0000000 Binary files a/techage/textures/techage_power_terminal_top.png and /dev/null differ diff --git a/techage/textures/techage_programmer.png b/techage/textures/techage_programmer.png deleted file mode 100644 index 6618e54..0000000 Binary files a/techage/textures/techage_programmer.png and /dev/null differ diff --git a/techage/textures/techage_programmer_wield.png b/techage/textures/techage_programmer_wield.png deleted file mode 100644 index 6afe96b..0000000 Binary files a/techage/textures/techage_programmer_wield.png and /dev/null differ diff --git a/techage/textures/techage_quarry_left.png b/techage/textures/techage_quarry_left.png deleted file mode 100644 index 002be37..0000000 Binary files a/techage/textures/techage_quarry_left.png and /dev/null differ diff --git a/techage/textures/techage_quarry_left14.png b/techage/textures/techage_quarry_left14.png deleted file mode 100644 index a521449..0000000 Binary files a/techage/textures/techage_quarry_left14.png and /dev/null differ diff --git a/techage/textures/techage_rack_and_pinion.png b/techage/textures/techage_rack_and_pinion.png deleted file mode 100644 index e01a0ce..0000000 Binary files a/techage/textures/techage_rack_and_pinion.png and /dev/null differ diff --git a/techage/textures/techage_ramchip.png b/techage/textures/techage_ramchip.png deleted file mode 100644 index efb064e..0000000 Binary files a/techage/textures/techage_ramchip.png and /dev/null differ diff --git a/techage/textures/techage_reactor_filler_plan.png b/techage/textures/techage_reactor_filler_plan.png deleted file mode 100644 index 2fb7a6e..0000000 Binary files a/techage/textures/techage_reactor_filler_plan.png and /dev/null differ diff --git a/techage/textures/techage_reactor_filler_side.png b/techage/textures/techage_reactor_filler_side.png deleted file mode 100644 index 7f7d3c8..0000000 Binary files a/techage/textures/techage_reactor_filler_side.png and /dev/null differ diff --git a/techage/textures/techage_reactor_filler_top.png b/techage/textures/techage_reactor_filler_top.png deleted file mode 100644 index f116c6b..0000000 Binary files a/techage/textures/techage_reactor_filler_top.png and /dev/null differ diff --git a/techage/textures/techage_reactor_inv.png b/techage/textures/techage_reactor_inv.png deleted file mode 100644 index 3a8af3e..0000000 Binary files a/techage/textures/techage_reactor_inv.png and /dev/null differ diff --git a/techage/textures/techage_reactor_plan.png b/techage/textures/techage_reactor_plan.png deleted file mode 100644 index 511e0af..0000000 Binary files a/techage/textures/techage_reactor_plan.png and /dev/null differ diff --git a/techage/textures/techage_reactor_shell.png b/techage/textures/techage_reactor_shell.png deleted file mode 100644 index 52165c9..0000000 Binary files a/techage/textures/techage_reactor_shell.png and /dev/null differ diff --git a/techage/textures/techage_reactor_side.png b/techage/textures/techage_reactor_side.png deleted file mode 100644 index 9ac7a53..0000000 Binary files a/techage/textures/techage_reactor_side.png and /dev/null differ diff --git a/techage/textures/techage_reactor_stand_back.png b/techage/textures/techage_reactor_stand_back.png deleted file mode 100644 index 7ed69ad..0000000 Binary files a/techage/textures/techage_reactor_stand_back.png and /dev/null differ diff --git a/techage/textures/techage_reactor_stand_bottom.png b/techage/textures/techage_reactor_stand_bottom.png deleted file mode 100644 index 459fb3c..0000000 Binary files a/techage/textures/techage_reactor_stand_bottom.png and /dev/null differ diff --git a/techage/textures/techage_reactor_stand_front.png b/techage/textures/techage_reactor_stand_front.png deleted file mode 100644 index e161ea0..0000000 Binary files a/techage/textures/techage_reactor_stand_front.png and /dev/null differ diff --git a/techage/textures/techage_reactor_stand_side.png b/techage/textures/techage_reactor_stand_side.png deleted file mode 100644 index 199c247..0000000 Binary files a/techage/textures/techage_reactor_stand_side.png and /dev/null differ diff --git a/techage/textures/techage_reactor_stand_top.png b/techage/textures/techage_reactor_stand_top.png deleted file mode 100644 index a287583..0000000 Binary files a/techage/textures/techage_reactor_stand_top.png and /dev/null differ diff --git a/techage/textures/techage_repairkit.png b/techage/textures/techage_repairkit.png deleted file mode 100644 index 35bba39..0000000 Binary files a/techage/textures/techage_repairkit.png and /dev/null differ diff --git a/techage/textures/techage_rope.png b/techage/textures/techage_rope.png deleted file mode 100644 index f20a831..0000000 Binary files a/techage/textures/techage_rope.png and /dev/null differ diff --git a/techage/textures/techage_rope_inv.png b/techage/textures/techage_rope_inv.png deleted file mode 100644 index 7d54ddf..0000000 Binary files a/techage/textures/techage_rope_inv.png and /dev/null differ diff --git a/techage/textures/techage_rotor.png b/techage/textures/techage_rotor.png deleted file mode 100644 index e334d1d..0000000 Binary files a/techage/textures/techage_rotor.png and /dev/null differ diff --git a/techage/textures/techage_rotor_blade.png b/techage/textures/techage_rotor_blade.png deleted file mode 100644 index aba770d..0000000 Binary files a/techage/textures/techage_rotor_blade.png and /dev/null differ diff --git a/techage/textures/techage_rotor_blades.png b/techage/textures/techage_rotor_blades.png deleted file mode 100644 index 70b5192..0000000 Binary files a/techage/textures/techage_rotor_blades.png and /dev/null differ diff --git a/techage/textures/techage_rotor_lamp_off.png b/techage/textures/techage_rotor_lamp_off.png deleted file mode 100644 index 742fe82..0000000 Binary files a/techage/textures/techage_rotor_lamp_off.png and /dev/null differ diff --git a/techage/textures/techage_rotor_lamp_on.png b/techage/textures/techage_rotor_lamp_on.png deleted file mode 100644 index acc0464..0000000 Binary files a/techage/textures/techage_rotor_lamp_on.png and /dev/null differ diff --git a/techage/textures/techage_rotor_top.png b/techage/textures/techage_rotor_top.png deleted file mode 100644 index 2d2372f..0000000 Binary files a/techage/textures/techage_rotor_top.png and /dev/null differ diff --git a/techage/textures/techage_round_ceramic.png b/techage/textures/techage_round_ceramic.png deleted file mode 100644 index 70d5dd6..0000000 Binary files a/techage/textures/techage_round_ceramic.png and /dev/null differ diff --git a/techage/textures/techage_screwdriver.png b/techage/textures/techage_screwdriver.png deleted file mode 100644 index e80ac2a..0000000 Binary files a/techage/textures/techage_screwdriver.png and /dev/null differ diff --git a/techage/textures/techage_server2_back.png b/techage/textures/techage_server2_back.png deleted file mode 100644 index c91583d..0000000 Binary files a/techage/textures/techage_server2_back.png and /dev/null differ diff --git a/techage/textures/techage_server2_front.png b/techage/textures/techage_server2_front.png deleted file mode 100644 index 973849e..0000000 Binary files a/techage/textures/techage_server2_front.png and /dev/null differ diff --git a/techage/textures/techage_server2_side.png b/techage/textures/techage_server2_side.png deleted file mode 100644 index 0887f4b..0000000 Binary files a/techage/textures/techage_server2_side.png and /dev/null differ diff --git a/techage/textures/techage_server2_top.png b/techage/textures/techage_server2_top.png deleted file mode 100644 index 46004c0..0000000 Binary files a/techage/textures/techage_server2_top.png and /dev/null differ diff --git a/techage/textures/techage_server_back.png b/techage/textures/techage_server_back.png deleted file mode 100644 index 66549c2..0000000 Binary files a/techage/textures/techage_server_back.png and /dev/null differ diff --git a/techage/textures/techage_server_front.png b/techage/textures/techage_server_front.png deleted file mode 100644 index bc7f2e8..0000000 Binary files a/techage/textures/techage_server_front.png and /dev/null differ diff --git a/techage/textures/techage_server_side.png b/techage/textures/techage_server_side.png deleted file mode 100644 index 51843c8..0000000 Binary files a/techage/textures/techage_server_side.png and /dev/null differ diff --git a/techage/textures/techage_server_top.png b/techage/textures/techage_server_top.png deleted file mode 100644 index 04093df..0000000 Binary files a/techage/textures/techage_server_top.png and /dev/null differ diff --git a/techage/textures/techage_sieve_gravel_ta1.png b/techage/textures/techage_sieve_gravel_ta1.png deleted file mode 100644 index 1d2a968..0000000 Binary files a/techage/textures/techage_sieve_gravel_ta1.png and /dev/null differ diff --git a/techage/textures/techage_sieve_sieve_ta1.png b/techage/textures/techage_sieve_sieve_ta1.png deleted file mode 100644 index 57c76b7..0000000 Binary files a/techage/textures/techage_sieve_sieve_ta1.png and /dev/null differ diff --git a/techage/textures/techage_sieve_top_ta1.png b/techage/textures/techage_sieve_top_ta1.png deleted file mode 100644 index 8dca866..0000000 Binary files a/techage/textures/techage_sieve_top_ta1.png and /dev/null differ diff --git a/techage/textures/techage_signal_lamp.png b/techage/textures/techage_signal_lamp.png deleted file mode 100644 index 326d874..0000000 Binary files a/techage/textures/techage_signal_lamp.png and /dev/null differ diff --git a/techage/textures/techage_signallamp2.png b/techage/textures/techage_signallamp2.png deleted file mode 100644 index 93d5f07..0000000 Binary files a/techage/textures/techage_signallamp2.png and /dev/null differ diff --git a/techage/textures/techage_signaltower.png b/techage/textures/techage_signaltower.png deleted file mode 100644 index daa794c..0000000 Binary files a/techage/textures/techage_signaltower.png and /dev/null differ diff --git a/techage/textures/techage_signaltower_amber.png b/techage/textures/techage_signaltower_amber.png deleted file mode 100644 index 2c432ef..0000000 Binary files a/techage/textures/techage_signaltower_amber.png and /dev/null differ diff --git a/techage/textures/techage_signaltower_green.png b/techage/textures/techage_signaltower_green.png deleted file mode 100644 index 6bd40d5..0000000 Binary files a/techage/textures/techage_signaltower_green.png and /dev/null differ diff --git a/techage/textures/techage_signaltower_red.png b/techage/textures/techage_signaltower_red.png deleted file mode 100644 index 14f1f0b..0000000 Binary files a/techage/textures/techage_signaltower_red.png and /dev/null differ diff --git a/techage/textures/techage_signaltower_top.png b/techage/textures/techage_signaltower_top.png deleted file mode 100644 index a4c7b81..0000000 Binary files a/techage/textures/techage_signaltower_top.png and /dev/null differ diff --git a/techage/textures/techage_silicon_wafer.png b/techage/textures/techage_silicon_wafer.png deleted file mode 100644 index 261e9de..0000000 Binary files a/techage/textures/techage_silicon_wafer.png and /dev/null differ diff --git a/techage/textures/techage_sluice1_inv.png b/techage/textures/techage_sluice1_inv.png deleted file mode 100644 index 201f742..0000000 Binary files a/techage/textures/techage_sluice1_inv.png and /dev/null differ diff --git a/techage/textures/techage_sluice2_inv.png b/techage/textures/techage_sluice2_inv.png deleted file mode 100644 index 80a4cb1..0000000 Binary files a/techage/textures/techage_sluice2_inv.png and /dev/null differ diff --git a/techage/textures/techage_smart_button_inventory.png b/techage/textures/techage_smart_button_inventory.png deleted file mode 100644 index fc1976a..0000000 Binary files a/techage/textures/techage_smart_button_inventory.png and /dev/null differ diff --git a/techage/textures/techage_smart_button_off.png b/techage/textures/techage_smart_button_off.png deleted file mode 100644 index 757961a..0000000 Binary files a/techage/textures/techage_smart_button_off.png and /dev/null differ diff --git a/techage/textures/techage_smart_button_on.png b/techage/textures/techage_smart_button_on.png deleted file mode 100644 index 3d25ae5..0000000 Binary files a/techage/textures/techage_smart_button_on.png and /dev/null differ diff --git a/techage/textures/techage_smartline.png b/techage/textures/techage_smartline.png deleted file mode 100644 index e009a78..0000000 Binary files a/techage/textures/techage_smartline.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_2x.png b/techage/textures/techage_smartline_button_2x.png deleted file mode 100644 index aaa73df..0000000 Binary files a/techage/textures/techage_smartline_button_2x.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_4x.png b/techage/textures/techage_smartline_button_4x.png deleted file mode 100644 index 5bc5286..0000000 Binary files a/techage/textures/techage_smartline_button_4x.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_4x_on1.png b/techage/textures/techage_smartline_button_4x_on1.png deleted file mode 100644 index 95d27e3..0000000 Binary files a/techage/textures/techage_smartline_button_4x_on1.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_4x_on2.png b/techage/textures/techage_smartline_button_4x_on2.png deleted file mode 100644 index 34cad03..0000000 Binary files a/techage/textures/techage_smartline_button_4x_on2.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_4x_on3.png b/techage/textures/techage_smartline_button_4x_on3.png deleted file mode 100644 index e587ed6..0000000 Binary files a/techage/textures/techage_smartline_button_4x_on3.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_4x_on4.png b/techage/textures/techage_smartline_button_4x_on4.png deleted file mode 100644 index 1f6c6c2..0000000 Binary files a/techage/textures/techage_smartline_button_4x_on4.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_inv.png b/techage/textures/techage_smartline_button_inv.png deleted file mode 100644 index 97ff12d..0000000 Binary files a/techage/textures/techage_smartline_button_inv.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_off.png b/techage/textures/techage_smartline_button_off.png deleted file mode 100644 index e5dec3d..0000000 Binary files a/techage/textures/techage_smartline_button_off.png and /dev/null differ diff --git a/techage/textures/techage_smartline_button_on.png b/techage/textures/techage_smartline_button_on.png deleted file mode 100644 index 5fa41a8..0000000 Binary files a/techage/textures/techage_smartline_button_on.png and /dev/null differ diff --git a/techage/textures/techage_smartline_collector.png b/techage/textures/techage_smartline_collector.png deleted file mode 100644 index c3a32fc..0000000 Binary files a/techage/textures/techage_smartline_collector.png and /dev/null differ diff --git a/techage/textures/techage_smartline_collector_inv.png b/techage/textures/techage_smartline_collector_inv.png deleted file mode 100644 index 5cb5f1f..0000000 Binary files a/techage/textures/techage_smartline_collector_inv.png and /dev/null differ diff --git a/techage/textures/techage_smartline_detector.png b/techage/textures/techage_smartline_detector.png deleted file mode 100644 index 4ce63e4..0000000 Binary files a/techage/textures/techage_smartline_detector.png and /dev/null differ diff --git a/techage/textures/techage_smartline_detector_inv.png b/techage/textures/techage_smartline_detector_inv.png deleted file mode 100644 index 3f33f96..0000000 Binary files a/techage/textures/techage_smartline_detector_inv.png and /dev/null differ diff --git a/techage/textures/techage_smartline_detector_on.png b/techage/textures/techage_smartline_detector_on.png deleted file mode 100644 index 1d4cc93..0000000 Binary files a/techage/textures/techage_smartline_detector_on.png and /dev/null differ diff --git a/techage/textures/techage_smartline_mba_detector.png b/techage/textures/techage_smartline_mba_detector.png deleted file mode 100644 index 660fe10..0000000 Binary files a/techage/textures/techage_smartline_mba_detector.png and /dev/null differ diff --git a/techage/textures/techage_smartline_mba_detector_inv.png b/techage/textures/techage_smartline_mba_detector_inv.png deleted file mode 100644 index dc681b6..0000000 Binary files a/techage/textures/techage_smartline_mba_detector_inv.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_2x.png b/techage/textures/techage_smartline_signal_2x.png deleted file mode 100644 index 7d0e633..0000000 Binary files a/techage/textures/techage_smartline_signal_2x.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_4x.png b/techage/textures/techage_smartline_signal_4x.png deleted file mode 100644 index ec3e9fc..0000000 Binary files a/techage/textures/techage_smartline_signal_4x.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_amber1.png b/techage/textures/techage_smartline_signal_amber1.png deleted file mode 100644 index ff3d5e7..0000000 Binary files a/techage/textures/techage_smartline_signal_amber1.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_amber2.png b/techage/textures/techage_smartline_signal_amber2.png deleted file mode 100644 index fb9df3d..0000000 Binary files a/techage/textures/techage_smartline_signal_amber2.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_amber3.png b/techage/textures/techage_smartline_signal_amber3.png deleted file mode 100644 index da5f91e..0000000 Binary files a/techage/textures/techage_smartline_signal_amber3.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_amber4.png b/techage/textures/techage_smartline_signal_amber4.png deleted file mode 100644 index 3267c8f..0000000 Binary files a/techage/textures/techage_smartline_signal_amber4.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_green1.png b/techage/textures/techage_smartline_signal_green1.png deleted file mode 100644 index df07eb2..0000000 Binary files a/techage/textures/techage_smartline_signal_green1.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_green2.png b/techage/textures/techage_smartline_signal_green2.png deleted file mode 100644 index 34685ec..0000000 Binary files a/techage/textures/techage_smartline_signal_green2.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_green3.png b/techage/textures/techage_smartline_signal_green3.png deleted file mode 100644 index 956cc49..0000000 Binary files a/techage/textures/techage_smartline_signal_green3.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_green4.png b/techage/textures/techage_smartline_signal_green4.png deleted file mode 100644 index 08c0efe..0000000 Binary files a/techage/textures/techage_smartline_signal_green4.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_off1.png b/techage/textures/techage_smartline_signal_off1.png deleted file mode 100644 index edabb43..0000000 Binary files a/techage/textures/techage_smartline_signal_off1.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_off2.png b/techage/textures/techage_smartline_signal_off2.png deleted file mode 100644 index 2065fa4..0000000 Binary files a/techage/textures/techage_smartline_signal_off2.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_off3.png b/techage/textures/techage_smartline_signal_off3.png deleted file mode 100644 index 451bff0..0000000 Binary files a/techage/textures/techage_smartline_signal_off3.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_off4.png b/techage/textures/techage_smartline_signal_off4.png deleted file mode 100644 index 1ffcbac..0000000 Binary files a/techage/textures/techage_smartline_signal_off4.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_red1.png b/techage/textures/techage_smartline_signal_red1.png deleted file mode 100644 index 64bc5eb..0000000 Binary files a/techage/textures/techage_smartline_signal_red1.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_red2.png b/techage/textures/techage_smartline_signal_red2.png deleted file mode 100644 index 714d806..0000000 Binary files a/techage/textures/techage_smartline_signal_red2.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_red3.png b/techage/textures/techage_smartline_signal_red3.png deleted file mode 100644 index 38b8b99..0000000 Binary files a/techage/textures/techage_smartline_signal_red3.png and /dev/null differ diff --git a/techage/textures/techage_smartline_signal_red4.png b/techage/textures/techage_smartline_signal_red4.png deleted file mode 100644 index 7220fb5..0000000 Binary files a/techage/textures/techage_smartline_signal_red4.png and /dev/null differ diff --git a/techage/textures/techage_smoke.png b/techage/textures/techage_smoke.png deleted file mode 100644 index 344982c..0000000 Binary files a/techage/textures/techage_smoke.png and /dev/null differ diff --git a/techage/textures/techage_solar_cell_mini_bottom.png b/techage/textures/techage_solar_cell_mini_bottom.png deleted file mode 100644 index a09c461..0000000 Binary files a/techage/textures/techage_solar_cell_mini_bottom.png and /dev/null differ diff --git a/techage/textures/techage_solar_cell_mini_side.png b/techage/textures/techage_solar_cell_mini_side.png deleted file mode 100644 index 5cd0274..0000000 Binary files a/techage/textures/techage_solar_cell_mini_side.png and /dev/null differ diff --git a/techage/textures/techage_solar_cell_mini_top.png b/techage/textures/techage_solar_cell_mini_top.png deleted file mode 100644 index aef9de1..0000000 Binary files a/techage/textures/techage_solar_cell_mini_top.png and /dev/null differ diff --git a/techage/textures/techage_solar_module_bottom.png b/techage/textures/techage_solar_module_bottom.png deleted file mode 100644 index d3ed8ff..0000000 Binary files a/techage/textures/techage_solar_module_bottom.png and /dev/null differ diff --git a/techage/textures/techage_solar_module_inv.png b/techage/textures/techage_solar_module_inv.png deleted file mode 100644 index aa9e3d0..0000000 Binary files a/techage/textures/techage_solar_module_inv.png and /dev/null differ diff --git a/techage/textures/techage_solar_module_top.png b/techage/textures/techage_solar_module_top.png deleted file mode 100644 index ca80dbf..0000000 Binary files a/techage/textures/techage_solar_module_top.png and /dev/null differ diff --git a/techage/textures/techage_steam_hole.png b/techage/textures/techage_steam_hole.png deleted file mode 100644 index 8a4132a..0000000 Binary files a/techage/textures/techage_steam_hole.png and /dev/null differ diff --git a/techage/textures/techage_steam_hole2.png b/techage/textures/techage_steam_hole2.png deleted file mode 100644 index 4181ce5..0000000 Binary files a/techage/textures/techage_steam_hole2.png and /dev/null differ diff --git a/techage/textures/techage_steam_knee.png b/techage/textures/techage_steam_knee.png deleted file mode 100644 index 27b2738..0000000 Binary files a/techage/textures/techage_steam_knee.png and /dev/null differ diff --git a/techage/textures/techage_steam_knee2.png b/techage/textures/techage_steam_knee2.png deleted file mode 100644 index 5dcd9d9..0000000 Binary files a/techage/textures/techage_steam_knee2.png and /dev/null differ diff --git a/techage/textures/techage_steam_pipe.png b/techage/textures/techage_steam_pipe.png deleted file mode 100644 index da965cf..0000000 Binary files a/techage/textures/techage_steam_pipe.png and /dev/null differ diff --git a/techage/textures/techage_steel_tiles.png b/techage/textures/techage_steel_tiles.png deleted file mode 100644 index 21a25cd..0000000 Binary files a/techage/textures/techage_steel_tiles.png and /dev/null differ diff --git a/techage/textures/techage_steel_tiles_side.png b/techage/textures/techage_steel_tiles_side.png deleted file mode 100644 index 59fb186..0000000 Binary files a/techage/textures/techage_steel_tiles_side.png and /dev/null differ diff --git a/techage/textures/techage_steel_tiles_top.png b/techage/textures/techage_steel_tiles_top.png deleted file mode 100644 index 95f1cf5..0000000 Binary files a/techage/textures/techage_steel_tiles_top.png and /dev/null differ diff --git a/techage/textures/techage_steel_tiles_top2.png b/techage/textures/techage_steel_tiles_top2.png deleted file mode 100644 index f5e2e7e..0000000 Binary files a/techage/textures/techage_steel_tiles_top2.png and /dev/null differ diff --git a/techage/textures/techage_steel_tiles_top3.png b/techage/textures/techage_steel_tiles_top3.png deleted file mode 100644 index 3eb4c8a..0000000 Binary files a/techage/textures/techage_steel_tiles_top3.png and /dev/null differ diff --git a/techage/textures/techage_steelmat.png b/techage/textures/techage_steelmat.png deleted file mode 100644 index 06b1571..0000000 Binary files a/techage/textures/techage_steelmat.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp.png b/techage/textures/techage_streetlamp.png deleted file mode 100644 index 22c7147..0000000 Binary files a/techage/textures/techage_streetlamp.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp2_housing.png b/techage/textures/techage_streetlamp2_housing.png deleted file mode 100644 index 8cb3dcd..0000000 Binary files a/techage/textures/techage_streetlamp2_housing.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp2_housing_on.png b/techage/textures/techage_streetlamp2_housing_on.png deleted file mode 100644 index b7b5873..0000000 Binary files a/techage/textures/techage_streetlamp2_housing_on.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp2_off.png b/techage/textures/techage_streetlamp2_off.png deleted file mode 100644 index 9af136f..0000000 Binary files a/techage/textures/techage_streetlamp2_off.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp2_on.png b/techage/textures/techage_streetlamp2_on.png deleted file mode 100644 index febb593..0000000 Binary files a/techage/textures/techage_streetlamp2_on.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp_off.png b/techage/textures/techage_streetlamp_off.png deleted file mode 100644 index 32fc650..0000000 Binary files a/techage/textures/techage_streetlamp_off.png and /dev/null differ diff --git a/techage/textures/techage_streetlamp_top.png b/techage/textures/techage_streetlamp_top.png deleted file mode 100644 index 3584f5a..0000000 Binary files a/techage/textures/techage_streetlamp_top.png and /dev/null differ diff --git a/techage/textures/techage_symbol_liquid.png b/techage/textures/techage_symbol_liquid.png deleted file mode 100644 index 4e0ff52..0000000 Binary files a/techage/textures/techage_symbol_liquid.png and /dev/null differ diff --git a/techage/textures/techage_symbol_powder.png b/techage/textures/techage_symbol_powder.png deleted file mode 100644 index ced8098..0000000 Binary files a/techage/textures/techage_symbol_powder.png and /dev/null differ diff --git a/techage/textures/techage_ta1.png b/techage/textures/techage_ta1.png deleted file mode 100644 index 8b436e8..0000000 Binary files a/techage/textures/techage_ta1.png and /dev/null differ diff --git a/techage/textures/techage_ta2.png b/techage/textures/techage_ta2.png deleted file mode 100644 index fa64e0c..0000000 Binary files a/techage/textures/techage_ta2.png and /dev/null differ diff --git a/techage/textures/techage_ta3.png b/techage/textures/techage_ta3.png deleted file mode 100644 index e61e01e..0000000 Binary files a/techage/textures/techage_ta3.png and /dev/null differ diff --git a/techage/textures/techage_ta3b.png b/techage/textures/techage_ta3b.png deleted file mode 100644 index 24cf11e..0000000 Binary files a/techage/textures/techage_ta3b.png and /dev/null differ diff --git a/techage/textures/techage_ta4.png b/techage/textures/techage_ta4.png deleted file mode 100644 index b398516..0000000 Binary files a/techage/textures/techage_ta4.png and /dev/null differ diff --git a/techage/textures/techage_ta4_cable.png b/techage/textures/techage_ta4_cable.png deleted file mode 100644 index 62fb955..0000000 Binary files a/techage/textures/techage_ta4_cable.png and /dev/null differ diff --git a/techage/textures/techage_ta4_cable_end.png b/techage/textures/techage_ta4_cable_end.png deleted file mode 100644 index 82d329e..0000000 Binary files a/techage/textures/techage_ta4_cable_end.png and /dev/null differ diff --git a/techage/textures/techage_ta4_cable_hole.png b/techage/textures/techage_ta4_cable_hole.png deleted file mode 100644 index f936c9c..0000000 Binary files a/techage/textures/techage_ta4_cable_hole.png and /dev/null differ diff --git a/techage/textures/techage_ta4_cable_inv.png b/techage/textures/techage_ta4_cable_inv.png deleted file mode 100644 index 38753eb..0000000 Binary files a/techage/textures/techage_ta4_cable_inv.png and /dev/null differ diff --git a/techage/textures/techage_ta4_controller.png b/techage/textures/techage_ta4_controller.png deleted file mode 100644 index 9fb3ab3..0000000 Binary files a/techage/textures/techage_ta4_controller.png and /dev/null differ diff --git a/techage/textures/techage_ta4_controller_inventory.png b/techage/textures/techage_ta4_controller_inventory.png deleted file mode 100644 index eb92d12..0000000 Binary files a/techage/textures/techage_ta4_controller_inventory.png and /dev/null differ diff --git a/techage/textures/techage_ta4_filter.png b/techage/textures/techage_ta4_filter.png deleted file mode 100644 index 90ca758..0000000 Binary files a/techage/textures/techage_ta4_filter.png and /dev/null differ diff --git a/techage/textures/techage_ta4_junctionbox_side.png b/techage/textures/techage_ta4_junctionbox_side.png deleted file mode 100644 index f91e72f..0000000 Binary files a/techage/textures/techage_ta4_junctionbox_side.png and /dev/null differ diff --git a/techage/textures/techage_ta4_junctionbox_top.png b/techage/textures/techage_ta4_junctionbox_top.png deleted file mode 100644 index b564c01..0000000 Binary files a/techage/textures/techage_ta4_junctionbox_top.png and /dev/null differ diff --git a/techage/textures/techage_ta4_solar.png b/techage/textures/techage_ta4_solar.png deleted file mode 100644 index ea9d118..0000000 Binary files a/techage/textures/techage_ta4_solar.png and /dev/null differ diff --git a/techage/textures/techage_ta4_streetlamp.png b/techage/textures/techage_ta4_streetlamp.png deleted file mode 100644 index 2e18a08..0000000 Binary files a/techage/textures/techage_ta4_streetlamp.png and /dev/null differ diff --git a/techage/textures/techage_ta4_tes.png b/techage/textures/techage_ta4_tes.png deleted file mode 100644 index 240cc96..0000000 Binary files a/techage/textures/techage_ta4_tes.png and /dev/null differ diff --git a/techage/textures/techage_ta4c.png b/techage/textures/techage_ta4c.png deleted file mode 100644 index 6ce1a9f..0000000 Binary files a/techage/textures/techage_ta4c.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe.png b/techage/textures/techage_ta5_gaspipe.png deleted file mode 100644 index 7f9106d..0000000 Binary files a/techage/textures/techage_ta5_gaspipe.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipeB.png b/techage/textures/techage_ta5_gaspipeB.png deleted file mode 100644 index 17659c4..0000000 Binary files a/techage/textures/techage_ta5_gaspipeB.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe_hole.png b/techage/textures/techage_ta5_gaspipe_hole.png deleted file mode 100644 index 821059d..0000000 Binary files a/techage/textures/techage_ta5_gaspipe_hole.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe_hole2.png b/techage/textures/techage_ta5_gaspipe_hole2.png deleted file mode 100644 index 9097b83..0000000 Binary files a/techage/textures/techage_ta5_gaspipe_hole2.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe_junction.png b/techage/textures/techage_ta5_gaspipe_junction.png deleted file mode 100644 index f5c44ad..0000000 Binary files a/techage/textures/techage_ta5_gaspipe_junction.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe_knee.png b/techage/textures/techage_ta5_gaspipe_knee.png deleted file mode 100644 index bafe337..0000000 Binary files a/techage/textures/techage_ta5_gaspipe_knee.png and /dev/null differ diff --git a/techage/textures/techage_ta5_gaspipe_knee2.png b/techage/textures/techage_ta5_gaspipe_knee2.png deleted file mode 100644 index d0ea469..0000000 Binary files a/techage/textures/techage_ta5_gaspipe_knee2.png and /dev/null differ diff --git a/techage/textures/techage_tank_cart_bottom.png b/techage/textures/techage_tank_cart_bottom.png deleted file mode 100644 index 7aa750f..0000000 Binary files a/techage/textures/techage_tank_cart_bottom.png and /dev/null differ diff --git a/techage/textures/techage_tank_cart_front.png b/techage/textures/techage_tank_cart_front.png deleted file mode 100644 index a2dab4a..0000000 Binary files a/techage/textures/techage_tank_cart_front.png and /dev/null differ diff --git a/techage/textures/techage_tank_cart_side.png b/techage/textures/techage_tank_cart_side.png deleted file mode 100644 index 70f253d..0000000 Binary files a/techage/textures/techage_tank_cart_side.png and /dev/null differ diff --git a/techage/textures/techage_tank_cart_top.png b/techage/textures/techage_tank_cart_top.png deleted file mode 100644 index 5cb4f8e..0000000 Binary files a/techage/textures/techage_tank_cart_top.png and /dev/null differ diff --git a/techage/textures/techage_terminal1_bottom.png b/techage/textures/techage_terminal1_bottom.png deleted file mode 100644 index b4e0c66..0000000 Binary files a/techage/textures/techage_terminal1_bottom.png and /dev/null differ diff --git a/techage/textures/techage_terminal1_front.png b/techage/textures/techage_terminal1_front.png deleted file mode 100644 index cf84486..0000000 Binary files a/techage/textures/techage_terminal1_front.png and /dev/null differ diff --git a/techage/textures/techage_terminal1_side.png b/techage/textures/techage_terminal1_side.png deleted file mode 100644 index 5bc0a53..0000000 Binary files a/techage/textures/techage_terminal1_side.png and /dev/null differ diff --git a/techage/textures/techage_terminal1_top.png b/techage/textures/techage_terminal1_top.png deleted file mode 100644 index cd25c33..0000000 Binary files a/techage/textures/techage_terminal1_top.png and /dev/null differ diff --git a/techage/textures/techage_terminal2_back.png b/techage/textures/techage_terminal2_back.png deleted file mode 100644 index 481cd25..0000000 Binary files a/techage/textures/techage_terminal2_back.png and /dev/null differ diff --git a/techage/textures/techage_terminal2_front.png b/techage/textures/techage_terminal2_front.png deleted file mode 100644 index 7239366..0000000 Binary files a/techage/textures/techage_terminal2_front.png and /dev/null differ diff --git a/techage/textures/techage_terminal2_side.png b/techage/textures/techage_terminal2_side.png deleted file mode 100644 index 91f8c04..0000000 Binary files a/techage/textures/techage_terminal2_side.png and /dev/null differ diff --git a/techage/textures/techage_terminal2_top.png b/techage/textures/techage_terminal2_top.png deleted file mode 100644 index c67ac2f..0000000 Binary files a/techage/textures/techage_terminal2_top.png and /dev/null differ diff --git a/techage/textures/techage_tes_inlet.png b/techage/textures/techage_tes_inlet.png deleted file mode 100644 index 89f0b7d..0000000 Binary files a/techage/textures/techage_tes_inlet.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_bronze.png b/techage/textures/techage_tool_hammer_bronze.png deleted file mode 100644 index 65ebfbc..0000000 Binary files a/techage/textures/techage_tool_hammer_bronze.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_diamond.png b/techage/textures/techage_tool_hammer_diamond.png deleted file mode 100644 index 3721d62..0000000 Binary files a/techage/textures/techage_tool_hammer_diamond.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_meridium.png b/techage/textures/techage_tool_hammer_meridium.png deleted file mode 100644 index 3fabe0c..0000000 Binary files a/techage/textures/techage_tool_hammer_meridium.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_mese.png b/techage/textures/techage_tool_hammer_mese.png deleted file mode 100644 index 291e9c8..0000000 Binary files a/techage/textures/techage_tool_hammer_mese.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_steel.png b/techage/textures/techage_tool_hammer_steel.png deleted file mode 100644 index 7a8fd95..0000000 Binary files a/techage/textures/techage_tool_hammer_steel.png and /dev/null differ diff --git a/techage/textures/techage_tool_hammer_stone.png b/techage/textures/techage_tool_hammer_stone.png deleted file mode 100644 index f99cde3..0000000 Binary files a/techage/textures/techage_tool_hammer_stone.png and /dev/null differ diff --git a/techage/textures/techage_top_ta4.png b/techage/textures/techage_top_ta4.png deleted file mode 100644 index f05c057..0000000 Binary files a/techage/textures/techage_top_ta4.png and /dev/null differ diff --git a/techage/textures/techage_trafo.png b/techage/textures/techage_trafo.png deleted file mode 100644 index 0d9d49a..0000000 Binary files a/techage/textures/techage_trafo.png and /dev/null differ diff --git a/techage/textures/techage_trowel.png b/techage/textures/techage_trowel.png deleted file mode 100644 index 11d7941..0000000 Binary files a/techage/textures/techage_trowel.png and /dev/null differ diff --git a/techage/textures/techage_tube_hole.png b/techage/textures/techage_tube_hole.png deleted file mode 100644 index 6d61205..0000000 Binary files a/techage/textures/techage_tube_hole.png and /dev/null differ diff --git a/techage/textures/techage_tube_hole2.png b/techage/textures/techage_tube_hole2.png deleted file mode 100644 index f890046..0000000 Binary files a/techage/textures/techage_tube_hole2.png and /dev/null differ diff --git a/techage/textures/techage_tube_junction.png b/techage/textures/techage_tube_junction.png deleted file mode 100644 index 433d2e8..0000000 Binary files a/techage/textures/techage_tube_junction.png and /dev/null differ diff --git a/techage/textures/techage_tube_knee.png b/techage/textures/techage_tube_knee.png deleted file mode 100644 index 935d75e..0000000 Binary files a/techage/textures/techage_tube_knee.png and /dev/null differ diff --git a/techage/textures/techage_tube_knee2.png b/techage/textures/techage_tube_knee2.png deleted file mode 100644 index 50b3205..0000000 Binary files a/techage/textures/techage_tube_knee2.png and /dev/null differ diff --git a/techage/textures/techage_tube_tube.png b/techage/textures/techage_tube_tube.png deleted file mode 100644 index 72b8602..0000000 Binary files a/techage/textures/techage_tube_tube.png and /dev/null differ diff --git a/techage/textures/techage_tubeta4_hole2.png b/techage/textures/techage_tubeta4_hole2.png deleted file mode 100644 index be5004d..0000000 Binary files a/techage/textures/techage_tubeta4_hole2.png and /dev/null differ diff --git a/techage/textures/techage_tubeta4_junction.png b/techage/textures/techage_tubeta4_junction.png deleted file mode 100644 index 0c27a9d..0000000 Binary files a/techage/textures/techage_tubeta4_junction.png and /dev/null differ diff --git a/techage/textures/techage_tubeta4_knee.png b/techage/textures/techage_tubeta4_knee.png deleted file mode 100644 index 2aff9c9..0000000 Binary files a/techage/textures/techage_tubeta4_knee.png and /dev/null differ diff --git a/techage/textures/techage_tubeta4_knee2.png b/techage/textures/techage_tubeta4_knee2.png deleted file mode 100644 index 983a79e..0000000 Binary files a/techage/textures/techage_tubeta4_knee2.png and /dev/null differ diff --git a/techage/textures/techage_tubeta4_tube.png b/techage/textures/techage_tubeta4_tube.png deleted file mode 100644 index ba51f73..0000000 Binary files a/techage/textures/techage_tubeta4_tube.png and /dev/null differ diff --git a/techage/textures/techage_usmium_nuggets.png b/techage/textures/techage_usmium_nuggets.png deleted file mode 100644 index 929068f..0000000 Binary files a/techage/textures/techage_usmium_nuggets.png and /dev/null differ diff --git a/techage/textures/techage_vacuum_tube.png b/techage/textures/techage_vacuum_tube.png deleted file mode 100644 index 146e9be..0000000 Binary files a/techage/textures/techage_vacuum_tube.png and /dev/null differ diff --git a/techage/textures/techage_water_flowing.png b/techage/textures/techage_water_flowing.png deleted file mode 100644 index 718d334..0000000 Binary files a/techage/textures/techage_water_flowing.png and /dev/null differ diff --git a/techage/textures/techage_watermill1_inv.png b/techage/textures/techage_watermill1_inv.png deleted file mode 100644 index b7f26fc..0000000 Binary files a/techage/textures/techage_watermill1_inv.png and /dev/null differ diff --git a/techage/textures/techage_watermill2_inv.png b/techage/textures/techage_watermill2_inv.png deleted file mode 100644 index 9d917ac..0000000 Binary files a/techage/textures/techage_watermill2_inv.png and /dev/null differ diff --git a/techage/textures/techage_watermill3_inv.png b/techage/textures/techage_watermill3_inv.png deleted file mode 100644 index e58e307..0000000 Binary files a/techage/textures/techage_watermill3_inv.png and /dev/null differ diff --git a/techage/textures/techage_watermill4_inv.png b/techage/textures/techage_watermill4_inv.png deleted file mode 100644 index 8198c86..0000000 Binary files a/techage/textures/techage_watermill4_inv.png and /dev/null differ diff --git a/techage/textures/techage_weight_bottom.png b/techage/textures/techage_weight_bottom.png deleted file mode 100644 index be4db17..0000000 Binary files a/techage/textures/techage_weight_bottom.png and /dev/null differ diff --git a/techage/textures/techage_weight_side.png b/techage/textures/techage_weight_side.png deleted file mode 100644 index 1f07d4f..0000000 Binary files a/techage/textures/techage_weight_side.png and /dev/null differ diff --git a/techage/textures/techage_wind_turbine_inv.png b/techage/textures/techage_wind_turbine_inv.png deleted file mode 100644 index f589768..0000000 Binary files a/techage/textures/techage_wind_turbine_inv.png and /dev/null differ diff --git a/techage/textures/techage_wlanchip.png b/techage/textures/techage_wlanchip.png deleted file mode 100644 index 9ebe01c..0000000 Binary files a/techage/textures/techage_wlanchip.png and /dev/null differ diff --git a/techage/textures/techage_wood50.png b/techage/textures/techage_wood50.png deleted file mode 100644 index 18914f2..0000000 Binary files a/techage/textures/techage_wood50.png and /dev/null differ diff --git a/techage/tools/assembly_tool.lua b/techage/tools/assembly_tool.lua deleted file mode 100644 index 7378d9d..0000000 --- a/techage/tools/assembly_tool.lua +++ /dev/null @@ -1,198 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end - -local InvalidBlocks = {} - -local function base_checks(user, pointed_thing, place) - if pointed_thing.type ~= "node" then - return false - end - - if not user then - return false - end - - local pos = place and pointed_thing.above or pointed_thing.under - local player_name = user:get_player_name() - - if minetest.is_protected(pos, player_name) then - return false - end - - return true, pos, player_name -end - ----------------------------------------------------------------------------- -local function add_to_inventory(pos, item, user) - local inv = user:get_inventory() - if inv and item and inv:room_for_item("main", item) then - inv:add_item("main", item) - else - minetest.item_drop(item, user, pos) - end -end - -local function take_from_inventory(user) - local inv = user:get_inventory() - local stack = inv:get_stack("main", 1) - local taken = stack:take_item(1) - - if taken:get_count() == 1 then - local imeta = taken:get_meta() - if imeta:get_string("node_number") ~= "" then - inv:set_stack("main", 1, stack) - return taken - end - end -end - ------------------------------------------------------------------------------ -local function remove_node(pos, digger) - local node = minetest.get_node(pos) - local number = M(pos):get_string("node_number") - local item = ItemStack(node.name) - local imeta = item:get_meta() - local ndef = minetest.registered_nodes[node.name] - local oldmetadata = minetest.get_meta(pos):to_table() - - if InvalidBlocks[node.name] then - return - end - - if ndef.can_dig and not ndef.can_dig(pos, digger) then - return - end - - if ndef and ndef.preserve_nodedata then - local s = ndef.preserve_nodedata(pos, node) - imeta:set_string("node_data", s) - minetest.remove_node(pos) - if ndef.after_dig_node then - ndef.after_dig_node(pos, node, oldmetadata, digger) - end - if number ~= "" then - techage.post_remove_node(pos) - imeta:set_string("node_number", number) - imeta:set_string("description", ndef.description .. " : " .. number) - else - imeta:set_string("description", ndef.description .. " (preserved)") - end - return item - elseif number ~= "" and ndef and ndef.after_dig_node then - minetest.remove_node(pos) - ndef.after_dig_node(pos, node, oldmetadata, digger) - techage.post_remove_node(pos) - imeta:set_string("node_number", number) - imeta:set_string("description", ndef.description .. " : " .. number) - return item - end -end - -local function place_node(pos, item, placer, pointed_thing) - local imeta = item:get_meta() - local number = imeta:get_string("node_number") - local name = item:get_name() - local param2 = minetest.dir_to_facedir(placer:get_look_dir()) - local ndef = minetest.registered_nodes[name] - - if ndef and ndef.restore_nodedata then - if number ~= "" then - techage.pre_add_node(pos, number) - end - minetest.add_node(pos, {name = name, param2 = param2}) - local s = imeta:get_string("node_data") - ndef.restore_nodedata(pos, s) - return true - elseif number ~= "" and ndef and ndef.after_place_node then - techage.pre_add_node(pos, number) - minetest.add_node(pos, {name = name, param2 = param2}) - ndef.after_place_node(pos, placer, item, pointed_thing) - return true - end -end - ----------------------------------------------------------------------------- -local function on_place_node(itemstack, pos, user, player_name, pointed_thing) - local item = take_from_inventory(user) - if item then - if place_node(pos, item, user, pointed_thing) then - itemstack:add_wear(65636/200) - minetest.sound_play("techage_tool2", { - pos = pos, - gain = 1, - max_hear_distance = 10}) - return itemstack - else - add_to_inventory(pos, item, user) - end - end -end - -local function on_remove_node(itemstack, pos, user, player_name) - local item = remove_node(pos, user) - if item then - add_to_inventory(pos, item, user) - itemstack:add_wear(65636/200) - minetest.sound_play("techage_tool1", { - pos = pos, - gain = 1, - max_hear_distance = 10}) - end - return itemstack -end - ----------------------------------------------------------------------------- -local function on_place(itemstack, user, pointed_thing) - local res, pos, player_name = base_checks(user, pointed_thing, true) - if res then - return on_place_node(itemstack, pos, user, player_name, pointed_thing) - end -end - -local function on_use(itemstack, user, pointed_thing) - local res, pos, player_name = base_checks(user, pointed_thing, false) - if res then - return on_remove_node(itemstack, pos, user, player_name) - end -end - ----------------------------------------------------------------------------- -minetest.register_tool("techage:assembly_tool", { - description = S("TechAge Assembly Tool"), - inventory_image = "techage_repairkit.png", - wield_image = "techage_repairkit.png^[transformR270", - groups = {cracky=1, book=1}, - on_use = on_use, - on_place = on_place, - node_placement_prediction = "", - stack_max = 1, -}) - -minetest.register_craft({ - output = "techage:assembly_tool", - recipe = { - {"", "techage:screwdriver", ""}, - {"basic_materials:plastic_sheet", "basic_materials:plastic_strip", "basic_materials:plastic_sheet"}, - {"", "techage:end_wrench", ""}, - }, -}) - -minetest.register_alias("techage:repairkit", "techage:assembly_tool") - -function techage.disable_block_for_assembly_tool(block_name) - InvalidBlocks[block_name] = true -end diff --git a/techage/tools/end_wrench.lua b/techage/tools/end_wrench.lua deleted file mode 100644 index 23e683c..0000000 --- a/techage/tools/end_wrench.lua +++ /dev/null @@ -1,244 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2017-2023 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local Cable1 = techage.ElectricCable -local Cable2 = techage.TA4_Cable -local Pipe2 = techage.LiquidPipe -local menu = techage.menu - -local N = techage.get_node_lvm -local CTL = function(pos) return (minetest.registered_nodes[N(pos).name] or {}).control end - -local function network_check(start_pos, Cable, player_name) --- local ndef = techage.networks.net_def(start_pos, Cable.tube_type) --- local outdir = nil --- local num = 0 --- if ndef and ndef.ntype ~= "junc" then --- outdir = M(start_pos):get_int("outdir") --- end --- networks.connection_walk(start_pos, outdir, Cable, function(pos, indir, node) --- local distance = vector.distance(start_pos, pos) --- num = num + 1 --- if distance < 50 and num < 100 then --- local state = techage.power.power_available(pos, Cable) and "power" or "no power" --- techage.mark_position(player_name, pos, state, "#ff0000", 6) --- end --- end) -end - -local function read_state(itemstack, user, pointed_thing) - local pos = pointed_thing.under - if pos and user then - local time = math.floor(minetest.get_timeofday() * 24 * 6) - local hours = math.floor(time / 6) - local mins = (time % 6) * 10 - if mins < 10 then mins = "00" end - - local number = techage.get_node_number(pos) - local node = minetest.get_node(pos) - local ndef = minetest.registered_nodes[node.name] - - if node.name == "default:water_source" then - local player_name = user:get_player_name() - techage.valid_place_for_windturbine(pos, player_name, 0) - return itemstack - end - - minetest.chat_send_player(user:get_player_name(), S("Time")..": "..hours..":"..mins.." ") - local data = minetest.get_biome_data(pos) - if data then - local name = minetest.get_biome_name(data.biome) - minetest.chat_send_player(user:get_player_name(), S("Biome")..": "..name..", "..S("Position temperature")..": "..math.floor(data.heat).." ") - end - - if number then - if ndef and ndef.description then - local info = techage.send_single("0", number, "info", nil) - if info and info ~= "" and info ~= "unsupported" then - info = tostring(info) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..":\n"..info.." ") - end - local state = techage.send_single("0", number, "state", nil) - if state and state ~= "" and state ~= "unsupported" then - state = dump(state) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": state = "..state.." ") - end - local state = techage.send_single("0", number, "count", nil) - if state and state ~= "" and state ~= "unsupported" then - state = dump(state) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": count = "..state.." ") - end - local fuel = techage.send_single("0", number, "fuel", nil) - if fuel and fuel ~= "" and fuel ~= "unsupported" then - fuel = dump(fuel) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": fuel = "..fuel.." ") - end - local output = techage.send_single("0", number, "output", nil) - if output and output ~= "" and output ~= "unsupported" then - output = dump(output) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": output = "..output.." ") - end - local load, abs = techage.send_single("0", number, "load", nil) - if load and load ~= "" and load ~= "unsupported" then - load, abs = dump(load), abs and dump(abs) or "--" - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": load = "..load.." % / "..abs.." units ") - end - local delivered = techage.send_single("0", number, "delivered", nil) - if delivered and delivered ~= "" and delivered ~= "unsupported" then - delivered = dump(delivered) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": delivered = "..delivered.." ku ") - end - local consumption = techage.send_single("0", number, "consumption", nil) - if consumption and consumption ~= "" and consumption ~= "unsupported" then - consumption = dump(consumption) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": consumption = "..consumption.." kud ") - end - local flowrate = techage.send_single("0", number, "flowrate", nil) - if flowrate and flowrate ~= "" and flowrate ~= "unsupported" then - flowrate = dump(flowrate) - minetest.chat_send_player(user:get_player_name(), ndef.description.." "..number..": flowrate = "..flowrate.." ") - end - local owner = M(pos):get_string("owner") or "" - if owner ~= "" then - minetest.chat_send_player(user:get_player_name(), S("Node owner")..": "..owner.." ") - end - if ndef and ndef.networks and ndef.networks.pipe2 and ndef.networks.pipe2.ntype == "pump" then - local tbl = networks.liquid.get_liquids(pos, Pipe2) - if #tbl > 0 then - local names = table.concat(tbl, ", ") - minetest.chat_send_player(user:get_player_name(), S("Pump connected to tank(s) with: @1", names)) - else - minetest.chat_send_player(user:get_player_name(), S("Pump connected to no/empty tank(s).")) - end - end - - minetest.chat_send_player(user:get_player_name(), S("Position")..": "..minetest.pos_to_string(pos).." ") - itemstack:add_wear(65636/200) - return itemstack - end - elseif ndef and ndef.description then - if ndef.techage_info then - local info = ndef.techage_info(pos) or "" - minetest.chat_send_player(user:get_player_name(), ndef.description..":\n"..info) - end - local owner = M(pos):get_string("owner") or "" - if owner ~= "" then - minetest.chat_send_player(user:get_player_name(), S("Node owner")..": "..owner.." ") - end - minetest.chat_send_player(user:get_player_name(), S("Position")..": "..minetest.pos_to_string(pos).." ") - itemstack:add_wear(65636/200) - return itemstack - end - end -end - -local context = {} - -local function settings_menu(pos, playername) - if minetest.is_protected(pos, playername) then - return - end - -- Check node settings in addition - local access = M(pos):get_string("access") - local owner = M(pos):get_string("owner") - if access == "private" and playername ~= owner then - return - end - - local number = techage.get_node_number(pos) - local node = minetest.get_node(pos) - local ndef = minetest.registered_nodes[node.name] - local form_def - - if ndef then - if ndef.ta3_formspec or ndef.ta4_formspec then - form_def = ndef.ta3_formspec or ndef.ta4_formspec - elseif ndef.ta5_formspec then - local player = minetest.get_player_by_name(playername) - if techage.get_expoints(player) >= ndef.ta5_formspec.ex_points then - form_def = ndef.ta5_formspec.menu - end - end - end - - context[playername] = pos - if form_def then - minetest.show_formspec(playername, "techage:ta_formspec", - menu.generate_formspec(pos, ndef, form_def, playername)) - end -end - -minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname ~= "techage:ta_formspec" then - return false - end - - local playername = player:get_player_name() - local pos = context[playername] - if pos then - --context[playername] = nil - local number = techage.get_node_number(pos) - local node = minetest.get_node(pos) - local ndef = minetest.registered_nodes[node.name] - local form_def = ndef and (ndef.ta3_formspec or ndef.ta4_formspec or (ndef.ta5_formspec and ndef.ta5_formspec.menu)) - - if form_def then - if menu.eval_input(pos, form_def, fields, playername) then - --context[playername] = pos - minetest.after(0.2, function() - minetest.show_formspec(playername, "techage:ta_formspec", - menu.generate_formspec(pos, ndef, form_def, playername)) - end) - if ndef.ta_after_formspec then - ndef.ta_after_formspec(pos, fields, playername) - end - end - end - end - return true -end) - - -local function on_place(itemstack, placer, pointed_thing) - if pointed_thing.type == "node" then - local pos = pointed_thing.under - local playername = placer:get_player_name() - if placer:get_player_control().sneak then - settings_menu(pos, playername) - end - end -end - -minetest.register_tool("techage:end_wrench", { - description = S("TechAge Info Tool (use = read status info)"), - inventory_image = "techage_end_wrench.png", - wield_image = "techage_end_wrench.png", - groups = {cracky=1, book=1}, - on_use = read_state, - on_place = on_place, - node_placement_prediction = "", - liquids_pointable = true, - stack_max = 1, -}) - -minetest.register_craft({ - output = "techage:end_wrench", - recipe = { - {"", "", "default:steel_ingot"}, - {"", "techage:iron_ingot", ""}, - {"default:steel_ingot", "", ""}, - }, -}) diff --git a/techage/tools/pipe_wrench.lua b/techage/tools/pipe_wrench.lua deleted file mode 100644 index 27182df..0000000 --- a/techage/tools/pipe_wrench.lua +++ /dev/null @@ -1,41 +0,0 @@ -local S = techage.S - -local function remove_pipe(itemstack, user, pointed_thing) - local pos = pointed_thing.under - if pos and user then - if minetest.is_protected(pos, user:get_player_name()) then - return itemstack - end - end - - if(pos ~= nil) then - local node = minetest.get_node(pos) - if(node.name == "techage:oil_drillbit2") then - minetest.set_node(pos, {name = "air"}) - itemstack:add_wear(65636/200) - return itemstack - - end -- if(node.name - - end -- if(pos ~= nil) - -end -- remove_pipe - - -minetest.register_tool("techage:ta3_drill_pipe_wrench", { - description = S("TA3 Drill Pipe Wrench"), - inventory_image = "techage_pipe_wrench.png", - wield_image = "techage_pipe_wrench.png", - groups = {cracky=1}, - on_use = remove_pipe, - stack_max = 1, -}) - -minetest.register_craft({ - output = "techage:ta3_drill_pipe_wrench", - recipe = { - {"default:diamond", "default:diamond", ""}, - {"dye:red", "default:steel_ingot", "dye:red"}, - {"default:steel_ingot", "", "default:steel_ingot"}, - }, -}) diff --git a/techage/tools/screwdriver.lua b/techage/tools/screwdriver.lua deleted file mode 100644 index 47a3639..0000000 --- a/techage/tools/screwdriver.lua +++ /dev/null @@ -1,160 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2020-2022 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Screwdriver - -]]-- -if minetest.global_exists("screwdriver") then - -local S = techage.S -local M = minetest.get_meta - -local USES = 2000 - -local function base_checks(user, pointed_thing) - if pointed_thing.type ~= "node" then - return false - end - - if not user then - return false - end - - local pos = pointed_thing.under - local player_name = user:get_player_name() - - if minetest.is_protected(pos, player_name) then - return false - end - - local node = minetest.get_node(pos) - local ndef = minetest.registered_nodes[node.name] - - if not ndef then - return false - end - - if ndef.on_rotate == screwdriver.disallow and not ndef.ta_rotate_node then - return false - end - - local yaw = user:get_look_horizontal() - local dir = minetest.yaw_to_dir(yaw) - local facedir = minetest.dir_to_facedir(dir) - - return true, pos, player_name, facedir, node, ndef -end - - -local function store_node_param2(user, node) - user:get_meta():set_int("techage_screwdriver_param2", node.param2) - minetest.chat_send_player(user:get_player_name(), S("Block alignment stored!")) -end - -local function turn_node_param2(pos, node, ndef, user) - local param2 = user:get_meta():get_int("techage_screwdriver_param2") or 0 - if ndef.ta_rotate_node then - ndef.ta_rotate_node(pos, node, param2) - else - minetest.swap_node(pos, {name = node.name, param2 = param2}) - minetest.check_for_falling(pos) - end -end - -local function turn_left(pos, node, ndef) - local param2 = techage.param2_turn_left(node.param2) - if ndef.ta_rotate_node then - ndef.ta_rotate_node(pos, node, param2) - else - minetest.swap_node(pos, {name = node.name, param2 = param2}) - minetest.check_for_falling(pos) - end -end - -local function turn_up(pos, node, ndef, facedir) - local param2 = techage.param2_turn_up(facedir, node.param2) - if ndef.ta_rotate_node then - ndef.ta_rotate_node(pos, node, param2) - else - minetest.swap_node(pos, {name = node.name, param2 = param2}) - minetest.check_for_falling(pos) - end -end - --- on_use == on_left_click == turn left -local function on_use(itemstack, user, pointed_thing) - local res, pos, player_name, facedir, node, ndef = base_checks(user, pointed_thing) - if res then - if ndef.paramtype2 == "facedir" then - if user:get_player_control().sneak then - store_node_param2(user, node) - else - turn_left(pos, node, ndef) - end - else - return screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, USES) - end - - if not minetest.is_creative_enabled(player_name) then - itemstack:add_wear(65535 / (USES - 1)) - end - end - return itemstack -end - --- on_place == on_right_click == turn up -local function on_place(itemstack, user, pointed_thing) - local res, pos, player_name, facedir, node, ndef = base_checks(user, pointed_thing) - if res then - -- Support for anvil - if node.name == "anvil:anvil" then - return screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, USES) - end - - if ndef.paramtype2 == "facedir" then - if ndef.on_rotate ~= screwdriver.rotate_simple then - if user:get_player_control().sneak then - turn_node_param2(pos, node, ndef, user) - else - turn_up(pos, node, ndef, facedir) - end - else - return itemstack - end - else - return screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, USES) - end - - if not minetest.is_creative_enabled(player_name) then - itemstack:add_wear(65535 / (USES - 1)) - end - end - return itemstack -end - -minetest.register_tool("techage:screwdriver", { - description = S("Techage Screwdriver\n(See: TA3 > Tools)"), - inventory_image = "techage_screwdriver.png", - on_use = on_use, - on_place = on_place, - node_placement_prediction = "", - stack_max = 1, -}) - -minetest.register_craft({ - output = "techage:screwdriver", - recipe = { - {"", "default:diamond", ""}, - {"", "basic_materials:steel_bar", ""}, - {"", "techage:baborium_ingot", ""}, - }, -}) - -end diff --git a/techage/tools/trowel.lua b/techage/tools/trowel.lua deleted file mode 100644 index bffeb91..0000000 --- a/techage/tools/trowel.lua +++ /dev/null @@ -1,68 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Trowel tool to hide/open cable/pipe/tube nodes - -]]-- - --- for lazy programmers -local P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local function replace_node(itemstack, placer, pointed_thing) - if pointed_thing.type == "node" then - local pos = pointed_thing.under - local name = placer:get_player_name() - if minetest.is_protected(pos, name) then - return - end - local node = minetest.get_node(pos) - local res = false - if minetest.get_item_group(node.name, "techage_trowel") == 1 then - res = networks.hide_node(pos, node, placer) - elseif networks.hidden_name(pos) or M(pos):get_string("techage_hidden_nodename") ~= "" then - res = networks.open_node(pos, node, placer) - else - minetest.chat_send_player(placer:get_player_name(), "Invalid/unsuported block!") - return - end - if res then - minetest.sound_play("default_dig_snappy", { - pos = pos, - gain = 1, - max_hear_distance = 5}) - elseif placer and placer.get_player_name then - minetest.chat_send_player(placer:get_player_name(), "Invalid fill material in inventory slot 1!") - end - end -end - -minetest.register_tool("techage:trowel", { - description = S("TechAge Trowel"), - inventory_image = "techage_trowel.png", - wield_image = "techage_trowel.png", - use_texture_alpha = techage.CLIP, - groups = {cracky=1}, - on_use = replace_node, - on_place = replace_node, - node_placement_prediction = "", - stack_max = 1, -}) - - -minetest.register_craft({ - output = "techage:trowel", - recipe = { - {"basic_materials:steel_bar", "basic_materials:steel_bar", ""}, - {"basic_materials:steel_bar", "default:stick", ""}, - {"", "", "default:stick"}, - }, -}) diff --git a/techage/wind_turbine/pillar.lua b/techage/wind_turbine/pillar.lua deleted file mode 100644 index 31c83b9..0000000 --- a/techage/wind_turbine/pillar.lua +++ /dev/null @@ -1,44 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - pillar - -]]-- - -local S = techage.S - -minetest.register_node("techage:pillar", { - description = S("TA4 Pillar"), - tiles = {"techage_concrete.png"}, - drawtype = "mesh", - mesh = "techage_cylinder_07.obj", - selection_box = { - type = "fixed", - fixed = {-10/32, -16/32, -10/32, 10/32, 16/32, 10/32}, - }, - collision_box = { - type = "fixed", - fixed = {-4/32, -16/32, -4/32, 4/32, 16/32, 4/32}, - }, - climbable = true, - walkable = true, - paramtype = "light", - backface_culling = true, - groups = {cracky=1}, - on_rotate = screwdriver.disallow, - is_ground_content = false, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_craft({ - type = "shapeless", - output = "techage:pillar", - recipe = {"basic_materials:concrete_block"}, -}) diff --git a/techage/wind_turbine/rotor.lua b/techage/wind_turbine/rotor.lua deleted file mode 100644 index d84245a..0000000 --- a/techage/wind_turbine/rotor.lua +++ /dev/null @@ -1,396 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2022 DS-Minetest, Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - TA4 Power Wind Turbine Rotor - - Code by Joachim Stolberg, derived from DS-Minetest [1] - Rotor model and texture designed by DS-Minetest [1] (CC-0) - - [1] https://github.com/DS-Minetest/wind_turbine - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local STANDBY_TICKS = 4 -local CYCLE_TIME = 2 -local PWR_PERF = 70 -local COUNTDOWN_TICKS = 2 - -local Cable = techage.ElectricCable -local power = networks.power -local control = networks.control - -local Rotors = {} - -local Face2Dir = {[0]= - {x=0, y=0, z=1}, - {x=1, y=0, z=0}, - {x=0, y=0, z=-1}, - {x=-1, y=0, z=0}, - {x=0, y=-1, z=0}, - {x=0, y=1, z=0} -} - -local function pos_and_yaw(pos, param2) - local dir = Face2Dir[param2] or Face2Dir[0] - local yaw = minetest.dir_to_yaw(dir) - dir = vector.multiply(dir, 1.1) - pos = vector.add(pos, dir) - return pos, {x=0, y=yaw, z=0} -end - -local function is_windy() - local time = minetest.get_timeofday() or 0 - return (time >= 5.00/24.00 and time <= 9.00/24.00) or (time >= 17.00/24.00 and time <= 21.00/24.00) -end - -local function check_rotor(pos, nvm) - local resp, err = techage.valid_place_for_windturbine(pos, nil, 1) - if not resp then - nvm.error = err - return false - end - - local npos = techage.get_pos(pos, "F") - local node = techage.get_node_lvm(npos) - if node.name ~= "techage:ta4_wind_turbine_nacelle" then - nvm.error = S("Nacelle is missing") - return false - end - - local own_num = M(pos):get_string("node_number") or "" - M(pos):set_string("infotext", S("TA4 Wind Turbine")..": "..own_num) - nvm.error = false - return true -end - -local function formspec(self, pos, nvm) - return techage.generator_formspec(self, pos, nvm, S("TA4 Wind Turbine"), nvm.provided, PWR_PERF) -end - -local function add_rotor(pos, nvm, force) - if (force and not nvm.error) or check_rotor(pos, nvm) then - local hash = minetest.hash_node_position(pos) - if Rotors[hash] then - Rotors[hash]:remove() - end - local node = minetest.get_node(pos) - local npos, yaw = pos_and_yaw(pos, node.param2) - local obj = minetest.add_entity(npos, "techage:rotor_ent") - obj:set_animation({x = 0, y = 119}, 0, 0, true) - obj:set_rotation(yaw) - Rotors[hash] = obj - end -end - -local function start_rotor(pos, nvm, state) - if not nvm.error then - local meta = M(pos) - nvm.provided = 0 - techage.evaluate_charge_termination(nvm, meta) - power.start_storage_calc(pos, Cable, 5) - local hash = minetest.hash_node_position(pos) - if Rotors[hash] and is_windy() then - Rotors[hash]:set_animation_frame_speed(50) - end - end -end - -local function stop_rotor(pos, nvm, state) - nvm.provided = 0 - nvm.load = 0 - power.start_storage_calc(pos, Cable, 5) - local hash = minetest.hash_node_position(pos) - if Rotors[hash] then - Rotors[hash]:set_animation_frame_speed(0) - end -end - -local function can_start(pos, nvm) - check_rotor(pos, nvm) - if nvm.error then - return nvm.error - end - add_rotor(pos, nvm) - return true -end - -local State = techage.NodeStates:new({ - node_name_passive = "techage:ta4_wind_turbine", - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec_func = formspec, - start_node = start_rotor, - stop_node = stop_rotor, - can_start = can_start, -}) - -local function node_timer(pos, elapsed) - local nvm = techage.get_nvm(pos) - local running = techage.is_running(nvm) - local windy = is_windy() - if running and not windy then - State:standby(pos, nvm) - stop_rotor(pos, nvm, State) - elseif not running and windy then - State:start(pos, nvm) - -- start_node() is called implicit - elseif running then - local meta = M(pos) - local tp1 = tonumber(meta:get_string("termpoint1")) - local tp2 = tonumber(meta:get_string("termpoint2")) - nvm.provided = power.provide_power(pos, Cable, 5, PWR_PERF, tp1, tp2) - local val = power.get_storage_load(pos, Cable, 5, PWR_PERF) - if val > 0 then - nvm.load = val - end - State:keep_running(pos, nvm, COUNTDOWN_TICKS) - end - if techage.is_activeformspec(pos) then - M(pos):set_string("formspec", formspec(State, pos, nvm)) - end - return State:is_active(nvm) -end - -local function on_rightclick(pos, node, clicker) - techage.set_activeformspec(pos, clicker) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function on_receive_fields(pos, formname, fields, player) - if minetest.is_protected(pos, player:get_player_name()) then - return - end - local nvm = techage.get_nvm(pos) - State:state_button_event(pos, nvm, fields) - M(pos):set_string("formspec", formspec(State, pos, nvm)) -end - -local function get_generator_data(pos, outdir, tlib2) - local nvm = techage.get_nvm(pos) - if techage.is_running(nvm) then - return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} - end -end - -local function after_place_node(pos, placer) - local meta = M(pos) - local nvm = techage.get_nvm(pos) - local number = techage.add_node(pos, "techage:ta4_wind_turbine") - State:node_init(pos, nvm, number) - meta:set_string("owner", placer:get_player_name()) - M(pos):set_string("formspec", formspec(State, pos, nvm)) - add_rotor(pos, nvm) - Cable:after_place_node(pos) -end - -local function after_dig_node(pos, oldnode, oldmetadata) - local hash = minetest.hash_node_position(pos) - if Rotors[hash] and Rotors[hash]:get_luaentity() then - Rotors[hash]:remove() - end - Rotors[hash] = nil - Cable:after_dig_node(pos) - techage.remove_node(pos, oldnode, oldmetadata) - techage.del_mem(pos) -end - -minetest.register_node("techage:ta4_wind_turbine", { - description = S("TA4 Wind Turbine"), - inventory_image = "techage_wind_turbine_inv.png", - tiles = { - -- up, down, right, left, back, front - "techage_rotor_top.png", - "techage_rotor_top.png^techage_appl_hole_electric.png", - "techage_rotor.png", - "techage_rotor.png", - "techage_rotor.png", - "techage_rotor.png^techage_appl_open.png", - }, - - after_place_node = after_place_node, - after_dig_node = after_dig_node, - get_generator_data = get_generator_data, - on_timer = node_timer, - on_rightclick = on_rightclick, - on_receive_fields = on_receive_fields, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), - ta4_formspec = techage.generator_settings("ta4", PWR_PERF), -}) - -power.register_nodes({"techage:ta4_wind_turbine"}, Cable, "gen", {"D"}) - -control.register_nodes({"techage:ta4_wind_turbine"}, { - on_receive = function(pos, tlib2, topic, payload) - end, - on_request = function(pos, tlib2, topic) - if topic == "info" then - local nvm = techage.get_nvm(pos) - local meta = M(pos) - return { - type = S("TA4 Wind Turbine"), - number = meta:get_string("node_number") or "", - running = techage.is_running(nvm) or false, - available = PWR_PERF, - provided = nvm.provided or 0, - termpoint = meta:get_string("termpoint"), - } - end - return false - end, - } -) - -minetest.register_node("techage:ta4_wind_turbine_nacelle", { - description = S("TA4 Wind Turbine Nacelle"), - tiles = { - -- up, down, right, left, back, front - "techage_rotor_top.png", - "techage_rotor_top.png", - "techage_rotor.png", - "techage_rotor.png", - "techage_rotor.png^techage_appl_open.png", - "techage_rotor.png", - }, - paramtype2 = "facedir", - groups = {cracky=2, crumbly=2, choppy=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - -minetest.register_entity("techage:rotor_ent", {initial_properties = { - physical = false, - pointable = false, - visual = "mesh", - visual_size = {x = 1.5, y = 1.5, z = 1.5}, - mesh = "techage_rotor.b3d", - textures = {"techage_rotor_blades.png"}, - static_save = false, -}}) - -techage.register_node({"techage:ta4_wind_turbine"}, { - on_recv_message = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == "state" then - local node = minetest.get_node(pos) - if node.name == "ignore" then -- unloaded node? - return "unloaded" - end - if nvm.error then - return "error" - elseif techage.is_running(nvm) then - return "running" - else - return "stopped" - end - elseif topic == "delivered" then - return nvm.delivered or 0 - elseif topic == "on" then - State:start(pos, nvm) - elseif topic == "off" then - State:stop(pos, nvm) - else - return "unsupported" - end - end, - on_beduino_receive_cmnd = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 1 and payload[1] == 1 then - State:start(pos, nvm) - elseif topic == 1 and payload[1] == 0 then - State:stop(pos, nvm) - else - return 2 - end - return 0 - end, - on_beduino_request_data = function(pos, src, topic, payload) - local nvm = techage.get_nvm(pos) - if topic == 129 then - local node = minetest.get_node(pos) - if node.name == "ignore" then -- unloaded node? - return 0, {techage.UNLOADED} - end - if nvm.error then - return 0, {techage.FAULT} - elseif techage.is_running(nvm) then - return 0, {techage.RUNNING} - else - return 0, {techage.STOPPED} - end - elseif topic == 135 then -- Delivered Power - return 0, {nvm.delivered or 0} - else - return 2, "" - end - end, - on_node_load = function(pos) - local nvm = techage.get_nvm(pos) - add_rotor(pos, nvm, true) - start_rotor(pos, nvm) - minetest.get_node_timer(pos):start(CYCLE_TIME) - end, -}) - -minetest.register_craftitem("techage:ta4_carbon_fiber", { - description = S("TA4 Carbon Fiber"), - inventory_image = "techage_carbon_fiber.png", -}) - -minetest.register_craftitem("techage:ta4_rotor_blade", { - description = S("TA4 Rotor Blade"), - inventory_image = "techage_rotor_blade.png", -}) - - -minetest.register_craft({ - output = "techage:ta4_wind_turbine", - recipe = { - {"dye:white", "techage:ta4_rotor_blade", "dye:red"}, - {"basic_materials:gear_steel", "techage:generator", "basic_materials:gear_steel"}, - {"techage:ta4_rotor_blade", "techage:electric_cableS", "techage:ta4_rotor_blade"}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_wind_turbine_nacelle", - recipe = { - {"default:steel_ingot", "", "default:steel_ingot"}, - {"dye:white", "techage:ta4_wlanchip", "dye:red"}, - {"", "default:copper_ingot", ""}, - }, -}) - -minetest.register_craft({ - output = "techage:ta4_rotor_blade", - recipe = { - {"techage:ta4_carbon_fiber", "dye:white", "techage:ta4_carbon_fiber"}, - {"techage:canister_epoxy", "techage:ta4_carbon_fiber", "techage:canister_epoxy"}, - {"techage:ta4_carbon_fiber", "dye:red", "techage:ta4_carbon_fiber"}, - }, - replacements = { - {"techage:canister_epoxy", "techage:ta3_canister_empty"}, - {"techage:canister_epoxy", "techage:ta3_canister_empty"}, - }, -}) - -techage.furnace.register_recipe({ - output = "techage:ta4_carbon_fiber", - recipe = {"default:papyrus", "default:stick", "default:papyrus", "default:stick"}, - heat = 4, - time = 3, -}) diff --git a/techage/wind_turbine/signallamp.lua b/techage/wind_turbine/signallamp.lua deleted file mode 100644 index e4884e4..0000000 --- a/techage/wind_turbine/signallamp.lua +++ /dev/null @@ -1,109 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019 Joachim Stolberg - - AGPL v3 - See LICENSE.txt for more information - - Colored Signal Lamp (requires unifieddyes) - -]]-- - --- for lazy programmers -local M = minetest.get_meta -local S = techage.S - -local logic = techage.logic - -local COLORED = minetest.get_modpath("unifieddyes") and minetest.global_exists("unifieddyes") - - -local function switch_on(pos, node) - node.name = "techage:signal_lamp_on" - minetest.swap_node(pos, node) -end - -local function switch_off(pos, node) - node.name = "techage:signal_lamp_off" - minetest.swap_node(pos, node) -end - -minetest.register_node("techage:rotor_signal_lamp_off", { - description = S("TA4 Wind Turbine Signal Lamp"), - tiles = {"techage_rotor_lamp_off.png"}, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/16, -8/16, -2/16, 2/16, -3/16, 2/16}, - }, - }, - - after_place_node = function(pos, placer, itemstack, pointed_thing) - minetest.get_node_timer(pos):start(2) - end, - - on_timer = function(pos, elapsed) - minetest.swap_node(pos, {name = "techage:rotor_signal_lamp_on"}) - return true - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - paramtype2 = "glasslikeliquidlevel", - sunlight_propagates = true, - sounds = default.node_sound_glass_defaults(), - groups = {cracky = 3, oddly_breakable_by_hand = 3}, - is_ground_content = false, - drop = "techage:rotor_signal_lamp_off" -}) - -minetest.register_node("techage:rotor_signal_lamp_on", { - description = S("TA4 Wind Turbine Signal Lamp"), - tiles = {"techage_rotor_lamp_on.png"}, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/16, -8/16, -2/16, 2/16, -3/16, 2/16}, - }, - }, - - on_timer = function(pos, elapsed) - minetest.swap_node(pos, {name = "techage:rotor_signal_lamp_off"}) - return true - end, - - paramtype = "light", - use_texture_alpha = techage.CLIP, - light_source = 8, - paramtype2 = "glasslikeliquidlevel", - sunlight_propagates = true, - sounds = default.node_sound_glass_defaults(), - groups = {cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory=1}, - is_ground_content = false, - drop = "techage:rotor_signal_lamp_off" -}) - -minetest.register_lbm({ - label = "Restart Lamp", - name = "techage:rotor_signal_lamp", - nodenames = {"techage:rotor_signal_lamp_on", "techage:rotor_signal_lamp_off"}, - run_at_every_load = true, - action = function(pos, node) - minetest.get_node_timer(pos):start(2) - end, -}) - - -minetest.register_craft({ - output = "techage:rotor_signal_lamp_off", - recipe = { - {"", "dye:red", ""}, - {"", "default:torch", ""}, - {"", "default:glass", ""}, - }, -})