1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Text Particles - Spawn for players without overlapping other particles.

Discussion in 'Development' started by BouncyJeffer, May 11, 2017.

  1. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    Hello, I'm trying to create a simple text particle system that'll save the particle in the server. As of now, whenever a player joins, the text is added. Then, once another player joins, the old particle is overlapped, giving more black background. Is there a way to only have one text particle for everyone?
     
  2. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    I didn't make it clear in the post but I do know I'll need to use a Config.
     
  3. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Yes, you can save the instance.
    What I'd also recommend you to do is take a look at the second parameter of Level::addParticle(), if that's what you're using.
    You can make it send the text to just one player instead of all players on the server.
     
  4. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    If you're using the FloatingTextParticle class provided by PocketMine I actually think using a config won't even work.
    (Except if you're serializing, but why would you?)
     
  5. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    Oh wow, I forgot to check. Thanks! I will try this when I get on my PC.
     
  6. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    For my design, yes it'll be needed.
     
  7. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Then I'm sorry, perhaps I didn't understand.
     
    BouncyJeffer likes this.
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    What exactly are you trying to do? Are you attempting to display each player's username to only that player in the particle?
     
  9. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    Yes, that's one of my goals.
     
  10. BouncyJeffer

    BouncyJeffer Spider Jockey

    Messages:
    39
    GitHub:
    bouncyjeffer
    I think I got this handled now though.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.