[Mod] Technic [0.4.16-dev] [technic]

User avatar
Cryterion
Member
 
Posts: 93
Joined: Tue Jun 10, 2014 08:12
GitHub: Cryterion
IRC: Cryterion
In-game: Cryterion

Re: [Mod] Technic [0.4.10] [technic]

by Cryterion » Tue Oct 07, 2014 14:18

Hi

had a bit of a problem trying to register an mv machine to be used in another mod, and found the following code changed fixed the naming convention error I kept getting

in /technic/technic/machines/register/machine_base.lua

line 126

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("technic:"..ltier.."_"..machine_name, {

change it to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node(":technic:"..ltier.."_"..machine_name, {


and line 158

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node(":technic:"..ltier.."_"..machine_name.."_active",{

changed it to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node(":technic:"..ltier.."_"..machine_name.."_active",{


It still keeps technic functional, but will allow other mods to register lv,mv and hv machines if they wish to use the technic functions.
No trees or animals were hurt in the production of this message. However, a large number of Electrons were temporarily inconvenienced.
 

User avatar
DuDraig
Member
 
Posts: 69
Joined: Sun Sep 28, 2014 17:56
IRC: DuDraig
In-game: DuDraig

Re: [Mod] Technic [0.4.10] [technic]

by DuDraig » Sat Nov 01, 2014 07:50

The technic manual says that
Generally, powered machines of MV and HV tiers can work with pneumatic tubes, and those of lower tiers cannot. (As an exception, the fuel-fired furnace from the basic Minetest game can accept inputs through tubes, but can't output into tubes.)

I've confirmed that the tubes will not connect at all to an LV furnace, and will input material to a coal furnace but a filter will not take the product out.

My question is: why? Is this by design, a bug, or an unimplemented function. It seems to make no sense that an LV furnace can not accept and deliver materials via pipeworks tubes as can MV and HV furnaces.

The Mintest server I'm on disabled MV and HV machines because of the rise in server lag they created, so we only have LV machines available. The inability of LV machines to accept pipes is crippling to most automation, so I'm wondering if there is a reason for this.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Sat Nov 01, 2014 08:02

I'm pretty sure the lack of tube support for LV is intentional, the idea being that if you want automation you must upgrade to MV machines.

A fuel-fired furnace should definitely work with a filter pulling items from it, perhaps your server admin disabled that too?

Sounds like you might want to find a better server, I have dozens of tubed MV machines on VanessaE's survival server and up to 10 HV quarries running at a time, and I've seen several other players with similar massive automation of MV machines, and there is no discernable lag on the server. And that's saying a lot considering I'm in South Africa, where we have some pretty crappy Internet connectivity sometimes.
 

User avatar
DuDraig
Member
 
Posts: 69
Joined: Sun Sep 28, 2014 17:56
IRC: DuDraig
In-game: DuDraig

Re: [Mod] Technic [0.4.10] [technic]

by DuDraig » Sat Nov 01, 2014 10:30

Thanks for the reply ThatGraemeGuy. I've been delving the technic code and have come to the same conclusion that the lack of pipe support in LV machines is by design. Although it still makes no functional sense since a conveyance system is completely separate from the tech level of the machine to/from which items are conveyed. Besides, if LV machines can't use pipes, why do they show pipe connection textures?

I found that this server is using an older version of pipeworks and technic that does not allow output from a fuel furnace. Using the current versions in my own server, the fuel furnace works just fine with input and output.

However, the LV furnace will not take input nor send output through a pipe, and the MV furnace will take input but not send output. The LV lack of input is because the node does not have the "tube" group as does MV. This is by design. The lack of output in MV seems to be a technic bug where the node field "input_inventory" is not assigned the name of the furnace product inventory list "dst" as it is in the overrides for the default fuel furnace. Pipeworks needs this field to identify the inventory list of products to send.

At least I now understand the coding reasons for these behaviors. I still think the lack of pipe functions for LV machines makes no realistic sense, especially since the fuel furnace has full pipe functionality. If there are reasons for this, I'd like to hear them.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Sat Nov 01, 2014 10:45

The main reason is to give you more incentive to upgrade than simply "they're faster". After all, if you find LV to be too slow you can just build more machines to compensate.

MV machines will eject their output to tubes if you place at least 1 control logic unit in the machine's upgrade slot. Add a second control logic unit to increase the rate that it ejects items. Pipeworks filter/injectors do not work for taking things from MV machines.
 

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

Re: [Mod] Technic [0.4.10] [technic]

by Nore » Sat Nov 01, 2014 11:09

DuDraig wrote:The Mintest server I'm on disabled MV and HV machines because of the rise in server lag they created, so we only have LV machines available. The inability of LV machines to accept pipes is crippling to most automation, so I'm wondering if there is a reason for this.


You can ask the server owner to change a few lines to fix that: just allow upgrades for LV furnaces (see how it is done in MV furnaces registration), and they should be able to work as MV for tubes.
 

Marshall_maz
Member
 
Posts: 240
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal

Re: [Mod] Technic [0.4.10] [technic]

by Marshall_maz » Sat Nov 01, 2014 11:29

DuDraig wrote:Thanks for the reply ThatGraemeGuy. I've been delving the technic code and have come to the same conclusion that the lack of pipe support in LV machines is by design. Although it still makes no functional sense since a conveyance system is completely separate from the tech level of the machine to/from which items are conveyed. Besides, if LV machines can't use pipes, why do they show pipe connection textures?

I found that this server is using an older version of pipeworks and technic that does not allow output from a fuel furnace. Using the current versions in my own server, the fuel furnace works just fine with input and output.

However, the LV furnace will not take input nor send output through a pipe, and the MV furnace will take input but not send output. The LV lack of input is because the node does not have the "tube" group as does MV. This is by design. The lack of output in MV seems to be a technic bug where the node field "input_inventory" is not assigned the name of the furnace product inventory list "dst" as it is in the overrides for the default fuel furnace. Pipeworks needs this field to identify the inventory list of products to send.

At least I now understand the coding reasons for these behaviors. I still think the lack of pipe functions for LV machines makes no realistic sense, especially since the fuel furnace has full pipe functionality. If there are reasons for this, I'd like to hear them.


Also to add, use a screwdriver to swivel the furnace around. I found that depending on which direction the furnace stands the side it ejects differs. Some of MV furnaces ejects left side only and other ejects right side only. Something I could never understand.

Best is to connect your pipes , add logic controller like Greame said , put stuff in and then use screwdriver to rotate it until it starts to eject. But if one ejects left side , doesn't mean another will. Another might eject right hand side. I have this behavior with all my MV furnaces and even centrifuges as well.
 

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

Re: [Mod] Technic [0.4.10] [technic]

by Nore » Sat Nov 01, 2014 12:48

Marshall_maz wrote:Also to add, use a screwdriver to swivel the furnace around. I found that depending on which direction the furnace stands the side it ejects differs. Some of MV furnaces ejects left side only and other ejects right side only. Something I could never understand.

This is a known long-standing bug, and was never fixed in order to avoid breaking already-existing machines.
 

User avatar
DuDraig
Member
 
Posts: 69
Joined: Sun Sep 28, 2014 17:56
IRC: DuDraig
In-game: DuDraig

Re: [Mod] Technic [0.4.10] [technic]

by DuDraig » Sat Nov 01, 2014 13:23

The orientation of the output is
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Face   - The direction you were facing when you placed the node.
Output - The direction of the output side of the node.
Face   Output
----   ------
North  East
East   North
South  West
West   South

I just don't understand the reasoning behind the entire idea. You are supposed to get output from any non-input face: either side or top. If someone places a pipe device on more than one output side, then it should either not output anything or output to each in turn.

Now I understand my confusion with making the MV outputs work. You must not use pipeworks filters and must use at least one Logic Control Units to enable output to a pipe device. I've never seen any documentation that clarifies this. No wonder there is so much confusion.

At least I have everything working now and have sussed the code enough to make some useful improvements. Thank you all for your help.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Sat Nov 01, 2014 16:14

DuDraig wrote:You must not use pipeworks filters and must use at least one Logic Control Units to enable output to a pipe device. I've never seen any documentation that clarifies this. No wonder there is so much confusion.


https://github.com/minetest-technic/tec ... /manual.md

It's a work in progress, feel free to contribute :-)
 

Marshall_maz
Member
 
Posts: 240
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal

Re: [Mod] Technic [0.4.10] [technic]

by Marshall_maz » Mon Nov 03, 2014 06:05

DuDraig wrote:The orientation of the output is
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Face   - The direction you were facing when you placed the node.
Output - The direction of the output side of the node.
Face   Output
----   ------
North  East
East   North
South  West
West   South

I just don't understand the reasoning behind the entire idea. You are supposed to get output from any non-input face: either side or top. If someone places a pipe device on more than one output side, then it should either not output anything or output to each in turn.

Now I understand my confusion with making the MV outputs work. You must not use pipeworks filters and must use at least one Logic Control Units to enable output to a pipe device. I've never seen any documentation that clarifies this. No wonder there is so much confusion.

At least I have everything working now and have sussed the code enough to make some useful improvements. Thank you all for your help.


Thanx for this list.
 

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40

Re: [Mod] Technic [0.4.10] [technic]

by JPRuehmann » Wed Nov 12, 2014 16:26

Hello
Tere is an incompatibility between the technic modpack and the carpet 3d mod
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
17:12:30: ERROR[main]: ========== ERROR FROM LUA ===========
17:12:30: ERROR[main]: Failed to load and run script from
17:12:30: ERROR[main]: /home/minetest/.minetest/mods/carpet3d/init.lua:
17:12:30: ERROR[main]: ...netest/.minetest/mods/technic/technic_worldgen/nodes.lua:154: bad argument #1 to 'ipairs' (table expected, got string)
17:12:30: ERROR[main]: ======= END OF ERROR FROM LUA ========
17:12:30: ERROR[main]: Server: Failed to load and run /home/minetest/.minetest/mods/carpet3d/init.lua
17:12:30: ERROR[main]: ERROR: An unhandled exception occurred: ModError: Failed to load and run /home/minetest/.minetest/mods/carpet3d/init.lua

Is there a way to change that.
Thanks,
JPR
 

User avatar
lisacvuk
Member
 
Posts: 165
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [Mod] Technic [0.4.10] [technic]

by lisacvuk » Wed Nov 12, 2014 17:22

hey, Raven tried to protect his castle with forcefield on our server, interesting thing is that it cant work on water. Means you can pass below it
400 character limit? Am I writing a book?
I'm a Minetest player, 'learning' C++ and OpenGL, listening to Blind Guardian, Nightwish, Amon Amarth. Administrator on Craig's server. Likes cookies.
I live in Serbia.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Thu Nov 13, 2014 11:19

lisacvuk wrote:hey, Raven tried to protect his castle with forcefield on our server, interesting thing is that it cant work on water. Means you can pass below it


I've made it penetrate water on my own copy which you can use in the meantime (https://github.com/thatgraemeguy/technic).

I see the technic manual specifically mentions that the forcefield does not penetrate liquid nodes, so I'm not sure if my change will be merged. There may be some very good reason why it was made that way that I haven't realised. At any rate, it seems to works just fine as-is based on the tests I did.
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Technic [0.4.10] [technic]

by ShadowNinja » Thu Nov 13, 2014 17:32

I made the forcefield replace all buildable_to nodes (except ignore).
I also found the bottleneck in the forcefield updater and improved the update speed by about 20x (about 0.5s -> 0.02s).
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

linkukun
New member
 
Posts: 7
Joined: Mon Jun 24, 2013 19:48

Autocrafter

by linkukun » Sun Nov 16, 2014 23:46

I was wondering if it would be possible to somehow use node groups in the autocrafter's crafting grid? That way you could dump several materials in the autocrafter and, as long as they are in that group the recipe uses, it will use them.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Mon Nov 17, 2014 03:47

1. I'm sure someone had mentioned on IRC that there was some intention to look into that, although there seems to be no open issue on github for it.

2. Autocrafters are actually from pipeworks, not technic. Forum: viewtopic.php?f=11&t=2155. Github: https://github.com/VanessaE/pipeworks/
 

Miner59
Member
 
Posts: 46
Joined: Mon Sep 22, 2014 19:14

Re: [Mod] Technic [0.4.10] [technic]

by Miner59 » Mon Nov 17, 2014 14:37

Hi, I just want to post my changed chainsaw.lua file here.
You can cut down the trees from paragenV7 mod now with the chainsaw. This mod adds a acacia tree, a pine tree, a cactus and it changes default trees and jungletrees.
The pine tree was a bit tricky because it has snow on it, but with some changes now the chainsaw should remove the snow, too.
Although I added code to give you only some of the leaves and not all.
And I added acorns and cones from moretrees mod to the removeable nodes, so the sky is not cluttered with them after cutting down a oak for example.

You can put it in technic pack instead of old chainsaw.lua if you like it.

Please copy this code to /technic/technic/tools/chainsaw.lua:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local chainsaw_max_charge      = 30000 -- Maximum charge of the saw
-- Gives 2500 nodes on a single charge (about 50 complete normal trees)
local chainsaw_charge_per_node = 12
-- Cut down tree leaves.  Leaf decay may cause slowness on large trees
-- if this is disabled.
local chainsaw_leaves = true
local chainsaw_all_leaves = false

-- The default trees
local timber_nodenames = {
   ["default:jungletree"] = true,
   ["default:papyrus"]    = true,
   ["default:cactus"]     = true,
   ["default:tree"]       = true,
   ["default:apple"]      = true,
}

if chainsaw_leaves then
   timber_nodenames["default:leaves"] = true
   timber_nodenames["default:jungleleaves"] = true
end

-- technic_worldgen defines rubber trees if moretrees isn't installed
if minetest.get_modpath("technic_worldgen") or
      minetest.get_modpath("moretrees") then
   timber_nodenames["moretrees:rubber_tree_trunk_empty"] = true
   timber_nodenames["moretrees:rubber_tree_trunk"]       = true
   if chainsaw_leaves then
      timber_nodenames["moretrees:rubber_tree_leaves"] = true
   end
end

-- Support moretrees if it is there
if minetest.get_modpath("moretrees") then
   timber_nodenames["moretrees:apple_tree_trunk"]                 = true
   timber_nodenames["moretrees:apple_tree_trunk_sideways"]        = true
   timber_nodenames["moretrees:beech_trunk"]                      = true
   timber_nodenames["moretrees:beech_trunk_sideways"]             = true
   timber_nodenames["moretrees:birch_trunk"]                      = true
   timber_nodenames["moretrees:birch_trunk_sideways"]             = true
   timber_nodenames["moretrees:fir_trunk"]                        = true
   timber_nodenames["moretrees:fir_trunk_sideways"]               = true
   timber_nodenames["moretrees:oak_trunk"]                        = true
   timber_nodenames["moretrees:oak_trunk_sideways"]               = true
   timber_nodenames["moretrees:palm_trunk"]                       = true
   timber_nodenames["moretrees:palm_trunk_sideways"]              = true
   timber_nodenames["moretrees:pine_trunk"]                       = true
   timber_nodenames["moretrees:pine_trunk_sideways"]              = true
   timber_nodenames["moretrees:rubber_tree_trunk_sideways"]       = true
   timber_nodenames["moretrees:rubber_tree_trunk_sideways_empty"] = true
   timber_nodenames["moretrees:sequoia_trunk"]                    = true
   timber_nodenames["moretrees:sequoia_trunk_sideways"]           = true
   timber_nodenames["moretrees:spruce_trunk"]                     = true
   timber_nodenames["moretrees:spruce_trunk_sideways"]            = true
   timber_nodenames["moretrees:willow_trunk"]                     = true
   timber_nodenames["moretrees:willow_trunk_sideways"]            = true
   timber_nodenames["moretrees:jungletree_trunk"]                 = true
   timber_nodenames["moretrees:jungletree_trunk_sideways"]        = true

   if chainsaw_leaves then
      timber_nodenames["moretrees:apple_tree_leaves"]        = true
      timber_nodenames["moretrees:oak_leaves"]               = true
      timber_nodenames["moretrees:fir_leaves"]               = true
      timber_nodenames["moretrees:fir_leaves_bright"]        = true
      timber_nodenames["moretrees:sequoia_leaves"]           = true
      timber_nodenames["moretrees:birch_leaves"]             = true
      timber_nodenames["moretrees:birch_leaves"]             = true
      timber_nodenames["moretrees:palm_leaves"]              = true
      timber_nodenames["moretrees:spruce_leaves"]            = true
      timber_nodenames["moretrees:spruce_leaves"]            = true
      timber_nodenames["moretrees:pine_leaves"]              = true
      timber_nodenames["moretrees:willow_leaves"]            = true
      timber_nodenames["moretrees:jungletree_leaves_green"]  = true
      timber_nodenames["moretrees:jungletree_leaves_yellow"] = true
      timber_nodenames["moretrees:jungletree_leaves_red"]    = true
--cut this fruits down too
      timber_nodenames["moretrees:acorn"]               = true
      timber_nodenames["moretrees:coconut"]                  = true
      timber_nodenames["moretrees:pine_cone"]                = true
      timber_nodenames["moretrees:fir_cone"]                 = true
      timber_nodenames["moretrees:spruce_cone"]              = true


   end
end

-- Support growing_trees
if minetest.get_modpath("growing_trees") then
   timber_nodenames["growing_trees:trunk"]         = true
   timber_nodenames["growing_trees:medium_trunk"]  = true
   timber_nodenames["growing_trees:big_trunk"]     = true
   timber_nodenames["growing_trees:trunk_top"]     = true
   timber_nodenames["growing_trees:trunk_sprout"]  = true
   timber_nodenames["growing_trees:branch_sprout"] = true
   timber_nodenames["growing_trees:branch"]        = true
   timber_nodenames["growing_trees:branch_xmzm"]   = true
   timber_nodenames["growing_trees:branch_xpzm"]   = true
   timber_nodenames["growing_trees:branch_xmzp"]   = true
   timber_nodenames["growing_trees:branch_xpzp"]   = true
   timber_nodenames["growing_trees:branch_zz"]     = true
   timber_nodenames["growing_trees:branch_xx"]     = true

   if chainsaw_leaves then
      timber_nodenames["growing_trees:leaves"] = true
   end
end

--Support paragenv7
if minetest.get_modpath("paragenv7") then
   timber_nodenames["paragenv7:acaciatree"]    = true
   timber_nodenames["paragenv7:pinetree"]       = true
   timber_nodenames["paragenv7:cactus"]       = true

   if chainsaw_leaves then
      timber_nodenames["paragenv7:acacialeaf"]= true
      timber_nodenames["paragenv7:appleleaf"] = true
      timber_nodenames["paragenv7:jungleleaf"]= true
      timber_nodenames["paragenv7:needles"]    = true
   end
end

-- Support growing_cactus
if minetest.get_modpath("growing_cactus") then
   timber_nodenames["growing_cactus:sprout"]                       = true
   timber_nodenames["growing_cactus:branch_sprout_vertical"]       = true
   timber_nodenames["growing_cactus:branch_sprout_vertical_fixed"] = true
   timber_nodenames["growing_cactus:branch_sprout_xp"]             = true
   timber_nodenames["growing_cactus:branch_sprout_xm"]             = true
   timber_nodenames["growing_cactus:branch_sprout_zp"]             = true
   timber_nodenames["growing_cactus:branch_sprout_zm"]             = true
   timber_nodenames["growing_cactus:trunk"]                        = true
   timber_nodenames["growing_cactus:branch_trunk"]                 = true
   timber_nodenames["growing_cactus:branch"]                       = true
   timber_nodenames["growing_cactus:branch_xp"]                    = true
   timber_nodenames["growing_cactus:branch_xm"]                    = true
   timber_nodenames["growing_cactus:branch_zp"]                    = true
   timber_nodenames["growing_cactus:branch_zm"]                    = true
   timber_nodenames["growing_cactus:branch_zz"]                    = true
   timber_nodenames["growing_cactus:branch_xx"]                    = true
end

-- Support farming_plus
if minetest.get_modpath("farming_plus") then
   if chainsaw_leaves then
      timber_nodenames["farming_plus:cocoa_leaves"] = true
   end
end


local S = technic.getter

technic.register_power_tool("technic:chainsaw", chainsaw_max_charge)

-- Table for saving what was sawed down
local produced = {}

-- Save the items sawed down so that we can drop them in a nice single stack
local function handle_drops(drops)
   for _, item in ipairs(drops) do
      local stack = ItemStack(item)
      local name = stack:get_name()
--dont give snow stacks, just remove snow from sky
      if name~="default:snowblock" and name~="default:snow" then
--give only a few leaves
         if chainsaw_all_leaves or (math.random(0, 50)>48 or (
name~="default:leaves"
and
name~="default:jungleleaves"
and
name~="moretrees:rubber_tree_leaves"
and
name~="moretrees:apple_tree_leaves"
and
name~="moretrees:oak_leaves"
and
name~="moretrees:fir_leaves"
and
name~="moretrees:fir_leaves_bright"
and
name~="moretrees:sequoia_leaves"
and
name~="moretrees:birch_leaves"
and
name~="moretrees:birch_leaves"
and
name~="moretrees:palm_leaves"
and
name~="moretrees:spruce_leaves"
and
name~="moretrees:spruce_leaves"
and
name~="moretrees:pine_leaves"
and
name~="moretrees:willow_leaves"
and
name~="moretrees:jungletree_leaves_green"
and
name~="moretrees:jungletree_leaves_yellow"
and
name~="moretrees:jungletree_leaves_red"
and
name~="moretrees:acorn"
and
name~="moretrees:coconut"
and
name~="moretrees:pine_cone"
and
name~="moretrees:fir_cone"
and
name~="moretrees:spruce_cone"
and
name~="paragenv7:acacialeaf"
and
name~="paragenv7:appleleaf"
and
name~="paragenv7:jungleleaf"
and
name~="paragenv7:needles"

)) then

      local p = produced[name]
      if not p then
         produced[name] = stack
      else
         p:set_count(p:get_count() + stack:get_count())
      end
      end
end
   end
end

--- Iterator over positions to try to saw around a sawed node.
-- This returns positions in a 3x1x3 area around the position, plus the
-- position above it.  This does not return the bottom position to prevent
-- the chainsaw from cutting down nodes below the cutting position.
-- @param pos Sawing position.
local function iterSawTries(pos)
   -- Copy position to prevent mangling it
   local pos = vector.new(pos)
   local i = 0

   return function()
      i = i + 1
      -- Given a (top view) area like so (where 5 is the starting position):
      -- X -->
      -- Z 123
      -- | 456
      -- V 789
      -- This will return positions 1, 4, 7, 2, 8 (skip 5), 3, 6, 9,
      -- and the position above 5.
      if i == 1 then
         -- Move to starting position
         pos.x = pos.x - 1
         pos.z = pos.z - 1
      elseif i == 4 or i == 7 then
         -- Move to next X and back to start of Z when we reach
         -- the end of a Z line.
         pos.x = pos.x + 1
         pos.z = pos.z - 2
      elseif i == 5 then
         -- Skip the middle position (we've already run on it)
         -- and double-increment the counter.
         pos.z = pos.z + 2
         i = i + 1
      elseif i <= 9 then
         -- Go to next Z.
         pos.z = pos.z + 1
      elseif i == 10 then
         -- Move back to center and up.
         -- The Y+ position must be last so that we don't dig
         -- straight upward and not come down (since the Y-
         -- position isn't checked).
         pos.x = pos.x - 1
         pos.z = pos.z - 1
         pos.y = pos.y + 1
      else
         return nil
      end
      return pos
   end
end

-- This function does all the hard work. Recursively we dig the node at hand
-- if it is in the table and then search the surroundings for more stuff to dig.
local function recursive_dig(pos, remaining_charge)
   if remaining_charge < chainsaw_charge_per_node then
      return remaining_charge
   end
   local node = minetest.get_node(pos)

   if not timber_nodenames[node.name] then
      return remaining_charge
   end

--remove snow too for snowy trees
   if node.name=="default:snow" or node.name=="default:snowblock" then
      local bnode = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
      if (bnode.name~="paragenv7:needles" and bnode.name~="paragenv7:pinetree" and bnode.name~="air") then
      return remaining_charge
      end
   end
   if chainsaw_leaves and (node.name=="paragenv7:needles" or node.name=="paragenv7:pinetree") then
      timber_nodenames["default:snowblock"]        = true
      timber_nodenames["default:snow"]             = true
   end

   -- Wood found - cut it
   handle_drops(minetest.get_node_drops(node.name, ""))
   minetest.remove_node(pos)
   remaining_charge = remaining_charge - chainsaw_charge_per_node

   -- Check surroundings and run recursively if any charge left
   for npos in iterSawTries(pos) do
      if remaining_charge < chainsaw_charge_per_node then
         break
      end
      if timber_nodenames[minetest.get_node(npos).name] then
         remaining_charge = recursive_dig(npos, remaining_charge)
      end
   end

   return remaining_charge
end

-- Function to randomize positions for new node drops
local function get_drop_pos(pos)
   local drop_pos = {}

   for i = 0, 8 do
      -- Randomize position for a new drop
      drop_pos.x = pos.x + math.random(-3, 3)
      drop_pos.y = pos.y - 1
      drop_pos.z = pos.z + math.random(-3, 3)

      -- Move the randomized position upwards until
      -- the node is air or unloaded.
      for y = drop_pos.y, drop_pos.y + 5 do
         drop_pos.y = y
         local node = minetest.get_node_or_nil(drop_pos)

         if not node then
            -- If the node is not loaded yet simply drop
            -- the item at the original digging position.
            return pos
         elseif node.name == "air" then
            -- Add variation to the entity drop position,
            -- but don't let drops get too close to the edge
            drop_pos.x = drop_pos.x + (math.random() * 0.8) - 0.5
            drop_pos.z = drop_pos.z + (math.random() * 0.8) - 0.5
            return drop_pos
         end
      end
   end

   -- Return the original position if this takes too long
   return pos
end

-- Chainsaw entry point
local function chainsaw_dig(pos, current_charge)
   -- Start sawing things down

   local remaining_charge = recursive_dig(pos, current_charge)
   minetest.sound_play("chainsaw", {pos = pos, gain = 1.0,
         max_hear_distance = 10})

   -- Now drop items for the player
   for name, stack in pairs(produced) do
      -- Drop stacks of stack max or less
      local count, max = stack:get_count(), stack:get_stack_max()
      stack:set_count(max)
      while count > max do
         minetest.add_item(get_drop_pos(pos), stack)
         count = count - max
      end
      stack:set_count(count)
      minetest.add_item(get_drop_pos(pos), stack)
   end

   -- Clean up
   produced = {}

   timber_nodenames["default:snowblock"]        = false
   timber_nodenames["default:snow"]             = false

   return remaining_charge
end


minetest.register_tool("technic:chainsaw", {
   description = S("Chainsaw"),
   inventory_image = "technic_chainsaw.png",
   stack_max = 1,
   wear_represents = "technic_RE_charge",
   on_refill = technic.refill_RE_charge,
   on_use = function(itemstack, user, pointed_thing)
      if pointed_thing.type ~= "node" then
         return itemstack
      end

      local meta = minetest.deserialize(itemstack:get_metadata())
      if not meta or not meta.charge or
            meta.charge < chainsaw_charge_per_node then
         return
      end

      local name = user:get_player_name()
      if minetest.is_protected(pointed_thing.under, name) then
         minetest.record_protection_violation(pointed_thing.under, name)
         return
      end

      -- Send current charge to digging function so that the
      -- chainsaw will stop after digging a number of nodes
      meta.charge = chainsaw_dig(pointed_thing.under, meta.charge)

      technic.set_RE_wear(itemstack, meta.charge, chainsaw_max_charge)
      itemstack:set_metadata(minetest.serialize(meta))
      return itemstack
   end,
})

minetest.register_craft({
output = "technic:chainsaw",
recipe = {
{"technic:stainless_steel_ingot", "mesecons_button:button_off", "technic:battery"},
{"technic:fine_copper_wire", "technic:motor", "technic:battery"},
{"", "", "technic:stainless_steel_ingot"},
}
})
 

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

Re: [Mod] Technic [0.4.10] [technic]

by VanessaE » Sat Nov 22, 2014 19:14

I'll let one of the other devs deal with the chainsaw, meanwhile I've updated the mesecons-dependent parts of this mod to use the latest mesecons API. Requires mesecons commit 5be179bf or newer.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
Joby
Member
 
Posts: 15
Joined: Mon Dec 01, 2014 17:24
GitHub: JobyB

Re: [Mod] Technic [0.4.10] [technic]

by Joby » Mon Dec 01, 2014 17:53

ThatGraemeGuy wrote:
Marshall_maz wrote:
Nore wrote:It is explained in the manual here: https://github.com/minetest-technic/technic/blob/master/manual.md#uranium-enrichment. Basically, you'll need a lot of centrifuges, which are MV machines.


Thanx for the link. Doesn't help much though.
I have no idea how to set up the centrifuges with tube segments and can't find anywhere help on how that must actually look :(


OK, the whole process looks really complicated, but if you break it down into a few simple facts, you see it isn't that bad,

    Uranium (lumps/dust/ingots) can exist in 36 different grades, from 0.0%-fissile to 3.5%-fissile, in increments of 0.1%.
    The Uranium lumps you get from digging ore are 0.7%-fissile.
    Placing 2 uranium dust of a particular grade of uranium into a centrifuge will result in 1 dust of the lower grade and 1 dust of the higher grade. For example, placing 2 0.7%-fissile dusts into a centrifuge will result in 1 0.6%-fissile dust and 1 0.8%-fissile dust.
    In order to make fuel rods that may be used in the nuclear reactor core, you need to compress 5 x 3.5%-fissile uranium.

So what you need to do (and you really do need to do this, trying to do this manually is quite simply insane), is to automate the entire process of moving the various grades of dust around. The most straightforward arrangement is to simply have 1 centrifuge for each grade of dust from 0.1% to 3.4%. Added to that you have sorting tubes on each centrifuge to make sure the dusts go to the right place each time. You have a grinder where you place your mined 0.7% lumps, and it sends the 0.7% dusts to the centrifuge that handles the 0.7% dusts. The sorting tube attached to that centrifuge will then have filters configured to ensure that 0.7% dust is routed to it, 0.6% dust is routed to the centrifuge lower down the cascade and 0.8% dust is routed to the one higher in the cascade.

This general setup applies to all centrifuges except the 2 at the extreme ends of the cascade. The centrifuge outputting 0.0%-fissile dust will not feed into another centrifuge, instead you can whatever you want with those dusts. I chose to feed them into a furnace to make ingots, which in turn outputs to an autocrafter which makes blocks from every 9 ingots. At the other extreme, the centrifuge which takes 3.4% dust as input will have its 3.5% dust outputted to a furnace, which in turn outputs to a compressor, which will compress 5 ingots into a fuel rod. This you can then output to a chest.

Here's a visual.




Hi, I've been trying to get this to work but just can't has something changed recently in the code or am I missing something?

First issue is the sorting pipes, is the setup just to drop the value of dust onto the input port to the cent and leave the rest on and empty? In the pic on the right side the red row. The output refined dust will come back through this and be different values or does that not matter?


Second issue, it looks like that the dust piles are floating around individually, I read that if a single dust unit gets into a centrifuge it will block it, how do you make sure that the dust stays in multiples of 2?

1 ore unit -> grinder -> 2x 0.7 cent -> 1 unit each of 0.6 and 0.8 blocks both those cents...

is the simple answer to never put an odd number of raw ore into the grinder?
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Tue Dec 02, 2014 06:51

Joby wrote:Hi, I've been trying to get this to work but just can't has something changed recently in the code or am I missing something?


There are changes every now and then, but as far as I'm aware nothing that affects centrifuge cascade setups. At least mine have not required any changes.

Joby wrote:First issue is the sorting pipes, is the setup just to drop the value of dust onto the input port to the cent and leave the rest on and empty? In the pic on the right side the red row. The output refined dust will come back through this and be different values or does that not matter?


First, a few things:

  • You can input things from any side
  • Output (assuming you have at least control logic unit in an upgrade slot) is always to the machine's right side. If you stand with the machine directly in front of you, the front is the side that lights up when the machine is active

So if you are referring to my earlier screenshot, you can see the machines on the right have the red side attached on the machine, the white side goes up and the black side goes down. If you take the 0.7% centrifuge as an example:

  • Red = 0.7%
  • White = 0.8%
  • Black = 0.6%

Joby wrote:Second issue, it looks like that the dust piles are floating around individually, I read that if a single dust unit gets into a centrifuge it will block it, how do you make sure that the dust stays in multiples of 2?

1 ore unit -> grinder -> 2x 0.7 cent -> 1 unit each of 0.6 and 0.8 blocks both those cents...

is the simple answer to never put an odd number of raw ore into the grinder?


They do move around as single dusts, but this isn't an issue because you will have set up the sorting tubes to route things properly. Each centrifuge will handle only 1 grade of dust. I'm not sure what you are referring to when you mention dust blocking centrifuges. If a centrifuge has only 1 dust in the input slot it simply doesn't activate until such time it has received another. There's no need to try and keep even numbers of inputs.
 

User avatar
Joby
Member
 
Posts: 15
Joined: Mon Dec 01, 2014 17:24
GitHub: JobyB

Re: [Mod] Technic [0.4.10] [technic]

by Joby » Tue Dec 02, 2014 21:34

Thanks so much for your reply! that answers all my questions I'll try it out tonight, I had only configured the Red line, left white and black empty, that must be what I did wrong, that and getting them spun the right way :)

The "blocking" I was referring too was a misunderstanding by me of something I read, I thought I had read that if only 1 unit of U gets in into a cent it will not work and be blocked, what was actually meant was if a different % of U gets into a cent say a 0.6 in the 0.7 it will be blocked.

EDIT: Yup that worked!! thanks again.
 

ThatGraemeGuy
Member
 
Posts: 126
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy

Re: [Mod] Technic [0.4.10] [technic]

by ThatGraemeGuy » Wed Dec 03, 2014 07:30

You're welcome!
 

GeneralNIff
New member
 
Posts: 1
Joined: Sat Dec 06, 2014 08:03
In-game: GeneralNiff

Re: [Mod] Technic [0.4.10] [technic]

by GeneralNIff » Sat Dec 06, 2014 08:10

I can't make the crafting recipe work for the fine copper wire.
bandicam 2014-12-06 01-09-31-718.jpg
bandicam 2014-12-06 01-09-31-718.jpg (94.44 KiB) Viewed 3314 times
 

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

Re: [Mod] Technic [0.4.10] [technic]

by kaeza » Sat Dec 06, 2014 09:47

GeneralNIff wrote:I can't make the crafting recipe work for the fine copper wire

The recipe seems right. Are you sure you enabled the mod? Try starting the game in creative mode and see if the items appear in the creative inventory.

If not, select the world in the mainmenu, click "Configure", select technic, and click "Enable Modpack".
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

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

Jesseman1
Member
 
Posts: 49
Joined: Fri Dec 12, 2014 21:32
In-game: Jesseman1 or Plant_Operator

Re: [Mod] Technic [0.4.10] [technic]

by Jesseman1 » Sat Dec 13, 2014 05:24

I'm loving this mod, thank you so much for making it! I'm still new to all of this, but is there a way to toggle the current off/on in your voltage cables? I'd like to be able to set up a forcefield around my nuclear reactor, but not get stuck inside the forcefield as well, so is there a way to integrate a switch into the cable to turn on the forcefield from the outside? If not, would you consider adding the means to do so in the next update? That would be really cool, thanks.
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Technic [0.4.10] [technic]

by ShadowNinja » Mon Dec 15, 2014 22:26

Jesseman1 wrote:Is there a way to integrate a switch into the cable to turn on the forcefield from the outside?

Yes (just dig/place a cable node), but you probably don't want to do this. The forcefield and it's power source has to be self-contained or anyone can get through your field by disabling your power source (this can be mitigated with protection though).
What I'd do is set up a steel door at the edge of the field. The emitter won't replace it, but only you'll be able to open and close it to get through.
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

Jesseman1
Member
 
Posts: 49
Joined: Fri Dec 12, 2014 21:32
In-game: Jesseman1 or Plant_Operator

Re: [Mod] Technic [0.4.10] [technic]

by Jesseman1 » Wed Dec 17, 2014 01:55

ShadowNinja wrote:What I'd do is set up a steel door at the edge of the field. The emitter won't replace it, but only you'll be able to open and close it to get through.


I actually figured that out shortly after posting, lol. I even used the prefab mod (adds tons of concrete stuff) to make everything inside the forcefield look like an intimidating high-security fortress! I just wish I knew how to make it a multyplayer server, I've designed it to allow other players use the excess power outside of the forcefield(two reactors FTW!).
 

Miner59
Member
 
Posts: 46
Joined: Mon Sep 22, 2014 19:14

Re: [Mod] Technic [0.4.10] [technic]

by Miner59 » Thu Dec 25, 2014 10:42

Hi,
with newest version from github I always get a lua error in /technic/machines/register/recipes.lua, line 30
Can you please change

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function register_recipe(typename, data)
   -- Handle aliases
   for i, stack in ipairs(data.input) do
      data.input[i] = ItemStack(stack):to_string()
   end


in

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function register_recipe(typename, data)
   -- Handle aliases
   if type(data.input) == "table" then
      for i, stack in ipairs(data.input) do
         data.input[i] = ItemStack(stack):to_string()
      end
   else
      data.input={}
      data.input[1] = ItemStack(data.input):to_string()
   end


Then it should work without problems.
 

User avatar
ShadowNinja
Member
 
Posts: 194
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

Re: [Mod] Technic [0.4.10] [technic]

by ShadowNinja » Fri Dec 26, 2014 04:03

Miner59 wrote:With the latest version from GitHub I always get a Lua error in .../technic/machines/register/recipes.lua line 30.


It seems like another mod is using the technic registration API in an invalid way (input isn't a table). Your code won't actually work because it clears the input before reading it. Change the minetest.after call in technic.register_recipe to a direct register_recipe call to find out what mod is calling technic.register_recipe invalidly and report a bug with that mod.

Alternatively, a variant of your code could be applied for convenience, but it only saves two characters and it would be classified as a feature request, not a bug fix.
I play on my Minetest server and VanessaE's.
The best way to contact me is usually IRC (InchraNet, freenode).
 

PreviousNext

Return to Mod Releases

Who is online

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

cron