Hello again!
I am wanting to start getting a bit more advanced with my Lua usage. I have a question over lua usage.
It is about additional Actor information. I would like to give actors information in themselves such as a color for their name. What is the best way of doing this? I would love to access these variables in a way such as "Actor["Name"].Color.
Currently I'm doing it this way:
but I'm not sure how to best initialize the value? I would like some sort of editor source such as with the description, shown here:
Thanks for all your help thus far, you're response speed has been unbelievable!
- DC
Lua and Name Colors
Lua and Name Colors
Last edited by dbclutis on Tue Jun 09, 2020 6:14 pm, edited 1 time in total.
Re: Lua and Name Colors
Oh, and one more thing:
Can I use files variables to get animator controllers for portraits? If so, how do they work, is it taking from the resources folder or from assets?
Something like this: or should I simply make it a string?
This is the custom sequencer command code I have right now, but I want to know how I can best use the file variable type: Thanks again!
Can I use files variables to get animator controllers for portraits? If so, how do they work, is it taking from the resources folder or from assets?
Something like this: or should I simply make it a string?
This is the custom sequencer command code I have right now, but I want to know how I can best use the file variable type: Thanks again!
Re: Lua and Name Colors
Well, I solved one of my own problems, so I'll just leave it here to help anyone else who is confused. You can access the other variables through highlighting the actor you want in the "Actors" tab, then all the information will show up in the inspector. After that, just open "All Fields" and press "Template." Now that I've seen it, I realize this was a pretty intuitive solution
Oh well!
Still would love help on the second part though!
Oh well!
Still would love help on the second part though!
Re: Lua and Name Colors
Hi,
Two common ways to handle colors are:
1. Wrap the actor's Display Name in rich text codes, such as:
Under the hood, all fields, including the Files type, are just strings. You can define a new type with a custom appearance by writing a custom field type. For example, you could populate a popup menu with the names of all animator controllers found in Resources folder. Then your custom field type could show that popup menu instead of a plain text field.
Side note on Resources: If you happen to be using Addressables, you can mark the animator controller as an addressable. This way you don't have to put it in Resources. If you use DialogueManager.LoadAsset() instead of Resources.Load(), it will load the asset regardless of whether it's an addressable, an asset in an assetbundle, or an asset in a Resources folder.
Two common ways to handle colors are:
1. Wrap the actor's Display Name in rich text codes, such as:
- Display Name: "<color=red>Red Sonja the Barbarian</color>"
Under the hood, all fields, including the Files type, are just strings. You can define a new type with a custom appearance by writing a custom field type. For example, you could populate a popup menu with the names of all animator controllers found in Resources folder. Then your custom field type could show that popup menu instead of a plain text field.
Side note on Resources: If you happen to be using Addressables, you can mark the animator controller as an addressable. This way you don't have to put it in Resources. If you use DialogueManager.LoadAsset() instead of Resources.Load(), it will load the asset regardless of whether it's an addressable, an asset in an assetbundle, or an asset in a Resources folder.