Page 1 of 1

[Mod] Particles [particles] Digging explosions and other particles.

PostPosted: Sun Sep 16, 2012 11:35
by cornernote
Particles for Minetest

Generates particles in the world when you dig blocks, smoke, etc.

Documentation | GitHub Project

Image

About

This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching Earthlings, a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.

Credits

sfan5 - coded the original particles mod which I borrowed and made into this one.
PilzAdam - made it work for any item without being defined in a mod, also improved the code.

License

BSD-3-Clause, Copyright © 2014 Brett O'Donnell

PostPosted: Sun Sep 16, 2012 12:33
by PilzAdam
This look great!

PostPosted: Sun Sep 16, 2012 12:41
by PilzAdam
Some suggestions:
Add particles for every node (maybe a group no_particles to prevent it) and use the textures of the node
Make the particles a bit slower (they fly too far IMO)
Remove the selectionbox of the particles
Smoke particles spawn in fire

PostPosted: Sun Sep 16, 2012 15:46
by cHyper
awesome... cool effects....

PostPosted: Sun Sep 16, 2012 17:59
by VanessaE
+1 regarding smoke, and please PLEASE make it look something like smoke instead of just pixels, and make it more abundant than in the old mod (sorry sfan :-) ).

PostPosted: Sun Sep 16, 2012 18:01
by PilzAdam

PostPosted: Sun Sep 16, 2012 19:08
by sfan5
Very cool!

PostPosted: Mon Sep 17, 2012 02:59
by cornernote
VanessaE wrote:+1 regarding smoke, and please PLEASE make it look something like smoke instead of just pixels, and make it more abundant than in the old mod (sorry sfan :-) ).


Do you have a texture you would like see used?

PostPosted: Mon Sep 17, 2012 03:00
by cornernote


pulled, thanks for the code improvements

PostPosted: Mon Sep 17, 2012 14:01
by Gambit
Does this provide particles for water or lava as well? It would be neat to see splashing or small magma pieces jump up.

PostPosted: Mon Sep 17, 2012 15:20
by Mito551
a little suggestion: maybe make them disappear faster?

PostPosted: Mon Sep 17, 2012 16:41
by VanessaE
Odd bug: dig up a piston or sticky piston from mesecons. The particles become some odd color and flicker like crazy.

PostPosted: Mon Sep 17, 2012 17:30
by Mito551
Gambit wrote:Does this provide particles for water or lava as well? It would be neat to see splashing or small magma pieces jump up.


i'm not the cornernote, but nope, it doesn't. splashing seems easy to do (as i see it), but lava stuff... a suggestion^^

PostPosted: Mon Sep 17, 2012 17:48
by PilzAdam
VanessaE wrote:Odd bug: dig up a piston or sticky piston from mesecons. The particles become some odd color and flicker like crazy.

Suggestion for all mesecon nodes:
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
groups = {no_particles=1}

Particles dont fit into the mesecons mod.

PostPosted: Tue Sep 18, 2012 04:27
by leo_rockway
This looks great!
What about particles while digging? Or at least particles on punch?

PostPosted: Tue Sep 18, 2012 05:00
by VanessaE
There's no callback/function that can tell if the player is digging (or even just swinging at air), so this isn't really possible yet.

PostPosted: Tue Sep 18, 2012 05:26
by leo_rockway
VanessaE wrote:There's no callback/function that can tell if the player is digging (or even just swinging at air), so this isn't really possible yet.


Yeah, we talked about checking the health of the node once, on IRC, but it sounded like a cumbersome hack for little functionality. I was just hoping that maybe a function to tell if the player is digging had been included in the new release...

Anyway, at least it could be done for punches...

PostPosted: Tue Sep 18, 2012 11:34
by Magicdolphin
looks cool!!

PostPosted: Wed Sep 19, 2012 20:17
by Iqualfragile
PLEASE: tune down the amount of particles spawned to 5 or random(7,3)
i have chaned it on my server because it just killed the upload.

PostPosted: Wed Sep 19, 2012 21:40
by cornernote
That's odd. It works really fast for me. Is your computer oldish?

Has anyone else had an issue because of too mant particles?

PostPosted: Wed Sep 19, 2012 21:43
by Iqualfragile
let me cite: "the upload."
so its network-based (crappy upload…)

PostPosted: Wed Sep 19, 2012 21:51
by Iqualfragile
23:48:16: ERROR[ServerThread]: Item "doorsplus:door_wood_left_a_c" not defined
node_dig
23:48:16: ACTION[ServerThread]: me digs doorsplus:door_wood_left_a_c at (-56,11,7)
23:48:17: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...dir/minetest/bin/../mods/minetest/particles/init.lua:49: attempt to index local 'node' (a nil value)
23:48:17: ERROR[main]: stack traceback:

In thread 7f855fe88740:
/home/me/minetest/src/main.cpp:1741: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7f855fe88740:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void ServerMap::saveBlock(MapBlock*))
(Leftover data: #4 void ItemStack::serialize(std::ostream&) const)

PostPosted: Wed Sep 19, 2012 22:40
by cornernote
Iqualfragile wrote:23:48:16: ERROR[ServerThread]: Item "doorsplus:door_wood_left_a_c" not defined
node_dig
23:48:16: ACTION[ServerThread]: me digs doorsplus:door_wood_left_a_c at (-56,11,7)
23:48:17: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...dir/minetest/bin/../mods/minetest/particles/init.lua:49: attempt to index local 'node' (a nil value)
23:48:17: ERROR[main]: stack traceback:

In thread 7f855fe88740:
/home/me/minetest/src/main.cpp:1741: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7f855fe88740:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void ServerMap::saveBlock(MapBlock*))
(Leftover data: #4 void ItemStack::serialize(std::ostream&) const)



I installed doorsplus, but I could not replicate the issue. From your log it says you broke door A when it was closed. I broke door A and B, open and closed, no crash.

I did look at the code where it crashed, and added a line that may fix it. Please let me know if you still have this issue.

PostPosted: Thu Sep 20, 2012 17:15
by Iqualfragile
Iqualfragile wrote:23:48:16: ERROR[ServerThread]: Item "doorsplus:door_wood_left_a_c" not defined


i have removed the mod, so its an unknown block

PostPosted: Thu Sep 20, 2012 22:22
by cornernote
Ahh, I see. Please try latest git. I fixed some unknown block dig issues recently.

PostPosted: Fri Sep 28, 2012 01:34
by jordan4ibanez
+10

PostPosted: Fri Oct 05, 2012 02:30
by leo_rockway
I got this just now:

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
23:25:35: ERROR[main]: ServerEnv: Trying to store id=73 statically but block (3,-1,0) already contains 49 (over 49) objects. Forcing delete.
23:25:35: ERROR[main]: ServerEnv: Trying to store id=74 statically but block (3,-1,0) already contains 49 (over 49) objects. Forcing delete.
23:25:35: ERROR[main]: ServerEnv: Trying to store id=76 statically but block (3,-1,0) already contains 49 (over 49) objects. Forcing delete.
23:25:35: ERROR[main]: ServerEnv: Trying to store id=77 statically but block (3,-1,0) already contains 49 (over 49) objects. Forcing delete.
23:25:36: ERROR[main]: ServerError: LuaError: error running function 'on_step': /home/leo/.minetest/mods/minetest/particles/init.lua:53: attempt to index local 'digger' (a nil value)
23:25:36: ERROR[main]: stack traceback:


I think it's because a lot of gravel fell and it landed on a torch... it might be blocking the torch particles (although I'm not certain it's that).
Also, I'm not sure if the "Forcing delete" errors are related. That might be something from the simple mobs mod.

PostPosted: Fri Oct 05, 2012 02:53
by cornernote
thanks leo_rockway,

i just added fix to stop it from killing the server if that happens

PostPosted: Mon Nov 05, 2012 17:27
by PilzAdam
Heres a backup of the mod: http://ompldr.org/vZzVseQ/minetest-particles.zip
(The number of particles are changed to 7-9, but it looks better)