A special kind of Inventory/Dialogue Box (or not?)

  • #10, by JoelWednesday, 11. November 2015, 21:41 5 years ago
    That's a good idea smile I made two animations so far with her "flirting" to the player or just blinking. The only problem i'm encountering is, that sometimes it starts the animation inbetween two text lines, since i'm calling the talk animation in the talk section of the regular character. I guess there's like a very tiny pause when text is getting switched and then she itches for a milisecond into the random animations. Not quite sure how to solve this yet. I was hoping to avoid calling the animation manually each time she talks and then deactivate it again when she stops...

    Forum Fan

    129 Posts


  • #11, by JoelWednesday, 11. November 2015, 21:45 5 years ago
    For future releases an "if ... Animation is playing" or "if character x is talking" might be useful, that way i could just give the portrait idle an additional condition. Maybe it works if i activate a boolean whenever she starts talking and deactivate it again when its finished...

    Forum Fan

    129 Posts

  • #12, by afrlmeWednesday, 11. November 2015, 22:13 5 years ago
    You can do that with the Lua hook function & event handlers I mentioned. Set a condition I mean.

    Checking the animation is more tricky. You need to check if Animation x exists in the temp Active Animations table. You could directly query if ActiveAnimation[x] but that might return an error if animation is not found. The safer albeit slower method would be to iterate through the active animations table to check each entries name against the name of the animation you want to check exists...
    if ActiveAnimations["x"] then
    -- do something...
    end
    1
    2
    3
    4

    -- usage:
    --[[
    if animExists("test") then
    -- do something
    else
    -- do something else
    end
    --]]

    function animExists(anim)
    for i = 1, #(ActiveAnimations) do
    if i:getName() == anim then return true end
    end
    return false -- if anim does not exist return false
    end
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    Imperator

    6932 Posts

  • #13, by JoelWednesday, 11. November 2015, 22:38 5 years ago
    Well, i would've just done it with actions in the talk animation part. Something like

    Set istalking to true
    Wait till person has finished talking
    Set istalking to false

    And then just tell the idle animation to if istalking = false etc etc

    Although this will probably give me the same problem since the interruption is still there smile

    I think the problem is, that my timer which picks a random value doesn't stop when the talk animation plays so while she talks, the timer runs out in the background and already starts the random animation which will flash inbetween textblocks. Maybe i should try to reset it while she is talking or something...

    Forum Fan

    129 Posts

  • #14, by afrlmeWednesday, 11. November 2015, 23:16 5 years ago
    If it's inside of a called by other action then use the quit action action part to kill it & then call the action after talking is done. I'm sure you'll figure it out! wink

    Imperator

    6932 Posts

  • #15, by JoelWednesday, 11. November 2015, 23:31 5 years ago
    Just read in the Wiki about the quit action, i think that's exactly what i need smile Thanks! I got this far, there must be a way to get it perfect for sure. The good thing about experimenting is, that you learn a lot about how this stuff works wink

    Forum Fan

    129 Posts

  • #16, by afrlmeThursday, 12. November 2015, 00:13 5 years ago
    I don't know about that. I just use logic based thinking when it comes to VS & voila. The only thing I had issues with at first was Lua script & how it applied to Visionaire Studio as there wasn't really any examples other than one or two scripts others shared a few years back & the wiki only had syntax (bad syntax) that made no sense & had no working examples of the functions / code - one of reasons why I've focused so heavily on the Lua side of things in the wiki.

    Imperator

    6932 Posts

Write post