PilzAdam wrote:(...)
But I dont want to add this. I want some sounds that are played randomly.
As you wish. I just care about realistic sound.
Besides, there is nothing to stand in the way the default soundtrack consisted of randomly generated sounds while other sounds are played after the discovery of appropriate events.
PilzAdam wrote:(...)
But I dont want to add this. I want some sounds that are played randomly.
As you wish. I just care about realistic sound.
Besides, there is nothing to stand in the way the default soundtrack consisted of randomly generated sounds while other sounds are played after the discovery of appropriate events.
ServerError: LuaError: error running function 'on_rightclick':
...v-20120606-win32\bin\..\mods\minetest\carts\init.lua:727: attempt to call
method 'is_player' (a nil value)
graphics boy wrote:ServerError: LuaError: error running function 'on_rightclick':
...v-20120606-win32\bin\..\mods\minetest\carts\init.lua:727: attempt to call
method 'is_player' (a nil value)
Do you have latest version (29) of carts installed?
Do you have latest version (0.4.2-rc1) of minetest installed?
I think I may have some input. n.n The minecarts in Minecraft were rectangular boxes, and these are square. Now, let me just say that I don't really care about the shape, but I was considering some general ideas about the carts:
Make 3 points within a rectangular minecart.
<back point (follows track)><player point(stays between the back and front points)><front point (follows track)>
Doing this could (in theory) make a smoother looking minecart, and possibly eliminate some of the lag in the cart's player movement. Just an idea, but thought it might come in handy.
aFoxNamedMorris wrote:I think I may have some input. n.n The minecarts in Minecraft were rectangular boxes, and these are square. Now, let me just say that I don't really care about the shape, but I was considering some general ideas about the carts:
Make 3 points within a rectangular minecart.
<back point (follows track)><player point(stays between the back and front points)><front point (follows track)>
Doing this could (in theory) make a smoother looking minecart, and possibly eliminate some of the lag in the cart's player movement. Just an idea, but thought it might come in handy.
This wouldnt fix the lag when transporting players. Its an engine thing and I cant fix that in my mod.
minetest.register_node("carts:furnace", {
description = "Furnace",
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front.png"},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Automated Furnace")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("in", 4)
inv:set_size("dst", 9)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("in") then
return false
end
return true
end,
})
minetest.register_node("carts:furnace_active", {
description = "Furnace",
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front_active.png"},
paramtype2 = "facedir",
light_source = 8,
drop = "carts:furnace",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Automated Furnace");
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("in", 4)
inv:set_size("dst", 9)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("in") then
return false
end
return true
end,
})
function hacky_swap_node(pos,name)
local node = minetest.env:get_node(pos)
local meta = minetest.env:get_meta(pos)
local meta0 = meta:to_table()
if node.name == name then
return
end
node.name = name
local meta0 = meta:to_table()
minetest.env:set_node(pos,node)
meta = minetest.env:get_meta(pos)
meta:from_table(meta0)
end
minetest.register_abm({
nodenames = {"carts:furnace","carts:furnace_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.env:get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"in_totaltime",
"in_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end
local inv = meta:get_inventory()
local inlist = inv:get_list("in")
local cooked = nil
if inlist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = inlist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("in_time", meta:get_float("in_time") + 1)
if cooked and cooked.item and meta:get_float("in_time") >= cooked.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",cooked.item) then
-- Put result in "dst" list
inv:add_item("dst", cooked.item)
-- take stuff from "in" list
instack = inv:get_stack("in", 1)
instack:take_item()
inv:set_stack("in", 1, instack)
else
print("Could not insert item'")
end
meta:set_string("in_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Furnace active: "..percent.."%")
hacky_swap_node(pos,"carts:furnace_active")
meta:set_string("formspec",
"invsize[8,9;]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;in;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]")
return
end
local fuel = nil
local cooked = nil
local fuellist = inv:get_list("fuel")
local inlist = inv:get_list("in")
if inlist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = inlist})
end
if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
meta:set_string("infotext","Furnace out of fuel")
hacky_swap_node(pos,"carts:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec)
return
end
if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Furnace is empty")
hacky_swap_node(pos,"carts:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec)
end
return
end
Last edited by tinoesroho on Tue Aug 14, 2012 03:48, edited 1 time in total.
We are what we create.
I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.
It wasn't that hard to do. I wound up disabling normal furnaces and left automated stuff as a replacement. Now if only I could get automated pickup of the output...
We are what we create.
I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.
remove this line from furnaces code. its a bug. when filled whole inventory will cause crash, and world will be unusable.
or at least remove ..cooked.item..
I tried this & it works! thank's PilzAdam you make great mods i find them very cool! Also an way to ride the cart is to stand on it but it's very glitchy. When will we be able to ride the carts?
Josh wrote:I tried this & it works! thank's PilzAdam you make great mods i find them very cool! Also an way to ride the cart is to stand on it but it's very glitchy. When will we be able to ride the carts?
There need to be some new functions for the lua api. So it depends on the engine developers.
Josh wrote:I tried this & it works! thank's PilzAdam you make great mods i find them very cool! Also an way to ride the cart is to stand on it but it's very glitchy. When will we be able to ride the carts?
There need to be some new functions for the lua api. So it depends on the engine developers.
Yeah... It'd be nice if you could just tap the 'mine' button, teleport in, press the 'place' button, and ride. 4 walls, a floor, and all moving, pushing/pulling the player around.... that'd be nice.
One day, maybe. n.n Tho I've never looked at the code to this game, and my C++ is VERY rusty atm... Maybe I should study again?