Montandalar / gregon_litematica

Litematica clone for Minetest
GNU Affero General Public License v3.0
0 stars 0 forks source link

Can't load litematica schems #1

Closed AnarchyEnthusiast closed 1 week ago

AnarchyEnthusiast commented 2 weeks ago

Hi, i have no fuckin clue how this works and ive been trying for like an hour

I got it to "Saved to litematica_output setting", but now how do i load it back in? .liteload Don't do anything, if i put .liteload $ it just says a whole bunch of stuff about amethyst and calcite and nothing happens.. Any help?

Montandalar commented 2 weeks ago

Sorry, this mod should really come with a big warning label saying "Alpha, do not use unless you're prepared to read the code". Basically, all the node names and texture names have to be put into settings, and there's no nice user-friendly tool for doing that. Currently the default configuration only ships with a measly 5 nodes from Mineclone2 included. When you load successfully, it places particles like this in your world:

litematica_loaded

I will get around to making a tool for fetching the texture names eventually. It will be a server-side mod that you run and it will create what you need to put into your settings, so that you can paste that in. The mod can then ship with working definitions for Mineclone2 and Minetest Game at least.

By the way, what game and mods are you playing with?

AnarchyEnthusiast commented 2 weeks ago

I am playing on Pandorabox server (https://github.com/pandorabox-io/pandorabox-mods)

I dont really care about specific item preview for my project.. Is there a way i can just make it convert all the nodes that aren't "air" to display all the same thing? i.e, cobble, or dirt or something etc? all i want is to be able to see where the nodes go not necessarily every type of node

Montandalar commented 2 weeks ago

Hi,

I've added texture definitions for the PandoraBox modpack for MTG and vanilla VoxeLibre into the mod. I figured PandoraBox was not too specific to do since it contains a fair amount of MTG mods that are used elsewhere. The result is that I've got two new repositories involved for users - it was never going to work as just a CSM.

First there's the texture pack. It's optional, but you get a default texture for nodes Litematica doesn't know, and the WorldEdit textures in case the server doesn't have those. I couldn't just provide the textures inside of the CSM unfortunately. https://github.com/Montandalar/litematica_textures

Secondly, there's a branch for dumpnodes adapted for Litematica, which you can use to make your own texture list files (some modifications to Lua file still required, unless you replace the built-in ones) https://github.com/Montandalar/dumpnodes/tree/litematica

I know all of this is still quite hacky, but let me know how it suits your usecase. If you have a good idea of what to do with the mod, then I'll work on making it easier to actually use and less crash-prone.

AnarchyEnthusiast commented 2 weeks ago

Awesome thanks! so i was able to get it working in single player.. However in multiplayer (pandorabox) i got this error. Keep in mind i haven't got a lick of knowledge when it comes to programming. I assume this just means the server can't support litematica?

I can load schems i saved in offline world to the online world, but can't save schems on the online world.. which is not something i need a lot, but would still be nice.

Output of .litesave on pandorabox


Access denied. Reason: Lua: Runtime error from mod 'litematica' in callback on_sending_message(): litematica:init.lua:364: attempt to index local 'node' (a nil value)
stack traceback:
    litematica:init.lua:364: in function 'litematica_serialize'
    litematica:init.lua:416: in function 'func'
    *builtin*:client/chatcommands.lua:33: in function <*builtin*:client/chatcommands.lua:3>
    *builtin*:client/register.lua:25: in function <*builtin*:client/register.lua:13>
Montandalar commented 2 weeks ago

Yes, PandoraBox has restricted CSMs from reading nodes. You'll have to live without that feature. You can determine what restrictions the CSM environment has with this little mod I whipped up:

local locale, langcode = minetest.get_language()
local msgs = {
    string.format("Modname: %s\n", minetest.get_current_modname()),
    string.format("Modpath: %s\n", minetest.get_modpath(minetest.get_current_modname())),
    string.format("Language: %s // %s\n", locale, langcode),
    "Version Info = ", dump(minetest.get_version()),
    "\nCSM Restrictions = ", dump(minetest.get_csm_restrictions()),
}

local whatwegot = table.concat(msgs)

local dm = function(...)
    minetest.display_chat_message(string.format(...))
end

minetest.register_chatcommand("showmewhatyougot", {
    description = "Print info about the CSM environment",
    func = function()
        minetest.display_chat_message(whatwegot)
    end
})

I have updated the mod to not crash in case of node reading being restricted and in case of not having set both positions. You'll also get a warning on server-join if the lookup_nodes restriction is set.

AnarchyEnthusiast commented 2 weeks ago

Awesome! thanks so much for the time! Also wondered.. How large on an area can i save to a schematic? I didn't test out exactly where it stopped, but when i got an area of over like.. 80.x.x it just 'nil' when trying to load that schem in.. other than that it works great, and i can still do it in chunks/sections.. rn i dont have much time, but when i get time ill show you a screenshot of the thing im working on and hoping to build :) (I also have some neat things i think this mod could use..) ill fill this out in a bit. thanks!

Montandalar commented 1 week ago

I haven't tested it, but my the limit will probably be whatever is loaded by the client, and the maximum schematic size for WorldEdit schematics, since the mod uses WorldEdit's schematic code as a library. Since you're now able to load a schematic into singleplayer, I'm going to mark this issue as solved. If you have more issues or suggestions, feel free to add them.

AnarchyEnthusiast commented 1 week ago

Heres what me and my buddy are going to build

First, we modeled it in blender, next we are going to import it into minetest using the Voxelizer mod, then we will save the schematic from our offline world and build it in survival on Pandorabox. Hopfully it will span about 2,000 blocks from end to end.

Also thought it would be neat to be able to save multiple schematics.. Like .litesave 1 and .litesave 2. giving you 2 schematics, letting you load either one using .liteload 1/2 (idk if this is possible)

Thanks for the help and everything btw :) hopefully ill start work on this as soon as i can get Voxelizer working Screenshot from 2024-09-02 09-56-57 Screenshot from 2024-09-02 09-58-25 image