How to determine when all the text has been drawn?

Discussion in 'RPG Maker MV' started by Rhino, Apr 23, 2017.

  1. Rhino

    Rhino ~Inactive~ Veteran

    Messages:
    482
    Likes Received:
    783
    First Language:
    English
    Primarily Uses:
    RMMV
    When using a show text command, the letters appear one by one in the dialogue box. I'd like to know if there's a way to know when the full message has been displayed.

    Basically, I'm trying to create an animated talking mouth. I don't want the animation to continue until the next show text event, so I was hoping there's some kind of script that I could use in a conditional branch. If text is still being drawn= show talking animation else= show closed mouth.

    There are some plugins such as text sounds that stop once all the text is finished, so I assume it's possible somehow.
     
    #1
  2. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    458
    Likes Received:
    715
    First Language:
    English
    Primarily Uses:
    RMMV
    I would think it depends on how long your animation is. The only thing I could suggest is using variables to time your animation time and when you animation time is over to stop the picture. If that makes any sense.

    So basically a variable called timer and timing each of your events separately?

    I'm not really sure either, I'm just throwing ideas others have shared with me before. Sorry I couldn't be of more help.

    Edit: I'll try to be more specific in what I was saying. Maybe make a variable timer that goes with your message display and find out what "time" the variable stops on when the message finishes. And then conditional branch that number for when if equals, stop the picture playing.
     
    #2
    Rhino likes this.
  3. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    903
    Likes Received:
    717
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Those text sound effect scripts actually activate when each letter is being shown, and have no idea when the message ends, only that there aren't any letters anymore (the whole thing is wrapped in a quasi for-loop)

    The whole bit of code that handles message processing is embedded pretty deep into the system, so it's pretty much impossible for there to be a vanilla way to check if all text has been shown. If you know some coding, you can check out Window_Message and Game_Message in rpg_windows.js and rpg_objects.js.
     
    #3
    Rhino likes this.
  4. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    978
    Location:
    Buckie, Scotland
    First Language:
    English
    SceneManager._scene._messageWindow.isEndOfText();
     
    #4
    SwiftSign likes this.
  5. Rhino

    Rhino ~Inactive~ Veteran

    Messages:
    482
    Likes Received:
    783
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you all for your advice :kaojoy:
    The animation is basically a mouth flap. I just wanted a more dynamic way to show who is speaking, plus I think it adds visual interest. It sounds like your method would involve timing out each message window? Which isn't really an option I want to go for XD But using timers is a pretty cool idea, so I think I might use that for other animations :D Thanks!

    Thanks for clearing that up! I don't know any coding, so I'm going to try and see if any of my clever friends can help... If we come up with a solution, I'll be sure to post it up! I know that there were a few unanswered plugin requests hoping for animated bust type things as well.

    That really didn't want to work with any of my plugins, so I tried it on a new project, but it's conflicting with rpg managers.js anyway..
     
    #5
  6. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    978
    Location:
    Buckie, Scotland
    First Language:
    English
    It shouldn't be conflicting with rpg_managers.js, it's *part* of rpg_managers.js. What's happening when you try to use it?
     
    #6
  7. Rhino

    Rhino ~Inactive~ Veteran

    Messages:
    482
    Likes Received:
    783
    First Language:
    English
    Primarily Uses:
    RMMV
    This is what I'm getting
    Untitled.png
     
    #7

Share This Page