Page 1 of 1

[Mod] Scriptmine

PostPosted: Wed Oct 26, 2016 11:56
by dulsimikar
My son recently attended a "Coding with Minecraft" class at the library. He enjoyed himself and wanted to play with it at home. Since we don't have minecraft, I decided to see how hard it would be to implement it in minetest. The class used scriptcaft. After a little playing around, I managed to load the duktape javascript engine in minetest and get echo working. It's just a prototype at the moment. I don't have compiling/installing instructions yet.

https://github.com/dulsi/scriptmine

Why use javascript instead of just teaching him lua? Because he has friends using minecraft. If he has a compatible mod, they can trade scripts. Also scriptcraft is hard for people to install. If I had a simple package with minetest, I can probably get more people to try it out.

Re: [Mod] Scriptmine

PostPosted: Wed Oct 26, 2016 14:25
by twoelk

Re: [Mod] Scriptmine

PostPosted: Thu Oct 27, 2016 11:13
by azekill_DIABLO
looks nice!

Re: [Mod] Scriptmine

PostPosted: Fri Oct 28, 2016 03:30
by dulsimikar
I got box and box0 functions on drones working. Looking at some of the other functions have made me wonder about my approach. Right now Drone is mostly implemented in C code. I'm thinking I should reuse the javascript implementation in ScriptCraft as much as possible instead.

Re: [Mod] Scriptmine

PostPosted: Sun Oct 30, 2016 00:53
by dulsimikar
Ok. Hack as much code as quickly as possible to get scriptcraft's drone working is done. I can now do '/js sphere0(10, 41)' and make a giant gold hollow sphere. Some of the scriptcraft drone is not implemented yet like doors, ladders, garden, etc. My son wants to make a castle so I've focused on the functions needed for that. I've got the chessboard.js working. fort.js needs doors, ladders, and torches. Looks like castle.js doesn't need anything else.

How do I place a door in lua? I tried set_node and place-node but I haven't gotten them to work. Is item_place_node needed to do that? Does anyone have a example placing a door in lua?

I also decided to look at building the mod for windows. The windows minetest build is not dynamically linking to lua/luajit. Which means I can just hook this in. I haven't decided how I'm going to solve that problem yet.