[Mod] Better Screwdriver [0.4] [screwdriver2]

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

[Mod] Better Screwdriver [0.4] [screwdriver2]

by 12Me21 » Sun Sep 23, 2018 16:16

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:
Image

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.
 

User avatar
DS-minetest
Member
 
Posts: 1022
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Better Screwdriver [screwdriver2]

by DS-minetest » Sun Sep 23, 2018 17:22

Nice!

12Me21 wrote:Crafting:
(Same recipe as the old screwdriver)

I've seen, you add a recipe for the mtg screwdriver, but no recipe to craft it back.
Also I think, it's better to clear the craft recipe before overwriting it. Else craft guide mods will show both.

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.)

Is this the only thing that makes the camera position inaccurate?
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.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
Pyrollo
Member
 
Posts: 184
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: [Mod] Better Screwdriver [screwdriver2]

by Pyrollo » Sun Sep 23, 2018 18:37

Good idea !

Have you tried to play with it with moreblocs ?
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [screwdriver2]

by 12Me21 » Sun Sep 23, 2018 19:43

DS-minetest wrote:Nice!

12Me21 wrote:Crafting:
(Same recipe as the old screwdriver)

I've seen, you add a recipe for the mtg screwdriver, but no recipe to craft it back.
Also I think, it's better to clear the craft recipe before overwriting it. Else craft guide mods will show both.

Yeah I'll fix that. I wonder if I should just override screwdriver:screwdriver rather than adding a new item...

DS-minetest wrote:
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.)

Is this the only thing that makes the camera position inaccurate?
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.

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.
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...
 

User avatar
Chiantos
Member
 
Posts: 304
Joined: Sun Jan 15, 2017 09:04
Location: Earth
GitHub: BlockColor
IRC: mrchiantos
In-game: mrchiantos
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [screwdriver2]

by 12Me21 » Mon Sep 24, 2018 01:13

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)
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [screwdriver2]

by 12Me21 » Tue Sep 25, 2018 13:57

Image
Adding particle effects to show the rotation axis/direction after you use the screwdriver
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by texmex » Wed Oct 03, 2018 07:57

This mod is excellent. The particle effect is really useful, though I'd replace its texture with something simpler than the screwdriver texture.
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by texmex » Thu Oct 04, 2018 10:12

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.
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by 12Me21 » Fri Oct 05, 2018 14:12

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.

I was planning to use a different texture, but couldn't think of anything...

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.

How would this work with non-cube-shaped areas?
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by texmex » Fri Oct 05, 2018 16:37

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.
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by 12Me21 » Fri Oct 05, 2018 18:35

texmex 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.

oh ok
(I've never actually used worldedit before)
That should be pretty simple to add.
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [0.3] [screwdriver2]

by 12Me21 » Fri Oct 05, 2018 20:12

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...
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.4] [screwdriver2]

by texmex » Sun Oct 07, 2018 18:38

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
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [0.4] [screwdriver2]

by 12Me21 » Sun Oct 07, 2018 22:37

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

Should be fixed now. (https://github.com/12Me21/screwdriver2/issues/1)
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.4] [screwdriver2]

by texmex » Mon Oct 08, 2018 04:45

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.
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: [Mod] Better Screwdriver [0.4] [screwdriver2]

by 12Me21 » Mon Oct 08, 2018 18:58

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.

Yeah, I was thinking about that too.
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.
 

User avatar
texmex
Member
 
Posts: 1062
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Better Screwdriver [0.4] [screwdriver2]

by texmex » Fri Oct 12, 2018 21:02

12Me21 wrote:
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.

Yeah, I was thinking about that too.
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.

Seems apt.

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? :)
 


Return to Mod Releases



Who is online

Users browsing this forum: Exabot [Bot] and 6 guests