Solved Particle wall and curved particle trails

Discussion in 'Plugin Development' started by Ward1246, Jun 30, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Ward1246

    Hello. I am trying to do 2 (3 with spoiler) similar things, so I merged them into 1 thread. The first thing I am trying to do is create a curved particle line based on the players direction, these curves start and stop at certain locations, and go in certain directions. There will be 3 curves total; each about 1/2 of a circle or less, and about the players size. The first starts from down to upwards, the second from left to right, and the last from up to downwards. I would like to be able to tinker with the size and how much these curves curve. I state where they start and stop, because I would like to have the particles not created all at once, but having the next one delayed slightly (meant to look like sweeps of a sword, I would use sweep attack particles but I can't change their direction nor rotation, and it would look wrong for other players.).

    The second thing I would like to accomplish is a particle wall also based on the players direction, and this wall should curve towards the player, mostly at the top, and it also curves slightly along its length, mostly on the edges (since the particles go up, I may just find some way to use possibly cloud particles and only do the bottom part.). I would like to make this wall not follow the player, instead for it to stay where it was created, I may use an item entity for its location so it can drift forward slowly. The wall should be 5 blocks wide by 3 blocks tall. Lastly, I need this wall to block projectiles. I would also like to be able to adjust the sizes and curves again.

    Third issue (open)
    This isn't as important as the other 2 issues, so I figured I would put it in a spoiler. I would like to have a particle circle that "burns away", the only way I can think to describe this is imagine gunpowder in a circle, and then set a small space of it on fire, with the fire only going in 1 direction. The fire would go all the way around the circle until the circle is completely gone. I would like to implement that with particles. If this confuses you, I am sorry, you can just ignore this.


    I tried to be as specific as possible to help create a better idea of what I am trying to do, as I know this will use lot of math and that isn't my strongest area. I do not know if all of this can be done also, so if needed I can forget about some features. I do not need code created for me, it would likely best that I learn these things, however any example code or references relating could be helpful.

    EDIT: Unfortunately I was unable to be on for a few days, but I was able to get some code that did most of what I needed in the meantime. As such, I got the solutions I needed. Thank you Zombie Striker for the helpful leads! (Didn't want to create a second post, as this thread is getting old, and is now solved.)
     
    Last edited: Jul 2, 2017
  2. Offline

    Zombie_Striker

    @Ward1246
    First question: have you taken a trigonometry class yet? You will need to know it in order to understand how to write these curves.

    I'm going to assume you know how to set up the particle packets. If not, there are many utils (for pre -1.12) or use the World#spawnParticle (1.12+)

    1. For this, using trig, create a parabola that intersects at the two points you want. Then, using the particle offset parameters, add small increments to the X/Z.
    2. For this, just find the parameter of a circle of a certain radius, and spawn as many particles as you want on top of each other.
    3. Using this tutorial, you can flatten the helix so that it just a ring.
     
Thread Status:
Not open for further replies.

Share This Page