[Mod] Interchangeable Hands [hands]

Post Reply
User avatar
octacian
Member
Posts: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

[Mod] Interchangeable Hands [hands]

by octacian » Post

Image

Interchangeable Hands [hands]
This mod uses the function introduced in this pull request by TeTpaAka. Hands is mostly for demostration purposes for the reference of other modders or for players to mess around with. Keep in mind that the mod does not work on Minetest 0.4.14, as the feature was not introduced until Minetest 0.4.15.

The mod registers a single chatcommand (`/sethand`) and privilege (`sethand`), allowing the player to set their own hand to any node or item. Hands also has a simple API with which two example hands are registered as listed below.

Alternate Hands
  • hands:grey
  • hands:space
The textures aren't very good, but it allows you to get a basic and functional overview of the new feature.

Chatcommand

Code: Select all

/sethand hands:grey
/sethand default:stick
The above example shows that the /sethand command works both with the hands introduced by the mod or with any other node or item already in the game. Remember to grant yourself the sethand privilege before attempting to use the chatcommand.
Spoiler
API
Though I highly doubt that this mod would actually need an API and be expanded as a stand-alone mod, I decided to provide one in case somebody wanted to. Overall, it's pretty single. The only required parameter is the itemstring / "handstring".

Code: Select all

hands.register_hand(<itemstring>, {
  wield_image = <wield image>,
  wield_scale = <wield scale>,
  tool_capabilities = <tool capabilities>,
})
All of the fields except for the itemstring are optional, though it's pretty pointless to register a new hand without a wield image.

API Examples
Simplistic:

Code: Select all

hands.register_hand("hands:space", {
  wield_image = "hands_space.png",
})
Fine Tuned:

Code: Select all

hands.register_hand("hands:space", {
  wield_image = "hands_space.png",
  wield_scale = {x=1,y=1,z=2.5},
  tool_capabilities = {
  		full_punch_interval = 0.9,
  		max_drop_level = 0,
  		groupcaps = {
  			crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
  			snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
  			oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
  		},
  		damage_groups = {fleshy=1},
  	}
})
Last edited by octacian on Tue Jan 03, 2017 05:00, edited 2 times in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: [Mod] Interchangeable Hands [hands]

by ExeterDad » Post

Ohhh!
So in theory... One can register a new node (meshnode or nodebox) and map the player skin texture to it so the player can see a hand that matches their skin?

OMG! OMG! *runs in circles

User avatar
octacian
Member
Posts: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

Re: [Mod] Interchangeable Hands [hands]

by octacian » Post

ExeterDad wrote:So in theory... One can register a new node (meshnode or nodebox) and map the player skin texture to it so the player can see a hand that matches their skin?
Simply, yes. In fact, I think you can, not just in theory.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Interchangeable Hands [hands]

by Fixer » Post

Finally!

whitephoenix
Member
Posts: 19
Joined: Sun Jun 26, 2016 22:43

Re: [Mod] Interchangeable Hands [hands]

by whitephoenix » Post

Powersuits minetest port anyone?

User avatar
octacian
Member
Posts: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

Re: [Mod] Interchangeable Hands [hands]

by octacian » Post

whitephoenix wrote:Powersuits minetest port anyone?
Somebody requested this a while ago, once I finish MicroExpansion, I'll be on it if no one does before me :D
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
Wuzzy
Member
Posts: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Interchangeable Hands [hands]

by Wuzzy » Post

Nice demo!

Try this in Minetest Game:

Code: Select all

/sethand default:pick_diamond
:D

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Interchangeable Hands [hands]

by ABJ » Post

Cool-looking mod.
Why a priv, tho?

User avatar
octacian
Member
Posts: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

Re: [Mod] Interchangeable Hands [hands]

by octacian » Post

ABJ wrote:Why a priv, tho?
A player could do /sethand default:pick_diamond and their hand would immediately have the same power as a diamond pickaxe.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Interchangeable Hands [hands]

by ABJ » Post

Wait...really? I thought it just changed the mesh........

User avatar
octacian
Member
Posts: 597
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian
Location: Canada

Re: [Mod] Interchangeable Hands [hands]

by octacian » Post

Nope. It does more than just change the mesh. If it were possible I'd make it so that it only changes the mesh without the privilege and the tool capabilities if the player had the privilege.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
niwla23
Member
Posts: 118
Joined: Sat Nov 17, 2018 17:40
In-game: Niwla

Re: [Mod] Interchangeable Hands [hands]

by niwla23 » Post

Not working for me. using latest dev
Log is empty, no crash, command just sends a success message but nothing changes

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests