[Mod] Better Screwdriver [0.4] [screwdriver2]
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
[Mod] Better Screwdriver [0.4] [screwdriver2]
The default screwdriver is a very useful tool, but it only makes sense if you understand how the facedir axis/rotation system works (and even then, I usually just resort to clicking randomly until I get the rotation I want)
This mod adds a new screwdriver that (I think) is more intuitive:
Left click "pushes" an edge of the node, and right click rotates the face that you're pointing at.
Crafting:
(Same recipe as the old screwdriver)
Version 0.4 Changelog:
- Added WorldEdit screw
Version 0.3 Changelog:
- Improved pointed position detection
- Added sounds when rotating nodes
Version 0.2 Changelog:
- Added particles when nodes are rotated
- Checks to make sure the raycaster finds the correct node
- Added long item description for the doc mod
- Won't crash if you click inside a node's collision box (IDK if this ever actually happened but now it definitely won't)
- Error message when minetest.raycast does not exist (for versions before 5.0)
- Added mod.conf
- You can now sneak to reverse the rotation direction when left clicking.
Dependencies: none
Download:
(Requires minetest version 5.0 or later)
https://github.com/12Me21/screwdriver2
Zip: https://github.com/12Me21/screwdriver2/ ... master.zip
License:
WTFPL
This mod adds a new screwdriver that (I think) is more intuitive:
Left click "pushes" an edge of the node, and right click rotates the face that you're pointing at.
Crafting:
(Same recipe as the old screwdriver)
Version 0.4 Changelog:
- Added WorldEdit screw
Version 0.3 Changelog:
- Improved pointed position detection
- Added sounds when rotating nodes
Version 0.2 Changelog:
- Added particles when nodes are rotated
- Checks to make sure the raycaster finds the correct node
- Added long item description for the doc mod
- Won't crash if you click inside a node's collision box (IDK if this ever actually happened but now it definitely won't)
- Error message when minetest.raycast does not exist (for versions before 5.0)
- Added mod.conf
- You can now sneak to reverse the rotation direction when left clicking.
Dependencies: none
Download:
(Requires minetest version 5.0 or later)
https://github.com/12Me21/screwdriver2
Zip: https://github.com/12Me21/screwdriver2/ ... master.zip
License:
WTFPL
Last edited by 12Me21 on Fri Oct 05, 2018 20:13, edited 5 times in total.
- Desour
- Member
- Posts: 1473
- Joined: Thu Jun 19, 2014 19:49
- GitHub: Desour
- IRC: Desour
- In-game: DS
- Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
Re: [Mod] Better Screwdriver [screwdriver2]
Nice!
Also I think, it's better to clear the craft recipe before overwriting it. Else craft guide mods will show both.
The bobbing is probably done client side, the server doesn't know it better. But the crosshair could bob with the rest of the screen, too, maybe.
Imo you should leave the special rotation behaviors of nodes to the mods that add the nodes.
I've seen, you add a recipe for the mtg screwdriver, but no recipe to craft it back.12Me21 wrote:Crafting:
(Same recipe as the old screwdriver)
Also I think, it's better to clear the craft recipe before overwriting it. Else craft guide mods will show both.
Is this the only thing that makes the camera position inaccurate?12Me21 wrote:2. Camera position
The way I check the pointed-at position uses the new Raycast feature in minetest 0.5. However, this is not completely accurate, because (as far as I know,) there is no way to get the exact camera position. (Sure, you can check the player's eye height now, but the camera also bobs up and down whenever you walk.)
The bobbing is probably done client side, the server doesn't know it better. But the crosshair could bob with the rest of the screen, too, maybe.
Imo you should leave the special rotation behaviors of nodes to the mods that add the nodes.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- Pyrollo
- Developer
- Posts: 385
- Joined: Mon Jan 08, 2018 15:14
- GitHub: pyrollo
- In-game: Naj
- Location: Paris
Re: [Mod] Better Screwdriver [screwdriver2]
Good idea !
Have you tried to play with it with moreblocs ?
Have you tried to play with it with moreblocs ?
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [screwdriver2]
Yeah I'll fix that. I wonder if I should just override screwdriver:screwdriver rather than adding a new item...DS-minetest wrote:Nice!
I've seen, you add a recipe for the mtg screwdriver, but no recipe to craft it back.12Me21 wrote:Crafting:
(Same recipe as the old screwdriver)
Also I think, it's better to clear the craft recipe before overwriting it. Else craft guide mods will show both.
There are small amounts of inaccuracies in the other calculations, but I'm pretty sure most of the problems come from this animation. The animation is probably done client side, but the server must know the camera position when you place a node or use an item.DS-minetest wrote:Is this the only thing that makes the camera position inaccurate?12Me21 wrote:2. Camera position
The way I check the pointed-at position uses the new Raycast feature in minetest 0.5. However, this is not completely accurate, because (as far as I know,) there is no way to get the exact camera position. (Sure, you can check the player's eye height now, but the camera also bobs up and down whenever you walk.)
The bobbing is probably done client side, the server doesn't know it better. But the crosshair could bob with the rest of the screen, too, maybe.
Hopefully someday `pointed_thing` will always contain the exact pointing location (when applicable), so I won't have to use Raycast for this.
Anyway, I just remembered that there's the sonic screwdriver from technic, and I finally checked what the actual difference is between it and the normal screwdriver. It doesn't check can_dig, so it's able to rotate nodes like chests and machines with items inside. Maybe I'll do the same thing...
Re: [Mod] Better Screwdriver [screwdriver2]
Deleted message
Last edited by Chiantos on Mon Sep 30, 2019 04:59, edited 1 time in total.
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [screwdriver2]
AddedChiantos wrote:License ?
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [screwdriver2]
So it turns out that there is already a mod that does nearly the exact same thing!
Rhotator Screwdriver
It's definitely a lot more polished than my version (and compatible with Minetest 0.4), but doesn't always work on nodes that don't have full nodeboxes (Which is nearly impossible without the raycast system added in 0.5)
Rhotator Screwdriver
It's definitely a lot more polished than my version (and compatible with Minetest 0.4), but doesn't always work on nodes that don't have full nodeboxes (Which is nearly impossible without the raycast system added in 0.5)
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [screwdriver2]
Adding particle effects to show the rotation axis/direction after you use the screwdriver
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
This mod is excellent. The particle effect is really useful, though I'd replace its texture with something simpler than the screwdriver texture.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
Here’s a killer feature: the ability to rotate not only individual nodes but whole worldedit selections. It could be mapped to punching a special node so when rotating the node the worldedit selection rotates with it.
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
I was planning to use a different texture, but couldn't think of anything...texmex wrote:This mod is excellent. The particle effect is really useful, though I'd replace its texture with something simpler than the screwdriver texture.
How would this work with non-cube-shaped areas?texmex wrote:Here’s a killer feature: the ability to rotate not only individual nodes but whole worldedit selections. It could be mapped to punching a special node so when rotating the node the worldedit selection rotates with it.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
Imo it shouldn’t matter what dimensions a WE area consists of. The ”WorldEdit rotation node” would simply trigger the regular WE rotation command and WE would deal with the rotation accordingly.
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
oh oktexmex wrote:Imo it shouldn’t matter what dimensions a WE area consists of. The ”WorldEdit rotation node” would simply trigger the regular WE rotation command and WE would deal with the rotation accordingly.
(I've never actually used worldedit before)
That should be pretty simple to add.
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [0.3] [screwdriver2]
Alright, I added the worldedit rotation. Rotating the "WorldEdit Screw" node with the screwdriver will also rotate the worldedit region.
I feel like this isn't very useful since it requires a special node and a special tool... Maybe just adding a worldedit screwdriver tool would be a better option...
I feel like this isn't very useful since it requires a special node and a special tool... Maybe just adding a worldedit screwdriver tool would be a better option...
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.4] [screwdriver2]
Any idea why I'm getting this error at boot?
Code: Select all
ERROR[Main]: ModError: Failed to load and run script from /Users/user/Library/Application Support/minetest/mods/screwdriver2/init.lua:
ERROR[Main]: .../mods/screwdriver2/worldedit.lua:7: attempt to index field '/rotate' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]: ...mods/screwdriver2/worldedit.lua:7: in main chunk
ERROR[Main]: [C]: in function 'dofile'
ERROR[Main]: ...mods/screwdriver2/init.lua:319: in main chunk
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [0.4] [screwdriver2]
Should be fixed now. (https://github.com/12Me21/screwdriver2/issues/1)texmex wrote:Any idea why I'm getting this error at boot?
Code: Select all
ERROR[Main]: ModError: Failed to load and run script from /Users/user/Library/Application Support/minetest/mods/screwdriver2/init.lua: ERROR[Main]: .../mods/screwdriver2/worldedit.lua:7: attempt to index field '/rotate' (a nil value) ERROR[Main]: stack traceback: ERROR[Main]: ...mods/screwdriver2/worldedit.lua:7: in main chunk ERROR[Main]: [C]: in function 'dofile' ERROR[Main]: ...mods/screwdriver2/init.lua:319: in main chunk
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.4] [screwdriver2]
Indeed it’s fixed, thanks! This feature is awesome. :D I'm thinking that the screw node can interpret other actions as well, such as "pushes" by punching it translates to the WE move command. Perhaps it should grow into its own mod if added.
- 12Me21
- Member
- Posts: 873
- Joined: Tue Mar 05, 2013 00:36
- GitHub: 12Me21
- Location: (Ignore all of my posts before 2018)
Re: [Mod] Better Screwdriver [0.4] [screwdriver2]
Yeah, I was thinking about that too.texmex wrote:Indeed it’s fixed, thanks! This feature is awesome. :D I'm thinking that the screw node can interpret other actions as well, such as "pushes" by punching it translates to the WE move command. Perhaps it should grow into its own mod if added.
The problem with punching is that you wouldn't be able to break the node without triggering worldedit commands. Maybe right click would work, though.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Better Screwdriver [0.4] [screwdriver2]
Seems apt.12Me21 wrote:Yeah, I was thinking about that too.texmex wrote:Indeed it’s fixed, thanks! This feature is awesome. :D I'm thinking that the screw node can interpret other actions as well, such as "pushes" by punching it translates to the WE move command. Perhaps it should grow into its own mod if added.
The problem with punching is that you wouldn't be able to break the node without triggering worldedit commands. Maybe right click would work, though.
Btw,I’m trying to come up with an alternative tool name and texture for a more medieval setting, where screwdrivers don’t exist. Any ideas? :)
Who is online
Users browsing this forum: No registered users and 85 guests