Author Topic: Animated sprites for dialogs (custom dialog script)  (Read 627 times)

Diarandor

  • Hero Member
  • *****
  • Posts: 805
  • Cats are cool! (ΦωΦ)
    • View Profile
Animated sprites for dialogs (custom dialog script)
« on: January 08, 2017, 11:39:57 am »
I was asked by @Porksteak to explain how to use the animation sprites of my custom dialog box:
https://github.com/Diarandor/repository/blob/master/data/scripts/dialog_box.lua
https://www.youtube.com/watch?v=CRRcZjAwMw8
My old script does not explain how to use this feature (I forgot to add these explanations). I post this here so anyone will know how to use it:

An example would be this dialog:
Code: Lua
  1. dialog{
  2.   id = "old_man.thanks",
  3.   animation = "talking",
  4.   animation_sprite = "dialog_old_man",
  5.   text = [[
  6. Thanks for saving my
  7. cats, young man.
  8. See you later!
  9. ]]
  10. }
  11.  

The (optional) sprite of the character has to be located in the path given by the concatenated string:
"dialogs/" .. dialog.animation_sprite
and the animation used is the one given by the string: dialog.animation

MetalZelda

  • Hero Member
  • *****
  • Posts: 511
    • View Profile
Re: Animated sprites for dialogs (custom dialog script)
« Reply #1 on: January 08, 2017, 02:59:06 pm »
The faster way is to do it through the editor  :P


Diarandor

  • Hero Member
  • *****
  • Posts: 805
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Animated sprites for dialogs (custom dialog script)
« Reply #2 on: January 08, 2017, 06:33:18 pm »
Yeah, I had forgotten about that. :o