Dialogs, those damned dialogs [solved]

  • #1, z MateuszWednesday, 14. September 2016, 21:14 hodinky 8 years ago
    First post so hello everyone.

    I'm working over my first game. I'm trying to avoid scripting (except for "Object.Scale" - if you dare to call it a script) and was pretty much able to achieve everything (functionality wise) that I wanted.

    Except for god forsaken dialog.

    I have a character. I defined dialog area for him. I remembered to assign fonts and so on. But when I start a dialog, there is only a teeth grinding:
    1/ "Choices"/"Questions" (stuff that is selectable) displays as I want - always within a dialog area (perfect! hurray!)
    2/ Answers appear in upper left corner of the screen. Or in the middle of the screen. Or somewhere else. Pretty much wherever they want but not in the damn dialog area, where I want them.

    What am I missing?

    For those of you who have played alphademo of "Dark inside me" - this is a dialog look I want to achieve (dialog text of both protagonist and conversation partner in the same, fixed place.

    I'm using v 4.2.5
    My game has a "first person" perspective (blank main character) - probably not relevant but the only thing I can think of that may be "messing" with positions of text?
    Action text is drawn at cursor - again, probably not relevant.
    Scenes are exactly in the same size as game resolution (no screen scrolling).
    I've tried both to define dialog area only for main character (according to glenfx tutorials that should be enough - on the other hand, those are intended for vis 3.0 so maybe something changed?) and for all the npcs (same parameters as main character). In both cases only questions were positioned properly.

    Help. Please.

    Bažant

    59 Posts


  • #2, z afrlmeWednesday, 14. September 2016, 21:55 hodinky 8 years ago
    I'm going to assume that you are dragging the transparent character you are using as your active character into each scene with you. If that's the case then whenever you left click somewhere on the screen the character, even though it's transparent is still going to try to go to said click destination. By default dialogs will trigger regular display texts which are traditionally spoken above the characters animation.

    I am going to assume you aren't forcing the position of text either, so you will be needing to do a bit of scripting (sorry).
    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 text:getLink(VTextOwner):getName() == "hero" 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
    

    ... this displays the text in the center of the screen, 34 pixels from the bottom. You should update the offset value & characters name accordingly. Remember that character names are case sensitive.

    P.S: you can force text position for all texts if you want by removing the if text:getLink() line & end from after return true.

    P.P.S: this should be added to the script section of the editor.

    Imperátor

    7285 Posts

  • #3, z sebastianWednesday, 14. September 2016, 21:57 hodinky 8 years ago
    The thing is that answers or any text from a character is displayed above the speaking character. So by default it is normal that the answers appear on different places depending on where the main (your invisible) character is standing.

    To force the characters text position to a defined position you have to use some lua.
    Define the following script as a definition script in the script section of your game:

    local offset = 100 -- offset from bottom (in pixels)
    
    function txtPos(text)
     if text:getLink(VTextOwner):getId().tableId == eCharacters then
      text:setValue(VTextPositon, { x = (game.WindowResolution.x / 2), y = (game.WindowResolution.y - offset) })
      return true
     end
     return false
    end
    
    registerHookFunction("setTextPositon", "txtPos")
    

    (script from the all mighty AFRLme)

    It basically checks at runtime if a character is starting a text and repositions its text centered (x) and 100 px from the bottom (y).

    EDIT: LEE!!! XD (man im too slow)

    Kapitán

    2346 Posts

  • #4, z MateuszThursday, 15. September 2016, 15:06 hodinky 8 years ago
    It works!!! --> that's the good news. Thank you so much, guys.
    The bad news is, that it turns out that dialog system in general seems to suck some major... you know roll

    I'm using variation of this http://www.visionaire-studio.net/forum/thread/a-special-kind...

    (interface with portraits as buttons, interface background image serving as text underlay, display narration text when character "comments"/investigating" something) and it seems that in the end inbuilt dialog system will be a little too limiting (I'm gonna know today, as I'm intensively testing it today) when compared to what I can achieve with values and narration text .

    Anyway - except for not that flexible dialog system, botched particle system and constant crashes when manipulating gfx (I'm one of those lucky Nvidia cards owners with generous "unhandled exceptions" from Vis), Vis is a marvelous piece of software. It's not an irony - this is first game engine I was actually able to get a grasp on and I really believe I'll be able to put whole game with. It's easy to use and intuitive so many thanks to everyone involved in it's development.

    Bažant

    59 Posts

  • #5, z sebastianThursday, 15. September 2016, 16:36 hodinky 8 years ago
    hope the next 4.3 uodate will get rid of your graphic card issues / crashing =)
    you are also able to make an own dialogsystem by using values and lua script i guess...

    what do you want to achieve with the dialog system?

    Kapitán

    2346 Posts

  • #6, z afrlmeThursday, 15. September 2016, 16:47 hodinky 8 years ago
    Aye, next version should be a lot more stable as it will no longer have the offending wxWidgets framework that is the bane of most peoples lives when it comes to using Visionaire Studio.

    I 101% agree that the dialog system is about as antiquated as the Dinosaurs! I myself can't stand it either. Custom is the best way to go if you want to create something a lot more dynamic. It's what I would do & it's what Daedalic Entertainment do for the majority of their games - can't say for sure for earlier games, but at least from Deponia onwards, they seem to have created custom dialog systems.

    As for the development, there's 3 developers (Alex, BigStans & SimonS), but only Simon is currently actively developing the engine at the minute - single-handedly, because he's a bloody Wizard! grin

    Imperátor

    7285 Posts

  • #7, z sebastianThursday, 15. September 2016, 18:06 hodinky 8 years ago
    i would love to script also an own dialog system, but its kind of heavy for me... I would guess that the own dialogsystems from deadalic work with object texts and the clickable area of the text is a dynamical changed object polygon.. . something like of that.


    for me also scrolling through the options (up/down arrow) should be possible, so ithe script should have a table with all texs from the current shown dialog inside vut only displays e. g. point 1-4,2-5,etc...

    Kapitán

    2346 Posts

  • #8, z afrlmeThursday, 15. September 2016, 18:18 hodinky 8 years ago
    Yeah object texts sounds about right with condition based object polygons. I guess the difficulty of creating a custom interface system would depend on how complex you decide to make it (shape, static or animated avatar images for characters, multi-choice dialog trees, etc.).

    I believe the best practice when it comes to dialog choices is to limit them to 4 at a time. Just think about how dialog options in telltale games walking dead works. Up to 4 choices at any given time, but then again, their games are constantly evolving based on players choice, so there's no need to allow the player to go back & choose another option. Now, you could add scrollable options too with a Lua table & then rotating the order of the table entries.

    Imperátor

    7285 Posts

  • #9, z sebastianThursday, 15. September 2016, 18:36 hodinky 8 years ago
    depends a bit if the game is very narration based or more simple in its use of choices... But this should be another topic :p

    Kapitán

    2346 Posts

  • #10, z MateuszSaturday, 17. September 2016, 17:09 hodinky 8 years ago
    I sorted out my problem with dialog, following ARFLme's advice to someone else on this forums ("just use basic logic").

    In my game dialog consist of "conversation topics" that you pick. They are displayed as cryptic "one word" topics - for example "Europe", "Car" and so on.

    When player picks a topic, playable character elaborate and starts discussion. For example picking "Europe" will lead to character saying "That trip to Europe sure was an exciting way of spending our honeymoon, right hon?" This is then answered back by conversation partner.

    In-build system turned out to be a little to limiting. For example, setting questions as "one word" topics lead not to elaboration, but main character saying "Europe". So unless I'm missing something, it's of no use to me.

    I was however able to achieve what I wanted with interfaces and buttons. It's not pretty, a little bit convoluted but hey, it works, so I'm happy.

    Now, when I'm aware of limitations of dialog system, next time I'll be designing conversations I will do it "according to Visionaire logic".

    Next question, as I'm experiencing another problem. I want my cursor to change when hovering over item in interface (I'm using single click interface from here https://wiki.visionaire-tracker.net/wiki/Single_Click_Interface). I've tried to sort it with adding "when cursor enters/leaves area" to item placeholder areas of interface but it works only partially. When there is an item in a slot, cursor changes in way I want. However, when hovering over empty slot, cursors disappears completely. Any hints how to solve it?

    Bažant

    59 Posts

  • #11, z sebastianSaturday, 17. September 2016, 17:57 hodinky 8 years ago
    You are able to display/say another text than what is standing in your dialogpart choice:

    https://cl.ly/451I3Y0a3h33/Image%202016-09-17%20at%205.56.10%20PM.png
    (check "alternative text for dialog part" above the third text box)

    @second problem:
    im not quite sure if i understand it correctly, but you are able to change you cursor with an action part

    Kapitán

    2346 Posts