Page 2 of 2

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Fri Sep 05, 2014 14:24
by GJH105775
Here is the init.lua

Code: Select all

--fancy wood
minetest.register_node("xtrablocks:fancywood", {
    tile_images = {"xtrablocks_fancywood.png"},
    groups={snappy=2,choppy=3,oddly_breakable_by_hand=2,flammable=3},
	description = "FancyWood"
    }
})

--fancy tile cobble,stone
minetest.register_node("xtrablocks:fancytile", {
    tile_images = {"xtrablocks_fancytile.png"},
    groups={cracky=3},
	description = "FancyTileStone",
})
minetest.register_craft({
    output = '"xtrablocks:fancytile" 2',
    recipe = {
        {'default:cobble', 'default:stone', ''},
        {'default:stone', 'default:cobble', ''},
        {'', '', ''},
    }
})


--fancy marble
minetest.register_node("xtrablocks:fancymarble", {
    tile_images = {"xtrablocks_fancymarble.png"},
    groups={cracky=1},
	description = "Marble1",
})

minetest.register_craft({
    type = "cooking",
    output = "xtrablocks:fancymarble",
    recipe = "default:stone",
})


--fancy pure white marble
minetest.register_node("xtrablocks:fancypurewhitemarble", {
    tile_images = {"xtrablocks_fancypurewhitemarble.png"},
    groups={cracky=1},
	description = "WhiteMarble",
})

--fancy green marble
minetest.register_node("xtrablocks:fancygreenmarble", {
    tile_images = {"xtrablocks_fancygreenmarble.png"},
    groups={cracky=1},
	description = "GreenMArble",
})


--fancy black marble
minetest.register_node("xtrablocks:fancyblackmarble", {
    tile_images = {"xtrablocks_fancyblackmarble.png"},
    groups={cracky=1},
	description = "BleckMarble",
})

--fancy red marble
minetest.register_node("xtrablocks:fancyredmarble", {
    tile_images = {"xtrablocks_fancyredmarble.png"},
    groups={cracky=1},
	description = "RedMarble",
})
--generation

local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
	if maxp.y < height_min or minp.y > height_max then
		return
	end
	local y_min = math.max(minp.y, height_min)
	local y_max = math.min(maxp.y, height_max)
	local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
	local pr = PseudoRandom(seed)
	local num_chunks = math.floor(chunks_per_volume * volume)
	local chunk_size = 3
	if ore_per_chunk <= 4 then
		chunk_size = 2
	end
	local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
	--print("generate_ore num_chunks: "..dump(num_chunks))
	for i=1,num_chunks do
	if (y_max-chunk_size+1 <= y_min) then return end
		local y0 = pr:next(y_min, y_max-chunk_size+1)
		if y0 >= height_min and y0 <= height_max then
			local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
			local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
			local p0 = {x=x0, y=y0, z=z0}
			for x1=0,chunk_size-1 do
			for y1=0,chunk_size-1 do
			for z1=0,chunk_size-1 do
				if pr:next(1,inverse_chance) == 1 then
					local x2 = x0+x1
					local y2 = y0+y1
					local z2 = z0+z1
					local p2 = {x=x2, y=y2, z=z2}
					if minetest.env:get_node(p2).name == wherein then
						minetest.env:set_node(p2, {name=name})
					end
				end
			end
			end
			end
		end
	end
	print("generate_ore done")
end

minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("xtrablocks:fancymarble", "default:stone", minp, maxp, seed+16,   1/11/11/11,    8, -31000,  64)
generate_ore("xtrablocks:fancypurewhitemarble", "default:stone", minp, maxp, seed+17,   1/8/8/8,    2, -31000,  8)
generate_ore("xtrablocks:fancygreenmarble", "default:stone", minp, maxp, seed+18,   1/9/9/9,    5, -31005,  2)
generate_ore("xtrablocks:fancyredmarble", "default:stone", minp, maxp, seed+19,   1/12/12/12,    9, -31000,  64)
generate_ore("xtrablocks:fancyblackmarble", "default:stone", minp, maxp, seed+99,   1/15/15/15,    2, -31000,  8)
--generate_ore("xtrablocks:fancygreenmarble", "default:stone", minp, maxp, seed+18,   1/9/9/9,    5, -31005,  2)
--generate_ore("moreores:xtrablocks:fancyblackmarble", "default:stone", minp, maxp, seed+18,   1/10/10/10,    5, -31000,  2)
--generate_ore("moreores:xtrablocks_fancyredmarble", "default:stone", minp, maxp, seed+19,   1/11/11/11,    5, -31000,  -64)
--generate_ore(":mineral_mithril", "default:stone", minp, maxp, seed+20,   1/6/6/6,    1, -31000,  -512)
end)




Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Fri Sep 05, 2014 16:08
by balthazariv
Hello,

Now, i have items in my inventory but
17:58:18: ERROR[main]: Failed to load and run script from
17:58:18: ERROR[main]: L:\Minetest\minetest - Copie\bin\..\mods\xtrablocks\init.lua:
17:58:18: ERROR[main]: ...inetest\minetest - Copie\bin\..\mods\xtrablocks\init.lua:7: ')' expected (to close '(' at line 2) near '}'
You have :

Code: Select all

--fancy wood
minetest.register_node("xtrablocks:fancywood", {
    tile_images = {"xtrablocks_fancywood.png"},
    groups={snappy=2,choppy=3,oddly_breakable_by_hand=2,flammable=3},
   description = "FancyWood"
    }
})
You need :

Code: Select all

--fancy wood
minetest.register_node("xtrablocks:fancywood", {
    tile_images = {"xtrablocks_fancywood.png"},
    groups={snappy=2,choppy=3,oddly_breakable_by_hand=2,flammable=3},
   description = "FancyWood"    
})

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Wed Feb 25, 2015 14:18
by GJH105775
Thanks, repaired it. I have not been very active lately. Looking into making a very bright light block for devs, or droppable flares.

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Fri Oct 09, 2015 22:50
by GJH105775
Not directly related to the mod, but I may decide to get back into updating and adding onto it haha:

A couple weeks ago I got the contract for a 1C6 job (SPACE SYSTEMS OPERATIONS), I go to AFBMT (Air Force Basic Military Training) this coming July. I got my dream sheet (list of bases that you can choose from, but it is called a dream sheet because you are not guaranteed like jobs are).

I am hoping to get to go to Cape Canaveral, Florida or Vandenberg, California for my first two years of enlistment and after that I'd hope to go to Ramstein AFB in German. Anyways, NASA or DARPA have kinda been dream jobs for me. Any of you guys have advice on bases, or a story of getting your dream job?

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Fri Oct 09, 2015 23:21
by blert2112
I live just west of KSC, on the other side of the river. If you have kids pray you do not get sent here... The school system sucks hard. I pulled both my kids out and have been homeschooling them for the past two years. Other than that, Florida is nice.

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Sat Oct 10, 2015 01:03
by GJH105775
blert2112 wrote:I live just west of KSC, on the other side of the river. If you have kids pray you do not get sent here... The school system sucks hard. I pulled both my kids out and have been homeschooling them for the past two years. Other than that, Florida is nice.
Hahahaha, not married so that should not be a problem.

Image

Re: [Mod] xtrablocks [0.0.1] [Marble_Blocks] New File Host

Posted: Sun Oct 25, 2015 18:15
by GJH105775
What suggestions would you guys have?