Textboxes / conversation

  • #1, by CamouflageTuesday, 07. July 2015, 12:16 5 years ago
    Hi, can someone tell me step by step how i get a conversation running in my game, or link me a tutorial where its shown? I have two character images and i want that a textfield/textbox is displayed when person a talks to person b, afterwards another textbox when person b answers. i got the font from the demo game, but i dont know how to create this above mentioned setup. i would really appreciate it if someone could help me out. smile

    Newbie

    15 Posts


  • #2, by afrlmeTuesday, 07. July 2015, 13:01 5 years ago
    Are you talking about different boxes for each character or the same bounding box?

    The general idea of dialog conversations (with current dialog system) is that you create the dialog background box in the main (playable) characters dialog area tab. Don't forget to set which fonts should be used for the dialog interface in your characters properties tab.

    As for the dialog conversations themselves: you need to create these inside of the dialog tab of the intended NPC characters you wish to converse with (yes, the current system seems strange, illogical & antiquated the me too).

    After you've done that, you should be able to start a conversation with an NPC character by using the start dialog/dialog-layer action part & linking it the the NPC you want to converse with.

    Imperator

    6842 Posts

  • #3, by CamouflageTuesday, 07. July 2015, 14:55 5 years ago
    thanks, now i can display the text in a textbox, but afterwards its shown again, above the character and the answer to the dialog part too... do you know how to fix that? yes, it would be nice if i could have one text box for each character..

    Newbie

    15 Posts

  • #4, by afrlmeTuesday, 07. July 2015, 16:35 5 years ago
    Ah you meant a box for displaying all text in? You need to use the textPosition Lua hook function for manually positioning text.

    This is what I am using in the game I am currently working on. It positions the text in the center of the screen, 34 pixels from the bottom of the screen. The script handles both character & narration text. It is however possible to add another if query to determine whether or not it should only handle character or narration text.
    local offset = 34 -- offset from bottom (in pixels)
    local x = (game.WindowResolution.x / 2) -- calculate center value of resolution width
    local y = (game.WindowResolution.y - offset) -- calculate offset of text from bottom

    -- * function which updates the text position of displayed texts (character & narration) * --
    function txtPos(text)
    if not game.CurrentScene.SceneIsMenu then -- if scene is not a menu then...
    text:setValue(VTextPosition, {x = game.ScrollPosition.x + x, y = game.ScrollPosition.y + y}) -- define the new text position
    return true -- update text position
    end
    return false -- else don't update text position
    end

    registerHookFunction("setTextPosition", "txtPos") -- define the hook function for handling text position
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    Imperator

    6842 Posts

  • #5, by CamouflageSaturday, 11. July 2015, 18:42 5 years ago
    thanks for the script. Its nice for narration text, but realized i have to work with dialogs / dialog areas. I want a conversation, where i can select questions and get different answers. i dont know at all how its possible to create this kind of things.. really frustrating, that there aren't easiely understandable tutorials for beginners ....

    Newbie

    15 Posts

  • #6, by CamouflageSunday, 12. July 2015, 17:29 5 years ago
    Got a dialog running now, but if i select a question, the question is displayed again before the question shows up... in my game, there is no real char, so i just want to select questions and afterwards get the answer, without displaying the question again first... anyone know how to fix that?

    Newbie

    15 Posts

  • #7, by sebastianSunday, 12. July 2015, 18:20 5 years ago
    maybe try to tick the "alternative text for dialog part" and just fill in nothing or a short pause <p1>

    Thread Captain

    2337 Posts

  • #8, by CamouflageMonday, 13. July 2015, 18:28 5 years ago
    THANK YOU!

    Newbie

    15 Posts

Write post