Modding Help Let the player say something

Discussion in 'Starbound Modding' started by Rexaton, Jul 22, 2019.

  1. Rexaton

    Rexaton Void-Bound Voyager

    What I want to achieve:
    I want the player to say something. The trigger is the "Take all" button of a chest. In the callback of the button there is a situation when I want to show a chat text bubble above my character saying "My inventory is full!" or something similar.

    Technically:
    I know that I cannot simply call "player.sayPortrait" because the "say" or "sayPortrait" is for NPCs only. In another thread (https://community.playstarbound.com...-text-bubble-on-player-with-lua-magic.104597/) the solution is to use "world.spawnProjectile" for showing text, but it doesn't look like a chat bubble: I'm missing a background color and border around the text for better visibility.

    Can someone please guide me to the right direction? I'm willing to learn but at the moment I don't have any idea how to proceed.

    Thank you!
     
    Last edited: Jul 23, 2019
  2. Rexaton

    Rexaton Void-Bound Voyager

    ... or is it possible to make a projectile following the player? Currently it is fixed at the position where the player was at the moment of the call:

    Code:
    world.spawnProjectile(
        "invisibleprojectile",
        world.entityPosition(pane.playerEntityId()),
        pane.playerEntityId(),
        {0,0},
        true,
        {
            damageType = "NoDamage",
            actionOnReap = {
                action = "particle",
                specification = {
                    text = "Big red words!",
                    size = 1,
                    color = {255, 0, 0, 255},
                    destructionAction = "fade",
                    timeToLive = 5,
                    destructionTime = 0.0,
                    layer = "front",
                    position = {0,5},
                    initialVelocity = {0,0},
                    finalVelocity = {0,0},
                    type = "text"
                }
            }
        }
    )
    
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    I do remember sometime back there was a method for adding a dialog box - but I can't remember now what the implementation. Though I am sure it wasn't through particles.
     

Share This Page