Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop array to generate responses #575

Closed
Corsage opened this issue May 23, 2024 · 1 comment
Closed

Loop array to generate responses #575

Corsage opened this issue May 23, 2024 · 1 comment

Comments

@Corsage
Copy link

Corsage commented May 23, 2024

I looked through the doc and wasn't sure if this was possible or if I'm thinking about this the wrong way.

I wanted to create a generic default dialogue script to my NPC, something of the following:

~ Example

{{ npc_name }}: [[Hi|Hello|Howdy]], this is some dialogue.
{{ npc_name }}: You have {{ quests.size() }} quests.

do i = 0
while i < quests.size()
	- {{ quests[i].title }}
		{{ npc_name }}: {{ quests[i].description }}
	do i += 1

I want to generate the responses for all the possible quests but in this case it will go through the quest responses one-by-one.

I understand I can probably resolve my issue using DialogueManager.create_resource_from_text but was wondering if there was any other way?

@nathanhoad
Copy link
Owner

In this case the only way to generate a fully dynamic responses list is to use the create_resource_from_text method like you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants