particlespawner property: kind = "line"

Post Reply
shanish2
Member
Posts: 22
Joined: Sun Apr 14, 2024 12:25

particlespawner property: kind = "line"

by shanish2 » Post

In the doc it says:
"line": the particles are attracted to an (infinite) line passing through the points origin and angle. use this for e.g. beacon effects, energy beam effects, etc.

I'm interested in using it for beacon instead of using light nodes. But I have no clue how to use it.
Can someone give me an example how to use kind = "line"?

Astrobe
Member
Posts: 588
Joined: Sun Apr 01, 2018 10:46

Re: particlespawner property: kind = "line"

by Astrobe » Post

Shanish2, please note that MRVI's answer is an obvious copy/pasta of chatGPT that wasn't even reviewed for correctness.

This "user" has been reported.
My game? It's Minefall.

adam anbar
New member
Posts: 3
Joined: Tue May 14, 2024 22:45

Re: particlespawner property: kind = "line"

by adam anbar » Post

Pour utiliser la propriété kind = "line" dans ton système de particules pour créer un effet de balise, tu peux configurer les particules de manière à ce qu'elles soient attirées par une ligne infinie entre deux points. Voici un exemple pour t'aider :

Code: Select all

minetest.register_entity("mod:particle_beacon", {
    initial_properties = {
        visual = "sprite",
        textures = {"your_texture.png"},
        physical = false,
    },
    on_activate = function(self)
        minetest.add_particlespawner({
            amount = 100,
            time = 0,
            minpos = {x = 0, y = 0, z = 0},
            maxpos = {x = 0, y = 0, z = 0},
            minvel = {x = 0, y = 0, z = 0},
            maxvel = {x = 0, y = 0, z = 0},
            minacc = {x = 0, y = 0, z = 0},
            maxacc = {x = 0, y = 0, z = 0},
            minexptime = 1,
            maxexptime = 2,
            minsize = 1,
            maxsize = 2,
            collisiondetection = false,
            vertical = false,
            texture = "your_particle_texture.png",
            glow = 10,
            kind = "line",
            origin = self.object:get_pos(),
            angle = {x = 0, y = 1, z = 0},
        })
    end,
})
Explications :
kind = "line" : Cela indique que les particules seront attirées par une ligne.
origin : Le point de départ de la ligne.
angle : La direction de la ligne.
Pour des exemples détaillés, tu peux consulter osTicket sur GitHub, qui montre comment configurer et utiliser les particules.

J'espère que cela t'aide !

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests