[Mod] Torches [3.0.1] [torches]

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

[Mod] Torches [3.0.1] [torches]

by BlockMen » Sat May 25, 2013 21:31

Hi everyone,

this mod adds 3D torches to Minetest in two different styles; by default in Minetest style (flames are animated textures).
The second style is Minecraft like, so flames are "animated" by using particles

Minetest styled:
Those torches use the same textures as the 2D torch, so its fully compatible with Texture Packs. By default ceiling torches
are removed and cannot be placed aswell. You can change this behavior by adding "torches_enable_ceiling = true" to your minetest.conf
Furthermore this style is more server traffic friendly, so it is enabled by default

Minecraft styled:
Those torches have a non-animated texture and needs to be supported by Texture Packs (currently most don't support this mod).
"Animation" is done like in Minecraft with particles, which cause (in the current implementation in the Minetest engine)
some amount of traffic and can cause lags at slow connections. The rate and distance when particles are send is configurable
in the first lines of "mc_style.lua". Enable this style by adding "torches_style = minecraft" to your minetest.conf. Note that
the ceiling setting is ignored with this style.

Notice:
Both styles convert existing torches to the new style. Keep in mind that by default ceiling torches get removed !

Depends:
default

Download:
Version 3.0.1: Download (Minetest 0.4.12 and later)

+ older Releases (WTFPL)


License:
LGPL 2.1 (Code) and CC-BY 3.0 (Textures and Meshes/Models)

Other:
Repository: on Github

Please give Feedback and ideas for improvement
Last edited by BlockMen on Sun Mar 29, 2015 16:54, edited 5 times in total.
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat May 25, 2013 21:33

http://forum.minetest.net/viewtopic.php?id=3021
The link above leads to a previous attempt to create 3D torches for Minetest. Maybe it's lantern could prove to be useful?
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat May 25, 2013 21:39

Inocudom wrote:http://forum.minetest.net/viewtopic.php?id=3021
The link above leads to a previous attempt to create 3D torches for Minetest. Maybe it's lantern could prove to be useful?


There are one or two more mods that have 3D torches, but none has particles flames, which have IMO alot benefits and also look IMO better.

And this mod will just have torches, nothing else ;)
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat May 25, 2013 21:46

Another amazing mod BlockMen! :D
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun May 26, 2013 12:43

Evergreen wrote:Another amazing mod BlockMen! :D

thanks.

--

Update: Version 1.1

Changelog:
- Torches on wall dont drop when node under it is digged
- Torches drop directly when not placed on floor or wall
- fixed different other placing bugs
 

User avatar
babe223
Member
 
Posts: 141
Joined: Mon Nov 14, 2011 13:36

by babe223 » Sun May 26, 2013 14:17

http://forum.minetest.net/viewtopic.php?id=3021
My mod has animation of fire so no particle of smoke nor his '-'
Bem vindos Brasileiros,eu sou primeiro brasileiro daqui do forum, espero que tragam bastante mods

[MOD] torch http://minetest.net/forum/viewtopic.php?id=3021
[MOD]HATCHE:http://minetest.net/forum/viewtopic.php?id=3458
 

User avatar
AndrOn
Member
 
Posts: 38
Joined: Fri May 31, 2013 22:32

by AndrOn » Thu Jun 20, 2013 14:31

These torches are regularly dropping torches items in my world, don't know why. (awesome mod by the way ;)
sorry for bad english
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu Jun 20, 2013 18:23

AndrOn wrote:These torches are regularly dropping torches items in my world, don't know why. (awesome mod by the way ;)


Are the torches dropping "themself" or do they stay and drop items? What version do you use (Minetest and mod)?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Thu Jun 20, 2013 18:59

Nice!
 

User avatar
MaxCZ
Member
 
Posts: 21
Joined: Thu Jun 13, 2013 11:19

by MaxCZ » Fri Jun 21, 2013 14:37

NNNNNNNNNNNNNNNNNNNNNNNNNNNiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiccccccccccccccccccccccccccccceeeeeeeeeeeeeeeeeee
wazuclan.com by MaxCZ
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Jun 21, 2013 21:42

I really like the torches mod. :)

I do have one problem though. I can't place the torches on ceilings. They fall off right away. Placing torches on ceilings, upside down, is the most common way I use torches so it's a little bit of a pain for me. That is the only downside I have seen to the mod so far.

Great work. :)
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat Jun 22, 2013 08:24

LionsDen wrote:I do have one problem though. I can't place the torches on ceilings. They fall off right away.


Its a feature, not a bug ;)
 

CalumMc
Member
 
Posts: 58
Joined: Mon Dec 12, 2011 16:50

by CalumMc » Sat Aug 10, 2013 17:21

Sometimes I see a torch raining dropped items directly under it, resulting in many items. Also if a player places a torch on a door, it actually destroys part of the door. In addition, this mod takes no notice of protection systems, leaving a mess of torches in my spawn. Is there a solution to these problems besides removing the mod? Thanks
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Aug 18, 2013 14:18

CalumMc wrote:Sometimes I see a torch raining dropped items directly under it, resulting in many items. Also if a player places a torch on a door, it actually destroys part of the door. In addition, this mod takes no notice of protection systems, leaving a mess of torches in my spawn. Is there a solution to these problems besides removing the mod? Thanks


Currently i have no idea what is causing this issues, so i guess removing is currently the best solution...
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Fri Sep 06, 2013 16:54

Update. Version 1.2 released

--

accidentally i removed this post, sry
Last edited by BlockMen on Wed Jan 22, 2014 12:57, edited 1 time in total.
 

jenova99sephiros
Member
 
Posts: 158
Joined: Sat Aug 03, 2013 15:16
In-game: Jenova

by jenova99sephiros » Wed Oct 09, 2013 07:12

Great mod
I english google translator
 

User avatar
Johnyknowhow
Member
 
Posts: 358
Joined: Fri Sep 21, 2012 15:17
In-game: Minetestian

by Johnyknowhow » Sun Nov 17, 2013 20:54

Great,
More minecraftest,
I lost interest in Minetest for a couple of years and... I am still not really paying much attention. I rarely browse these forums anymore but it's nice to see old faces.

obligatory fancy signature goes here
 

Markov
New member
 
Posts: 6
Joined: Sat Jan 11, 2014 06:59

by Markov » Tue Jan 14, 2014 09:31

Can you just edit textire to model for default torch? It'll be better!
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Tue Jan 14, 2014 14:15

Markov wrote:Can you just edit textire to model for default torch? It'll be better!


I don't like like the default texture, so my answer is: no.
 

gsmanners
Member
 
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Thu Jan 16, 2014 05:21

Is there a way to make this work without the add_particle? I'm not sure, but I think having lots of particles in a really huge cavern would make the game lag a bit.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu Jan 16, 2014 13:32

gsmanners wrote:Is there a way to make this work without the add_particle? I'm not sure, but I think having lots of particles in a really huge cavern would make the game lag a bit.


Well, you can try out if limiting helps. I made a dev-branch on github where flames are only spawned when a player is near torch (13 block by default).

https://github.com/BlockMen/torches/tree/dev
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Jan 16, 2014 14:00

BlockMen wrote:They have "real" flames

Wouldnt that harm my computer?
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Thu Jan 16, 2014 14:21

PilzAdam wrote:
BlockMen wrote:They have "real" flames

Wouldnt that harm my computer?
In fact, wouldn't that burn down your house?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu Jan 16, 2014 14:54

PilzAdam wrote:
BlockMen wrote:They have "real" flames

Wouldnt that harm my computer?


Hmm...guess why I put the word "real" in quotation marks.

But be a man and try out if they harm your computer ;)
 

gsmanners
Member
 
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Thu Jan 16, 2014 23:28

BlockMen wrote:Well, you can try out if limiting helps. I made a dev-branch on github where flames are only spawned when a player is near torch (13 block by default).

https://github.com/BlockMen/torches/tree/dev


Thanks. I'll give that a shot.
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Fri Jan 17, 2014 00:42

You made a mistake when redefining the torch, better use this diff:
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
diff --git a/init.lua b/init.lua
index ea88ee8..96e0038 100644
--- a/init.lua
+++ b/init.lua
@@ -77,13 +77,8 @@ local function is_wall(wallparam)
 end

 --node_boxes
-minetest.register_craftitem(":default:torch", {
-       description = "Torch",
-       inventory_image = "torches_torch.png",
-       wield_image = "torches_torch.png",
-       wield_scale = {x=1,y=1,z=1+1/16},
-       liquids_pointable = false,
-       on_place = function(itemstack, placer, pointed_thing)
+minetest.override_item("default:torch",{
+       on_place = function(itemstack, placer, pointed_thing)
                if pointed_thing.type ~= "node" or string.find(minetest.env:get_node(pointed_thing.above).name, "torch") then
                        return itemstack
                end
@@ -92,20 +87,18 @@ minetest.register_craftitem(":default:torch", {
                local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z})
                local u_n = minetest.get_node(under)
                if u_n and not minetest.registered_nodes[u_n.name].walkable then above = under end
-               local u_n = minetest.get_node(above)
+                       local u_n = minetest.get_node(above)
                if u_n and minetest.registered_nodes[u_n.name].walkable then return itemstack end
                if wdir == 1 then
-                       minetest.env:add_node(above, {name = "torches:floor"})
-               else
+                       minetest.env:add_node(above, {name = "torches:floor"})
+               else   
                        minetest.env:add_node(above, {name = "torches:wand", param2 = is_wall(wdir)})
                end
                if not wdir == 0 or not minetest.setting_getbool("creative_mode") then
                        itemstack:take_item()
                end
                return itemstack
-
        end
-
 })

 minetest.register_node("torches:floor", {
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
 

gsmanners
Member
 
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Fri Jan 17, 2014 00:50

Hmm... I was about to say it's working a lot better, although there is still the problem of torches sometimes falling for no apparent reason at times.

Image

I'm a little nuts with the torches here, but I think limiting the add_particle within 13 is a good optimization. I think this many torches would have made me lag quite a bit in the old vesion.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Fri Jan 17, 2014 09:13

Iqualfragile wrote:You made a mistake when redefining the torch, better use this diff:
[spoiler]
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
diff --git a/init.lua b/init.lua
index ea88ee8..96e0038 100644
--- a/init.lua
+++ b/init.lua
@@ -77,13 +77,8 @@ local function is_wall(wallparam)
 end

 --node_boxes
-minetest.register_craftitem(":default:torch", {
-       description = "Torch",
-       inventory_image = "torches_torch.png",
-       wield_image = "torches_torch.png",
-       wield_scale = {x=1,y=1,z=1+1/16},
-       liquids_pointable = false,
-       on_place = function(itemstack, placer, pointed_thing)
+minetest.override_item("default:torch",{
+       on_place = function(itemstack, placer, pointed_thing)
                if pointed_thing.type ~= "node" or string.find(minetest.env:get_node(pointed_thing.above).name, "torch") then
                        return itemstack
                end
@@ -92,20 +87,18 @@ minetest.register_craftitem(":default:torch", {
                local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z})
                local u_n = minetest.get_node(under)
                if u_n and not minetest.registered_nodes[u_n.name].walkable then above = under end
-               local u_n = minetest.get_node(above)
+                       local u_n = minetest.get_node(above)
                if u_n and minetest.registered_nodes[u_n.name].walkable then return itemstack end
                if wdir == 1 then
-                       minetest.env:add_node(above, {name = "torches:floor"})
-               else
+                       minetest.env:add_node(above, {name = "torches:floor"})
+               else   
                        minetest.env:add_node(above, {name = "torches:wand", param2 = is_wall(wdir)})
                end
                if not wdir == 0 or not minetest.setting_getbool("creative_mode") then
                        itemstack:take_item()
                end
                return itemstack
-
        end
-
 })

 minetest.register_node("torches:floor", {
[/spoiler]


First: Its no mistake, it the "old" way of redefining.
Second: I will stay at that to allow people with older Minetest versions use this mod to, IMO the "overwrite" function is not necessary at all.


gsmanners wrote:Hmm... I was about to say it's working a lot better, although there is still the problem of torches sometimes falling for no apparent reason at times.

http://i.imgur.com/APxUnvS.jpg

I'm a little nuts with the torches here, but I think limiting the add_particle within 13 is a good optimization. I think this many torches would have made me lag quite a bit in the old vesion.


Ok, thanks for your feedback. I will look for the "dropping"-issue by time and use the limiting in next release then.
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Fri Jan 17, 2014 16:27

BlockMen wrote:
Iqualfragile wrote:You made a mistake when redefining the torch, better use this diff:
[spoiler]
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
diff --git a/init.lua b/init.lua
index ea88ee8..96e0038 100644
--- a/init.lua
+++ b/init.lua
@@ -77,13 +77,8 @@ local function is_wall(wallparam)
 end

 --node_boxes
-minetest.register_craftitem(":default:torch", {
-       description = "Torch",
-       inventory_image = "torches_torch.png",
-       wield_image = "torches_torch.png",
-       wield_scale = {x=1,y=1,z=1+1/16},
-       liquids_pointable = false,
-       on_place = function(itemstack, placer, pointed_thing)
+minetest.override_item("default:torch",{
+       on_place = function(itemstack, placer, pointed_thing)
                if pointed_thing.type ~= "node" or string.find(minetest.env:get_node(pointed_thing.above).name, "torch") then
                        return itemstack
                end
@@ -92,20 +87,18 @@ minetest.register_craftitem(":default:torch", {
                local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z})
                local u_n = minetest.get_node(under)
                if u_n and not minetest.registered_nodes[u_n.name].walkable then above = under end
-               local u_n = minetest.get_node(above)
+                       local u_n = minetest.get_node(above)
                if u_n and minetest.registered_nodes[u_n.name].walkable then return itemstack end
                if wdir == 1 then
-                       minetest.env:add_node(above, {name = "torches:floor"})
-               else
+                       minetest.env:add_node(above, {name = "torches:floor"})
+               else   
                        minetest.env:add_node(above, {name = "torches:wand", param2 = is_wall(wdir)})
                end
                if not wdir == 0 or not minetest.setting_getbool("creative_mode") then
                        itemstack:take_item()
                end
                return itemstack
-
        end
-
 })

 minetest.register_node("torches:floor", {
[/spoiler]


First: Its no mistake, it the "old" way of redefining.
Second: I will stay at that to allow people with older Minetest versions use this mod to, IMO the "overwrite" function is not necessary at all.

It actually has a mistake which i avoided by just overriding one single value: you did not define the torch as diggable at all.
overriding helps do avoid those mistakes, keep up with changes in the original mod and reduce collisions between mods, maybe it would be best to publish two seperate versions of your mod for different minetest versions (you could use mmdb for that).
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Fri Jan 17, 2014 17:29

Iqualfragile wrote:It actually has a mistake which i avoided by just overriding one single value: you did not define the torch as diggable at all.
overriding helps do avoid those mistakes, keep up with changes in the original mod and reduce collisions between mods, maybe it would be best to publish two seperate versions of your mod for different minetest versions (you could use mmdb for that).


I would have been able to just override/add the on_place function before, but i decided to override the complete definition to have a craft item instead. By that i missed that craft item-nodes (or whatever you want call then old torches) are not diggable.

So this mistake would not been prevented since my intention was to to change the definiton at all, not just that particular function.

But thanks for pointing out that old torches are not diggable.
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 8 guests

cron