Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slime blocks don't interact with pistons like in mc #4

Closed
anon55555 opened this issue Oct 1, 2020 · 16 comments
Closed

Slime blocks don't interact with pistons like in mc #4

anon55555 opened this issue Oct 1, 2020 · 16 comments
Labels
bug Something isn't working

Comments

@anon55555
Copy link

See https://minecraft.gamepedia.com/Slime_Block#Pistons.

@kay27 kay27 added the bug Something isn't working label Oct 4, 2020
@kay27
Copy link
Owner

kay27 commented Oct 4, 2020

Confirmed. I don't see slime-block-related stuff and there is even made a comment probably about it: https://github.com/kay27/MineClone2/blob/master/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua#L60

I'll take a look whether it could be added easily and what will happen... I mean there's some delay in ticks in MC between the (inter)actions of flying machine's part :) IDK what/how it will be in Minetest

kay27 added a commit that referenced this issue Oct 4, 2020
@kay27
Copy link
Owner

kay27 commented Oct 4, 2020

Seems fixed, see bf00324
Actually the fix is made in nodes_misc.lua.
Changes in mesecons_mvps is almost useless...

But for now hadn't time to build flying machine and test... :((( Only tested that blocks do move with slimeblock as in MC.

@kay27
Copy link
Owner

kay27 commented Oct 4, 2020

Actually I can't run a flying machine as it described here.
Something moves but then it gets stuck,
Slime block behaves good. Probably something wrong with redstone block or the way the pistons get the power.
image

@kay27
Copy link
Owner

kay27 commented Oct 4, 2020

Also I must check the protection after fixing that.

@kay27
Copy link
Owner

kay27 commented Oct 5, 2020

Much more simple example, looks like the piston is powered:
image
Mesecon mod changed a lot since it was added to MCL2, e. g. added some LBM handlers but I just try to understand how the queue works :) I need some additional time for that.

@kay27
Copy link
Owner

kay27 commented Oct 5, 2020

hm, btw in original mesecon/minetest_game it works, except that there's no redstone block...

https://github.com/kay27/MineClone2/blob/master/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua#L277 looks redundant, duplicates by https://github.com/kay27/MineClone2/blob/master/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua#L374

@kay27
Copy link
Owner

kay27 commented Oct 6, 2020

@anon55555 I made next fix. Some mechanics started to work in a loop, back and forth. But I still can't run really flying machine. Maybe you'd like to test it and help me to understand what's wrong now? 7031462

@anon55555
Copy link
Author

I'm getting crashes with this error message: attempt to index local 'pistonspec' (a nil value).

@kay27
Copy link
Owner

kay27 commented Oct 7, 2020

So odd, couldn't you please specify the line number if you remember it? I had same error and added meta for avoiding but several places maybe need it too but seems it was wrong way at all... Pusher shouldn't power the piston... But then I cant realize what's going on in Minecraft: when the pusher looks up - if it has a contact with redstone block by one of it's sides it keeps pushed state...

So I merged slime blocks fix to master as Mesehub backed to life... There is a big issue about redstone mechanics:

https://git.minetest.land/Wuzzy/MineClone2/issues/353#issuecomment-11392

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

I found an article explains some differences for myself, https://minecraft.gamepedia.com/Tutorials/Quasi-connectivity

Should it be implemented in MCL2? :))) IDK

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

Wow, can't believe!
After this simple change (on the picture attached) mechanics started to move back and forth like in Minecraft! So it wasn't even a significant change - I just added: 1) debug output through the chat; 2) delays; 3) little bugfix in the passing two tables to outer threads. That's all...
Now I need to remove delays back and see what will happen and I'll do that later when I'll have the time for it.

image

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

OMG, I was wrong again. The error was a duplicated addition of the vector in mvps_push_or_pull(), I removed it, https://git.minetest.land/Wuzzy/MineClone2/commit/f0afebea387d6972d0f3820ea44913b6fbbe4f7c

This sample of mechanics started to work immediately :)

Then I tried to loop it to the piston from its back and redstone block disappeared - so maybe there are still some bugs left.

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

By the way, maybe, we need to merge node timer patch from minetest-mods/mesecons@42cd973#diff-fe45ad82229c80f9a7352e533b6c311a

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

Then I tried to loop it to the piston from its back and redstone block disappeared - so maybe there are still some bugs left.

Probably @Wuzzy2 already reported the bug here: minetest-mods/mesecons#218 (comment)

@kay27
Copy link
Owner

kay27 commented Oct 8, 2020

The bug is because the piston loops to itself.
When I try to add distance check in piston's stopper it always affects itself too :)
And slime block's sticky function doesn't check the direction of adjacent piston as well...

The end.

I've wrote it to not forget to add piston direction check in any of the stopper checks... I think if slime block connects to the front part of the pusher it must just ignore this neighbor.

Every time I think: one more final step and I close the issue... But I'd like to fly and still can't fly on the machine... And the honey is missing too :(((

@kay27
Copy link
Owner

kay27 commented Oct 10, 2020

There are still many bugs but:

  1. Mesehub came back to life;
  2. the subject is fixed;
  3. fixed some major issues related.
    I'm closing the issue.
    See also:
    b0eecea
    0d96a43
    Add callbacks for node creation and destruction minetest/minetest#6981
    https://git.minetest.land/Wuzzy/MineClone2/issues/839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants