joe7575 / pdp13

A 16-bit minicomputer simulation inspired by DEC, IBM, and other Vintage Computers from the 60s and 70s
GNU Affero General Public License v3.0
8 stars 1 forks source link

attempt to call field 'register_node' (a nil value) #2

Closed Anonymous3-a closed 4 months ago

Anonymous3-a commented 4 months ago

I made a world, and added pdp13 and all dependencies. I join the world, and get this:

ModError: Failed to load and run script from /home/ilikecats/.minetest/mods/pdp13/init.lua:
/home/ilikecats/.minetest/mods/pdp13/pdp13/cpu.lua:709: attempt to call field 'register_node' (a nil value)
stack traceback:
    /home/ilikecats/.minetest/mods/pdp13/pdp13/cpu.lua:709: in main chunk
    [C]: in function 'dofile'
    /home/ilikecats/.minetest/mods/pdp13/init.lua:54: in main chunk
Check debug.txt for details.

I looked in the code, and it seems that the error is that you register pdp13:cpu1_on twice. Once in the code block just before, and once at line 709 (along with pdp13:cpu1). I'm not very experienced with Minetest lua modding, so I'm going to put this issue here, and try to fix the code in the meantime.

Anonymous3-a commented 4 months ago

Update: pdp13:cpu1 is also defined twice. I think I might be able to fix the code now. Update 2: Yep, it's just a bunch of redefining. I'll fix it all now. Update 3: There's more to it than that. I'll see about fixing that too.

Anonymous3-a commented 4 months ago

Ok, done. I'll get to testing. If it all works, pull request. Update: Not all done. I'll keep going. Update 2: I think that most of my problems will be adding if techage, do this instead of just do this (i didn't install techage, it was an optional dependency). I'll just make techage a non-optional dependency, because it's easier and probably won't matter too much. Update 2.5: I just noticed how it wants EITHER techage or tubelib (and if both are installed, it seems to just ignore tubelib). I then checked the readme and noticed it said "techage or tubelib". I think this point should be emphasized, but for now I'll just install whatever's smallest disk size. Update 2.55: I can't find techage as anything other than a game. Tubelib it is then. Update 2.555: Original tubelib is in a modpack now? I'm going to extract tubelib from the modpack. Update 2.5555: Ok, found tubelib on its own in https://github.com/joe7575/Minetest-Tubelib/ Update 3: Ok, got it working. I'd recommend just using tubelib and making it a non-optional dependency.

Anonymous3-a commented 4 months ago

Mildly unrelated: the power block says "on" when it means "off" and vice versa. Will also fix that. Update: this has proven to be too difficult and i dont care that much

joe7575 commented 4 months ago

Sorry for this confusion. techage is an optional dependency but it is highly recommended to use pdp13 together with techage. The main goal of pdp13 is to control your machines, in this case techage. There is currently no binding to other technic mods.

To the power block: The button label can either be the state (block is on), or the command (turn the block on). The color (lightning) in this case should give you clear hint.

Anonymous3-a commented 4 months ago

Pull request coming soon.