I'd like to use some of the minetest maps to create some maths/puzzle games for my daughter.
My plan is to have a game to search through buildings and locations, but that you will have to solve a series of puzzles along the way. Hopefully it's possible to restrict player access to particular zones, and have doors which cannot be opened until the puzzle has been solved.
The access state should be saved across sessions, but ideally I would like it to be player specific, so it could be put on a server and people play the quests together, so that ideally each individual has to do each puzzle, but only once.
I've found various posts which seem to show that all my ideas should work in minetest, but unfortunately not found any already functioning code for the basic nodes so will have to try and cobble things together, I'm thus wondering if anyone knows of any mods which are close to what I want, or could quickly create something (I'm not a very good coder, so even having found potential examples below am probably looking at a number of hours, not to mention then having to add the items to maps).
My plans are:-
To start with locks/puzzles would probably be simple 4*7 = ??, etc, so text entry to/from a dialog box would be the best initial approach. Something like: the vending machine of viewtopic.php?id=3039
I can't find anywhere detailing how to restrict a player to/from particular zones, but if it was possible to have a node check it's state when bumped into, it should be possible to create invisible walls which set their penetrability state depending on the player (starting with code from the bedrock mod:https://forum.minetest.net/viewtopic.php?f=11&t=1233). This would mean doors might be open, but impassable, but would at least provide a starting point.
worldedit has code for invisible nodes in ./worldedit/visualization.lua, which also provides an example of storing metainformation in the node.
I think this would be possible using the same type of approach as the mesecons "Player/Object Detector" which could then power something the "ghoststone"/invisiblock to disappear.
Saving variables across sessions is feasible. It looks like I can just create a global array which lists each door/puzzle and add a playersname to it when the puzzle is completed. The madblocks mod saves and reloads info to a file in bookmark.lua (download is https://github.com/cyisfor/minetest-madblocks), so would provide a basis for this. ./worldedit/serialization.lua has a much more complicated equivalent.
I should be able to use this table as a lookup table when an invisiwall node is hit by a player to check if they have permission to pass through that node.
Doors states can be linked/set (like the gates mod: viewtopic.php?f=11&t=896)
(or more specifically viewtopic.php?p=9010#p9010).
I'm also not sure how to have a door automatically open/close. Looks like there was an automatic sliding door done with mesecons (viewtopic.php?p=56024#p56024) , but as above I'm not super keen on mesecons. It would seem to be an option to have an invisible 'doormat' in front of each door which closed it when the player had passed through, but might just be easier to have the door shut on a timer, and also automatically shut if a non-authorised player tried to pass through.
Messages can be shown when hovering over a node (as in the simple doors mod: viewtopic.php?id=590)
minigame/puzzle door locks would be possible (like viewtopic.php?id=3698).
[I'm not keen on using mesecons as difficult to automate placement, and 'messy' on the map.]
Ideally if I'm using pre-existing maps, automatically replacing doors with puzzle doors would be a great time saver (something like a worldedit replace function). Ideally if the door texture could be kept, and the puzzle function just bolted on (not sure how to do this).
Using a similar idea to the instafill mod (viewtopic.php?id=5262) (ie fills between blocks with same type) would also make creating invisiwalls much quicker.
Automatically build houses with rooms - this would help with generating villages/etc with lots of buildings/rooms (haven't found anything remotely similar to this), but fireballs (viewtopic.php?f=11&t=6154) shows how to access nodes in proximity.
Other potential ideas/steps:
Learn how to read [phonics] mod: viewtopic.php?f=11&t=4237