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
Place stairs upside down depending on click position #1572
Comments
Getting the click position might be quite complex to do, needing a new API. |
I know I saw this in a mod, but I don't remember |
If you know the look yaw/pitch of the player, and you know their position, you can mathematically calculate where on the surface the cursor should be. This is what the painter mod does. https://github.com/xyzz/painting/blob/master/init.lua#L91 However, wrt slab/stair placing, people have complained about the handling before and I fear that any change is just going to get more people complaining again. The code is already overly complex as is. |
Yeah i would prefer simpler behaviour, impossible to satisfy most builders as building preferences vary so much. |
Simpler behaviour (for the user) normally means more code It is not simple to rotate each slab or stair with the screwdriver just because of the code is simple. And to be honest: was there a change in history that has satisfied EVERYBODY? The behaviour should be logical. And it is not logical that a slab is placed vertical if I attach it to a horizontal slab, for example. @sofar, thanks for the link. Maybe I try a PR some day if no one else will |
Yes i mean simple codewise. |
Btw, not only the painting mod does this. Some other examples: |
It's very easy (it's taught at grammar school). The camera offset is 1.625 m above player:getpos() position + the bobbing offset. The offset caused by bobbing is not known serverside, but it's small, so it can be omitted. |
Yes, simple maths but it's a lot of code for something probably unnecessary. SImple code helps devs' heads. |
If someone writes a PR, I'll review and help improve it (as I always do). |
I don't think it is unnecessary. I think, a game should be K.I.S.S for the players, not for the devs Will try to make a PR. I'll start with #1568 |
Well, then I'll fork the stairs mod |
Rather than simply adding code into the stairs mod to detect where on a node you have clicked, wouldn't it make sense to put this functionality into builtin? |
You can't fork the stairs mod because it's not an repository. |
C1ffisme, that function detects where on the node you have clicked: |
@HybridDog cool, thx. What does pt stand for? Position of the pointed node? |
I think, it means pointed_thing. |
perfect, thanks. It works |
that was easy |
Is someone willing to add HybridDog's code to builtin? Might be useful for other mods slabs are now a bit different. Also auto rotation works with different slab types |
Sorry for my comment, this looks good on both the videos, intuitive, i don't oppose. |
If someone can add HybridDog's code to builtin I can remove the code from stairs mod. I'll make a PR tomorrow |
Perhaps adding that code to builtin should be a separate PR? |
I think about more rotations depending on click position. Vertical rotation if clicked on the left or right side of the surface and default rotation when click at the center. But I'm afraid that this is more complicated and I want to try first if it feels natural |
Sorry i'm not keen on that. |
I'll make a mod for this. It can be used in older MTG versions too |
The way this works as shown in the video is really good 👍 . I think this definitely should be part of MTG. |
PR #1581 |
#1697 merged. |
To place stairs upside down you need to place a node above or a screwdriver. It would make things easier if stairs are rotated if you click in the top half of the node and not rotated if you click in the lower half.
I don't know if it is possible to get the click position on a node
The text was updated successfully, but these errors were encountered: