Text display pre-processor?

  • #1, by daniel-lowesTuesday, 25. February 2020, 08:04 A year ago
    Hi guys! I have  question that I hope someone can help me with.

    I am trying to make it possible for my players to choose whether they want text to auto-advance or not. From reading the docs, it appears the only mechanism that currently exists is the <p> tag in the text itself. However, adding that will make it pause for everyone, of course.

    So I was wondering if there isn't a Lua function that currently runs just before text is rendered, to allow you to modify it. That way, I could check the value of the option and append a <p> at the end if it is enabled.

    Does something like this exist in the engine?


    6 Posts

  • #2, by afrlmeTuesday, 25. February 2020, 11:48 A year ago
    I'm sure I wrote something a little while back for someone else that did something like this, but it was to do with waiting until the audio finished playing for auto-skip or if a particular option was enabled then it would require the player to click to skip/progress the displayed texts.

    Do you plan on adding audio (voice over) files to your texts?

    Anyway, this was the small function I wrote for the other person.

    -- * on text display function * --
    function sText(text)

    if Conditions["manual_text"].Value and text.Owner:getId().tableId == eCharacters then
    text.TimeToWait = -1
    text.WaitForAudio = false


    registerEventHandler("textStarted", "sText") -- event handler for begin text

    It needs to be added to the script section of the editor as a definition type script. You also need to create a condition somewhere & call it manual_text, which you should set as true whenever you want the player to manually skip/progress the displayed texts.

    The function above is an event listener. It listens out for when texts are displayed & when a text is displayed it checks if the text belongs to a character & whether or not the condition manual_text is set to true. If it's true then it will set the TimeToWait data strucute entry for the current text to -1 which means that the engine requires the player to skip the text manually.


    6981 Posts

  • #3, by daniel-lowesTuesday, 25. February 2020, 12:16 A year ago
    Ah I see, I did not know about that event. That should work very well smile

    And yes, there will be audio.

    Thank you!


    6 Posts

  • #4, by afrlmeTuesday, 25. February 2020, 12:20 A year ago
    No problem, have fun. smile


    6981 Posts

Write post