Manipulating Character Dialogue Animations question.

  • #1, by DilatedTuesday, 22. September 2015, 10:36 9 years ago
    TL;DR I need to figure out how to quit an action when a character stops talking, without doing it individually on every single dialogue answer (For obvious time saving reasons)

    LONGER EXPLANATION

    Basically the way character dialogue works, it's a cinematic close up. Everytime the character you're interacting with speaks, it plays an animation that covers the whole screen (1920x1080). However this was a temporary fix, and getting close to finishing my game, I can see size wise, it gets ridiculous with so many 1920x1080 frames.

    My idea so far is to create a single blank frame for the characters talking animation that triggers an action, which activates all the separate elements, rather than just one solid animation. However the issue is quitting this action when the character stops speaking, I can do it manually for each one, but it would be extremely tedious to re-do it.

    Does anyone have any ideas? Obviously the engine triggers the dialog options after the opposing character stops speaking, is there a way I can add "quit action" onto that command.

    Thanks in advance grin

    Forum Fan

    149 Posts


  • #2, by afrlmeTuesday, 22. September 2015, 11:41 9 years ago
    Can't you use the registerEventHandler with the textStarted & textStopped flags with some if queries inside of their functions to globally control the actions / interface (whatever) belonging to the character who is speaking?

    Imperator

    7278 Posts

  • #3, by DilatedTuesday, 22. September 2015, 12:12 9 years ago
    I haven't actually used a registerEventHandler, currently looking on the wiki now to wrap my head around it.

    Would I have to make a separate event handler for each character since they all would all have their own unique function?

    Ideal scenario would be that after a specific character has stopped talking through all its dialogues it would quit the action.

    Display text by character Doug (blank animation triggers unique action)
    Display text by character Doug
    Display text by character Doug
    Display text by character Doug

    Lua script quits the action.

    Display text by character Paradigm
    Display text by character Paradigm

    Display text by character Doug (blank animation triggers unique action)
    Display text by character Doug
    Lua script quits the action.

    ETC ETC.

    Although this looks like it would get pretty complicated?

    Forum Fan

    149 Posts

  • #4, by afrlmeTuesday, 22. September 2015, 12:50 9 years ago
    If you created all the same type of actions for each character with the same name, such as: default, angry, confused, sad, gesture x, etc then you would be able to control them more globally from a single script I think.

    With the event handler or hook function for text based events you can return the owner of the text, which means you will easily be able to access actions of the currently talking character.

    & yes, based on what you have written, it does sound a little complicated, but only because I don't fully understand how you want your talk system to work.

    Imperator

    7278 Posts

  • #5, by DilatedTuesday, 22. September 2015, 13:51 9 years ago
    Alrighty! Looks like I'm pretty out of my league here haha.

    But basically there is no different emotions or anything, just each character would have its own, single unique action.

    Like I wrote before currently the system is it just triggers an animation which is 1920x1080, covering the screen, however its resource hungry. So my idea was to instead trigger an action with the separate elements.

    So it turns on condition for background, then plays an animation on top of that. For example just the lips moving. This way I only have to export lips moving, instead of exporting FULL 1920x1080 frames. Thus saving huge amounts of space. (there are like 18 characters with 4-10 frames each at 1920x1080)

    I can trigger the action via a blank frame when the character begins to talk, HOWEVER the PROBLEM is that I can't turn it off after the character is finished talking, unless I add individually to EVERY dialogue part the exit action.

    Forum Fan

    149 Posts

  • #6, by afrlmeTuesday, 22. September 2015, 14:27 9 years ago
    Ah ok. So...

    1. create an interface.

    2. create a button per character with image set as character. & add 2 animations to the object. Create an animation for the character & add the talk animation to it. Make sure you include part of face in the image so that it covers over the top of the default animation correctly. Do not assign the animation to the properties tab of the button. Set animation to play infinitely.

    3. Using the registerEventHandler & the textStarted & textStopped flags you could determine which person to display by toggling their active / inactive images on & off based on the text owner & also trigger the animation in the button simply named "talk" to start playing when text starts & stop when text stops.

    4. As for the background close-up... may I recommend zooming into the scene & adding a touch of blur using the openGL shaders? Much less hassle than creating millions of backgrounds. Your large character image will probably hide the regular characters on the screen anyway.

    5. Next you should create some actions for sorting out the transition between close-up & regular view. 2 called by other actions should suffice which you call just before you start a dialog conversation & again when you want to end a dialog conversation.

    Make sense at all? I know how I would go about it, but it's a little hard to explain with a few words alone.

    Quick tip: global functions are all down to naming convention. You need to think about how you can use something else to access something else globally. So think like this... You want to access a button based on a characters name, so you name the button exactly the same as the character or at least you add the characters name to it somewhere, so that when you return the characters name along with whatever prefix you added it can access said button.

    Imperator

    7278 Posts

  • #7, by DilatedTuesday, 22. September 2015, 15:21 9 years ago
    Interesting approach with the interface. I'll need to mull it over more.

    What I've actually done is create a separate scene for each character dialogue. So when you 'talk to' it sends paradigm to a new scene, and changes the outfit to a close up view. And calls an action with various other changes.

    The backgrounds with the shader is a good idea, if I knew about it earlier, I probably would of done it haha. ALTHOUGH few scenes I made unique backgrounds for specific purposes, so it wouldn't work for everything. Besides they're all set and ready anyway. Probably would only save like 10-20mb overall

    Really all I need the event handler to do is "quit action" on textStopped for the current NPC that is talking.

    Do you have any examples of register handlers working with textStopped I can look at?

    Forum Fan

    149 Posts

  • #8, by afrlmeTuesday, 22. September 2015, 15:44 9 years ago
    Could you send me a video or some screenshots of how you have currently set it up please? Send via pm or email or skype. Or could even use Team Viewer program so I can see your desktop screen via remote access.

    local owner
    
    function txtStart(text)
     -- some actions
    end
    
    function txtStop(text)
     if not text.TextOwner:isEmpty() then
      stopAction("ActiveActions[action_name]")
     end
    end
    
    registerEventHandler("textStarted", "txtStart")
    registerEventHandler("textStopped", "txtStop")
    

    Imperator

    7278 Posts