BiLachner / TurtleMiner

A mod for Minetest to let builder become programmer
GNU General Public License v3.0
10 stars 9 forks source link

Formspec Improvements #2

Open BiLachner opened 8 years ago

BiLachner commented 8 years ago
octacian commented 8 years ago

I think the best way to do this is to reconsider the entire direction of the formspec. Instead of building a formspec that updates as the player presses a button, we should be building a text-based editor then a visual-based editor for players to interact with. When they press the "Run" button code could then be run. Take a look at my "editor" branch where I've already done a bit of work, but since I'll be unable to do much for at least a week, I committed my work so far.

To get it working properly, I still have to remove sounds and improve the environment as some things still cause the server to crash.

Inventory is quite simple. Though I've never done it before, all you've gotta do is look at the code in the nodes.lua file of the default mod and find the node register for default:chest. Just use the formspec and much of the code there simply adding a button at the top to switch between the inventory and the main formspec. From there it will be simple to get turtles to add nodes they break to the inventory. Or items they pick up.