Hey again.
Simple one this time!
Currently the inline markup tag for changing portraits [pic=<index>] uses its own logic that requires the use of the portrait indexes (unless I missed a function call somewhere). It would be mighty fine if the [pic] markup tag used the SetPortrait logic so that we could use portraits from the resources folder or by name.
[Feature Request] Change [pic=] markup to use SetPortrait logic
- digiwombat
- Posts: 50
- Joined: Sun Jun 16, 2019 4:59 am
Re: [Feature Request] Change [pic=] markup to use SetPortrait logic
Thanks for the suggestion! To maintain compatibility with Chat Mapper, [pic=#] will remain unchanged. Can you get by with SetPortrait()?
- digiwombat
- Posts: 50
- Joined: Sun Jun 16, 2019 4:59 am
Re: [Feature Request] Change [pic=] markup to use SetPortrait logic
SetPortrait() should actually be enough. I think I made an assumption about the inline command that wasn't true. I was imagining something that would allow mid-dialogue shifting like so:
In which case, I'd like to amend my request slightly to be the ability to include a tag or have a bool to set a node to "Append to Previous" which would allow for things like that unless there is currently a way to achieve that that I don't know about.
But thinking about the code I was looking at, it just sets things during the text formatting phase and only uses that.Bob: [pic=Happy]Hey, I didn't think you'd-- [pic=Concerned]Oh... it's you.
In which case, I'd like to amend my request slightly to be the ability to include a tag or have a bool to set a node to "Append to Previous" which would allow for things like that unless there is currently a way to achieve that that I don't know about.
Re: [Feature Request] Change [pic=] markup to use SetPortrait logic
There are currently two ways you can do it:
1. Use RPGMaker codes:
1. Use RPGMaker codes:
- Dialogue Text 1: "[pic=Happy]Hey, I didn't think you'd --"
- Dialogue Text 2: "[pic=Concerned]\>Hey, I didn't think you'd --\< Oh... it's you."
- DialogueText: "Hey, I didn't think you'd -- Oh... it's you."
- Sequence: {{default}}; SetPortrait(Happy); SetPortrait(Concerned)@0.6
- digiwombat
- Posts: 50
- Joined: Sun Jun 16, 2019 4:59 am
Re: [Feature Request] Change [pic=] markup to use SetPortrait logic
The first option would work okay except I'm using SuperTextMesh and it uses its own reader code. As such, I've got a request in for a solution for that with Kai.
Though STM does allow inline event firing so I can actually just run an event to handle it I think via <e=String>. So STM might actually have a solution for this particular issue for me.
Though STM does allow inline event firing so I can actually just run an event to handle it I think via <e=String>. So STM might actually have a solution for this particular issue for me.
Re: [Feature Request] Change [pic=] markup to use SetPortrait logic
Since you're using STM, inline event firing is a good way to go. You can configure the event to call:
DialogueManager.instance.SetActorPortraitSprite(actorName, sprite);
A simple example if your portraits are in a Resources folder:
If you're using addressables, they load asynchronously, so it's a little more complicated. Example:
DialogueManager.instance.SetActorPortraitSprite(actorName, sprite);
A simple example if your portraits are in a Resources folder:
Code: Select all
var sprite = Resources.Load<Sprite>("Happy");
DialogueManager.instance.SetActorPortraitSprite("Player, sprite);
Code: Select all
DialogueManager.LoadAsset("Happy", typeof(Sprite),
(asset) =>
{
var sprite = asset as Sprite;
DialogueManager.instance.SetActorPortraitSprite("Player", sprite);
}