Dynamically placed dialog box

  • #1, by htw8849Tuesday, 22. March 2016, 13:53 9 years ago
    Hi,

    is there a way to dynamically place the dialog box via LUA ?

    Background: usually my dialog box is on the top of the screen, but depending on which character you talk with
    I sometime would like to have the dialog box on the bottom of the sceen.

    Newbie

    41 Posts


  • #2, by afrlmeTuesday, 22. March 2016, 14:13 9 years ago
    You are talking about dialog boxes in which the player has to select an option from? There's actually an option somewhere on the dialog box setup page itself which allows you to offset the dialog box.

    As for Lua... I'm assuming it would be the VCharacterDialogArea field, but according to the wiki it is unscriptable - which doesn't necessarily mean that it isn't, but you know. Anyway, it says it's a rect field, so that means it needs you to input x & y coordinates & specify a width & height.
    game.CurrentCharacter.DialogArea = { x = 0, y = 880, width = 1920, height = 200} -- maybe? I've not tried scripting this field before...
    

    Imperator

    7285 Posts

  • #3, by htw8849Tuesday, 22. March 2016, 14:52 9 years ago
    Thanx for you quick answer.

    Yes I mean the dialog box that opens up when you talk to a NPC.

    But I couldn't yet find any "offset"-option at the editors dialog setup page. My current editor version is 4.2.

    I also tried you example, but unfortunately it "only" moved the
    area with the selectable sentences to 0,0 fullscreen - regardless what I put there, it won't move further
    down or right roll

    Another problem is that background graphics for the dialog box isn't affected by that command at all roll
    Is there a way to touch the dialog box background graphics via LUA ?

    Newbie

    41 Posts

  • #4, by afrlmeTuesday, 22. March 2016, 15:17 9 years ago
    Not that I know of, but... but... since the most recent update of Visionaire Studio we are now supposed to be able to draw graphics directly with Lua script itself using some new functions that the dev team added. Don't ask me how as I've not tried using them yet. There are some examples on the second page of the thread about the last release of VS I think.

    Yeah second post found here @ http://www.visionaire-studio.net/forum/thread/visionaire-stu...

    Imperator

    7285 Posts

  • #5, by htw8849Tuesday, 22. March 2016, 15:28 9 years ago
    Ok thanks, I will have a look into it smile

    So only that dialog rectangle of your example not positioned right (0,0 instead of the given x,y values) blocks the way to success ... roll

    Newbie

    41 Posts

  • #6, by htw8849Tuesday, 22. March 2016, 15:46 9 years ago
    Ok, solved that as well - it was a typo ... now it works fine - as you put in your example grin

    With the drawing graphics that's fine - but the question is then how to move that and the arrows (for scrolling the lines up and down) around ?

    In the Wiki there is

    CharacterDialogSprite
    CharacterDialogInactiveScrollUp
    CharacterDialogInactiveScrollDown

    They are defined as "t_sprite".

    If I want to rewrite that - what parameters are expected for t_sprite ?

    Is there some information in the Wiki how these "definition types" like t_sprite, t_rect, t_point are defined exactly ?

    Newbie

    41 Posts

  • #7, by afrlmeTuesday, 22. March 2016, 16:23 9 years ago
    A lot of the dialog stuff in unscriptable. The dialog box example should have also moved the positions of the arrows too as far as I know, but again... that field is also listed as unscriptable, whether it is unscriptable because it's unscriptable or because the updated value doesn't get included in save files, I don't know.

    Imperator

    7285 Posts

  • #8, by htw8849Tuesday, 22. March 2016, 16:37 9 years ago
    Hmm, ok. But your nice example showed that the dialog area is accessible via LUA despite the information in the wiki.

    So that CharacterDialogSprite (the background sprite of the dialog) should in theory be also accessible via LUA.

    But it is having this special "t_sprite" value which I have no idea about what input field t_sprite do expect roll

    local sprite=game.CurrentCharacter.CharacterDialogSprite
    
    print(MySprite: sprite)
    



    It gives me:

    MySprite: Sprite: path interface/talkbox_16to9/talkbox.p n g, width 0, height 0, pos (0,0)


    So how to access for example the y-value of pos(0,0) then ?

    Newbie

    41 Posts

  • #9, by afrlmeTuesday, 22. March 2016, 17:40 9 years ago
    Sprite filed is just the path to the image file. A sprite being said image.

    Quick question: is it possible to change the active dialog box associated with your main character? If you can change that, then you could probably simply toggle between whichever one you need to be displayed. Ideally though it's best if you only use the one fixed position & dialog box design. That said, you could always create a custom dialog system like Daedalic have done for various games (reason? because the built-in dialog system is shitty & very limited - well for me it is anyway).

    Imperator

    7285 Posts

  • #10, by htw8849Tuesday, 22. March 2016, 23:27 9 years ago
    Quick question: is it possible to change the active dialog box associated with your main character?


    Honestly I have no idea how to reach that ... so far I only used the built in system -> so my main character just has only this one active dialog box designed in the editor

    Newbie

    41 Posts

  • #11, by afrlmeTuesday, 22. March 2016, 23:48 9 years ago
    Just checked. Doesn't look like it. You could create some duplicated copies of your main character which contain only the idle animations & talk animations. Change active character to whichever you need before calling a dialog & then change back to your default character when done. I'm sure there's probably other methods you could use too...

    Imperator

    7285 Posts