Display speaker text and pause with LUA

  • #1, by cr34m3Wednesday, 05. March 2014, 12:01 11 years ago
    This may sound like a silly question, but how do you display speaker text (as per the action parts menus) with a LUA script? I've seen many threads on hooks for allignment and placement of this text, but (unfortunately for me) nothing as basic as just displaying the text and pausing for a bit. The wiki covers Displayed Text but only for the action parts interface.

    The idea is to pass text strings (and other parameters) to a function which will then do funny things with the text (e.g. scramble it or replace letters or slowly display sections).

    Apologies if this has been covered before, but my searching of the forums have not had any results. smile

    Newbie

    72 Posts


  • #2, by AlexWednesday, 05. March 2014, 12:38 11 years ago
    That is not possible. Reason being that the displayed text is not a simple string but taken from the data structure. A text contains text language entries, i.e. translations of a text for each language of the game.

    What you could do is display a value in your text, e.g.
    "<vs=text_bla>"

    in your script you can set the string value which will be displayed in the text,e.g.
    getObject("Values[text_bla]"):setValue(VValueString, 'scrambled text...')
    

    If your game is multilingual you have to take care of this yourself by testing the current language and setting the value accordingly.

    Great Poster

    378 Posts

  • #3, by cr34m3Wednesday, 05. March 2014, 13:06 11 years ago
    Thanks Alex, I'll give the solution you proposed a try.

    Slowly but surely I'm discovering what I can and cannot do with Visionaire, and how to get around it.

    Newbie

    72 Posts

  • #4, by afrlmeWednesday, 05. March 2014, 15:12 11 years ago
    As Alex said: it's not possible to display text with Lua. However if you want to achieve some of the things you mentioned - & don't mind going out of your way, a wee bit - then instead of using displayed text, you could instead create your texts as images/animations & add them to objects/buttons in a scene/interface & then control what is displayed, how & when, with in editor action parts & Lua. In this way you could create typewriter effect for your texts, color coded key text etc... the possibilities are endless.

    Imperator

    7278 Posts

  • #5, by cr34m3Wednesday, 05. March 2014, 16:11 11 years ago
    Thanks for the suggestion AFRLme. I am however trying to avoid predetermined things like animations and trying to procedurally generate results. Not only will this save me time, but it will allow me to reuse and repurpose code.

    I will keep on trying to find ways around this and keep on picking the brains of the forum members when I get stuck. smile

    Newbie

    72 Posts

  • #6, by afrlmeWednesday, 05. March 2014, 16:37 11 years ago
    Ok dokie, no worries smile

    Maybe Alex or Simon will upgrade the display text system, in a future release? I too would like to see some new ways of displaying text. Character transitions, sounds per character, fade in/out, speech bubbles & multi colored key text options, etc...

    Imperator

    7278 Posts