nathanhoad / godot_dialogue_manager

A powerful nonlinear dialogue system for Godot
MIT License
2.05k stars 160 forks source link

Loop array to generate responses #575

Closed Corsage closed 3 months ago

Corsage commented 3 months ago

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 commented 3 months ago

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.