lunafromthemoon/RenJS-V2

Add support for side-images

Closed this issue · 6 comments

It would be nice be able to show a picture of character that's talking next to the messageBox, or any place specified in the GUI.yaml.

Ren'py and monogatari calls them side images.
https://developers.monogatari.io/documentation/v/develop/script-actions/dialogs#side-images
https://www.renpy.org/doc/html/side_image.html?highlight=side%20image

I think this is more or less the same as this feature (#11) that I've been meaning to implement. The more I think about this feature the more complex and convoluted it gets:

My main questions now are:

  • Are these portaits/side images associated to the message box and they show and disappear along with it?
  • What syntax can be used to show this side images without contaminating to much the say action
  • Are the side images something different from a look? Let's say, can a character appear on screen and on side image as well?

I think this is more or less the same as this feature (#11) that I've been meaning to implement. The more I think about this feature the more complex and convoluted it gets:

Yes, you can probably merge theese 2 issues.

My main questions now are:

* Are these portaits/side images associated to the message box and they show and disappear along with it?

Yes,, I think so.

* What syntax can be used to show this side images without contaminating to much the say action

It's not pretty, but one way without refactoring to much of the code be something like this:

- portrait deuzi: frowning # from this point deuzi's portrait is frowning
- deuzi says: I'm very mad at you!
- portrait RESET: # resets all portraits for all character to the default one
* Are the side images something different from a look? Let's say, can a character appear on screen and on side image as well?

Yes.

So, since the looks and portraits are different, I think there would be a better way to do this. We already have support for changing expressions during dialog, like:

   - deuzi says happy: Asdf qwer

What this currently does is simply show the character with the new look. Now, what I'm thinking is using this same syntax for the portraits (and trying to keep the original behaviour too, since it's still quite useful):
Now you can define a list of looks for a character, that's just a list with look key and the path to the file. We can do something similar to define portraits, so, like this:

characters:
  deuzi:
    displayName: Deuzilene
    looks:
      normal: assets/characters/Char3NormalSchool.png
      happy: assets/characters/Char3HappySchool.png
      angry: assets/characters/Char3AngrySchool.png
    portraits:
      normal: assets/characters/DeuziPortrait.png
      happy: etc

So now when we do a 'say' action with a named look, if the character has portraits defined, then it will show them as portraits. And if you want to show the characters as usual, you can use the show action.
To give a bit more flexibility, we could have a property in character that will define if you want to use the portraits or not. Let's imagine you want to use portraits only for the "protagonist" and want to change protagonist during game, and also encounter them as normal. You'd have to setup both looks and portraits for all characters and then go around changing this property to set who you want to use portraits and who you don't want to. (probably with a plugin)

Finally, to setup where the portrait is going to be shown, and since this is related very closely with the message box, I guess the best would be to define a portrait position directly in the message box, in the GUI file. Since you can now have different message boxes, you'll be able to set where the portrait is in each one.

What do you think about this way of handling the portraits?

Sounds really good!

So now when we do a 'say' action with a named look, if the character has portraits defined, then it will show them as portraits. And if you want to show the characters as usual, you can use the show action.

What should we do with - deuzi says angry: if the angry portrait does not exist? I think we should show normal.

To give a bit more flexibility, we could have a property in character that will define if you want to use the portraits or not. Let's imagine you want to use portraits only for the "protagonist" and want to change protagonist during game, and also encounter them as normal. You'd have to setup both looks and portraits for all characters and then go around changing this property to set who you want to use portraits and who you don't want to. (probably with a plugin)

We could also do this by only showing portraits for characters that has a portraits: property. That would also make it completely no breaking for old stories.

Finally, to setup where the portrait is going to be shown, and since this is related very closely with the message box, I guess the best would be to define a portrait position directly in the message box, in the GUI file.

I think it would be better if we just did like ctc:

     portrait:
        x: 2800
        y: 118
        asset: asset14 # optional background that is showing behind the portrait when it's visible

Since you can now have different message boxes, you'll be able to set where the portrait is in each one.

Nice, didn't know that. I really need to learn the new UI.

Hey, just to let you know this feature is pretty much implemented already (I need to test a few things but it works like a charm) and will be probably included in the next version (that will come out soon, maybe next week)

The features is now implemented and release as of version 2.3.0!