Flint and steel
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
Flint and steel
Very simple. You use the flint and steel to light fires, giving some real purpose for fire. I'm sure I will improve on this eventually. Also it would be great if someone could tell me how to add health to a craftitem.
Download: http://ubuntuone.com/50skCvr06V62lclyd4ln6p
Download: http://ubuntuone.com/50skCvr06V62lclyd4ln6p
Last edited by jordan4ibanez on Mon Apr 16, 2012 07:24, edited 1 time in total.
hello, am program. do language in rust. make computer do. okay i go now.
Amazing! I've just burned down almost whole jungle. What do you think about crafting recipe like:
nothing, nothing, nothing
sandstone, sandstone, steel_ingot
sandstone, sandstone, steel_ingot
nothing, nothing, nothing
sandstone, sandstone, steel_ingot
sandstone, sandstone, steel_ingot
my mods: infrastructure_modpack | papyrus_bed | papyrus_door my blog: radekslowik.pl
Is there a way to override the definition of the gravel node in {Minetest_Directory}/games/minetest-game/mods/default/init.lua? I'd to like make them give them flint instead of a gravel block sometimes. I added the following to {Minetest_Directory}/mods/minetest/flint_and_steel/init.lua, but much to my disappoint it didn't redefine default:gravel. Is there a way to do this without editing /default/init.lua?
Code: Select all
minetest.register_node("flint_and_steel:gravel", {
description = "Gravel",
tile_images = {"default_gravel.png"},
is_ground_content = true,
groups = {crumbly=2, falling_node=1},
drop = {
max_items = 1,
items = {
{
items = {'flint_and_steel:flint'},
rarity = 5,
},
{
items = {'default:gravel'},
}
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
}),
})
minetest.register_craft({
output = 'flint_and_steel:flint_and_steel 1',
recipe = {
{'default:steel_ingot', '', ''},
{'', 'flint_and_steel:flint', ''},
}
})
Last edited by MikoMiko on Thu Apr 19, 2012 02:34, edited 1 time in total.
Try changing flint_and_steel:gravel to default:gravel, and see what you come up with (hoping it's not an error)
Last edited by lkjoel on Thu Apr 19, 2012 02:39, edited 1 time in total.
My mods: The Nether | Doctor Who (WIP)
I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
Thanks for the suggestion, but I had tried that before posting, it raises the following error. I guess using default:gravel in mods isn't allowed.
Code: Select all
21:41:02: ERROR[main]: ========== ERROR FROM LUA ===========
21:41:02: ERROR[main]: Failed to load and run script from
21:41:02: ERROR[main]: /home/UserName/Downloads/minetest-git/bin/../mods/minetest/flint_and_steel/init.lua:
21:41:02: ERROR[main]: ...nloads/minetest-git/bin/../builtin/misc_register.lua:62: Name default:gravel does not follow naming conventions: "modname:" or ":" prefix required
21:41:02: ERROR[main]: stack traceback:
21:41:02: ERROR[main]: [C]: in function 'error'
21:41:02: ERROR[main]: ...nloads/minetest-git/bin/../builtin/misc_register.lua:62: in function 'check_modname_prefix'
21:41:02: ERROR[main]: ...nloads/minetest-git/bin/../builtin/misc_register.lua:98: in function 'register_item'
21:41:02: ERROR[main]: ...nloads/minetest-git/bin/../builtin/misc_register.lua:154: in function 'register_node'
21:41:02: ERROR[main]: ...st-git/bin/../mods/minetest/flint_and_steel/init.lua:27: in main chunk
21:41:02: ERROR[main]: =======END OF ERROR FROM LUA ========
yep, I knew it would output an error :S. I'm clueless now
My mods: The Nether | Doctor Who (WIP)
I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
ehh..works in here https://github.com/jordan4ibanez/Minetest-Ultra
hello, am program. do language in rust. make computer do. okay i go now.
Yeah, but I looked and you had to edit /default/init.lua. I was hoping there would be a way to avoid doing that and override in the mod but that doesn't seem to possible.jordan4ibanez wrote:ehh..works in here https://github.com/jordan4ibanez/Minetest-Ultra
- minecraft64
- Member
- Posts: 16
- Joined: Sun Jul 22, 2012 14:23
- Location: Stalker Block!! XD
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
This is a bit late but you can redefine nodes by setting a : in front of their name:MikoMiko wrote:Is there a way to override the definition of the gravel node in {Minetest_Directory}/games/minetest-game/mods/default/init.lua? I'd to like make them give them flint instead of a gravel block sometimes. I added the following to {Minetest_Directory}/mods/minetest/flint_and_steel/init.lua, but much to my disappoint it didn't redefine default:gravel. Is there a way to do this without editing /default/init.lua?
Code: Select all
minetest.register_node(":default:gravel", {...})
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
jordan4ibanez wrote:Also it would be great if someone could tell me how to add health to a craftitem.
Code: Select all
itemstack:add_wear(65535/[number of uses])
-
- Member
- Posts: 211
- Joined: Tue Jul 31, 2012 20:37
Even overriding default:gravel I'm not getting drops of flint... either something is not working or the flint drops are very very very very rare.PilzAdam wrote:This is a bit late but you can redefine nodes by setting a : in front of their name:MikoMiko wrote:Is there a way to override the definition of the gravel node in {Minetest_Directory}/games/minetest-game/mods/default/init.lua? I'd to like make them give them flint instead of a gravel block sometimes. I added the following to {Minetest_Directory}/mods/minetest/flint_and_steel/init.lua, but much to my disappoint it didn't redefine default:gravel. Is there a way to do this without editing /default/init.lua?Code: Select all
minetest.register_node(":default:gravel", {...})
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
awesome mod!
i added a drop from gravel (tested and it works), and also a shapeless craft. grab the code here:
https://github.com/cornernote/minetest-flint_and_steel
please merge my changes back into this code
i added a drop from gravel (tested and it works), and also a shapeless craft. grab the code here:
https://github.com/cornernote/minetest-flint_and_steel
please merge my changes back into this code
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
This is the code for flint and strike in fancy game mode
Code: Select all
--The igniter tool
minetest.register_tool("flint_and_strike:flint_and_strike", {
description = "Flint and Strike",
inventory_image = "flint_and_steel.png",
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type=="node" then
if minetest.env:get_node(pointed_thing.under).name == "torch_plus:torch_unlit" then
minetest.sound_play("flint", {pos=pointed_thing.under, loop=false})
node = minetest.env:get_node(pointed_thing.under)
minetest.env:add_node(pointed_thing.under, {name="torch_plus:torch_lit", param2 = node.param2})
itemstack:add_wear(1000)
return itemstack
else
if minetest.env:get_node(pointed_thing.above).name == "air" then
minetest.sound_play("flint", {pos=pointed_thing.under, loop=false})
itemstack:add_wear(1000)
minetest.env:add_node(pointed_thing.above, {name="fire:basic_flame"})
return itemstack
end
end
end
end,
})
minetest.register_craft({
type = "shapeless",
output = 'flint_and_strike:flint_and_strike 1',
recipe = {
'flint_and_strike:stone_piece',
'flint_and_strike:flint',
}
})
minetest.register_craftitem("flint_and_strike:flint", {
description = "Flint",
inventory_image = "flint.png",
})
minetest.register_craftitem("flint_and_strike:stone_piece", {
description = "Stone Piece",
inventory_image = "stone_piece.png",
})
minetest.register_craft({
output = 'flint_and_strike:flint',
recipe = {
{'default:gravel'},
}
})
minetest.register_craft({
output = 'flint_and_strike:flint',
recipe = {
{'default:sandstone'},
}
})
minetest.register_craft({
output = 'flint_and_strike:flint',
recipe = {
{'default:desert_stone'},
}
})
minetest.register_craft({
output = 'flint_and_strike:stone_piece',
recipe = {
{'default:cobble'},
}
})
hello, am program. do language in rust. make computer do. okay i go now.
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
Who is online
Users browsing this forum: No registered users and 33 guests