Page 2 of 3

PostPosted: Tue Feb 28, 2012 19:31
by Jeija
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
WATERPARTICLES = {
    physical = true,
    collisionbox = {0,0,0,0,0,0},
    visual = "sprite",
    visual_size = {x=0.2, y=0.2},
    textures = {"default_water.png"},
    on_activate = function (self)
        self.object:setvelocity({x=math.random(-1,1)*0.5, y=math.random(-1,1)*0.5, z=math.random(-1,1)*0.5})
    end,
    on_step = function(self, dtime)
        self.timer = self.timer + dtime
        if self.timer > 20 then
            self.object:remove()
        end
        if minetest.env:get_node(self.object:getpos()).name ~= "default:water_source" then
            self.object:remove()
        end
    end,
    timer = 0,
}

minetest.register_entity("particles:water", WATERPARTICLES)

minetest.register_abm({
    nodenames = {"default:water_source"},--, "default:water_flowing"},
    interval = 10,
    chance = 1,
    action = function(pos)
        if math.random(1000) == 1 then
            minetest.env:add_entity({x=pos.x+math.random()*0.5,y=pos.y-0.25,z=pos.z+math.random()*0.5}, "particles:water")
        end
    end,
})


This code adds floating particles in water. What about adding this to V 0.2 of this mod? (Maybe with another texture for the particles)

PostPosted: Tue Feb 28, 2012 19:33
by sfan5
Jeija wrote:
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
WATERPARTICLES = {
    physical = true,
    collisionbox = {0,0,0,0,0,0},
    visual = "sprite",
    visual_size = {x=0.2, y=0.2},
    textures = {"default_water.png"},
    on_activate = function (self)
        self.object:setvelocity({x=math.random(-1,1)*0.5, y=math.random(-1,1)*0.5, z=math.random(-1,1)*0.5})
    end,
    on_step = function(self, dtime)
        self.timer = self.timer + dtime
        if self.timer > 20 then
            self.object:remove()
        end
        if minetest.env:get_node(self.object:getpos()).name ~= "default:water_source" then
            self.object:remove()
        end
    end,
    timer = 0,
}

minetest.register_entity("particles:water", WATERPARTICLES)

minetest.register_abm({
    nodenames = {"default:water_source"},--, "default:water_flowing"},
    interval = 10,
    chance = 1,
    action = function(pos)
        if math.random(1000) == 1 then
            minetest.env:add_entity({x=pos.x+math.random()*0.5,y=pos.y-0.25,z=pos.z+math.random()*0.5}, "particles:water")
        end
    end,
})


This code adds floating particles in water. What about adding this to V 0.2 of this mod? (Maybe with another texture for the particles)

I'll maybe add this

PostPosted: Tue Feb 28, 2012 19:41
by Jeija
Congrats to your 600th post! ^^

PostPosted: Tue Feb 28, 2012 19:50
by sfan5
Jeija wrote:Congrats to your 600th post! ^^

Yay ^^:D

PostPosted: Tue Feb 28, 2012 20:02
by Jordach
Congrats, you still playing?

PostPosted: Wed Feb 29, 2012 07:03
by Melkor
is possible to make rain or snow with this?

PostPosted: Wed Feb 29, 2012 08:02
by Jordach
yes

PostPosted: Wed Feb 29, 2012 13:24
by jordan4ibanez
need to do it in C++ like that other guy did with weather, then we can have high performance particles

PostPosted: Wed Feb 29, 2012 16:14
by Jeija
I guess the fact that it is lua instead of c++ isn't the main problem. The most important thing is that particles cannot be controlled by a server - It must be client-side only. So for now, it's good to have this mod, but don't put too much work into it, so if someone makes this in c++ it was not totally for nothing.

PostPosted: Wed Feb 29, 2012 16:18
by Jordach
Jeija wrote:I guess the fact that it is lua instead of c++ isn't the main problem. The most important thing is that particles cannot be controlled by a server - It must be client-side only. So for now, it's good to have this mod, but don't put too much work into it, so if someone makes this in c++ it was not totally for nothing.


yes, that's right, all we need now is some form of way to see if someone is digging.

PostPosted: Mon Mar 12, 2012 13:32
by sfan5
Update!!
Changelog:
  • Colored Digging Particles
Download in the first Post!

PostPosted: Mon Mar 12, 2012 13:57
by Utilisatrice
Thank's Sfan5 !

You're amazing.

PostPosted: Tue Mar 20, 2012 06:19
by Death Dealer
little bubbles in front of your face while under water would be neat:D or maybe when you first jump in

PostPosted: Mon Apr 02, 2012 15:25
by bingo009
Hey, i'm new in Minetest, and this mod didn't work. I create mods folder in data folder, and move particle folder into mods folder, and i haven't got a particle effects. I only use a Minecraft Texture Pack. What's wrong?

PostPosted: Mon Apr 02, 2012 15:30
by Death Dealer
bingo009 wrote:Hey, i'm new in Minetest, and this mod didn't work. I create mods folder in data folder, and move particle folder into mods folder, and i haven't got a particle effects. I only use a Minecraft Texture Pack. What's wrong?

what version are you using? and the mod folder doesnt need to be made its in the root directory somewhere.

PostPosted: Mon Apr 02, 2012 16:12
by bingo009
I download minetest from this page(latest stable version, windows 7):
http://c55.me/minetest/download.php

This is my folders structure:
bin data doc world
|
mods(i place mods folders here)

PostPosted: Mon Apr 02, 2012 16:20
by Death Dealer

PostPosted: Sat Apr 07, 2012 09:51
by sfan5
Update!
Changelog:
  • Big Performance Improvement (make one on_dignode callback instead of ~30 of them)
  • Digging Particles support for Mesecons
Download in first Post

BTW for Modders: If you want Digging Particle Support for your Mod make a List with all Block and their Color
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
--== Modname ==--
{"modname:my_block1", "gray"},
{"modname:my_block2", "sandcolor"},

Available Colors: (List may be outdated)
  • black
  • brown
  • gray
  • green
  • lightgray
  • red
  • sandcolor
  • white
  • yellow
If you need extra Colors make a Texture for them called p_mycolor.png in the texture Folder.
Send me the List and extra Colors (if there are any) and i'll include it

PostPosted: Sat Apr 07, 2012 11:47
by RabbiBob
Nice!

Just had a random though looking at the code: would it be possible to have Particles Mod react to a node that belongs to a specific group? If so, define a custom group namespace in your mod and mod Devs would add that to their own mod code: instant integration without dependency.

Again, random thought not based on any actual working code reality.

PostPosted: Sat Apr 07, 2012 14:35
by Jordach
This is fucking handy Sfan!

PostPosted: Sat Apr 07, 2012 17:19
by sfan5
RabbiBob wrote:Nice!

Just had a random though looking at the code: would it be possible to have Particles Mod react to a node that belongs to a specific group? If so, define a custom group namespace in your mod and mod Devs would add that to their own mod code: instant integration without dependency.

Again, random thought not based on any actual working code reality.

Particles Mod can support any Mod, without any Dependency

PostPosted: Sat Apr 07, 2012 19:24
by JoseMing
omg thanks man for make particles to the blocks

PostPosted: Sat Apr 07, 2012 22:09
by RabbiBob
sfan5 wrote:Particles Mod can support any Mod, without any Dependency


My idea came when I read this, which is a dependency of interaction on your part if I read it correctly.

sfan5 wrote:BTW for Modders: If you want Digging Particle Support for your Mod make a List with all Block and their Color
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
--== Modname ==--
{"modname:my_block1", "gray"},
{"modname:my_block2", "sandcolor"},


...

Send me the List and extra Colors (if there are any) and i'll include it

PostPosted: Sun Apr 08, 2012 08:11
by sfan5
RabbiBob wrote:
sfan5 wrote:Particles Mod can support any Mod, without any Dependency


My idea came when I read this, which is a dependency of interaction on your part if I read it correctly.

sfan5 wrote:BTW for Modders: If you want Digging Particle Support for your Mod make a List with all Block and their Color
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
--== Modname ==--
{"modname:my_block1", "gray"},
{"modname:my_block2", "sandcolor"},


...

Send me the List and extra Colors (if there are any) and i'll include it

I need to add it to my Mod, you don't need to add something to e.g. BobBlocks

PostPosted: Sun Apr 08, 2012 10:11
by RabbiBob
Right, I get that and it's not what I'm saying.

I have the current groups on my 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 = {snappy=2,cracky=3,oddly_breakable_by_hand=3},


The engine knows that my block belongs to those groups and acts accordingly.

My question was "would it be possible to have Particles Mod react to a node that belongs to a specific group?", meaning this as an 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
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, particle_mod=2},


and arbitrarily 2 equates to, lets say, red.

If the engine allowed the mod to react to that value in someway, you would not need to add things to your mod (i.e. this is a dependency of a different sort) and I could decide one day to just add it to my Mod without needing your adding/updating/me waiting for server Admins to update their servers/etc.

Does that make more sense?

Just saw this post:

http://minetest.net/forum/viewtopic.php?pid=19632#p19632

PostPosted: Sun Apr 08, 2012 10:43
by Utilisatrice
Hi,

Sfan5, when i want delete the particle mod, i can't play on my map because the game crashed !

Can you help me, please ?

My map is very great.

PostPosted: Sun Apr 08, 2012 11:47
by sfan5
Utilisatrice wrote:Hi,

Sfan5, when i want delete the particle mod, i can't play on my map because the game crashed !

Can you help me, please ?

My map is very great.

What Error do you get?

PostPosted: Sun Apr 08, 2012 12:07
by Utilisatrice
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
14:04:26: VERBOSE[ServerThread]: ServerEnvironment::deactivateFarObjects(): deactivating object id=2 on inactive block (676,3,689)
14:04:26: INFO[ServerThread]: ItemSAO::getStaticData
14:04:26: VERBOSE[ServerThread]: ServerEnvironment::deactivateFarObjects(): object id=2 is known by clients; not deleting yet
14:04:26: INFO[main]: Pointing at [node under=10779,52,11032 above=10779,53,11032]
14:04:26: VERBOSE[ServerThread]: ServerEnvironment::activateObjects(): activating objects of block (673,1,689) (2 objects)
14:04:26: INFO[ServerThread]: LuaEntitySAO::create(name="particles:smoke" state="")
14:04:26: VERBOSE[ServerThread]: ServerEnvironment::activateObjects(): activated static object pos=(10780.3,28.7076,11026.1) type=7
14:04:26: VERBOSE[ServerThread]: ServerEnvironment::addActiveObjectRaw(): Added id=3; there are now 3 active objects.
14:04:26: VERBOSE[ServerThread]: scriptapi_luaentity_add: id=3 name="particles:smoke"
14:04:26: ERROR[ServerThread]: LuaEntity name "particles:smoke" not defined
14:04:26: VERBOSE[ServerThread]: scriptapi_luaentity_activate: id=3

PostPosted: Sun Apr 08, 2012 12:40
by sfan5
Install Particles Mod, do /clearobjects, deinstall Particles Mod
That should work

PostPosted: Sun Apr 08, 2012 13:17
by Utilisatrice
Thank Sfan5,

His work !