Giter VIP home page Giter VIP logo

saveschems's People

Contributors

ezhh avatar paramat avatar sofar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

saveschems's Issues

incorrect schematics in here

The minetest_game schematics were changed and those changes not merged back in here:

Binary files schematics/acacia_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/acacia_tree.mts differ
Binary files schematics/apple_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/apple_tree.mts differ
Binary files schematics/apple_tree_from_sapling.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/apple_tree_from_sapling.mts differ
Binary files schematics/jungle_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/jungle_tree.mts differ
Binary files schematics/large_cactus.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/large_cactus.mts differ
Binary files schematics/papyrus.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/papyrus.mts differ
Binary files schematics/pine_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/pine_tree.mts differ

We need to see if we can find the modified schematics so this repo will have the correct and used minetest_game tree models again.

Data reversal method for upright tables

I can work on this if desired as an additional function for use with future lua tables, it works.
I will call the function 'mts_save_rev' since it reverses the lua table.

local mts_convert = function(name, schematic)
	-- Reverse data table
	local datarev = {}
	local datasize = #schematic.data
	for i = 1, datasize do
		datarev[i] = schematic.data[datasize + 1 - i]
	end
	schematic.data = datarev

	local s = minetest.serialize_schematic(schematic, "mts", {})
	local path = minetest.get_modpath("saveschems") .. "/schematics"
	local filename = path .. "/" .. name .. ".mts"
	filename = filename:gsub("\"", "\\\""):gsub("\\", "\\\\")
	local file, err = io.open(filename, "wb")
	if err == nil then
		file:write(s)
		file:flush()
		file:close()
	end
	print("Wrote: " .. filename)
end

Tested tiny pine:


local L = {name = "default:pine_needles", prob = 255}
local T = {name = "default:pine_tree", prob = 255, force_place = true}

mts_convert("tiny_pine", {
	size = {x = 3, y = 4, z = 3},
	data = {
		_, _, _,
		L, L, L,
		_, _, _,
		_, _, _,

		_, L, _,
		L, T, L,
		_, T, _,
		_, T, _,

		_, _, _,
		L, L, L,
		_, _, _,
		_, _, _,
	},
})

Schematics folder needs adding for mod operation

The repo now misses a schematics folder, obviously due to the new gitignore, however this means the mod doesn't work as-is, it needs a folder named 'schematics' adding. This may confuse users. Maybe add a comment about this somewhere? Or is there a way to have the folder present but empty?
Maybe even include the actual schematics in the folder, they're small files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.