Search found 39 matches

by electrodude512
Thu Oct 09, 2014 20:07
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

Are you using "userspace" to refer to sandboxed or normal code? You mean sandboxed code (code the end user writes), right? Don't bother to take away the env from any functions. It will lead to nothing but headaches and subtle security flaws. Instead, wrap the function inside another functi...
by electrodude512
Thu Oct 09, 2014 17:50
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

the resume-line in init.lua is what keeps computers running. that resume executes the systems' coroutines until they yield again (or quit). each computer has it's own coroutine. Yeah, I know. I changed it to what I quoted it as, and you put it back. I was just saying I changed it to figure out why ...
by electrodude512
Wed Oct 08, 2014 13:59
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

I really think we should redo the whole computer environment. All privileged APIs should be loaded into the computer's environment before bootstrap.lua starts, so bootstrap.lua never has access to anything it potentially shouldn't. That way, it's actually completely sandboxed and still will be sandb...
by electrodude512
Tue Oct 07, 2014 16:57
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

Thanks for making me a contributor. I was going to send you a pull request, but Git was being stupid (note to self: don't amend commits after pushing them). I'll talk to you about changing things already in place, but I'm going to go ahead and add stuff that doesn't change stuff you already have. I'...
by electrodude512
Mon Oct 06, 2014 18:27
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

When this was still my project, I wanted terminals and hard drives to be separate from computers. This would let you have computers share harddrives (easy persistent data) and make you not need terminals (cheaper) or be able to use alternate terminals (remote login, HUD, etc.). Another reason to sep...
by electrodude512
Sun Oct 05, 2014 22:51
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

How about we bug the MT devs about adding a minetest.register_on_key and add some way to capture keystrokes before they make it to the game engine, so you can have the normal mode where w is go forward and then another mode where w is type w on the keyboard you're currently pointing at? Then we coul...
by electrodude512
Wed Oct 01, 2014 23:18
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

I've finally found the time to reply to this thread. I don't want to have to compete with someone over two very similar mods, but I was really looking forward to writing this when you stole it. Instead of ending up with two separate competing mods, can we work on this together? I'll go with your ver...
by electrodude512
Sun Sep 28, 2014 00:55
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

I'm not really sure who any of that was to, me or Zeno. I got my library to load. I was passing "threads.so" to require, when I should have been passing just "threads". I made a function that passes the lua state to lua_newstate, lua_xmove's the function on top of the stack of th...
by electrodude512
Thu Sep 25, 2014 21:19
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

Would you consider making your mod compatible with the blockly add on for computer craft? http://blockly-lua.appspot.com/static/apps/code/index.htm I see the computer craft mod as a gateway to teaching beginners lua. They start with blockly lua using the computer mod. Move on to lua in computer cra...
by electrodude512
Wed Sep 24, 2014 16:16
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

I can't get it to find your example C library. It compiles fine, but it gives this error when I try to play the game. It gives the same error if I change the name of the library to look for to something that doesn't exist, so it must not be finding it. Here's the lua code: local path = minetest.get_...
by electrodude512
Wed Sep 24, 2014 02:47
Forum: Partly official engine development
Topic: Advanced Cave Culling Algorithm
Replies: 10
Views: 3164

Re: Advanced Cave Culling Algorithm

Very nice optimization. I think it should definitely be added - more culling = faster framerate = farther render distance = happy. It would be great for survival, but it would have to be disabled if you're using noclip or noclip would become useless because (almost) nothing would be rendered when yo...
by electrodude512
Tue Sep 23, 2014 21:34
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

Thanks! That'll be really helpful if I end up making a C library. What are the chances of a github PR I might submit getting merged into the official minetest core? It would basically add a few functions to spawn new lua threads and control them in basic ways. I can see this as having a very low cha...
by electrodude512
Mon Sep 22, 2014 23:23
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Re: Lua Threads for Computer Mod

Thanks, but that still doesn't answer the question of how to run completely sandboxed lua code that can't take over the server. Lua Lanes looks useful, though - I'll have to look into it. I've never used LuaJIT and my install of MT has decided to use normal Lua, so I have no idea about compatibility...
by electrodude512
Mon Sep 22, 2014 21:52
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25332

Lua Threads for Computer Mod

Hi, My friend just told me about Minetest a few days ago after I started writing my own Minecraft clone in C++ and Lua (after M****s*** bought Mojang). I immediately abandoned my project and switched to Minetest, and am very happy with it. I'm interested in writing a ComputerCraft-type mod for Minet...