Search found 36 matches

by ninnghazad
Wed Dec 10, 2014 17:02
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

local str = fs.read(path):getdata() nice, this will suffice. ...don't see myself ever using this. Every time I've ever used a file in lua, I've either read the whole thing... i have used it a lot, and already have plans for it. although reading parts would be more important than writing parts. it's...
by ninnghazad
Wed Dec 10, 2014 11:52
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

heho electrodude. thats some good news. i did not yet find the time to test the newevents branch. request/response-bundling is a good idea. but make one version with immediate yielding. so that the player can have a single request with built in yield, or have the bundled request to be send upon the ...
by ninnghazad
Fri Dec 05, 2014 10:05
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

Passing nothing to coroutine.yield why pass stuff to yield()? i think thats an odd spot to put event handling. if that is what it is. yield() should yield and nothing more. kernel.events.receive[_async](filter)/send(type) + kernel.events.* or whynot? can you give a rough example code how u would im...
by ninnghazad
Thu Dec 04, 2014 15:08
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

The shell should definitely be in userspace. ye ofc, i didn't mean any complicated stuff, just the stuff that comes with a normal shell. idk, like setting a custom prompt or little things like that, that thematically belong in shell.* - all just userspace. it currently gets its key-events from dron...
by ninnghazad
Thu Dec 04, 2014 11:36
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

we do produce quite the walls of text =) The overhead only happens when you initiate a connection, which should be pretty rarely. i guess in the drones case this would mean opening a connection when wrapping the drone, so no additional hassle for the player and only little overhead. so THAT's why dr...
by ninnghazad
Wed Dec 03, 2014 19:19
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

To send commands to a drone, you open a connection to it and then send it commands. Any response data from the drone goes in the send_ack, although I didn't really explicitly say that in the protocol draft. i see... but why not still have a direct method-call without open? would save some overhead....
by ninnghazad
Wed Dec 03, 2014 12:56
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@electrodude512 heho, didn't notice your post yesterday. will hang around irc today till bout 1700 CET, problably for the next days. i merged and tested your branch, just a few tiny fixes and i was able to run test-quarry without problems. so that went well. talking bout ugly getfenvs, maybe you cou...
by ninnghazad
Fri Nov 28, 2014 10:34
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@electrodude512 heho, i thought about it and i wouldn't want to drop the dronetest cpu/core. although that is in the end just based on the fact that i like writing and thinking about it, and i wouldn't want to have to compromise about some stuff that may or may not come up. still, yay to a common pr...
by ninnghazad
Tue Nov 25, 2014 22:43
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

Heho. @electrodude512 I do this for fun, i don't and don't want to feel in competition about this stuff. i think it's great the luacontroller grows. however, i also do not think digilines and dronetest are redundant. digilines is to me more of a lower-level foundation - i think of the luacontroller ...
by ninnghazad
Wed Nov 19, 2014 10:30
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@electrodude512 You are right, i guess i just got a little frustrated with not being able to move on my own pace. That code by no means has to be that ugly, plx fix if you like. Just one of those functions that grew ugly. Do make sure you test out stuff after you change that however, maybe try to ru...
by ninnghazad
Tue Oct 28, 2014 10:34
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

laggy i have commented about this on the pull request - it does not cause lag, it causes additional traffic. we don't need to discuss this here - if we want that feature, it has it's price, simple as that. PRs need 2 coredevs approving, we have like 1,5 - so getting another dev's approval is what w...
by ninnghazad
Tue Oct 21, 2014 09:38
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

in case you are wondering why nothing is happening, i'm waiting for https://github.com/minetest/minetest/pull/1737. and to be true, i don't think anybody actually feels responsible for pull requests from outside, on the contrary - there are >100 pull requests and most of these will be wasted time. a...
by ninnghazad
Tue Oct 14, 2014 07:06
Forum: WIP Mods
Topic: [Mod] ComputerTest
Replies: 23
Views: 13949

Re: [Mod] ComputerTest

Heho, electrodude512 and me have something in the workings, and so far the working is good. displays are realized using composite textures, not formspecs. input-however still uses formspecs until proper methods are available in minetest itself. it is not ready for public use, however it is in a stat...
by ninnghazad
Sat Oct 11, 2014 12:30
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

Maybe we could put a metatable.__index on _G to automatically load apis when they're first needed? sure, that's a good idea - either way we should add an easy way to list available apis. a command and function maybe. if you add an __index to userspace's _G, just add some viewer-function for the tab...
by ninnghazad
Fri Oct 10, 2014 08:46
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

I think we should separate the computer innards from init.lua into their own file, for manageability. Ye, that init.lua has grown quickly. Lets split it up. which timezone do you live in GMT +1:00 (CET) we can either have the wrapper sandbox things itself (slower but foolproof) or expect API functi...
by ninnghazad
Thu Oct 09, 2014 21:20
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

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? yes, i refer to the environment and coroutine the player writes and executes code in as userspace. The sandbox function I wrote but haven't committed yet goes through...
by ninnghazad
Thu Oct 09, 2014 18:45
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

That way, computers can't run getfenv(sys.receiveDigilineMessage).minetest and get the global minetest table. I already mostly did this and will push it soon. i know and was planning on doing that checking in userspace-version of getfenv (or disable it). the reason for this plan was me assuming tha...
by ninnghazad
Wed Oct 08, 2014 16:12
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

COMMENCE EPIC QUADPOST! #1 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. #2 the server-log you posted looks like the systems crash while booting and try to restart the...
by ninnghazad
Tue Oct 07, 2014 19:27
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

i see the github term is "collaborator" - be that as it may, i set you up. hm, that loadlib thingy may be handy as a basis for a userspace-version of loadstring dofile and so on. want to put it in /rom/apis/os.lua as os.whatever? remember that the loadstring you use when putting this as an...
by ninnghazad
Tue Oct 07, 2014 12:02
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

thought about peripheral.* some more - would be great if you could directly put it in /rom/apis/peripheral.lua as part of the main mod. i placed something to start from there with a basic function for wrapping and a test_peripheral example that wraps a display. to test, use /giveme dronetest:compute...
by ninnghazad
Tue Oct 07, 2014 09:04
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@electrodude512 heho. i like the modular approach, and while i have to think about how to implement drones exactly in a approach like this, i changed the computers/drones to not have displays, and added dronetest_display peripheral, which is used per digilines. just a quick shot, but it works well. ...
by ninnghazad
Mon Oct 06, 2014 13:35
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

using combined textures on entities works, updating the screen works too.
screenshot of drone with a test-screen on its back:
Image
by ninnghazad
Mon Oct 06, 2014 10:29
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@electrodude512 heho, sounds good. it would have to be a minetest.register_on_player_receive_key, similar to register_on_player_receive_fields. we need to be aware that this means more traffic for the server, as every client's keystroke is send immediately, instead of in a bunch like how it is with ...
by ninnghazad
Sun Oct 05, 2014 19:39
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

builtin/common/serialize.lua line 17
by ninnghazad
Sun Oct 05, 2014 15:03
Forum: Modding Discussion
Topic: Lua Threads for Computer Mod
Replies: 95
Views: 25248

Re: Lua Threads for Computer Mod

@aldobr feel free to submit patches or fork the project, nothing is stopping anybody from changing everything. maybe if you actually tried what you are talking about, you would understand what i am talking about. i'd think we're talking past each other, and time would be better spend coding, but dis...