STAR TREK 2d20
  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253

    Progress information - slow function

    I've a slow function. This function creates a large amount of data for my system during character creation.
    I would like to show something to the user. I had thought of a field with a description of the progress (textual),
    but it only updates at the end, so it's not needed.

    Do you have suggestions?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Is your code running in an onInit function? If so, this function is generally called before windows (and contained) controls are displayed, for example: https://fantasygroundsunity.atlassia...nstance#onInit

    So, if you want to display something to the user during an onInit function, then you may want to display another window showing progress, or perform the code outside of an onInit function.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    No, it is not always called during onInit. What I assume is that when the process starts, no updates come to the presentation,
    so the effects are only seen at the end. I believe that even if I opened a window, perhaps to be removed at the end, all the
    effects would be made visible at the end (i.e. I believe that the window would not be seen at all).

    What I would need is a command that "show output now", i.e. redraws it without waiting for the current process to finish.
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    I think we'll need a comment from one of the FG devs on this.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Due to the fact that the Lua scripts can modify anything in the UI or database and need to be processed sequentially with network and other updates, the Lua runs in a single threaded manner with the UI/database. So, there will be no screen updates nor user inputs during a long-running process.

    In general, I highly recommend rethinking/redesigning any processes which run so long that you would need to do this.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in