Custom Lua using Quest & Item & Acotr dropdown

Announcements, support questions, and discussion for Quest Machine.
Post Reply
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

Hi there,
I'm aware that the Bridge in Dialogue System Support has a dropdown where I can select quest names from a string. It also provides a dropdown for NPC names. I was wondering if I can achieve the same functionality with my custom Lua function. Right now, everything is in string format.
Do you have any hints on how I might accomplish this? Would it be very complicated to implement?
Thanks!
User avatar
Tony Li
Posts: 22465
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by Tony Li »

Hi,

Yes. Create a Custom Lua Function Info asset, and set the parameter dropdowns to Actor or Quest. Example:

customLuaFunctionInfo.png
customLuaFunctionInfo.png (31.55 KiB) Viewed 347 times

In the example above, the selected actor's and quest's Names will be passed to the function.
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

I never really paid close attention to the parameter data types available in the dropdowns for custom Lua functions. I just noticed there’s no int option, so I’ve been using double instead. Now that you’ve pointed out options like Actor and Quest, my question is easily resolved—and it also makes my question seem kind of funny. At the same time, it explains why no one else has asked similar questions on the forums lol.

Thank you so much!
User avatar
Tony Li
Posts: 22465
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by Tony Li »

Glad to help!
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

I would like to ask an additional question: Currently, the parameters include options for Actor and Quest, but why is there no option for Location? I saw in another post that Location is only used as a record, which is a bit of a pity. In my case, aside from Actor and Quest, if Location were integrated with CustomLua, there would be many ways to automate the process when calling it, making it more convenient. Is there a chance this feature might be added in the future?
User avatar
Tony Li
Posts: 22465
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by Tony Li »

Yes, I'll try to get that added in 2.2.51. It just wasn't a priority since no one had requested it yet.
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

Thanks, Tony! That sounds great!
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

Since we're already talking about custom Lua, I wanted to take this chance to ask: In the Bridge's SetQuestNodeState function, is there any specific reason why the Node State parameter isn’t set up as a dropdown? I’m currently just typing the strings manually, which works fine, but I’d prefer having a dropdown to select something like "success"—it’d save me from the typos I keep making!
User avatar
Tony Li
Posts: 22465
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by Tony Li »

Hi,

It's because the Dialogue System doesn't have a concept of quest nodes, which are a Quest Machine-specific thing. So the dropdown helper feature can't provide quest node dropdowns.
User avatar
ds2497
Posts: 64
Joined: Wed Jun 14, 2023 2:13 am

Re: Custom Lua using Quest & Item & Acotr dropdown

Post by ds2497 »

Got it, thanks for answering!
Post Reply