[Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

Post Reply
User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

[Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

This mod adds 3D accessories that you can equip for the looks or bonus stats

Image

some of the stat values are displayed in the accessory inventory
Defense - by default, for every 5 defense points you are guaranteed to take 1 damage less from attacks. every other point gives 20% chance to block 1 extra damage from the attack. You will still take at least 1 damage from attacks, even if you have more than enough defense to fully block an attack

Offense/attack damage - increases the damage you deal to enemies, if the attack you used actually counts as your attack. (attacking enemies with any melee weapon will always count as your attack, blowing enemies up with TNT does not count as your attack, ranged weapons from some mods might cound and some might not... that depends on how projectiles of that mod work)

HP regeneration - each regeneration point restores 1 health every second. (If you have 0.2 HP regen for example, you will have 1 point of your health restored every 5 seconds)

HP bonus - your max HP will be increased by your HP bonus value

Walking speed - increases your movement speed

Digging speed - increases your digging speed with any tool (does not work with bare hands)



and a few more less-important stats that are not displayed in accessory inventory.

The mod also has set bonuses. Usually, set consists of 3 pieces of armor (helmet,body armor,leggings) and gives bonus defense, but there might be some exceptional item sets or special armor sets, that increase other stats or have some other function. (Full molten armor set gives 8 seconds of lava/fire block immunity of example)


The mod was just relased and it only has a bunch of simple single-material armor sets, one unusual armor set and a bunch of accessories.

most armor recipes are the same as they would be in minecraft, except that armor sets do not include boots... kinda like in Terraria...

and most of accessories are craftable out of all sorts of materials and a few accessories can only be found in speccial accessory chests that generate deep undergroud (for now there's one chest that generates 2500+ nodes underground)

I'd recommend using unified inventory or some sort of crafting guide mod, along with this mod.

this mod kind of does work with 3D armor, but is not really intended to be used with 3D armor... there will be conflicts in physics changes and crafting recipes and using 3D armor armor and accessories at the same time would be pretty overpowered
(I originally wanted to make this an accessory mod that would work along 3D armor... but since I added stat bonuses with my own defense system, which could get quite OP if used along with another defense system and I also kind of decided that armors in 3D armor mod weren't 3D enough for me... I ended up just making a mod that has both, armor and accessories all in one)

(the mod was slightly tested in multiplayer between 2 test accounts, but I am still not sure if I didn't terribly screw something up in making of this mod, so if you want to use this mod in your server... you'd better not for at least a few months since it's relase, to make sure it actually works fine)


If you have any questions on how this mod or it's code works, you can always try asking me.

Plans for future:
*Vanity accessory inventory
*Accessory dye inventory
*more accessories (obviously)


Current problems:
*Accessories that were attached to player while in 3rd-person mode, will not be visible to the owner until you change your camera mode.(your accessories should still always be visible to other players, so it's not a very big problem)
*Accessory attachments might disappear if the player is moving very fast (accessory visuals are automatically reapplied every 60 seconds, in case they were to disappear, so it's not a very big problem)



Acceccory inventory can be accessed from sfinv inventory, unified_inventory or "/accinv" command

depends: none
optional_depends: default,unified_inventory,moreores,mobs,farming,wool,sfinv,dungeon_loot,tool_modifiers

MT version: 5.3.0

license: CC-BY-SA 4.0
Attachments
equippable_accessories v0.2.zip
(629.99 KiB) Downloaded 23 times
equippable_accessories v0.115.zip
(595.49 KiB) Downloaded 10 times
Last edited by davidthecreator on Wed Feb 03, 2021 18:58, edited 5 times in total.

User avatar
cx384
Member
Posts: 518
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] equippable_accessories v0.1 (3D accessories you can equip for looks and stat bonuses)

by cx384 » Post

This mod looks promising, well done. I especially like the textures.
I hope it will be on Content DB and/or gitlab/github soon.
davidthecreator wrote:
Tue Feb 02, 2021 13:46
most armor recipes are the same as they would be in minecraft
What do you mean by "as they would be in minecraft"? Or can you provide some sources?
davidthecreator wrote:
Tue Feb 02, 2021 13:46
few accessories can only be found in speccial accessory chests that generate deep undergroud
Have you considered making it possible to also find accessories in dungeon chests by using the dungeon_loot mod from minetest game?
Last edited by cx384 on Tue Feb 02, 2021 15:42, edited 2 times in total.
Can your read this?

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.1 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

cx384 wrote:
Tue Feb 02, 2021 15:18
This mod looks promising, well done. I especially like the textures.
I hope it will be on Content DB and/or gitlab/github soon.
Perhaps when I make an update to the mod, I Will add it to GitHub...
cx384 wrote:
Tue Feb 02, 2021 15:18
What do you mean by "as they would be in minecraft"? Or can you provide some sources?
I mean... Most people probably know the iconic MineCraft armor recipes for helmet, body armor, leggings...

M= material
X= nothing

MMM
MXM = Helmet
XXX

MXM
MMM = Body armor
MMM

MMM
MXM = Leggings
MXM

Current materials that have a single-material armor set: (any wood, cactus, copper ingots, tin ingots, bronze ingots, steel ingots, gold ingots, silver ingots(moreores), mithril ingots(moreores))
cx384 wrote:
Tue Feb 02, 2021 15:18

Have you considered making it possible to also find accessories in dungeon chests by using the dungeon_loot mod from minetest game?
The current dungeon look is so boring, I kind of forgot it was a thing...

I probably will add some unique dungeon accessories

User avatar
cx384
Member
Posts: 518
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] equippable_accessories v0.1 (3D accessories you can equip for looks and stat bonuses)

by cx384 » Post

Also this error appeared:

Code: Select all

WARNING[Server]: Undeclared global variable "name" accessed at .../.minetest/mods/equippable_accessories/init.lua:928
ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'equippable_accessories' in callback environment_Step(): .../.minetest/mods/equippable_accessories/init.lua:726: attempt to concatenate local 'name' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]: 	.../.minetest/mods/equippable_accessories/init.lua:726: in function 'PlayerHasAccGroupEquipped'
ERROR[Main]: 	.../.minetest/mods/equippable_accessories/init.lua:928: in function <.../.minetest/mods/equippable_accessories/init.lua:770>
ERROR[Main]: 	.../minetest/builtin/game/register.lua:433: in function <.../minetest/builtin/game/register.lua:417>
Can your read this?

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.1 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

Will be fixed next update.

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.11 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

ok, made a quick update that should fix the crash.

also added a bronze shield.

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.11 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

davidthecreator wrote:
Tue Feb 02, 2021 16:11
ok, made a quick update that should fix the crash.

also added a bronze shield.
--- update 0.115 ---

Found another error that caused crashes and fixed that one aswell now

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

--- update v0.2 ---
*Added an armor set and a shield, that can only be found in dungeon chests
*Obsidian shield now requires the "skull shield" from dungeon chests instead of steel shield to craft, but it now has slightly better stats than before
*supports tool_modifiers mod (requires tool_modifiers v0.3) with a set of modifiers that can be applied to all accessories and armor in this mod with 50% probability when crafted or dropped from a dug accessory lootchest
(tool_modifiers mod can be found here: viewtopic.php?f=9&t=22862)

MisterE
Member
Posts: 239
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by MisterE » Post

Could you describe how another mod could add accessories? I dont see any global tables... but I would really like to be able to add accessories from via other mods. Specifically, I want to change over an existing server from 3darmor to accessories. II want to register some armors from 3d armor (diamond), and I want to register lots of custom accessories.

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

to register an accessory, just register any tool/item/node and add "acc_slot" to it's definition
for example:

Code: Select all

acc_slot = "helmet_acc",
Image
this will make the accessory equippable to that slot
there's also "both_hand_acc" and "both_ring_acc" if you want your hand or ring accessory equippable to both left and right slot (right ring/hand accessory visual will not appear on the player if the accessory is equipped on the left spot and vice versa.)


and to make it visible on the player, you need add accessory attachment slot group and acesssory attachment visual definition to the item's definition

possible slots groups: head_accessory, body_accessory, l_arm_accessory, r_arm_accessory, l_reg_accessory, r_arm_accessory

accessory attachment visual definition:

Code: Select all

	acc_size_<slot> = ({x=<number>,y=<number>}), -- determines how big the accessory visual is
	acc_model_<slot> = (<model>), -- model for the attached accessory visual
	acc_texture_<slot> = (<texture>), -- texture for the attached accessory visual
	acc_pos_<slot> = {x=<number>,y=<number>,z=<number>}, -- positioning of the accessory visual on user's bone
	acc_anim_<slot> = {x=<number>,y=<number>}, --if the model you used has an animation, you can enter the starting and ending frame of model's animation, for the accessory visual to play that animation
you need to enter both, the group and visual definition for accessory to have a proper visual.

a single accessory can attach a visual to as much bones as you want.

if you don't add add any accessory groups at all, your accessory will be completelly invisible on the player


and you can register accessory stats, by adding them to item's definition as well
for example:

Code: Select all

acc_defense = 3,
acc_offense = 5,
your registered accessory would give 3 defense and 5% attack damage bonus in this case


currently available stats:

Code: Select all

acc_defense -- protects you from damage, dealt by enemy attacks. dy default each 5 defense points blocks 1 damage completelly and for every extra point of defense, you get 20% chance to block another point of damage
acc_offense -- increases your acttack damage 
acc_hpRegen -- restores that much HP per second (for example, 0.25 hpRegen would regenerate 1HP every 4 seconds)
acc_hpBonus -- increases your Max HP
acc_flight_time -- increases the amount of time the player can fly for, before only being able to fall slowly until landing on a node (any accessory can increase flight time, but the player must still wear wings (accessory with "acc_wings" group) to be able to fly)
acc_flight_force -- how much the player gets propelled upwards every tick, while flying
acc_walkSpeed -- increases walking speed
acc_jumpHeight -- increases jumping height
acc_gravPull -- increases gravitational pull (enter a negative value, -0.5 for example, if you want the player to fall down at half the normal speed or so)
acc_digSpeed -- increases digging speed (only works with tools. Will not increase digging speed of your hand)
acc_thorns -- reflects that percentage of damage back to attacker (if you get attacked for 4 damage while having 50% thorns, your enemy will take back 2 damage. The returned damage will also be increaes by your offense stat)
acc_dodgeChance -- gives a chance to take no damage from an attack at all
acc_fireRes -- each point of fireRes gives 1 second of not taking any damage in damaging nodes, such as fire and lava

acc_CustomStats = ({{"FloatStat",<your floating-point number stat>,<float value>},{"IntStat",<your integer stat>,<int value>}}), -- you can add your own stats to your accessories using this. use FloatStat if you want your stat to support decimal numbers or IntStat if you don't. You can just register your own custom stat onto your accessories right away, there's no need to define it anywhere else beforehand. Custom stats, just like default stats, are saved as player's meta, so you can access them by using 
player:get_meta():get_int(<your integer stat>) or player:get_meta():get_float(<your floating-point number stat>) 

examples:
acc_CustomStats = ({{"FloatStat","ManaRegen",2.5},{"IntStat","dankness",420},{"IntStat","PoisonRessistence",5}})

acc_CustomStats = ({{"IntStat","luck",30}})



example of a registered accessory:

Code: Select all

minetest.register_tool("equippable_accessories:copper_chainmail", {
	description = ("Copper Chainmail \n" ..core.colorize("#aaaaaa","Equippable \n").. "" ..core.colorize("#aaaaaa","3 Defense").. ""),
	inventory_image = "accessories_copper_chainmail_inv.png",
	acc_defense = 3,

	acc_slot = "armor_acc",

	acc_size_body = ({x=2.5,y=2.5}),
	acc_model_body = ("double_body.b3d"),
	acc_texture_body = ("accessories_copper_chainmail.png"),
	acc_pos_body = {x=0,y=3.0,z=0},
	acc_anim_body = {x=0,y=0},

	acc_size_l_arm = ({x=2.4,y=2.4}),
	acc_model_l_arm = ("double_hand.b3d"),
	acc_texture_l_arm = ("accessories_copper_l_arm.png"),
	acc_pos_l_arm = {x=0,y=1.75,z=0},
	acc_anim_l_arm = {x=0,y=0},

	acc_size_r_arm = ({x=2.4,y=2.4}),
	acc_model_r_arm = ("double_hand.b3d"),
	acc_texture_r_arm = ("accessories_copper_r_arm.png"),
	acc_pos_r_arm = {x=0,y=1.75,z=0},
	acc_anim_r_arm = {x=0,y=0},

groups = {body_accessory = 1,l_arm_accessory = 1,r_arm_accessory = 1},
})
you can also register accessory sets with stats
just use

Code: Select all

AddAccessorySet(<your set name>,{<list of items that belong to the set>},{<stat list>},<set explanation>)
somewhere in your code.

example of a set:

Code: Select all

AddAccessorySet("adamantium_set",{"myaccmod:adamantium_helmet","myaccmod:adamantium_chestplate","myaccmod:adamantium_leggings"},{{"IntStat","accessory_defense",10},{"IntStat","dankness",69}},"12 defense & 69 dankness")
name of the equipped set is also saved as player's meta and you can use it for something if you want to.

Code: Select all

player:get_meta():get_string("SetName")
there's also

Code: Select all

PlayerHasAccEquipped(<player name>,<accessory itemname>)
and

Code: Select all

PlayerHasAccGroupEquipped(<player name>,<accessory group name>)
that you can use in your code, to check if a player has a specific accessory equipped or an accessory with a specific group

MisterE
Member
Posts: 239
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by MisterE » Post

wow, thanks for all this. Suggestion: copy/paste the above into a readme

User avatar
apercy
Member
Posts: 146
Joined: Wed Mar 25, 2020 16:31
GitHub: APercy
In-game: APercy
Location: Pinheiral - RJ - Brazil

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by apercy » Post

Wow! Any chance to make something to equip a character like Ains Ooal Gown? (https://overlordmaruyama.fandom.com/wiki/Ainz_Ooal_Gown)

User avatar
davidthecreator
Member
Posts: 387
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by davidthecreator » Post

apercy wrote:
Sun Feb 21, 2021 01:05
Wow! Any chance to make something to equip a character like Ains Ooal Gown? (https://overlordmaruyama.fandom.com/wiki/Ainz_Ooal_Gown)
Possible... But the design of that character seems quite complex...

So I can't guarantee you I'd make it soon or at all, but when I'm done with most important parts of the mod, I might try to.

User avatar
apercy
Member
Posts: 146
Joined: Wed Mar 25, 2020 16:31
GitHub: APercy
In-game: APercy
Location: Pinheiral - RJ - Brazil

Re: [Mod] equippable_accessories v0.2 (3D accessories you can equip for looks and stat bonuses)

by apercy » Post

davidthecreator wrote:
Sun Feb 21, 2021 11:14
apercy wrote:
Sun Feb 21, 2021 01:05
Wow! Any chance to make something to equip a character like Ains Ooal Gown? (https://overlordmaruyama.fandom.com/wiki/Ainz_Ooal_Gown)
Possible... But the design of that character seems quite complex...

So I can't guarantee you I'd make it soon or at all, but when I'm done with most important parts of the mod, I might try to.
It would be perfect!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests