Assigning image to location

Announcements, support questions, and discussion for the Dialogue System.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Assigning image to location

Post by devalus »

Hi Tony!

How you doing?
I have a question regarding Locations inside the dialogue system.
I'm trying to switch images based on the location of the current conversation and was hoping there's a way to assign images to locations like you can assign images to actors.

I wanted to check with you first before digging on my own, as there's likely a simple solution I'm not seeing.

Thanks for your help!

Cheers,
Amy
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning image to location

Post by Tony Li »

Hi Amy,

The Dialogue Editor window doesn't provide drag-and-drop images for locations like it does for actors. Here are two alternate ideas for locations:

1. Put the location images in a Resources folder. In the Dialogue Editor, add a custom text field to the Location template. For each location, set the custom field to the name of the image in the Resources folder. When you want to show a location's image, load the image using Unity's Resources.Load method or DialogueManager.LoadAsset method. (DialogueManager.LoadAsset is like Resources.Load, but it will also look in asset bundles if you have them in your project.)

2. If you're comfortable with scripting, you can use a custom field type for the custom field to make it easier for you to assign images to the custom field.

I don't recall if you're using the Dialogue System's visual novel starter framework, but it also has a background image system.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Assigning image to location

Post by devalus »

Hi Tony,

Thanks for your help, I'm not using the Visual Novel framework but Textline instead. I was able to set background images utilizing the custom field so that's all sorted. :)

While I have you, a few months back I inquired about simulating the loading of older messages:
viewtopic.php?f=3&t=1957
You mentioned support for EnhancedScroller on Textline, was wondering if that was ever implemented?

Cheers,
Amy
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning image to location

Post by Tony Li »

Hi Amy,

Thanks for reminding me. It's done but not fully tested yet. I had set it aside to finish up version 2.1.7, and I just plain forgot. I'll get it tested and released by the end of the week.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Assigning image to location

Post by devalus »

Awesome news! Thank you :D
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning image to location

Post by Tony Li »

Hi,

Would you like to test this beta version? The EnhancedScroller version is in a subfolder named Supplemental.

Textline_2019-06-21_b1.unitypackage
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Assigning image to location

Post by devalus »

Hi Tony,

So I tested out EnhancedScroller on a new project but am experiencing problems. I followed the instructions in the Readme file but not sure if I did everything correctly, I recorded a gif to show you my result:


The scroll doesn't seem to be working and the conversations is stuck at the top.
Also all the assigned objects in the Textline Dialogue UI Enhanced Scroller panel goes missing after play, not sure if that's supposed to happen.

Cheers,
Amy
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning image to location

Post by Tony Li »

Hi Amy,

Thanks for the GIF. I'll check this out and fix it.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning image to location

Post by Tony Li »

Hi Amy,

I added extra debugging to this version:

Textline_2019-06-23_b1.unitypackage

I tested it in Unity 5.6.6 and Unity 2019.1.5. I did find that, with the new prefab system, it works best to import the unitypackage in three steps:

(0. Import Dialogue System, Menu Framework, and Enhanced Scroller.)

1. Import Textline but exclude Textline / Supplemental / EnhancedScroller Support / Prefabs.

2. Select Edit > Project Settings > Player. Add the scripting define symbol USE_ENHANCEDSCROLLER.

3. Import the Textline package again to import the Prefabs folder.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Assigning image to location

Post by devalus »

Hi Tony,

I thought perhaps my Unity version is responsible for the problem so I updated to the newest Unity 2019.1.8. Tested out the new package in a new project following your instructions but the same thing is happening. The conversation stays at the top and does not scroll down.

Cheers,
Amy
Post Reply