Learning game: player specific door locks/puzzles/walls

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Learning game: player specific door locks/puzzles/walls

by dgm5555 » Fri Apr 25, 2014 13:10

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
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Learning game: player specific door locks/puzzles/walls

by Sokomine » Mon Apr 28, 2014 14:45

Take a look at some of my mods. Especially locks. While intended for multiplayer servers and for sharing objects, it also provides a password field. You might add a sign with the riddle above the door/chest and set the solution as the password. Correctly entered passwords are only stored for some time and not 100% secret (but once you know how to read them out, you've got to solve more complex equations than what you have in mind :-)).

There was also a thread recently about teaching mathematics to children. Some mods where introduced there (afaik by sfan5). Take a look at that :-)

As for spawning huge apartment complexes: My apartment mod may help. It can store a pattern (=one apartment or house) and create multiple copies, with each second one varying in one material so that it doesn't look too boring. Access to these apartments is obtained by just renting one...perhaps you might want to include a puzzle there.

I'm planning to extend my traders mod and adding a mob that stands around and - when right-clicked - shows a formspec with a question. That'll be the start for a small rpg system. I'm just not sure yet how to handle the configuration of those mobs - they have their question, and they expect an answer (might as well be "yes, please take that block you're looking for out of my inventory"). Answers can in theory be given exactly (like the solution for your equations), or they may contain words the mob is looking for (i.e. anything containing "hallo" or "hi" might extract a greeting from the mob), or as multiple choice. Of course, real RPG or quest systems are more complex...
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: Learning game: player specific door locks/puzzles/walls

by dgm5555 » Mon Apr 28, 2014 21:13

Baby-step 1: An invisible brick which allows access when you get close to it (if you're quick you can feel it stop you before it 'disappears'). Extract the zip into the mesecons directory
Attachments
mesecons_invisiwall.zip
(1.98 KiB) Downloaded 77 times
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: Learning game: player specific door locks/puzzles/walls

by hajo » Wed Feb 01, 2017 14:24

dgm5555 wrote:minetest maps to create some maths/puzzle games for my daughter. ..
search through buildings and locations, .. solve a series of puzzles along the way.

Have a look at basic_machines and basic_robots.
basic_machines has keypads (big pushbuttons), detectors and movers.

Keypads & detectors can activate other objects,
movers can move objects & teleport players.

And robots can do almost everything...

I'm also not sure how to have a door automatically open/close.

Maybe visit the ROBOTS-server (46.150.38.198:30000) - there is a math-puzzle
right at the start (solve quiz to get out of the spawn-building).

Also several automatic- and puzzle-doors are scattered around,
eg. the door at the entrance to the mines, and to the robots-tutorial.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 4 guests

cron