minetest.register_craftitem("swords:big", {
description = "Big Sword",
inventory_image = "big_sword_texture.png",
wield_scale = { x = 2, y = 2, z = 2, },
})
octacian wrote:IDK, I guess people just haven't make any big swords. It's not that it's not possible in MT, all you have to do is change the wield_scale property of the itemdef. For example:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_craftitem("swords:big", {
description = "Big Sword",
inventory_image = "big_sword_texture.png",
wield_scale = { x = 2, y = 2, z = 2, },
})
The above should make a sword twice the size as normal swords. I haven't actually tried it, but that's my understanding.
Kosmos wrote:The above should make a sword twice the size as normal swords. I haven't actually tried it, but that's my understanding.
GreenDimond wrote:Now how to get this to work with weildview/3Darmor? :D
minetest.register_tool("swords:big_sword", {
description = "Big Sword",
inventory_image = "swords_big_sword.png",
wield_scale = {x=3, y=3, z=2},
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
if minetest.global_exists("wield3d") then
wield3d.location["swords:big_sword"] = {
"Arm_Right",
{x=0, y=5.5, z=8},
{x=-90, y=225, z=90},
{x=0.25, y=0.25}
}
end
octacian wrote:Wow, wrong yet again. lol
Thanks for correcting me stu and providing the right code :rotfl:
Kosmos wrote:Hi,
I looked a lot MineCraft videos and i tought why MT have no big swords like Minecraft.
stu wrote:GreenDimond wrote:Now how to get this to work with weildview/3Darmor? :D
Not possible with wieldview sadly, however, it is with wield3d ;-)
Here is the full code, it has the same properties as the default diamond sword. The last part is not absolutely necessary however it does position the sword better in the hand. Note that the mod 'swords' would need to soft-depend on wield3d for that to work.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_tool("swords:big_sword", {
description = "Big Sword",
inventory_image = "swords_big_sword.png",
wield_scale = {x=3, y=3, z=2},
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
if minetest.global_exists(wield3d) then
wield3d.location["swords:big_sword"] = {
"Arm_Right",
{x=0, y=5.5, z=8},
{x=-90, y=225, z=90},
{x=0.25, y=0.25}
}
end
GreenDimond wrote:Tried this, failed to remember to put the last part, and it worked with wrong placement. Added the rest of the code and now it is telling me
2017-01-14 14:58:58: ERROR[Main]: ModError: Failed to load and run script from /home/alex/.minetest/mods/test/init.lua:
2017-01-14 14:58:58: ERROR[Main]: /usr/share/minetest/builtin/common/strict.lua:9: core.global_exists: table: 0x404e1c40 is not a string
2017-01-14 14:58:58: ERROR[Main]: stack traceback:
2017-01-14 14:58:58: ERROR[Main]: [C]: in function 'error'
2017-01-14 14:58:58: ERROR[Main]: /usr/share/minetest/builtin/common/strict.lua:9: in function 'global_exists'
2017-01-14 14:58:58: ERROR[Main]: /home/alex/.minetest/mods/test/init.lua:46: in main chunk
2017-01-14 14:58:58: ERROR[Main]: Check debug.txt for details.
Yes, I added wield3d as soft dependency. Wat do?
if minetest.global_exists("wield3d") then
wield3d.location["swords:big_sword"] = {
"Arm_Right",
{x=0, y=5.5, z=8},
{x=-90, y=225, z=90},
{x=0.25, y=0.25}
}
end
stu wrote:GreenDimond wrote:Tried this, failed to remember to put the last part, and it worked with wrong placement. Added the rest of the code and now it is telling me
2017-01-14 14:58:58: ERROR[Main]: ModError: Failed to load and run script from /home/alex/.minetest/mods/test/init.lua:
2017-01-14 14:58:58: ERROR[Main]: /usr/share/minetest/builtin/common/strict.lua:9: core.global_exists: table: 0x404e1c40 is not a string
2017-01-14 14:58:58: ERROR[Main]: stack traceback:
2017-01-14 14:58:58: ERROR[Main]: [C]: in function 'error'
2017-01-14 14:58:58: ERROR[Main]: /usr/share/minetest/builtin/common/strict.lua:9: in function 'global_exists'
2017-01-14 14:58:58: ERROR[Main]: /home/alex/.minetest/mods/test/init.lua:46: in main chunk
2017-01-14 14:58:58: ERROR[Main]: Check debug.txt for details.
Yes, I added wield3d as soft dependency. Wat do?
Sorry, my bad, `minetest.global_exists` is expecting a string. I have now corrected the code above.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
if minetest.global_exists("wield3d") then
wield3d.location["swords:big_sword"] = {
"Arm_Right",
{x=0, y=5.5, z=8},
{x=-90, y=225, z=90},
{x=0.25, y=0.25}
}
end
Pro Tip: The value z=8 determines how far forward the object is translated.
Gael de Sailly wrote:Kosmos wrote:Hi,
I looked a lot MineCraft videos and i tought why MT have no big swords like Minecraft.
What is the purpose of such a sword, except imitating Minecraft on principle, and masking the player's view?
GreenDimond wrote:Now the game loads but it doesn't affect object position. I am still holding it by the blade in front of the handguard. Changing z= doesnt do a single thing.
stu wrote:GreenDimond wrote:Now the game loads but it doesn't affect object position. I am still holding it by the blade in front of the handguard. Changing z= doesnt do a single thing.
Well you must have done something wrong as the code works fine for me as you can see. I have attached a minimal working test mod, I hope this helps.
Users browsing this forum: No registered users and 6 guests